Compare commits
No commits in common. "d543c41694fca95a5e0a3bc1f2b952cc68a11374" and "c188003188d714feaefba65fce0c49cbea0098de" have entirely different histories.
d543c41694
...
c188003188
2 changed files with 29 additions and 38 deletions
|
@ -1,34 +0,0 @@
|
||||||
{
|
|
||||||
unstableSource,
|
|
||||||
}:
|
|
||||||
|
|
||||||
self: super:
|
|
||||||
|
|
||||||
let
|
|
||||||
useUnstable = self.config.useUnstable or true;
|
|
||||||
sanitizePlatform = platformConfig: self.lib.removeAttrs platformConfig [
|
|
||||||
"emulator"
|
|
||||||
"emulatorAvailable"
|
|
||||||
];
|
|
||||||
|
|
||||||
unstablePkgsForNixpkgs = nixpkgs: import unstableSource {
|
|
||||||
# localSystem -> pkgs.stdenv.buildPlatform
|
|
||||||
localSystem = sanitizePlatform nixpkgs.stdenv.buildPlatform;
|
|
||||||
# crossSystem -> pkgs.stdenv.hostPlatform or pkgs.stdenv.targetPlatform ??
|
|
||||||
# passing below
|
|
||||||
# config -> pkgs.config
|
|
||||||
config = nixpkgs.config;
|
|
||||||
# overlays -> partial of pkgs.overlays
|
|
||||||
overlays = nixpkgs.overlays;
|
|
||||||
# crossOverlays -> partial of pkgs.overlays
|
|
||||||
# crossOverlays are merged to overlays, not sure what issues that might raise.
|
|
||||||
# ignoring.
|
|
||||||
} // (if nixpkgs.stdenv.buildPlatform == nixpkgs.stdenv.hostPlatform then {} else {
|
|
||||||
# workaround for some odd structured packages that changes behaviour
|
|
||||||
# when crossSystem is passed.
|
|
||||||
crossSystem = sanitizePlatform nixpkgs.stdenv.hostPlatform;
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
unstable = if useUnstable then unstablePkgsForNixpkgs self else self;
|
|
||||||
}
|
|
|
@ -2,9 +2,18 @@ self: super:
|
||||||
|
|
||||||
let
|
let
|
||||||
nixos = self.config.nixos or true;
|
nixos = self.config.nixos or true;
|
||||||
|
unstableRevision = self.config.unstableRevision or null;
|
||||||
|
unstableRevisionHash = self.config.unstableRevisionHash or null;
|
||||||
useUnstable = self.config.useUnstable or true;
|
useUnstable = self.config.useUnstable or true;
|
||||||
|
|
||||||
unstablePkgsExprs = if nixos
|
unstablePkgsExprs = if !builtins.isNull unstableRevision
|
||||||
|
then if !builtins.isNull unstableRevisionHash
|
||||||
|
then builtins.fetchTarball {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/${unstableRevision}.tar.gz";
|
||||||
|
sha256 = unstableRevisionHash;
|
||||||
|
}
|
||||||
|
else builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${unstableRevision}.tar.gz"
|
||||||
|
else if nixos
|
||||||
then builtins.fetchTarball "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
|
then builtins.fetchTarball "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
|
||||||
else builtins.fetchTarball "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
|
else builtins.fetchTarball "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
|
||||||
|
|
||||||
|
@ -15,10 +24,26 @@ let
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgsRevision = (builtins.readFile "${unstablePkgsExprs}/.git-revision");
|
nixpkgsRevision = (builtins.readFile "${unstablePkgsExprs}/.git-revision");
|
||||||
|
unstablePkgsForNixpkgs = nixpkgs: import unstablePkgsExprs {
|
||||||
|
# localSystem -> pkgs.stdenv.buildPlatform
|
||||||
|
localSystem = nixpkgs.stdenv.buildPlatform;
|
||||||
|
# crossSystem -> pkgs.stdenv.hostPlatform or pkgs.stdenv.targetPlatform ??
|
||||||
|
# passing below
|
||||||
|
# config -> pkgs.config
|
||||||
|
config = nixpkgs.config;
|
||||||
|
# overlays -> partial of pkgs.overlays
|
||||||
|
overlays = nixpkgs.overlays;
|
||||||
|
# crossOverlays -> partial of pkgs.overlays
|
||||||
|
# crossOverlays are merged to overlays, not sure what issues that might raise.
|
||||||
|
# ignoring.
|
||||||
|
} // (if nixpkgs.stdenv.buildPlatform == nixpkgs.stdenv.hostPlatform then {} else {
|
||||||
|
# workaround for some odd structured packages that changes behaviour
|
||||||
|
# when crossSystem is passed.
|
||||||
|
crossSystem = nixpkgs.stdenv.hostPlatform;
|
||||||
|
});
|
||||||
in
|
in
|
||||||
import ./unstable-from-source.nix {
|
{
|
||||||
unstableSource = unstablePkgsExprs;
|
unstable = if useUnstable then unstablePkgsForNixpkgs self else self;
|
||||||
} self super // {
|
|
||||||
unstableVersion = self.lib.optionalString useUnstable nixpkgsVersion;
|
unstableVersion = self.lib.optionalString useUnstable nixpkgsVersion;
|
||||||
unstableRevision = self.lib.optionalString useUnstable nixpkgsRevision;
|
unstableRevision = self.lib.optionalString useUnstable nixpkgsRevision;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue