-7
packetmix/modules/nilla-home/home.nix
-7
packetmix/modules/nilla-home/home.nix
···
12
default.value = { };
13
type = homes-type;
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
}
+5
-1
packetmix/modules/nilla-home/homes-type.nix
+5
-1
packetmix/modules/nilla-home/homes-type.nix
···
106
description = "The created Home Manager home for each of the systems.";
107
type = lib.types.attrs.of lib.types.raw;
108
writable = false;
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;
114
};
115
};
116
+31
-69
packetmix/modules/nilla-home/nixos.nix
+31
-69
packetmix/modules/nilla-home/nixos.nix
···
37
homeManager = submodule.config.home-manager;
38
in
39
(lib.fp.pipe [
40
(lib.attrs.mapToList (
41
homeName: home:
42
let
43
homeNameParts = builtins.match "([a-z][-a-z0-9]*)(@([-A-Za-z0-9]+))?(:([-_A-Za-z0-9]+))?" homeName;
44
username = builtins.elemAt homeNameParts 0;
45
in
46
-
{
47
-
inherit home homeName username;
48
-
}
49
))
50
(builtins.map (
51
{
52
home,
53
homeName,
54
-
...
55
}@identity:
56
warnIf (home.home-manager != homeManager)
57
"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
)
94
);
95
};
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
};
162
}
···
37
homeManager = submodule.config.home-manager;
38
in
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
+
)
47
(lib.attrs.mapToList (
48
homeName: home:
49
let
50
homeNameParts = builtins.match "([a-z][-a-z0-9]*)(@([-A-Za-z0-9]+))?(:([-_A-Za-z0-9]+))?" homeName;
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};
54
in
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
+
}
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
+
)
77
(builtins.map (
78
{
79
home,
80
homeName,
81
+
username,
82
}@identity:
83
warnIf (home.home-manager != homeManager)
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."
···
120
)
121
);
122
};
123
};
124
}
+13
-16
packetmix/npins/sources.json
+13
-16
packetmix/npins/sources.json
···
412
"owner": "nilla-nix",
413
"repo": "nilla"
414
},
415
-
"branch": "private/coded/push-nzprlvpltxyl",
416
"submodules": false,
417
-
"revision": "2f8b8c68efc4d81637be344d1b01462291a45e05",
418
-
"url": "https://github.com/nilla-nix/nilla/archive/2f8b8c68efc4d81637be344d1b01462291a45e05.tar.gz",
419
-
"hash": "sha256-VLlP6L8uvgEjb1ZZXdc4P3NAs5PcgIjpGm8LvaObrLY="
420
},
421
"nilla-cli": {
422
"type": "Git",
···
432
"hash": "sha256-cPdYYXhCsDllVgq+gs5Wqhb41bFtKWHlkTvjOJv7its="
433
},
434
"nilla-home": {
435
-
"type": "GitRelease",
436
"repository": {
437
"type": "GitHub",
438
"owner": "nilla-nix",
439
"repo": "home"
440
},
441
-
"pre_releases": true,
442
-
"version_upper_bound": null,
443
-
"release_prefix": null,
444
"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="
449
},
450
"nilla-nixos": {
451
"type": "Git",
···
454
"owner": "nilla-nix",
455
"repo": "nixos"
456
},
457
-
"branch": "main",
458
"submodules": false,
459
-
"revision": "52c623ae89fe77de669a981c7e92b1504cd99eac",
460
-
"url": "https://github.com/nilla-nix/nixos/archive/52c623ae89fe77de669a981c7e92b1504cd99eac.tar.gz",
461
-
"hash": "sha256-7tadYU5GzOUAxo8XLC18+dk0Rj+QSORUO5cFdpqfSy4="
462
},
463
"niri": {
464
"type": "Git",
···
412
"owner": "nilla-nix",
413
"repo": "nilla"
414
},
415
+
"branch": "private/minion/push-swlstmwvzvkr",
416
"submodules": false,
417
+
"revision": "25f05256fafeaa962389b9ca2bea12fff77f20a7",
418
+
"url": "https://github.com/nilla-nix/nilla/archive/25f05256fafeaa962389b9ca2bea12fff77f20a7.tar.gz",
419
+
"hash": "sha256-ulbTSG6aflGuYYA+ItRf9HwXkITeEFzxRipmAXNhusw="
420
},
421
"nilla-cli": {
422
"type": "Git",
···
432
"hash": "sha256-cPdYYXhCsDllVgq+gs5Wqhb41bFtKWHlkTvjOJv7its="
433
},
434
"nilla-home": {
435
+
"type": "Git",
436
"repository": {
437
"type": "GitHub",
438
"owner": "nilla-nix",
439
"repo": "home"
440
},
441
+
"branch": "private/minion/push-ovknmuuuxzul",
442
"submodules": false,
443
+
"revision": "5eae985eb596ec26dba3ed07869fc067b697c7e2",
444
+
"url": "https://github.com/nilla-nix/home/archive/5eae985eb596ec26dba3ed07869fc067b697c7e2.tar.gz",
445
+
"hash": "sha256-UfyL9nxwyF7g7FLyXkPNl3LyK6G26VDzPXrmwnR99LA="
446
},
447
"nilla-nixos": {
448
"type": "Git",
···
451
"owner": "nilla-nix",
452
"repo": "nixos"
453
},
454
+
"branch": "private/minion/push-yxkmmnpurumu",
455
"submodules": false,
456
+
"revision": "ca792473bca389769dffd171b60c8f9c26833231",
457
+
"url": "https://github.com/nilla-nix/nixos/archive/ca792473bca389769dffd171b60c8f9c26833231.tar.gz",
458
+
"hash": "sha256-5uYZ7rA00ZaKZYgrCYkpsQhpRPeNb5PKZKfv7yrPDLs="
459
},
460
"niri": {
461
"type": "Git",