chore: make namespace generic so people can copy easier
This commit is contained in:
parent
88593f53a2
commit
7ad43f35c8
45 changed files with 249 additions and 217 deletions
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
osConfig ? { },
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -12,23 +11,14 @@ let
|
|||
mkDefault
|
||||
mkMerge
|
||||
;
|
||||
inherit (lib.wyrdgard) mkOpt;
|
||||
inherit (lib.${namespace}) mkOpt;
|
||||
|
||||
cfg = config.wyrdgard.user;
|
||||
cfg = config.${namespace}.user;
|
||||
|
||||
is-linux = pkgs.stdenv.isLinux;
|
||||
is-darwin = pkgs.stdenv.isDarwin;
|
||||
|
||||
home-directory =
|
||||
if cfg.name == null then
|
||||
null
|
||||
else if is-darwin then
|
||||
"/Users/${cfg.name}"
|
||||
else
|
||||
"/home/${cfg.name}";
|
||||
home-directory = if cfg.name == null then null else "/home/${cfg.name}";
|
||||
in
|
||||
{
|
||||
options.wyrdgard.user = {
|
||||
options.${namespace}.user = {
|
||||
enable = mkOpt types.bool true "Whether to configure the user account.";
|
||||
name = mkOpt (types.nullOr types.str) (config.snowfallorg.user.name or "cholli"
|
||||
) "The user account.";
|
||||
|
@ -44,11 +34,11 @@ in
|
|||
assertions = [
|
||||
{
|
||||
assertion = cfg.name != null;
|
||||
message = "wyrdgard.user.name must be set";
|
||||
message = "${namespace}.user.name must be set";
|
||||
}
|
||||
{
|
||||
assertion = cfg.home != null;
|
||||
message = "wyrdgard.user.home must be set";
|
||||
message = "${namespace}.user.home must be set";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue