refactor(actualbudget): remove unused service #179
@@ -1,51 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
cfg = config.guests.actualbudget; # NOLINT(let_order)
|
|
||||||
dataDir = "/data";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.guests.actualbudget = {
|
|
||||||
dataPath = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
default = null;
|
|
||||||
example = "/srv/actualbudget";
|
|
||||||
description = "Host path bind-mounted as Actual Budget's data directory.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = cfg.dataPath != null;
|
|
||||||
message = "guests.actualbudget.dataPath must point at the host directory that stores Actual Budget data.";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
registry.homepage.${config.networking.hostName}.actualbudget = {
|
|
||||||
tab = "Apps";
|
|
||||||
section = "Other";
|
|
||||||
name = "Actual Budget";
|
|
||||||
description = "Finance";
|
|
||||||
icon = "actual-budget.png";
|
|
||||||
};
|
|
||||||
|
|
||||||
guests.actualbudget = {
|
|
||||||
interior = {
|
|
||||||
modules.services.actualbudget = {
|
|
||||||
enable = true;
|
|
||||||
inherit dataDir;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
mounts.${dataDir}.directory = cfg.dataPath;
|
|
||||||
limits = {
|
|
||||||
memory = lib.mkDefault "2G";
|
|
||||||
cpu = lib.mkDefault "200%";
|
|
||||||
tasksMax = lib.mkDefault 512;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -71,22 +71,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
guests.actualbudget = {
|
|
||||||
enable = true;
|
|
||||||
vlan = 20;
|
|
||||||
mac = "BC:24:11:C1:CD:28";
|
|
||||||
dataPath = "/pikachu/data/actualbudget";
|
|
||||||
address = "10.23.20.42";
|
|
||||||
reverseProxy = {
|
|
||||||
enable = true;
|
|
||||||
route = {
|
|
||||||
domain = "budget.alexion.dev";
|
|
||||||
protocol = "https";
|
|
||||||
port = 5006;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
guests.navidrome = {
|
guests.navidrome = {
|
||||||
enable = true;
|
enable = true;
|
||||||
vlan = 20;
|
vlan = 20;
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.actualbudget; # NOLINT(let_order)
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.services.actualbudget = {
|
|
||||||
enable = lib.mkEnableOption "Actual Budget";
|
|
||||||
|
|
||||||
port = lib.mkOption {
|
|
||||||
type = lib.types.port;
|
|
||||||
default = 5006;
|
|
||||||
description = "Port Actual Budget listens on.";
|
|
||||||
};
|
|
||||||
|
|
||||||
dataDir = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "/data";
|
|
||||||
description = "Directory where Actual Budget stores server and user files.";
|
|
||||||
};
|
|
||||||
|
|
||||||
user = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "actual";
|
|
||||||
description = "User account that runs Actual Budget.";
|
|
||||||
};
|
|
||||||
|
|
||||||
group = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "storage";
|
|
||||||
description = "Group account that owns Actual Budget's writable state.";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
|
||||||
{
|
|
||||||
registry."stable-uid".${config.networking.hostName}.actualbudget = 20001;
|
|
||||||
}
|
|
||||||
|
|
||||||
(lib.mkIf cfg.enable {
|
|
||||||
users.users.${cfg.user} = {
|
|
||||||
isSystemUser = true;
|
|
||||||
uid = config.registry."stable-uid".${config.networking.hostName}.actualbudget;
|
|
||||||
inherit (cfg) group;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.actual = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true;
|
|
||||||
inherit (cfg) user;
|
|
||||||
inherit (cfg) group;
|
|
||||||
settings = {
|
|
||||||
inherit (cfg) port dataDir;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user