nixos-configuration/pkgs/overlays/cosmic-packages.nix
Wroclaw 2d24ce7fd4 pkgs/overlays/cosmic-packages: use unstable-from-source overlay
code here wants to do the same thing as unstable-from-source overlay
2025-01-03 02:30:33 +01:00

34 lines
944 B
Nix

{
inputs ? import ../../inputs.nix {},
rustPlatform ? null,
}:
self: super:
let
nixos-cosmic = inputs.cosmic-modules;
# Pinned unstable nixpkgs from cosmic-modules
cosmicModulesLock = builtins.fromJSON (builtins.readFile "${nixos-cosmic}/flake.lock");
pinnedNixpkgsRev = cosmicModulesLock.nodes.nixpkgs.locked.rev;
pinnedNixpkgsNarHash = cosmicModulesLock.nodes.nixpkgs.locked.narHash;
futureNixpkgsSrc = builtins.fetchTarball {
name = "nixpkgs";
url = "https://github.com/NixOS/nixpkgs/archive/${pinnedNixpkgsRev}.tar.gz";
sha256 = pinnedNixpkgsNarHash;
};
# Initialize pinned nixpkgs
futureNixpkgs = let
extended = self.extend (import ./unstable-from-source.nix {
unstableSource = futureNixpkgsSrc;
});
in extended.unstable;
in
import "${nixos-cosmic}/pkgs" {
final = self;
prev = super;
rustPlatform = if rustPlatform != null then rustPlatform else futureNixpkgs.rustPlatform;
}