nixos-facter
nixos-facter copied to clipboard
Detect if LVM snapshots are being used
For reference https://github.com/NixOS/nixpkgs/blob/dac9cdf8c930c0af98a63cbfe8005546ba0125fb/nixos/modules/installer/tools/nixos-generate-config.pl#L265-L268
Just because you use LVM doesn't necessarily mean you are using snapshots. This logic needs to be refined.
#9 might also provide the info necessary for this logic, tbd.
Here's some context as to where this logic came from: https://github.com/NixOS/nixpkgs/issues/33646
On the other hand, just because a volume doesn't have snapshots at the time you run nixos-facter, doesn't mean that no snapshots could be created at a later point. So I think always adding the module when LVM is detected is actually the right thing to do.