refactor(buildClan): simplify pkgs overriding logic
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
pkgsForSystem,
|
||||
system,
|
||||
}:
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(
|
||||
{
|
||||
# For vars we need to override the system so we run vars
|
||||
# generators on the machine that runs `clan vars generate`. If a
|
||||
# users is using the `pkgsForSystem`, we don't set
|
||||
# nixpkgs.hostPlatform it would conflict with the `nixpkgs.pkgs`
|
||||
# option.
|
||||
nixpkgs.hostPlatform = lib.mkIf (system != null && (pkgsForSystem system) != null) (
|
||||
lib.mkForce system
|
||||
);
|
||||
}
|
||||
// lib.optionalAttrs (pkgs != null) { nixpkgs.pkgs = lib.mkForce pkgs; }
|
||||
)
|
||||
];
|
||||
}
|
||||
17
lib/build-clan/machineModules/overridePkgs.nix
Normal file
17
lib/build-clan/machineModules/overridePkgs.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
pkgs,
|
||||
}:
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
({
|
||||
# For vars we need to ensure that the system so we run vars generate on
|
||||
# is in sync with the pkgs of the system
|
||||
nixpkgs.hostPlatform = lib.mkForce pkgs.system;
|
||||
nixpkgs.pkgs = lib.mkForce pkgs;
|
||||
})
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user