my over complex system configurations
dotfiles.isabelroses.com/
nixos
nix
flake
dotfiles
linux
1{
2 lib,
3 _class,
4 config,
5 ...
6}:
7let
8 inherit (lib.attrsets) mergeAttrsList optionalAttrs;
9 inherit (lib.options) mkEnableOption;
10
11 cfg = config.garden.system.tools;
12in
13{
14 options.garden.system.tools = {
15 enable = mkEnableOption "tools" // {
16 default = true;
17 };
18
19 minimal = mkEnableOption "limit to minimal system tooling" // {
20 default = true;
21 };
22 };
23
24 config = mergeAttrsList [
25 (optionalAttrs (_class == "nixos") {
26 system = {
27 disableInstallerTools = cfg.minimal;
28
29 tools = {
30 nixos-version.enable = true;
31 nixos-rebuild.enable = true;
32 };
33 };
34 })
35
36 (optionalAttrs (_class == "darwin") {
37 system.tools = {
38 enable = !cfg.minimal;
39
40 darwin-version.enable = true;
41 darwin-rebuild.enable = true;
42 };
43 })
44 ];
45}