diff --git a/nix/modules/commonOptions.nix b/nix/modules/commonOptions.nix index 13946f2..fae606f 100644 --- a/nix/modules/commonOptions.nix +++ b/nix/modules/commonOptions.nix @@ -16,7 +16,7 @@ in { default = "1d"; }; - commonSettings.after = mkOption { + commonSettings.requires = mkOption { type = types.nullOr (types.listOf types.str); default = null; }; @@ -77,7 +77,7 @@ in { ''; }; - after = mkOption { + requires = mkOption { type = types.nullOf (types.listOf types.str); default = null; description = '' diff --git a/nix/modules/home-manager/default.nix b/nix/modules/home-manager/default.nix index 36912d5..190c78b 100644 --- a/nix/modules/home-manager/default.nix +++ b/nix/modules/home-manager/default.nix @@ -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 { @@ -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 = {