summaryrefslogtreecommitdiffstats
path: root/modules/desktop/defaults.nix
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-01-07 12:00:08 -0500
committerJon Santmyer <jon@jonsantmyer.com>2024-01-07 12:00:08 -0500
commit7b79203f54853733d4fae88943829d0e24e6e49f (patch)
treea352d199fad7453332b9308a6295164157729f27 /modules/desktop/defaults.nix
parent184bd30bcb303104a4981ac742d8f8961c5477e7 (diff)
downloadnix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.gz
nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.bz2
nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.zip
massive overhaul
Diffstat (limited to 'modules/desktop/defaults.nix')
-rw-r--r--modules/desktop/defaults.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/modules/desktop/defaults.nix b/modules/desktop/defaults.nix
new file mode 100644
index 0000000..2cf4a46
--- /dev/null
+++ b/modules/desktop/defaults.nix
@@ -0,0 +1,44 @@
+{
+ config,
+ options,
+ lib,
+ pkgs,
+ ...
+}: let
+ defaultApps = config.modules.desktop.defaultApplications;
+in {
+ options.modules.desktop.defaultApplications = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = true;
+ };
+ apps = lib.mkOption {
+ type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
+ options = {
+ package = lib.mkOption {type = lib.types.package;};
+ install = lib.mkOption {type = lib.types.bool; default = true;};
+ cmd = lib.mkOption {type = lib.types.path;};
+ desktop = lib.mkOption {type = lib.types.str;};
+ };
+ }));
+ };
+ };
+
+ config = lib.mkIf (defaultApps.enable) {
+ modules.desktop.apps.terminals.kitty.enable = true;
+ modules.desktop.apps.editors.neovim.enable = true;
+ modules.desktop.apps.mpv.enable = true;
+
+ env = {
+ EDITOR = defaultApps.apps.editor.desktop;
+ TERM = defaultApps.apps.terminal.desktop;
+ VIDEO = defaultApps.apps.video.desktop;
+ };
+
+ home.packages = lib.filter (elem: elem != null) (lib.mapAttrsToList (name: value:
+ if value.install
+ then value.package
+ else null)
+ defaultApps.apps);
+ };
+}