Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos: do not use functions for extraServiceConfig/extraSocketConfig #2389

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions nix/nixos/cardano-node-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -290,20 +290,18 @@ in {
};

extraServiceConfig = mkOption {
# activate type for nixos-21.03:
# type = types.functionTo (types.listOf types.attrs);
default = n: i: {};
type = types.attrs;
default = {};
description = ''
Extra systemd service config, given service name and instance index.
Extra systemd service config (apply to all instances).
'';
};

extraSocketConfig = mkOption {
# activate type for nixos-21.03:
# type = types.functionTo (types.listOf types.attrs);
default = n: i: {};
type = types.attrs;
default = {};
description = ''
Extra systemd socket config, given socket name and instance index.
Extra systemd socket config (apply to all instances).
'';
};

Expand Down Expand Up @@ -463,7 +461,7 @@ in {
RestartSec = 1;
KillSignal = "SIGINT";
};
} (cfg.extraServiceConfig n i));
} cfg.extraServiceConfig);

systemd.sockets = genInstanceConf (n: i: lib.mkIf cfg.systemdSocketActivation (recursiveUpdate {
description = "Socket of the ${n} service.";
Expand All @@ -477,7 +475,7 @@ in {
SocketUser = "cardano-node";
SocketGroup = "cardano-node";
};
} (cfg.extraSocketConfig n i)));
} cfg.extraSocketConfig));
}
{
# oneshot service start allows to easily control all instances at once.
Expand Down