mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-26 11:06:44 +03:00
nixos/gitwatch: fix module accounting
With initial commit I missed the `module-list.nix` file and maintainers
field.
Change-Id: If0af670b11370b3634dd7fb89c9707a8fb51c91e
(cherry picked from commit bc678b2892
)
This commit is contained in:
parent
674878d6cb
commit
d3d83fa66e
2 changed files with 21 additions and 10 deletions
|
@ -894,6 +894,7 @@
|
||||||
./services/monitoring/do-agent.nix
|
./services/monitoring/do-agent.nix
|
||||||
./services/monitoring/fusion-inventory.nix
|
./services/monitoring/fusion-inventory.nix
|
||||||
./services/monitoring/gatus.nix
|
./services/monitoring/gatus.nix
|
||||||
|
./services/monitoring/gitwatch.nix
|
||||||
./services/monitoring/glances.nix
|
./services/monitoring/glances.nix
|
||||||
./services/monitoring/goss.nix
|
./services/monitoring/goss.nix
|
||||||
./services/monitoring/grafana-agent.nix
|
./services/monitoring/grafana-agent.nix
|
||||||
|
|
|
@ -5,11 +5,20 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
inherit (lib)
|
||||||
|
maintainers
|
||||||
|
mapAttrs'
|
||||||
|
mkEnableOption
|
||||||
|
mkOption
|
||||||
|
nameValuePair
|
||||||
|
optionalString
|
||||||
|
types
|
||||||
|
;
|
||||||
mkSystemdService =
|
mkSystemdService =
|
||||||
name: cfg:
|
name: cfg:
|
||||||
lib.nameValuePair "gitwatch-${name}" (
|
nameValuePair "gitwatch-${name}" (
|
||||||
let
|
let
|
||||||
getvar = flag: var: lib.optionalString (cfg."${var}" != null) "${flag} ${cfg."${var}"}";
|
getvar = flag: var: optionalString (cfg."${var}" != null) "${flag} ${cfg."${var}"}";
|
||||||
branch = getvar "-b" "branch";
|
branch = getvar "-b" "branch";
|
||||||
remote = getvar "-r" "remote";
|
remote = getvar "-r" "remote";
|
||||||
in
|
in
|
||||||
|
@ -35,7 +44,7 @@ let
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.gitwatch = lib.mkOption {
|
options.services.gitwatch = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
A set of git repositories to watch for. See
|
A set of git repositories to watch for. See
|
||||||
[gitwatch](https://github.com/gitwatch/gitwatch) for more.
|
[gitwatch](https://github.com/gitwatch/gitwatch) for more.
|
||||||
|
@ -57,25 +66,25 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
type =
|
type =
|
||||||
with lib.types;
|
with types;
|
||||||
attrsOf (submodule {
|
attrsOf (submodule {
|
||||||
options = {
|
options = {
|
||||||
enable = lib.mkEnableOption "watching for repo";
|
enable = mkEnableOption "watching for repo";
|
||||||
path = lib.mkOption {
|
path = mkOption {
|
||||||
description = "The path to repo in local machine";
|
description = "The path to repo in local machine";
|
||||||
type = str;
|
type = str;
|
||||||
};
|
};
|
||||||
user = lib.mkOption {
|
user = mkOption {
|
||||||
description = "The name of services's user";
|
description = "The name of services's user";
|
||||||
type = str;
|
type = str;
|
||||||
default = "root";
|
default = "root";
|
||||||
};
|
};
|
||||||
remote = lib.mkOption {
|
remote = mkOption {
|
||||||
description = "Optional url of remote repository";
|
description = "Optional url of remote repository";
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
branch = lib.mkOption {
|
branch = mkOption {
|
||||||
description = "Optional branch in remote repository";
|
description = "Optional branch in remote repository";
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -83,5 +92,6 @@ in
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
config.systemd.services = lib.mapAttrs' mkSystemdService config.services.gitwatch;
|
config.systemd.services = mapAttrs' mkSystemdService config.services.gitwatch;
|
||||||
|
meta.maintainers = with maintainers; [ shved ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue