Introduce a "user" module that can be interpolated everywhere.
Signed-off-by: Mariano Uvalle <juvallegarza@microsoft.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
imports = [
|
||||
./user-config.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
|
||||
{
|
||||
options.user = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Primary username for the system";
|
||||
};
|
||||
|
||||
homeDirectory = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Home directory path for the user";
|
||||
default =
|
||||
if pkgs.stdenv.isDarwin
|
||||
then "/Users/${config.user.name}"
|
||||
else "/home/${config.user.name}";
|
||||
};
|
||||
};
|
||||
};
|
||||
description = "User configuration options";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user