diff options
author | tdback <tyler@tdback.net> | 2025-01-16 19:57:13 -0500 |
---|---|---|
committer | tdback <tyler@tdback.net> | 2025-01-16 19:57:13 -0500 |
commit | 88017f5a874478dd82f306a5df88c38a8d06fcb6 (patch) | |
tree | 8806c58c4f21bb6a56d8530df8a93b256d44b4f3 /modules/scripts/zquota | |
parent | 01d012473d4311d4f4e5a0831d912bc4b8c61639 (diff) |
fix: format flake with `nixfmt-rfc-style`
Diffstat (limited to 'modules/scripts/zquota')
-rw-r--r-- | modules/scripts/zquota/default.nix | 32 |
1 files changed, 19 insertions, 13 deletions
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" ]; |