Skip to content
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

Add options to build disk image function #50239

Merged
merged 2 commits into from Jan 23, 2019

Conversation

tathougies
Copy link
Contributor

Motivation for this change

I'd like to be able to build a disk image with a custom label. This patch simply adds an option to do that. When the option is omitted, this patch preserves the old behavior.

Additionally, when cross-compiling, nixos-enter has a suffix based on the target triple. This needs to be added to the nixos-enter commands for the cross-compile to succeed

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@@ -178,7 +184,7 @@ let format' = format; in let
nix-store --load-db < ${closureInfo}/registration

echo "running nixos-install..."
nixos-install --root $root --no-bootloader --no-root-passwd \
nixos-install${suffix} --root $root --no-bootloader --no-root-passwd \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bug. It shouldn't have a suffix & that's not documented anywhere. It must come from how make-derivation overrides name:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/make-derivation.nix#L180-L186

@matthewbauer
Copy link
Member

The label change looks good though!

@danbst danbst merged commit a66ef3a into NixOS:master Jan 23, 2019
danbst pushed a commit to danbst/nixpkgs that referenced this pull request Jan 31, 2019
* add options to build disk image function

* Revert suffix changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants