Initial commit
This commit is contained in:
24
lib/fs.nix
Normal file
24
lib/fs.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
final: prev:
|
||||
let
|
||||
filesystem = fsType: path: device: options: {
|
||||
fileSystems.${path} =
|
||||
{ inherit device fsType; }
|
||||
// final.optionalAttrs (options != null) { inherit options; };
|
||||
};
|
||||
|
||||
in {
|
||||
btrfs = filesystem "btrfs";
|
||||
ntfs = filesystem "ntfs-3g";
|
||||
ext4 = filesystem "ext4";
|
||||
vfat = filesystem "vfat";
|
||||
zfs = filesystem "zfs";
|
||||
tmpfs = filesystem "tmpfs";
|
||||
|
||||
swap = device: {swapDevices = [{inherit device;}];};
|
||||
|
||||
luks = mapper: device: additional: {
|
||||
boot.initrd.luks.devices.${mapper} = {
|
||||
inherit device;
|
||||
} // additional;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user