From fa3a7f57862a9713f8b29bf4589ad1533a4b960e Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Mon, 11 Aug 2025 15:35:34 +0200 Subject: [PATCH] fixed home manager session variables --- flake.nix | 1 + lib/deploy/default.nix | 8 ++++++-- modules/home/fixes/sessionVariables/default.nix | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 modules/home/fixes/sessionVariables/default.nix diff --git a/flake.nix b/flake.nix index 0136228..50fc587 100644 --- a/flake.nix +++ b/flake.nix @@ -146,6 +146,7 @@ overrides = { kylekrein-server.hostname = "kylekrein.com"; }; + exclude = ["kylekrein-wsl-wm"]; }; outputs-builder = channels: { diff --git a/lib/deploy/default.nix b/lib/deploy/default.nix index 9aeb39a..b1d4096 100644 --- a/lib/deploy/default.nix +++ b/lib/deploy/default.nix @@ -19,14 +19,18 @@ in rec { mkDeploy = { self, overrides ? {}, + exclude ? [], }: let - hosts = self.nixosConfigurations or {}; + hosts = + builtins.removeAttrs + (self.nixosConfigurations or {}) + exclude; names = builtins.attrNames hosts; nodes = lib.foldl ( result: name: let host = hosts.${name}; - user = host.config.user.name or null; + user = overrides.user or null; inherit (host.pkgs) system; in result diff --git a/modules/home/fixes/sessionVariables/default.nix b/modules/home/fixes/sessionVariables/default.nix new file mode 100644 index 0000000..a07e096 --- /dev/null +++ b/modules/home/fixes/sessionVariables/default.nix @@ -0,0 +1,9 @@ +#https://github.com/nix-community/home-manager/issues/1011 +{config, ...}: let + homeManagerSessionVars = "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"; +in { + programs.bash.enable = !config.programs.zsh.enable && !config.programs.fish.enable && !config.programs.nushell.enable; + programs.bash.initExtra = '' + source "${homeManagerSessionVars}" + ''; +}