Skip to content

Commit 5b82f9d

Browse files
authored
Merge pull request #41 from DoomHammer/move-system-manager
chore: Move system-manager to its own subdir
2 parents beea847 + 8419adc commit 5b82f9d

4 files changed

Lines changed: 50 additions & 12 deletions

File tree

.config/nix/flake.nix

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,8 @@
151151
};
152152
# nix run 'github:numtide/system-manager' --accept-flake-config -- switch --flake ~/.config/nix --sudo
153153
systemConfigs = {
154-
"precision" = inputs.system-manager.lib.makeSystemConfig {
155-
modules = [
156-
inputs.nix-apt.systemManagerModules.default
157-
./system-manager/default.nix
158-
];
159-
extraSpecialArgs = {
160-
inherit
161-
inputs
162-
outputs
163-
stateVersion
164-
;
165-
};
154+
"precision" = helper.mkSysMan {
155+
hostname = "precision";
166156
};
167157
};
168158
# Custom packages and modifications, exported as overlays

.config/nix/parts/lib/helpers.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,38 @@
118118
];
119119
};
120120

121+
mkSysMan =
122+
{
123+
hostname,
124+
username ? "doomhammer",
125+
desktop ? null,
126+
platform ? "x86_64-linux",
127+
}:
128+
let
129+
isISO = false;
130+
isInstall = true;
131+
isLima = false;
132+
isWorkstation = true;
133+
in
134+
inputs.system-manager.lib.makeSystemConfig {
135+
specialArgs = {
136+
inherit
137+
inputs
138+
outputs
139+
desktop
140+
hostname
141+
platform
142+
username
143+
stateVersion
144+
isInstall
145+
isLima
146+
isISO
147+
isWorkstation
148+
;
149+
};
150+
modules = [ ../../systems/linux ];
151+
};
152+
121153
forAllSystems = inputs.nixpkgs.lib.genAttrs [
122154
"aarch64-linux"
123155
"x86_64-linux"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
{
22
inputs,
3+
pkgs,
4+
username,
5+
hostname,
36
...
47
}:
58
{
9+
imports = [
10+
inputs.nix-apt.systemManagerModules.default
11+
12+
./${hostname}
13+
];
614
config = {
715
nixpkgs.hostPlatform = "x86_64-linux";
816

@@ -40,5 +48,12 @@
4048
"openssh-server"
4149
];
4250
};
51+
52+
users.users.${username} = {
53+
isNormalUser = true;
54+
shell = pkgs.zsh;
55+
ignoreShellProgramCheck = true;
56+
};
57+
4358
};
4459
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_: { }

0 commit comments

Comments
 (0)