about summary refs log tree commit diff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--home/shell/aliases.nix4
-rw-r--r--home/shell/default.nix11
-rw-r--r--home/shell/fish/default.nix2
-rw-r--r--home/shell/zsh/default.nix9
4 files changed, 20 insertions, 6 deletions
diff --git a/home/shell/aliases.nix b/home/shell/aliases.nix
new file mode 100644
index 0000000..003f253
--- /dev/null
+++ b/home/shell/aliases.nix
@@ -0,0 +1,4 @@
+{
+  ll = "ls -l --color=auto";
+  lt = "ls -ltrh --color=auto";
+}
diff --git a/home/shell/default.nix b/home/shell/default.nix
index 35a6275..f34d997 100644
--- a/home/shell/default.nix
+++ b/home/shell/default.nix
@@ -1,7 +1,9 @@
 { config, lib, pkgs, ... }:
 
 with lib;
-let cfg = config.my.home.shell;
+let
+  cfg = config.my.home.shell;
+  aliases = import ./aliases.nix;
 in
 {
   options.my.home.shell = {
@@ -10,6 +12,13 @@ in
       type = types.enum [ "fish" "zsh" ];
       example = "zsh";
     };
+    aliases = mkOption {
+      default = aliases;
+      description = ''
+        A wrapper for shellAliases for zsh and fish
+      '';
+      type = types.attrsOf types.str;
+    };
   };
 
   imports = [ ./fish ./zsh ];
diff --git a/home/shell/fish/default.nix b/home/shell/fish/default.nix
index 3a21b24..c81f188 100644
--- a/home/shell/fish/default.nix
+++ b/home/shell/fish/default.nix
@@ -2,11 +2,13 @@
 let
   cfg = config.my.home.shell;
   swayEnabled = config.my.home.wm.windowManager == "sway";
+  aliases = config.my.home.shell.aliases;
 in
 {
   config = lib.mkIf (cfg.name == "fish") {
     programs.fish = {
       enable = true;
+      shellAliases = aliases;
       interactiveShellInit = ''
         set fish_greeting
 
diff --git a/home/shell/zsh/default.nix b/home/shell/zsh/default.nix
index 14ddd6c..b5858e9 100644
--- a/home/shell/zsh/default.nix
+++ b/home/shell/zsh/default.nix
@@ -1,5 +1,7 @@
 { config, pkgs, lib, ... }:
-let cfg = config.my.home.shell;
+let
+  cfg = config.my.home.shell;
+  aliases = config.my.home.shell.aliases;
 in
 {
   config = lib.mkIf (cfg.name == "zsh") {
@@ -28,10 +30,7 @@ in
         REPORTTIME = 5;
       };
 
-      shellAliases = {
-        ll = "ls -l --color=auto";
-        lt = "ls -ltrh --color=auto";
-      };
+      shellAliases = aliases;
 
       defaultKeymap = "emacs";