2 Commits

Author SHA1 Message Date
4fa7edfa1f vikunja implementation on b4l 2025-07-24 11:39:06 +07:00
1bfda37cba vikunja clanService 2025-07-24 11:38:39 +07:00
10 changed files with 133 additions and 3 deletions

16
flake.lock generated
View File

@@ -121,6 +121,21 @@
"type": "github"
}
},
"import-tree": {
"locked": {
"lastModified": 1752730890,
"narHash": "sha256-GES8fapSLGz36MMPRVNkSUWXUTtqvGQNXHjRmRLfJUY=",
"owner": "vic",
"repo": "import-tree",
"rev": "6ebb8cb87987b20264c09296166543fd3761d274",
"type": "github"
},
"original": {
"owner": "vic",
"repo": "import-tree",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
@@ -191,6 +206,7 @@
"clan-core": "clan-core",
"devshell": "devshell",
"flake-parts": "flake-parts",
"import-tree": "import-tree",
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix"
}

View File

@@ -15,6 +15,7 @@
inputs.nixpkgs-lib.follows = "nixpkgs";
url = "github:hercules-ci/flake-parts";
};
import-tree.url = "github:vic/import-tree";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
treefmt-nix = {
url = "github:numtide/treefmt-nix";

View File

@@ -54,6 +54,13 @@
};
roles.default.machines.b4l = { };
};
vikunja = {
module = {
name = "vikunja";
input = "self";
};
roles.default.machines.b4l = { };
};
};
services = {

View File

@@ -1,7 +1,7 @@
{ config, ... }:
{ inputs, config, ... }:
{
imports = [
(inputs.import-tree ./services)
];
nixpkgs.hostPlatform = {
system = "x86_64-linux";

View File

@@ -0,0 +1,26 @@
{ config, ... }:
{
clan.core.vars.generators.vikunja = {
files.subdomain.secret = false;
prompts = {
subdomain = {
persist = true;
type = "line";
description = "Sub-domain for Vikunja todo app. Default:(todo)";
};
};
script = ''cat $prompts/subdomain | echo "todo" > $out/subdomain'';
};
services.vikunja = {
frontendHostname = "${config.clan.core.vars.generators.vikunja.files.subdomain.value}.${config.networking.fqdn}";
};
services.nginx.virtualHosts."${config.services.vikunja.frontendHostname}" = {
useACMEHost = "${config.networking.fqdn}";
forceSSL = true;
locations."/" = {
proxyPass = "${config.services.vikunja.frontendScheme}://${config.services.vikunja.frontendHostname}:${builtins.toString config.services.vikunja.port}";
};
};
}

View File

@@ -6,7 +6,7 @@
clan = {
meta.name = "NewEdgeClan";
machines = { };
specialArgs = { inherit self; };
specialArgs = { inherit inputs self; };
inherit self;
};
}

View File

@@ -0,0 +1,22 @@
{ ... }:
{
_class = "clan.service";
manifest.name = "vikunja";
manifest.description = "The to-do app to organize your life.";
manifest.categories = [ "System" ];
roles.default = {
perInstance.nixosModule =
{
lib,
...
}:
{
services.vikunja = {
enable = lib.mkDefault true;
frontendScheme = lib.mkDefault "http";
frontendHostname = lib.mkDefault "localhost";
};
};
};
}

View File

@@ -0,0 +1,18 @@
{ lib, ... }:
let
module = lib.modules.importApply ./default.nix { };
in
{
clan.modules = {
vikunja = module;
};
perSystem =
{ ... }:
{
clan.nixosTests.vikunja = {
imports = [ ./tests/vm/default.nix ];
clan.modules."@clan/vikunja" = module;
};
};
}

View File

@@ -0,0 +1,39 @@
{
pkgs,
...
}:
{
name = "service-vikunja";
clan = {
directory = ./.;
inventory = {
machines.server = { };
instances = {
vikunja-test = {
module.name = "@clan/vikunja";
module.input = "self";
roles.default.machines."server".settings = { };
};
};
};
};
nodes = {
server = {
services.vikunja = {
};
};
};
testScript = ''
start_all()
server.wait_for_unit("vikunja")
# Check that garage is running
server.succeed("systemctl status vikunja")
'';
}

View File

@@ -0,0 +1 @@
todo