flake: clean up nixpkgsFor-related functions
This commit is contained in:
parent
7b9910f287
commit
2bd98e6764
26
flake.nix
26
flake.nix
|
@ -40,17 +40,6 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
nixpkgsCompiledBy = local: nixpkgs.legacyPackages."${local}";
|
nixpkgsCompiledBy = local: nixpkgs.legacyPackages."${local}";
|
||||||
# return something which behaves like `pkgs`, for the provided system
|
|
||||||
# `local` = architecture of builder. `target` = architecture of the system beying deployed to
|
|
||||||
nixpkgsFor = local: target:
|
|
||||||
import ((nixpkgsCompiledBy local).path) {
|
|
||||||
crossSystem = target;
|
|
||||||
localSystem = local;
|
|
||||||
};
|
|
||||||
# evaluate ONLY our overlay, for the provided system
|
|
||||||
customPackagesFor = local: target:
|
|
||||||
let pkgs = nixpkgsFor local target;
|
|
||||||
in import ./pkgs/overlay.nix pkgs pkgs;
|
|
||||||
|
|
||||||
decl-host = { name, local, target }:
|
decl-host = { name, local, target }:
|
||||||
let
|
let
|
||||||
|
@ -126,23 +115,18 @@
|
||||||
# non-emulated packages build *from* local *for* target.
|
# non-emulated packages build *from* local *for* target.
|
||||||
# for large packages like the linux kernel which are expensive to build under emulation,
|
# for large packages like the linux kernel which are expensive to build under emulation,
|
||||||
# the config can explicitly pull such packages from `pkgs.cross` to do more efficient cross-compilation.
|
# the config can explicitly pull such packages from `pkgs.cross` to do more efficient cross-compilation.
|
||||||
# crossFrom."x86_64-linux" = (nixpkgsFor "x86_64-linux" prev.stdenv.buildPlatform) // (customPackagesFor local target);
|
|
||||||
crossFrom."x86_64-linux" = (prev.forceSystem "x86_64-linux" null).appendOverlays next.overlays;
|
crossFrom."x86_64-linux" = (prev.forceSystem "x86_64-linux" null).appendOverlays next.overlays;
|
||||||
crossFrom."aarch64-linux" = (prev.forceSystem "x86_64-linux" null).appendOverlays next.overlays;
|
crossFrom."aarch64-linux" = (prev.forceSystem "x86_64-linux" null).appendOverlays next.overlays;
|
||||||
|
|
||||||
# cross-compatible packages
|
|
||||||
# gocryptfs = cross.gocryptfs;
|
|
||||||
|
|
||||||
# pinned packages:
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
packages =
|
packages =
|
||||||
let
|
let
|
||||||
allPkgsFor = sys: (customPackagesFor sys sys) // {
|
allPkgsFor = sys:
|
||||||
nixpkgs = nixpkgsCompiledBy sys;
|
let pkgs = nixpkgsCompiledBy sys; in {
|
||||||
uninsane = uninsane.packages."${sys}";
|
nixpkgs = pkgs;
|
||||||
};
|
uninsane = uninsane.packages."${sys}";
|
||||||
|
} // (self.overlays.pkgs pkgs pkgs);
|
||||||
in {
|
in {
|
||||||
x86_64-linux = allPkgsFor "x86_64-linux";
|
x86_64-linux = allPkgsFor "x86_64-linux";
|
||||||
aarch64-linux = allPkgsFor "aarch64-linux";
|
aarch64-linux = allPkgsFor "aarch64-linux";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user