-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnixos.nix
72 lines (70 loc) · 1.79 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
inputs,
self,
withSystem,
...
}:
let
# Utility function to construct a NixOS system configuration with optional
# module overrides.
mkNixOSConfigWith =
{
hostname,
system,
extraModules ? [ ],
}:
withSystem system (
{
pkgsets,
pkgs,
unstable,
homeManager,
...
}:
pkgsets.nixpkgs.lib.nixosSystem rec {
inherit system;
specialArgs = {
inherit
inputs
pkgsets
pkgs
unstable
;
};
modules = extraModules ++ [
pkgsets.nixpkgs.nixosModules.notDetected
homeManager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
networking.hostName = hostname;
}
../modules/nixos/primary-user.nix
{ primary-user.home-manager = import (../hosts + "/${hostname}/user.nix"); }
(../hosts + "/${hostname}/system.nix")
];
}
);
# Utility function to construct a NixOS system config without specifying any
# additional modules.
mkNixOSConfig = hostname: system: mkNixOSConfigWith { inherit hostname system; };
in
{
flake = {
nixosConfigurations = {
tatl = mkNixOSConfigWith {
hostname = "tatl";
system = "x86_64-linux";
extraModules = [
inputs.disko.nixosModules.disko
inputs.microvm.nixosModules.host
inputs.impermanence.nixosModule
];
};
};
# Expose the activation package created by `nixos-rebuild`, so it can be
# realized (and possibly applied) directly from the command line.
packages = with self.outputs.nixosConfigurations; {
x86_64-linux.tatl-system = tatl.config.system.build.toplevel;
};
};
}