From 4fa4d0bc2153c4e458db4a2a355127937c05a943 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sun, 8 Dec 2024 12:10:50 +0100 Subject: [PATCH] feat(hive.nix): Refactor mkNixpkgsConfig --- hive.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hive.nix b/hive.nix index f5a17f3..2316de7 100644 --- a/hive.nix +++ b/hive.nix @@ -53,15 +53,14 @@ let }; }; - # Build up the arguments to instantiate a nixpkgs given a system and a version. + # Build up the arguments to instantiate a nixpkgs given a system and a version. mkNixpkgsConfig = - system: version: - if system == "nixos" then - { } - else if system == "zyxel-nwa50ax" then - (mkLiminixConfig system version) - else - (throw "Unknown system: ${system} for nixpkgs configuration instantiation"); + system: + { + nixos = _: { }; + zyxel-nwa50ax = mkLiminixConfig system; + } + .${system} or (throw "Unknown system: ${system} for nixpkgs configuration instantiation"); # Instanciates the required nixpkgs version mkSystemNixpkgs = system: version: import (mkNixpkgs' version) (mkNixpkgsConfig system version);