Compare commits
2 Commits
aec9eed0b2
...
4fa7edfa1f
| Author | SHA1 | Date | |
|---|---|---|---|
| 4fa7edfa1f | |||
| 1bfda37cba |
16
flake.lock
generated
16
flake.lock
generated
@@ -121,6 +121,21 @@
|
|||||||
"type": "github"
|
"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": {
|
"nix-darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -191,6 +206,7 @@
|
|||||||
"clan-core": "clan-core",
|
"clan-core": "clan-core",
|
||||||
"devshell": "devshell",
|
"devshell": "devshell",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
|
"import-tree": "import-tree",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
};
|
};
|
||||||
|
import-tree.url = "github:vic/import-tree";
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
treefmt-nix = {
|
treefmt-nix = {
|
||||||
url = "github:numtide/treefmt-nix";
|
url = "github:numtide/treefmt-nix";
|
||||||
|
|||||||
@@ -54,6 +54,13 @@
|
|||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
roles.default.machines.b4l = { };
|
||||||
};
|
};
|
||||||
|
vikunja = {
|
||||||
|
module = {
|
||||||
|
name = "vikunja";
|
||||||
|
input = "self";
|
||||||
|
};
|
||||||
|
roles.default.machines.b4l = { };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, ... }:
|
{ inputs, config, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
(inputs.import-tree ./services)
|
||||||
];
|
];
|
||||||
nixpkgs.hostPlatform = {
|
nixpkgs.hostPlatform = {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|||||||
26
machines/b4l/services/vikunja.nix
Normal file
26
machines/b4l/services/vikunja.nix
Normal 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}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
clan = {
|
clan = {
|
||||||
meta.name = "NewEdgeClan";
|
meta.name = "NewEdgeClan";
|
||||||
machines = { };
|
machines = { };
|
||||||
specialArgs = { inherit self; };
|
specialArgs = { inherit inputs self; };
|
||||||
inherit self;
|
inherit self;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
22
modules/clan/vikunja/default.nix
Normal file
22
modules/clan/vikunja/default.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
18
modules/clan/vikunja/flake-module.nix
Normal file
18
modules/clan/vikunja/flake-module.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
39
modules/clan/vikunja/tests/vm/default.nix
Normal file
39
modules/clan/vikunja/tests/vm/default.nix
Normal 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")
|
||||||
|
|
||||||
|
'';
|
||||||
|
}
|
||||||
1
vars/per-machine/b4l/vikunja/subdomain/value
Normal file
1
vars/per-machine/b4l/vikunja/subdomain/value
Normal file
@@ -0,0 +1 @@
|
|||||||
|
todo
|
||||||
Reference in New Issue
Block a user