diff options
-rw-r--r-- | home-manager/clone-repos.nix | 4 | ||||
-rw-r--r-- | nixos/default.nix | 1 | ||||
-rw-r--r-- | nixos/zshenv.nix | 24 | ||||
-rw-r--r-- | users/timmy/default.nix | 10 |
4 files changed, 35 insertions, 4 deletions
diff --git a/home-manager/clone-repos.nix b/home-manager/clone-repos.nix index aad6fab..0822d7b 100644 --- a/home-manager/clone-repos.nix +++ b/home-manager/clone-repos.nix @@ -14,6 +14,7 @@ in { config = lib.mkIf cfg.enable { # TODO look into xdg.configFile.<name> + # home.file.<name>.source = config.lib.file.mkOutOfStoreSymlink "..."; home.activation = { cloneRepos = lib.hm.dag.entryAfter ["writeBoundary"] ('' export PATH="${pkgs.git}/bin:$PATH" @@ -29,8 +30,5 @@ in { (cloneMissing "${server}awesome" "${dotConfig}/awesome" "") ])); }; - home.file.".zprofile" = { - source = config.lib.file.mkOutOfStoreSymlink "${dotConfig}/zsh/zprofile"; - }; }; } diff --git a/nixos/default.nix b/nixos/default.nix index 5074c06..e934431 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -23,5 +23,6 @@ ./ssh.nix ./sudo.nix ./suspend.nix + ./zshenv.nix ]; } diff --git a/nixos/zshenv.nix b/nixos/zshenv.nix new file mode 100644 index 0000000..4c2fc7c --- /dev/null +++ b/nixos/zshenv.nix @@ -0,0 +1,24 @@ +{ lib, config, ... }: let + cfg = config.programs.zsh._zshenv; + generatedExports = lib.concatLines ( + lib.mapAttrsToList (var: value: ''export ${var}="${value}"'') cfg.exports + ); +in { + options.programs.zsh._zshenv = { + enable = lib.mkEnableOption "generate /etc/zshenv.local"; + exports = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + default = {}; + example = { + ZDOTDIR = "$HOME/.config/zsh"; + }; + }; + }; + + config = lib.mkIf cfg.enable { + environment.etc."zshenv.local".text = '' + # Exports + ${generatedExports} + ''; + }; +} diff --git a/users/timmy/default.nix b/users/timmy/default.nix index 659efde..cfe37fa 100644 --- a/users/timmy/default.nix +++ b/users/timmy/default.nix @@ -36,7 +36,15 @@ in { #config = lib.mkIf cfg.enable { config = { # Setup zsh - programs.zsh.enable = true; + programs.zsh = { + enable = true; + _zshenv = { + enable = true; + exports = { + ZDOTDIR = "$HOME/.config/zsh"; + }; + }; + }; #environment.systemPackages = [ pkgs.zsh-fast-syntax-highlighting ]; # TODO # Setup normal user |