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