yep, more dotfiles
1layout: { device, swapSize }:
2
3{ self, pkgs, lib, ... }:
4
5let
6 inherit (self.inputs) disko;
7in
8{
9 imports = [
10 disko.nixosModules.disko
11 ../../nixos/layout/${layout}.nix
12 ];
13
14 options.local.disk = {
15 device = lib.mkOption {
16 type = with lib.types; str;
17 default = "/dev/${device}";
18 description = "Identifier of the disk (/dev/<device>)";
19 };
20
21 swapSize = lib.mkOption {
22 type = with lib.types; int;
23 default = swapSize;
24 description = ''
25 Size (in GB) of the swap file
26
27 The recommended amount from RedHat is:
28
29 Amount of RAM Recommended swap space Recommended swap space
30 in the system if allowing for hibernation
31 —————————————— —————————————————————————— ———————————————————————————
32 ⩽ 2 GB 2 times the amount of RAM 3 times the amount of RAM
33 > 2 GB – 8 GB Equal to the amount of RAM 2 times the amount of RAM
34 > 8 GB – 64 GB At least 4 GB 1.5 times the amount of RAM
35 > 64 GB At least 4 GB Hibernation not recommended
36 '';
37 };
38 };
39}