Add options.my.setup & append aliases to extra.zshrc
This commit is contained in:
parent
110f74396a
commit
db5c77001f
|
@ -49,6 +49,12 @@ with lib;
|
||||||
description = "...";
|
description = "...";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setup = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = "...";
|
||||||
|
};
|
||||||
|
|
||||||
zsh = {
|
zsh = {
|
||||||
rc = mkOption {
|
rc = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
@ -70,7 +76,6 @@ with lib;
|
||||||
my.user.packages = config.my.packages;
|
my.user.packages = config.my.packages;
|
||||||
my.env.PATH = [ "$PATH" ];
|
my.env.PATH = [ "$PATH" ];
|
||||||
|
|
||||||
environment.shellAliases = config.my.alias;
|
|
||||||
environment.extraInit =
|
environment.extraInit =
|
||||||
let exportLines = mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.my.env;
|
let exportLines = mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.my.env;
|
||||||
in ''
|
in ''
|
||||||
|
@ -78,7 +83,14 @@ with lib;
|
||||||
${config.my.init}
|
${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;
|
my.home.xdg.configFile."zsh/extra.zshenv".text = config.my.zsh.env;
|
||||||
|
|
||||||
|
system.userActivationScripts.mySetup = config.my.setup;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue