From 132e688d65e71eb0b763e7a14f1aee67038175a1 Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Fri, 27 Feb 2026 12:17:29 -0500 Subject: [PATCH] feat: add src option for flake-compatible pure evaluation When services.webapp.src is set, it is used directly instead of builtins.fetchGit. This allows passing a flake input as the source, which is required for pure evaluation mode in Nix flakes. --- webapp.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/webapp.nix b/webapp.nix index bc5ac75..ff0e216 100644 --- a/webapp.nix +++ b/webapp.nix @@ -9,8 +9,8 @@ let pname = "aio-webapp"; version = "1.0.0"; - # Fetch source from git repository - src = builtins.fetchGit { + # Use src option if provided (flake input), otherwise fetch from git + src = if cfg.src != null then cfg.src else builtins.fetchGit { url = cfg.gitUrl; ref = cfg.gitRef; }; @@ -88,6 +88,15 @@ in { options.services.webapp = { enable = lib.mkEnableOption "AIO webapp"; + src = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + description = '' + Source tree for the webapp. When set, this is used directly instead of + fetching via builtins.fetchGit. Use this with flake inputs for pure evaluation. + ''; + }; + gitUrl = lib.mkOption { type = lib.types.str; default = "https://git.atitlan.io/aiolabs/webapp";