diff options
Diffstat (limited to 'use-cases/default.nix')
-rw-r--r-- | use-cases/default.nix | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/use-cases/default.nix b/use-cases/default.nix new file mode 100644 index 0000000..5af2903 --- /dev/null +++ b/use-cases/default.nix @@ -0,0 +1,43 @@ +# This configuration is centered around use cases, rather than profiles. Since +# all of the machines I manage are single-user machines, there's no point in +# creating multiple users. +# +# While the users don't differ, the use cases definitely do. I use some +# machines for homework and gaming, while others are used for web-browsing and +# development. Each use case is a subdirectory with (home-manager) +# configuration options. +# +# Note that e.g. "running a DNS server" is not a use case. That's specified in +# the respective host's `configuration.nix`. + +{ config, lib, flakeInputs, ... }: + +let + inherit (lib) mkEnableOption mkIf; + cfg = config.my.use-cases; +in +{ + options.my.use-cases = { + development.enable = mkEnableOption "development use case"; + sysadmin.enable = mkEnableOption "sysadmin use case"; + }; + + config = { + home-manager.users.linus = { + imports = + (lib.optional cfg.development.enable ./development) ++ + (lib.optional cfg.sysadmin.enable ./sysadmin); + # TODO: Graphical linux config (remember assertion). + + xdg.enable = true; + }; + + # Pass + home-manager.extraSpecialArgs = { + super = config; + inherit flakeInputs; + }; + + home-manager.useGlobalPkgs = true; + }; +} |