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