From db5c77001f794f8ad9d4c1b28f3022a8ab68bbe4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 12 Jan 2020 19:46:39 -0500 Subject: [PATCH] Add options.my.setup & append aliases to extra.zshrc --- options/my.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/options/my.nix b/options/my.nix index 7f020ca8..7e99fa38 100644 --- a/options/my.nix +++ b/options/my.nix @@ -49,6 +49,12 @@ with lib; description = "..."; }; + setup = mkOption { + type = types.lines; + default = ""; + description = "..."; + }; + zsh = { rc = mkOption { type = types.lines; @@ -70,7 +76,6 @@ with lib; my.user.packages = config.my.packages; my.env.PATH = [ "$PATH" ]; - environment.shellAliases = config.my.alias; environment.extraInit = let exportLines = mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.my.env; in '' @@ -78,7 +83,14 @@ with lib; ${config.my.init} ''; - my.home.xdg.configFile."zsh/extra.zshrc".text = config.my.zsh.rc; + my.home.xdg.configFile."zsh/extra.zshrc".text = + let aliasLines = mapAttrsToList (n: v: "alias ${n}=\"${v}\"") config.my.alias; + in '' + ${concatStringsSep "\n" aliasLines} + ${config.my.zsh.rc} + ''; my.home.xdg.configFile."zsh/extra.zshenv".text = config.my.zsh.env; + + system.userActivationScripts.mySetup = config.my.setup; }; }