Skip to content

Commit

Permalink
docs(custom-service): Fix multi-instance example (#469)
Browse files Browse the repository at this point in the history
resolves #458
  • Loading branch information
shivaraj-bh authored Feb 28, 2025
1 parent 65c47ee commit 4a43eec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions doc/custom-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Let's write the same `hello` service as above, in `hello.nix`, but this time as
{ config, lib, name, pkgs, ... }:
{
options = {
enable = lib.mkEnableOption "Enable ${name} service";
package = lib.mkPackageOption pkgs "hello" { };
message = lib.mkOption {
type = lib.types.str;
Expand All @@ -111,7 +110,7 @@ The primary differences from the single instance service are:

- The module now takes an additional argument `name`, which is the name of the instance of the service.
- We no longer have to write the `config` block, as it is now handled by the library by importing the `outputs.settings` option.
- And we don't have to write `options.services."${name}"`, as that is abstracted away by the library.
- And we don't have to write `options.services."${name}"` or define `enable` and `dataDir` options, as that is abstracted away by the library.

Now that we have defined the multi-instance service, we can import it in our flake:

Expand Down

0 comments on commit 4a43eec

Please sign in to comment.