Skip to content

Commit

Permalink
feat: add mkDevice helper
Browse files Browse the repository at this point in the history
  • Loading branch information
oddlama committed Apr 3, 2024
1 parent 7257321 commit e3fb5de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/src/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,8 @@ nodes.router = mkSwitch "Router" {
connections.wan1 = mkConnection "host1" "wan";
};
```

## mkDevice

Exactly the same as `mkSwitch`, but sets the device type to `device` instead of `switch`,
which has no icon to the right by default.
6 changes: 6 additions & 0 deletions topology/helpers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,10 @@ in rec {
// {
deviceType = "router";
};

mkDevice = name: args:
mkDevice name args
// {
deviceType = "device";
};
}

0 comments on commit e3fb5de

Please sign in to comment.