diff --git a/.gitignore b/.gitignore index aa10e55..f18e503 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ result/ .DS_Store rust/target -*.qcow2 diff --git a/assets/wallpaper.jpg b/assets/wallpaper.jpg deleted file mode 100644 index 5cb1a5b..0000000 Binary files a/assets/wallpaper.jpg and /dev/null differ diff --git a/desktop.qcow2 b/desktop.qcow2 deleted file mode 100644 index fdf6ba6..0000000 Binary files a/desktop.qcow2 and /dev/null differ diff --git a/flake.lock b/flake.lock index b278631..7eecfc5 100644 --- a/flake.lock +++ b/flake.lock @@ -16,73 +16,6 @@ "type": "github" } }, - "base16": { - "inputs": { - "fromYaml": "fromYaml" - }, - "locked": { - "lastModified": 1746562888, - "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", - "owner": "SenchoPens", - "repo": "base16.nix", - "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "base16.nix", - "type": "github" - } - }, - "base16-fish": { - "flake": false, - "locked": { - "lastModified": 1622559957, - "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", - "owner": "tomyun", - "repo": "base16-fish", - "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", - "type": "github" - }, - "original": { - "owner": "tomyun", - "repo": "base16-fish", - "type": "github" - } - }, - "base16-helix": { - "flake": false, - "locked": { - "lastModified": 1748408240, - "narHash": "sha256-9M2b1rMyMzJK0eusea0x3lyh3mu5nMeEDSc4RZkGm+g=", - "owner": "tinted-theming", - "repo": "base16-helix", - "rev": "6c711ab1a9db6f51e2f6887cc3345530b33e152e", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-helix", - "type": "github" - } - }, - "base16-vim": { - "flake": false, - "locked": { - "lastModified": 1732806396, - "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", - "owner": "tinted-theming", - "repo": "base16-vim", - "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-vim", - "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", - "type": "github" - } - }, "bats-assert": { "flake": false, "locked": { @@ -115,30 +48,6 @@ "type": "github" } }, - "cosmic-manager": { - "inputs": { - "flake-parts": "flake-parts", - "home-manager": [ - "home-manager" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1744387566, - "narHash": "sha256-O39zTv7LdRgr4Hw38d+eQG2LYpP75rw2XKqTGV5qzgs=", - "owner": "HeitorAugustoLN", - "repo": "cosmic-manager", - "rev": "52d3fdd080a9dd4639948687682a68282fbf0314", - "type": "github" - }, - "original": { - "owner": "HeitorAugustoLN", - "repo": "cosmic-manager", - "type": "github" - } - }, "crane": { "locked": { "lastModified": 1751562746, @@ -161,11 +70,11 @@ ] }, "locked": { - "lastModified": 1751854533, - "narHash": "sha256-U/OQFplExOR1jazZY4KkaQkJqOl59xlh21HP9mI79Vc=", + "lastModified": 1751607816, + "narHash": "sha256-5PtrwjqCIJ4DKQhzYdm8RFePBuwb+yTzjV52wWoGSt4=", "owner": "nix-community", "repo": "disko", - "rev": "16b74a1e304197248a1bc663280f2548dbfcae3c", + "rev": "da6109c917b48abc1f76dd5c9bf3901c8c80f662", "type": "github" }, "original": { @@ -196,22 +105,6 @@ "type": "github" } }, - "firefox-gnome-theme": { - "flake": false, - "locked": { - "lastModified": 1748383148, - "narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=", - "owner": "rafaelmardojai", - "repo": "firefox-gnome-theme", - "rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf", - "type": "github" - }, - "original": { - "owner": "rafaelmardojai", - "repo": "firefox-gnome-theme", - "type": "github" - } - }, "flake-base": { "inputs": { "nixpkgs": [ @@ -251,27 +144,6 @@ } }, "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "cosmic-manager", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "nixos-anywhere", @@ -292,28 +164,7 @@ "type": "github" } }, - "flake-parts_3": { - "inputs": { - "nixpkgs-lib": [ - "stylix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1749398372, - "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_4": { + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "terranix", @@ -401,39 +252,6 @@ "type": "github" } }, - "fromYaml": { - "flake": false, - "locked": { - "lastModified": 1731966426, - "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", - "owner": "SenchoPens", - "repo": "fromYaml", - "rev": "106af9e2f715e2d828df706c386a685698f3223b", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "fromYaml", - "type": "github" - } - }, - "gnome-shell": { - "flake": false, - "locked": { - "lastModified": 1744584021, - "narHash": "sha256-0RJ4mJzf+klKF4Fuoc8VN8dpQQtZnKksFmR2jhWE1Ew=", - "owner": "GNOME", - "repo": "gnome-shell", - "rev": "52c517c8f6c199a1d6f5118fae500ef69ea845ae", - "type": "github" - }, - "original": { - "owner": "GNOME", - "ref": "48.1", - "repo": "gnome-shell", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -479,7 +297,7 @@ "nixos-anywhere": { "inputs": { "disko": "disko_2", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts", "nix-vm-test": "nix-vm-test", "nixos-images": "nixos-images", "nixos-stable": "nixos-stable", @@ -546,11 +364,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1751741127, - "narHash": "sha256-t75Shs76NgxjZSgvvZZ9qOmz5zuBE8buUaYD28BMTxg=", + "lastModified": 1751582995, + "narHash": "sha256-u7ubvtxdTnFPpV27AHpgoKn7qHuE7sgWgza/1oj5nzA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "29e290002bfff26af1db6f64d070698019460302", + "rev": "7a732ed41ca0dd64b4b71b563ab9805a80a7d693", "type": "github" }, "original": { @@ -575,36 +393,9 @@ "type": "github" } }, - "nur": { - "inputs": { - "flake-parts": [ - "stylix", - "flake-parts" - ], - "nixpkgs": [ - "stylix", - "nixpkgs" - ], - "treefmt-nix": "treefmt-nix_3" - }, - "locked": { - "lastModified": 1751320053, - "narHash": "sha256-3m6RMw0FbbaUUa01PNaMLoO7D99aBClmY5ed9V3vz+0=", - "owner": "nix-community", - "repo": "NUR", - "rev": "cbde1735782f9c2bb2c63d5e05fba171a14a4670", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, "root": { "inputs": { "advisory-db": "advisory-db", - "cosmic-manager": "cosmic-manager", "crane": "crane", "disko": "disko", "flake-base": "flake-base", @@ -612,7 +403,6 @@ "nixos-anywhere": "nixos-anywhere", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay", - "stylix": "stylix", "terranix": "terranix", "terranix-hcloud": "terranix-hcloud" } @@ -624,11 +414,11 @@ ] }, "locked": { - "lastModified": 1751942411, - "narHash": "sha256-01uMHCt2U9tP4f24DGch145tT8YQppLY5TC9mWK7O0A=", + "lastModified": 1751769931, + "narHash": "sha256-QR2Rp/41NkA5YxcpvZEKD1S2QE1Pb9U415aK8M/4tJc=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "c587235f892930a61c9e415f0d9792a1b27a41a2", + "rev": "3ac4f630e375177ea8317e22f5c804156de177e8", "type": "github" }, "original": { @@ -660,41 +450,6 @@ "type": "github" } }, - "stylix": { - "inputs": { - "base16": "base16", - "base16-fish": "base16-fish", - "base16-helix": "base16-helix", - "base16-vim": "base16-vim", - "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_3", - "gnome-shell": "gnome-shell", - "nixpkgs": [ - "nixpkgs" - ], - "nur": "nur", - "systems": "systems_2", - "tinted-foot": "tinted-foot", - "tinted-kitty": "tinted-kitty", - "tinted-schemes": "tinted-schemes", - "tinted-tmux": "tinted-tmux", - "tinted-zed": "tinted-zed" - }, - "locked": { - "lastModified": 1752009340, - "narHash": "sha256-6IKc+fdgJ+mWW8pBOVS5MYvttHBhvWSbff/31pG3SAY=", - "owner": "nix-community", - "repo": "stylix", - "rev": "c647aaa1dead3752fb49f226a4f67ae1030d7747", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-25.05", - "repo": "stylix", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -725,28 +480,13 @@ "type": "github" } }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "terranix": { "inputs": { - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_2", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_3" + "systems": "systems_2" }, "locked": { "lastModified": 1749381683, @@ -822,87 +562,6 @@ "type": "github" } }, - "tinted-foot": { - "flake": false, - "locked": { - "lastModified": 1726913040, - "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", - "owner": "tinted-theming", - "repo": "tinted-foot", - "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-foot", - "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", - "type": "github" - } - }, - "tinted-kitty": { - "flake": false, - "locked": { - "lastModified": 1735730497, - "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", - "owner": "tinted-theming", - "repo": "tinted-kitty", - "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-kitty", - "type": "github" - } - }, - "tinted-schemes": { - "flake": false, - "locked": { - "lastModified": 1750770351, - "narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=", - "owner": "tinted-theming", - "repo": "schemes", - "rev": "5a775c6ffd6e6125947b393872cde95867d85a2a", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "schemes", - "type": "github" - } - }, - "tinted-tmux": { - "flake": false, - "locked": { - "lastModified": 1751159871, - "narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=", - "owner": "tinted-theming", - "repo": "tinted-tmux", - "rev": "bded5e24407cec9d01bd47a317d15b9223a1546c", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-tmux", - "type": "github" - } - }, - "tinted-zed": { - "flake": false, - "locked": { - "lastModified": 1751158968, - "narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=", - "owner": "tinted-theming", - "repo": "base16-zed", - "rev": "86a470d94204f7652b906ab0d378e4231a5b3384", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-zed", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -944,28 +603,6 @@ "repo": "treefmt-nix", "type": "github" } - }, - "treefmt-nix_3": { - "inputs": { - "nixpkgs": [ - "stylix", - "nur", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733222881, - "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "49717b5af6f80172275d47a418c9719a31a78b53", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 83f07df..b0f6305 100644 --- a/flake.nix +++ b/flake.nix @@ -40,19 +40,6 @@ nixpkgs.follows = "nixpkgs"; }; }; - stylix = { - url = "github:nix-community/stylix/release-25.05"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - cosmic-manager = { - url = "github:HeitorAugustoLN/cosmic-manager"; - inputs = { - nixpkgs.follows = "nixpkgs"; - home-manager.follows = "home-manager"; - }; - }; }; outputs = @@ -65,26 +52,15 @@ dirs = inputs.nixpkgs.lib.filterAttrs (name: kind: kind == "directory") files; in builtins.attrNames dirs; - inputNixosModules = [ - inputs.disko.nixosModules.disko - inputs.stylix.nixosModules.stylix - ]; - inputHomeModules = [ - inputs.cosmic-manager.homeManagerModules.cosmic-manager - ]; - allowUnfreePackages = [ - "spotify" - "google-chrome" - ]; + profileArgs = { inherit self; }; + profileNames = dirsInPath ./nix/profiles; + nixosModules = dirsInPath ./nix/modules/nixos; + inputModules = [ inputs.disko.nixosModules.disko ]; in (inputs.flake-base.lib.mkFlake { inherit inputs; src = ./.; - channels-config = { - allowUnfreePredicate = pkg: builtins.elem (inputs.nixpkgs.lib.getName pkg) allowUnfreePackages; - }; - systems.modules.nixos = inputNixosModules; - homes.modules = inputHomeModules; + systems.modules.nixos = inputModules; snowfall = { root = ./nix; namespace = "khscodes"; @@ -93,6 +69,18 @@ name = "Machines"; }; }; + modules.nixos = { + default = + { + imports = builtins.map (m: self.nixosModules.${m}) nixosModules ++ inputModules; + } + // (builtins.listToAttrs ( + builtins.map (n: { + name = n; + value = (import ./nix/profiles/${n} profileArgs); + }) profileNames + )); + }; overlays = [ inputs.rust-overlay.overlays.default ]; }) // { diff --git a/nix/checks/hetzner-sets-ipv6/default.nix b/nix/checks/hetzner-sets-ipv6/default.nix index b4db636..68ce8ce 100644 --- a/nix/checks/hetzner-sets-ipv6/default.nix +++ b/nix/checks/hetzner-sets-ipv6/default.nix @@ -12,10 +12,7 @@ pkgs.nixosTest { { ... }: { imports = [ - inputs.self.nixosModules.hetzner - inputs.self.nixosModules.systemd-boot - inputs.self.nixosModules."virtualisation/qemu-guest" - inputs.disko.nixosModules.disko + inputs.self.nixosModules.default sharedModule ]; khscodes.hetzner = { diff --git a/nix/homes/x86_64-linux/khs@desktop.kaareskovgaard.net/default.nix b/nix/homes/x86_64-linux/khs@desktop.kaareskovgaard.net/default.nix deleted file mode 100644 index e607c02..0000000 --- a/nix/homes/x86_64-linux/khs@desktop.kaareskovgaard.net/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ inputs, ... }: -{ - imports = [ "${inputs.self}/nix/profiles/home/khs-linux-desktop.nix" ]; -} diff --git a/nix/homes/x86_64-linux/khs@test.kaareskovgaard.net/default.nix b/nix/homes/x86_64-linux/khs@test.kaareskovgaard.net/default.nix new file mode 100644 index 0000000..740142d --- /dev/null +++ b/nix/homes/x86_64-linux/khs@test.kaareskovgaard.net/default.nix @@ -0,0 +1,4 @@ +{ + snowfallorg.user.name = "khs"; + home.stateVersion = "25.05"; +} diff --git a/nix/modules/home/applications/default.nix b/nix/modules/home/applications/default.nix deleted file mode 100644 index c915eb0..0000000 --- a/nix/modules/home/applications/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ ... }: { } diff --git a/nix/modules/home/desktop/default.nix b/nix/modules/home/desktop/default.nix deleted file mode 100644 index 245f4b5..0000000 --- a/nix/modules/home/desktop/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ lib, ... }: -{ - options.khscodes.desktop = { - enable = lib.mkEnableOption "Generic setting other modules can use to enable/disable stuff when used on desktops"; - }; -} diff --git a/nix/modules/home/khs/applications/alacritty/default.nix b/nix/modules/home/khs/applications/alacritty/default.nix deleted file mode 100644 index 7f66990..0000000 --- a/nix/modules/home/khs/applications/alacritty/default.nix +++ /dev/null @@ -1,113 +0,0 @@ -{ - lib, - pkgs, - config, - system, - ... -}: -let - isDarwin = lib.strings.hasSuffix "-darwin" system; - isLinux = lib.strings.hasSuffix "-darwin" system; - shell = pkgs.bashInteractive; - shellArgs = [ - "-c" - (lib.getExe pkgs.zellij) - ]; -in -{ - config = lib.mkIf (config.khscodes.khs.enable && config.khscodes.desktop.enable) { - programs.alacritty = { - enable = true; - settings = { - terminal = - { - shell = { - program = "${shell}${shell.shellPath}"; - args = shellArgs; - }; - } - // lib.attrsets.optionalAttrs isDarwin { - osc52 = "CopyPaste"; - }; - scrolling = { - history = 100000; - }; - window = { - padding = { - x = 2; - y = 0; - }; - }; - bell = { - animation = "EaseOutExpo"; - }; - hints = { - enabled = [ - { - regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\\\s{-}\\\\^⟨⟩`]+"; - command = if isLinux then "xdg-open" else "open"; - post_processing = true; - mouse = { - enabled = true; - mods = "Control"; - }; - } - ]; - }; - window = { - option_as_alt = "OnlyLeft"; - }; - env = { - TERM = "xterm-256color"; - }; - keyboard.bindings = - [ - { - key = "T"; - mods = "Control|Shift"; - action = "SpawnNewInstance"; - } - { - key = "W"; - mods = "Control|Shift"; - action = "Quit"; - } - { - key = "Plus"; - mods = "Control"; - action = "IncreaseFontSize"; - } - { - key = "Minus"; - mods = "Control"; - action = "DecreaseFontSize"; - } - { - key = "Key0"; - mods = "Control"; - action = "ResetFontSize"; - } - { - key = "C"; - mods = "Super"; - action = "None"; - } - ] - ++ lib.lists.optionals isDarwin [ - { - key = "N"; - mods = "Command"; - action = "SpawnNewInstance"; - } - # Allow zellij to receive the keys, to make copy/pasting work in darwin - { - key = "C"; - mods = "Command"; - action = "ReceiveChar"; - } - ]; - }; - }; - stylix.targets.alacritty.enable = true; - }; -} diff --git a/nix/modules/home/khs/applications/default.nix b/nix/modules/home/khs/applications/default.nix deleted file mode 100644 index ffcd441..0000000 --- a/nix/modules/home/khs/applications/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/nix/modules/home/khs/default.nix b/nix/modules/home/khs/default.nix deleted file mode 100644 index 16400e2..0000000 --- a/nix/modules/home/khs/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ lib, config, ... }: -let - cfg = config.khscodes.khs; -in -{ - options.khscodes.khs = { - enable = lib.mkEnableOption "Enables the settings for KHS"; - }; - - config = lib.mkIf cfg.enable { - snowfallorg.user.name = "khs"; - home.sessionVariables = { - EMAIL = "kaare@kaareskovgaard.net"; - }; - home.stateVersion = "25.05"; - }; -} diff --git a/nix/modules/home/khs/desktop/cosmic/default.nix b/nix/modules/home/khs/desktop/cosmic/default.nix deleted file mode 100644 index e6ee668..0000000 --- a/nix/modules/home/khs/desktop/cosmic/default.nix +++ /dev/null @@ -1,120 +0,0 @@ -{ - config, - inputs, - lib, - ... -}: -let - cosmicLib = import "${inputs.cosmic-manager}/lib" { inherit lib; }; - mkRON = cosmicLib.mkRON; - accent = mkRON "optional" { - red = mkRON "raw" "0.3882353"; - green = mkRON "raw" "0.8156863"; - blue = mkRON "raw" "0.8745098"; - }; - active_hint = 1; - corner_radii = { - radius_0 = mkRON "tuple" [ - 0.0 - 0.0 - 0.0 - 0.0 - ]; - radius_xs = mkRON "tuple" [ - 2.0 - 2.0 - 2.0 - 2.0 - ]; - radius_s = mkRON "tuple" [ - 8.0 - 8.0 - 8.0 - 8.0 - ]; - radius_m = mkRON "tuple" [ - 8.0 - 8.0 - 8.0 - 8.0 - ]; - radius_l = mkRON "tuple" [ - 8.0 - 8.0 - 8.0 - 8.0 - ]; - radius_xl = mkRON "tuple" [ - 8.0 - 8.0 - 8.0 - 8.0 - ]; - }; - gaps = mkRON "tuple" [ - 0 - 1 - ]; -in -{ - config = lib.mkIf (config.khscodes.desktop.enable && config.khscodes.khs.enable) { - wayland.desktopManager.cosmic = { - enable = true; - applets = { - # This is the "dock" - app-list = { - settings = { - enable_drag_source = false; - favorites = [ - "com.system76.CosmicFiles" - "thunderbird" - "Google-chrome" - "Code" - "Alacritty" - "com.system76.CosmicSettings" - "Spotify" - "steam" - ]; - filter_top_levels = mkRON "optional" null; - }; - }; - }; - appearance = { - toolkit = { - interface_density = mkRON "enum" "Standard"; - monospace_font = { - family = config.stylix.fonts.monospace.name; - stretch = mkRON "enum" "Normal"; - style = mkRON "enum" "Normal"; - weight = mkRON "enum" "Normal"; - }; - }; - theme = { - light = { - inherit - accent - active_hint - corner_radii - gaps - ; - }; - dark = { - inherit - accent - active_hint - corner_radii - gaps - ; - }; - }; - }; - compositor = { - active_hint = true; - autotile = true; - autotile_behavior = mkRON "enum" "PerWorkspace"; - cursor_follows_focus = false; - focus_follows_cursor = false; - }; - }; - }; -} diff --git a/nix/modules/home/khs/shell/bash/default.nix b/nix/modules/home/khs/shell/bash/default.nix deleted file mode 100644 index a711dc4..0000000 --- a/nix/modules/home/khs/shell/bash/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, lib, ... }: -{ - config = lib.mkIf config.khscodes.khs.enable { - programs.bash = { - enable = true; - shellAliases = config.khscodes.khs.shell.aliases; - }; - }; -} diff --git a/nix/modules/home/khs/shell/carapace/default.nix b/nix/modules/home/khs/shell/carapace/default.nix deleted file mode 100644 index c2af0bd..0000000 --- a/nix/modules/home/khs/shell/carapace/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ lib, config, ... }: -{ - config = lib.mkIf (config.khscodes.khs.enable && config.khscodes.desktop.enable) { - programs.carapace = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - enableFishIntegration = true; - enableNushellIntegration = true; - }; - }; -} diff --git a/nix/modules/home/khs/shell/default.nix b/nix/modules/home/khs/shell/default.nix deleted file mode 100644 index 05c1cf4..0000000 --- a/nix/modules/home/khs/shell/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ lib, ... }: -{ - options.khscodes.khs.shell = { - aliases = lib.mkOption { - type = lib.types.attrsOf lib.types.str; - description = "Shell aliases to be copied to different shells"; - default = { - add = "git add"; - commit = "git commit"; - st = "git status"; - push = "git push"; - puff = "git puff"; - pull = "git pull"; - purr = "git purr"; - }; - }; - }; -} diff --git a/nix/modules/home/khs/shell/fish/default.nix b/nix/modules/home/khs/shell/fish/default.nix deleted file mode 100644 index ea46533..0000000 --- a/nix/modules/home/khs/shell/fish/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, lib, ... }: -{ - config = lib.mkIf config.khscodes.khs.enable { - programs.fish = { - enable = true; - shellAliases = config.khscodes.khs.shell.aliases; - shellInit = "set fish_greeting"; - }; - }; -} diff --git a/nix/modules/home/khs/shell/nushell/default.nix b/nix/modules/home/khs/shell/nushell/default.nix deleted file mode 100644 index 8069729..0000000 --- a/nix/modules/home/khs/shell/nushell/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: -let - aliases = config.khscodes.khs.shell.aliases; -in -{ - config = lib.mkIf config.khscodes.khs.enable { - programs.nushell = { - enable = true; - shellAliases = aliases; - extraConfig = '' - $env.config = { - show_banner: false - } - ''; - environmentVariables = config.home.sessionVariables; - }; - }; -} diff --git a/nix/modules/home/khs/shell/oh-my-posh/default.nix b/nix/modules/home/khs/shell/oh-my-posh/default.nix deleted file mode 100644 index c181680..0000000 --- a/nix/modules/home/khs/shell/oh-my-posh/default.nix +++ /dev/null @@ -1,158 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.khscodes.khs.shell.oh-my-posh; - unicodeChar = code: builtins.fromJSON ''"\u${code}"''; - powerline_symbol = unicodeChar "e0b0"; - rpowerline_symbol = unicodeChar "e0b2"; - colors = config.lib.stylix.colors.withHashtag; - bright-yellow = config.lib.stylix.colors.yellow or config.lib.stylix.colors.base0a; - bright-yellow-hashtag = "#${bright-yellow}"; - segment_style = { - style = "diamond"; - leading_diamond = ""; - trailing_diamond = powerline_symbol; - }; - rsegment_style = { - style = "diamond"; - leading_diamond = rpowerline_symbol; - trailing_diamond = ""; - }; -in -{ - options.khscodes.khs.shell.oh-my-posh = { - enable = lib.mkEnableOption "Enables oh my posh khs setup"; - }; - config = lib.mkIf cfg.enable { - programs.oh-my-posh = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - enableFishIntegration = true; - enableNushellIntegration = true; - useTheme = null; - settings = { - "$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json"; - "console_title_template" = "{{ .PWD }} @ {{ .HostName }}"; - "blocks" = [ - { - "alignment" = "left"; - "type" = "prompt"; - "segments" = [ - { - type = "shell"; - style = "diamond"; - leading_diamond = ""; - trailing_diamond = powerline_symbol; - "template" = "{{ .Name }}"; - "background" = colors.base00; - "foreground" = colors.blue; - "background_templates" = [ "{{ if eq .Name \"🐠\" }}${colors.base00}{{ end }}" ]; - properties = { - mapped_shell_names = { - "nushell" = "nu"; - "fish" = "🐟"; - "bash" = "$_"; - "zsh" = "%_"; - }; - }; - } - ( - { - "type" = "session"; - "background" = colors.red; - "foreground" = colors.base07; - "template" = "{{ if .SSHSession }} {{ .HostName }} {{ end }}"; - } - // segment_style - ) - ( - { - "type" = "path"; - "background" = colors.blue; - "foreground" = colors.base00; - "template" = " {{ .Path }} "; - "properties" = { - "style" = "full"; - }; - } - // segment_style - ) - ( - { - "type" = "git"; - "background" = colors.green; - "foreground" = colors.base00; - "background_templates" = [ - "{{ if or (.Working.Changed) (.Staging.Changed) }}${colors.yellow}{{ end }}" - ]; - "template" = - "{{ if .Detached }}➦ {{ trunc 7 .Commit.Sha }}{{ else }}{{ .UpstreamIcon }} {{ .Ref }}{{ end }}{{ if .Merge }}|merge{{ end }}{{ if .Rebase }}|rebase{{ end }}{{ if .CherryPick }}|cherrypick{{ end }}{{ if .Ahead}}↑{{ .Ahead }}{{ end }}{{ if .Behind }}↓{{ .Behind }}{{ end }}{{ if .Working.Changed}}●{{ end }}{{ if .Staging.Changed }}✚{{ end }}{{ if .StashCount }} 󰺿{{ end }} "; - "properties" = { - "fetch_status" = true; - "untracked_modes" = { - "/Users/user/Projects/oh-my-posh/" = "no"; - }; - fetch_upstream_icon = true; - upstream = { - git_icon = ""; - }; - "source" = "cli"; - }; - } - // segment_style - ) - ]; - } - { - alignment = "right"; - type = "rprompt"; - "segments" = [ - ( - { - type = "status"; - background = colors.base01; - background_templates = [ "{{ if .Error }}${colors.red}{{ end }}" ]; - foreground = colors.green; - foreground_templates = [ "{{ if .Error}}${bright-yellow-hashtag}{{ end }}" ]; - template = " {{ if .Error }}✘ {{ .Code }}{{ else }}✔{{ end }} "; - properties = { - always_enabled = true; - }; - } - // rsegment_style - ) - ( - { - type = "executiontime"; - foreground = colors.base00; - background = colors.yellow; - template = " ⌚{{ .FormattedMs }} "; - properties = { - always_enabled = false; - threshold = 3000; - style = "round"; - }; - } - // rsegment_style - ) - # Rendering this screws up spacing of the beginning of the prompt - ( - { - type = "nix-shell"; - background = colors.blue; - foreground = colors.base00; - template = " {{ .Type }} "; - } - // rsegment_style - ) - ]; - } - ]; - "terminal_background" = colors.base00; - "disable_notice" = true; - "final_space" = true; - "version" = 2; - }; - }; - }; -} diff --git a/nix/modules/home/khs/shell/zellij/default.nix b/nix/modules/home/khs/shell/zellij/default.nix deleted file mode 100644 index d5bf5fe..0000000 --- a/nix/modules/home/khs/shell/zellij/default.nix +++ /dev/null @@ -1,505 +0,0 @@ -{ - lib, - config, - pkgs, - system, - ... -}: -let - isDarwin = lib.strings.hasSuffix "-darwin" system; -in -{ - config = lib.mkIf (config.khscodes.khs.enable && config.khscodes.desktop.enable) { - # In built styles look off to me. And when alacritty is themed, - # this appears to not be needed. - stylix.targets.zellij.enable = false; - programs.zellij = { - enable = true; - settings = { - default_shell = lib.getExe pkgs.fish; - copy_on_select = false; - mouse_mode = true; - show_startup_tips = false; - scroll_buffer_size = 100000; - support_kitty_keyboard_protocol = true; - "keybinds clear-defaults=true" = { - normal = lib.attrsets.optionalAttrs isDarwin { - "bind \"Super c\"" = { - Copy = [ ]; - }; - }; - locked = { - "bind \"Ctrl g\"" = { - SwitchToMode = "Normal"; - }; - }; - resize = { - "bind \"Ctrl n\"" = { - SwitchToMode = "Normal"; - }; - "bind \"h\" \"Left\"" = { - Resize = "Increase Left"; - }; - "bind \"j\" \"Down\"" = { - Resize = "Increase Down"; - }; - "bind \"k\" \"Up\"" = { - Resize = "Increase Up"; - }; - "bind \"l\" \"Right\"" = { - Resize = "Increase Right"; - }; - "bind \"H\"" = { - Resize = "Decrease Left"; - }; - "bind \"J\"" = { - Resize = "Decrease Down"; - }; - "bind \"K\"" = { - Resize = "Decrease Up"; - }; - "bind \"L\"" = { - Resize = "Decrease Right"; - }; - "bind \"=\" \"+\"" = { - Resize = "Increase"; - }; - "bind \"-\"" = { - Resize = "Decrease"; - }; - }; - pane = { - "bind \"Ctrl\ p\"" = { - SwitchToMode = "Normal"; - }; - "bind \"h\" \"Left\"" = { - MoveFocus = "Left"; - }; - "bind \"l\" \"Right\"" = { - MoveFocus = "Right"; - }; - "bind \"j\" \"Down\"" = { - MoveFocus = "Down"; - }; - "bind \"k\" \"Up\"" = { - MoveFocus = "Up"; - }; - "bind \"p\"" = { - SwitchFocus = [ ]; - }; - "bind \"n\"" = { - NewPane = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"d\"" = { - NewPane = "Down"; - SwitchToMode = "Normal"; - }; - "bind \"r\"" = { - NewPane = "Right"; - SwitchToMode = "Normal"; - }; - "bind \"x\"" = { - CloseFocus = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"f\"" = { - ToggleFocusFullscreen = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"z\"" = { - TogglePaneFrames = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"w\"" = { - ToggleFloatingPanes = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"e\"" = { - TogglePaneEmbedOrFloating = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"c\"" = { - SwitchToMode = "RenamePane"; - PaneNameInput = 0; - }; - }; - move = { - "bind \"Ctrl h\"" = { - SwitchToMode = "Normal"; - }; - "bind \"n\" \"Tab\"" = { - MovePane = [ ]; - }; - "bind \"p\"" = { - MovePaneBackwards = [ ]; - }; - "bind \"h\" \"Left\"" = { - MovePane = "Left"; - }; - "bind \"j\" \"Down\"" = { - MovePane = "Down"; - }; - "bind \"k\" \"Up\"" = { - MovePane = "Up"; - }; - "bind \"l\" \"Right\"" = { - MovePane = "Right"; - }; - }; - tab = { - "bind \"Alt t\"" = { - SwitchToMode = "Normal"; - }; - "bind \"r\"" = { - SwitchToMode = "RenameTab"; - TabNameInput = 0; - }; - "bind \"h\" \"Left\" \"Up\" \"k\"" = { - GoToPreviousTab = [ ]; - }; - "bind \"l\" \"Right\" \"Down\" \"j\"" = { - GoToNextTab = [ ]; - }; - "bind \"n\"" = { - NewTab = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"x\"" = { - CloseTab = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"s\"" = { - ToggleActiveSyncTab = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"1\"" = { - GoToTab = 1; - SwitchToMode = "Normal"; - }; - "bind \"2\"" = { - GoToTab = 2; - SwitchToMode = "Normal"; - }; - "bind \"3\"" = { - GoToTab = 3; - SwitchToMode = "Normal"; - }; - "bind \"4\"" = { - GoToTab = 4; - SwitchToMode = "Normal"; - }; - "bind \"5\"" = { - GoToTab = 5; - SwitchToMode = "Normal"; - }; - "bind \"6\"" = { - GoToTab = 6; - SwitchToMode = "Normal"; - }; - "bind \"7\"" = { - GoToTab = 7; - SwitchToMode = "Normal"; - }; - "bind \"8\"" = { - GoToTab = 8; - SwitchToMode = "Normal"; - }; - "bind \"9\"" = { - GoToTab = 9; - SwitchToMode = "Normal"; - }; - "bind \"Tab\"" = { - ToggleTab = [ ]; - }; - }; - scroll = { - "bind \"Ctrl s\"" = { - SwitchToMode = "Normal"; - }; - "bind \"e\"" = { - EditScrollback = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"s\"" = { - SwitchToMode = "EnterSearch"; - SearchInput = 0; - }; - "bind \"Ctrl c\"" = { - ScrollToBottom = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"j\" \"Down\"" = { - ScrollDown = [ ]; - }; - "bind \"k\" \"Up\"" = { - ScrollUp = [ ]; - }; - "bind \"Ctrl f\" \"PageDown\" \"Right\" \"l\"" = { - PageScrollDown = [ ]; - }; - "bind \"Ctrl b\" \"PageUp\" \"Left\" \"h\"" = { - PageScrollUp = [ ]; - }; - "bind \"d\"" = { - HalfPageScrollDown = [ ]; - }; - "bind \"u\"" = { - HalfPageScrollUp = [ ]; - }; - }; - search = { - "bind \"Ctrl s\"" = { - SwitchToMode = "Normal"; - }; - "bind \"Ctrl c\"" = { - ScrollToBottom = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"j\" \"Down\"" = { - ScrollDown = [ ]; - }; - "bind \"k\" \"Up\"" = { - ScrollUp = [ ]; - }; - "bind \"Ctrl f\" \"PageDown\" \"Right\" \"l\"" = { - PageScrollDown = [ ]; - }; - "bind \"Ctrl b\" \"PageUp\" \"Left\" \"h\"" = { - PageScrollUp = [ ]; - }; - "bind \"d\"" = { - HalfPageScrollDown = [ ]; - }; - "bind \"u\"" = { - HalfPageScrollUp = [ ]; - }; - "bind \"n\"" = { - Search = "down"; - }; - "bind \"p\"" = { - Search = "up"; - }; - "bind \"c\"" = { - SearchToggleOption = "CaseSensitivity"; - }; - "bind \"w\"" = { - SearchToggleOption = "Wrap"; - }; - "bind \"o\"" = { - SearchToggleOption = "WholeWord"; - }; - }; - entersearch = { - "bind \"Ctrl c\" \"Esc\"" = { - SwitchToMode = "Scroll"; - }; - "bind \"Enter\"" = { - SwitchToMode = "Search"; - }; - }; - renametab = { - "bind \"Ctrl c\"" = { - SwitchToMode = "Normal"; - }; - "bind \"Esc\"" = { - UndoRenameTab = [ ]; - SwitchToMode = "Tab"; - }; - }; - renamepane = { - "bind \"Ctrl c\"" = { - SwitchToMode = "Normal"; - }; - "bind \"Esc\"" = { - UndoRenamePane = [ ]; - SwitchToMode = "Pane"; - }; - }; - session = { - "unbind \"Ctrl o\"" = [ ]; - "bind \"Ctrl q\"" = { - SwitchToMode = "Normal"; - }; - "bind \"Ctrl s\"" = { - SwitchToMode = "Scroll"; - }; - "bind \"d\"" = { - Detach = [ ]; - }; - }; - tmux = { - "bind \"[\"" = { - SwitchToMode = "Scroll"; - }; - "bind \"Ctrl b\"" = { - Write = 2; - SwitchToMode = "Normal"; - }; - "bind \"\\\"\"" = { - NewPane = "Down"; - SwitchToMode = "Normal"; - }; - "bind \"%\"" = { - NewPane = "Right"; - SwitchToMode = "Normal"; - }; - "bind \"z\"" = { - ToggleFocusFullscreen = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"c\"" = { - NewTab = [ ]; - SwitchToMode = "Normal"; - }; - "bind \",\"" = { - SwitchToMode = "RenameTab"; - }; - "bind \"p\"" = { - GoToPreviousTab = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"n\"" = { - GoToNextTab = [ ]; - SwitchToMode = "Normal"; - }; - "bind \"Left\"" = { - MoveFocus = "Left"; - SwitchToMode = "Normal"; - }; - "bind \"Right\"" = { - MoveFocus = "Right"; - SwitchToMode = "Normal"; - }; - "bind \"Down\"" = { - MoveFocus = "Down"; - SwitchToMode = "Normal"; - }; - "bind \"Up\"" = { - MoveFocus = "Up"; - SwitchToMode = "Normal"; - }; - "bind \"h\"" = { - MoveFocus = "Left"; - SwitchToMode = "Normal"; - }; - "bind \"l\"" = { - MoveFocus = "Right"; - SwitchToMode = "Normal"; - }; - "bind \"j\"" = { - MoveFocus = "Down"; - SwitchToMode = "Normal"; - }; - "bind \"k\"" = { - MoveFocus = "Up"; - SwitchToMode = "Normal"; - }; - "bind \"o\"" = { - FocusNextPane = [ ]; - }; - "bind \"d\"" = { - Detach = [ ]; - }; - "bind \"Space\"" = { - NextSwapLayout = [ ]; - }; - "bind \"x\"" = { - CloseFocus = [ ]; - SwitchToMode = "Normal"; - }; - }; - "shared_except \"locked\"" = { - "bind \"Ctrl g\"" = { - SwitchToMode = "Locked"; - }; - "bind \"Alt n\"" = { - NewPane = [ ]; - }; - "bind \"Alt h\" \"Alt Left\"" = { - MoveFocusOrTab = "Left"; - }; - "bind \"Alt l\" \"Alt Right\"" = { - MoveFocusOrTab = "Right"; - }; - "bind \"Alt j\" \"Alt Down\"" = { - MoveFocus = "Down"; - }; - "bind \"Alt k\" \"Alt Up\"" = { - MoveFocus = "Up"; - }; - "bind \"Alt =\" \"Alt +\"" = { - Resize = "Increase"; - }; - "bind \"Alt -\"" = { - Resize = "Decrease"; - }; - "bind \"Alt [\"" = { - PreviousSwapLayout = [ ]; - }; - "bind \"Alt ]\"" = { - NextSwapLayout = [ ]; - }; - }; - "shared_except \"normal\" \"locked\"" = { - "bind \"Enter\" \"Esc\"" = { - SwitchToMode = "Normal"; - }; - }; - "shared_except \"pane\" \"locked\"" = { - "bind \"Ctrl p\"" = { - SwitchToMode = "Pane"; - }; - }; - "shared_except \"resize\" \"locked\"" = { - "bind \"Ctrl n\"" = { - SwitchToMode = "Resize"; - }; - }; - "shared_except \"scroll\" \"locked\"" = { - "bind \"Ctrl s\"" = { - SwitchToMode = "Scroll"; - }; - }; - "shared_except \"session\" \"locked\"" = { - unbind = "Ctrl o"; - "bind \"Ctrl q\"" = { - SwitchToMode = "Session"; - }; - }; - "shared_except \"tab\" \"locked\"" = { - "bind \"Alt t\"" = { - SwitchToMode = "Tab"; - }; - }; - "shared_except \"move\" \"locked\"" = { - "bind \"Ctrl h\"" = { - SwitchToMode = "Move"; - }; - }; - "shared_except \"tmux\" \"locked\"" = { - "bind \"Ctrl b\"" = { - SwitchToMode = "Tmux"; - }; - }; - }; - plugins = { - tab-bar = { - path = "tab-bar"; - }; - status-bar = { - path = "status-bar"; - }; - strider = { - path = "strider"; - }; - compact-bar = { - path = "compact-bar"; - }; - }; - simplified-ui = false; - pane_frames = false; - }; - }; - }; -} diff --git a/nix/modules/home/khs/shell/zsh/default.nix b/nix/modules/home/khs/shell/zsh/default.nix deleted file mode 100644 index 1800055..0000000 --- a/nix/modules/home/khs/shell/zsh/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, lib, ... }: -{ - config = lib.mkIf config.khscodes.khs.enable { - programs.zsh = { - enable = true; - shellAliases = config.khscodes.khs.shell.aliases; - }; - }; -} diff --git a/nix/modules/nixos/networking/fqdn/default.nix b/nix/modules/nixos/fqdn/default.nix similarity index 86% rename from nix/modules/nixos/networking/fqdn/default.nix rename to nix/modules/nixos/fqdn/default.nix index bc185cc..73cf099 100644 --- a/nix/modules/nixos/networking/fqdn/default.nix +++ b/nix/modules/nixos/fqdn/default.nix @@ -4,10 +4,10 @@ ... }: let - cfg = config.khscodes.networking.fqdn; + cfg = config.khscodes.fqdn; in { - options.khscodes.networking.fqdn = lib.mkOption { + options.khscodes.fqdn = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; description = "Sets the FQDN of the machine. This is a prerequisite for many modules to be used"; diff --git a/nix/modules/nixos/infrastructure/hetzner-instance/default.nix b/nix/modules/nixos/infrastructure/hetzner-instance/default.nix index d65e044..27f9670 100644 --- a/nix/modules/nixos/infrastructure/hetzner-instance/default.nix +++ b/nix/modules/nixos/infrastructure/hetzner-instance/default.nix @@ -6,7 +6,7 @@ }: let cfg = config.khscodes.infrastructure.hetzner-instance; - fqdn = config.khscodes.networking.fqdn; + fqdn = config.khscodes.fqdn; firewallTcpRules = lib.lists.map (p: { direction = "in"; protocol = "tcp"; @@ -205,8 +205,8 @@ in { assertions = [ { - assertion = config.khscodes.networking.fqdn != null; - message = "Must set config.khscodes.networking.fqdn when using opentofu"; + assertion = config.khscodes.fqdn != null; + message = "Must set config.khscodes.fqdn when using opentofu"; } ]; diff --git a/nix/modules/nixos/infrastructure/khs-openstack-instance/default.nix b/nix/modules/nixos/infrastructure/khs-openstack-instance/default.nix index 4478c81..110b669 100644 --- a/nix/modules/nixos/infrastructure/khs-openstack-instance/default.nix +++ b/nix/modules/nixos/infrastructure/khs-openstack-instance/default.nix @@ -6,7 +6,7 @@ }: let cfg = config.khscodes.infrastructure.khs-openstack-instance; - fqdn = config.khscodes.networking.fqdn; + fqdn = config.khscodes.fqdn; firewallTcpRules = lib.lists.flatten ( lib.lists.map (p: [ { @@ -232,8 +232,8 @@ in { assertions = [ { - assertion = config.khscodes.networking.fqdn != null; - message = "Must set config.khscodes.networking.fqdn when using opentofu"; + assertion = config.khscodes.fqdn != null; + message = "Must set config.khscodes.fqdn when using opentofu"; } ]; diff --git a/nix/modules/nixos/networking/default.nix b/nix/modules/nixos/networking/default.nix deleted file mode 100644 index c915eb0..0000000 --- a/nix/modules/nixos/networking/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ ... }: { } diff --git a/nix/modules/nixos/security/default.nix b/nix/modules/nixos/security/default.nix deleted file mode 100644 index c915eb0..0000000 --- a/nix/modules/nixos/security/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ ... }: { } diff --git a/nix/modules/nixos/security/yubikey/default.nix b/nix/modules/nixos/security/yubikey/default.nix deleted file mode 100644 index 889c91e..0000000 --- a/nix/modules/nixos/security/yubikey/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - cfg = config.khscodes.security.yubikey; -in -{ - options.khscodes.security.yubikey = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; - }; - config = lib.mkIf cfg.enable { - services.pcscd.enable = true; - services.udev.packages = [ pkgs.yubikey-personalization ]; - - environment.systemPackages = [ - pkgs.yubikey-manager - pkgs.yubico-piv-tool - ]; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - }; -} diff --git a/nix/modules/nixos/users/default.nix b/nix/modules/nixos/users/default.nix deleted file mode 100644 index c915eb0..0000000 --- a/nix/modules/nixos/users/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ ... }: { } diff --git a/nix/modules/nixos/users/khs/default.nix b/nix/modules/nixos/users/khs/default.nix deleted file mode 100644 index 527be3e..0000000 --- a/nix/modules/nixos/users/khs/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ lib, config, ... }: -let - cfg = config.khscodes.users.khs; -in -{ - options.khscodes.users.khs = { - enable = lib.mkEnableOption "Enables settings for the khs user. This should be used in conjunction with homes"; - }; - - config = lib.mkIf cfg.enable { - snowfallorg.users.khs.admin = true; - users.users.khs = { - # TODO: What should I do wrt. ensuring the passwords are consistent? - # Maybe set them through OpenBAO and some service? - initialPassword = "changeme"; - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCqY0FHnWFKfLG2yfgr4qka5sR9CK+EMAhzlHUkaQyWHTKD+G0/vC/fNPyL1VV3Dxc/ajxGuPzVE+mBMoyxazL3EtuCDOVvHJ5CR+MUSEckg/DDwcGHqy6rC8BvVVpTAVL04ByQdwFnpE1qNSBaQLkxaFVdtriGKkgMkc7+UNeYX/bv7yn+APqfP1a3xr6wdkSSdO8x4N2jsSygOIMx10hLyCV4Ueu7Kp8Ww4rGY8j5o7lKJhbgfItBfSOuQHdppHVF/GKYRhdnK6Y2fZVYbhq4KipUtclbZ6O/VYd8/sOO98+LMm7cOX+K35PQjUpYgcoNy5+Sw3CNS/NHn4JvOtTaUEYP7fK6c9LhMULOO3T7Cm6TMdiFjUKHkyG+s2Mu/LXJJoilw571zwuh6chkeitW8+Ht7k0aPV96kNEvTdoXwLhBifVEaChlAsLAzSUjUq+YYCiXVk0VIXCZQWKj8LoVNTmaqDksWwbcT64fw/FpVC0N18WHbKcFUEIW/O4spJMa30CQwf9FeqpoWoaF1oRClCSDPvX0AauCu0JcmRinz1/JmlXljnXWbSfm20/V+WyvktlI0wTD0cdpNuSasT9vS77YfJ8nutcWWZKSkCj4R4uHeCNpDTX5YXzapy7FxpM9ANCXLIvoGX7Yafba2Po+er7SSsUIY1AsnBBr8ZoDVw==" - ]; - }; - }; -} diff --git a/nix/modules/nixos/virtualisation/default.nix b/nix/modules/nixos/virtualisation/default.nix index c915eb0..7817ed4 100644 --- a/nix/modules/nixos/virtualisation/default.nix +++ b/nix/modules/nixos/virtualisation/default.nix @@ -1 +1,10 @@ -{ ... }: { } +# TODO: Why is this needed just for this directory? +# In the other directories this will create the modules twice. +# Perhaps because there's only a single sub directory here? +args@{ lib, ... }: +let + modules = lib.khscodes.dirsInPath ./.; +in +{ + imports = lib.lists.map (d: import d args) modules; +} diff --git a/nix/modules/nixos/virtualisation/qemu-guest/default.nix b/nix/modules/nixos/virtualisation/qemu-guest/default.nix index 4ab6ae4..a902f0e 100644 --- a/nix/modules/nixos/virtualisation/qemu-guest/default.nix +++ b/nix/modules/nixos/virtualisation/qemu-guest/default.nix @@ -6,41 +6,11 @@ }: let cfg = config.khscodes.virtualisation.qemu-guest; - rng = "-device virtio-rng-pci,rng=rng0 -object rng-random,id=rng0,filename=/dev/urandom"; - spice = [ - "-spice disable-ticketing=on,gl=on,unix=on,addr=/tmp/spice.sock" - "-device virtio-serial-pci" - "-chardev socket,id=agent0,path=vm.sock,server=on,wait=off" - "-device virtserialport,chardev=agent0,name=org.qemu.guest_agent.0" - "-chardev spicevmc,id=vdagent0,name=vdagent" - "-device virtserialport,chardev=vdagent0,name=com.redhat.spice.0" - "-chardev spiceport,id=webdav0,name=org.spice-space.webdav.0" - "-device virtserialport,chardev=webdav0,name=org.spice-space.webdav.0" - ]; in { options.khscodes.virtualisation.qemu-guest = { enable = lib.mkEnableOption "Configures machine with NixOS profile for qemu guest"; - enableWhenVmTarget = lib.mkEnableOption "Enables some enhancement settings when building as a vm"; }; - imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ]; - - config = lib.mkIf cfg.enableWhenVmTarget { - virtualisation = { - vmVariant = { - services.qemuGuest.enable = true; - services.spice-vdagentd.enable = true; - khscodes.virtualisation.qemu-guest.enable = true; - }; - memorySize = 1024 * 8; - qemu = { - options = [ - "-smp 8" - "-vga none -device virtio-gpu-gl,hostmem=2G,blob=true,venus=true" - rng - ] ++ spice; - }; - }; - }; + config = lib.mkIf cfg.enable (import "${modulesPath}/profiles/qemu-guest.nix" { }); } diff --git a/nix/modules/nixos/virtualisation/qemu-guest/profile.nix b/nix/modules/nixos/virtualisation/qemu-guest/profile.nix deleted file mode 100644 index 77560ee..0000000 --- a/nix/modules/nixos/virtualisation/qemu-guest/profile.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - config, - lib, - modulesPath, - ... -}: -let - cfg = config.khscodes.virtualisation.qemu-guest; -in -{ - config = lib.mkIf cfg.enable (import "${modulesPath}/profiles/qemu-guest.nix" { }); -} diff --git a/nix/packages/start-vm/default.nix b/nix/packages/start-vm/default.nix deleted file mode 100644 index 7cd65c4..0000000 --- a/nix/packages/start-vm/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, inputs, ... }: -pkgs.writeShellApplication { - name = "start-vm"; - runtimeInputs = [ - pkgs.spice-gtk - pkgs.uutils-findutils - ]; - text = '' - host="''${1:-}" - clean="''${2:-no}" - if [[ "$clean" == "clean" ]]; then - find . -type f -name '*.qcow2' -delete - fi - run_vm="$(nix build --no-link --print-out-paths '${inputs.self}#nixosConfigurations."'"$host"'".config.system.build.vm' --show-trace)" - - # shellcheck disable=SC2211 - # shellcheck disable=SC2086 - $run_vm/bin/* & - pid=$! - trap 'kill $pid' EXIT - sleep 2 - spicy --title "$host" --uri=spice+unix:///tmp/spice.sock - ''; -} diff --git a/nix/profiles/nixos/hetzner-server.nix b/nix/profiles/hetzner-server.nix similarity index 76% rename from nix/profiles/nixos/hetzner-server.nix rename to nix/profiles/hetzner-server.nix index ae5cccc..da9068b 100644 --- a/nix/profiles/nixos/hetzner-server.nix +++ b/nix/profiles/hetzner-server.nix @@ -1,6 +1,5 @@ { ... }: { - imports = [ ./nix-base.nix ]; config.khscodes = { hetzner.enable = true; services.openssh.enable = true; diff --git a/nix/profiles/home/khs-base.nix b/nix/profiles/home/khs-base.nix deleted file mode 100644 index 11421cd..0000000 --- a/nix/profiles/home/khs-base.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - khscodes.khs.enable = true; - khscodes.khs.shell.oh-my-posh.enable = true; -} diff --git a/nix/profiles/home/khs-desktop.nix b/nix/profiles/home/khs-desktop.nix deleted file mode 100644 index 8dd0230..0000000 --- a/nix/profiles/home/khs-desktop.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ ./khs-base.nix ]; - home.packages = [ - pkgs.bitwarden-cli - pkgs.nerd-fonts.inconsolata - pkgs.google-chrome - ]; - khscodes = { - desktop.enable = true; - }; -} diff --git a/nix/profiles/home/khs-linux-desktop.nix b/nix/profiles/home/khs-linux-desktop.nix deleted file mode 100644 index 3241e5b..0000000 --- a/nix/profiles/home/khs-linux-desktop.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ ./khs-desktop.nix ]; - home.packages = [ pkgs.spotify ]; -} diff --git a/nix/profiles/nixos/khs-openstack-server.nix b/nix/profiles/khs-openstack-server.nix similarity index 76% rename from nix/profiles/nixos/khs-openstack-server.nix rename to nix/profiles/khs-openstack-server.nix index 02e2333..dafafd2 100644 --- a/nix/profiles/nixos/khs-openstack-server.nix +++ b/nix/profiles/khs-openstack-server.nix @@ -1,6 +1,5 @@ { ... }: { - imports = [ ./nix-base.nix ]; config.khscodes = { openstack.enable = true; services.openssh.enable = true; diff --git a/nix/profiles/nixos/nix-base.nix b/nix/profiles/nix-base.nix similarity index 100% rename from nix/profiles/nixos/nix-base.nix rename to nix/profiles/nix-base.nix diff --git a/nix/profiles/nixos/khs-base.nix b/nix/profiles/nixos/khs-base.nix deleted file mode 100644 index 07d84db..0000000 --- a/nix/profiles/nixos/khs-base.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ ./nix-base.nix ]; - snowfallorg.users.khs.admin = true; - users.users.khs = { - # TODO: Figure out how to provision password changes to servers from VAULT - initialPassword = "changeme"; - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCqY0FHnWFKfLG2yfgr4qka5sR9CK+EMAhzlHUkaQyWHTKD+G0/vC/fNPyL1VV3Dxc/ajxGuPzVE+mBMoyxazL3EtuCDOVvHJ5CR+MUSEckg/DDwcGHqy6rC8BvVVpTAVL04ByQdwFnpE1qNSBaQLkxaFVdtriGKkgMkc7+UNeYX/bv7yn+APqfP1a3xr6wdkSSdO8x4N2jsSygOIMx10hLyCV4Ueu7Kp8Ww4rGY8j5o7lKJhbgfItBfSOuQHdppHVF/GKYRhdnK6Y2fZVYbhq4KipUtclbZ6O/VYd8/sOO98+LMm7cOX+K35PQjUpYgcoNy5+Sw3CNS/NHn4JvOtTaUEYP7fK6c9LhMULOO3T7Cm6TMdiFjUKHkyG+s2Mu/LXJJoilw571zwuh6chkeitW8+Ht7k0aPV96kNEvTdoXwLhBifVEaChlAsLAzSUjUq+YYCiXVk0VIXCZQWKj8LoVNTmaqDksWwbcT64fw/FpVC0N18WHbKcFUEIW/O4spJMa30CQwf9FeqpoWoaF1oRClCSDPvX0AauCu0JcmRinz1/JmlXljnXWbSfm20/V+WyvktlI0wTD0cdpNuSasT9vS77YfJ8nutcWWZKSkCj4R4uHeCNpDTX5YXzapy7FxpM9ANCXLIvoGX7Yafba2Po+er7SSsUIY1AsnBBr8ZoDVw==" - ]; - }; - environment = { - systemPackages = [ pkgs.openbao ]; - variables = { - BAO_ADDR = "https://vault.kaareskovgaard.net"; - }; - }; -} diff --git a/nix/profiles/nixos/khs-desktop.nix b/nix/profiles/nixos/khs-desktop.nix deleted file mode 100644 index 8e653a0..0000000 --- a/nix/profiles/nixos/khs-desktop.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - lib, - pkgs, - inputs, - ... -}: -{ - imports = [ ./khs-base.nix ]; - khscodes.virtualisation.qemu-guest.enableWhenVmTarget = true; - - services.desktopManager.cosmic.enable = true; - services.displayManager.cosmic-greeter.enable = true; - - stylix = { - enable = true; - autoEnable = false; - image = "${inputs.self}/assets/khs-desktop-wallpaper.jpg"; - base16Scheme = lib.mkDefault "${pkgs.base16-schemes}/share/themes/solarized-dark.yaml"; - targets.console.enable = true; - fonts = { - monospace = { - package = pkgs.nerd-fonts.inconsolata; - name = "Inconsolata Nerd Font"; - }; - sizes = { - terminal = 14; - }; - }; - }; - console = { - enable = true; - font = "${pkgs.powerline-fonts}/share/consolefonts/ter-powerline-v24b.psf.gz"; - packages = [ - pkgs.terminus_font - pkgs.powerline-fonts - ]; - }; -} diff --git a/nix/profiles/nixos/khs-server.nix b/nix/profiles/nixos/khs-server.nix deleted file mode 100644 index 25e8c3f..0000000 --- a/nix/profiles/nixos/khs-server.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - imports = [ ./nix-base.nix ]; - config.khscodes = { - services.openssh.enable = true; - }; -} diff --git a/nix/systems/aarch64-linux/khs.codes/default.nix b/nix/systems/aarch64-linux/khs.codes/default.nix index aed4c34..0d8a456 100644 --- a/nix/systems/aarch64-linux/khs.codes/default.nix +++ b/nix/systems/aarch64-linux/khs.codes/default.nix @@ -3,13 +3,13 @@ ... }: { - imports = [ "${inputs.self}/nix/profiles/nixos/hetzner-server.nix" ]; + imports = [ "${inputs.self}/nix/profiles/hetzner-server.nix" ]; khscodes.infrastructure.hetzner-instance = { enable = true; mapRdns = true; server_type = "cax11"; secretsSource = "bitwarden"; }; - khscodes.networking.fqdn = "khs.codes"; + khscodes.fqdn = "khs.codes"; system.stateVersion = "25.05"; } diff --git a/nix/systems/x86_64-linux/desktop.kaareskovgaard.net/default.nix b/nix/systems/x86_64-linux/desktop.kaareskovgaard.net/default.nix deleted file mode 100644 index 5a5ac3b..0000000 --- a/nix/systems/x86_64-linux/desktop.kaareskovgaard.net/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - inputs, - ... -}: -{ - imports = [ "${inputs.self}/nix/profiles/nixos/khs-desktop.nix" ]; - khscodes.networking.fqdn = "desktop.kaareskovgaard.net"; - system.stateVersion = "25.05"; -} diff --git a/nix/systems/x86_64-linux/test.kaareskovgaard.net/default.nix b/nix/systems/x86_64-linux/test.kaareskovgaard.net/default.nix index c6f0b6a..ddfcb62 100644 --- a/nix/systems/x86_64-linux/test.kaareskovgaard.net/default.nix +++ b/nix/systems/x86_64-linux/test.kaareskovgaard.net/default.nix @@ -3,7 +3,7 @@ ... }: { - imports = [ "${inputs.self}/nix/profiles/nixos/khs-openstack-server.nix" ]; + imports = [ "${inputs.self}/nix/profiles/khs-openstack-server.nix" ]; khscodes.infrastructure.khs-openstack-instance = { enable = true; flavor = "m.medium"; @@ -11,11 +11,11 @@ }; snowfallorg.users.khs.admin = true; users.users.khs = { - initialPassword = "changeMe"; + initialPassword = "test"; openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCqY0FHnWFKfLG2yfgr4qka5sR9CK+EMAhzlHUkaQyWHTKD+G0/vC/fNPyL1VV3Dxc/ajxGuPzVE+mBMoyxazL3EtuCDOVvHJ5CR+MUSEckg/DDwcGHqy6rC8BvVVpTAVL04ByQdwFnpE1qNSBaQLkxaFVdtriGKkgMkc7+UNeYX/bv7yn+APqfP1a3xr6wdkSSdO8x4N2jsSygOIMx10hLyCV4Ueu7Kp8Ww4rGY8j5o7lKJhbgfItBfSOuQHdppHVF/GKYRhdnK6Y2fZVYbhq4KipUtclbZ6O/VYd8/sOO98+LMm7cOX+K35PQjUpYgcoNy5+Sw3CNS/NHn4JvOtTaUEYP7fK6c9LhMULOO3T7Cm6TMdiFjUKHkyG+s2Mu/LXJJoilw571zwuh6chkeitW8+Ht7k0aPV96kNEvTdoXwLhBifVEaChlAsLAzSUjUq+YYCiXVk0VIXCZQWKj8LoVNTmaqDksWwbcT64fw/FpVC0N18WHbKcFUEIW/O4spJMa30CQwf9FeqpoWoaF1oRClCSDPvX0AauCu0JcmRinz1/JmlXljnXWbSfm20/V+WyvktlI0wTD0cdpNuSasT9vS77YfJ8nutcWWZKSkCj4R4uHeCNpDTX5YXzapy7FxpM9ANCXLIvoGX7Yafba2Po+er7SSsUIY1AsnBBr8ZoDVw==" ]; }; - khscodes.networking.fqdn = "test.kaareskovgaard.net"; + khscodes.fqdn = "test.kaareskovgaard.net"; system.stateVersion = "25.05"; }