You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to set a drive size with a minimum and a maximum value?
This would make it easier to use the same disko layout on different drive/partition sizes.
eg, for separate /nix partition of 100GB on a 1TB+ drive but 10GB on a smaller VM drive
The text was updated successfully, but these errors were encountered:
hmm, not really. I guess you would need to get the disk data into nix first and then do some detection on it. Another possibility would be to generate multiple different disko configs and execute a different one depending on a script you write yourself. Something like:
environment.systemPackages = [
(pkgs.writeScriptBin "multidisko" ''
device_to_format=$1
if [ $(fdisk -x "$device_to_format" | grep '[0-9]* bytes, | sed 's/ bytes,//') -lt 1000000 ]; then
${nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{ disko.devices = {
disk = {
device = "$device_to_format"; #not sure if this works, it should in theory
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
];
}.config.system.build.diskoScript}
else
${nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{ disko.devices = {
disk = {
device = "$device_to_format"; #not sure if this works, it should in theory
content = {
type = "filesystem";
format = "xfs";
mountpoint = "/";
};
};
};
];
}.config.system.build.diskoScript}
fi
'')
];
iFreilicht
changed the title
Size range
Specify a size range for partitions
Oct 1, 2024
Would it be possible to set a drive size with a minimum and a maximum value?
This would make it easier to use the same disko layout on different drive/partition sizes.
eg, for separate /nix partition of 100GB on a 1TB+ drive but 10GB on a smaller VM drive
The text was updated successfully, but these errors were encountered: