blob: 99c098e4c4b38f67cab9f04d66ae85a366d1d544 [file] [log] [blame]
Samuel Shuertf1d6e992023-11-24 17:28:33 -05001{
2 description = "Initialization flake";
3
4 inputs = {
Samuel Shuert80c2dd42023-12-01 22:03:34 -05005 nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
Samuel Shuertcd9a7f52024-02-09 21:40:44 -05006
Samuel Shuertf1d6e992023-11-24 17:28:33 -05007 nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
Samuel Shuertcd9a7f52024-02-09 21:40:44 -05008 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 Shuertf1d6e992023-11-24 17:28:33 -050011
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 Shuertcd9a7f52024-02-09 21:40:44 -050018 deploy-rs.url = "github:serokell/deploy-rs";
19
Samuel Shuertf1d6e992023-11-24 17:28:33 -050020 lanzaboote.url = "github:nix-community/lanzaboote";
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050021 lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
Samuel Shuertf1d6e992023-11-24 17:28:33 -050022 };
23
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050024 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 Shuertf1d6e992023-11-24 17:28:33 -050032 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 Shuertcd9a7f52024-02-09 21:40:44 -050038 system = { inherit stateVersion; };
Samuel Shuertf1d6e992023-11-24 17:28:33 -050039 }
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050040 ] ++ 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 Shuertf1d6e992023-11-24 17:28:33 -050060 };
61 };
62}