Repository navigation
Expand file tree
/
Copy pathsystem.nix
More file actions
50 lines (45 loc) · 1.72 KB
/
Copy pathsystem.nix
File metadata and controls
50 lines (45 loc) · 1.72 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
let
sources = import ./other/npins;
pkgs = import sources.nixpkgs { config.allowUnfree = true; }; # Read impurely from `builtins.currentSystem`
nixosSystem = import "${sources.nixpkgs}/nixos/lib/eval-config.nix";
# Variables that apply to all hosts, to query things like the username without
# hardcoding it within config
baseVars = import ./other/baseVars.nix;
myLib = import ./other/myLib/default.nix { inherit pkgs; };
wrappers = import ./wrappers { inherit pkgs sources myLib; };
mkHost = hostVars: nixosSystem {
inherit pkgs;
specialArgs = {
self = {
inherit sources baseVars hostVars wrappers;
packages = import ./packages { inherit pkgs sources myLib wrappers; };
};
};
# I use a custom recursive importer, that will "expand" any folders in this
# list to all the files within that folder.
modules = myLib.recursivelyImport [
./modules
./other/hosts/${hostVars.hostname}
./other/nixosModules
];
};
in {
# Each host passes something we call hostVars, which are automatically passed
# into `specialArgs`. If two hosts only differ by their scaling factor, we
# don't have to duplicate the configuration - we just use the dynamic value of
# hostVars.scalingFactor!
desktop = mkHost {
hostname = "desktop";
configDirectory = "/home/${baseVars.username}/Documents/projects/nixos";
stateVersion = "24.05";
mouseName = "Libinput/1133/16500/Logitech G305";
scalingFactor = 1;
};
palpot = mkHost {
hostname = "palpot";
configDirectory = "/home/${baseVars.username}/Documents/projects/nixos";
stateVersion = "25.05";
touchpadName = "Libinput/1739/53227/VEN_06CB:00 06CB:CFEB Touchpad";
scalingFactor = 1;
};
}