feat(hive.nix): Refactor mkNixpkgsConfig

This commit is contained in:
Tom Hubrecht 2024-12-08 12:10:50 +01:00
parent 3a325437b8
commit 4fa4d0bc21
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc

View file

@ -55,13 +55,12 @@ 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 = mkNixpkgsConfig =
system: version: system:
if system == "nixos" then {
{ } nixos = _: { };
else if system == "zyxel-nwa50ax" then zyxel-nwa50ax = mkLiminixConfig system;
(mkLiminixConfig system version) }
else .${system} or (throw "Unknown system: ${system} for nixpkgs configuration instantiation");
(throw "Unknown system: ${system} for nixpkgs configuration instantiation");
# Instanciates the required nixpkgs version # Instanciates the required nixpkgs version
mkSystemNixpkgs = system: version: import (mkNixpkgs' version) (mkNixpkgsConfig system version); mkSystemNixpkgs = system: version: import (mkNixpkgs' version) (mkNixpkgsConfig system version);