From 9a5d6b69caed3ddcfffee56ac58d80998443f5c0 Mon Sep 17 00:00:00 2001 From: Tyler Kelley Date: Wed, 3 Apr 2024 23:16:57 -0500 Subject: [PATCH] Adding New Test User To See If Multi User Working --- system.nix | 11 +---------- users/users.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 users/users.nix diff --git a/system.nix b/system.nix index ff371f6..117996b 100644 --- a/system.nix +++ b/system.nix @@ -12,6 +12,7 @@ in { [ ./hosts/${host}/hardware.nix ./config/system + ./users/users.nix ]; # Enable networking @@ -40,16 +41,6 @@ in { # Define a user account. users = { mutableUsers = true; - users."${username}" = { - homeMode = "755"; - hashedPassword = "$6$YdPBODxytqUWXCYL$AHW1U9C6Qqkf6PZJI54jxFcPVm2sm/XWq3Z1qa94PFYz0FF.za9gl5WZL/z/g4nFLQ94SSEzMg5GMzMjJ6Vd7."; - isNormalUser = true; - description = "${gitUsername}"; - extraGroups = [ "networkmanager" "wheel" "libvirtd" ]; - shell = pkgs.${theShell}; - ignoreShellProgramCheck = true; - packages = with pkgs; []; - }; }; environment.variables = { diff --git a/users/users.nix b/users/users.nix new file mode 100644 index 0000000..623d39a --- /dev/null +++ b/users/users.nix @@ -0,0 +1,28 @@ +{ pkgs, config, username, host, ... }: + +let + inherit (import ./hosts/${host}/options.nix) gitUsername theShell; +in { + users.users = { + "${username}" = { + homeMode = "755"; + hashedPassword = "$6$YdPBODxytqUWXCYL$AHW1U9C6Qqkf6PZJI54jxFcPVm2sm/XWq3Z1qa94PFYz0FF.za9gl5WZL/z/g4nFLQ94SSEzMg5GMzMjJ6Vd7."; + isNormalUser = true; + description = "${gitUsername}"; + extraGroups = [ "networkmanager" "wheel" "libvirtd" ]; + shell = pkgs.${theShell}; + ignoreShellProgramCheck = true; + packages = with pkgs; []; + }; + "newuser" = { + homeMode = "755"; + hashedPassword = "$6$YdPBODxytqUWXCYL$AHW1U9C6Qqkf6PZJI54jxFcPVm2sm/XWq3Z1qa94PFYz0FF.za9gl5WZL/z/g4nFLQ94SSEzMg5GMzMjJ6Vd7."; + isNormalUser = true; + description = "New user account"; + extraGroups = [ "networkmanager" "wheel" "libvirtd" ]; + shell = pkgs.${theShell}; + ignoreShellProgramCheck = true; + packages = with pkgs; []; + }; + }; +}