summaryrefslogtreecommitdiff
path: root/config/users.nix
blob: fa673789a6af10245640a117d26cf8b68eec318d (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ config, lib, pkgs, ... }:
let aliases = import ../data/aliases.nix;
in {
  users = {
    defaultUserShell = pkgs.zsh;
    extraUsers = {
      orbekk = {
        isNormalUser = true;
        home = "/home/orbekk";
        uid = 1000;
        description = "KJ";
        extraGroups = ["wheel" "networkmanager" "dialout" "uucp" "audio" "plugdev" "lxd" "readonly" "input"];
        openssh.authorizedKeys.keyFiles = [
          ../data/pincer_rsa.pub
          ../data/yubikey_rsa.pub
        ];
      };
      fcgi = {
        group = "fcgi";
	extraGroups = ["readonly"];
	uid = 500;
      };
      systemhttpd = {
        name = "systemhttpd";
        group = "systemhttpd";
        createHome = true;
        uid = 502;
        home = "/var/lib/systemhttpd";
      };
      linoquotes = {
        name = "linoquotes";
        group = "linoquotes";
        createHome = true;
        uid = 503;
        home = "/var/lib/linoquotes";
      };
      stats = {
        name = "stats";
        group = "stats";
        createHome = true;
        uid = 504;
        home = aliases.services.stats.home;
      };
      terraria = {
        name = "terraria";
	group = "terraria";
	createHome = true;
	uid = 505;
	home = "/var/lib/terraria";
      };
      readonly = {
        group = "readonly";
	createHome = false;
	uid = 506;
	useDefaultShell = true;
	home = "/storage";
      };
      mpd = lib.optionalAttrs config.services.mpd.enable {
        extraGroups = ["readonly"];
      };
      nginx = lib.optionalAttrs config.services.nginx.enable {
        extraGroups = ["readonly"]; 
      };
    };
    extraGroups = {
      fcgi = { name = "fcgi"; gid = 500; };
      plugdev = { name = "plugdev"; gid = 501; };
      systemhttpd = { name = "systemhttpd"; gid = 502; };
      linoquotes = { name = "linoquotes"; gid = 503; };
      stats = { name = "stats"; gid = 504; };
      terraria = { name = "terraria"; gid = 505; };
      readonly = { gid = 506; };
    };
  };
}