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