diff --git a/configs/nixos/modules/host/default.nix b/configs/nixos/modules/host/default.nix index 8b3c1be..49380de 100644 --- a/configs/nixos/modules/host/default.nix +++ b/configs/nixos/modules/host/default.nix @@ -53,6 +53,7 @@ in home.username = config.user.name; home.homeDirectory = "/home/${config.user.name}"; home.stateVersion = config.system.stateVersion; + home.sessionVariables = lib.attrByPath [ config.networking.hostName ] { } config.registry.env; home.packages = with pkgs; [ eza unzip diff --git a/configs/nixos/modules/shell/python.nix b/configs/nixos/modules/shell/python.nix index 403433f..09d2113 100644 --- a/configs/nixos/modules/shell/python.nix +++ b/configs/nixos/modules/shell/python.nix @@ -13,9 +13,8 @@ in lib.mkEnableOption "Python tools for the primary user's shell environment"; config = lib.mkIf config.modules.shell.python.enable { - home-manager.users.${user}.home = { - sessionVariables.PYTHON_TOOLCHAIN_ROOT = "${pkgs.python3}"; - packages = [ pkgs.python3 ]; - }; + registry.env.${config.networking.hostName}.PYTHON_TOOLCHAIN_ROOT = "${pkgs.python3}"; + + home-manager.users.${user}.home.packages = [ pkgs.python3 ]; }; } diff --git a/configs/nixos/modules/shell/rust.nix b/configs/nixos/modules/shell/rust.nix index ac3d791..092fbaf 100644 --- a/configs/nixos/modules/shell/rust.nix +++ b/configs/nixos/modules/shell/rust.nix @@ -23,9 +23,9 @@ in lib.mkEnableOption "Rust tools for the primary user's shell environment"; config = lib.mkIf config.modules.shell.rust.enable { - home-manager.users.${user} = { - home.sessionVariables.RUST_TOOLCHAIN_ROOT = "${toolchain}"; + registry.env.${config.networking.hostName}.RUST_TOOLCHAIN_ROOT = "${toolchain}"; + home-manager.users.${user} = { home.packages = [ toolchain pkgs.rust-analyzer diff --git a/configs/nixos/registry/env.nix b/configs/nixos/registry/env.nix new file mode 100644 index 0000000..8a6fd91 --- /dev/null +++ b/configs/nixos/registry/env.nix @@ -0,0 +1,4 @@ +{ lib, ... }: +{ + type = lib.types.str; +}