disko
disko copied to clipboard
Add documentation/steps on development
Currently I am having trouble getting started on #298.
What would help me enormously is some basic documentation on (getting started with) development, even if only a couple of bullet points. E.g. how to run tests? Can that be done in a vm? If not, how to protect your current system (yes I do have backups but still... ;).
I am not very experienced in nix, so if these are questions that are obvious to regular nix developers and/or have their answers elsewhere then by all means just close this issue.
Hi @victorklos
E.g. how to run tests? If not, how to protect your current system (yes I do have backups but still... ;).
You can use nix run
to execute integration tests of your choice, they are run in a (or more) nixos vm(s). i.e.
nix run .\#checks.x86_64-linux.zfs -L
To execute the test defined in https://github.com/nix-community/disko/blob/master/tests/zfs.nix
There's a ´zfs-over-legacy`test as well and others can and probably should be added for the features you plan. See e.g. https://github.com/nix-community/disko/blob/master/lib/tests.nix#L44 for options to customize te test environment.
Does this help? :) If one has been around the community for a while it can be hard to see whats missing from a newer users perspective, so feel free to continue asking "obvious questions" here ;)
The nixos-anywhere project uses disko and has a quickstart guide that also includes vm tests:
https://github.com/numtide/nixos-anywhere/blob/main/docs/quickstart.md#steps-required-to-run-nixos-anywhere
If you use disko than you can use nixos-anywhere even if you don't use it for installing (just skip the last step that installs). Also you disko will re-format everything. So you need to have everything backed up before.