From cd5a99df67ef5e8cf50b6fac5690f9be11ee6061 Mon Sep 17 00:00:00 2001 From: Philipp Jungkamp Date: Fri, 23 Jun 2023 11:50:07 +0200 Subject: [PATCH] packaging-nix: fix cross-compilation Update nixpkgs for upstream libre cross compilation fix. Use minimal systemd dependency for mosquitto and rdma-core. Signed-off-by: Philipp Jungkamp --- packaging/nix/flake.lock | 8 ++++---- packaging/nix/flake.nix | 23 ++++++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/packaging/nix/flake.lock b/packaging/nix/flake.lock index 3892ff349..321ea822f 100644 --- a/packaging/nix/flake.lock +++ b/packaging/nix/flake.lock @@ -90,16 +90,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1687482344, - "narHash": "sha256-ZKsH8Cpb97Zbozaz26XkLv7Swa5uk3G1Vmy34MVt1ro=", + "lastModified": 1687354544, + "narHash": "sha256-1Xu+QzyA10AiY21i27Zu9bqQAaxXBacNKbGUA9OZy7Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3612945be80f916cde80537433ec0a4a0e6b3d3b", + "rev": "876181e3ae452cc6186486f6f7300a8a6de237cb", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-22.11", + "ref": "release-23.05", "repo": "nixpkgs", "type": "github" } diff --git a/packaging/nix/flake.nix b/packaging/nix/flake.nix index a4eb07670..91c13f242 100644 --- a/packaging/nix/flake.nix +++ b/packaging/nix/flake.nix @@ -2,7 +2,7 @@ description = "a tool for connecting real-time power grid simulation equipment"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; + nixpkgs.url = "github:NixOS/nixpkgs/release-23.05"; common = { url = "github:VILLASframework/common"; @@ -55,18 +55,23 @@ # generate attributes corresponding to all supported combinations of system and crossSystem forSupportedCrossSystems = f: forSupportedSystems (system: lib.genAttrs supportedCrossSystems (f system)); - # this overlay can be applied to nixpkgs (see `pkgsFor` below for an example) - overlay = final: prev: packagesWith final; - # initialize nixpkgs for the specified `system` pkgsFor = system: import nixpkgs { inherit system; - overlays = [overlay]; + overlays = [self.overlays.default]; }; # initialize nixpkgs for cross-compiling from `system` to `crossSystem` - crossPkgsFor = system: crossSystem: (pkgsFor system).pkgsCross.${crossSystem}; + crossPkgsFor = system: crossSystem: + (import nixpkgs { + inherit system; + overlays = [ + self.overlays.default + self.overlays.minimal + ]; + }) + .pkgsCross.${crossSystem}; # build villas and its dependencies for the specified `pkgs` packagesWith = pkgs: rec { @@ -113,7 +118,11 @@ # standard flake attribute allowing you to add the villas packages to your nixpkgs overlays = { - default = overlay; + default = final: prev: packagesWith final; + minimal = final: prev: { + mosquitto = prev.mosquitto.override {systemd = final.systemdMinimal;}; + rdma-core = prev.rdma-core.override {udev = final.systemdMinimal;}; + }; }; # standard flake attribute for defining developer environments