Open con-f-use opened 9 months ago
Not exactly what you are looking for, but this works for flakes nix eval .#nixosConfigurations.HOST.config.fileSystems
just replace HOST with the system name. If you want a pretty output nix eval .#nixosConfigurations.HOST.config.fileSystems --json | jq
should do as well
@LovingMelody sorry, I'm new to Nix — what is "works for flakes" in this context? given a (slightly patched) disko and a standalone disko config file, how can I make this expression work?
@intelfx It should work so long as your NixOS configuration is using flakes.
@LovingMelody I don't have NixOS, just a standalone disko checkout and a config file :sweat_smile:
If you want this manually, you can use nixos-generate-config --show-hardware-config --root /mnt
once it's mounted (via mount
mode, or disko
mode). There's some extra stuff in there regarding kernel modules/drivers etc (which should be ignored if you are partitioning a disk for another system), but you mainly need the filesystem stuff.
@intelfx: I don't have NixOS, just a standalone disko checkout and a config file 😅
In the disko repository, run this:
nix eval --impure --expr 'builtins.mapAttrs (_: v: v.contents) ((import ./. {}).config (import example/simple-efi.nix))'
When that works, replace example/simple-efi.nix
with the path to your disko file.
I think this is a decent feature and would accept a PR that implements it. The code I wrote out above should be a good starting point.
For debugging and when one doesn't want to use the module in one's NixOS configuraiton, it would be nice if disko had a fourth mode, that just prints the resulting
fileSystems = { ... };
block for a nixos system.