From bc5c7553db260c1bc1644846726079c6641452bb Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 3 Jul 2024 00:53:09 +0200 Subject: [PATCH 1/2] pkgs/overlays/unstable: fix crosscompiling --- pkgs/overlays/unstable.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/overlays/unstable.nix b/pkgs/overlays/unstable.nix index 9aa8f2c..f40c705 100644 --- a/pkgs/overlays/unstable.nix +++ b/pkgs/overlays/unstable.nix @@ -16,10 +16,10 @@ let nixpkgsRevision = (builtins.readFile "${unstablePkgsExprs}/.git-revision"); unstablePkgsForNixpkgs = nixpkgs: import unstablePkgsExprs { - # localSystem -> pkgs.stdenv.hostPlatform or pkgs.stdenv.hostPlatform ??? - localSystem = nixpkgs.stdenv.hostPlatform; - # crossSystem -> nixpkgs.stdenv.targetPlatform - crossSystem = nixpkgs.stdenv.targetPlatform; + # localSystem -> pkgs.stdenv.buildPlatform + localSystem = nixpkgs.stdenv.buildPlatform; + # crossSystem -> pkgs.stdenv.hostPlatform or pkgs.stdenv.targetPlatform ?? + crossSystem = nixpkgs.stdenv.hostPlatform; # config -> pkgs.config config = nixpkgs.config; # overlays -> partial of pkgs.overlays From 7f81b391c10118e66ad1a3e5fb8cb743bf6e96eb Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 3 Jul 2024 01:01:54 +0200 Subject: [PATCH 2/2] pkgs/overlays/unstable: allow setting unstable revision --- pkgs/overlays/unstable.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/overlays/unstable.nix b/pkgs/overlays/unstable.nix index f40c705..2a20c30 100644 --- a/pkgs/overlays/unstable.nix +++ b/pkgs/overlays/unstable.nix @@ -2,12 +2,21 @@ self: super: let nixos = self.config.nixos or true; + unstableRevision = self.config.unstableRevision or null; + unstableRevisionHash = self.config.unstableRevisionHash or null; 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"; - + unstablePkgsExprs = if !builtins.isNull unstableRevision + then if !builtins.isNull unstableRevisionHash + then builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/${unstableRevision}.tar.gz"; + sha256 = unstableRevisionHash; + } + else builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${unstableRevision}.tar.gz" + else 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")