Skip to content

Commit 85c8b5e

Browse files
committed
devos: demonstrate decoupled hm user and system user
1 parent 587013b commit 85c8b5e

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
@@ -147,7 +147,7 @@
147147
users = digga.lib.rakeLeaves ./users;
148148
};
149149
suites = with profiles; rec {
150-
base = [ core.darwin users.darwin ];
150+
base = [ core.darwin users.admin ];
151151
};
152152
};
153153
};
@@ -162,24 +162,9 @@
162162
};
163163
};
164164
users = {
165-
# TODO: does this naming convention still make sense with darwin support?
166-
#
167-
# - it doesn't make sense to make a 'nixos' user available on
168-
# darwin, and vice versa
169-
#
170-
# - the 'nixos' user might have special significance as the default
171-
# user for fresh systems
172-
#
173-
# - perhaps a system-agnostic home-manager user is more appropriate?
174-
# something like 'primaryuser'?
175-
#
176-
# all that said, these only exist within the `hmUsers` attrset, so
177-
# it could just be left to the developer to determine what's
178-
# appropriate. after all, configuring these hm users is one of the
179-
# first steps in customizing the template.
180165
nixos = { suites, ... }: { imports = suites.base; };
181-
darwin = { suites, ... }: { imports = suites.base; };
182-
}; # digga.lib.importers.rakeLeaves ./users/hm;
166+
primary = { suites, ... }: { imports = suites.base; };
167+
};
183168
};
184169

185170
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)