diff options
| author | Martin Fischer <martin@push-f.com> | 2026-05-16 12:03:38 +0200 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2026-05-16 12:10:50 +0200 |
| commit | 24c971ff89fa4152ce776efbc0267b629ea79d32 (patch) | |
| tree | ab89ea5c493865c3423ae7cc2787148e4168ce75 /nixos/profiles/workstation | |
| parent | 737c2c2d92ecc3f2e0bb1e528e987efa21e66566 (diff) | |
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.
Diffstat (limited to 'nixos/profiles/workstation')
| -rw-r--r-- | nixos/profiles/workstation/default.nix | 7 |
1 files changed, 7 insertions, 0 deletions
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 <nixos-config>}" + ]; + environment.variables.NIXPKGS_CONFIG = lib.mkForce (toString ./nixpkgs/config.nix); + users.users.${cfg.username} = { isNormalUser = true; extraGroups = [ |
