Skip to content

Commit

Permalink
feat(flake)!: replace after in modules by requires
Browse files Browse the repository at this point in the history
  • Loading branch information
akshettrj committed Aug 28, 2024
1 parent d73ad6a commit 5426cd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions nix/modules/commonOptions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ in {
default = "1d";
};

commonSettings.after = mkOption {
commonSettings.requires = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
Expand Down Expand Up @@ -77,7 +77,7 @@ in {
'';
};

after = mkOption {
requires = mkOption {
type = types.nullOf (types.listOf types.str);
default = null;
description = ''
Expand Down
12 changes: 7 additions & 5 deletions nix/modules/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ in {
cfg.commonSettings.maxRuntime
);

after = (
if settings.after != null then
settings.after
requires = (
if settings.requires != null then
settings.requires
else
cfg.commonSettings.after
cfg.commonSettings.requires
);

in {
Expand All @@ -54,7 +54,9 @@ in {
Unit = {
Description = "WaTgBridge service for '${instanceName}'";
Documentation = "https://github.com/akshettrj/watbridge";
After = [ "network.target" ] ++ lib.optionals (after != null) after;
After = [ "network.target" ];
} // lib.optionalAttrs (requires != null) {
Requires = requires;
};

Service = {
Expand Down

0 comments on commit 5426cd3

Please sign in to comment.