From cd2b98cca2a1ba3a1f477f29cd9526efe406be17 Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 15 Apr 2021 12:34:38 +0200 Subject: [PATCH] Use dot operator for attribute sets with 1 element --- modules/communication.nix | 4 +--- modules/datasync.nix | 12 ++++-------- modules/devops.nix | 2 +- modules/periodic.nix | 2 +- modules/webstack.nix | 34 ++++++++++++++-------------------- 5 files changed, 21 insertions(+), 33 deletions(-) diff --git a/modules/communication.nix b/modules/communication.nix index 98e506e..2af6c6d 100644 --- a/modules/communication.nix +++ b/modules/communication.nix @@ -31,9 +31,7 @@ address = "http://localhost:8118"; port = 8118; }; - bridge = { - permissions = { "@coolneng:coolneng.duckdns.org" = "admin"; }; - }; + bridge.permissions."@coolneng:coolneng.duckdns.org" = "admin"; }; serviceDependencies = [ "matrix-synapse.service" ]; }; diff --git a/modules/datasync.nix b/modules/datasync.nix index 38fc994..66f3248 100644 --- a/modules/datasync.nix +++ b/modules/datasync.nix @@ -8,14 +8,10 @@ dataDir = "/vault/syncthing"; declarative = { devices = { - panacea = { - id = - "UNZIABR-GEQ4AWT-XKFADLW-HW3SQ3Y-BEYZ56A-W530DLS-DXGQWKK-2QQ4RQ6"; - }; - caravanserai = { - id = - "6KSGHNJ-NH4EZGP-X5HGV6B-OQ3ZFE6-WZQACOC-6WKPRGI-TTBRHJ5-U3R2AQ3"; - }; + panacea.id = + "UNZIABR-GEQ4AWT-XKFADLW-HW3SQ3Y-BEYZ56A-W530DLS-DXGQWKK-2QQ4RQ6"; + caravanserai.id = + "6KSGHNJ-NH4EZGP-X5HGV6B-OQ3ZFE6-WZQACOC-6WKPRGI-TTBRHJ5-U3R2AQ3"; }; folders = { Documents = { diff --git a/modules/devops.nix b/modules/devops.nix index 0f23095..f0922b0 100644 --- a/modules/devops.nix +++ b/modules/devops.nix @@ -14,6 +14,6 @@ repositoryRoot = "/vault/git"; appName = "Gitea"; lfs.enable = true; - settings = { ui = { DEFAULT_THEME = "arc-green"; }; }; + settings.ui.DEFAULT_THEME = "arc-green"; }; } diff --git a/modules/periodic.nix b/modules/periodic.nix index 20021d6..b4faef4 100644 --- a/modules/periodic.nix +++ b/modules/periodic.nix @@ -20,7 +20,7 @@ in { path = with pkgs; [ curl ]; script = "curl -L https://github.com/notracking/hosts-blocklists/raw/master/dnsmasq/dnsmasq.blacklist.txt -o ${blocklist}"; - serviceConfig = { Type = "oneshot"; }; + serviceConfig.Type = "oneshot"; postStop = '' chown -R dnsmasq ${stateDir} systemctl restart dnsmasq diff --git a/modules/webstack.nix b/modules/webstack.nix index dfe834e..df38fd7 100644 --- a/modules/webstack.nix +++ b/modules/webstack.nix @@ -92,17 +92,15 @@ ssl = true; } ]; - locations."/" = { proxyPass = "http://localhost:8008/"; }; + locations."/".proxyPass = "http://localhost:8008/"; }; "element.coolneng.duckdns.org" = { enableACME = true; forceSSL = true; locations."/".root = pkgs.element-web.override { - conf = { - default_server_config."m.homeserver" = { - "base_url" = "https://matrix.coolneng.duckdns.org"; - "server_name" = "coolneng.duckdns.org"; - }; + conf.default_server_config."m.homeserver" = { + "base_url" = "https://matrix.coolneng.duckdns.org"; + "server_name" = "coolneng.duckdns.org"; }; }; }; @@ -134,25 +132,21 @@ security.acme = { acceptTerms = true; email = "akasroua@gmail.com"; - certs = { - "coolneng.duckdns.org" = { - extraDomainNames = [ - "radicale.coolneng.duckdns.org" - "sync.coolneng.duckdns.org" - "git.coolneng.duckdns.org" - "rss.coolneng.duckdns.org" - "matrix.coolneng.duckdns.org" - "element.coolneng.duckdns.org" - "wallabag.coolneng.duckdns.org" - ]; - }; - }; + certs."coolneng.duckdns.org".extraDomainNames = [ + "radicale.coolneng.duckdns.org" + "sync.coolneng.duckdns.org" + "git.coolneng.duckdns.org" + "rss.coolneng.duckdns.org" + "matrix.coolneng.duckdns.org" + "element.coolneng.duckdns.org" + "wallabag.coolneng.duckdns.org" + ]; }; # Generate dhparams security.dhparams = { enable = true; - params = { nginx.bits = 2048; }; + params.nginx.bits = 2048; }; # PostgreSQL databases configuration