summaryrefslogtreecommitdiff
path: root/users.nix
diff options
context:
space:
mode:
authorChristoph Cullmann <christoph@cullmann.io>2024-06-27 20:37:20 +0200
committerChristoph Cullmann <christoph@cullmann.io>2024-06-27 20:37:20 +0200
commit5fb5fe1f6bf072f00ef760c85f11cf0955ed86e9 (patch)
tree06f74a3bc98eb4932744e9a7ac53fbceea4932f6 /users.nix
parentac27521d022b5402c15d389bf0ec1515b52638bd (diff)
separate the settings
Diffstat (limited to 'users.nix')
-rw-r--r--users.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/users.nix b/users.nix
new file mode 100644
index 0000000..44c5283
--- /dev/null
+++ b/users.nix
@@ -0,0 +1,51 @@
+{ config, pkgs, ... }:
+
+{
+ users = {
+ # all users and passwords are defined here
+ mutableUsers = false;
+
+ # default shell is ZSH
+ defaultUserShell = pkgs.zsh;
+
+ #
+ # administrator
+ #
+
+ users.root = {
+ # init password
+ hashedPassword = builtins.readFile "/data/nixos/password.secret";
+
+ # use fixed auth keys
+ openssh.authorizedKeys.keys = pkgs.lib.splitString "\n" (builtins.readFile "/data/nixos/authorized_keys.secret");
+ };
+
+ #
+ # my main user
+ #
+
+ users.cullmann = {
+ # hard code UID for stability over machines
+ uid = 1000;
+
+ # normal user
+ isNormalUser = true;
+
+ # it's me :P
+ description = "Christoph Cullmann";
+
+ # allow VirtualBox and sudo for my main user
+ extraGroups = [ "vboxusers" "wheel" ];
+
+ # init password
+ hashedPassword = config.users.users.root.hashedPassword;
+
+ # use fixed auth keys
+ openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
+ };
+ };
+
+ # use shared home manager settings for all users
+ home-manager.users.root = import ./home.nix;
+ home-manager.users.cullmann = import ./home.nix;
+}