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";