nixos-configuration/pkgs/overlays/unstable.nix
2024-09-14 19:51:36 +02:00

24 lines
889 B
Nix

self: super:
let
nixos = self.config.nixos or true;
useUnstable = self.config.useUnstable or true;
unstablePkgsExprs = 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
nixpkgsVersion = builtins.concatStringsSep "." [
(builtins.readFile "${unstablePkgsExprs}/.version")
(builtins.readFile "${unstablePkgsExprs}/.version-suffix")
];
nixpkgsRevision = (builtins.readFile "${unstablePkgsExprs}/.git-revision");
in
import ./unstable-from-source.nix {
unstableSource = unstablePkgsExprs;
} self super // {
unstableVersion = self.lib.optionalString useUnstable nixpkgsVersion;
unstableRevision = self.lib.optionalString useUnstable nixpkgsRevision;
}