-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos: fix cross-compiling by using buildPackages for build-time lndir #142273
Conversation
how to test? |
@Artturin, if nix -L build .#nixosConfigurations.${host}.config.services.xserver.displayManager.sessionData.desktops |
Testing looks like: nix -L build .#nixosConfigurations.${host}.config.environment.etc.'"systemd/system"'.source |
Could you send a cross compile flake, I haven't used cross compilation with flakes yet |
@Artturin, here's a minimal {
inputs.nixpkgs.url = "github:NixOS/nixpkgs/4be96dbda035972f60f9e0f386aaec2abd6f1cdb";
outputs = inputs: let
remoteNixpkgsPatches = [
{
meta.description = "nixos: fix cross-compiling by using buildPackages for build-time lndir";
url = "https://github.com/NixOS/nixpkgs/pull/142273.diff";
sha256 = "sha256-ZCDQ7SpGhH8JvAwWzdcyrc68RFEWHxxAj0M2+AvEzIg=";
}
];
originPkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
nixpkgs = originPkgs.applyPatches {
name = "nixpkgs-patched";
src = inputs.nixpkgs;
patches = map originPkgs.fetchpatch remoteNixpkgsPatches;
};
nixosSystem = import (nixpkgs + "/nixos/lib/eval-config.nix");
# Uncomment to use a Nixpkgs without remoteNixpkgsPatches
#nixosSystem = inputs.nixpkgs.lib.nixosSystem;
in
{
nixosConfigurations.nixos = nixosSystem {
system = "x86_64-linux";
modules = [
({ pkgs, lib, config, ... }: {
nixpkgs.crossSystem = lib.systems.examples.armv7l-hf-multiplatform;
services.xserver = {
enable = true;
desktopManager.session = [
{ name = "home-manager";
start = ''
${pkgs.runtimeShell} $HOME/.hm-xsession &
waitPID=$!
'';
bgSupport = true;
}
];
};
})
];
};
};
} Test with: nix -L build .#nixosConfigurations.nixos.config.services.xserver.displayManager.sessionData.desktops Change Note that testing the nix -L build .#nixosConfigurations.nixos.config.environment.etc.'"systemd/system"'.source Meaning having to disable stuffs or using an overlay to set failing packages to the dummy |
i added a modified version of your example to https://nixos.wiki/wiki/Nixpkgs/Reviewing_changes#Testing_the_cross-compilation_of_modules |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation for this change
Cross-compiling.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)