user: username option

sh-initrd-on-root
Zynh Ludwig 2024-07-11 21:35:03 +00:00
parent 2954a57cf7
commit 727b016567
2 changed files with 11 additions and 6 deletions

View File

@ -6,11 +6,18 @@ in
{ {
options.snowhawk.user = { options.snowhawk.user = {
enable = lib.mkEnableOption "user"; enable = lib.mkEnableOption "user";
username = lib.mkOption {
default = "ravenshade";
example = "zynh";
description = "the username to use. also defines the default home folder as /home/\${username}";
type = lib.types.str;
};
}; };
config = lib.mkIf cfg.enable rec { config = lib.mkIf cfg.enable {
home.username = lib.mkDefault "ravenshade"; home.username = lib.mkDefault cfg.username;
home.homeDirectory = lib.mkDefault "/home/${config.home.username}"; home.homeDirectory = lib.mkDefault "/home/${cfg.username}";
home.sessionPath = [ home.sessionPath = [
"${config.home.homeDirectory}/.cargo/bin" "${config.home.homeDirectory}/.cargo/bin"

View File

@ -9,12 +9,10 @@
enable = true; enable = true;
package = inputs.neovim-overlay.packages.${pkgs.system}.default; package = inputs.neovim-overlay.packages.${pkgs.system}.default;
}; };
snowhawk.user.enable = false;
snowhawk.defaultPrograms.enable = false; snowhawk.defaultPrograms.enable = false;
snowhawk.ssh.enable = true; snowhawk.ssh.enable = true;
snowhawk.user.username = "val";
home.username = "val";
home.sessionPath = [ home.sessionPath = [
"${config.home.homeDirectory}/.cargo/bin" "${config.home.homeDirectory}/.cargo/bin"