making a mess of it, but getting to auto loading multi user setups!
This commit is contained in:
parent
20a2450683
commit
b139021f8e
13 changed files with 139 additions and 216 deletions
31
lib/user.nix
Normal file
31
lib/user.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ lib, ... }: let
|
||||
inherit (builtins) baseNameOf;
|
||||
inherit (lib.attrsets) filterAttrs;
|
||||
inherit (lib.strings) removeSuffix;
|
||||
in rec
|
||||
{
|
||||
mkSysUser = path: let
|
||||
user = import path {};
|
||||
name = removeSuffix ".nix" (baseNameOf path);
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
inherit (user) is_trusted;
|
||||
description = user.full_name;
|
||||
extraGroups = (if user.is_trusted then [ "wheel" ] else []);
|
||||
isNormalUser = true;
|
||||
home = "/home/${name}";
|
||||
group = "users";
|
||||
};
|
||||
|
||||
mkHmUser = path: stateVersion: let
|
||||
user = import path {};
|
||||
name = removeSuffix ".nix" (baseNameOf path);
|
||||
in
|
||||
{
|
||||
home = {
|
||||
inherit stateVersion;
|
||||
sessionPath = [ "$SNEEUWVLOK_BIN" "$XDG_BIN_HOME" "$PATH" ]; # Pretty sure I don't need this.
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue