From a88854058057dc11705071535ad903f9a5c8336f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?= Date: Thu, 14 Nov 2024 09:49:49 +0100 Subject: [PATCH] Opt-in to formatting for the `services/` subdirectory --- flake.nix | 5 ++++- services/fediversity/garage.nix | 12 +++--------- services/fediversity/mastodon.nix | 6 +----- services/fediversity/peertube.nix | 6 +----- services/flake.nix | 4 +--- services/installer.nix | 4 +--- services/tests/mastodon-garage.nix | 4 +--- services/tests/pixelfed-garage.nix | 8 ++------ services/vm/pixelfed-vm.nix | 6 +----- 9 files changed, 15 insertions(+), 40 deletions(-) diff --git a/flake.nix b/flake.nix index 38975ca..7192e50 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,10 @@ ## opt-in. Maybe one day we will decide to have them everywhere. let inherit (builtins) concatStringsSep; - optin = [ "deployment" ]; + optin = [ + "deployment" + "services" + ]; files = "^((" + concatStringsSep "|" optin + ")/.*\\.nix|[^/]*\\.nix)$"; in { diff --git a/services/fediversity/garage.nix b/services/fediversity/garage.nix index 758a151..16b5702 100644 --- a/services/fediversity/garage.nix +++ b/services/fediversity/garage.nix @@ -141,12 +141,8 @@ in types.submodule { # TODO: these should be managed as secrets, not in the nix store options = { - id = mkOption { - type = types.str; - }; - secret = mkOption { - type = types.str; - }; + id = mkOption { type = types.str; }; + secret = mkOption { type = types.str; }; # TODO: assert at least one of these is true # NOTE: this currently needs to be done at the top level module ensureAccess = mkOption { @@ -184,9 +180,7 @@ in pkgs.awscli ]; - networking.firewall.allowedTCPPorts = [ - fedicfg.rpc.port - ]; + networking.firewall.allowedTCPPorts = [ fedicfg.rpc.port ]; services.garage = { enable = true; package = pkgs.garage_0_9; diff --git a/services/fediversity/mastodon.nix b/services/fediversity/mastodon.nix index 8b6e95b..8cd7454 100644 --- a/services/fediversity/mastodon.nix +++ b/services/fediversity/mastodon.nix @@ -5,11 +5,7 @@ let }; in -{ - config, - lib, - ... -}: +{ config, lib, ... }: lib.mkIf (config.fediversity.enable && config.fediversity.mastodon.enable) { #### garage setup diff --git a/services/fediversity/peertube.nix b/services/fediversity/peertube.nix index 4a4a07b..1d1ea08 100644 --- a/services/fediversity/peertube.nix +++ b/services/fediversity/peertube.nix @@ -5,11 +5,7 @@ let }; in -{ - config, - lib, - ... -}: +{ config, lib, ... }: lib.mkIf (config.fediversity.enable && config.fediversity.peertube.enable) { networking.firewall.allowedTCPPorts = [ diff --git a/services/flake.nix b/services/flake.nix index aec006b..b55b281 100644 --- a/services/flake.nix +++ b/services/flake.nix @@ -128,9 +128,7 @@ }; devShells.${system}.default = pkgs.mkShell { - inputs = with pkgs; [ - nil - ]; + inputs = with pkgs; [ nil ]; shellHook = self.checks.${system}.pre-commit.shellHook; }; }; diff --git a/services/installer.nix b/services/installer.nix index f87be58..a5f787e 100644 --- a/services/installer.nix +++ b/services/installer.nix @@ -42,9 +42,7 @@ let }; in { - imports = [ - "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" - ]; + imports = [ "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" ]; nixpkgs.hostPlatform = "x86_64-linux"; services.getty.autologinUser = lib.mkForce "root"; programs.bash.loginShellInit = nixpkgs.lib.getExe bootstrap; diff --git a/services/tests/mastodon-garage.nix b/services/tests/mastodon-garage.nix index 75e269c..242e865 100644 --- a/services/tests/mastodon-garage.nix +++ b/services/tests/mastodon-garage.nix @@ -7,9 +7,7 @@ let seleniumScript = pkgs.writers.writePython3Bin "selenium-script" - { - libraries = with pkgs.python3Packages; [ selenium ]; - } + { libraries = with pkgs.python3Packages; [ selenium ]; } '' from selenium import webdriver from selenium.webdriver.common.by import By diff --git a/services/tests/pixelfed-garage.nix b/services/tests/pixelfed-garage.nix index 746728b..bdac402 100644 --- a/services/tests/pixelfed-garage.nix +++ b/services/tests/pixelfed-garage.nix @@ -54,9 +54,7 @@ let seleniumScriptPostPicture = pkgs.writers.writePython3Bin "selenium-script-post-picture" - { - libraries = with pkgs.python3Packages; [ selenium ]; - } + { libraries = with pkgs.python3Packages; [ selenium ]; } '' import os import time @@ -99,9 +97,7 @@ let seleniumScriptGetSrc = pkgs.writers.writePython3Bin "selenium-script-get-src" - { - libraries = with pkgs.python3Packages; [ selenium ]; - } + { libraries = with pkgs.python3Packages; [ selenium ]; } '' ${seleniumImports} ${seleniumSetup} diff --git a/services/vm/pixelfed-vm.nix b/services/vm/pixelfed-vm.nix index 8ec156a..b5e820f 100644 --- a/services/vm/pixelfed-vm.nix +++ b/services/vm/pixelfed-vm.nix @@ -1,8 +1,4 @@ -{ - lib, - modulesPath, - ... -}: +{ lib, modulesPath, ... }: let inherit (lib) mkVMOverride;