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/common/sanix.nix | 7 ------- nixos/profiles/workstation/default.nix | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nixos/profiles/common/sanix.nix b/nixos/profiles/common/sanix.nix index a92cb69..407c90c 100644 --- a/nixos/profiles/common/sanix.nix +++ b/nixos/profiles/common/sanix.nix @@ -5,12 +5,5 @@ overlays = import ./nixpkgs/overlays.nix { inherit pkgs; }; }; - # 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); - nix.channel.enable = false; } 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