pkgs/overlay/cosmic-packages: build cosmic using locked nixpkgs
but with future rust cosmic didn't work at all when I just made it using futureNixpkgs.
This commit is contained in:
parent
6b1ea56d8b
commit
99a59bfb6b
1 changed files with 22 additions and 9 deletions
|
@ -1,5 +1,7 @@
|
||||||
{ inputs ? import ../../inputs.nix {}}:
|
{ inputs ? import ../../inputs.nix {}}:
|
||||||
|
|
||||||
|
self: super:
|
||||||
|
|
||||||
let
|
let
|
||||||
nixos-cosmic = inputs.cosmic-modules;
|
nixos-cosmic = inputs.cosmic-modules;
|
||||||
cosmicPkgsMainDir = builtins.readDir "${nixos-cosmic}/pkgs";
|
cosmicPkgsMainDir = builtins.readDir "${nixos-cosmic}/pkgs";
|
||||||
|
@ -11,15 +13,26 @@ let
|
||||||
url = "https://github.com/NixOS/nixpkgs/archive/b79cec4237cd0f655562890bf927466c68b48d68.tar.gz";
|
url = "https://github.com/NixOS/nixpkgs/archive/b79cec4237cd0f655562890bf927466c68b48d68.tar.gz";
|
||||||
sha256 = "1mswisq9iwffg2d6rfxvr27mvi4w853d9rn222s2g76445d0iqh8";
|
sha256 = "1mswisq9iwffg2d6rfxvr27mvi4w853d9rn222s2g76445d0iqh8";
|
||||||
};
|
};
|
||||||
cosmicOverlay = self: super: builtins.listToAttrs (
|
|
||||||
builtins.map (v: {name = v; value = self.callPackage "${nixos-cosmic}/pkgs/${v}/package.nix" {};}) cosmicPkgsDirs
|
# Take rustPackages from staging nixpkgs
|
||||||
|
stagingNixpkgs = import stagingNixpkgsSrc {
|
||||||
|
localSystem = self.stdenv.buildPlatform;
|
||||||
|
config = self.config;
|
||||||
|
} // (if self.stdenv.buildPlatform == self.stdenv.hostPlatform then {} else {
|
||||||
|
crossSystem = self.stdenv.hostPlatform;
|
||||||
|
});
|
||||||
|
futureRustPackages = stagingNixpkgs.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
|
||||||
);
|
);
|
||||||
in
|
cosmicNixpkgs = import inputs.nixpkgs {
|
||||||
|
|
||||||
self: super:
|
|
||||||
|
|
||||||
let
|
|
||||||
stagingNixpkgs = import stagingNixpkgsSrc {
|
|
||||||
localSystem = self.stdenv.buildPlatform;
|
localSystem = self.stdenv.buildPlatform;
|
||||||
config = self.config;
|
config = self.config;
|
||||||
overlays = [ cosmicOverlay ];
|
overlays = [ cosmicOverlay ];
|
||||||
|
@ -29,5 +42,5 @@ stagingNixpkgs = import stagingNixpkgsSrc {
|
||||||
in
|
in
|
||||||
|
|
||||||
builtins.listToAttrs (
|
builtins.listToAttrs (
|
||||||
builtins.map (v: {name = v; value = stagingNixpkgs.${v};}) cosmicPkgsDirs
|
builtins.map (v: {name = v; value = cosmicNixpkgs.${v};}) cosmicPkgsDirs
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue