organize
This commit is contained in:
34
modules/core/infra/cloudflared.nix
Normal file
34
modules/core/infra/cloudflared.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
let
|
||||
uuid = "4118935e-359b-4dd2-95bd-eb27f7b0c5bb";
|
||||
domain = "bug.tools";
|
||||
creds = "/home/bug/.cloudflared/${uuid}.json";
|
||||
in {
|
||||
den.aspects.cloudflared = {
|
||||
nixos = { config, pkgs, lib, ... }: {
|
||||
options.den.tunnels = lib.mkOption {
|
||||
default = [];
|
||||
description = "cloudflared tunnels";
|
||||
type = lib.types.listOf lib.types.str;
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.systemPackages = [ pkgs.cloudflared ];
|
||||
environment.etc."cloudflared/${uuid}.json".source = creds;
|
||||
|
||||
services.cloudflared = {
|
||||
enable = true;
|
||||
|
||||
tunnels.${uuid} = {
|
||||
credentialsFile = "/etc/cloudflared/${uuid}.json";
|
||||
default = "http_status:404";
|
||||
|
||||
ingress = lib.listToAttrs (map (subdomain: {
|
||||
name = "${subdomain}.${domain}";
|
||||
value = "http://127.0.0.1:${toString config.den.portmap.${subdomain}}";
|
||||
}) config.den.tunnels);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
42
modules/core/infra/syncthing.nix
Normal file
42
modules/core/infra/syncthing.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
den.aspects.syncthing = {
|
||||
homeManager = let
|
||||
devices = ["desktop" "laptop" "server"];
|
||||
|
||||
mkFolder = path: {
|
||||
inherit path;
|
||||
devices = devices;
|
||||
};
|
||||
in {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
|
||||
key = "/home/bug/.syncthing/key.pem";
|
||||
cert = "/home/bug/.syncthing/cert.pem";
|
||||
|
||||
settings = {
|
||||
devices = {
|
||||
desktop.id = "VEZXY3W-U6UXWTP-6BHANIG-O5EKNZY-XNV5YOX-4V4O3HB-ETECIUX-T2DK7AV";
|
||||
laptop.id = "I6NW53P-IJMMT73-7O53TXY-3GAHS2U-4EAADM7-ZNB5ZPB-62QHKVW-H7DYXQ2";
|
||||
server.id = "KJECAIP-Y2Y3FHV-NOJKIQV-LWIDMMZ-5ITEAZ4-LQCQL72-3BGW6T7-BFPFJQA";
|
||||
};
|
||||
|
||||
folders = {
|
||||
"Documents" = mkFolder "/home/bug/Documents";
|
||||
"Downloads" = mkFolder "/home/bug/Downloads";
|
||||
"Pictures" = mkFolder "/home/bug/Pictures";
|
||||
"Videos" = mkFolder "/home/bug/Videos";
|
||||
"Music" = mkFolder "/home/bug/Music";
|
||||
"nix" = mkFolder "/home/bug/nix";
|
||||
"hytale" = mkFolder "/home/bug/.local/share/Hytale/UserData/Saves";
|
||||
"ssh" = mkFolder "/home/bug/.ssh";
|
||||
"cloudflared" = mkFolder "/home/bug/.cloudflared";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user