-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
167 lines (142 loc) · 4.66 KB
/
flake.nix
File metadata and controls
167 lines (142 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
{
description = "NixOS flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser.url = "github:0xc000022070/zen-browser-flake";
stamusctl.url = "github:StamusNetworks/stamusctl";
vscode-server.url = "github:nix-community/nixos-vscode-server";
claude-desktop.url = "github:aaddrick/claude-desktop-debian";
};
outputs =
inputs@{
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
stamusctl,
zen-browser,
nur,
vscode-server,
claude-desktop,
sops-nix,
...
}:
let
system = "x86_64-linux";
myOverlays = [
(import ./overlays/waybar.nix)
(import ./overlays/curseforge.nix)
(import ./overlays/wago-addons.nix)
(import ./overlays/warcraftlogs.nix)
(import ./overlays/claude-code.nix)
(import ./overlays/codex.nix)
(import ./overlays/opencode.nix)
claude-desktop.overlays.default
];
pkgs = import nixpkgs {
inherit system;
overlays = myOverlays;
};
pkgs-unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
# Override stamusctl with correct vendorHash
stamusctl-fixed = {
packages.${system}.default = stamusctl.packages.${system}.default.overrideAttrs (oldAttrs: {
vendorHash = "sha256-NvuiyrMfgpGDBGyLFt1wtmGI1dlAicN4DpITF/rBUUQ=";
});
};
sharedSpecialArgs = {
inherit
inputs
system
pkgs-unstable
zen-browser
nur
;
stamusctl = stamusctl-fixed;
};
homeManagerModule = {
nixpkgs.overlays = myOverlays;
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
home-manager.backupFileExtension = "bak";
home-manager.extraSpecialArgs = sharedSpecialArgs;
home-manager.users.lanath = import ./home/lanath.nix;
home-manager.users.mushu = import ./home/mushu.nix;
};
mkHost =
hostFile:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = sharedSpecialArgs;
modules = [
hostFile
home-manager.nixosModules.home-manager
homeManagerModule
nur.modules.nixos.default
];
};
mkHostWithVscodeServer =
hostFile:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = sharedSpecialArgs;
modules = [
hostFile
home-manager.nixosModules.home-manager
homeManagerModule
nur.modules.nixos.default
vscode-server.nixosModules.default
{ services.vscode-server.enable = true; }
];
};
in
{
overlays = { };
packages.${system} = {
stamusctl = pkgs.stamusctl;
curseforge = pkgs.curseforge;
wago-addons = pkgs.wago-addons;
warcraftlogs = pkgs.warcraftlogs;
};
nixosConfigurations = {
lanath-desktop = mkHostWithVscodeServer ./hosts/lanath-desktop.nix;
lanath-laptop = mkHost ./hosts/lanath-laptop.nix;
mushu-desktop = mkHost ./hosts/mushu-desktop.nix;
mushu-laptop = mkHost ./hosts/mushu-laptop.nix;
# Installer ISO
installer = nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ./installer/iso.nix ];
};
};
# ISO image for easy building
images.${system} = {
installer = self.nixosConfigurations.installer.config.system.build.isoImage;
};
# Checks that run on `nix flake check`
checks.${system} = {
# Verify all nixosConfigurations evaluate
eval-lanath-desktop = self.nixosConfigurations.lanath-desktop.config.system.build.toplevel;
eval-lanath-laptop = self.nixosConfigurations.lanath-laptop.config.system.build.toplevel;
eval-mushu-desktop = self.nixosConfigurations.mushu-desktop.config.system.build.toplevel;
eval-mushu-laptop = self.nixosConfigurations.mushu-laptop.config.system.build.toplevel;
# VM integration tests
vm-test = import ./tests/nixos-test.nix { inherit pkgs; };
hyprland-test = import ./tests/hyprland-test.nix { inherit pkgs; };
};
};
}