From 4067b71e9db33e6333e5f20714bc05d962f82ade Mon Sep 17 00:00:00 2001 From: wucke13 Date: Mon, 8 Jul 2024 23:59:49 +0200 Subject: [PATCH] chore: consolidate nixpkgs imports Signed-off-by: Wanja Zaeske --- .github/workflows/nix.yaml | 37 ++++++++ flake.nix | 177 ++++++++++++------------------------- 2 files changed, 94 insertions(+), 120 deletions(-) diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml index 4c868ce..505c551 100644 --- a/.github/workflows/nix.yaml +++ b/.github/workflows/nix.yaml @@ -91,6 +91,22 @@ jobs: authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build run: nix build .#packages.x86_64-linux.crossStdenvAarch64 --print-build-logs + x86_64-linux---packages---crossStdenvAarch64OldBintools: + name: x86_64-linux---packages---crossStdenvAarch64OldBintools + runs-on: + - ubuntu-latest + needs: [] + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/cachix-action@v14 + with: + name: dlr-ft + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - name: Build + run: nix build .#packages.x86_64-linux.crossStdenvAarch64OldBintools --print-build-logs x86_64-linux---packages---crossStdenvArmv7l: name: x86_64-linux---packages---crossStdenvArmv7l runs-on: @@ -107,6 +123,22 @@ jobs: authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build run: nix build .#packages.x86_64-linux.crossStdenvArmv7l --print-build-logs + x86_64-linux---packages---crossStdenvArmv7lOldBintools: + name: x86_64-linux---packages---crossStdenvArmv7lOldBintools + runs-on: + - ubuntu-latest + needs: [] + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/cachix-action@v14 + with: + name: dlr-ft + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - name: Build + run: nix build .#packages.x86_64-linux.crossStdenvArmv7lOldBintools --print-build-logs x86_64-linux---packages---crossStdenvi686: name: x86_64-linux---packages---crossStdenvi686 runs-on: @@ -245,6 +277,7 @@ jobs: - x86_64-linux---packages---camkes-deps - x86_64-linux---packages---capDL-tool - x86_64-linux---packages---concurrencytest + - x86_64-linux---packages---crossStdenvAarch64OldBintools - x86_64-linux---packages---guardonce - x86_64-linux---packages---pyfdt - x86_64-linux---packages---seL4-deps @@ -267,6 +300,7 @@ jobs: - x86_64-linux---packages---camkes-deps - x86_64-linux---packages---capDL-tool - x86_64-linux---packages---concurrencytest + - x86_64-linux---packages---crossStdenvAarch64OldBintools - x86_64-linux---packages---guardonce - x86_64-linux---packages---pyfdt - x86_64-linux---packages---seL4-deps @@ -289,6 +323,7 @@ jobs: - x86_64-linux---packages---camkes-deps - x86_64-linux---packages---capDL-tool - x86_64-linux---packages---concurrencytest + - x86_64-linux---packages---crossStdenvAarch64OldBintools - x86_64-linux---packages---guardonce - x86_64-linux---packages---pyfdt - x86_64-linux---packages---seL4-deps @@ -311,6 +346,7 @@ jobs: - x86_64-linux---packages---camkes-deps - x86_64-linux---packages---capDL-tool - x86_64-linux---packages---concurrencytest + - x86_64-linux---packages---crossStdenvAarch64OldBintools - x86_64-linux---packages---guardonce - x86_64-linux---packages---pyfdt - x86_64-linux---packages---seL4-deps @@ -333,6 +369,7 @@ jobs: - x86_64-linux---packages---camkes-deps - x86_64-linux---packages---capDL-tool - x86_64-linux---packages---concurrencytest + - x86_64-linux---packages---crossStdenvArmv7lOldBintools - x86_64-linux---packages---guardonce - x86_64-linux---packages---pyfdt - x86_64-linux---packages---seL4-deps diff --git a/flake.nix b/flake.nix index c8feb91..db4196f 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,18 @@ overlays = [ self.overlays.default ]; }); + pkgsCrossArmv7lOldBintools = (import nixpkgs { + inherit system; + crossSystem.config = "armv7l-unknown-linux-gnueabihf"; + overlays = [ self.overlays.default self.overlays.oldBintools ]; + }); + + pkgsCrossAarch64OldBintools = (import nixpkgs { + inherit system; + crossSystem.config = "aarch64-unknown-linux-gnu"; + overlays = [ self.overlays.default self.overlays.oldBintools ]; + }); + pkgsCrossi686 = (import nixpkgs { inherit system; crossSystem.config = "i686-unknown-linux-gnu"; @@ -50,6 +62,8 @@ # crossStdenvAarch64 = pkgsCrossAarch64.stdenvNoLibs; crossStdenvArmv7l = pkgsCrossArmv7l.stdenvNoLibs; + crossStdenvAarch64OldBintools = pkgsCrossAarch64OldBintools.stdenvNoLibs; + crossStdenvArmv7lOldBintools = pkgsCrossArmv7lOldBintools.stdenvNoLibs; crossStdenvi686 = pkgsCrossi686.stdenvNoLibs; crossStdenvx86_64 = pkgsCrossx86_64.stdenvNoLibs; @@ -293,134 +307,49 @@ # ### seL4 CAmkES VM Examples # - seL4-camkes-vm-examples-aarch64-tx1 = - let - pkgsCross = (import nixpkgs { - inherit system; - crossSystem.config = "aarch64-unknown-linux-gnu"; - overlays = [ - self.overlays.default - # seL4's musllibc fork can't stand modern bintools because its too old. - (final: prev: { - bintools = prev.wrapBintoolsWith { - bintools = prev.binutils-unwrapped_2_38; - libc = prev.stdenv.cc.libc; - }; - }) - ]; - }); - in - pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { - stdenvNoLibs = pkgsCross.overrideCC pkgsCross.stdenvNoLibs pkgsCross.stdenvNoLibs.cc; - extraCmakeFlags = [ - "-DPLATFORM=tx1" - "-DCAMKES_VM_APP=vm_minimal" - ]; - }; + seL4-camkes-vm-examples-aarch64-tx1 = pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { + stdenvNoLibs = pkgsCrossAarch64OldBintools.overrideCC pkgsCrossAarch64OldBintools.stdenvNoLibs pkgsCrossAarch64OldBintools.stdenvNoLibs.cc; + extraCmakeFlags = [ + "-DPLATFORM=tx1" + "-DCAMKES_VM_APP=vm_minimal" + ]; + }; - seL4-camkes-vm-examples-aarch64-tx2 = - let - pkgsCross = (import nixpkgs { - inherit system; - crossSystem.config = "aarch64-unknown-linux-gnu"; - overlays = [ - self.overlays.default - # seL4's musllibc fork can't stand modern bintools because its too old. - (final: prev: { - bintools = prev.wrapBintoolsWith { - bintools = prev.binutils-unwrapped_2_38; - libc = prev.stdenv.cc.libc; - }; - }) - ]; - }); - in - pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { - stdenvNoLibs = pkgsCross.overrideCC pkgsCross.stdenvNoLibs pkgsCross.stdenvNoLibs.cc; - extraCmakeFlags = [ - "-DPLATFORM=tx2" - "-DCAMKES_VM_APP=vm_minimal" - ]; - }; + seL4-camkes-vm-examples-aarch64-tx2 = pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { + stdenvNoLibs = pkgsCrossAarch64OldBintools.overrideCC pkgsCrossAarch64OldBintools.stdenvNoLibs pkgsCrossAarch64OldBintools.stdenvNoLibs.cc; + extraCmakeFlags = [ + "-DPLATFORM=tx2" + "-DCAMKES_VM_APP=vm_minimal" + ]; + }; - seL4-camkes-vm-examples-aarch64-qemu-arm-virt = - let - pkgsCross = (import nixpkgs { - inherit system; - crossSystem.config = "aarch64-unknown-linux-gnu"; - overlays = [ - self.overlays.default - # seL4's musllibc fork can't stand modern bintools because its too old. - (final: prev: { - bintools = prev.wrapBintoolsWith { - bintools = prev.binutils-unwrapped_2_38; - libc = prev.stdenv.cc.libc; - }; - }) - ]; - }); - in - pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { - stdenvNoLibs = pkgsCross.overrideCC pkgsCross.stdenvNoLibs pkgsCross.stdenvNoLibs.cc; - extraCmakeFlags = [ - "-DPLATFORM=qemu-arm-virt" - "-DCAMKES_VM_APP=vm_minimal" - ]; - }; + seL4-camkes-vm-examples-aarch64-qemu-arm-virt = pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { + stdenvNoLibs = pkgsCrossAarch64OldBintools.overrideCC pkgsCrossAarch64OldBintools.stdenvNoLibs pkgsCrossAarch64OldBintools.stdenvNoLibs.cc; + extraCmakeFlags = [ + "-DPLATFORM=qemu-arm-virt" + "-DCAMKES_VM_APP=vm_minimal" + ]; + }; - seL4-camkes-vm-examples-aarch64-zcu102 = - let - pkgsCross = (import nixpkgs { - inherit system; - crossSystem.config = "aarch64-unknown-linux-gnu"; - overlays = [ - self.overlays.default - # seL4's musllibc fork can't stand modern bintools because its too old. - (final: prev: { - bintools = prev.wrapBintoolsWith { - bintools = prev.binutils-unwrapped_2_38; - libc = prev.stdenv.cc.libc; - }; - }) - ]; - }); - in - pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { - stdenvNoLibs = pkgsCross.overrideCC pkgsCross.stdenvNoLibs pkgsCross.stdenvNoLibs.cc; - extraCmakeFlags = [ - "-DPLATFORM=zcu102" - "-DCAMKES_VM_APP=vm_minimal" - ]; - }; + seL4-camkes-vm-examples-aarch64-zcu102 = pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { + stdenvNoLibs = pkgsCrossAarch64OldBintools.overrideCC pkgsCrossAarch64OldBintools.stdenvNoLibs pkgsCrossAarch64OldBintools.stdenvNoLibs.cc; + extraCmakeFlags = [ + "-DPLATFORM=zcu102" + "-DCAMKES_VM_APP=vm_minimal" + ]; + }; - seL4-camkes-vm-examples-armv7l-exynos5422 = - let - pkgsCross = (import nixpkgs { - inherit system; - crossSystem.config = "armv7l-unknown-linux-gnueabi"; - overlays = [ - self.overlays.default - # seL4's musllibc fork can't stand modern bintools because its too old. - (final: prev: { - bintools = prev.wrapBintoolsWith { - bintools = prev.binutils-unwrapped_2_38; - libc = prev.stdenv.cc.libc; - }; - }) - ]; - }); - in - pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { - stdenvNoLibs = pkgsCross.overrideCC pkgsCross.stdenvNoLibs pkgsCross.stdenvNoLibs.cc; - extraCmakeFlags = [ - "-DPLATFORM=exynos5422" - "-DCAMKES_VM_APP=vm_minimal" - ]; - }; + seL4-camkes-vm-examples-armv7l-exynos5422 = pkgs.callPackage pkgs/seL4-camkes-vm-examples.nix { + stdenvNoLibs = pkgsCrossArmv7lOldBintools.overrideCC pkgsCrossArmv7lOldBintools.stdenvNoLibs pkgsCrossArmv7lOldBintools.stdenvNoLibs.cc; + extraCmakeFlags = [ + "-DPLATFORM=exynos5422" + "-DCAMKES_VM_APP=vm_minimal" + ]; + }; # @@ -622,5 +551,13 @@ }) // { # declare overlay with added deps, i. e. the python packages not available in official nixpkgs overlays.default = import ./overlay.nix; + + # seL4's musllibc fork can't stand modern bintools because its too old. + overlays.oldBintools = final: prev: { + bintools = prev.wrapBintoolsWith { + bintools = prev.binutils-unwrapped_2_38; + libc = prev.stdenv.cc.libc; + }; + }; }; }