programs.criu: add nixos option for installing criu + kernel flags

authored by

Herwig Hochleitner and committed by
Herwig Hochleitner
66080ae4 0b621321

+44
+1
nixos/modules/module-list.nix
··· 75 75 ./programs/cdemu.nix 76 76 ./programs/chromium.nix 77 77 ./programs/command-not-found/command-not-found.nix 78 + ./programs/criu.nix 78 79 ./programs/dconf.nix 79 80 ./programs/environment.nix 80 81 ./programs/fish.nix
+26
nixos/modules/programs/criu.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let cfg = config.programs.criu; 6 + in { 7 + 8 + options = { 9 + programs.criu = { 10 + enable = mkOption { 11 + default = false; 12 + description = '' 13 + Install <command>criu</command> along with necessary kernel options. 14 + ''; 15 + }; 16 + }; 17 + }; 18 + config = mkIf cfg.enable { 19 + system.requiredKernelConfig = with config.lib.kernelConfig; [ 20 + (isYes "CHECKPOINT_RESTORE") 21 + ]; 22 + boot.kernel.features.criu = true; 23 + environment.systemPackages = [ pkgs.criu ]; 24 + }; 25 + 26 + }
+17
pkgs/os-specific/linux/kernel/common-config.nix
··· 682 682 WW_MUTEX_SELFTEST? n 683 683 ''} 684 684 685 + ${optionalString (features.criu or false) '' 686 + EXPERT y 687 + CHECKPOINT_RESTORE y 688 + ''} 689 + 690 + ${optionalString ((features.criu or false) && (features.criu_revert_expert or true)) 691 + # Revert some changes, introduced by EXPERT, when necessary for criu 692 + '' 693 + RFKILL_INPUT? y 694 + HID_PICOLCD_FB? y 695 + HID_PICOLCD_BACKLIGHT? y 696 + HID_PICOLCD_LCD? y 697 + HID_PICOLCD_LEDS? y 698 + HID_PICOLCD_CIR? y 699 + DEBUG_MEMORY_INIT? y 700 + ''} 701 + 685 702 ${extraConfig} 686 703 ''