aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-05-16 12:03:38 +0200
committerMartin Fischer <martin@push-f.com>2026-05-16 12:10:50 +0200
commit24c971ff89fa4152ce776efbc0267b629ea79d32 (patch)
treeab89ea5c493865c3423ae7cc2787148e4168ce75
parent737c2c2d92ecc3f2e0bb1e528e987efa21e66566 (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.
-rw-r--r--nixos/profiles/common/sanix.nix7
-rw-r--r--nixos/profiles/workstation/default.nix7
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 <nixos-config>}"
- ];
- 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 <nixos-config>}"
+ ];
+ environment.variables.NIXPKGS_CONFIG = lib.mkForce (toString ./nixpkgs/config.nix);
+
users.users.${cfg.username} = {
isNormalUser = true;
extraGroups = [