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

Remove dependency on nixos-install #1

Open
ninegua opened this issue Sep 24, 2019 · 2 comments
Open

Remove dependency on nixos-install #1

ninegua opened this issue Sep 24, 2019 · 2 comments

Comments

@ninegua
Copy link
Owner

ninegua commented Sep 24, 2019

The pitfall of using nixos-install in this script is that the hardware detection can be mis-guided (e.g. swap partition).
A better way is to follow the approach taken by nixos/modules/installer/cd-dvd/iso-image.nix, and use a pure Nix way to create a USB disk image.

Other hopeful benefits are

  • A way to create a disk image (of only necessary size) that can be later written into USB drive.
  • A way to create a disk image on a non-NixOS Linux or even OS X machine.
@ninegua
Copy link
Owner Author

ninegua commented Oct 1, 2019

Commit 8ab8bd7 implemented a nix based solution. The main caveat is that it had to use runInLinuxVM because there seems to be no easy way to use cryptsetup without first mounting the image file through a loopback device.

@ninegua
Copy link
Owner Author

ninegua commented Oct 4, 2019

It turns out that commit 8ab8bd7 wasn't safe, because nix would remember arguments in derivation files, and a passphrase would be in clear text in a nix-store! I need to figure out some other way to get around this problem.

Thanks to @nmattia for pointing out this glaring mistake! I've rolled back the master until a better solution surfaces.

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

No branches or pull requests

1 participant