diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2022-12-01 08:54:17 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2022-12-01 08:54:17 -0500 |
commit | a0ea66ddc749e42aaea89eb6b27887e4fe32ad45 (patch) | |
tree | 9af5342611be47ff6b6c65210553c45e532495f9 | |
parent | b5efaa433c1c6f53413b0443a18c1aea95bd2215 (diff) |
Fix formatting
-rw-r--r-- | config/linoquotes.nix | 14 | ||||
-rw-r--r-- | config/mail-server.nix | 44 | ||||
-rw-r--r-- | config/matrix.nix | 49 | ||||
-rw-r--r-- | config/minecraft.nix | 8 | ||||
-rw-r--r-- | config/mpd.nix | 32 | ||||
-rw-r--r-- | config/pjournal.nix | 36 | ||||
-rw-r--r-- | config/postgresql.nix | 5 | ||||
-rw-r--r-- | config/pxe.nix | 3 |
8 files changed, 87 insertions, 104 deletions
diff --git a/config/linoquotes.nix b/config/linoquotes.nix index d778979..b5909ab 100644 --- a/config/linoquotes.nix +++ b/config/linoquotes.nix @@ -1,9 +1,8 @@ { configs, lib, pkgs, ... }: let port = (import ../data/aliases.nix).services.linoquotes.port; - linoquotes-gamma = pkgs.callPackage /opt/linoquotes-gamma/default.nix {}; -in -{ + linoquotes-gamma = pkgs.callPackage /opt/linoquotes-gamma/default.nix { }; +in { networking.firewall.allowedTCPPorts = [ port ]; systemd.services.linoquotes = { @@ -11,12 +10,13 @@ in after = [ "networking.target" ]; wantedBy = [ "multi-user.target" ]; environment = { - RUST_BACKTRACE = "1"; - RUST_LOG = "error,main=info,logger=info,iron=info,linoquotes-gamma=info"; + RUST_BACKTRACE = "1"; + RUST_LOG = "error,main=info,logger=info,iron=info,linoquotes-gamma=info"; }; serviceConfig = { - ExecStart = "${linoquotes-gamma}/bin/linoquotes-gamma --port ${toString port} " + - "--db_file /var/lib/linoquotes/db.sqlite"; + ExecStart = + "${linoquotes-gamma}/bin/linoquotes-gamma --port ${toString port} " + + "--db_file /var/lib/linoquotes/db.sqlite"; User = "linoquotes"; }; }; diff --git a/config/mail-server.nix b/config/mail-server.nix index 9ea07f7..fd363fb 100644 --- a/config/mail-server.nix +++ b/config/mail-server.nix @@ -1,5 +1,4 @@ -{ config, lib, pkgs, ... }: -{ +{ config, lib, pkgs, ... }: { networking.firewall.allowedTCPPorts = [ 25 465 587 ]; services.dovecot2 = { enable = true; @@ -32,7 +31,8 @@ hostname = "shape"; domain = "orbekk.com"; - destination = ["orbekk.com" "kj.orbekk.com" "orbekk.no" "kj.orbekk.no" "kufieta.net"]; + destination = + [ "orbekk.com" "kj.orbekk.com" "orbekk.no" "kj.orbekk.no" "kufieta.net" ]; relayHost = "smtp.gmail.com"; relayPort = 587; @@ -56,25 +56,25 @@ ''; extraAliases = let - erik = "erikorbekk@gmail.com"; - kjetil = "kjetil.orbekk@gmail.com"; - lise = "lise.orbekk@gmail.com"; - katharina = "katharina.kufieta@gmail.com"; - in '' -eo: ${erik} -erik: ${erik} -orbekk: ${kjetil} -k: ${kjetil} -kj: ${kjetil} -kjetil: ${kjetil} -root: ${kjetil} -postmaster: ${kjetil} -katharina: ${katharina} -kathi: ${katharina} -kasiunia: ${katharina} -kat: ${katharina} -lise: ${lise} - ''; + erik = "erikorbekk@gmail.com"; + kjetil = "kjetil.orbekk@gmail.com"; + lise = "lise.orbekk@gmail.com"; + katharina = "katharina.kufieta@gmail.com"; + in '' + eo: ${erik} + erik: ${erik} + orbekk: ${kjetil} + k: ${kjetil} + kj: ${kjetil} + kjetil: ${kjetil} + root: ${kjetil} + postmaster: ${kjetil} + katharina: ${katharina} + kathi: ${katharina} + kasiunia: ${katharina} + kat: ${katharina} + lise: ${lise} + ''; sslCert = "/var/lib/acme/shape.orbekk.com/fullchain.pem"; sslCACert = "/var/lib/acme/shape.orbekk.com/fullchain.pem"; sslKey = "/var/lib/acme/shape.orbekk.com/key.pem"; diff --git a/config/matrix.nix b/config/matrix.nix index 6a57e76..8747d62 100644 --- a/config/matrix.nix +++ b/config/matrix.nix @@ -1,9 +1,9 @@ { config, lib, pkgs, ... }: let matrixPort = (import ../data/aliases.nix).services.matrix.port; - matrixFederationPort = (import ../data/aliases.nix).services.matrixFederation.port; -in -{ + matrixFederationPort = + (import ../data/aliases.nix).services.matrixFederation.port; +in { networking.firewall.allowedTCPPorts = [ matrixPort matrixFederationPort ]; services.matrix-synapse = { @@ -11,27 +11,30 @@ in server_name = "orbekk.com"; # registration_shared_secret = "disable_after_registration"; listeners = [ - { - port = matrixPort; - bind_address = ""; - type = "http"; - tls = false; - x_forwarded = true; - resources = [ - { names = ["client" "webclient"]; compress = true; } + { + port = matrixPort; + bind_address = ""; + type = "http"; + tls = false; + x_forwarded = true; + resources = [{ + names = [ "client" "webclient" ]; + compress = true; + } # { names = ["federation"]; compress = false; } - ]; - } - { - port = matrixFederationPort; - bind_address = ""; - type = "http"; - tls = true; - x_forwarded = false; - resources = [ - { names = ["federation"]; compress = false; } - ]; - } + ]; + } + { + port = matrixFederationPort; + bind_address = ""; + type = "http"; + tls = true; + x_forwarded = false; + resources = [{ + names = [ "federation" ]; + compress = false; + }]; + } ]; }; } diff --git a/config/minecraft.nix b/config/minecraft.nix index 8e6ad0c..9aa7720 100644 --- a/config/minecraft.nix +++ b/config/minecraft.nix @@ -1,12 +1,8 @@ { config, lib, pkgs, ... }: let minecraft-port = 25565; - allowedAddresses = [ - "108.30.16.212" - "24.193.7.0/24" - ]; -in -{ + allowedAddresses = [ "108.30.16.212" "24.193.7.0/24" ]; +in { networking.firewall.extraCommands = lib.concatMapStrings (addr: '' iptables -A nixos-fw -p tcp \ --dport ${toString minecraft-port} \ diff --git a/config/mpd.nix b/config/mpd.nix index 7815f61..a9dcee0 100644 --- a/config/mpd.nix +++ b/config/mpd.nix @@ -1,8 +1,8 @@ { config, lib, pkgs, ... }: - let mpdport = (import ../data/aliases.nix).services.mpd.port; - mpdwebport = (import ../data/aliases.nix).services.mpdweb.port; - in -{ +let + mpdport = (import ../data/aliases.nix).services.mpd.port; + mpdwebport = (import ../data/aliases.nix).services.mpdweb.port; +in { networking.firewall.allowedTCPPorts = [ mpdport mpdwebport ]; services.ympd = { @@ -14,18 +14,18 @@ enable = true; musicDirectory = "/storage/music"; extraConfig = '' - audio_output { - type "httpd" - name "KJ mpd stream" - encoder "lame" - port "${toString mpdport}" - quality "0" # do not define if bitrate is defined - #bitrate "128" # do not define if quality is defined - format "44100:16:1" - always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped. - tags "yes" # httpd supports sending tags to listening streams. - audio_buffer_size "8192" - } + audio_output { + type "httpd" + name "KJ mpd stream" + encoder "lame" + port "${toString mpdport}" + quality "0" # do not define if bitrate is defined + #bitrate "128" # do not define if quality is defined + format "44100:16:1" + always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped. + tags "yes" # httpd supports sending tags to listening streams. + audio_buffer_size "8192" + } ''; }; } diff --git a/config/pjournal.nix b/config/pjournal.nix index 7214537..06e93d0 100644 --- a/config/pjournal.nix +++ b/config/pjournal.nix @@ -1,9 +1,7 @@ { config, lib, pkgs, ... }: with lib; -let - cfg = config.services.pjournal; -in -{ +let cfg = config.services.pjournal; +in { options = { services.pjournal = { enable = mkOption { @@ -13,7 +11,7 @@ in package = mkOption { type = types.package; - default = pkgs.callPackage ../pkgs/pjournal/default.nix {}; + default = pkgs.callPackage ../pkgs/pjournal/default.nix { }; }; base_url = mkOption { @@ -29,30 +27,22 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = [ - cfg.package - ]; + environment.systemPackages = [ cfg.package ]; services.postgresql = { enable = true; - ensureDatabases = ["pjournal"]; - ensureUsers = [ - { - name = "pjournal"; - ensurePermissions = { - "DATABASE pjournal" = "ALL PRIVILEGES"; - }; - } - ]; + ensureDatabases = [ "pjournal" ]; + ensureUsers = [{ + name = "pjournal"; + ensurePermissions = { "DATABASE pjournal" = "ALL PRIVILEGES"; }; + }]; }; systemd.services.pjournal = { description = "pjournal instance"; after = [ "multi-user.target" "postgresql.service" ]; - wantedBy = ["multi-user.target"]; - environment = { - RUST_BACKTRACE = "1"; - }; + wantedBy = [ "multi-user.target" ]; + environment = { RUST_BACKTRACE = "1"; }; script = '' # This will fail the first time. Run pjournal init to initialize # the database. @@ -61,9 +51,7 @@ in --port ${toString cfg.port} \ --base-url ${cfg.base_url} ''; - serviceConfig = { - User = "pjournal"; - }; + serviceConfig = { User = "pjournal"; }; }; }; diff --git a/config/postgresql.nix b/config/postgresql.nix index 40f00f0..5d4aa7d 100644 --- a/config/postgresql.nix +++ b/config/postgresql.nix @@ -1,4 +1 @@ -{ config, lib, pkgs, ... }: -{ - services.postgresql.enable = true; -} +{ config, lib, pkgs, ... }: { services.postgresql.enable = true; } diff --git a/config/pxe.nix b/config/pxe.nix index fcf839e..ad90e0c 100644 --- a/config/pxe.nix +++ b/config/pxe.nix @@ -1,5 +1,4 @@ -{ config, lib, pkgs, ... }: -{ +{ config, lib, pkgs, ... }: { services.dnsmasq = { extraConfig = '' enable-tftp |