add mercurial to rundeck path

This commit is contained in:
Luke Granger-Brown 2021-04-10 22:17:28 +00:00
parent 15ed0197e3
commit e0241545d2
5 changed files with 28 additions and 10 deletions

View file

@ -2,7 +2,7 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
{ pkgs, ... }@args: { { depot, pkgs, ... }@args: {
bazel-run = import ./bazel-run.nix args; bazel-run = import ./bazel-run.nix args;
crane = import ./crane.nix args; crane = import ./crane.nix args;
javaws-env = import ./javaws-env.nix args; javaws-env = import ./javaws-env.nix args;
@ -28,5 +28,8 @@
flameshot = pkgs.libsForQt5.callPackage ./flameshot {}; flameshot = pkgs.libsForQt5.callPackage ./flameshot {};
lukegb-wallpapers = pkgs.callPackage ./lukegb-wallpapers {}; lukegb-wallpapers = pkgs.callPackage ./lukegb-wallpapers {};
rundeck-bin = pkgs.callPackage ./rundeck-bin {}; rundeck-bin = pkgs.callPackage ./rundeck-bin {};
mercurial = with pkgs; (mercurial.overridePythonAttrs (origAttrs: {
propagatedBuildInputs = [python3Packages.hg-evolve depot.nix.pkgs.hg-git];
}));
} // (import ./heptapod-runner.nix args) } // (import ./heptapod-runner.nix args)
// (import ./lightspeed args) // (import ./lightspeed args)

View file

@ -7,11 +7,22 @@ in {
options.services.rundeck = { options.services.rundeck = {
enable = mkEnableOption "rundeck"; enable = mkEnableOption "rundeck";
user = mkOption {
default = null;
type = types.nullOr types.str;
};
package = mkOption { package = mkOption {
default = depot.pkgs.rundeck-bin; default = depot.pkgs.rundeck-bin;
defaultText = "depot.pkgs.rundeck-bin"; defaultText = "depot.pkgs.rundeck-bin";
type = types.package; type = types.package;
}; };
pathPackages = mkOption {
default = [];
defaultText = "[]";
type = types.listOf types.package;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -19,7 +30,9 @@ in {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ]; after = [ "network.target" ];
serviceConfig = { serviceConfig = {
User = "deployer"; User = cfg.user;
DynamicUser = cfg.user != cfg.user;
Path = lib.makeBinPath cfg.pathPackages;
ExecStart = "${cfg.package}/bin/rundeckd -b /var/lib/rundeck"; ExecStart = "${cfg.package}/bin/rundeckd -b /var/lib/rundeck";
StateDirectory = "rundeck"; StateDirectory = "rundeck";
}; };

View file

@ -2,7 +2,7 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
{ depot, lib, ... }: { depot, lib, pkgs, ... }:
{ {
imports = [ imports = [
../lib/bvm.nix ../lib/bvm.nix
@ -20,7 +20,13 @@
}; };
my.ip.tailscale = "100.65.226.19"; my.ip.tailscale = "100.65.226.19";
services.rundeck.enable = true; services.rundeck = {
enable = true;
user = "deployer";
pathPackages = with pkgs; [
depot.nix.pkgs.mercurial
];
};
environment.etc."rundeck.nodes.yaml" = let environment.etc."rundeck.nodes.yaml" = let
content = builtins.mapAttrs (name: value: { content = builtins.mapAttrs (name: value: {

View file

@ -86,9 +86,7 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vim rxvt_unicode.terminfo tmux rebuilder tailscale rsync libarchive tcpdump restic vim rxvt_unicode.terminfo tmux rebuilder tailscale rsync libarchive tcpdump restic
iftop htop jq iftop htop jq
(mercurial.overridePythonAttrs (origAttrs: { depot.nix.pkgs.mercurial
propagatedBuildInputs = [python3Packages.hg-evolve depot.nix.pkgs.hg-git];
}))
switch-prebuilt switch-prebuilt
]; ];

View file

@ -100,9 +100,7 @@ in
'') '')
rxvt_unicode.terminfo tmux rsync libarchive tcpdump restic rxvt_unicode.terminfo tmux rsync libarchive tcpdump restic
iftop htop jq iftop htop jq
(mercurial.overridePythonAttrs (origAttrs: { depot.nix.pkgs.mercurial
propagatedBuildInputs = [python3Packages.hg-evolve depot.nix.pkgs.hg-git];
}))
] ++ lib.optionals isLinux [ ] ++ lib.optionals isLinux [
iotop iotop
])); ]));