Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 1 | { |
| 2 | description = "Initialization flake"; |
| 3 | |
| 4 | inputs = { |
Samuel Shuert | 80c2dd4 | 2023-12-01 22:03:34 -0500 | [diff] [blame] | 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; |
Samuel Shuert | 504b0fd | 2024-02-11 14:39:15 -0500 | [diff] [blame] | 6 | nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 7 | |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 8 | nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 9 | nix-vscode-extensions.inputs.nixpkgs.follows = "nixpkgs"; |
| 10 | nix-vscode-extensions.inputs.flake-compat.follows = "lanzaboote/flake-compat"; |
| 11 | nix-vscode-extensions.inputs.flake-utils.follows = "lanzaboote/flake-utils"; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 12 | |
| 13 | alacritty-themes.url = "github:rajasegar/alacritty-themes"; |
| 14 | alacritty-themes.flake = false; |
| 15 | |
| 16 | home-manager.url = "github:nix-community/home-manager"; |
| 17 | home-manager.inputs.nixpkgs.follows = "nixpkgs"; |
| 18 | |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 19 | deploy-rs.url = "github:serokell/deploy-rs"; |
| 20 | |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 21 | lanzaboote.url = "github:nix-community/lanzaboote"; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 22 | lanzaboote.inputs.nixpkgs.follows = "nixpkgs"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame] | 23 | |
| 24 | hyprland.url = "github:hyprwm/Hyprland"; |
| 25 | |
| 26 | anyrun = { |
| 27 | url = "github:Kirottu/anyrun"; |
| 28 | inputs.nixpkgs.follows = "nixpkgs"; |
| 29 | }; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 30 | }; |
| 31 | |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 32 | outputs = { self, nixpkgs, home-manager, deploy-rs, ... }@inputs: let |
| 33 | stateVersion = "23.11"; # Only change this number on a full config rewrite. |
| 34 | modulesFor = x: (nixpkgs.lib.pipe ./modules/${x} [ |
| 35 | (import ./utils/nixFilesIn.nix nixpkgs.lib) |
| 36 | (map import) |
| 37 | ]); |
| 38 | in { |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame] | 39 | nixosConfigurations.codedPC = let |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 40 | system = "x86_64-linux"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame] | 41 | in nixpkgs.lib.nixosSystem { |
| 42 | inherit system; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 43 | modules = [ |
| 44 | home-manager.nixosModules.home-manager |
| 45 | inputs.lanzaboote.nixosModules.lanzaboote |
| 46 | { |
| 47 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 48 | system = { inherit stateVersion; }; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 49 | } |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 50 | ] ++ modulesFor "common" ++ modulesFor "codedPC"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame] | 51 | specialArgs = { inherit inputs system; flakeRoot = ./.; }; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 52 | }; |
| 53 | |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame] | 54 | nixosConfigurations.codedPI = let |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 55 | system = "amd64-linux"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame] | 56 | in nixpkgs.lib.nixosSystem { |
| 57 | inherit system; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 58 | modules = [ |
| 59 | home-manager.nixosModules.home-manager |
| 60 | inputs.lanzaboote.nixosModules.lanzaboote |
| 61 | { |
| 62 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; |
| 63 | system = { inherit stateVersion; }; |
| 64 | } |
| 65 | ] ++ modulesFor "common" ++ modulesFor "codedPI"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame] | 66 | specialArgs = { inherit inputs system; flakeRoot = ./.; }; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | deploy.nodes.codedPI.profiles.system = { |
| 70 | user = "coded"; |
| 71 | path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.codedPI; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 72 | }; |
| 73 | }; |
| 74 | } |