blob: 8dd142c58bdd0c61f1718b3822ed68a11753f56d [file] [log] [blame]
Skyler Grey4f3e6062023-03-04 01:29:29 +00001{ pkgs, ... }:
2let
Skyler Greyfe1740c2023-10-21 01:24:18 +00003 createUser = { username, realname, founder ? false, sudo ? false, ... }: {
Skyler Grey4f3e6062023-03-04 01:29:29 +00004 description = realname;
Skyler Greyfe1740c2023-10-21 01:24:18 +00005 extraGroups = ((if founder then [ "founder" ] else [ ])
6 ++ (if founder || sudo then [ "wheel" ] else [ ]));
Skyler Grey4f3e6062023-03-04 01:29:29 +00007 isNormalUser = true;
8 openssh.authorizedKeys.keyFiles = [ "./sshKeys/${username}" ];
9 };
Skyler Grey1e2187f2023-03-03 22:45:10 +000010
Skyler Grey4f3e6062023-03-04 01:29:29 +000011 users = {
Skyler Greyfe1740c2023-10-21 01:24:18 +000012 "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 Grey4f3e6062023-03-04 01:29:29 +000028 };
Skyler Greyfe1740c2023-10-21 01:24:18 +000029in {
Skyler Grey4f3e6062023-03-04 01:29:29 +000030 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 Greyfe1740c2023-10-21 01:24:18 +000039 users =
40 builtins.mapAttrs (name: value: createUser { username = name; } // value)
41 users;
Skyler Grey4f3e6062023-03-04 01:29:29 +000042 groups = { };
43 };
Skyler Grey1e2187f2023-03-03 22:45:10 +000044}