Skip to content

Commit

Permalink
device-client: write NixOS modules for CanForward option
Browse files Browse the repository at this point in the history
  • Loading branch information
nyiyui committed Jan 11, 2025
1 parent 196ad39 commit d59befd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/device-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

type Config struct {
Clients map[string]ClientConfig
CanFoaward bool
CanForward bool
}

type ClientConfig struct {
Expand Down Expand Up @@ -209,7 +209,7 @@ func createGoroutines(m *MachineData, dnsClient dns.Client, config Config) {
if err != nil {
panic(err)
}
if !config.CanFoaward {
if !config.CanForward {
c.SetCanForward(false)
}
c.Machine = m.Machines[clientName]
Expand Down
5 changes: 5 additions & 0 deletions modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ args@{
type = attrsOf clientConfig;
default = [ ];
};
CanForward = mkOption {
type = bool;
default = true;
description = "Enables the device to forward packets between peers.";
};
dns = mkOption {
type = submodule {
options.enable = mkEnableOption "Qrystal on-device DNS server.";
Expand Down

0 comments on commit d59befd

Please sign in to comment.