mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-05 16:41:04 +01:00
parallel: init module (#8240)
This commit is contained in:
parent
effe4c007d
commit
ff067cfc61
4 changed files with 60 additions and 0 deletions
7
modules/misc/news/2025/11/2025-11-30_00-04-38.nix
Normal file
7
modules/misc/news/2025/11/2025-11-30_00-04-38.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
time = "2025-11-29T23:04:38+00:00";
|
||||||
|
condition = true;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.parallel'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
42
modules/programs/parallel.nix
Normal file
42
modules/programs/parallel.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkIf
|
||||||
|
mkEnableOption
|
||||||
|
mkOption
|
||||||
|
types
|
||||||
|
;
|
||||||
|
|
||||||
|
cfg = config.programs.parallel;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
meta.maintainers = [ lib.maintainers.xavwe ];
|
||||||
|
|
||||||
|
options.programs.parallel = {
|
||||||
|
enable = mkEnableOption "GNU Parallel";
|
||||||
|
|
||||||
|
package = lib.mkPackageOption pkgs "parallel-full" { };
|
||||||
|
|
||||||
|
will-cite = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Accept GNU Parallels citation policy: <https://www.gnu.org/software/parallel/parallel_design.html#citation-notice>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home = {
|
||||||
|
packages = [ cfg.package ];
|
||||||
|
file.".parallel/will-cite" = mkIf cfg.will-cite {
|
||||||
|
text = "generated by home manager (programs.parallel.will-cite)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
1
tests/modules/programs/parallel/default.nix
Normal file
1
tests/modules/programs/parallel/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{ parallel-example-config = ./example-config.nix; }
|
||||||
10
tests/modules/programs/parallel/example-config.nix
Normal file
10
tests/modules/programs/parallel/example-config.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
programs.parallel = {
|
||||||
|
enable = true;
|
||||||
|
will-cite = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.parallel/will-cite
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue