-
Notifications
You must be signed in to change notification settings - Fork 0
/
toplevel.nix
105 lines (100 loc) · 2.92 KB
/
toplevel.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
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
localFlake @ {
self,
lib,
inputs,
flake-parts-lib,
...
}: let
l = lib;
inherit (flake-parts-lib) importApply;
flakeModules = {
hosts = ./flakeModules/hosts/hosts.nix;
lib = ./flakeModules/lib-module.nix;
packagesGroups = ./flakeModules/packagesGroups.nix;
channels = ./flakeModules/channels.nix;
profiles = ./flakeModules/profiles.nix;
home = ./flakeModules/home-module.nix;
nixosModulesExtended = ./flakeModules/nixos-module-wrapper.nix;
scripts = importApply ./scripts/flakeModule.nix localFlake;
};
provision = import ./lib {
inherit lib;
extra-lib = inputs.extra-lib.lib;
};
flakeModulesAll = l.attrValues flakeModules;
in {
imports =
[
inputs.flake-parts.flakeModules.easyOverlay
]
++ (l.attrValues flakeModules);
flake = {
inherit flakeModules flakeModulesAll;
lib = provision;
__provision.nixosModules.flakeArgs = localFlake;
__provision.nixosModules.dir = ./nixosModules;
__provision.nixosModules.filterByPath = [
["virt" "microvm" "vm"]
# [ "provision" "scripts" ]
];
profiles = lib.recursiveUpdate (self.lib.nix.rakeLeaves ./profiles) {
users = {
#test-deploy = import ./profiles/users/test-deploy.nix args;
# test-deploy = import ./profiles/users/test-deploy.nix;
# test-operator = import ./profiles/users/test-operator.nix;
test-deploy = ./profiles/users/test-deploy.nix;
test-operator = ./profiles/users/test-operator.nix;
};
};
};
# for CI / nix-fast-build
flake.checks.x86_64-linux =
(lib.genAttrs [
"basic"
"basic-iso"
"testAllProfiles"
"testSecurity"
"testBtrfsBios"
"testZfsUefi"
]
(name: self.nixosConfigurations.${name}.config.system.build.toplevel))
// {
wireguard-basic = import ./tests/wireguard-basic.nix self;
wireguard-firewall = import ./tests/wireguard-firewall.nix self;
};
flake.provisionOverlays = [
self.overlays.lib
self.overlays.lnav
];
flake.overlays = {
lib = final: prev: {
lib = prev.lib.extend (_: _: {
inherit provision;
});
};
lnav = final: prev: {
# https://github.com/tstack/lnav/issues/1291
lnav = prev.lnav.overrideAttrs (self: {
nativeBuildInputs = self.nativeBuildInputs ++ [prev.tzdata];
buildInputs = self.buildInputs ++ [prev.tzdata];
});
};
};
perSystem = {config, ...}: {
channels.nixpkgs.overlays = self.hosts.defaults.overlays;
channels.stable.input = inputs.nixpkgs-stable;
channels.stable.overlays = [
(final: prev: {
# import packages from other channels via overlays
inherit
(config.channels.nixpkgs.pkgs)
yazi
dnscrypt-proxy
matrix-synapse-unwrapped
;
})
];
# FIX(zfs): 6_10 removed from stable and unstable
channels.nixpkgs-zfs.inputName = "nixpkgs-zfs";
};
}