From cc887fdc72aeeab406fc394679a260fbaa63428e Mon Sep 17 00:00:00 2001 From: Squibid Date: Sun, 11 Jan 2026 17:12:47 -0500 Subject: [PATCH] add lib for helper functions --- flake.nix | 3 ++- lib.nix | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f881612..1b47114 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,8 @@ { description = "Declaratively update your data."; inputs.nixpkgs.url = "nixpkgs/nixos-unstable"; - outputs = { ... }: { + outputs = { nixpkgs, ... }: { + lib = builtins.import ./lib.nix { pkgs = nixpkgs; }; nixosModules = rec { fooud = builtins.import ./module.nix; default = fooud; diff --git a/lib.nix b/lib.nix index e69de29..689d185 100644 --- a/lib.nix +++ b/lib.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +let + post-recv = dest: pkgs.writeScriptBin "post-recv" '' + git clone . ${dest} + ''; +in +let + lib.git = { + inherit post-recv; + }; +in + lib