pkgs/overlays/unstable: allow setting unstable revision

This commit is contained in:
Wroclaw 2024-07-03 01:01:54 +02:00
parent bc5c7553db
commit 7f81b391c1

View file

@ -2,12 +2,21 @@ 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 builtins.fetchTarball "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" then if !builtins.isNull unstableRevisionHash
else builtins.fetchTarball "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; 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"
else builtins.fetchTarball "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
# Compiled nixpkgs expression eg expressions from a nix channel # Compiled nixpkgs expression eg expressions from a nix channel
nixpkgsVersion = builtins.concatStringsSep "." [ nixpkgsVersion = builtins.concatStringsSep "." [
(builtins.readFile "${unstablePkgsExprs}/.version") (builtins.readFile "${unstablePkgsExprs}/.version")