-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnixos.nix
58 lines (49 loc) · 1.4 KB
/
nixos.nix
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
# SPDX-FileCopyrightText: 2024 - 2025 Daniel Sampliner <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{
config,
inputs,
lib,
...
}:
let
hostSystems = {
default = "x86_64-linux";
};
extraModules = {
"thiccpad" = [ inputs.nixos-hardware.nixosModules.lenovo-legion-16ach6h-nvidia ];
};
hosts = lib.pipe ./nixos/hosts [
(config.lib.collectDir { default = "configuration.nix"; })
config.lib.treeifyFiles
];
homes = lib.pipe ./home/users [
(config.lib.collectDir { default = "home.nix"; })
config.lib.treeifyFiles
];
profilesPath = ./nixos/profiles;
hmProfilesPath = ./home/profiles;
mkNixosSystem = host: config-nix: {
specialArgs = { inherit profilesPath; };
system = hostSystems.${host} or hostSystems.default;
modules =
config.lib.collectDir { } ./nixosModules
++ extraModules.${host} or [ ]
++ [
inputs.home-manager.nixosModules.default
(_: {
home-manager = {
extraSpecialArgs.profilesPath = hmProfilesPath;
sharedModules = config.lib.collectDir { } ./homeModules ++ [ hmProfilesPath ];
users = builtins.mapAttrs (_: import) homes;
};
networking.hostName = builtins.baseNameOf host;
nixpkgs.config = config.nixpkgs.config;
})
profilesPath
config-nix
];
};
in
builtins.mapAttrs mkNixosSystem hosts