Skip to content

Commit

Permalink
btrfs: add swap priority, options
Browse files Browse the repository at this point in the history
  • Loading branch information
nvmd authored and mergify[bot] committed Sep 3, 2024
1 parent 39b4091 commit 099b6cc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/types/btrfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ let
default = name;
description = "Path to the swap file (relative to the mountpoint)";
};

priority = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = null;
description = lib.mdDoc ''
Specify the priority of the swap file. Priority is a value between 0 and 32767.
Higher numbers indicate higher priority.
null lets the kernel choose a priority, which will show up as a negative value.
'';
};

options = lib.mkOption {
type = lib.types.listOf lib.types.nonEmptyStr;
default = [ "defaults" ];
example = [ "nofail" ];
description = "Options used to mount the swap.";
};
};
}));
default = { };
Expand All @@ -24,6 +41,7 @@ let
swapDevices = builtins.map
(file: {
device = "${mountpoint}/${file.path}";
inherit (file) priority options;
})
(lib.attrValues swap);
};
Expand Down

0 comments on commit 099b6cc

Please sign in to comment.