1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

nix: Remove non-standard crossPkgs Flake output

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel 2024-04-10 00:11:36 +02:00
parent 151274c882
commit 1340508fbc
2 changed files with 0 additions and 58 deletions

View file

@ -25,15 +25,9 @@
# Supported systems for native compilation
supportedSystems = ["x86_64-linux" "aarch64-linux"];
# Supported systems to cross compile to
supportedCrossSystems = ["aarch64-multiplatform"];
# Generate attributes corresponding to all the supported systems
forSupportedSystems = lib.genAttrs supportedSystems;
# Generate attributes corresponding to all supported combinations of system and crossSystem
forSupportedCrossSystems = f: forSupportedSystems (system: lib.genAttrs supportedCrossSystems (f system));
# Initialize nixpkgs for the specified `system`
pkgsFor = system:
import nixpkgs {
@ -41,18 +35,6 @@
overlays = with self.overlays; [default];
};
# Initialize nixpkgs for cross-compiling from `system` to `crossSystem`
crossPkgsFor = system: crossSystem:
(import nixpkgs {
inherit system;
overlays = with self.overlays; [
default
minimal
];
})
.pkgsCross
.${crossSystem};
# Initialize development nixpkgs for the specified `system`
devPkgsFor = system:
import nixpkgs {
@ -88,12 +70,6 @@
packagesWith (pkgsFor system)
);
# Non-standard attribute for cross-compilated packages
crossPackages = forSupportedCrossSystems (
system: crossSystem:
packagesWith (crossPkgsFor system crossSystem)
);
# Standard flake attribute allowing you to add the villas packages to your nixpkgs
overlays = {
default = final: prev: packagesWith final;

View file

@ -127,40 +127,6 @@ docker load < $(nix build --no-link --print-out-paths --impure --expr '
See https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTools
## Simple cross-compilation to aarch64
The flake currently supports `x86_64-linux` and `aarch64-linux` systems. But
especially on some weaker `aarch64` target machines, compiling `villas` from
source is rather cumbersome. This flake has a non-standard `crossPackages`
flake output. This is currently only useful for cross-compiling from `x86_64`
to `aarch64`.
```shell
nix build villas#crossPackages.x86_64-linux.aarch64-multiplatform.villas
```
If your target has a nix installation you can directly build and copy the
cross-compiled package using `nix copy`.
```shell
# build and copy in one
nix copy villas#crossPackages.x86_64-linux.aarch64-multiplatform.villas --to ssh-ng://target-system
```
```shell
# build the cross-compiled package
nix build villas#crossPackages.x86_64-linux.aarch64-multiplatform.villas
# copy it over
nix copy $(readlink result) --to ssh-ng://target
# add the cross-compiled package to the target's PATH
ssh target nix profile add $(readlink result)
```
Further parameters for port or user of the ssh connection can only be specified
in the ssh configuration files.
## Customization
The [`villas.nix`] file contains the Nix "derivation" used to