From 24c971ff89fa4152ce776efbc0267b629ea79d32 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 16 May 2026 12:03:38 +0200 Subject: refactor: set nixPath and NIXPKGS_CONFIG only in workstation Referencing pkgs.path in /etc/set-environment caused the system derivations to needlessly depend on ~460M of nixpkgs (which slowed down server deployments). The only downside is that `nix-shell -p` doesn't work anymore on the servers. And the other paths are local to my hamac laptop and don't exist on the servers. --- nixos/profiles/workstation/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nixos/profiles/workstation') diff --git a/nixos/profiles/workstation/default.nix b/nixos/profiles/workstation/default.nix index dab51dc..199c177 100644 --- a/nixos/profiles/workstation/default.nix +++ b/nixos/profiles/workstation/default.nix @@ -23,6 +23,13 @@ in ]; config = { + # Makes commands default to the same Nixpkgs, config, overlays and NixOS configuration + nix.nixPath = [ + "nixpkgs=${pkgs.path}" + "nixos-config=${toString }" + ]; + environment.variables.NIXPKGS_CONFIG = lib.mkForce (toString ./nixpkgs/config.nix); + users.users.${cfg.username} = { isNormalUser = true; extraGroups = [ -- cgit v1.3.1