about summary refs log tree commit diff
path: root/modules/common/users.nix
blob: ffe6234680de77ea75d015a68fd0b1cfa9863b7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib, ... }:
let
  home = "/home/${lib.my.username}";
in
{
  imports = [
    (lib.mkAliasOptionModule
      [ "my" ]
      [
        "users"
        "users"
        lib.my.username
      ]
    )
  ];

  ark.directories = [ home ];

  users = {
    mutableUsers = false;

    users = {
      root = {
        hashedPassword = null;
        password = null;
      };

      ${lib.my.username} = {
        isNormalUser = true;
        uid = 1000;
        description = lib.my.fullname;
        inherit home;
        inherit (lib.my) hashedPassword;
        openssh.authorizedKeys.keys = [ lib.my.ssh.key ];
        extraGroups = [ "wheel" ];
      };
    };
  };
}

Consider giving Nix/NixOS a try! <3