about summary refs log tree commit diff
path: root/nixos/modules/programs/criu.nix
blob: 9414d0b27f0d2c83c6f0583d2f334ca0d9f58f38 (plain) (blame)
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
{ config, lib, pkgs, ... }:

with lib;

let cfg = config.programs.criu;
in {

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

}