aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-04-09 09:44:39 +0200
committerKarel Kočí <cynerd@email.cz>2022-04-12 21:48:06 +0200
commit1c2206f46fc9f608f805071dd5e036d46249756d (patch)
treebbb44dbfc1575f228503afc1f58810edb0373e29 /nixos
parent5339e045194c5ad482250c0271959a5fd9f97db2 (diff)
downloadnixturris-1c2206f46fc9f608f805071dd5e036d46249756d.tar.gz
nixturris-1c2206f46fc9f608f805071dd5e036d46249756d.tar.bz2
nixturris-1c2206f46fc9f608f805071dd5e036d46249756d.zip
treewide: move sentinel to the dedicated repository
Diffstat (limited to 'nixos')
-rw-r--r--nixos/default.nix1
-rw-r--r--nixos/modules/sentinel-fwlogs.nix37
-rw-r--r--nixos/modules/sentinel-minipot.nix73
-rw-r--r--nixos/modules/sentinel.nix53
4 files changed, 0 insertions, 164 deletions
diff --git a/nixos/default.nix b/nixos/default.nix
index ae8c367..8b20e39 100644
--- a/nixos/default.nix
+++ b/nixos/default.nix
@@ -1,4 +1,3 @@
{
turris-board = import ./modules/turris-board.nix;
- sentinel = import ./modules/sentinel.nix;
}
diff --git a/nixos/modules/sentinel-fwlogs.nix b/nixos/modules/sentinel-fwlogs.nix
deleted file mode 100644
index b7b056a..0000000
--- a/nixos/modules/sentinel-fwlogs.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-{
-
- imports = [ ./sentinel.nix ];
-
-
- options = {
-
- services.sentinel.fwlogs = {
- enable = mkOption {
- type = types.bool;
- default = true;
- description = ''
- Whether to enable the Turris Sentinel Firewall logs collector.
- The services.sentinel.enable has to be enabled as well.
- '';
- };
- };
- };
-
-
- config = mkIf config.services.sentinel.enable && config.services.sentinel.fwlogs.enable {
- environment.systemPackages = [ pkgs.sentinel-fwlogs ];
-
- systemd.services.sentinel-fwlogs = {
- description = "Turris Sentinel Firewall Logs";
- wantedBy = [ "multi-user.target" ];
- path = [ pkgs.sentinel-fwlogs ];
- serviceConfig.ExecStart = "${pkgs.sentinel-fwlogs}/bin/sentinel-fwlogs";
- };
-
- };
-
-}
diff --git a/nixos/modules/sentinel-minipot.nix b/nixos/modules/sentinel-minipot.nix
deleted file mode 100644
index f0b022e..0000000
--- a/nixos/modules/sentinel-minipot.nix
+++ /dev/null
@@ -1,73 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-let
-
- cnf = config.sentinel.minipot;
- inherit (pkgs) sentinel-minipot;
-
- minipotOpts = { name, port }: {
- enable = mkOption {
- type = types.bool;
- default = true;
- description = ''
- Whether to enable the Turris Sentinel ${name} Minipot.
- The services.sentinel.enable and service.sentinel.minipot.enable have to be enabled as well.
- '';
- };
- port = mkOption {
- type = types.port;
- default = port;
- description = "The port ${name} minipot should bind to.";
- };
- };
-
-in {
-
- imports = [ ./sentinel.nix ];
-
-
- options = {
- services.sentinel.minipot = {
- enable = mkOption {
- type = types.bool;
- default = true;
- description = ''
- Whether to enable the Turris Sentinel Minipot system.
- The services.sentinel.enable has to be enabled as well.
- '';
- };
-
- http = minipotOpts { name = "HTTP"; port = 80805; };
- ftp = minipotOpts { name = "FTP"; port = 80805; };
- smtp = minipotOpts { name = "SMTP"; port = 80805; };
- telnet = minipotOpts { name = "Telnet"; port = 80805; };
- };
- };
-
-
- config = mkIf config.services.sentinel.enable && cnf.enable {
- assertions = [
- {
- assertion = cnf.http.enable || cnf.ftp.enable || cnf.smtp.enable || cnf.telnet.enable;
- message = "Sentinel minipot requires at least one of the protocols to be enabled";
- }
- ];
-
- environment.systemPackages = [ sentinel-minipot ];
-
- systemd.services.sentinel-minipot = {
- description = "Turris Sentinel Minipot";
- wantedBy = [ "multi-user.target" ];
- path = [ sentinel-minipot ];
- serviceConfig.ExecStart = "${sentinel-minipot}/bin/sentinel-minipot"
- + optionalString cnf.http.enable " --http=${cnf.http.port}"
- + optionalString cnf.ftp.enable " --ftp=${cnf.ftp.port}"
- + optionalString cnf.smtp.enable " --smtp=${cnf.smtp.port}"
- + optionalString cnf.telnet.enable " --telnet=${cnf.telnet.port}";
- };
-
- };
-
-}
diff --git a/nixos/modules/sentinel.nix b/nixos/modules/sentinel.nix
deleted file mode 100644
index 5362524..0000000
--- a/nixos/modules/sentinel.nix
+++ /dev/null
@@ -1,53 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-{
-
- options = {
-
- services.sentinel = {
-
- enable = mkOption {
- type = types.bool;
- default = false;
- description = ''
- Whether to enable the Turris Sentinel attact prevention system.
- '';
- };
- deviceToken = mkOption {
- type = types.str;
- description = ''
- Turris Sentinel token. You can use `sentinel-device-token -c` to get new one.
- '';
- };
-
- faillogs = {
- enable = mkOption {
- type = types.bool;
- default = true;
- description = ''
- Whether to enable the Turris Sentinel fail logs collector.
- The services.sentinel.enable has to be enabled as well.
- '';
- };
- };
- };
-
- };
-
-
- config = mkIf config.services.sentinel.enable {
- environment.systemPackages = [ pkgs.sentinel-proxy ];
- #environment.etc.cups.source = "/var/lib/cups";
-
- #systemd.services.sentinel-proxy = {
- # description = "Turris Sentinel proxy";
- # wantedBy = [ "multi-user.target" ];
- # path = [ sentinel-proxy ];
- # serviceConfig.ExecStart = "${sentinel-proxy}/bin/sentinel-proxy -f ";
- #};
-
- };
-
-}