Compare commits
5 commits
radicale-s
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 55a68c21da | |||
| 5e6167ece8 | |||
| d6ef606632 | |||
| 39f73ef2f2 | |||
| 01015c19b9 |
9 changed files with 70 additions and 77 deletions
37
flake.lock
generated
37
flake.lock
generated
|
|
@ -98,22 +98,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1758690382,
|
|
||||||
"narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"phps": {
|
"phps": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
|
|
@ -140,8 +124,7 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"phps": "phps",
|
"phps": "phps"
|
||||||
"winboat": "winboat"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
|
@ -191,24 +174,6 @@
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"winboat": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1760183562,
|
|
||||||
"narHash": "sha256-lauscAI61WXjLTuGiRDMUAEeTqvOTSWhRoHDaor5sfE=",
|
|
||||||
"owner": "TibixDev",
|
|
||||||
"repo": "winboat",
|
|
||||||
"rev": "ae60de6c2cba7a2001fef1027d5c2e06614e6904",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "TibixDev",
|
|
||||||
"repo": "winboat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
url = "github:ryantm/agenix";
|
url = "github:ryantm/agenix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
winboat.url = "github:TibixDev/winboat";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs: {
|
outputs = inputs: {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
./forgejo.nix
|
./forgejo.nix
|
||||||
./links.nix
|
./links.nix
|
||||||
|
./radicale.nix
|
||||||
./vaultwarden.nix
|
./vaultwarden.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -35,6 +36,11 @@
|
||||||
|
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = pkgs.caddy.withPlugins {
|
||||||
|
plugins =
|
||||||
|
[ "github.com/abiosoft/caddy-exec@v0.0.0-20240914124740-521d8736cb4d" ];
|
||||||
|
hash = "sha256-ef6/x7wjKk0axjX6MfAzTTwPM2FTOTSSyI9zLLrczV0=";
|
||||||
|
};
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"astral.leaf.ninja".extraConfig = ''
|
"astral.leaf.ninja".extraConfig = ''
|
||||||
respond "astral is online"
|
respond "astral is online"
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,21 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
domain = "nettika.leaf.ninja";
|
domain = "nettika.leaf.ninja";
|
||||||
root = "/srv/links";
|
root = "/srv/links";
|
||||||
webhookHandler = pkgs.writeScript "webhook-handler.py" ''
|
|
||||||
#!${pkgs.python3}/bin/python3
|
|
||||||
|
|
||||||
import http.server
|
|
||||||
import socketserver
|
|
||||||
import subprocess
|
|
||||||
import os
|
|
||||||
|
|
||||||
class WebhookHandler(http.server.SimpleHTTPRequestHandler):
|
|
||||||
def do_POST(self):
|
|
||||||
os.chdir('${root}')
|
|
||||||
subprocess.run(['${pkgs.git}/bin/git', 'pull'], check=True)
|
|
||||||
self.send_response(200)
|
|
||||||
self.end_headers()
|
|
||||||
self.wfile.write(b'OK')
|
|
||||||
|
|
||||||
with socketserver.TCPServer(("127.0.0.1", 8081), WebhookHandler) as httpd:
|
|
||||||
httpd.serve_forever()
|
|
||||||
'';
|
|
||||||
in {
|
in {
|
||||||
systemd.services.links-webhook = {
|
services.caddy.virtualHosts = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
${domain}.extraConfig = ''
|
||||||
after = [ "network.target" ];
|
root * ${root}
|
||||||
serviceConfig = {
|
file_server
|
||||||
Type = "simple";
|
'';
|
||||||
ExecStart = "${pkgs.python3}/bin/python3 ${webhookHandler}";
|
"http://localhost:8081".extraConfig = let git = lib.getExe pkgs.git;
|
||||||
Restart = "always";
|
in ''
|
||||||
};
|
route {
|
||||||
|
exec {
|
||||||
|
command ${git} pull --rebase
|
||||||
|
directory ${root}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
|
||||||
root * ${root}
|
|
||||||
file_server
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
hosts/astral/radicale.nix
Normal file
25
hosts/astral/radicale.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, ... }:
|
||||||
|
let domain = "radicale.leaf.ninja";
|
||||||
|
in {
|
||||||
|
age.secrets.radicale-htpasswd = {
|
||||||
|
file = ./secrets/radicale-htpasswd;
|
||||||
|
mode = "400";
|
||||||
|
owner = "radicale";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.radicale = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server.hosts = [ "localhost:5232" ];
|
||||||
|
auth = {
|
||||||
|
type = "htpasswd";
|
||||||
|
htpasswd_filename = config.age.secrets.radicale-htpasswd.path;
|
||||||
|
htpasswd_encryption = "plain";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
||||||
|
reverse_proxy localhost:5232
|
||||||
|
'';
|
||||||
|
}
|
||||||
9
hosts/astral/secrets/radicale-htpasswd
Normal file
9
hosts/astral/secrets/radicale-htpasswd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 f+PJrQ pKqLrqz0R7kAzNQZ3ChRsoWa63JEN2H2KHtGguF5nSc
|
||||||
|
6Mk1qDWKx26jPdEzaVMh0vgUeVWjAGcmIPpvSU8BFNE
|
||||||
|
-> ssh-ed25519 nz/vnw 0PuVNQ97Qa6iCk4pPf34lgS1aPb4CeDB4Qclk5F24T4
|
||||||
|
OwJOYMTlTY9+Pj/BwG09z4q2/QViii710Kh3xPU5FRA
|
||||||
|
--- mSdutlC3gFq8lDjeOGqi361i+DUI1Yg6Bpl7hCfznJA
|
||||||
|
“ÜtQÆ/í rNeKeíé¸Ñ¥Äè~ˆý¾×Ÿ{_¡o
|
||||||
|
y_Ü}‹¸Ã»P*W5<57>»´õFû.ECø¡‘Z©å#;
|
||||||
|
£¢ð§Ûli…Ô§±*´Î]yT
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ self, nixpkgs, phps, agenix, winboat }:
|
{ self, nixpkgs, phps, agenix }:
|
||||||
let
|
let
|
||||||
baseSpecialArgs = {
|
baseSpecialArgs = {
|
||||||
inherit (self) nixosModules;
|
inherit (self) nixosModules;
|
||||||
|
|
@ -11,7 +11,7 @@ in {
|
||||||
marauder = nixosSystem {
|
marauder = nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [ ./marauder ];
|
modules = [ ./marauder ];
|
||||||
specialArgs = { inherit phps winboat; };
|
specialArgs = { inherit phps; };
|
||||||
};
|
};
|
||||||
astral = nixosSystem {
|
astral = nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, nixosModules, phps, agenix, winboat, ... }:
|
{ pkgs, nixosModules, phps, agenix, ... }:
|
||||||
let
|
let
|
||||||
fortune = pkgs.writeShellScript "cgi" ''
|
fortune = pkgs.writeShellScript "cgi" ''
|
||||||
echo "Content-type: text/html"
|
echo "Content-type: text/html"
|
||||||
|
|
@ -76,6 +76,7 @@ in {
|
||||||
};
|
};
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
kernelParams = [ "amd_pstate=active" ];
|
kernelParams = [ "amd_pstate=active" ];
|
||||||
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
|
|
@ -102,7 +103,7 @@ in {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Chat clients
|
# Chat clients
|
||||||
discord
|
discord
|
||||||
element-desktop
|
cinny-desktop
|
||||||
signal-desktop
|
signal-desktop
|
||||||
slack
|
slack
|
||||||
telegram-desktop
|
telegram-desktop
|
||||||
|
|
@ -119,6 +120,7 @@ in {
|
||||||
krita
|
krita
|
||||||
openscad-unstable
|
openscad-unstable
|
||||||
orca-slicer
|
orca-slicer
|
||||||
|
plasticity
|
||||||
|
|
||||||
# Multimedia
|
# Multimedia
|
||||||
ffcheck
|
ffcheck
|
||||||
|
|
@ -132,6 +134,8 @@ in {
|
||||||
|
|
||||||
# Dev Tools
|
# Dev Tools
|
||||||
fossil
|
fossil
|
||||||
|
just
|
||||||
|
kondo
|
||||||
nixd
|
nixd
|
||||||
nixfmt-classic
|
nixfmt-classic
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
|
|
@ -149,7 +153,6 @@ in {
|
||||||
dig
|
dig
|
||||||
htop
|
htop
|
||||||
jq
|
jq
|
||||||
just
|
|
||||||
unzip
|
unzip
|
||||||
zip
|
zip
|
||||||
|
|
||||||
|
|
@ -157,14 +160,17 @@ in {
|
||||||
mullvad-vpn
|
mullvad-vpn
|
||||||
qbittorrent
|
qbittorrent
|
||||||
|
|
||||||
|
# Utility Apps
|
||||||
|
baobab
|
||||||
|
gparted
|
||||||
|
system-config-printer
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
gcc
|
gcc
|
||||||
intiface-central
|
intiface-central
|
||||||
openssl
|
openssl
|
||||||
pkg-config
|
pkg-config
|
||||||
prismlauncher
|
prismlauncher
|
||||||
system-config-printer
|
|
||||||
winboat.packages.x86_64-linux.winboat
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,5 @@ in {
|
||||||
"hosts/astral/secrets/vaultwarden-env.age".publicKeys = [ marauder astral ];
|
"hosts/astral/secrets/vaultwarden-env.age".publicKeys = [ marauder astral ];
|
||||||
"hosts/astral/secrets/forgejo-mailer-password.age".publicKeys =
|
"hosts/astral/secrets/forgejo-mailer-password.age".publicKeys =
|
||||||
[ marauder astral ];
|
[ marauder astral ];
|
||||||
|
"hosts/astral/secrets/radicale-htpasswd".publicKeys = [ marauder astral ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue