refactor: use 'import-as-enable' pattern
This commit is contained in:
@@ -9,38 +9,32 @@ let
|
||||
inherit (config.home) username;
|
||||
in
|
||||
{
|
||||
options.shell.bash = {
|
||||
enable = lib.mkEnableOption "bash configuration";
|
||||
imports = [ ./utils.nix ];
|
||||
|
||||
options.shell.bash = {
|
||||
aliases = {
|
||||
all = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Enable common aliases";
|
||||
};
|
||||
lang-js = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable JavaScript/Node.js aliases";
|
||||
};
|
||||
};
|
||||
|
||||
addBinToPath = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Add dots .bin directory to PATH";
|
||||
};
|
||||
|
||||
extraInit = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = "Additional bash initialization";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
shell-utils.enable = lib.mkDefault true;
|
||||
|
||||
config = {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
|
||||
@@ -1,16 +1,3 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.starship = {
|
||||
enable = lib.mkEnableOption "starship prompt";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.starship.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
programs.starship.enable = true;
|
||||
}
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.shell-utils = {
|
||||
enable = lib.mkEnableOption "shell utilities";
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = lib.mkDefault true;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.shell-utils.enable {
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = lib.mkDefault true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
ripgrep
|
||||
bat
|
||||
jq
|
||||
entr
|
||||
parallel
|
||||
];
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
ripgrep
|
||||
bat
|
||||
jq
|
||||
entr
|
||||
parallel
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user