Skip to content

Commit

Permalink
Merge #2389
Browse files Browse the repository at this point in the history
2389: nixos: do not use functions for extraServiceConfig/extraSocketConfig r=disassembler a=jbgi

 since option values merging does not work correctly for functions (on nixos-20.03).

Co-authored-by: Jean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>
  • Loading branch information
iohk-bors[bot] and jbgi committed Feb 19, 2021
2 parents e877313 + cca3fb9 commit 58c1e06
Showing 1 changed file with 8 additions and 10 deletions.
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

0 comments on commit 58c1e06

Please sign in to comment.