From 18c0827860e17356c4a2b9a10122185c05b0f51f Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Thu, 5 Oct 2023 23:55:38 +0100 Subject: [PATCH] flake.nix: load the environment variables --- flake.nix | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 26f5da3b..b621bd44 100644 --- a/flake.nix +++ b/flake.nix @@ -194,14 +194,18 @@ (flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; - homeManager = (mkHomeConfig { + homeManager = (mkHomeConfig rec { inherit system; hostname = "devShell"; homeDirectory = "/tmp/home"; # Needs to run with `--impure` flag username = builtins.getEnv "USER"; extraModules = [{ - home.stateVersion = "23.11"; + home = { + # Not sure why this variable is not filling up automatically + sessionPath = [ "${homeDirectory}/.nix-profile/bin" ]; + stateVersion = "23.11"; + }; # Disable some modules home-manager = { darwin.enable = false; @@ -239,24 +243,25 @@ trap "rm -rf $HOME" EXIT ${homeManager.activationPackage}/activate + . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" zsh -l && exit 0 ''; }; })) - { - # Allows the user to use our cache when using `nix run `. - nixConfig = { - extra-substituters = [ - "https://nix-community.cachix.org" - "https://thiagokokada-nix-configs.cachix.org" - ]; - extra-trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "thiagokokada-nix-configs.cachix.org-1:MwFfYIvEHsVOvUPSEpvJ3mA69z/NnY6LQqIQJFvNwOc=" - ]; - }; - } + { + # Allows the user to use our cache when using `nix run `. + nixConfig = { + extra-substituters = [ + "https://nix-community.cachix.org" + "https://thiagokokada-nix-configs.cachix.org" + ]; + extra-trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "thiagokokada-nix-configs.cachix.org-1:MwFfYIvEHsVOvUPSEpvJ3mA69z/NnY6LQqIQJFvNwOc=" + ]; + }; + } ]); # END recursiveMergeAttrs }