Compare commits

...
4 Commits
Author SHA1 Message Date
marc f5ffea6d64 Added diwan to thingvellir 2026-11-09 19:28:24 +01:00
marc b369ef8e1d diwan: update lock to c09f2a1 (fixes .diwan/ dir not being created on first run) 2026-11-09 16:22:10 +01:00
marc a5b74df151 More thingvellir fixes 2026-11-09 15:38:07 +01:00
marc 0b50ca2dce diwan: switch flake input from local path: to the real remote
https://git.samfelag.xyz/marc/diwan is now pushed and reachable; locked
to de1576a. Re-verified via the same nix eval smoke test as before --
ExecStart resolves to the real built package over the network.
2026-11-09 15:35:28 +01:00
9 changed files with 116 additions and 12 deletions

No files matched your search

+10
View File
@@ -15,6 +15,10 @@ client {
path = "/var/lib/nomad_volumes/dns/pihole/etc-dnsmasq.d"
read_only = false
}
host_volume "dns-unbound" {
path = "/var/lib/nomad_volumes/dns/unbound/etc-unbound"
read_only = false
}
# Caddy
host_volume "caddyfile" {
@@ -37,4 +41,10 @@ client {
path = "/var/lib/nomad_volumes/folkugat"
read_only = false
}
# Receptari
host_volume "receptari" {
path = "/var/lib/nomad_volumes/receptari"
read_only = false
}
}
Generated
+9 -6
View File
@@ -43,14 +43,17 @@
]
},
"locked": {
"lastModified": 1794219210,
"narHash": "sha256-dv8srfP1/ZMcql+Da8U9dK/zEsTmW3ViBID7BoTnIVw=",
"path": "/home/marc/projects/diwan",
"type": "path"
"lastModified": 1794246188,
"narHash": "sha256-Y9ABp5yvkeTjzj7s7gd3JxiL9nlUrB6+DhOA+BKdoAk=",
"ref": "refs/heads/main",
"rev": "43215d6e0a35f8b8594e2dec78e9535731444e6a",
"revCount": 8,
"type": "git",
"url": "https://git.samfelag.xyz/marc/diwan"
},
"original": {
"path": "/home/marc/projects/diwan",
"type": "path"
"type": "git",
"url": "https://git.samfelag.xyz/marc/diwan"
}
},
"emacs-overlay": {
+1 -5
View File
@@ -45,11 +45,7 @@
herdr.url = "github:herdrdev/herdr";
# - Diwan -------------------------------------
# TODO: switch to a real git remote (e.g. git.samfelag.xyz) once diwan
# is pushed there -- a local path: input only resolves on whatever
# machine evaluates this flake, which breaks on hosts (like thingvellir)
# that clone and build samfelag themselves.
diwan.url = "path:/home/marc/projects/diwan";
diwan.url = "git+https://git.samfelag.xyz/marc/diwan";
diwan.inputs.nixpkgs.follows = "nixpkgs";
};
+15
View File
@@ -17,6 +17,7 @@ with lib;
enable = false;
allowedUDPPorts = [
53 # DNS (pihole + unbound)
8300 # Consul inter-node communication
8600 # Consul DNS
];
};
@@ -69,5 +70,19 @@ with lib;
dev.docker.enable = true;
dev.docker.users = ["marc"];
ai.claude.enable = true;
ai.diwan = {
enable = true;
notesDir = "/home/marc/org-agenda";
};
app.nextcloud.syncClient = {
enable = true;
user = "marc";
localDir = "/home/marc/org-agenda";
remoteUrl = "https://nextcloud.samfelag.xyz";
remotePath = "/org-agenda";
passwordFile = config.age.secrets."app.d/nextcloud-password".path;
};
};
}
+6
View File
@@ -20,5 +20,11 @@
group = "consul";
mode = "600";
};
"app.d/nextcloud-password" = {
file = ../../secrets/app.d/nextcloud-password.age;
owner = "marc";
mode = "400";
};
};
}
+3
View File
@@ -43,6 +43,9 @@ in
description = "diwan tick";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
# diwan shells out to `herdr`; systemd's default service PATH doesn't
# include it, so add it explicitly rather than relying on the login PATH.
path = [ inputs.herdr.packages.${system}.default ];
environment = {
DIWAN_NOTES_DIR = cfg.notesDir;
};
+60 -1
View File
@@ -6,8 +6,45 @@ in
{
options.samfelag.modules.app.nextcloud = {
enable = lib.mkEnableOption "nextcloud";
syncClient = {
enable = lib.mkEnableOption "headless nextcloud sync via nextcloudcmd on a timer";
user = lib.mkOption {
type = lib.types.str;
description = "User to run the sync as, and Nextcloud login name";
};
config = lib.mkIf cfg.enable {
localDir = lib.mkOption {
type = lib.types.str;
description = "Local directory to sync";
};
remoteUrl = lib.mkOption {
type = lib.types.str;
description = "Nextcloud server URL";
};
remotePath = lib.mkOption {
type = lib.types.str;
default = "";
description = "Remote path on the Nextcloud server to sync";
};
passwordFile = lib.mkOption {
type = lib.types.str;
description = "Path to an EnvironmentFile containing NC_PASSWORD=... (should be secret)";
};
interval = lib.mkOption {
type = lib.types.str;
default = "1min";
description = "How often to run the sync (systemd time span)";
};
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
nextcloud-client
];
@@ -16,6 +53,28 @@ in
enable = true;
startInBackground = true;
};
})
(lib.mkIf cfg.syncClient.enable {
systemd.services.nextcloud-sync = {
description = "Nextcloud headless sync (nextcloudcmd)";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
User = cfg.syncClient.user;
EnvironmentFile = cfg.syncClient.passwordFile;
ExecStart = "${pkgs.nextcloud-client}/bin/nextcloudcmd --non-interactive -u ${cfg.syncClient.user} --path ${cfg.syncClient.remotePath} ${cfg.syncClient.localDir} ${cfg.syncClient.remoteUrl}";
};
};
systemd.timers.nextcloud-sync = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = cfg.syncClient.interval;
OnUnitActiveSec = cfg.syncClient.interval;
};
};
})
];
}
+9
View File
@@ -0,0 +1,9 @@
age-encryption.org/v1
-> ssh-ed25519 GWuf0Q VbKtptk2zh0R7h9LxIxRsYXqaq3uHCIZQEdOn3/QvSM
E9A0gRixWQfxmJSHeqxNv0W73jKNliQtP93CjzFXkJE
-> ssh-ed25519 kNjiNQ 2eJ3bwzlT8Jjox0TUyUKzMQqCDsIJtjHljyfQYkHi2I
KvtOT0oijhV8L07bW0dby8v4IWP/2n+XAlN4bmekihY
--- Cv64ZC71bS45sWrEpwhV4hmLPv+96QmIR/qOR+D8bo0
Í ã2f}KÃÄäÞ˰–üÙ.
4¼Z¢2ðסzY”
…1§Ž–ëSŠ�’uÛ¹vm‘&еB]  »KÑ‚?" Ð\œÈ¶ÍTq
+3
View File
@@ -37,4 +37,7 @@ in
# -- Nomad -------------------------------
"nomad.d/consul-token-client.json.age".publicKeys = samfelag-hosts;
"nomad.d/consul-token-server.json.age".publicKeys = thingvellir;
# -- Apps --------------------------------
"app.d/nextcloud-password.age".publicKeys = thingvellir;
}