blob: 2ba0c237e0d8a8da4e85e808316357eed3c423e8 [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 Shuert3f828662024-02-10 20:45:50 -050022
23 hyprland.url = "github:hyprwm/Hyprland";
24
25 anyrun = {
26 url = "github:Kirottu/anyrun";
27 inputs.nixpkgs.follows = "nixpkgs";
28 };
Samuel Shuertf1d6e992023-11-24 17:28:33 -050029 };
30
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050031 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 Shuert3f828662024-02-10 20:45:50 -050038 nixosConfigurations.codedPC = let
Samuel Shuertf1d6e992023-11-24 17:28:33 -050039 system = "x86_64-linux";
Samuel Shuert3f828662024-02-10 20:45:50 -050040 in nixpkgs.lib.nixosSystem {
41 inherit system;
Samuel Shuertf1d6e992023-11-24 17:28:33 -050042 modules = [
43 home-manager.nixosModules.home-manager
44 inputs.lanzaboote.nixosModules.lanzaboote
45 {
46 nix.settings.experimental-features = [ "nix-command" "flakes" ];
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050047 system = { inherit stateVersion; };
Samuel Shuertf1d6e992023-11-24 17:28:33 -050048 }
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050049 ] ++ modulesFor "common" ++ modulesFor "codedPC";
Samuel Shuert3f828662024-02-10 20:45:50 -050050 specialArgs = { inherit inputs system; flakeRoot = ./.; };
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050051 };
52
Samuel Shuert3f828662024-02-10 20:45:50 -050053 nixosConfigurations.codedPI = let
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050054 system = "amd64-linux";
Samuel Shuert3f828662024-02-10 20:45:50 -050055 in nixpkgs.lib.nixosSystem {
56 inherit system;
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050057 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 Shuert3f828662024-02-10 20:45:50 -050065 specialArgs = { inherit inputs system; flakeRoot = ./.; };
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050066 };
67
68 deploy.nodes.codedPI.profiles.system = {
69 user = "coded";
70 path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.codedPI;
Samuel Shuertf1d6e992023-11-24 17:28:33 -050071 };
72 };
73}