-7
packetmix/modules/nilla-home/home.nix
-7
packetmix/modules/nilla-home/home.nix
···
12
12
default.value = { };
13
13
type = homes-type;
14
14
};
15
-
16
-
config = {
17
-
assertions = lib.attrs.mapToList (name: value: {
18
-
assertion = !(builtins.isNull value.pkgs);
19
-
message = "A Nixpkgs instance is required for the home-manager home \"${name}\", but none was provided and \"inputs.nixpkgs\" does not exist.";
20
-
}) config.homes;
21
-
};
22
15
}
+5
-1
packetmix/modules/nilla-home/homes-type.nix
+5
-1
packetmix/modules/nilla-home/homes-type.nix
···
106
106
description = "The created Home Manager home for each of the systems.";
107
107
type = lib.types.attrs.of lib.types.raw;
108
108
writable = false;
109
-
default.value = result;
109
+
default.value =
110
+
if builtins.isNull config.pkgs then
111
+
"A Nixpkgs instance is required for the home-manager home \"${name}\", but none was provided and \"inputs.nixpkgs\" does not exist."
112
+
else
113
+
result;
110
114
};
111
115
};
112
116
+31
-69
packetmix/modules/nilla-home/nixos.nix
+31
-69
packetmix/modules/nilla-home/nixos.nix
···
37
37
homeManager = submodule.config.home-manager;
38
38
in
39
39
(lib.fp.pipe [
40
+
(
41
+
value:
42
+
if builtins.isNull homeManager && value != [ ] then
43
+
builtins.throw "A home-manager instance is required to enable homes for the NixOS system \"${name}\", but none was provided and \"inputs.home-manager\" does not exist."
44
+
else
45
+
value
46
+
)
40
47
(lib.attrs.mapToList (
41
48
homeName: home:
42
49
let
43
50
homeNameParts = builtins.match "([a-z][-a-z0-9]*)(@([-A-Za-z0-9]+))?(:([-_A-Za-z0-9]+))?" homeName;
44
51
username = builtins.elemAt homeNameParts 0;
52
+
homeHasHomeManager = !(builtins.isNull home.home-manager);
53
+
homeIsValidForSystem = home ? result.${config.pkgs.stdenv.hostPlatform.system or config.pkgs.system};
45
54
in
46
-
{
47
-
inherit home homeName username;
48
-
}
55
+
if !homeHasHomeManager then
56
+
builtins.throw "You've asked for the home \"${homeName}\" to be activated in the NixOS system \"${name}\", but it needs a home-manager instance, none was provided and \"inputs.home-manager\" does not exist."
57
+
else if !homeIsValidForSystem then
58
+
builtins.throw "You've asked for the home \"${homeName}\" to be activated in the NixOS system \"${name}\", but it isn't valid for \"${
59
+
config.pkgs.stdenv.hostPlatform.system or config.pkgs.system
60
+
}\" systems."
61
+
else
62
+
{
63
+
inherit home homeName username;
64
+
}
49
65
))
66
+
(
67
+
values:
68
+
let
69
+
existingUsernames = builtins.filter (value: value.username != null) values;
70
+
uniqueUsernames = lib.lists.unique existingUsernames;
71
+
in
72
+
if existingUsernames != uniqueUsernames then
73
+
builtins.throw "There are multiple homes for a single user in the NixOS system \"${name}\". Please make sure you've only enabled a single home per user."
74
+
else
75
+
values
76
+
)
50
77
(builtins.map (
51
78
{
52
79
home,
53
80
homeName,
54
-
...
81
+
username,
55
82
}@identity:
56
83
warnIf (home.home-manager != homeManager)
57
84
"The home \"${homeName}\" isn't using the same home-manager input as the NixOS system \"${name}\". This may work, but is not officially supported by the Nilla Home or Nilla NixOS maintainers. Please fix this before reporting any bugs you may find."
···
93
120
)
94
121
);
95
122
};
96
-
};
97
-
98
-
config = {
99
-
assertions = lib.lists.flatten (
100
-
lib.attrs.mapToList (
101
-
name: value:
102
-
let
103
-
hasNixpkgs = !(builtins.isNull value.pkgs);
104
-
requestedHomes = value.homes != [ ];
105
-
hasHomeManager = !(builtins.isNull value.home-manager);
106
-
in
107
-
[
108
-
{
109
-
assertion = hasNixpkgs;
110
-
message = "A Nixpkgs instance is required for the NixOS system \"${name}\", but none was provided and \"inputs.nixpkgs\" does not exist.";
111
-
}
112
-
{
113
-
assertion = !requestedHomes || hasHomeManager;
114
-
message = "A home-manager instance is required to enable homes for the NixOS system \"${name}\", but none was provided and \"inputs.home-manager\" does not exist.";
115
-
}
116
-
(lib.attrs.mapToList (
117
-
homeName: home:
118
-
let
119
-
homeHasHomeManager = !(builtins.isNull home.home-manager);
120
-
homeIsValidForSystem = home ? result.${value.pkgs.stdenv.hostPlatform.system};
121
-
in
122
-
[
123
-
{
124
-
assertion = homeHasHomeManager;
125
-
message = "You've asked for the home \"${homeName}\" to be activated in the NixOS system \"${name}\", but it needs a home-manager instance, none was provided and \"inputs.home-manager\" does not exist.";
126
-
}
127
-
{
128
-
assertion = !homeHasHomeManager || !hasNixpkgs || homeIsValidForSystem;
129
-
message = "You've asked for the home \"${homeName}\" to be activated in the NixOS system \"${name}\", but it isn't valid for \"${value.pkgs.stdenv.hostPlatform.system}\" systems.";
130
-
}
131
-
]
132
-
) value.homes)
133
-
(
134
-
let
135
-
usernames = lib.attrs.mapToList (
136
-
homeName: home:
137
-
let
138
-
homeHasHomeManager = !(builtins.isNull home.home-manager);
139
-
homeIsValidForSystem = home ? result.${value.pkgs.stdenv.hostPlatform.system};
140
-
in
141
-
if homeHasHomeManager && hasNixpkgs && homeIsValidForSystem then
142
-
let
143
-
homeNameParts = builtins.match "([a-z][-a-z0-9]*)(@([-A-Za-z0-9]+))?(:([-_A-Za-z0-9]+))?" homeName;
144
-
username = builtins.elemAt homeNameParts 0;
145
-
in
146
-
username
147
-
else
148
-
null
149
-
) value.homes;
150
-
existingUsernames = builtins.filter (username: username != null) usernames;
151
-
uniqueUsernames = lib.lists.unique existingUsernames;
152
-
in
153
-
{
154
-
assertion = !hasNixpkgs || (existingUsernames == uniqueUsernames);
155
-
message = "There are multiple homes for a single user in the NixOS system \"${name}\". Please make sure you've only enabled a single home per user.";
156
-
}
157
-
)
158
-
]
159
-
) global.config.systems.nixos
160
-
);
161
123
};
162
124
}
+13
-16
packetmix/npins/sources.json
+13
-16
packetmix/npins/sources.json
···
412
412
"owner": "nilla-nix",
413
413
"repo": "nilla"
414
414
},
415
-
"branch": "private/coded/push-nzprlvpltxyl",
415
+
"branch": "private/minion/push-swlstmwvzvkr",
416
416
"submodules": false,
417
-
"revision": "2f8b8c68efc4d81637be344d1b01462291a45e05",
418
-
"url": "https://github.com/nilla-nix/nilla/archive/2f8b8c68efc4d81637be344d1b01462291a45e05.tar.gz",
419
-
"hash": "sha256-VLlP6L8uvgEjb1ZZXdc4P3NAs5PcgIjpGm8LvaObrLY="
417
+
"revision": "f85d82d169c0faf452255ee156e51147ba0be443",
418
+
"url": "https://github.com/nilla-nix/nilla/archive/f85d82d169c0faf452255ee156e51147ba0be443.tar.gz",
419
+
"hash": "sha256-LZ0rGLnlaNJR8EYaL2xyM6sj4ld9/rFUUvu7RjSA020="
420
420
},
421
421
"nilla-cli": {
422
422
"type": "Git",
···
432
432
"hash": "sha256-cPdYYXhCsDllVgq+gs5Wqhb41bFtKWHlkTvjOJv7its="
433
433
},
434
434
"nilla-home": {
435
-
"type": "GitRelease",
435
+
"type": "Git",
436
436
"repository": {
437
437
"type": "GitHub",
438
438
"owner": "nilla-nix",
439
439
"repo": "home"
440
440
},
441
-
"pre_releases": true,
442
-
"version_upper_bound": null,
443
-
"release_prefix": null,
441
+
"branch": "private/minion/push-ovknmuuuxzul",
444
442
"submodules": false,
445
-
"version": "v0.1.1-alpha",
446
-
"revision": "8d8d783cd3ebe38246f66c027a312e5ec0914c58",
447
-
"url": "https://api.github.com/repos/nilla-nix/home/tarball/refs/tags/v0.1.1-alpha",
448
-
"hash": "sha256-34qP2aqJgvJ6rQo5vi9o65kxrxbp2dFi8S7z3B+P74g="
443
+
"revision": "547625a704ed3c5ad4fbb85b756f299ae73e13af",
444
+
"url": "https://github.com/nilla-nix/home/archive/547625a704ed3c5ad4fbb85b756f299ae73e13af.tar.gz",
445
+
"hash": "sha256-a7Jlf+/bwe85kkkPSNZjOOZyPKtUquE/6XgXElaKxOs="
449
446
},
450
447
"nilla-nixos": {
451
448
"type": "Git",
···
454
451
"owner": "nilla-nix",
455
452
"repo": "nixos"
456
453
},
457
-
"branch": "main",
454
+
"branch": "private/minion/push-yxkmmnpurumu",
458
455
"submodules": false,
459
-
"revision": "52c623ae89fe77de669a981c7e92b1504cd99eac",
460
-
"url": "https://github.com/nilla-nix/nixos/archive/52c623ae89fe77de669a981c7e92b1504cd99eac.tar.gz",
461
-
"hash": "sha256-7tadYU5GzOUAxo8XLC18+dk0Rj+QSORUO5cFdpqfSy4="
456
+
"revision": "b58d52f33ac6dc817702c5114bf5b53ab0db82c7",
457
+
"url": "https://github.com/nilla-nix/nixos/archive/b58d52f33ac6dc817702c5114bf5b53ab0db82c7.tar.gz",
458
+
"hash": "sha256-KOy1vtpjnwORx4dhx0c1Ddf/PzYpwQOZy8c4+Z8xn7E="
462
459
},
463
460
"niri": {
464
461
"type": "Git",