Opt-in to formatting for the services/ subdirectory

This commit is contained in:
Nicolas Jeannerod 2024-11-14 09:49:49 +01:00
parent 4b77808f3f
commit a888540580
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8
9 changed files with 15 additions and 40 deletions

View file

@ -27,7 +27,10 @@
## opt-in. Maybe one day we will decide to have them everywhere. ## opt-in. Maybe one day we will decide to have them everywhere.
let let
inherit (builtins) concatStringsSep; inherit (builtins) concatStringsSep;
optin = [ "deployment" ]; optin = [
"deployment"
"services"
];
files = "^((" + concatStringsSep "|" optin + ")/.*\\.nix|[^/]*\\.nix)$"; files = "^((" + concatStringsSep "|" optin + ")/.*\\.nix|[^/]*\\.nix)$";
in in
{ {

View file

@ -141,12 +141,8 @@ in
types.submodule { types.submodule {
# TODO: these should be managed as secrets, not in the nix store # TODO: these should be managed as secrets, not in the nix store
options = { options = {
id = mkOption { id = mkOption { type = types.str; };
type = types.str; secret = mkOption { type = types.str; };
};
secret = mkOption {
type = types.str;
};
# TODO: assert at least one of these is true # TODO: assert at least one of these is true
# NOTE: this currently needs to be done at the top level module # NOTE: this currently needs to be done at the top level module
ensureAccess = mkOption { ensureAccess = mkOption {
@ -184,9 +180,7 @@ in
pkgs.awscli pkgs.awscli
]; ];
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [ fedicfg.rpc.port ];
fedicfg.rpc.port
];
services.garage = { services.garage = {
enable = true; enable = true;
package = pkgs.garage_0_9; package = pkgs.garage_0_9;

View file

@ -5,11 +5,7 @@ let
}; };
in in
{ { config, lib, ... }:
config,
lib,
...
}:
lib.mkIf (config.fediversity.enable && config.fediversity.mastodon.enable) { lib.mkIf (config.fediversity.enable && config.fediversity.mastodon.enable) {
#### garage setup #### garage setup

View file

@ -5,11 +5,7 @@ let
}; };
in in
{ { config, lib, ... }:
config,
lib,
...
}:
lib.mkIf (config.fediversity.enable && config.fediversity.peertube.enable) { lib.mkIf (config.fediversity.enable && config.fediversity.peertube.enable) {
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [

View file

@ -128,9 +128,7 @@
}; };
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
inputs = with pkgs; [ inputs = with pkgs; [ nil ];
nil
];
shellHook = self.checks.${system}.pre-commit.shellHook; shellHook = self.checks.${system}.pre-commit.shellHook;
}; };
}; };

View file

@ -42,9 +42,7 @@ let
}; };
in in
{ {
imports = [ imports = [ "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" ];
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
];
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
services.getty.autologinUser = lib.mkForce "root"; services.getty.autologinUser = lib.mkForce "root";
programs.bash.loginShellInit = nixpkgs.lib.getExe bootstrap; programs.bash.loginShellInit = nixpkgs.lib.getExe bootstrap;

View file

@ -7,9 +7,7 @@ let
seleniumScript = seleniumScript =
pkgs.writers.writePython3Bin "selenium-script" pkgs.writers.writePython3Bin "selenium-script"
{ { libraries = with pkgs.python3Packages; [ selenium ]; }
libraries = with pkgs.python3Packages; [ selenium ];
}
'' ''
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By

View file

@ -54,9 +54,7 @@ let
seleniumScriptPostPicture = seleniumScriptPostPicture =
pkgs.writers.writePython3Bin "selenium-script-post-picture" pkgs.writers.writePython3Bin "selenium-script-post-picture"
{ { libraries = with pkgs.python3Packages; [ selenium ]; }
libraries = with pkgs.python3Packages; [ selenium ];
}
'' ''
import os import os
import time import time
@ -99,9 +97,7 @@ let
seleniumScriptGetSrc = seleniumScriptGetSrc =
pkgs.writers.writePython3Bin "selenium-script-get-src" pkgs.writers.writePython3Bin "selenium-script-get-src"
{ { libraries = with pkgs.python3Packages; [ selenium ]; }
libraries = with pkgs.python3Packages; [ selenium ];
}
'' ''
${seleniumImports} ${seleniumImports}
${seleniumSetup} ${seleniumSetup}

View file

@ -1,8 +1,4 @@
{ { lib, modulesPath, ... }:
lib,
modulesPath,
...
}:
let let
inherit (lib) mkVMOverride; inherit (lib) mkVMOverride;