2018-02-09 23:10:56 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let cfg = config.programs.criu;
|
|
|
|
in {
|
|
|
|
|
|
|
|
options = {
|
|
|
|
programs.criu = {
|
|
|
|
enable = mkOption {
|
2020-04-20 20:05:26 +02:00
|
|
|
type = types.bool;
|
2018-02-09 23:10:56 +01:00
|
|
|
default = false;
|
2022-07-28 23:19:15 +02:00
|
|
|
description = lib.mdDoc ''
|
|
|
|
Install {command}`criu` along with necessary kernel options.
|
2018-02-09 23:10:56 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
system.requiredKernelConfig = with config.lib.kernelConfig; [
|
|
|
|
(isYes "CHECKPOINT_RESTORE")
|
|
|
|
];
|
|
|
|
boot.kernel.features.criu = true;
|
|
|
|
environment.systemPackages = [ pkgs.criu ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|