Skip to content

modular-services: update and cleanup - #2

Open
Eveeifyeve wants to merge 4 commits into
finix-community:mainfrom
DigitalBrewStudios:update-and-cleanup
Open

modular-services: update and cleanup#2
Eveeifyeve wants to merge 4 commits into
finix-community:mainfrom
DigitalBrewStudios:update-and-cleanup

Conversation

@Eveeifyeve

@Eveeifyeve Eveeifyeve commented Jul 25, 2026

Copy link
Copy Markdown

Adds support for modular service apis to finix:

  • process.reloadCommand/process.reloadSignal &
  • notificationProtocol.

Relating ref:


NOTE: I cannot test this as I don't have a finix machine, maybe you can @aanderse.

@Eveeifyeve

Eveeifyeve commented Jul 25, 2026

Copy link
Copy Markdown
Author

Known issue: needs remove process.environment as it was recently reverted. See NixOS/nixpkgs#545519 for more details.

Fixed in fbaf359

@Eveeifyeve
Eveeifyeve force-pushed the update-and-cleanup branch from 648d132 to fbaf359 Compare July 25, 2026 18:46

@aanderse aanderse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for contributing! just a few small things to clean up

hopefully i can get a vm test up and running to validate this...

Comment thread modules/service.nix

finix.reload = mkOption {
type = types.nullOr types.str;
default = if config.process.reloadCommand != null then config.process.reloadCommand else "";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default = if config.process.reloadCommand != null then config.process.reloadCommand else "";
default = if config.process.reloadCommand != null then config.process.reloadCommand else null;

wouldn't null be better than empty string here?

Comment thread modules/service.nix
type = types.str;
default = lib.escapeShellArgs config.process.argv;
defaultText = lib.literalExpression "config.process.reloadCommand";
description = "";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Comment thread modules/service.nix
type = types.nullOr types.str;
default = if config.process.reloadCommand != null then config.process.reloadCommand else "";
defaultText = lib.literalExpression "config.process.reloadCommand";
description = "";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Comment thread modules/service.nix
finit.services."" = {
command = config.finit.command;
reload = config.finit.reload;
notify =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ++ is list concatenation operator, not string
  • finit only accepts a single value, so you should is an if...else expression
  • give systemd the highest preference ✔️

Comment thread modules/service.nix
notify =
lib.optionalString config.notificationProtocol.systemd "systemd"
++ lib.optionalString config.notificationProtocol.s6 "s6";
conditions = lib.mkIf (config.notificationProtocol.systemd || config.notificationProtocol.s6) [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can drop the conditional here and simply set the value

Comment thread modules/service.nix
description = "";
};

finix.reload = mkOption {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
finix.reload = mkOption {
finit.reload = mkOption {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants