summary refs log tree commit diff stats
path: root/users.nix
diff options
context:
space:
mode:
authorene <ene@sils.li>2023-01-19 14:02:04 +0100
committerene <ene@sils.li>2023-01-19 14:02:04 +0100
commit211ab56adf2dd91732feb0c75332321206e0d499 (patch)
tree6b595097bc5a92138f04d696b00cfec68998ae3e /users.nix
parentMerge pull request 'Feat: Added /boot as persistent subvolume' (#10) from ser... (diff)
downloadnixos-server-211ab56adf2dd91732feb0c75332321206e0d499.tar.gz
nixos-server-211ab56adf2dd91732feb0c75332321206e0d499.zip
Feat: User configuration, with secure passwords
The passwords will be stored in a specific password file, which because it
isn't part of this repository is secure.

Refs: #9
Diffstat (limited to '')
-rw-r--r--users.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/users.nix b/users.nix
new file mode 100644
index 0000000..dcf06e8
--- /dev/null
+++ b/users.nix
@@ -0,0 +1,64 @@
+{
+  cfg,
+  lib,
+  pkgs,
+  list,
+  ...
+}: {
+  users.mutableUsers = false;
+  users.defaultUserShell = pkgs.zsh;
+
+  # Persisting user passwords
+  fileSystems."/srv".neededForBoot = true;
+
+  users.users = {
+    root = {
+      passwordFile = "/srv/users/root/password";
+      #uid = 0;
+      #hashedPassword = null; # to lock root
+    };
+
+    sils = {
+      name = "sils";
+      isNormalUser = true;
+      home = "/srv/users/sils/home";
+      passwordFile = "/srv/users/sils/password";
+      uid = 1000;
+      extraGroups = [
+        "wheel"
+      ];
+      openssh.authorizedKeys.keys = [
+        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG63gxw8JePmrC8Fni0pLV4TnPBhCPmSV9FYEdva+6s7 sils"
+      ];
+    };
+
+    soispha = {
+      name = "soispha";
+      isNormalUser = true;
+      home = "/srv/users/soispha/home";
+      passwordFile = "/srv/users/soispha/password";
+      uid = 1001;
+      extraGroups = [
+        "wheel"
+      ];
+      openssh.authorizedKeys.keys = [
+        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGBFuTNNn71Rhfnop2cdz3r/RhWWlCePnSBOhTBbu2ME soispha"
+      ];
+    };
+
+    nightingale = {
+      name = "nightingale";
+      isNormalUser = true;
+      home = "/srv/users/nightingale/home";
+      passwordFile = "/srv/users/nightingale/password";
+      uid = 1002;
+      extraGroups = [
+        "wheel"
+      ];
+      openssh.authorizedKeys.keys = [
+      ];
+    };
+  };
+}
+# vim: ts=2
+