From 4f6ff408efef3f8550baa0a62a5a0e40570499a1 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 1 Feb 2021 22:53:12 +0100 Subject: [PATCH] treewide: remove unneeded string literals --- modules/backups.nix | 2 +- modules/bitcoind.nix | 12 ++++++------ modules/btcpayserver.nix | 2 +- modules/clightning.nix | 4 ++-- modules/hardware-wallets.nix | 2 +- modules/joinmarket-ob-watcher.nix | 2 +- modules/joinmarket.nix | 14 +++++++------- modules/lightning-loop.nix | 2 +- modules/liquid.nix | 8 ++++---- modules/lnd.nix | 4 ++-- pkgs/python-packages/chromalog/default.nix | 2 +- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/modules/backups.nix b/modules/backups.nix index 322a84c..13a922c 100644 --- a/modules/backups.nix +++ b/modules/backups.nix @@ -72,7 +72,7 @@ in { "--include-filelist" "${filelist}" "--full-if-older-than" "1M" ]; - targetUrl = "${cfg.destination}"; + targetUrl = cfg.destination; frequency = cfg.frequency; secretFile = "${config.nix-bitcoin.secretsDir}/backup-encryption-env"; }; diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index d8eb698..9752b88 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -343,13 +343,13 @@ in { serviceConfig = nbLib.defaultHardening // { Type = "notify"; NotifyAccess = "all"; - User = "${cfg.user}"; - Group = "${cfg.group}"; + User = cfg.user; + Group = cfg.group; TimeoutStartSec = 300; ExecStart = "${cfg.package}/bin/bitcoind -datadir='${cfg.dataDir}'"; Restart = "on-failure"; UMask = mkIf cfg.dataDirReadableByGroup "0027"; - ReadWritePaths = "${cfg.dataDir}"; + ReadWritePaths = cfg.dataDir; } // (if cfg.enforceTor then nbLib.allowTor else nbLib.allowAnyIP) @@ -375,9 +375,9 @@ in { done ''; serviceConfig = nbLib.defaultHardening // { - User = "${cfg.user}"; - Group = "${cfg.group}"; - ReadWritePaths = "${cfg.dataDir}"; + User = cfg.user; + Group = cfg.group; + ReadWritePaths = cfg.dataDir; } // nbLib.allowTor; }; diff --git a/modules/btcpayserver.nix b/modules/btcpayserver.nix index 6466634..fe38313 100644 --- a/modules/btcpayserver.nix +++ b/modules/btcpayserver.nix @@ -108,7 +108,7 @@ in { enable = true; ensureDatabases = [ "btcpaydb" ]; ensureUsers = [{ - name = "${cfg.btcpayserver.user}"; + name = cfg.btcpayserver.user; ensurePermissions."DATABASE btcpaydb" = "ALL PRIVILEGES"; }]; }; diff --git a/modules/clightning.nix b/modules/clightning.nix index a46eac1..f2d64e4 100644 --- a/modules/clightning.nix +++ b/modules/clightning.nix @@ -140,10 +140,10 @@ in { ''; serviceConfig = nbLib.defaultHardening // { ExecStart = "${nbPkgs.clightning}/bin/lightningd --lightning-dir=${cfg.dataDir}"; - User = "${cfg.user}"; + User = cfg.user; Restart = "on-failure"; RestartSec = "10s"; - ReadWritePaths = "${cfg.dataDir}"; + ReadWritePaths = cfg.dataDir; } // (if cfg.enforceTor then nbLib.allowTor else nbLib.allowAnyIP diff --git a/modules/hardware-wallets.nix b/modules/hardware-wallets.nix index e7dea40..92a7a22 100644 --- a/modules/hardware-wallets.nix +++ b/modules/hardware-wallets.nix @@ -47,7 +47,7 @@ in { # Provides lsusb for debugging pkgs.usbutils ]; - users.groups."${cfg.group}" = {}; + users.groups.${cfg.group} = {}; nix-bitcoin.operator.groups = [ cfg.group ]; }) (mkIf cfg.ledger { diff --git a/modules/joinmarket-ob-watcher.nix b/modules/joinmarket-ob-watcher.nix index e8b2a30..bf71e50 100644 --- a/modules/joinmarket-ob-watcher.nix +++ b/modules/joinmarket-ob-watcher.nix @@ -79,7 +79,7 @@ in { serviceConfig = nbLib.defaultHardening // rec { StateDirectory = "joinmarket-ob-watcher"; StateDirectoryMode = "0770"; - WorkingDirectory = "${cfg.dataDir}"; # The service creates dir 'logs' in the working dir + WorkingDirectory = cfg.dataDir; # The service creates dir 'logs' in the working dir ExecStart = '' ${nbPkgs.joinmarket}/bin/ob-watcher --datadir=${cfg.dataDir} \ --host=${cfg.address} --port=${toString cfg.port} diff --git a/modules/joinmarket.nix b/modules/joinmarket.nix index ccdc8cb..f593d34 100644 --- a/modules/joinmarket.nix +++ b/modules/joinmarket.nix @@ -148,7 +148,7 @@ in { ]; users.users.${cfg.user} = { description = "joinmarket User"; - group = "${cfg.group}"; + group = cfg.group; home = cfg.dataDir; extraGroups = [ "tor" ]; }; @@ -202,11 +202,11 @@ in { fi ''); ExecStart = "${nbPkgs.joinmarket}/bin/joinmarketd"; - WorkingDirectory = "${cfg.dataDir}"; # The service creates 'commitmentlist' in the working dir - User = "${cfg.user}"; + WorkingDirectory = cfg.dataDir; # The service creates 'commitmentlist' in the working dir + User = cfg.user; Restart = "on-failure"; RestartSec = "10s"; - ReadWritePaths = "${cfg.dataDir}"; + ReadWritePaths = cfg.dataDir; } // nbLib.allowTor; }; @@ -242,10 +242,10 @@ in { serviceConfig = nbLib.defaultHardening // rec { RuntimeDirectory = "joinmarket-yieldgenerator"; # Only used to create start script RuntimeDirectoryMode = "700"; - WorkingDirectory = "${cfg.dataDir}"; # The service creates dir 'logs' in the working dir + WorkingDirectory = cfg.dataDir; # The service creates dir 'logs' in the working dir ExecStart = "${pkgs.bash}/bin/bash /run/${RuntimeDirectory}/start"; - User = "${cfg.user}"; - ReadWritePaths = "${cfg.dataDir}"; + User = cfg.user; + ReadWritePaths = cfg.dataDir; } // nbLib.allowTor; }; }) diff --git a/modules/lightning-loop.nix b/modules/lightning-loop.nix index fd87b19..3c84713 100644 --- a/modules/lightning-loop.nix +++ b/modules/lightning-loop.nix @@ -101,7 +101,7 @@ in { User = "lnd"; Restart = "on-failure"; RestartSec = "10s"; - ReadWritePaths = "${cfg.dataDir}"; + ReadWritePaths = cfg.dataDir; } // (if cfg.enforceTor then nbLib.allowTor else nbLib.allowAnyIP); diff --git a/modules/liquid.nix b/modules/liquid.nix index a9bc4c5..3d482bd 100644 --- a/modules/liquid.nix +++ b/modules/liquid.nix @@ -233,12 +233,12 @@ in { ''; serviceConfig = nbLib.defaultHardening // { Type = "simple"; - User = "${cfg.user}"; - Group = "${cfg.group}"; + User = cfg.user; + Group = cfg.group; ExecStart = "${nbPkgs.elementsd}/bin/elementsd ${cmdlineOptions}"; - PIDFile = "${pidFile}"; + PIDFile = pidFile; Restart = "on-failure"; - ReadWritePaths = "${cfg.dataDir}"; + ReadWritePaths = cfg.dataDir; } // (if cfg.enforceTor then nbLib.allowTor else nbLib.allowAnyIP diff --git a/modules/lnd.nix b/modules/lnd.nix index 6a22844..b6e2549 100644 --- a/modules/lnd.nix +++ b/modules/lnd.nix @@ -193,7 +193,7 @@ in { User = "lnd"; Restart = "on-failure"; RestartSec = "10s"; - ReadWritePaths = "${cfg.dataDir}"; + ReadWritePaths = cfg.dataDir; ExecStartPost = let restUrl = "https://${cfg.restAddress}:${toString cfg.restPort}/v1"; in [ @@ -246,7 +246,7 @@ in { sleep 0.1 done - ''}" + '') # Run fully privileged for chown "+${nbLib.script '' umask ug=r,o= diff --git a/pkgs/python-packages/chromalog/default.nix b/pkgs/python-packages/chromalog/default.nix index 44589a8..0d2e0c8 100644 --- a/pkgs/python-packages/chromalog/default.nix +++ b/pkgs/python-packages/chromalog/default.nix @@ -6,7 +6,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "freelan-developers"; repo = "chromalog"; - rev = "${version}"; + rev = version; sha256 = "0pj4s52rgwlvwkzrj85y92c5r9c84pz8gga45jl5spysrv41y9p0"; };