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 | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame^] | 22 | |
| 23 | hyprland.url = "github:hyprwm/Hyprland"; |
| 24 | |
| 25 | anyrun = { |
| 26 | url = "github:Kirottu/anyrun"; |
| 27 | inputs.nixpkgs.follows = "nixpkgs"; |
| 28 | }; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 29 | }; |
| 30 | |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 31 | outputs = { self, nixpkgs, home-manager, deploy-rs, ... }@inputs: let |
| 32 | stateVersion = "23.11"; # Only change this number on a full config rewrite. |
| 33 | modulesFor = x: (nixpkgs.lib.pipe ./modules/${x} [ |
| 34 | (import ./utils/nixFilesIn.nix nixpkgs.lib) |
| 35 | (map import) |
| 36 | ]); |
| 37 | in { |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame^] | 38 | nixosConfigurations.codedPC = let |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 39 | system = "x86_64-linux"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame^] | 40 | in nixpkgs.lib.nixosSystem { |
| 41 | inherit system; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 42 | modules = [ |
| 43 | home-manager.nixosModules.home-manager |
| 44 | inputs.lanzaboote.nixosModules.lanzaboote |
| 45 | { |
| 46 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 47 | system = { inherit stateVersion; }; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 48 | } |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 49 | ] ++ modulesFor "common" ++ modulesFor "codedPC"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame^] | 50 | specialArgs = { inherit inputs system; flakeRoot = ./.; }; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 51 | }; |
| 52 | |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame^] | 53 | nixosConfigurations.codedPI = let |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 54 | system = "amd64-linux"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame^] | 55 | in nixpkgs.lib.nixosSystem { |
| 56 | inherit system; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 57 | modules = [ |
| 58 | home-manager.nixosModules.home-manager |
| 59 | inputs.lanzaboote.nixosModules.lanzaboote |
| 60 | { |
| 61 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; |
| 62 | system = { inherit stateVersion; }; |
| 63 | } |
| 64 | ] ++ modulesFor "common" ++ modulesFor "codedPI"; |
Samuel Shuert | 3f82866 | 2024-02-10 20:45:50 -0500 | [diff] [blame^] | 65 | specialArgs = { inherit inputs system; flakeRoot = ./.; }; |
Samuel Shuert | cd9a7f5 | 2024-02-09 21:40:44 -0500 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | deploy.nodes.codedPI.profiles.system = { |
| 69 | user = "coded"; |
| 70 | path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.codedPI; |
Samuel Shuert | f1d6e99 | 2023-11-24 17:28:33 -0500 | [diff] [blame] | 71 | }; |
| 72 | }; |
| 73 | } |