From 92c095c8a56d445085f5e6f9cbc6c0f028d0d397 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Thu, 28 Nov 2024 00:13:48 +0000 Subject: [PATCH] Add nathan user --- nixos/machines/wsl/configuration.nix | 3 ++- nixos/modules/user.nix | 30 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/user.nix diff --git a/nixos/machines/wsl/configuration.nix b/nixos/machines/wsl/configuration.nix index 3c6e9b0..a09f94d 100644 --- a/nixos/machines/wsl/configuration.nix +++ b/nixos/machines/wsl/configuration.nix @@ -31,11 +31,12 @@ inputs.nixos-wsl.nixosModules.default # Our modules (import ../../modules/base.nix {inherit inputs;}) + (import ../../modules/user.nix {inherit inputs;mutableUsers = true;}) ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; wsl.enable = true; - wsl.defaultUser = "nixos"; + wsl.defaultUser = "nathan"; nix.settings.experimental-features = [ "nix-command" diff --git a/nixos/modules/user.nix b/nixos/modules/user.nix new file mode 100644 index 0000000..9fd2468 --- /dev/null +++ b/nixos/modules/user.nix @@ -0,0 +1,30 @@ +{ + inputs, + mutableUsers ? false, + username ? "nathan", + homedir ? "/home/nathan", +}: +{ + config, + lib, + pkgs, + ... +}: + +{ + security.polkit = { enable = true; }; + users = { + inherit mutableUsers; + users.${username} = { + home = homedir; + description = "Nathan McCarty"; + shell = pkgs.nushell; + isNormalUser = true; + extraGroups = [ + "wheel" + ]; + hashedPassword = "$6$ShBAPGwzKZuB7eEv$cbb3erUqtVGFo/Vux9UwT2NkbVG9VGCxJxPiZFYL0DIc3t4GpYxjkM0M7fFnh.6V8MoSKLM/TvOtzdWbYwI58."; + }; + + }; +}