Skip to content

Commit

Permalink
devos: demonstrate decoupled hm user and system user
Browse files Browse the repository at this point in the history
  • Loading branch information
montchr committed Jul 12, 2022
1 parent 587013b commit 85c8b5e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 26 deletions.
21 changes: 3 additions & 18 deletions examples/devos/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
users = digga.lib.rakeLeaves ./users;
};
suites = with profiles; rec {
base = [ core.darwin users.darwin ];
base = [ core.darwin users.admin ];
};
};
};
Expand All @@ -162,24 +162,9 @@
};
};
users = {
# TODO: does this naming convention still make sense with darwin support?
#
# - it doesn't make sense to make a 'nixos' user available on
# darwin, and vice versa
#
# - the 'nixos' user might have special significance as the default
# user for fresh systems
#
# - perhaps a system-agnostic home-manager user is more appropriate?
# something like 'primaryuser'?
#
# all that said, these only exist within the `hmUsers` attrset, so
# it could just be left to the developer to determine what's
# appropriate. after all, configuring these hm users is one of the
# first steps in customizing the template.
nixos = { suites, ... }: { imports = suites.base; };
darwin = { suites, ... }: { imports = suites.base; };
}; # digga.lib.importers.rakeLeaves ./users/hm;
primary = { suites, ... }: { imports = suites.base; };
};
};

devshell = ./shell;
Expand Down
11 changes: 11 additions & 0 deletions examples/devos/users/admin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ hmUsers, ... }:
{
# The user profile names defined in `self.home.users` don't need to correspond
# directly to system usernames. They can, instead, be imported as a module in
# any `home-manager.users` configuration, allowing for more flexibility.
home-manager.users.admin = {...}: { imports = [hmUsers.primary]; };

users.users.admin = {
description = "default";
};
}
8 changes: 0 additions & 8 deletions examples/devos/users/darwin/default.nix

This file was deleted.

0 comments on commit 85c8b5e

Please sign in to comment.