From 85c8b5e7620816e8b51dabd42068a28343f6e128 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Thu, 28 Apr 2022 00:35:15 -0400 Subject: [PATCH] devos: demonstrate decoupled hm user and system user --- examples/devos/flake.nix | 21 +++------------------ examples/devos/users/admin/default.nix | 11 +++++++++++ examples/devos/users/darwin/default.nix | 8 -------- 3 files changed, 14 insertions(+), 26 deletions(-) create mode 100644 examples/devos/users/admin/default.nix delete mode 100644 examples/devos/users/darwin/default.nix diff --git a/examples/devos/flake.nix b/examples/devos/flake.nix index 02db321b3..f64b07a07 100644 --- a/examples/devos/flake.nix +++ b/examples/devos/flake.nix @@ -147,7 +147,7 @@ users = digga.lib.rakeLeaves ./users; }; suites = with profiles; rec { - base = [ core.darwin users.darwin ]; + base = [ core.darwin users.admin ]; }; }; }; @@ -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; diff --git a/examples/devos/users/admin/default.nix b/examples/devos/users/admin/default.nix new file mode 100644 index 000000000..7243f67b6 --- /dev/null +++ b/examples/devos/users/admin/default.nix @@ -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"; + }; +} diff --git a/examples/devos/users/darwin/default.nix b/examples/devos/users/darwin/default.nix deleted file mode 100644 index a268b8a87..000000000 --- a/examples/devos/users/darwin/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ hmUsers, ... }: -{ - home-manager.users = { inherit (hmUsers) darwin; }; - - users.users.darwin = { - description = "default"; - }; -}