From 891fa64466f44a3281d6c377edadf2be59a3590d Mon Sep 17 00:00:00 2001 From: Jan-Bulthuis Date: Mon, 2 Dec 2024 00:54:05 +0100 Subject: [PATCH] Added shell alias configuration --- modules/users/modules/shell/bash.nix | 6 +++++- modules/users/modules/shell/default.nix | 19 +++++++++++++++++++ modules/users/modules/shell/fish.nix | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 modules/users/modules/shell/default.nix diff --git a/modules/users/modules/shell/bash.nix b/modules/users/modules/shell/bash.nix index d71f5f9..c391b33 100644 --- a/modules/users/modules/shell/bash.nix +++ b/modules/users/modules/shell/bash.nix @@ -14,5 +14,9 @@ in enable = mkEnableOption "bash"; }; - config.programs.bash.enable = cfg.enable; + config.programs.bash = { + enable = cfg.enable; + + shellAliases = config.modules.shell.aliases; + }; } diff --git a/modules/users/modules/shell/default.nix b/modules/users/modules/shell/default.nix new file mode 100644 index 0000000..5ade290 --- /dev/null +++ b/modules/users/modules/shell/default.nix @@ -0,0 +1,19 @@ +{ + pkgs, + lib, + config, + ... +}: + +with lib; +{ + options.modules.shell = { + aliases = mkOption { + type = types.attrsOf types.str; + default = { + "..." = "cd ../.."; + }; + description = "Shell aliases"; + }; + }; +} diff --git a/modules/users/modules/shell/fish.nix b/modules/users/modules/shell/fish.nix index 343fdf7..e020d43 100644 --- a/modules/users/modules/shell/fish.nix +++ b/modules/users/modules/shell/fish.nix @@ -36,6 +36,8 @@ in programs.fish = { enable = true; + shellAliases = config.modules.shell.aliases; + plugins = [ (mkIf cfg.plugins.done { name = "done";