From 667f7d819910f63540ed36f51baf8d39926732b2 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 2 Oct 2024 02:20:46 +0200 Subject: [PATCH] pkgs/overlays/cosmic-packages: use packages constructor from upstream --- pkgs/overlays/cosmic-packages.nix | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/pkgs/overlays/cosmic-packages.nix b/pkgs/overlays/cosmic-packages.nix index 4026eae..fcaee7b 100644 --- a/pkgs/overlays/cosmic-packages.nix +++ b/pkgs/overlays/cosmic-packages.nix @@ -4,8 +4,6 @@ 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 from cosmic-modules cosmicModulesLock = builtins.fromJSON (builtins.readFile "${nixos-cosmic}/flake.lock"); @@ -18,33 +16,17 @@ let sha256 = pinnedNixpkgsNarHash; }; - # Take rustPackages from pinned nixpkgs + # Initialize pinned 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 -) +import "${nixos-cosmic}/pkgs" { + final = self; + prev = super; + rustPlatform = futureNixpkgs.rustPlatform; +}