From 1dd4f04725eeaafaab20adffc38be4ff558af011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sun, 1 Oct 2023 23:26:01 +0300 Subject: [PATCH] statix: fix bugs with inherit now I know better what it does. --- flake.nix | 2 +- hosts/fra1-a/configuration.nix | 2 +- hosts/fwminex/configuration.nix | 2 +- hosts/vno1-oh2/configuration.nix | 3 ++- hosts/vno3-rp3b/configuration.nix | 3 ++- modules/base/zfsborg/default.nix | 5 ++--- modules/services/friendlyport/default.nix | 2 +- modules/services/jakstpub/default.nix | 2 +- modules/services/syncthing/default.nix | 5 +---- statix.toml | 1 + 10 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 statix.toml diff --git a/flake.nix b/flake.nix index 47fc00f..81d1c20 100644 --- a/flake.nix +++ b/flake.nix @@ -61,7 +61,7 @@ (_self: super: { deploy-rs = { inherit (import nixpkgs {inherit system;}) deploy-rs; - inherit (super.deploy-rs.lib); + inherit (super.deploy-rs) lib; }; }) ]; diff --git a/hosts/fra1-a/configuration.nix b/hosts/fra1-a/configuration.nix index 94e4719..f4c5230 100644 --- a/hosts/fra1-a/configuration.nix +++ b/hosts/fra1-a/configuration.nix @@ -56,7 +56,7 @@ deployerbot = { follower = { - inherit (myData.hosts."vno1-oh2.servers.jakst".publicKey); + inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey; enable = true; sshAllowSubnets = [myData.subnets.tailscale.sshPattern]; diff --git a/hosts/fwminex/configuration.nix b/hosts/fwminex/configuration.nix index 37665fb..67829d0 100644 --- a/hosts/fwminex/configuration.nix +++ b/hosts/fwminex/configuration.nix @@ -84,7 +84,7 @@ in { deployerbot = { follower = { - inherit (myData.hosts."vno1-oh2.servers.jakst".publicKey); + inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey; enable = true; uidgid = myData.uidgid.updaterbot-deployee; diff --git a/hosts/vno1-oh2/configuration.nix b/hosts/vno1-oh2/configuration.nix index 236b539..96d3fed 100644 --- a/hosts/vno1-oh2/configuration.nix +++ b/hosts/vno1-oh2/configuration.nix @@ -196,10 +196,11 @@ }; follower = { + inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey; + enable = true; sshAllowSubnets = [myData.subnets.tailscale.sshPattern]; uidgid = myData.uidgid.updaterbot-deployee; - inherit (myData.hosts."vno1-oh2.servers.jakst".publicKey); }; }; diff --git a/hosts/vno3-rp3b/configuration.nix b/hosts/vno3-rp3b/configuration.nix index 659ac4f..c251481 100644 --- a/hosts/vno3-rp3b/configuration.nix +++ b/hosts/vno3-rp3b/configuration.nix @@ -94,10 +94,11 @@ deployerbot = { follower = { + inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey; + enable = true; sshAllowSubnets = [myData.subnets.tailscale.sshPattern]; uidgid = myData.uidgid.updaterbot-deployee; - inherit (myData.hosts."vno1-oh2.servers.jakst".publicKey); }; }; diff --git a/modules/base/zfsborg/default.nix b/modules/base/zfsborg/default.nix index 35d367a..4e51813 100644 --- a/modules/base/zfsborg/default.nix +++ b/modules/base/zfsborg/default.nix @@ -67,8 +67,7 @@ in { lib.nameValuePair "${lib.strings.sanitizeDerivationName mountpoint}-${toString i}" ({ - inherit (attrs.repo); - inherit (attrs.paths); + inherit (attrs) repo paths; doInit = true; encryption = { @@ -95,7 +94,7 @@ in { BORG_RSH = ''ssh -i "${config.mj.base.zfsborg.sshKeyPath}"''; }; } - // lib.optionalAttrs (attrs ? patterns) {inherit (attrs.patterns);}) + // lib.optionalAttrs (attrs ? patterns) {inherit (attrs) patterns;}) ) dirs ); diff --git a/modules/services/friendlyport/default.nix b/modules/services/friendlyport/default.nix index 03bad89..7a11f7f 100644 --- a/modules/services/friendlyport/default.nix +++ b/modules/services/friendlyport/default.nix @@ -22,7 +22,7 @@ }; config = let - inherit (config.mj.services.friendlyport.ports); + inherit (config.mj.services.friendlyport) ports; mkAdd = proto: subnets: ints: let subnetsS = builtins.concatStringsSep "," subnets; diff --git a/modules/services/jakstpub/default.nix b/modules/services/jakstpub/default.nix index cb6567c..f22d037 100644 --- a/modules/services/jakstpub/default.nix +++ b/modules/services/jakstpub/default.nix @@ -69,7 +69,7 @@ in { services.samba-wsdd = { enable = true; - inherit (cfg.hostname); + inherit (cfg) hostname; }; users.users.jakstpub = { diff --git a/modules/services/syncthing/default.nix b/modules/services/syncthing/default.nix index dbb3e68..536922e 100644 --- a/modules/services/syncthing/default.nix +++ b/modules/services/syncthing/default.nix @@ -105,10 +105,7 @@ in { ]; services.syncthing = { - inherit (cfg.enable); - inherit (cfg.user); - inherit (cfg.group); - inherit (cfg.dataDir); + inherit (cfg) enable user group dataDir; openDefaultPorts = true; guiAddress = let diff --git a/statix.toml b/statix.toml new file mode 100644 index 0000000..c2c0666 --- /dev/null +++ b/statix.toml @@ -0,0 +1 @@ +ignore = ['modules/base/boot']