Skip to content

Commit 15fed52

Browse files
committed
devos: demonstrate decoupled hm user and system user
1 parent 6a31b63 commit 15fed52

File tree

3 files changed

+14
-26
lines changed

3 files changed

+14
-26
lines changed

examples/devos/flake.nix

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
users = digga.lib.rakeLeaves ./users;
154154
};
155155
suites = with profiles; rec {
156-
base = [ core.darwin users.darwin ];
156+
base = [ core.darwin users.admin ];
157157
};
158158
};
159159
};
@@ -168,24 +168,9 @@
168168
};
169169
};
170170
users = {
171-
# TODO: does this naming convention still make sense with darwin support?
172-
#
173-
# - it doesn't make sense to make a 'nixos' user available on
174-
# darwin, and vice versa
175-
#
176-
# - the 'nixos' user might have special significance as the default
177-
# user for fresh systems
178-
#
179-
# - perhaps a system-agnostic home-manager user is more appropriate?
180-
# something like 'primaryuser'?
181-
#
182-
# all that said, these only exist within the `hmUsers` attrset, so
183-
# it could just be left to the developer to determine what's
184-
# appropriate. after all, configuring these hm users is one of the
185-
# first steps in customizing the template.
186171
nixos = { suites, ... }: { imports = suites.base; };
187-
darwin = { suites, ... }: { imports = suites.base; };
188-
}; # digga.lib.importers.rakeLeaves ./users/hm;
172+
primary = { suites, ... }: { imports = suites.base; };
173+
};
189174
};
190175

191176
devshell = ./shell;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{ hmUsers, ... }:
2+
{
3+
# The user profile names defined in `self.home.users` don't need to correspond
4+
# directly to system usernames. They can, instead, be imported as a module in
5+
# any `home-manager.users` configuration, allowing for more flexibility.
6+
home-manager.users.admin = {...}: { imports = [hmUsers.primary]; };
7+
8+
users.users.admin = {
9+
description = "default";
10+
};
11+
}

examples/devos/users/darwin/default.nix

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)