summaryrefslogtreecommitdiffstats
path: root/nixos/modules/programs/criu.nix
blob: 8d5d2eb64f2e91aeb573d374660476b2327c5431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  config,
  lib,
  pkgs,
  ...
}:

let
  cfg = config.programs.criu;
in
{

  options = {
    programs.criu = {
      enable = lib.mkOption {
        type = lib.types.bool;
        default = false;
        description = ''
          Install {command}`criu` along with necessary kernel options.
        '';
      };
    };
  };
  config = lib.mkIf cfg.enable {
    system.requiredKernelConfig = with config.lib.kernelConfig; [
      (isYes "CHECKPOINT_RESTORE")
    ];
    boot.kernel.features.criu = true;
    environment.systemPackages = [ pkgs.criu ];
  };

}