From 0b2af1214889efbd5eb39589f7bd0b8c52eac3bb Mon Sep 17 00:00:00 2001 From: Emmet Date: Thu, 4 Apr 2024 14:09:46 -0500 Subject: [PATCH] Use stable for servers and unstable for other --- flake.nix | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index f56a62e..42b01c9 100644 --- a/flake.nix +++ b/flake.nix @@ -58,14 +58,20 @@ }; # configure pkgs - pkgs = import nixpkgs-patched { - system = systemSettings.system; - config = { - allowUnfree = true; - allowUnfreePredicate = (_: true); - }; - overlays = [ rust-overlay.overlays.default ]; - }; + # use nixpkgs if running a server (homelab or worklab profile) + # otherwise use patched nixos-unstable nixpkgs + pkgs = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab")) + then + pkgs-stable + else + (import nixpkgs-patched { + system = systemSettings.system; + config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + }; + overlays = [ rust-overlay.overlays.default ]; + })); pkgs-stable = import nixpkgs-stable { system = systemSettings.system; @@ -84,7 +90,13 @@ }; # configure lib - lib = nixpkgs.lib; + # use nixpkgs if running a server (homelab or worklab profile) + # otherwise use patched nixos-unstable nixpkgs + lib = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab")) + then + nixpkgs-stable.lib + else + nixpkgs.lib); # Systems that can run tests: supportedSystems = [ "aarch64-linux" "i686-linux" "x86_64-linux" ];