Skip to content
Snippets Groups Projects
Commit b9d9c862 authored by Benjamin Koch's avatar Benjamin Koch
Browse files

apply overlay by re-importing nixpkgs

This feels like a very hacky solution - especially inside a flake.
However, other do the same so I guess it is ok:
https://github.com/edolstra/dwarffs/blob/a536d80ed446d5a442f6c7c9b12c662e48fe60ea/flake.nix#L41
parent fe9e96a2
No related branches found
No related tags found
No related merge requests found
......@@ -3,13 +3,16 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09";
outputs = { self, nixpkgs }: {
overlay = import ./overlay.nix;
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
fixOverlay = system: import ./release.nix { nixpkgsPath = nixpkgs; inherit system; };
in {
overlay = import ./overlay.nix;
packages = forAllSystems fixOverlay;
packages = let
# doesn't work because it doesn't update the packages used by callPackage
#fixOverlay = arch: let super = nixpkgs.legacyPackages.${arch}; x = self.overlay (super // x) super; in x;
fixOverlay = system: import ./release.nix { pkgs = nixpkgs.legacyPackages.${system}; inherit system; };
in { aarch64-linux = fixOverlay "aarch64-linux"; x86_64-linux = fixOverlay "x86_64-linux"; };
};
defaultPackage = forAllSystems (system: self.packages.${system}.espressif-esp32-tools);
};
}
......@@ -45,6 +45,6 @@ self: super: {
'';
}) {};
cntr = self.callPackage ./cntr/cntr-aarch64.nix {};
cntr = self.callPackage ./cntr/cntr-aarch64.nix { cntr = super.cntr; };
cntr-new = self.callPackage ./cntr/cntr-1.4.0.nix {};
}
......@@ -28,8 +28,9 @@ in
, crossBinaryCacheSystem ? if crossAarch64 then "aarch64-linux" else null
, system ? builtins.currentSystem
, extraArgs ? {}
, nixpkgsPath ? <nixpkgs> # only used if cross* arguments are not used
, pkgs ? if crossSystem == null
then import <nixpkgs> ({ inherit system; } // (addOverlay overlay extraArgs))
then import nixpkgsPath ({ inherit system; } // (addOverlay overlay extraArgs))
else mkPkgsCross crossSystem crossBinaryCacheSystem (addOverlay overlay extraArgs)
}:
pkgs.lib.attrsets.mapAttrs (name: _: pkgs."${name}") (overlay {} {}) // { inherit pkgs; }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment