mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 21:49:34 +03:00
Add support for BLCR: modules/programs/blcr.nix
svn path=/nixos/trunk/; revision=21092
This commit is contained in:
parent
b42c2ecc13
commit
37746e4fb3
2 changed files with 60 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
./misc/nixpkgs.nix
|
./misc/nixpkgs.nix
|
||||||
./misc/passthru.nix
|
./misc/passthru.nix
|
||||||
./programs/bash/bash.nix
|
./programs/bash/bash.nix
|
||||||
|
./programs/blcr.nix
|
||||||
./programs/info.nix
|
./programs/info.nix
|
||||||
./programs/pwdutils/pwdutils.nix
|
./programs/pwdutils/pwdutils.nix
|
||||||
./programs/ssh.nix
|
./programs/ssh.nix
|
||||||
|
|
59
modules/programs/blcr.nix
Normal file
59
modules/programs/blcr.nix
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (pkgs.lib) mkOption mkIf;
|
||||||
|
|
||||||
|
cfg = config.environment.blcr;
|
||||||
|
|
||||||
|
blcrPkg = config.boot.kernelPackages.blcr;
|
||||||
|
|
||||||
|
insmod = "${pkgs.module_init_tools}/sbin/insmod";
|
||||||
|
rmmod = "${pkgs.module_init_tools}/sbin/rmmod";
|
||||||
|
|
||||||
|
modulesDir = "${blcrPkg}/lib/modules/${pkgs.linux.version}";
|
||||||
|
blcr_imports_ko = "${modulesDir}/blcr_imports.ko";
|
||||||
|
blcr_ko = "${modulesDir}/blcr.ko";
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
environment.blcr.enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description =
|
||||||
|
"Wheter to enable support for the BLCR checkpoingint tool.";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.blcr.autorun = mkOption {
|
||||||
|
default = true;
|
||||||
|
description =
|
||||||
|
"Whether to load BLCR kernel modules automatically at boot.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ blcrPkg ];
|
||||||
|
|
||||||
|
jobs.openafsClient = {
|
||||||
|
name = "blcr";
|
||||||
|
description = "Loads BLCR kernel modules";
|
||||||
|
task = true;
|
||||||
|
|
||||||
|
startOn = if cfg.autorun then "started udev" else null;
|
||||||
|
stopOn = "shutdown";
|
||||||
|
|
||||||
|
preStart = ''
|
||||||
|
${insmod} ${blcr_imports_ko}
|
||||||
|
${insmod} ${blcr_ko}
|
||||||
|
'';
|
||||||
|
postStop = ''
|
||||||
|
${rmmod} ${blcr_ko}
|
||||||
|
${rmmod} ${blcr_imports_ko}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue