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.
This commit is contained in:
parent
b30b37d5ce
commit
132e688d65
1 changed files with 11 additions and 2 deletions
13
webapp.nix
13
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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue