WIP create ergonomic per-system flake helper
This commit is contained in:
parent
f809786caf
commit
175e2fb067
14
flake.nix
14
flake.nix
|
@ -39,6 +39,20 @@
|
||||||
];
|
];
|
||||||
} // builtins.removeAttrs args [ "modules" ]
|
} // builtins.removeAttrs args [ "modules" ]
|
||||||
);
|
);
|
||||||
|
mkFlake = flakeDef:
|
||||||
|
let
|
||||||
|
rewritePerSystem = sectionDef: (forAllSystems (system:
|
||||||
|
builtins.mapAttrs (name: value:
|
||||||
|
nixpkgs.legacyPackages.${system}.callPackage value {}
|
||||||
|
) sectionDef
|
||||||
|
));
|
||||||
|
in
|
||||||
|
builtins.mapAttrs (name: value:
|
||||||
|
if name == "packages" || name == "legacyPackages" || name == "devShells" then
|
||||||
|
rewritePerSystem value
|
||||||
|
else
|
||||||
|
value
|
||||||
|
) flakeDef;
|
||||||
});
|
});
|
||||||
|
|
||||||
legacyPackages = forAllSystems (system:
|
legacyPackages = forAllSystems (system:
|
||||||
|
|
Loading…
Reference in New Issue