From e163d452d9aebca4879efd482ef9605bd734ea52 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Thu, 25 Apr 2024 11:39:11 +0200 Subject: [PATCH] add zfs commands --- nixos/homes/common/default.nix | 1 + nixos/homes/common/zfs.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 nixos/homes/common/zfs.nix diff --git a/nixos/homes/common/default.nix b/nixos/homes/common/default.nix index 6430844..bda4196 100644 --- a/nixos/homes/common/default.nix +++ b/nixos/homes/common/default.nix @@ -3,6 +3,7 @@ imports = [ ./packages.nix ./terminal.nix + ./zfs.nix ]; options.gui.enable = lib.mkEnableOption "should GUI packages be anabled?"; } diff --git a/nixos/homes/common/zfs.nix b/nixos/homes/common/zfs.nix new file mode 100644 index 0000000..66e5270 --- /dev/null +++ b/nixos/homes/common/zfs.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, ... }: +with pkgs; +with lib; +{ + config = mkMerge [ + { + home.packages = [ + ( + let + options = [ + "name" + "mountpoint" + "com.sun:auto-snapshot:yearly" + "com.sun:auto-snapshot:monthly" + "com.sun:auto-snapshot:daily" + "com.sun:auto-snapshot:hourly" + ]; + in + pkgs.writers.writeBashBin "zfs-overview" '' + ${pkgs.zfs}/bin/zfs list -o ${concatStringsSep "," options} "$@" + '' + ) + ]; + } + ]; +}