diff --git a/hosts/permafrost/configuration.nix b/hosts/permafrost/configuration.nix index b45711b..70d8cf6 100644 --- a/hosts/permafrost/configuration.nix +++ b/hosts/permafrost/configuration.nix @@ -5,6 +5,7 @@ nyazoom.enable = true; forgejo.enable = true; foundry.enable = true; + syncthing.enable = true; motd.enable = true; acme.enable = true; acme.useStagingServer = false; diff --git a/modules/syncthing.nix b/modules/syncthing.nix new file mode 100644 index 0000000..2c9424a --- /dev/null +++ b/modules/syncthing.nix @@ -0,0 +1,65 @@ +{ config, lib, ... }: + +with lib; +let + cfg = config.permafrost.syncthing; +in +{ + options.permafrost.syncthing = { + enable = mkEnableOption "syncthing"; + }; + + config = mkIf cfg.enable { + sops.secrets."syncthing/key" = { }; + sops.secrets."syncthing/cert" = { }; + + services.syncthing = + let dataDir = config.services.syncthing.dataDir; + in { + enable = true; + + user = "syncthing"; + group = "syncthing"; + + dataDir = "/home/syncthing"; + configDir = dataDir + "/config"; + + key = config.sops.secrets."syncthing/key".path; + cert = config.sops.secrets."syncthing/cert".path; + + overrideFolders = true; + overrideDevices = true; + + settings = { + devices = { + snowhawk.id = "3KTMCOY-BUHLO4J-BMXBLEF-CFSXCS3-4YVOBTS-GKZMKNS-STR7CTT-37S2OQ2"; + macbook.id = "O7EB4D6-AH4A53X-YM6UE7K-T3CJGIZ-MRJ6J7U-DXTEOKB-Z7LSV2M-LVUWFAO"; + s22.id = "IS2F2X5-43F7B2Q-SVSNY4J-GOHU5XP-NSJ2MJS-GDDNNTR-BGPQHHE-TE4JDAX"; + }; + + folders = { + "obsidian" = rec { + id = "obsidian"; + label = id; + path = dataDir + "/obsidian"; + devices = [ "snowhawk" "macbook" "s22" ]; + }; + "sync" = { + id = "default"; + label = "sync"; + path = dataDir + "/sync"; + devices = [ "macbook" ]; + }; + }; + + gui.theme = "dark"; + + options = { + urAccepted = -1; + localAnnounceEnabled = false; + relaysEnabled = true; + }; + }; + }; + }; +} diff --git a/secrets.yaml b/secrets.yaml index a2bfbc0..444d1eb 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phIlSGu627cxa7uBPdeji6usY3ZPlFI8TP4Wcpp+Xiw8on08v1pY6EVjaup5JFT/R3YksmIUUGvLYIlQnYEaDk8/tS4OIsbOKYx0CO8ePWcWrxGpeoSBFMZEcuV5HWfwm+Ls6UvoioRjLsbkJgHJxq3ayQ9JYwV2LfiPynWDV9Ed540kOH5IyIl7MPIBwpefn9V6dTEy2rvd3HPUJMto3lVH8grp5bQeKbOyXtFSiDvmIFMEM83A38EML2/y0jKJCxkUUrLK8m1lCBo/rqjkF9k7RJgd7MzCH1nzmk1BfDqZfV96Yc7wUnZiGKD6ak2PdUiYGe3pzfM7nJfuQsLRElqXZteYjaLGy4k0LQPaU2HVHqYaZoaUviIbT3VCV8axWeIm8hS6dEg7vkR9Akk84yKO7COxMkOVU0o/R43bdRGzefTLP1pI9+179eyTfEAP85sr2EqoyIaUh/FJDY/wJSZs0lqHTSWzSbyQTTgFLgDUdFZ5ECSG6773izK+VGzm5MAEskuKaTl0OzGEWxWvhkyUTb6bzI=,iv:VW2SO678c9voKoOtUQqqXaGQzPnSNN8vuta2g5zxNJ0=,tag:+BSLJOQSCvl/MxAd50rOKQ==,type:str] passwords: ravenshade: ENC[AES256_GCM,data:zWSMfn1NhvjJ41w8gh8rWHAGhhfx/m19CDT+V8opc/ToDqSC83ajHJ7g9wo5UFuTfVqd3hhw0+CLAINp/QFf10790UPZmiTqrQ==,iv:WYfg7XG1J68IxAaG5HA/9hXaAo3DPdArozUm0WQNtR0=,tag:jfgcLT1/cDxW5AgIbksIgA==,type:str] cloudflare: @@ -27,8 +30,8 @@ sops: dUk3UkE4dEFTTlNqTmNMbkh2M0ZWSTgKBKhzo5inQL8LXWyiD7ZqjfXZpZFPWgM8 b4urS/bu1qvX12Nu4IYls/xLV6Tca5DJ5+cXfYMec4TcydlUVcxJLw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-12-28T05:40:19Z" - mac: ENC[AES256_GCM,data:yNooB5pD8mCD8BVOC7kojOyp64lHZoxJNxSFZjZvh1xCw5wCG95JuzCjHqdJKa0a84C6HfsLshGAQ3fM30DiZfwA9vKar+hPh/p7FksHgTrV0bi04pSImpBycOveztkQyLya39kI7kgKDbCG2wDJ72mYB89+oCQe+nC8cKKt88I=,iv:fpwobK48VBXPhax1IQ2z2/7oACTX3eGEEZmAp3T1pIc=,tag:BvDzVcgvKSmf0tfHiCgeXA==,type:str] + lastmodified: "2024-12-28T14:13:27Z" + mac: ENC[AES256_GCM,data:gzyCqbreJ6AM1AWiRoKJEejF3YYbQbwv7TBruC/95cR00vx+xKhyxaW8RoX9Xy+TPtGn0f2as3Vt2+/ezHfyqMxlf1HQqqNFCTjZ3BufwhqPJOXUD/QR921qseviORsR5LbK09fhxRvrWId3gNYuTTOwlTooKVo8U6T9b3kYQLE=,iv:gmQSWWEl6ZkAkAh9m2V9syZpN/TtnwXG7N/tsSQzEb4=,tag:lpIhDSYGZQVuHEQ9F8WM0w==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.9.2