Skip to content

Commit

Permalink
treewide: snowflake -> flake-parts
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jan 22, 2025
1 parent 8a49d62 commit 7f89607
Show file tree
Hide file tree
Showing 365 changed files with 2,515 additions and 2,252 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ node_modules
.direnv/*
result
.ccls-cache
flake
.pre-commit-config.yaml
.venv
2 changes: 0 additions & 2 deletions checks/deploy/default.nix

This file was deleted.

21 changes: 0 additions & 21 deletions checks/pre-commit-hooks/default.nix

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
lib,
config,
namespace,
inputs,
lib,
root,
khanelinix-lib,
...
}:
let
inherit (lib.${namespace}) enabled;
inherit (khanelinix-lib) enabled;

cfg = config.${namespace}.user;
cfg = config.khanelinix.user;
in
{
imports = lib.optional (inputs.sops-nix ? darwinModules) inputs.sops-nix.darwinModules.sops;

khanelinix = {
archetypes = {
personal = enabled;
Expand All @@ -20,7 +24,7 @@ in
sops = {
enable = true;
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelimac/default.yaml";
defaultSopsFile = root + "/secrets/khanelimac/default.yaml";
};
};

Expand Down Expand Up @@ -72,5 +76,9 @@ in
};
};

nixpkgs.hostPlatform = {
system = "aarch64-darwin";
};

system.stateVersion = 5;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
lib,
namespace,
khanelinix-lib,
...
}:
let
inherit (lib.${namespace}) enabled disabled;
inherit (khanelinix-lib) enabled disabled;
in
{
khanelinix = {
Expand Down Expand Up @@ -79,7 +78,7 @@ in

# sops = {
# enable = true;
# defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelinix/khaneliman/default.yaml";
# defaultSopsFile = root + "/secrets/khanelinix/khaneliman/default.yaml";
# sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
# };
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
config,
lib,
namespace,
root,
khanelinix-lib,
...
}:
let
inherit (lib) mkForce;
inherit (lib.${namespace}) enabled disabled;
inherit (khanelinix-lib) enabled disabled;
in
{
khanelinix = {
Expand All @@ -23,8 +24,8 @@ in
extraAccounts =
let
# Not super secret, just doesn't need to be scraped so easily.
outlook = lib.${namespace}.decode "a2hhbmVsaW1hbjEyQG91dGxvb2suY29t";
personal = lib.${namespace}.decode "YXVzdGluLm0uaG9yc3RtYW5AZ21haWwuY29t";
outlook = khanelinix-lib.decode "a2hhbmVsaW1hbjEyQG91dGxvb2suY29t";
personal = khanelinix-lib.decode "YXVzdGluLm0uaG9yc3RtYW5AZ21haWwuY29t";

in
{
Expand Down Expand Up @@ -84,7 +85,7 @@ in
services = {
sops = {
enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelimac/khaneliman/default.yaml";
defaultSopsFile = root + "/secrets/khanelimac/khaneliman/default.yaml";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
config,
lib,
pkgs,
namespace,
root,
khanelinix-lib,
self,
system,
...
}:
let
inherit (lib) getExe;
inherit (lib.${namespace}) enabled;
inherit (khanelinix-lib) enabled;
in
{
khanelinix = {
Expand All @@ -25,8 +28,8 @@ in
extraAccounts =
let
# Not super secret, just doesn't need to be scraped so easily.
outlook = lib.${namespace}.decode "a2hhbmVsaW1hbjEyQG91dGxvb2suY29t";
personal = lib.${namespace}.decode "YXVzdGluLm0uaG9yc3RtYW5AZ21haWwuY29t";
outlook = khanelinix-lib.decode "a2hhbmVsaW1hbjEyQG91dGxvb2suY29t";
personal = khanelinix-lib.decode "YXVzdGluLm0uaG9yc3RtYW5AZ21haWwuY29t";

in
{
Expand Down Expand Up @@ -74,9 +77,7 @@ in

appendConfig = # bash
''
exec-once = hyprctl setcursor ${config.${namespace}.theme.gtk.cursor.name} ${
builtins.toString config.${namespace}.theme.gtk.cursor.size
}
exec-once = hyprctl setcursor ${config.khanelinix.theme.gtk.cursor.name} ${builtins.toString config.khanelinix.theme.gtk.cursor.size}
'';

prependConfig = # bash
Expand Down Expand Up @@ -190,23 +191,23 @@ in
monitors = [
{
name = "DP-3";
wallpaper = "${pkgs.${namespace}.wallpapers}/share/wallpapers/cat_pacman.png";
wallpaper = "${self.packages.${system}.wallpapers}/share/wallpapers/cat_pacman.png";
}
{
name = "DP-1";
wallpaper = "${pkgs.${namespace}.wallpapers}/share/wallpapers/cat-sound.png";
wallpaper = "${self.packages.${system}.wallpapers}/share/wallpapers/cat-sound.png";
}
];

wallpapers = [
"${pkgs.${namespace}.wallpapers}/share/wallpapers/buttons.png"
"${pkgs.${namespace}.wallpapers}/share/wallpapers/cat_pacman.png"
"${pkgs.${namespace}.wallpapers}/share/wallpapers/cat-sound.png"
"${pkgs.${namespace}.wallpapers}/share/wallpapers/flatppuccin_macchiato.png"
"${pkgs.${namespace}.wallpapers}/share/wallpapers/hashtags-black.png"
"${pkgs.${namespace}.wallpapers}/share/wallpapers/hashtags-new.png"
"${pkgs.${namespace}.wallpapers}/share/wallpapers/hearts.png"
"${pkgs.${namespace}.wallpapers}/share/wallpapers/tetris.png"
"${self.packages.${system}.wallpapers}/share/wallpapers/buttons.png"
"${self.packages.${system}.wallpapers}/share/wallpapers/cat_pacman.png"
"${self.packages.${system}.wallpapers}/share/wallpapers/cat-sound.png"
"${self.packages.${system}.wallpapers}/share/wallpapers/flatppuccin_macchiato.png"
"${self.packages.${system}.wallpapers}/share/wallpapers/hashtags-black.png"
"${self.packages.${system}.wallpapers}/share/wallpapers/hashtags-new.png"
"${self.packages.${system}.wallpapers}/share/wallpapers/hearts.png"
"${self.packages.${system}.wallpapers}/share/wallpapers/tetris.png"
];
};

Expand All @@ -218,7 +219,7 @@ in

sops = {
enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelinix/khaneliman/default.yaml";
defaultSopsFile = root + "/secrets/khanelinix/khaneliman/default.yaml";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
};
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
config,
lib,
namespace,
root,
khanelinix-lib,
...
}:
let
inherit (lib.${namespace}) enabled;
inherit (khanelinix-lib) enabled;
in
{
khanelinix = {
Expand All @@ -26,7 +26,7 @@ in
services = {
sops = {
enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelinix/khaneliman/default.yaml";
defaultSopsFile = root + "/secrets/khanelinix/khaneliman/default.yaml";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
};
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
config,
lib,
namespace,
osConfig,
root,
khanelinix-lib,
...
}:
let
inherit (lib) mkForce;
inherit (lib.${namespace}) enabled disabled;
inherit (khanelinix-lib) enabled disabled;
in
{
khanelinix = {
Expand Down Expand Up @@ -49,7 +50,7 @@ in
services = {
sops = {
enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/CORE/nixos/default.yaml";
defaultSopsFile = root + "/secrets/CORE/nixos/default.yaml";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
};
};
Expand All @@ -71,7 +72,7 @@ in
theme.catppuccin = enabled;
};

sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable {
sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable {
kubernetes = {
path = "${config.home.homeDirectory}/.kube/config";
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, namespace, ... }:
{ lib, khanelinix-lib, ... }:
let
inherit (lib) mkForce;
inherit (lib.${namespace}) enabled disabled;
inherit (khanelinix-lib) enabled disabled;
in
{
imports = [ ./hardware.nix ];
Expand Down Expand Up @@ -46,11 +46,9 @@ in
};
};

# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
nixpkgs.hostPlatform = {
system = "x86_64-linux";
};

system.stateVersion = "23.11"; # Did you read the comment?
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
config,
lib,
namespace,
khanelinix-lib,
...
}:
let
inherit (lib.${namespace}) enabled;
inherit (khanelinix-lib) enabled;
in
{
imports = [
Expand Down Expand Up @@ -80,7 +79,7 @@ in
# TODO: make part of ssh config proper
extraConfig = ''
Host server
User ${config.${namespace}.user.name}
User ${config.khanelinix.user.name}
Hostname austinserver.local
'';
};
Expand All @@ -92,7 +91,7 @@ in
# sops = {
# enable = true;
# sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
# defaultSopsFile = lib.snowfall.fs.get-file "secrets/bruddynix/default.yaml";
# defaultSopsFile = root + "secrets/bruddynix/default.yaml";
# };
};

Expand Down Expand Up @@ -125,6 +124,10 @@ in
NO_POINTER_VIEWPORT = "1";
};

nixpkgs.hostPlatform = {
system = "x86_64-linux";
};

nix.settings = {
cores = 8;
max-jobs = 8;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{ lib, inputs, ... }:
{
imports = lib.optional (inputs.disko ? nixosModules) inputs.disko.nixosModules.disko;

disko.devices.disk = {
main = {
device = "/dev/nvme0n1";
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
config,
lib,
namespace,
root,
khanelinix-lib,
...
}:
let
inherit (lib.${namespace}) enabled;
inherit (khanelinix-lib) enabled;
in
{
imports = [
Expand Down Expand Up @@ -119,7 +119,7 @@ in
sops = {
enable = true;
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelilab/default.yaml";
defaultSopsFile = root + "/secrets/khanelilab/default.yaml";
};
};

Expand Down Expand Up @@ -151,11 +151,9 @@ in
];
};

# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
nixpkgs.hostPlatform = {
system = "x86_64-linux";
};

system.stateVersion = "21.11"; # Did you read the comment?
}
Loading

0 comments on commit 7f89607

Please sign in to comment.