From fcc60b84e5e3cc44986d40af63f5de488caae909 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 3 Feb 2024 19:27:26 -0500 Subject: make everything a module --- users/seth/module/shell/default.nix | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 users/seth/module/shell/default.nix (limited to 'users/seth/module/shell/default.nix') diff --git a/users/seth/module/shell/default.nix b/users/seth/module/shell/default.nix new file mode 100644 index 0000000..050cb0c --- /dev/null +++ b/users/seth/module/shell/default.nix @@ -0,0 +1,40 @@ +{ + config, + lib, + ... +}: let + cfg = config.seth.shell; +in { + options.seth.shell = { + aliases.enable = lib.mkEnableOption "Shell aliases" // {default = true;}; + variables.enable = lib.mkEnableOption "Shell variables" // {default = true;}; + }; + + imports = [ + ./bash.nix + ./fish.nix + ./nu.nix + ./zsh.nix + ]; + + config = { + home = lib.mkMerge [ + (lib.mkIf cfg.variables.enable { + sessionVariables = rec { + EDITOR = "nvim"; + VISUAL = EDITOR; + CARGO_HOME = "${config.xdg.dataHome}/cargo"; + LESSHISTFILE = "${config.xdg.stateHome}/less/history"; + }; + }) + + (lib.mkIf cfg.aliases.enable { + shellAliases = { + diff = "diff --color=auto"; + g = "git"; + gs = "g status"; + }; + }) + ]; + }; +} -- cgit v1.2.3