From 8047d13b59904fc04ca5ee9ab0703cc8d09d0694 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Mon, 14 Oct 2024 04:51:19 +0300 Subject: [PATCH] Nixfmt: Enable strict formatting. --- .treefmt.toml | 1 + container/Change.nix | 4 +--- container/Cloud.nix | 4 +--- container/Ddns.nix | 4 +--- container/Dns.nix | 8 ++------ container/Download.nix | 4 +--- container/Frkn.nix | 4 +--- container/Git.nix | 4 +--- container/Hdd.nix | 4 +--- container/Iot.nix | 4 +--- container/Jobber.nix | 10 ++-------- container/Mail.nix | 4 +--- container/Office.nix | 4 +--- container/Paper.nix | 4 +--- container/Pass.nix | 4 +--- container/Postgres.nix | 4 +--- container/Print.nix | 4 +--- container/Rabbitmq.nix | 4 +--- container/Read.nix | 4 +--- container/Status.nix | 8 ++------ container/Stock.nix | 4 +--- container/proxy/host/Camera.nix | 6 +----- container/proxy/host/Hdd.nix | 6 +----- container/proxy/host/Home.nix | 6 +----- container/proxy/host/Iot.nix | 6 +----- container/proxy/host/Search.nix | 6 +----- flake.nix | 6 +----- home/config/template/Latex.nix | 4 +--- home/config/waybar/config/default.nix | 4 +--- home/user/Dasha.nix | 6 +----- host/x86_64-linux/work/Fprint.nix | 4 +--- lib/Container.nix | 10 ++-------- module/AmdCompute.nix | 8 ++------ module/Brightness.nix | 4 +--- module/IntelCpu.nix | 4 +--- module/Kernel.nix | 8 ++------ module/Package.nix | 16 ++++------------ module/Polkit.nix | 4 +--- module/Portal.nix | 4 +--- module/Sway.nix | 4 +--- module/Waybar.nix | 4 +--- package/homer/Config.nix | 4 +--- 42 files changed, 51 insertions(+), 168 deletions(-) diff --git a/.treefmt.toml b/.treefmt.toml index c1b1831..2137d4e 100644 --- a/.treefmt.toml +++ b/.treefmt.toml @@ -12,4 +12,5 @@ [formatter.nixfmt-rfc-style] command = "nixfmt" +options = [ "-s" ] includes = [ "*.nix" ] diff --git a/container/Change.nix b/container/Change.nix index 2c22527..218720e 100644 --- a/container/Change.nix +++ b/container/Change.nix @@ -32,9 +32,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.change = container.mkContainer cfg { bindMounts = { diff --git a/container/Cloud.nix b/container/Cloud.nix index e29401b..2ec8da0 100644 --- a/container/Cloud.nix +++ b/container/Cloud.nix @@ -36,9 +36,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.cloud = container.mkContainer cfg { bindMounts = { diff --git a/container/Ddns.nix b/container/Ddns.nix index 1be06e7..311b075 100644 --- a/container/Ddns.nix +++ b/container/Ddns.nix @@ -24,9 +24,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.ddns = container.mkContainer cfg { bindMounts = { diff --git a/container/Dns.nix b/container/Dns.nix index 3822f5b..30762e3 100644 --- a/container/Dns.nix +++ b/container/Dns.nix @@ -30,9 +30,7 @@ in config = { ... }: container.mkContainerConfig cfg { - environment.systemPackages = [ - pkgs.cloudflared - ]; + environment.systemPackages = [ pkgs.cloudflared ]; systemd.services.cloudflared = { description = "Cloudflare DoH server."; @@ -96,9 +94,7 @@ in "https://raw.githubusercontent.com/AssoEchap/stalkerware-indicators/master/generated/hosts" "https://urlhaus.abuse.ch/downloads/hostfile/" ]; - other = [ - "https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser" - ]; + other = [ "https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser" ]; }; # whiteLists = { # other = [ diff --git a/container/Download.nix b/container/Download.nix index 5b37e7a..91db50e 100644 --- a/container/Download.nix +++ b/container/Download.nix @@ -36,9 +36,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.download = container.mkContainer cfg { enableTun = true; diff --git a/container/Frkn.nix b/container/Frkn.nix index 9c10e9b..eec1917 100644 --- a/container/Frkn.nix +++ b/container/Frkn.nix @@ -40,9 +40,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.frkn = container.mkContainer cfg { bindMounts = { diff --git a/container/Git.nix b/container/Git.nix index 7e5c3f1..71521e8 100644 --- a/container/Git.nix +++ b/container/Git.nix @@ -37,9 +37,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.git = container.mkContainer cfg { bindMounts = { diff --git a/container/Hdd.nix b/container/Hdd.nix index 23d0899..e9a3616 100644 --- a/container/Hdd.nix +++ b/container/Hdd.nix @@ -34,9 +34,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.hdd = container.mkContainer cfg { # bindMounts = let diff --git a/container/Iot.nix b/container/Iot.nix index 66a039b..0536bad 100644 --- a/container/Iot.nix +++ b/container/Iot.nix @@ -33,9 +33,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.iot = container.mkContainer cfg { bindMounts = { diff --git a/container/Jobber.nix b/container/Jobber.nix index 6cf6e04..ca7b487 100644 --- a/container/Jobber.nix +++ b/container/Jobber.nix @@ -31,9 +31,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.jobber = container.mkContainer cfg { bindMounts = { @@ -58,11 +56,7 @@ in ]); in container.mkContainerConfig cfg { - networking = lib.mkForce { - nameservers = [ - "10.30.218.2" - ]; - }; + networking = lib.mkForce { nameservers = [ "10.30.218.2" ]; }; systemd.services.jobber = { description = "My job is pushing the button."; diff --git a/container/Mail.nix b/container/Mail.nix index 8337d18..b44edbc 100644 --- a/container/Mail.nix +++ b/container/Mail.nix @@ -193,9 +193,7 @@ in ru ]; hostName = cfg.domain; - plugins = [ - "managesieve" - ]; + plugins = [ "managesieve" ]; extraConfig = '' # starttls needed for authentication, so the fqdn required to match # the certificate diff --git a/container/Office.nix b/container/Office.nix index 90858a2..0c5330d 100644 --- a/container/Office.nix +++ b/container/Office.nix @@ -38,9 +38,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.office = container.mkContainer cfg { bindMounts = { diff --git a/container/Paper.nix b/container/Paper.nix index e19a963..b1fe477 100644 --- a/container/Paper.nix +++ b/container/Paper.nix @@ -34,9 +34,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.paper = container.mkContainer cfg { bindMounts = { diff --git a/container/Pass.nix b/container/Pass.nix index c68e864..fac3c2e 100644 --- a/container/Pass.nix +++ b/container/Pass.nix @@ -32,9 +32,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.pass = container.mkContainer cfg { bindMounts = { diff --git a/container/Postgres.nix b/container/Postgres.nix index 55ecfb4..6939e17 100644 --- a/container/Postgres.nix +++ b/container/Postgres.nix @@ -29,9 +29,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.postgres = container.mkContainer cfg { bindMounts = { diff --git a/container/Print.nix b/container/Print.nix index 422472c..9d5f5b8 100644 --- a/container/Print.nix +++ b/container/Print.nix @@ -40,9 +40,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.print = container.mkContainer cfg { bindMounts = { diff --git a/container/Rabbitmq.nix b/container/Rabbitmq.nix index d8f3f17..ece4693 100644 --- a/container/Rabbitmq.nix +++ b/container/Rabbitmq.nix @@ -30,9 +30,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.rabbitmq = container.mkContainer cfg { bindMounts = { diff --git a/container/Read.nix b/container/Read.nix index f59a3f4..198faec 100644 --- a/container/Read.nix +++ b/container/Read.nix @@ -33,9 +33,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.read = container.mkContainer cfg { bindMounts = { diff --git a/container/Status.nix b/container/Status.nix index 7362416..30a7932 100644 --- a/container/Status.nix +++ b/container/Status.nix @@ -32,9 +32,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.status = container.mkContainer cfg { bindMounts = { @@ -48,9 +46,7 @@ in { lib, ... }: container.mkContainerConfig cfg { networking = { - nameservers = mkForce [ - config.container.module.dns.address - ]; + nameservers = mkForce [ config.container.module.dns.address ]; }; services.uptime-kuma = { diff --git a/container/Stock.nix b/container/Stock.nix index c018341..d395fd4 100644 --- a/container/Stock.nix +++ b/container/Stock.nix @@ -32,9 +32,7 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = container.mkContainerDir cfg [ - "data" - ]; + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; containers.stock = container.mkContainer cfg { bindMounts = { diff --git a/container/proxy/host/Camera.nix b/container/proxy/host/Camera.nix index e0c7aa2..5ee2196 100644 --- a/container/proxy/host/Camera.nix +++ b/container/proxy/host/Camera.nix @@ -1,8 +1,4 @@ -{ - config, - container, - ... -}: +{ config, container, ... }: let domain = "camera.${config.container.domain}"; address = "192.168.2.249"; diff --git a/container/proxy/host/Hdd.nix b/container/proxy/host/Hdd.nix index fc628c3..2971f3c 100644 --- a/container/proxy/host/Hdd.nix +++ b/container/proxy/host/Hdd.nix @@ -1,8 +1,4 @@ -{ - container, - config, - ... -}: +{ container, config, ... }: let cfg = config.container.module.hdd; name = "hdd"; diff --git a/container/proxy/host/Home.nix b/container/proxy/host/Home.nix index 566306e..369d81c 100644 --- a/container/proxy/host/Home.nix +++ b/container/proxy/host/Home.nix @@ -1,8 +1,4 @@ -{ - config, - container, - ... -}: +{ config, container, ... }: let cfg = config.container.module.home; name = "home"; diff --git a/container/proxy/host/Iot.nix b/container/proxy/host/Iot.nix index afb5c05..6b17160 100644 --- a/container/proxy/host/Iot.nix +++ b/container/proxy/host/Iot.nix @@ -1,8 +1,4 @@ -{ - container, - config, - ... -}: +{ container, config, ... }: let cfg = config.container.module.iot; name = "iot"; diff --git a/container/proxy/host/Search.nix b/container/proxy/host/Search.nix index 45d2e5f..a6fb137 100644 --- a/container/proxy/host/Search.nix +++ b/container/proxy/host/Search.nix @@ -1,8 +1,4 @@ -{ - container, - config, - ... -}: +{ container, config, ... }: let cfg = config.container.module.search; name = "search"; diff --git a/flake.nix b/flake.nix index e5aceb1..ebe8e1f 100644 --- a/flake.nix +++ b/flake.nix @@ -231,11 +231,7 @@ }; }; - mkSystem = system: hostname: { - "${hostname}" = mkHost { - inherit system hostname; - }; - }; + mkSystem = system: hostname: { "${hostname}" = mkHost { inherit system hostname; }; }; in nixpkgs.lib.foldl' (acc: h: acc // h) { } ( map ( diff --git a/home/config/template/Latex.nix b/home/config/template/Latex.nix index 9702feb..2e4c0da 100644 --- a/home/config/template/Latex.nix +++ b/home/config/template/Latex.nix @@ -50,9 +50,7 @@ { devShells.${system} = { default = pkgs.mkShell rec { - nativeBuildInputs = with pkgs; [ - tex - ]; + nativeBuildInputs = with pkgs; [ tex ]; buildInputs = with pkgs; [ ]; SOURCE_DATE_EPOCH = "${toString self.lastModified}"; }; diff --git a/home/config/waybar/config/default.nix b/home/config/waybar/config/default.nix index a313d10..14190e6 100644 --- a/home/config/waybar/config/default.nix +++ b/home/config/waybar/config/default.nix @@ -24,9 +24,7 @@ in "sway/scratchpad" "mpris" ]; - modules-center = [ - "sway/workspaces" - ]; + modules-center = [ "sway/workspaces" ]; modules-right = [ "sway/language" "pulseaudio" diff --git a/home/user/Dasha.nix b/home/user/Dasha.nix index adb1a9b..eb1af8d 100644 --- a/home/user/Dasha.nix +++ b/home/user/Dasha.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: +{ lib, config, ... }: with lib; let cfg = config.user.dasha; diff --git a/host/x86_64-linux/work/Fprint.nix b/host/x86_64-linux/work/Fprint.nix index de387a5..bdf5d16 100644 --- a/host/x86_64-linux/work/Fprint.nix +++ b/host/x86_64-linux/work/Fprint.nix @@ -1,8 +1,6 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ - fprintd - ]; + environment.systemPackages = with pkgs; [ fprintd ]; services.fprintd = { enable = true; diff --git a/lib/Container.nix b/lib/Container.nix index eb68f25..e62a7d4 100644 --- a/lib/Container.nix +++ b/lib/Container.nix @@ -10,9 +10,7 @@ cfg: extra: lib.recursiveUpdate { # Allow nested containers. - additionalCapabilities = [ - ''all" --system-call-filter="add_key keyctl bpf" --capability="all'' - ]; + additionalCapabilities = [ ''all" --system-call-filter="add_key keyctl bpf" --capability="all'' ]; enableTun = true; # Start containers with the system by default. @@ -71,11 +69,7 @@ mkContainerDir = cfg: dirs: map (path: "d '${cfg.storage}/${path}' 1777 root root - -") dirs; # Common configuration for Nginx server. - mkServer = - cfg: - lib.recursiveUpdate { - forceSSL = false; - } cfg; + mkServer = cfg: lib.recursiveUpdate { forceSSL = false; } cfg; # Attach the host media directory to container. # They will be added to /type/{0..9} diff --git a/module/AmdCompute.nix b/module/AmdCompute.nix index 4b2c7b2..d6d894e 100644 --- a/module/AmdCompute.nix +++ b/module/AmdCompute.nix @@ -15,11 +15,7 @@ in config = mkIf cfg.enable { nixpkgs.config.rocmSupport = true; - systemd.tmpfiles.rules = [ - "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" - ]; - hardware.graphics.extraPackages = with pkgs; [ - rocmPackages.clr.icd - ]; + systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ]; + hardware.graphics.extraPackages = with pkgs; [ rocmPackages.clr.icd ]; }; } diff --git a/module/Brightness.nix b/module/Brightness.nix index 284daab..c3f2d8a 100644 --- a/module/Brightness.nix +++ b/module/Brightness.nix @@ -8,7 +8,5 @@ in module.desktop.brightness.enable = mkEnableOption "Brightness."; }; - config = mkIf cfg.enable { - programs.light.enable = true; - }; + config = mkIf cfg.enable { programs.light.enable = true; }; } diff --git a/module/IntelCpu.nix b/module/IntelCpu.nix index 5d8d37c..00ac071 100644 --- a/module/IntelCpu.nix +++ b/module/IntelCpu.nix @@ -22,9 +22,7 @@ in }; config = mkIf cfg.enable (mkMerge [ - { - boot.kernelModules = [ "kvm-intel" ]; - } + { boot.kernelModules = [ "kvm-intel" ]; } (mkIf cfg.powersave { module.powersave = { enable = true; diff --git a/module/Kernel.nix b/module/Kernel.nix index 9c98b10..ff03fd7 100644 --- a/module/Kernel.nix +++ b/module/Kernel.nix @@ -85,12 +85,8 @@ in }; }) - (mkIf cfg.hotspotTtlBypass { - boot.kernel.sysctl."net.ipv4.ip_default_ttl" = 65; - }) + (mkIf cfg.hotspotTtlBypass { boot.kernel.sysctl."net.ipv4.ip_default_ttl" = 65; }) - (mkIf cfg.latest { - boot.kernelPackages = pkgs.linuxPackages_latest; - }) + (mkIf cfg.latest { boot.kernelPackages = pkgs.linuxPackages_latest; }) ]); } diff --git a/module/Package.nix b/module/Package.nix index 7a2743c..ad5d31e 100644 --- a/module/Package.nix +++ b/module/Package.nix @@ -60,9 +60,7 @@ in }) # Desktop apps. - (mkIf cfg.desktop.enable { - environment.systemPackages = package.desktop; - }) + (mkIf cfg.desktop.enable { environment.systemPackages = package.desktop; }) # Gaming. (mkIf cfg.gaming.enable { @@ -86,18 +84,12 @@ in }) # Creative. - (mkIf cfg.creative.enable { - environment.systemPackages = package.creative; - }) + (mkIf cfg.creative.enable { environment.systemPackages = package.creative; }) # Development. - (mkIf cfg.dev.enable { - environment.systemPackages = package.dev; - }) + (mkIf cfg.dev.enable { environment.systemPackages = package.dev; }) # Extras. - (mkIf cfg.extra.enable { - environment.systemPackages = package.extra; - }) + (mkIf cfg.extra.enable { environment.systemPackages = package.extra; }) ]; } diff --git a/module/Polkit.nix b/module/Polkit.nix index d04400b..d4143cc 100644 --- a/module/Polkit.nix +++ b/module/Polkit.nix @@ -17,9 +17,7 @@ in config = mkIf cfg.enable { security.polkit.enable = true; systemd = { - packages = with pkgs; [ - polkit-kde-agent - ]; + packages = with pkgs; [ polkit-kde-agent ]; user = { services.plasma-polkit-agent = { serviceConfig = { diff --git a/module/Portal.nix b/module/Portal.nix index 705d591..b9c236b 100644 --- a/module/Portal.nix +++ b/module/Portal.nix @@ -17,9 +17,7 @@ in config = mkIf cfg.enable { xdg.portal = { enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-gtk - ]; + extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; config = { common = { default = [ diff --git a/module/Sway.nix b/module/Sway.nix index 43b8c23..f96b6e2 100644 --- a/module/Sway.nix +++ b/module/Sway.nix @@ -41,9 +41,7 @@ in base = true; gtk = true; }; - extraPackages = with pkgs; [ - swaykbdd - ]; + extraPackages = with pkgs; [ swaykbdd ]; }; }; } diff --git a/module/Waybar.nix b/module/Waybar.nix index 08dc797..f443ec9 100644 --- a/module/Waybar.nix +++ b/module/Waybar.nix @@ -15,7 +15,5 @@ in }; }; - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ waybar ]; - }; + config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ waybar ]; }; } diff --git a/package/homer/Config.nix b/package/homer/Config.nix index 52d0701..ebe1d43 100644 --- a/package/homer/Config.nix +++ b/package/homer/Config.nix @@ -47,9 +47,7 @@ let dark = colors; }; - links = [ - (mkLink "Status" "fa-heartbeat" "https://${config.container.module.status.domain}") - ]; + links = [ (mkLink "Status" "fa-heartbeat" "https://${config.container.module.status.domain}") ]; services = [ (mkGroup "App" "fa-server" [