aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/desktop/terminal/alacritty/default.nix8
-rw-r--r--modules/desktop/terminal/default.nix12
-rw-r--r--modules/desktop/terminal/kitty/default.nix8
-rw-r--r--modules/desktop/window-manager/sxhkd/default.nix4
-rw-r--r--modules/shell/bash/default.nix12
-rw-r--r--modules/shell/default.nix16
-rw-r--r--modules/shell/zsh/default.nix6
-rw-r--r--modules/tools/file-manager/default.nix10
-rw-r--r--modules/tools/file-manager/lf/default.nix7
-rw-r--r--modules/tools/file-manager/nnn/default.nix7
10 files changed, 71 insertions, 19 deletions
diff --git a/modules/desktop/terminal/alacritty/default.nix b/modules/desktop/terminal/alacritty/default.nix
index 575fe4e..151e098 100644
--- a/modules/desktop/terminal/alacritty/default.nix
+++ b/modules/desktop/terminal/alacritty/default.nix
@@ -7,7 +7,11 @@
config = lib.mkIf config.desktop.terminal.alacritty.enable {
programs.alacritty.enable = true;
- desktop.terminal.default = lib.mkDefault "${pkgs.alacritty}/bin/alacritty";
+ desktop.terminal.default = lib.mkDefault "alacritty";
+ desktop.terminal.command =
+ if config.desktop.terminal.default == "alacritty" then
+ lib.mkForce "${pkgs.kitty}/bin/alacritty"
+ else "";
programs.alacritty.settings = {
window = {
@@ -72,7 +76,7 @@
};
shell = {
- program = config.shell.default;
+ program = config.shell.command;
};
};
};
diff --git a/modules/desktop/terminal/default.nix b/modules/desktop/terminal/default.nix
index ac84471..189c794 100644
--- a/modules/desktop/terminal/default.nix
+++ b/modules/desktop/terminal/default.nix
@@ -7,9 +7,17 @@
];
options.desktop.terminal = {
- default = lib.mkOption {
+ command = lib.mkOption {
type = lib.types.str;
- description = "Path to the default terminal program.";
+ description = "Command for the terminal.";
+ };
+
+ default = lib.mkOption {
+ type = lib.types.enum [
+ "kitty"
+ "alacritty"
+ ];
+ description = "Default terminal.";
};
};
}
diff --git a/modules/desktop/terminal/kitty/default.nix b/modules/desktop/terminal/kitty/default.nix
index 8950a46..a34e58a 100644
--- a/modules/desktop/terminal/kitty/default.nix
+++ b/modules/desktop/terminal/kitty/default.nix
@@ -13,7 +13,11 @@
}
];
programs.kitty.enable = true;
- desktop.terminal.default = lib.mkDefault "${pkgs.kitty}/bin/kitty";
+ desktop.terminal.default = lib.mkDefault "kitty";
+ desktop.terminal.command =
+ if config.desktop.terminal.default == "kitty" then
+ lib.mkForce "${pkgs.kitty}/bin/kitty"
+ else "";
programs.kitty.settings = with config.scheme.withHashtag; {
window_padding_width = config.desktop.window-manager.gap;
@@ -42,7 +46,7 @@
selection_background = base03;
selection_foreground = base00;
- shell = config.shell.default;
+ shell = config.shell.command;
};
};
}
diff --git a/modules/desktop/window-manager/sxhkd/default.nix b/modules/desktop/window-manager/sxhkd/default.nix
index 04fb0cc..c31604b 100644
--- a/modules/desktop/window-manager/sxhkd/default.nix
+++ b/modules/desktop/window-manager/sxhkd/default.nix
@@ -34,12 +34,12 @@
${(createKeybinding
"t"
"Launch terminal.")}
- = config.desktop.terminal.default;
+ = config.desktop.terminal.command;
${(createKeybinding
"f"
"Launch File Manager.")}
- = "${config.desktop.terminal.default} --title 'File Manager' --class popup -e ${config.tools.file-manager.default}";
+ = "${config.desktop.terminal.command} --title 'File Manager' --class popup -e ${config.tools.file-manager.command}";
}
];
};
diff --git a/modules/shell/bash/default.nix b/modules/shell/bash/default.nix
index ee3b4a8..2e65d60 100644
--- a/modules/shell/bash/default.nix
+++ b/modules/shell/bash/default.nix
@@ -2,10 +2,20 @@
{
options.shell.bash = {
- enable = lib.mkEnableOption "Enables bash.";
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ description = "Enables bash.";
+ default = true;
+ };
};
config = lib.mkIf config.shell.bash.enable {
+ shell.default = lib.mkDefault "bash";
+ shell.command =
+ if config.shell.default == "bash" then
+ lib.mkForce "${pkgs.zsh}/bin/bash"
+ else "";
+
programs.bash.enable = true;
programs.bash.historyFile = "${config.xdg.cacheHome}/bash/history";
programs.bash.shellAliases = config.shell.alias;
diff --git a/modules/shell/default.nix b/modules/shell/default.nix
index 27a919a..c2eada9 100644
--- a/modules/shell/default.nix
+++ b/modules/shell/default.nix
@@ -8,17 +8,21 @@
options.shell = {
default = lib.mkOption {
+ type = lib.types.enum [
+ "bash"
+ "zsh"
+ ];
+ description = "Default shell.";
+ };
+
+ command = lib.mkOption {
type = lib.types.str;
- description = "Path to the default shell program.";
+ description = "Command for the default shell.";
};
+
alias = lib.mkOption {
type = lib.types.attrs;
description = "Shell aliases.";
};
};
-
- config = {
- shell.default = lib.mkDefault "${pkgs.bash}/bin/bash"; # Set bash as default shell
- shell.bash.enable = lib.mkDefault true; # Enable bash by default
- };
}
diff --git a/modules/shell/zsh/default.nix b/modules/shell/zsh/default.nix
index 7d7a261..0c14b8c 100644
--- a/modules/shell/zsh/default.nix
+++ b/modules/shell/zsh/default.nix
@@ -6,7 +6,11 @@
};
config = lib.mkIf config.shell.zsh.enable {
- shell.default = "${pkgs.zsh}/bin/zsh";
+ shell.default = lib.mkDefault "zsh";
+ shell.command =
+ if config.shell.default == "zsh" then
+ lib.mkForce "${pkgs.zsh}/bin/zsh"
+ else "";
programs.zsh.enable = true;
programs.zsh.dotDir = ".config/zsh";
diff --git a/modules/tools/file-manager/default.nix b/modules/tools/file-manager/default.nix
index 760584a..4889f5b 100644
--- a/modules/tools/file-manager/default.nix
+++ b/modules/tools/file-manager/default.nix
@@ -9,8 +9,16 @@
options.tools.file-manager = {
default = lib.mkOption {
+ type = lib.types.enum [
+ "nnn"
+ "lf"
+ ];
+ description = "Default file manager.";
+ };
+
+ command = lib.mkOption {
type = lib.types.str;
- description = "Path to the default file manager program.";
+ description = "Command for the default file manager program.";
};
};
}
diff --git a/modules/tools/file-manager/lf/default.nix b/modules/tools/file-manager/lf/default.nix
index 4cfbba2..bdbefbc 100644
--- a/modules/tools/file-manager/lf/default.nix
+++ b/modules/tools/file-manager/lf/default.nix
@@ -6,7 +6,12 @@
};
config = lib.mkIf config.tools.file-manager.lf.enable {
- tools.file-manager.default = "${pkgs.nnn}/bin/lf";
+ tools.file-manager.default = lib.mkDefault "lf";
+ tools.file-manager.command =
+ if config.tools.file-manager.default == "lf" then
+ lib.mkForce "${pkgs.lf}/bin/lf"
+ else "";
+
programs.lf.enable = true;
programs.lf.settings = {
hidden = true;
diff --git a/modules/tools/file-manager/nnn/default.nix b/modules/tools/file-manager/nnn/default.nix
index 6244d04..73b5c9d 100644
--- a/modules/tools/file-manager/nnn/default.nix
+++ b/modules/tools/file-manager/nnn/default.nix
@@ -6,7 +6,12 @@
};
config = lib.mkIf config.tools.file-manager.nnn.enable {
- tools.file-manager.default = "${pkgs.nnn}/bin/nnn -H -d";
+ tools.file-manager.default = lib.mkDefault "nnn";
+ tools.file-manager.command =
+ if config.tools.file-manager.default == "nnn" then
+ lib.mkForce "${pkgs.nnn}/bin/nnn -H -d"
+ else "";
+
programs.nnn.enable = true;
programs.nnn.package = pkgs.nnn.override ({ withNerdIcons = true; });
programs.nnn.plugins.src = "${pkgs.nnn}/share/plugins";