diff options
| author | Seth Flynn <[email protected]> | 2025-02-14 01:18:47 -0500 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-02-14 01:29:06 -0500 |
| commit | 3e208d20934bedd8cd7769f23f35cfae9d8e7d0d (patch) | |
| tree | 452399d770df6be2589be3c92771b1999dd1b93a /users/seth/custom | |
| parent | c1bea770122a7cf2dea5113387265f59010d5a7f (diff) | |
seth: simplify module structure
Moving to mixins generally reduces the boilerplate in all
configurations, and less custom "stuff"
These are then enabled by the regular options in programs.nix for
example
Many of the other options (like desktops) also had little use in being
abstracted as there's no situation where I'd *not* want them to be
applied when said desktop is in use
Diffstat (limited to 'users/seth/custom')
| -rw-r--r-- | users/seth/custom/adw-gtk3.nix | 44 | ||||
| -rw-r--r-- | users/seth/custom/default.nix | 7 | ||||
| -rw-r--r-- | users/seth/custom/nix-override.nix | 25 | ||||
| -rw-r--r-- | users/seth/custom/standalone.nix | 36 |
4 files changed, 112 insertions, 0 deletions
diff --git a/users/seth/custom/adw-gtk3.nix b/users/seth/custom/adw-gtk3.nix new file mode 100644 index 0000000..aad0d1a --- /dev/null +++ b/users/seth/custom/adw-gtk3.nix @@ -0,0 +1,44 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.seth.adw-gtk3; +in + +{ + options.seth.adw-gtk3 = { + enable = lib.mkEnableOption "the use of the `adw-gtk3` GTK theme"; + + mode = lib.mkOption { + type = lib.types.enum [ + "light" + "dark" + ]; + default = "dark"; + description = "Mode of the adw-gtk3 theme"; + example = "light"; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = config.gtk.enable; + message = "`gtk.enable` must be `true` to apply the adw-gtk3 theme"; + } + ]; + + gtk = { + enable = true; + + theme = { + name = "adw-gtk3-dark"; + package = pkgs.adw-gtk3; + }; + }; + }; +} diff --git a/users/seth/custom/default.nix b/users/seth/custom/default.nix new file mode 100644 index 0000000..f7545cb --- /dev/null +++ b/users/seth/custom/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./adw-gtk3.nix + ./nix-override.nix + ./standalone.nix + ]; +} diff --git a/users/seth/custom/nix-override.nix b/users/seth/custom/nix-override.nix new file mode 100644 index 0000000..7457cdd --- /dev/null +++ b/users/seth/custom/nix-override.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.seth.nix-override; +in + +{ + options.seth.nix-override = { + enable = lib.mkEnableOption "the use of a non-default implementation of Nix"; + package = lib.mkPackageOption pkgs "lix" { }; + }; + + config = lib.mkIf cfg.enable { + nix.package = cfg.package; + + programs = { + direnv.nix-direnv.package = pkgs.nix-direnv.override { nix = cfg.package; }; + }; + }; +} diff --git a/users/seth/custom/standalone.nix b/users/seth/custom/standalone.nix new file mode 100644 index 0000000..6bb85a1 --- /dev/null +++ b/users/seth/custom/standalone.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.seth.standalone; + + inherit (pkgs.stdenv.hostPlatform) isDarwin; +in + +{ + + options.seth.standalone = { + enable = lib.mkEnableOption "standalone configuration mode"; + }; + + config = lib.mkIf cfg.enable { + # This won't be set in standalone configurations + _module.args.osConfig = { }; + + # Make sure we can switch & update + programs.home-manager.enable = true; + + home = { + username = "seth"; + homeDirectory = (if isDarwin then "/Users" else "/home") + "/${config.home.username}"; + }; + + nix = { + package = lib.mkDefault pkgs.nix; + }; + }; +} |
