my over complex system configurations
dotfiles.isabelroses.com/
nixos
nix
flake
dotfiles
linux
1{
2 lib,
3 config,
4 ...
5}: let
6 inherit (lib) mkOption optionals types;
7in {
8 imports = [
9 ./activation.nix
10 ];
11
12 config.warnings = optionals (config.modules.system.users == []) [
13 ''
14 You have not added any users to be supported by your system. You may end up with an unbootable system!
15
16 Consider setting {option}`config.modules.system.users` in your configuration
17 ''
18 ];
19
20 options.modules.system = {
21 mainUser = mkOption {
22 type = types.enum config.modules.system.users;
23 description = "The username of the main user for your system";
24 default = builtins.elemAt config.modules.system.users 0;
25 };
26
27 users = mkOption {
28 type = with types; listOf str;
29 default = ["isabel"];
30 description = ''
31 A list of users that you wish to declare as your non-system users. The first username
32 in the list will be treated as your main user unless `modules.system.mainUser` is set.
33 '';
34 };
35
36 hostname = mkOption {
37 type = types.str;
38 description = "The name of the device for the system";
39 };
40 };
41}