{ inputs ? import ../../inputs.nix {}}: self: super: let nixos-cosmic = inputs.cosmic-modules; cosmicPkgsMainDir = builtins.readDir "${nixos-cosmic}/pkgs"; cosmicPkgsDirs = builtins.filter (v: cosmicPkgsMainDir."${v}" == "directory") (builtins.attrNames cosmicPkgsMainDir); # Pinned unstable nixpkgs futureNixpkgsSrc = builtins.fetchTarball { name = "nixpkgs"; url = "https://github.com/NixOS/nixpkgs/archive/c3aa7b8938b17aebd2deecf7be0636000d62a2b9.tar.gz"; sha256 = "1ds3yjcy52l8d3rkxr3b7h9c0c3nly079bgakjaasnfjj3xprrwr"; }; # Take rustPackages from staging nixpkgs futureNixpkgs = import futureNixpkgsSrc { localSystem = self.stdenv.buildPlatform; config = self.config; } // (if self.stdenv.buildPlatform == self.stdenv.hostPlatform then {} else { crossSystem = self.stdenv.hostPlatform; }); futureRustPackages = futureNixpkgs.rustPackages; # Create nixpkgs with future rust nixpkgsWithFutureRust = self.extend (futureSelf: futureSuper: { rustPackages = futureRustPackages; }); # Create cosmicPkgs that contains cosmic packages built from nixpkgs with future rust cosmicOverlay = cosmicSelf: cosmicSuper: builtins.listToAttrs ( builtins.map (v: {name = v; value = nixpkgsWithFutureRust.callPackage "${nixos-cosmic}/pkgs/${v}/package.nix" {};}) cosmicPkgsDirs ); cosmicNixpkgs = import inputs.nixpkgs { localSystem = self.stdenv.buildPlatform; config = self.config; overlays = [ cosmicOverlay ]; } // (if self.stdenv.buildPlatform == self.stdenv.hostPlatform then {} else { crossSystem = self.stdenv.hostPlatform; }); in builtins.listToAttrs ( builtins.map (v: {name = v; value = cosmicNixpkgs.${v};}) cosmicPkgsDirs )