Skip to content

nixos/azure-new: use local nixpkgs #86113

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

Merged
merged 1 commit into from
Apr 27, 2020
Merged

Conversation

colemickens
Copy link
Member

Motivation for this change

Prevent scenarios like in #86005 by using the local nixpkgs to build the image.

Advanced users that want to build their own image can follow the example to pin nixpkgs as they desire or manually use <nixpkgs> (which I don't really recommend).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Apr 27, 2020
@colemickens
Copy link
Member Author

colemickens commented Apr 27, 2020

$ cd ./nixos/maintainers/scripts/azure-new
$ nix-build ./examples/basic/image.nix

...
updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/sda...
Installing for i386-pc platform.
Installation finished. No error reported.
tune2fs 1.45.5 (07-Jan-2020)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Setting time filesystem last checked to Mon Apr 27 10:15:37 2020

[    3.871350] reboot: Power down
/nix/store/bg732z5jwd6ajbkgj95svg5glh5mdkkx-azure-image

$ ls ./result
disk.vhd

$ file ./result/disk.vhd 
./result/disk.vhd: DOS/MBR boot sector

@Mic92 Mic92 merged commit 2bd4ff0 into NixOS:master Apr 27, 2020
@Mic92
Copy link
Member

Mic92 commented Apr 27, 2020

Might be worth a backport.

@colemickens colemickens deleted the azure-local-nixpkgs branch December 30, 2022 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants