Skyler Grey | 4f3e606 | 2023-03-04 01:29:29 +0000 | [diff] [blame] | 1 | { pkgs, ... }: |
| 2 | let |
| 3 | createUser = { username, realname, founder = false, sudo = false, ... }: { |
| 4 | description = realname; |
| 5 | extraGroups = ( |
| 6 | (if founder then [ "founder" ] else [ ]) ++ |
| 7 | (if founder || sudo then [ "wheel" ] else [ ]) |
| 8 | ); |
| 9 | isNormalUser = true; |
| 10 | openssh.authorizedKeys.keyFiles = [ "./sshKeys/${username}" ]; |
| 11 | }; |
Skyler Grey | 1e2187f | 2023-03-03 22:45:10 +0000 | [diff] [blame] | 12 | |
Skyler Grey | 4f3e606 | 2023-03-04 01:29:29 +0000 | [diff] [blame] | 13 | users = { |
| 14 | "coded" = { realname = "Sam"; founder = true; }; |
| 15 | "minion" = { realname = "Skyler"; founder = true; }; |
| 16 | "pineapplefan" = { realname = "Ash"; founder = true; }; |
| 17 | "eek" = { realname = "Nexus"; sudo = true; }; |
| 18 | }; |
| 19 | in |
| 20 | { |
| 21 | users = { |
| 22 | mutableUsers = false; |
| 23 | motd = '' |
| 24 | Welcome to Clicks! Please make sure to follow all guidelines for using the server, which you can find by typing |
| 25 | `guidelines` in your terminal. In particular, please remember to use this server as minimally as possible (e.g. |
| 26 | by keeping as much of your work as is possible stateless and by using your personal |
| 27 | "${builtins.readFile ./texts/MOTD}" |
| 28 | ''; |
| 29 | defaultUserShell = pkgs.zsh; |
| 30 | users = builtins.mapAttrs (name: value: createUser { username = name; } // value) users; |
| 31 | groups = { }; |
| 32 | }; |
Skyler Grey | 1e2187f | 2023-03-03 22:45:10 +0000 | [diff] [blame] | 33 | } |