diff --git a/modules/decklink.nix b/modules/decklink.nix deleted file mode 100644 index d8d30c1..0000000 --- a/modules/decklink.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.hardware.decklink; - kernelPackages = config.boot.kernelPackages; -in -{ - options.hardware.decklink.enable = mkEnableOption "Enable hardware support for the Blackmagic Design Decklink audio/video interfaces."; - - config = mkIf cfg.enable { - boot.kernelModules = [ "blackmagic" "blackmagic-io" "snd_blackmagic-io" ]; - boot.extraModulePackages = [ kernelPackages.decklink ]; - systemd.services."DecklinkVideoHelper" = { - after = [ "syslog.target" "local-fs.target" ]; - wantedBy = [ "multi-user.target" ]; - serviceConfig.ExecStart = "${pkgs.blackmagicDesktopVideo}/bin/DesktopVideoHelper -n"; - }; - }; -} diff --git a/modules/default.nix b/modules/default.nix index 9e8e864..a47f5a8 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,10 +1,7 @@ { ... }: -let - sources = import ../nix/sources.nix; -in { + +{ imports = [ - ./nftnat - ./decklink.nix ./websites.nix ]; diff --git a/modules/nftnat/default.nix b/modules/nftnat/default.nix deleted file mode 100644 index e5481f5..0000000 --- a/modules/nftnat/default.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.hacc.nftables.nat; - nats = config.networking.nat; -in { - options.hacc.nftables.nat = { - enable = mkEnableOption "Wrap NAT into nftables."; - forwardPorts = mkOption { - type = with types; listOf (submodule { - options = { - ports = mkOption { - type = types.listOf (types.either types.int (types.strMatching "[[:digit:]]+-[[:digit:]]+")); - }; - destination = mkOption { - type = types.str; - example = "10.0.0.1"; - }; - proto = mkOption { - type = types.str; - default = "tcp"; - example = "udp"; - }; - }; - }); - default = []; - example = [{ ports = [ 8080 "9100-9200" ]; destination = "192.168.100.2"; proto = "udp"; }]; - }; - }; - - config = mkIf cfg.enable { - networking.nat.enable = mkOverride 99 false; - - boot = { - kernelModules = [ "nf_nat_ftp" ]; - kernel.sysctl = { - "net.ipv4.conf.all.forwarding" = mkOverride 90 true; - "net.ipv4.conf.default.forwarding" = mkOverride 90 true; - }; - }; - - networking.nftables = { - extraConfig = '' - table ip nat { - chain prerouting { - type nat hook prerouting priority -100 - ${concatMapStringsSep "\n" (rule: "iif ${nats.externalInterface} ${rule.proto} dport { ${concatStringsSep ", " (map (x: toString x) rule.ports)} } dnat ${rule.destination}") cfg.forwardPorts} - } - chain postrouting { - type nat hook postrouting priority 100 - ${concatMapStringsSep "\n" (iface: "iifname ${replaceStrings ["+"] ["*"] iface} oifname ${nats.externalInterface} masquerade") nats.internalInterfaces} - ${concatMapStringsSep "\n" (addr: "ip saddr ${addr} oifname ${nats.externalInterface} masquerade") nats.internalIPs} - } - } - ''; - }; - }; -}