Skip to content

Commit 5e5b461

Browse files
committed
feat: selfhosted user - add services
Signed-off-by: Reputable2722 <153411261+Reputable2772@users.noreply.github.com>
1 parent 1ae1235 commit 5e5b461

4 files changed

Lines changed: 100 additions & 1 deletion

File tree

Config/cloudflare-domains.age

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
age-encryption.org/v1
2+
-> ssh-ed25519 CHk3UA W+yzit9qjy1zU2bD0HrLwk7NNl5GLCYPTrOVUfgp1TM
3+
sMjOBSpoaPJZQGSohKvYocRJRZM3FsxB6YYUhYjNPjQ
4+
--- dRFs2zZK/i8P2LRGs7xDgIWdIW1uS3fBV1lefI6PvpI
5+
��11л��������5��R�<���+�Q�~�[��mVA�T�=�\��E���V���r�� ��r��K��}=�ED9�`�0�.�27��!�儀�Z��z�v~���=I��`

Config/config.nix

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,45 @@ rec {
323323
};
324324
};
325325
guest = { };
326+
selfhosted = rec {
327+
home = _home.wickedwizard or "";
328+
inherit (system.hp-laptop) secrets;
329+
dir.containers = "${home}/Containers";
330+
containers = {
331+
minecraft = {
332+
dir = null;
333+
envFiles = null;
334+
env = [
335+
"EULA=TRUE"
336+
"TYPE=FABRIC"
337+
"MEMORY=5G"
338+
"TZ=Asia/Kolkata"
339+
"ONLINE_MODE=FALSE"
340+
"ENFORCE_SECURE_PROFILE=FALSE"
341+
"VERSION_FROM_MODRINTH_PROJECTS=FALSE"
342+
"VERSION=26.1"
343+
# fabrictailor,easyauth,ledge have not been released for 26.1
344+
"MODRINTH_PROJECTS=fabric-api,fabric-language-kotlin,lithium,ferrite-core"
345+
"OPS=wickedwizard3588"
346+
];
347+
};
348+
ollama = {
349+
dir = null;
350+
envFiles = null;
351+
env = [
352+
"GGML_VULKAN=1"
353+
"OLLAMA_KEEP_ALIVE=10m"
354+
"OLLAMA_IGPU_ENABLE=1"
355+
"OLLAMA_LOAD_TIMEOUT=15m"
356+
];
357+
};
358+
ddns-updater = {
359+
dir = null;
360+
envFiles = [ "cloudflare-domains" ];
361+
env = null;
362+
};
363+
};
364+
};
326365
};
327366

328367
# All files should be in the same directory as this file.
@@ -357,6 +396,9 @@ rec {
357396
"wud.age".publicKeys = [ users.wickedwizard.secrets.encryption.key ];
358397
"n8n.age".publicKeys = [ users.wickedwizard.secrets.encryption.key ];
359398
"radicale.age".publicKeys = [ users.wickedwizard.secrets.encryption.key ];
399+
400+
# HP Laptop Container files
401+
"cloudflare-domains.age".publicKeys = [ users.selfhosted.secrets.encryption.key ];
360402
}
361403

362404
/**
@@ -381,4 +423,6 @@ rec {
381423
wud.age - Contains env variables like WUD_TRIGGER_NTFY_UPDATENOTIF_TOPIC, WUD_AUTH_BASIC_JOHN_USER, WUD_AUTH_BASIC_JOHN_HASH, etc. Refer to https://getwud.github.io/wud/#/configuration/ for more info.
382424
n8n.age - Contains env variables like N8N_HOST, WEBHOOK_URL, N8N_RUNNERS_AUTH_TOKEN
383425
radicale.age - Contains the apache htpasswd file, for user authentication. Should be mounted as a file into the container, not environment variables.
426+
427+
cloudflare-domains.age - Contains CLOUDFLARE_API_TOKEN, IP6_DOMAINS and PROXIED for cloudflare-ddns updater.
384428
*/

System/HP-Laptop/users.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
users = {
6060
selfhosted = {
6161
imports = [
62-
# ../../Users/Selfhosted/home.nix
62+
../../Users/Selfhosted/home.nix
6363
{
6464
home.stateVersion = "26.05";
6565
_module.args.config' = config'.users.selfhosted;

Users/Selfhosted/home.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
programs.home-manager.enable = true;
3+
4+
programs.quadlets.quadlets = {
5+
enable = true;
6+
"minecraft.container" = {
7+
Container = {
8+
ContainerName = "minecraft";
9+
Image = "docker.io/itzg/minecraft-server";
10+
PublishPort = [
11+
"12365:25565"
12+
];
13+
Volume = [
14+
"data:/data"
15+
];
16+
};
17+
};
18+
19+
"ollama.container" = {
20+
Container = {
21+
ContainerName = "ollama";
22+
GroupAdd = "keep-groups";
23+
Image = "docker.io/ollama/ollama:latest";
24+
PublishPort = [
25+
"11434:11434"
26+
];
27+
Volume = [
28+
":/root/.ollama"
29+
];
30+
AddDevice = [
31+
"/dev/dri:/dev/dri"
32+
];
33+
};
34+
};
35+
36+
"ddns-updater.container" = {
37+
Container = {
38+
ContainerName = "ddns-updater";
39+
Image = "docker.io/favonia/cloudflare-ddns:latest";
40+
Network = "host";
41+
User = "1000:1000";
42+
43+
ReadOnly = true;
44+
SecurityLabelDisable = true;
45+
NoNewPrivileges = true;
46+
DropCapability = "all";
47+
};
48+
};
49+
};
50+
}

0 commit comments

Comments
 (0)