From 88017f5a874478dd82f306a5df88c38a8d06fcb6 Mon Sep 17 00:00:00 2001 From: tdback Date: Thu, 16 Jan 2025 19:57:13 -0500 Subject: fix: format flake with `nixfmt-rfc-style` --- modules/scripts/zquota/default.nix | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'modules/scripts/zquota/default.nix') diff --git a/modules/scripts/zquota/default.nix b/modules/scripts/zquota/default.nix index 5741e0e..bd35546 100644 --- a/modules/scripts/zquota/default.nix +++ b/modules/scripts/zquota/default.nix @@ -1,13 +1,19 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.services.zquota; - zquota = let - bc = getExe pkgs.bc; - zfs = getExe pkgs.zfs; - hostname = config.networking.hostName; - in + zquota = + let + bc = getExe pkgs.bc; + zfs = getExe pkgs.zfs; + hostname = config.networking.hostName; + in pkgs.writeShellScriptBin "zquota" '' set -e @@ -38,7 +44,8 @@ let "dataset $DATASET on ${hostname} has exceeded quota by ''${DIFF}GB" fi ''; -in { +in +{ options = { services.zquota = { enable = mkEnableOption "zquota"; @@ -66,12 +73,11 @@ in { systemd.services."zquota" = { description = "Perform and report scheduled quota checks on ZFS datasets."; serviceConfig.Type = "oneshot"; - script = - strings.concatStringsSep "\n" ( - mapAttrsToList (dataset: quota: - "/run/current-system/sw/bin/zquota ${dataset} ${builtins.toString quota}" - ) cfg.quotas - ); + script = strings.concatStringsSep "\n" ( + mapAttrsToList ( + dataset: quota: "/run/current-system/sw/bin/zquota ${dataset} ${builtins.toString quota}" + ) cfg.quotas + ); }; systemd.timers."zquota" = { wantedBy = [ "timers.target" ]; -- cgit v1.2.3