blob: efccbade9760fd836ad21e5a70a9acbc33cd60b1 [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 Shuert504b0fd2024-02-11 14:39:15 -05006 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
Samuel Shuertcd9a7f52024-02-09 21:40:44 -05007
Samuel Shuertf1d6e992023-11-24 17:28:33 -05008 nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
Samuel Shuertcd9a7f52024-02-09 21:40:44 -05009 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 Shuertf1d6e992023-11-24 17:28:33 -050012
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 Shuertcd9a7f52024-02-09 21:40:44 -050019 deploy-rs.url = "github:serokell/deploy-rs";
20
Samuel Shuertf1d6e992023-11-24 17:28:33 -050021 lanzaboote.url = "github:nix-community/lanzaboote";
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050022 lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
Samuel Shuert3f828662024-02-10 20:45:50 -050023
24 hyprland.url = "github:hyprwm/Hyprland";
25
26 anyrun = {
27 url = "github:Kirottu/anyrun";
28 inputs.nixpkgs.follows = "nixpkgs";
29 };
Samuel Shuertf1d6e992023-11-24 17:28:33 -050030 };
31
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050032 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 Shuert3f828662024-02-10 20:45:50 -050039 nixosConfigurations.codedPC = let
Samuel Shuertf1d6e992023-11-24 17:28:33 -050040 system = "x86_64-linux";
Samuel Shuert3f828662024-02-10 20:45:50 -050041 in nixpkgs.lib.nixosSystem {
42 inherit system;
Samuel Shuertf1d6e992023-11-24 17:28:33 -050043 modules = [
44 home-manager.nixosModules.home-manager
45 inputs.lanzaboote.nixosModules.lanzaboote
46 {
47 nix.settings.experimental-features = [ "nix-command" "flakes" ];
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050048 system = { inherit stateVersion; };
Samuel Shuertf1d6e992023-11-24 17:28:33 -050049 }
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050050 ] ++ modulesFor "common" ++ modulesFor "codedPC";
Samuel Shuert3f828662024-02-10 20:45:50 -050051 specialArgs = { inherit inputs system; flakeRoot = ./.; };
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050052 };
53
Samuel Shuert3f828662024-02-10 20:45:50 -050054 nixosConfigurations.codedPI = let
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050055 system = "amd64-linux";
Samuel Shuert3f828662024-02-10 20:45:50 -050056 in nixpkgs.lib.nixosSystem {
57 inherit system;
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050058 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 Shuert3f828662024-02-10 20:45:50 -050066 specialArgs = { inherit inputs system; flakeRoot = ./.; };
Samuel Shuertcd9a7f52024-02-09 21:40:44 -050067 };
68
69 deploy.nodes.codedPI.profiles.system = {
70 user = "coded";
71 path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.codedPI;
Samuel Shuertf1d6e992023-11-24 17:28:33 -050072 };
73 };
74}