diff --git a/flake.lock b/flake.lock index 30927ca..4d15ec5 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1771610171, - "narHash": "sha256-+DeInuhbm6a6PpHDNUS7pozDouq2+8xSDefoNaZLW0E=", + "lastModified": 1774211390, + "narHash": "sha256-sTtAgCCaX8VNNZlQFACd3i1IQ+DB0Wf3COgiFS152ds=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "7f9eb087703ec4acc6b288d02fa9ea3db803cd3d", + "rev": "f62a4dbfa4e5584f14ad4c62afedf6e4b433cf70", "type": "github" }, "original": { @@ -126,11 +126,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1771587924, - "narHash": "sha256-eVYOGmF8nQBhudJyU6lHdgJI87kvGz8JyCq5/Vi9Mjk=", + "lastModified": 1774616169, + "narHash": "sha256-fP4bU3SOH5sefSl6EagqULFs+bXoo3h3VLQCCyJplo4=", "owner": "catppuccin", "repo": "nix", - "rev": "b0c65edbf31c2ad3d84438d82c2310f2c28373f3", + "rev": "e616c61cd9f7b05b32af266bc005fa266860dacf", "type": "github" }, "original": { @@ -165,11 +165,11 @@ ] }, "locked": { - "lastModified": 1771881364, - "narHash": "sha256-A5uE/hMium5of/QGC6JwF5TGoDAfpNtW00T0s9u/PN8=", + "lastModified": 1773889306, + "narHash": "sha256-PAqwnsBSI9SVC2QugvQ3xeYCB0otOwCacB1ueQj2tgw=", "owner": "nix-community", "repo": "disko", - "rev": "a4cb7bf73f264d40560ba527f9280469f1f081c6", + "rev": "5ad85c82cc52264f4beddc934ba57f3789f28347", "type": "github" }, "original": { @@ -218,11 +218,11 @@ ] }, "locked": { - "lastModified": 1769996383, - "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", "type": "github" }, "original": { @@ -273,27 +273,27 @@ "type": "github" } }, - "flake-utils": { + "flake-parts_4": { "inputs": { - "systems": "systems" + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "hercules-ci", + "repo": "flake-parts", "type": "github" } }, - "flake-utils_2": { + "flake-utils": { "inputs": { - "systems": "systems_5" + "systems": "systems" }, "locked": { "lastModified": 1731533236, @@ -373,11 +373,11 @@ ] }, "locked": { - "lastModified": 1772060133, - "narHash": "sha256-VuyRptb8v1lVGMlLp4/1vRX3Efwec0CN0S6mKmDPzLg=", + "lastModified": 1774647770, + "narHash": "sha256-UNNi14XiqRWWjO8ykbFwA5wRwx7EscsC+GItOVpuGjc=", "owner": "nix-community", "repo": "home-manager", - "rev": "ce9b6e52500a0ea0ec48f0bbf6d7a3e431d9dfa4", + "rev": "02371c05a04a2876cf92e2d67a259e8f87399068", "type": "github" }, "original": { @@ -402,11 +402,11 @@ ] }, "locked": { - "lastModified": 1753964049, - "narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=", + "lastModified": 1772461003, + "narHash": "sha256-pVICsV7FtcEeVwg5y/LFh3XFUkVJninm/P1j/JHzEbM=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5", + "rev": "b62396457b9cfe2ebf24fe05404b09d2a40f8ed7", "type": "github" }, "original": { @@ -431,11 +431,11 @@ ] }, "locked": { - "lastModified": 1770511807, - "narHash": "sha256-suKmSbSk34uPOJDTg/GbPrKEJutzK08vj0VoTvAFBCA=", + "lastModified": 1772461523, + "narHash": "sha256-mI6A51do+hEUzeJKk9YSWfVHdI/SEEIBi2tp5Whq5mI=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "7c75487edd43a71b61adb01cae8326d277aab683", + "rev": "7d63c04b4a2dd5e59ef943b4b143f46e713df804", "type": "github" }, "original": { @@ -461,11 +461,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1772107319, - "narHash": "sha256-qdeeNrWmUe1P2FsnNU1ngoZl8UxczEMJBziwm78V42I=", + "lastModified": 1774635054, + "narHash": "sha256-NVjEJ5u0VHKTc/A17kWDfXgFnBAsP2BOMNj+fAv58mM=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "c71fbd854dfdedaae011f4b8b1fdb81f8054b309", + "rev": "5dfb1033a433789021ab9f94b9044e6f32496211", "type": "github" }, "original": { @@ -507,11 +507,11 @@ ] }, "locked": { - "lastModified": 1767023960, - "narHash": "sha256-R2HgtVS1G3KSIKAQ77aOZ+Q0HituOmPgXW9nBNkpp3Q=", + "lastModified": 1772467975, + "narHash": "sha256-kipyuDBxrZq+beYpZqWzGvFWm4QbayW9agAvi94vDXY=", "owner": "hyprwm", "repo": "hyprland-guiutils", - "rev": "c2e906261142f5dd1ee0bfc44abba23e2754c660", + "rev": "5e1c6b9025aaf4d578f3eff7c0eb1f0c197a9507", "type": "github" }, "original": { @@ -532,11 +532,11 @@ ] }, "locked": { - "lastModified": 1765214753, - "narHash": "sha256-P9zdGXOzToJJgu5sVjv7oeOGPIIwrd9hAUAP3PsmBBs=", + "lastModified": 1772460177, + "narHash": "sha256-/6G/MsPvtn7bc4Y32pserBT/Z4SUUdBd4XYJpOEKVR4=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "3f3860b869014c00e8b9e0528c7b4ddc335c21ab", + "rev": "1cb6db5fd6bb8aee419f4457402fa18293ace917", "type": "github" }, "original": { @@ -561,11 +561,11 @@ ] }, "locked": { - "lastModified": 1771866172, - "narHash": "sha256-fYFoXhQLrm1rD8vSFKQBOEX4OGCuJdLt1amKfHd5GAw=", + "lastModified": 1772459629, + "narHash": "sha256-/iwvNUYShmmnwmz/czEUh6+0eF5vCMv0xtDW0STPIuM=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "0b219224910e7642eb0ed49f0db5ec3d008e3e41", + "rev": "7615ee388de18239a4ab1400946f3d0e498a8186", "type": "github" }, "original": { @@ -613,11 +613,11 @@ ] }, "locked": { - "lastModified": 1764592794, - "narHash": "sha256-7CcO+wbTJ1L1NBQHierHzheQGPWwkIQug/w+fhTAVuU=", + "lastModified": 1772462885, + "narHash": "sha256-5pHXrQK9zasMnIo6yME6EOXmWGFMSnCITcfKshhKJ9I=", "owner": "hyprwm", "repo": "hyprtoolkit", - "rev": "5cfe0743f0e608e1462972303778d8a0859ee63e", + "rev": "9af245a69fa6b286b88ddfc340afd288e00a6998", "type": "github" }, "original": { @@ -638,11 +638,11 @@ ] }, "locked": { - "lastModified": 1771271487, - "narHash": "sha256-41gEiUS0Pyw3L/ge1l8MXn61cK14VAhgWB/JV8s/oNI=", + "lastModified": 1774211405, + "narHash": "sha256-6KNwP4ojUzv3YBlZU5BqCpTrWHcix1Jo01BISsTT0xk=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "340a792e3b3d482c4ae5f66d27a9096bdee6d76d", + "rev": "cb4e152dc72095a2af422956c6b689590572231a", "type": "github" }, "original": { @@ -663,11 +663,11 @@ ] }, "locked": { - "lastModified": 1770501770, - "narHash": "sha256-NWRM6+YxTRv+bT9yvlhhJ2iLae1B1pNH3mAL5wi2rlQ=", + "lastModified": 1772459835, + "narHash": "sha256-978jRz/y/9TKmZb/qD4lEYHCQGHpEXGqy+8X2lFZsak=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "0bd8b6cde9ec27d48aad9e5b4deefb3746909d40", + "rev": "0a692d4a645165eebd65f109146b8861e3a925e7", "type": "github" }, "original": { @@ -692,11 +692,11 @@ ] }, "locked": { - "lastModified": 1771606233, - "narHash": "sha256-F3PLUqQ/TwgR70U+UeOqJnihJZ2EuunzojYC4g5xHr0=", + "lastModified": 1773074819, + "narHash": "sha256-qRqYnXiKoJLRTcfaRukn7EifmST2IVBUMZOeZMAc5UA=", "owner": "hyprwm", "repo": "hyprwire", - "rev": "06c7f1f8c4194786c8400653c4efc49dc14c0f3a", + "rev": "f68afd0e73687598cc2774804fedad76693046f0", "type": "github" }, "original": { @@ -732,11 +732,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1771977871, - "narHash": "sha256-lhmPJpB4V67O7rpTxb637yYX4C4PyhlnCGk+hrpjiyA=", + "lastModified": 1774656308, + "narHash": "sha256-k+L2Q5DtNGkPy+JgfhpTxpngdxy+FVz269iNfCYVy5E=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "76b7e0e4f7ed155a090a551cd2ab3e7cd81eb6c3", + "rev": "114911d841b928b2b147511bec7121af310d7a23", "type": "github" }, "original": { @@ -748,11 +748,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1771977223, - "narHash": "sha256-RAPxiR+GFi+eH8Hd8zP9Pg4ZRwAwGiCN+HOt9K5LMb4=", + "lastModified": 1774652330, + "narHash": "sha256-dqlsjRaLgD87D8YaC8842bhYziuRQ2qvTDgQDKL1ttQ=", "owner": "neovim", "repo": "neovim", - "rev": "327dcb897024159bdb201caf23d8d5673d7a0567", + "rev": "f027f41e2cfba7be8c4841cb1a036827375bbd73", "type": "github" }, "original": { @@ -763,11 +763,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1771848320, - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "lastModified": 1774386573, + "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", "type": "github" }, "original": { @@ -793,13 +793,28 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1771369470, - "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", + "lastModified": 1773821835, + "narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0182a361324364ae3f436a63005877674cf45efb", + "rev": "b40629efe5d6ec48dd1efba650c797ddbd39ace0", "type": "github" }, "original": { @@ -827,11 +842,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1771848320, - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "lastModified": 1774106199, + "narHash": "sha256-US5Tda2sKmjrg2lNHQL3jRQ6p96cgfWh3J1QBliQ8Ws=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "rev": "6c9a78c09ff4d6c21d0319114873508a6ec01655", "type": "github" }, "original": { @@ -843,11 +858,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1771923393, - "narHash": "sha256-Fy0+UXELv9hOE8WjYhJt8fMDLYTU2Dqn3cX4BwoGBos=", + "lastModified": 1774273680, + "narHash": "sha256-a++tZ1RQsDb1I0NHrFwdGuRlR5TORvCEUksM459wKUA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ea7f1f06811ce7fcc81d6c6fd4213150c23edcf2", + "rev": "fdc7b8f7b30fdbedec91b71ed82f36e1637483ed", "type": "github" }, "original": { @@ -859,11 +874,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1771848320, - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "lastModified": 1774386573, + "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", "type": "github" }, "original": { @@ -875,11 +890,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1771848320, - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "lastModified": 1774386573, + "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", "type": "github" }, "original": { @@ -889,22 +904,6 @@ "type": "github" } }, - "nixpkgs_8": { - "locked": { - "lastModified": 1744536153, - "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixvim": { "inputs": { "flake-parts": "flake-parts_2", @@ -914,11 +913,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1771135771, - "narHash": "sha256-wyvBIhDuyCRyjB3yPg77qoyxrlgQtBR1rVW3c9knV3E=", + "lastModified": 1774612943, + "narHash": "sha256-hRhq5cpDyBm/ZQyuzI+/YzQEVt35d/M6ko7ADfodw9s=", "owner": "nix-community", "repo": "nixvim", - "rev": "ed0424f0b08d303a7348f52f7850ad1b2704f9ba", + "rev": "2b9f8e1d659d1c7664e1b85ab1620c219672696c", "type": "github" }, "original": { @@ -981,11 +980,11 @@ ] }, "locked": { - "lastModified": 1771858127, - "narHash": "sha256-Gtre9YoYl3n25tJH2AoSdjuwcqij5CPxL3U3xysYD08=", + "lastModified": 1774104215, + "narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "49bbbfc218bf3856dfa631cead3b052d78248b83", + "rev": "f799ae951fde0627157f40aec28dec27b22076d0", "type": "github" }, "original": { @@ -1010,19 +1009,23 @@ "powershell-es": "powershell-es", "sops-nix": "sops-nix", "stylix": "stylix", - "typsite": "typsite" + "typsite": "typsite", + "wedding": "wedding" } }, "rust-overlay": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": [ + "typsite", + "nixpkgs" + ] }, "locked": { - "lastModified": 1749004659, - "narHash": "sha256-zaZrcC5UwHPGkgfnhTPx5sZfSSnUJdvYHhgex10RadQ=", + "lastModified": 1773371126, + "narHash": "sha256-SGnZQO8hnynR90Lo/1MVrTScsOPx9i26XjqSqoFOZ4E=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "c52e346aedfa745564599558a096e88f9a5557f9", + "rev": "475826b105eb52f39bd3281f60c052299e64d085", "type": "github" }, "original": { @@ -1038,11 +1041,11 @@ ] }, "locked": { - "lastModified": 1772048434, - "narHash": "sha256-/wA0OaH6kZ/pFA+nXR/tvg5oupOmEDmMS5us79JT60o=", + "lastModified": 1774303811, + "narHash": "sha256-fhG4JAcLgjKwt+XHbjs8brpWnyKUfU4LikLm3s0Q/ic=", "owner": "Mic92", "repo": "sops-nix", - "rev": "334daa7c273dd8bf7a0cd370e4e16022b64e55e9", + "rev": "614e256310e0a4f8a9ccae3fa80c11844fba7042", "type": "github" }, "original": { @@ -1072,11 +1075,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1771787992, - "narHash": "sha256-Vg4bGwwenNYI8p3nJTl9FRyeIyrjATeZrZr+GyUSDrw=", + "lastModified": 1774124764, + "narHash": "sha256-Poz9WTjiRlqZIf197CrMMJfTifZhrZpbHFv0eU1Nhtg=", "owner": "nix-community", "repo": "stylix", - "rev": "30054cca073b49b42a71289edec858f535b27fe9", + "rev": "e31c79f571c5595a155f84b9d77ce53a84745494", "type": "github" }, "original": { @@ -1145,21 +1148,6 @@ "type": "github" } }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tinted-foot": { "flake": false, "locked": { @@ -1243,18 +1231,18 @@ }, "typsite": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-parts": "flake-parts_4", "nixpkgs": [ "nixpkgs" ], "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1757041869, - "narHash": "sha256-3gq3miYeelGbYU6rpVzHJHVrnNegrLf9ec8KBN+a2uo=", + "lastModified": 1774208499, + "narHash": "sha256-v4OC6qcmx9anP+8V6Q587YNS82SD/XvCNmHCXI6Qd/A=", "owner": "Glomzzz", "repo": "typsite", - "rev": "0e8ca8ad75dc077d680550a797babd3b29495d25", + "rev": "bb942faa0932afd822028fc587894398d4d14956", "type": "github" }, "original": { @@ -1263,6 +1251,27 @@ "type": "github" } }, + "wedding": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1774688817, + "narHash": "sha256-Jmc51QARSI/Mpp4FH2sq2UAA+rag4XMwkr4c2IB4nvc=", + "ref": "simplify-static-html", + "rev": "4a05531e4478c6376146d6f5daffe5e3734fb1cb", + "revCount": 31, + "type": "git", + "url": "ssh://git@github.com/fwastring/wedding.git" + }, + "original": { + "ref": "simplify-static-html", + "type": "git", + "url": "ssh://git@github.com/fwastring/wedding.git" + } + }, "xdph": { "inputs": { "hyprland-protocols": [ @@ -1291,11 +1300,11 @@ ] }, "locked": { - "lastModified": 1761431178, - "narHash": "sha256-xzjC1CV3+wpUQKNF+GnadnkeGUCJX+vgaWIZsnz9tzI=", + "lastModified": 1773601989, + "narHash": "sha256-2tJf/CQoHApoIudxHeJye+0Ii7scR0Yyi7pNiWk0Hn8=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "4b8801228ff958d028f588f0c2b911dbf32297f9", + "rev": "a9b862d1aa000a676d310cc62d249f7ad726233d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2bfb434..d91806c 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,8 @@ confetti.url = "git+https://git.wastring.com/fw/confetti?ref=main"; powershell-es.url = "git+https://git.wastring.com/fw/powershell-es?ref=main"; bbk.url = "git+https://git.wastring.com/fw/bbk?ref=main"; + wedding.url = "git+ssh://git@github.com/fwastring/wedding.git?ref=simplify-static-html"; + wedding.inputs.nixpkgs.follows = "nixpkgs"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/maskiner/laptop/configuration.nix b/maskiner/laptop/configuration.nix index 4ae9d12..6877f3e 100644 --- a/maskiner/laptop/configuration.nix +++ b/maskiner/laptop/configuration.nix @@ -26,6 +26,7 @@ in (modulesDirectory + /sound.nix) (modulesDirectory + /services/base) + (modulesDirectory + /services/webcam-rtsp) (modulesDirectory + /programs/hyprland) (modulesDirectory + /programs/kubernetes-tools.nix) @@ -46,6 +47,14 @@ in base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${theme}.yaml"; }; + webcam-rtsp = { + enable = true; + device = "/dev/v4l/by-id/usb-GENERAL_GENERAL_WEBCAM-video-index0"; + rtspUrl = "rtsp://192.168.1.143:8554/laptop"; + framerate = 30; + videoSize = "1280x720"; + }; + nixvim = { enable = true; theme = theme; diff --git a/maskiner/node/configuration.nix b/maskiner/node/configuration.nix index 77b63d7..09723f2 100644 --- a/maskiner/node/configuration.nix +++ b/maskiner/node/configuration.nix @@ -10,6 +10,39 @@ }: let modulesDirectory = ../../moduler; + backupScript = pkgs.writeShellScript "rclone-backups" '' + set -euo pipefail + + declare -A SOURCES=( + [vaultwarden]="/var/lib/vaultwarden/" + [tailscale]="/var/lib/tailscale/" + [kitchenowl]="/var/lib/kitchenowl/" + ) + + REMOTE_BASE="gdrive:backups" + NOW="$(date +%Y-%m-%d_%H%M)" + + for name in "''${!SOURCES[@]}"; do + SRC="''${SOURCES[$name]}" + DEST="''${REMOTE_BASE}/''${name}/''${NOW}" + + rclone copy "''${SRC}" "''${DEST}" --create-empty-src-dirs \ + --config /root/.config/rclone/rclone.conf + + mapfile -t dirs < <( + rclone lsf "''${REMOTE_BASE}/''${name}" --dirs-only --format p \ + --config /root/.config/rclone/rclone.conf | sort + ) + + if [ "''${#dirs[@]}" -gt 7 ]; then + remove_count=$(( ''${#dirs[@]} - 7 )) + for d in "''${dirs[@]:0:''${remove_count}}"; do + rclone purge "''${REMOTE_BASE}/''${name}/''${d%/}" \ + --config /root/.config/rclone/rclone.conf + done + fi + done + ''; in { # You can import other NixOS modules here @@ -36,6 +69,7 @@ in (modulesDirectory + /services/immich) (modulesDirectory + /services/paperless) (modulesDirectory + /services/filebrowser) + (modulesDirectory + /services/mediamtx) ]; sops.defaultSopsFile = ../../secrets/sops.yaml; @@ -48,8 +82,63 @@ in environment.systemPackages = with pkgs; [ git vim + rsync + rclone + fuse ]; + programs.fuse.userAllowOther = true; + + systemd.tmpfiles.rules = [ + "d /mnt/gdrive 0755 root root - -" + "d /mnt/gdrive/backups 0755 root root - -" + ]; + + systemd.services.rclone-gdrive = { + description = "Rclone mount for Google Drive"; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = '' + ${pkgs.rclone}/bin/rclone mount \ + gdrive: /mnt/gdrive \ + --config /root/.config/rclone/rclone.conf \ + --allow-other \ + --dir-cache-time 12h \ + --vfs-cache-mode writes + ''; + ExecStop = "${pkgs.fuse}/bin/fusermount -u /mnt/gdrive"; + Restart = "on-failure"; + RestartSec = "10s"; + }; + wantedBy = [ "multi-user.target" ]; + }; + + systemd.services.rsync-backups = { + description = "Rclone snapshot backups to Google Drive"; + serviceConfig = { + Type = "oneshot"; + ExecStart = backupScript; + User = "root"; + }; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + path = [ + pkgs.coreutils + pkgs.findutils + pkgs.rclone + ]; + }; + + systemd.timers.rsync-backups = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "*-*-* 00,06,12,18:00:00"; + Persistent = true; + }; + }; + home-manager.users.fw = { # imports = [ # (modulesDirectory + /programs/beets) @@ -101,6 +190,11 @@ in port = 8126; domain = "files.wastring.com"; }; + mediamtx = { + enable = true; + host = "0.0.0.0"; + rtspPort = 8554; + }; glance = { enable = false; host = "127.0.0.1"; @@ -112,6 +206,10 @@ in domain = "wish.wastring.com"; }; + wedding = { + enable = true; + }; + forgejo = { enable = false; }; diff --git a/maskiner/styrelsen/configuration.nix b/maskiner/styrelsen/configuration.nix index bf04321..a53945e 100644 --- a/maskiner/styrelsen/configuration.nix +++ b/maskiner/styrelsen/configuration.nix @@ -37,6 +37,8 @@ in enable = true; }; + services.upower.enable = true; + stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${theme}.yaml"; @@ -110,7 +112,6 @@ in "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFpJBGPIfPB1BwSG7aoKqwfccyZSaU7J3xpJ8behMp9N fw@core" ]; - boot.kernelPackages = pkgs.linuxPackages_latest; networking.hostName = myhostname; diff --git a/moduler/programs.nix b/moduler/programs.nix index 878e649..0cc8b58 100644 --- a/moduler/programs.nix +++ b/moduler/programs.nix @@ -81,6 +81,7 @@ bitwarden-cli lagrange jujutsu + rclone dbeaver-bin diff --git a/moduler/programs/nixvim/default.nix b/moduler/programs/nixvim/default.nix index 5187cad..389280d 100644 --- a/moduler/programs/nixvim/default.nix +++ b/moduler/programs/nixvim/default.nix @@ -55,6 +55,10 @@ with lib; }; clipboard.register = "unnamedplus"; + extraPlugins = with pkgs.vimPlugins; [ + plenary-nvim + ]; + globals.mapleader = " "; keymaps = [ diff --git a/moduler/programs/waybar/default.nix b/moduler/programs/waybar/default.nix index b986a7c..397ccb5 100644 --- a/moduler/programs/waybar/default.nix +++ b/moduler/programs/waybar/default.nix @@ -1,5 +1,5 @@ { - lib, + lib, config, inputs, pkgs, @@ -27,16 +27,417 @@ with lib; }; }; config = mkIf config.waybar.enable { - programs = { - waybar = { - enable = true; - systemd = { - enable = true; - }; - }; - }; - xdg.configFile."waybar/config.jsonc".source = config.waybar.configPath; - xdg.configFile."waybar/style.css".source = config.waybar.stylePath; + programs = { + waybar = { + enable = true; + systemd = { + enable = true; + }; + }; + }; + xdg.configFile."waybar/config.jsonc".source = config.waybar.configPath; + xdg.configFile."waybar/style.css".source = config.waybar.stylePath; + xdg.configFile."waybar/scripts/tailscale.sh" = { + text = '' + #!${pkgs.bash}/bin/bash + + PATH=${ + lib.makeBinPath [ + pkgs.coreutils + pkgs.jq + pkgs.tailscale + ] + } + + STATE_FILE="/tmp/waybar_tailscale_state" + CONNECTING_DURATION=2 # seconds to show transition states + + get_tailscale_status() { + local status_json + if status_json=$(tailscale status --json 2>/dev/null); then + local backend_state=$(echo "$status_json" | jq -r '.BackendState // "NoState"') + case "$backend_state" in + "Running") + echo "connected" + ;; + "Stopped"|"NoState"|"NeedsLogin") + echo "stopped" + ;; + *) + echo "stopped" + ;; + esac + else + echo "stopped" + fi + } + + get_tooltip() { + local status_json + if ! status_json=$(tailscale status --json 2>/dev/null); then + echo "" + return + fi + + local backend_state=$(echo "$status_json" | jq -r '.BackendState // "NoState"') + if [[ "$backend_state" != "Running" ]]; then + echo "" + return + fi + + local hostname=$(echo "$status_json" | jq -r '.Self.HostName // "Unknown"') + + local tooltip="Hostname: $hostname\n" + + tooltip+="\nPeers:\n" + + local peers=$(echo "$status_json" | jq -r '.Peer // {} | to_entries[] | "\(.value.HostName):\(.value.Online)"' | sort) + + if [[ -n "$peers" ]]; then + while IFS=: read -r peer_name peer_online; do + if [[ "$peer_online" == "true" ]]; then + tooltip+="\n $peer_name" + else + tooltip+="\n $peer_name" + fi + done <<< "$peers" + else + tooltip+="\nNo peers" + fi + + echo "$tooltip" + } + + show_status() { + local status=$(get_tailscale_status) + local text="" + local alt="" + local tooltip="" + + case $status in + "connected") + text="" + alt="connected" + tooltip=$(get_tooltip) + ;; + "stopped") + text="" + alt="stopped" + tooltip="Tailscale is turned off" + ;; + esac + + if [[ -n "$tooltip" ]]; then + echo "{\"text\":\"$text\",\"class\":\"$status\",\"alt\":\"$alt\",\"tooltip\":\"$tooltip\"}" + else + echo "{\"text\":\"$text\",\"class\":\"$status\",\"alt\":\"$alt\"}" + fi + } + + show_connecting() { + echo "{\"text\":\"\",\"class\":\"connecting\",\"alt\":\"connecting\",\"tooltip\":\"Connecting...\"}" + } + + show_disconnecting() { + echo "{\"text\":\"\",\"class\":\"disconnecting\",\"alt\":\"disconnecting\",\"tooltip\":\"Disconnecting...\"}" + } + + is_in_transition() { + if [[ -f "$STATE_FILE" ]]; then + local state_info=$(cat "$STATE_FILE") + local state_time=$(echo "$state_info" | cut -d: -f1) + local current_time=$(date +%s) + + if (( current_time - state_time < CONNECTING_DURATION )); then + return 0 + else + rm -f "$STATE_FILE" + return 1 + fi + fi + return 1 + } + + case "$1" in + --status) + if is_in_transition; then + state_info=$(cat "$STATE_FILE") + state_action=$(echo "$state_info" | cut -d: -f2) + + if [[ "$state_action" == "connecting" ]]; then + show_connecting + exit 0 + elif [[ "$state_action" == "disconnecting" ]]; then + show_disconnecting + exit 0 + fi + fi + + show_status + ;; + --toggle) + if is_in_transition; then + state_info=$(cat "$STATE_FILE") + state_action=$(echo "$state_info" | cut -d: -f2) + + if [[ "$state_action" == "connecting" ]]; then + show_connecting + elif [[ "$state_action" == "disconnecting" ]]; then + show_disconnecting + fi + exit 0 + fi + + current_status=$(get_tailscale_status) + if [[ "$current_status" == "connected" ]]; then + tailscale down + show_status + else + echo "$(date +%s):connecting" > "$STATE_FILE" + tailscale up + show_connecting + fi + ;; + *) + echo "Usage: $0 {--status|--toggle}" + exit 1 + ;; + esac + ''; + executable = true; + }; + xdg.configFile."waybar/scripts/netbird.sh" = { + text = '' + #!${pkgs.bash}/bin/bash + + PATH=${ + lib.makeBinPath [ + pkgs.coreutils + pkgs.netbird + ] + } + + STATE_FILE="/tmp/waybar_netbird_state" + CONNECTING_DURATION=2 # seconds to show transition states + + get_netbird_status() { + local status_output + local management_status="" + + if ! status_output=$(netbird status -d 2>/dev/null); then + echo "stopped" + return + fi + + while IFS= read -r line; do + case "$line" in + "Management:"*) + management_status="''${line#Management: }" + ;; + esac + done <<< "$status_output" + + case "$management_status" in + *Connected*) + echo "connected" + ;; + *) + echo "stopped" + ;; + esac + } + + get_tooltip() { + local status_output + local management_status="" + local signal_status="" + local relays_available=0 + local relays_total=0 + local nameservers_available=0 + local nameservers_total=0 + local netbird_ip="" + local peers_count="" + local interface_type="" + local section="" + + if ! status_output=$(netbird status -d 2>/dev/null); then + echo "" + return + fi + + while IFS= read -r line; do + case "$line" in + "Management:"*) + management_status="''${line#Management: }" + section="" + ;; + "Signal:"*) + signal_status="''${line#Signal: }" + section="" + ;; + "Relays:"*) + section="relays" + ;; + "Nameservers:"*) + section="nameservers" + ;; + "NetBird IP:"*) + netbird_ip="''${line#NetBird IP: }" + section="" + ;; + "Interface type:"*) + interface_type="''${line#Interface type: }" + section="" + ;; + "Peers count:"*) + peers_count="''${line#Peers count: }" + section="" + ;; + "Peers detail:"*) + section="" + ;; + " ["*) + if [[ "$section" == "relays" ]]; then + relays_total=$((relays_total + 1)) + if [[ "$line" == *"Available"* ]]; then + relays_available=$((relays_available + 1)) + fi + elif [[ "$section" == "nameservers" ]]; then + nameservers_total=$((nameservers_total + 1)) + if [[ "$line" == *"Available"* ]]; then + nameservers_available=$((nameservers_available + 1)) + fi + fi + ;; + esac + done <<< "$status_output" + + if [[ -z "$management_status" ]]; then + echo "" + return + fi + + local tooltip="Management: $management_status" + if [[ -n "$signal_status" ]]; then + tooltip+="\nSignal: $signal_status" + fi + if (( relays_total > 0 )); then + tooltip+="\nRelays: $relays_available/$relays_total Available" + fi + if (( nameservers_total > 0 )); then + tooltip+="\nNameservers: $nameservers_available/$nameservers_total Available" + fi + if [[ -n "$netbird_ip" ]]; then + tooltip+="\nNetBird IP: $netbird_ip" + fi + if [[ -n "$interface_type" ]]; then + tooltip+="\nInterface: $interface_type" + fi + if [[ -n "$peers_count" ]]; then + tooltip+="\nPeers: $peers_count" + fi + + echo "$tooltip" + } + + show_status() { + local status=$(get_netbird_status) + local text="" + local alt="" + local tooltip="" + + case $status in + "connected") + text="" + alt="connected" + tooltip=$(get_tooltip) + ;; + "stopped") + text="" + alt="stopped" + tooltip="NetBird is turned off" + ;; + esac + + if [[ -n "$tooltip" ]]; then + echo "{\"text\":\"$text\",\"class\":\"$status\",\"alt\":\"$alt\",\"tooltip\":\"$tooltip\"}" + else + echo "{\"text\":\"$text\",\"class\":\"$status\",\"alt\":\"$alt\"}" + fi + } + + show_connecting() { + echo "{\"text\":\"\",\"class\":\"connecting\",\"alt\":\"connecting\",\"tooltip\":\"Connecting...\"}" + } + + show_disconnecting() { + echo "{\"text\":\"\",\"class\":\"disconnecting\",\"alt\":\"disconnecting\",\"tooltip\":\"Disconnecting...\"}" + } + + is_in_transition() { + if [[ -f "$STATE_FILE" ]]; then + local state_info=$(cat "$STATE_FILE") + local state_time=$(echo "$state_info" | cut -d: -f1) + local current_time=$(date +%s) + + if (( current_time - state_time < CONNECTING_DURATION )); then + return 0 + else + rm -f "$STATE_FILE" + return 1 + fi + fi + return 1 + } + + case "$1" in + --status) + if is_in_transition; then + state_info=$(cat "$STATE_FILE") + state_action=$(echo "$state_info" | cut -d: -f2) + + if [[ "$state_action" == "connecting" ]]; then + show_connecting + exit 0 + elif [[ "$state_action" == "disconnecting" ]]; then + show_disconnecting + exit 0 + fi + fi + + show_status + ;; + --toggle) + if is_in_transition; then + state_info=$(cat "$STATE_FILE") + state_action=$(echo "$state_info" | cut -d: -f2) + + if [[ "$state_action" == "connecting" ]]; then + show_connecting + elif [[ "$state_action" == "disconnecting" ]]; then + show_disconnecting + fi + exit 0 + fi + + current_status=$(get_netbird_status) + if [[ "$current_status" == "connected" ]]; then + netbird down + show_status + else + echo "$(date +%s):connecting" > "$STATE_FILE" + netbird up + show_connecting + fi + ;; + *) + echo "Usage: $0 {--status|--toggle}" + exit 1 + ;; + esac + ''; + executable = true; + }; }; # catppuccin.waybar = { # enable = true; diff --git a/moduler/programs/waybar/waybar-laptop.jsonc b/moduler/programs/waybar/waybar-laptop.jsonc index bcea439..f47b3f9 100644 --- a/moduler/programs/waybar/waybar-laptop.jsonc +++ b/moduler/programs/waybar/waybar-laptop.jsonc @@ -13,6 +13,8 @@ "bluetooth", "pulseaudio", "upower", + "custom/tailscale", + "custom/netbird", "network", "clock" ], @@ -44,7 +46,7 @@ "on-click": "pgrep .blueman-manage && pkill .blueman-manage || blueman-manager &" }, "network": { - "interface": "wlp1s0", + "interface": "wlp0s20f3", "format": "{ifname}", "format-wifi": " {essid} ({signalStrength}%)", "format-ethernet": "{ifname} ", @@ -86,5 +88,35 @@ "tooltip": true, "tooltip-format": "{:%A, %d %B %Y}\n %H:%M:%S", "interval": 1 + }, + "custom/tailscale": { + "exec": "/home/fw/.config/waybar/scripts/tailscale.sh --status", + "on-click": "/home/fw/.config/waybar/scripts/tailscale.sh --toggle", + "exec-on-event": true, + "format": "{icon} {text}", + "format-icons": { + "connected": "", + "stopped": "", + "connecting": "", + "disconnecting": "" + }, + "tooltip": true, + "return-type": "json", + "interval": 5 + }, + "custom/netbird": { + "exec": "/home/fw/.config/waybar/scripts/netbird.sh --status", + "on-click": "/home/fw/.config/waybar/scripts/netbird.sh --toggle", + "exec-on-event": true, + "format": "{icon} {text}", + "format-icons": { + "connected": "", + "stopped": "", + "connecting": "", + "disconnecting": "" + }, + "tooltip": true, + "return-type": "json", + "interval": 5 } } diff --git a/moduler/programs/waybar/waybar-mocha.css b/moduler/programs/waybar/waybar-mocha.css index 71edc44..c54b43c 100644 --- a/moduler/programs/waybar/waybar-mocha.css +++ b/moduler/programs/waybar/waybar-mocha.css @@ -19,6 +19,22 @@ font-size: 15px; } +.connecting { + animation: pulse 0.8s ease-in-out infinite; +} + +@keyframes pulse { + 0% { + opacity: 1; + } + 50% { + opacity: 0.5; + } + 100% { + opacity: 1; + } +} + window#waybar { /* background: @base; */ background: transparent; @@ -32,7 +48,7 @@ window#waybar.termite { background: @base; } window#waybar.chromium { background: @base; border: none; } /* -------- Module “pill” look -------- */ -#workspaces, #clock, #mpris, #pulseaudio, #bluetooth, #upower, #network { +#workspaces, #clock, #mpris, #pulseaudio, #bluetooth, #upower, #network, #custom-tailscale, #custom-netbird { background: @base; border: none; border-radius: 5px; @@ -139,6 +155,22 @@ button:active { letter-spacing: 0.2px; } +/* -------- Upower -------- */ +#custom-tailscale { + background: @peach; + color: @base; + font-weight: 600; + letter-spacing: 0.2px; +} + +/* -------- Netbird -------- */ +#custom-netbird { + background: @peach; + color: @base; + font-weight: 600; + letter-spacing: 0.2px; +} + /* -------- Network -------- */ #network { background: @peach; diff --git a/moduler/programs/waybar/waybar.jsonc b/moduler/programs/waybar/waybar.jsonc index bb97f93..eca5509 100644 --- a/moduler/programs/waybar/waybar.jsonc +++ b/moduler/programs/waybar/waybar.jsonc @@ -12,6 +12,8 @@ "mpris", "pulseaudio", "bluetooth", + "custom/tailscale", + "custom/netbird", "network", "clock" ], @@ -80,5 +82,35 @@ "tooltip": true, "tooltip-format": "{:%A, %d %B %Y}\n %H:%M:%S", "interval": 1 + }, + "custom/tailscale": { + "exec": "/home/fw/.config/waybar/scripts/tailscale.sh --status", + "on-click": "/home/fw/.config/waybar/scripts/tailscale.sh --toggle", + "exec-on-event": true, + "format": "{icon} {text}", + "format-icons": { + "connected": "", + "stopped": "", + "connecting": "", + "disconnecting": "" + }, + "tooltip": true, + "return-type": "json", + "interval": 5 + }, + "custom/netbird": { + "exec": "/home/fw/.config/waybar/scripts/netbird.sh --status", + "on-click": "/home/fw/.config/waybar/scripts/netbird.sh --toggle", + "exec-on-event": true, + "format": "{icon} {text}", + "format-icons": { + "connected": "", + "stopped": "", + "connecting": "", + "disconnecting": "" + }, + "tooltip": true, + "return-type": "json", + "interval": 5 } } diff --git a/moduler/services/mediamtx/default.nix b/moduler/services/mediamtx/default.nix new file mode 100644 index 0000000..abf7d43 --- /dev/null +++ b/moduler/services/mediamtx/default.nix @@ -0,0 +1,41 @@ +{ + lib, + config, + ... +}: +with lib; +{ + options = { + mediamtx = { + enable = mkEnableOption "enables mediamtx"; + host = mkOption { + type = types.str; + default = "0.0.0.0"; + description = "The host address to bind RTSP on."; + }; + rtspPort = mkOption { + type = types.int; + default = 8554; + description = "RTSP port exposed by MediaMTX."; + }; + }; + }; + + config = mkMerge [ + (mkIf config.mediamtx.enable { + virtualisation.podman.enable = true; + + virtualisation.oci-containers = { + backend = "podman"; + containers = { + mediamtx = { + image = "bluenviron/mediamtx:latest"; + ports = [ "${config.mediamtx.host}:${toString config.mediamtx.rtspPort}:8554" ]; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ config.mediamtx.rtspPort ]; + }) + ]; +} diff --git a/moduler/services/webcam-rtsp/default.nix b/moduler/services/webcam-rtsp/default.nix new file mode 100644 index 0000000..96a5888 --- /dev/null +++ b/moduler/services/webcam-rtsp/default.nix @@ -0,0 +1,57 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; +{ + options = { + webcam-rtsp = { + enable = mkEnableOption "enables webcam RTSP publisher"; + device = mkOption { + type = types.str; + default = "/dev/v4l/by-id/usb-GENERAL_GENERAL_WEBCAM-video-index0"; + description = "V4L2 device used as input for ffmpeg."; + }; + rtspUrl = mkOption { + type = types.str; + default = "rtsp://192.168.1.143:8554/laptop"; + description = "Destination RTSP URL where ffmpeg publishes the stream."; + }; + framerate = mkOption { + type = types.int; + default = 30; + description = "Input framerate for the webcam stream."; + }; + videoSize = mkOption { + type = types.str; + default = "1280x720"; + description = "Input video size for the webcam stream."; + }; + }; + }; + + config = mkIf config.webcam-rtsp.enable { + systemd.services.webcam-rtsp-publisher = { + description = "Publish USB webcam to MediaMTX over RTSP"; + wantedBy = [ "multi-user.target" ]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + + serviceConfig = { + Type = "simple"; + Restart = "always"; + RestartSec = "2"; + ExecStart = '' + ${pkgs.ffmpeg}/bin/ffmpeg \ + -hide_banner -loglevel warning \ + -f v4l2 -framerate ${toString config.webcam-rtsp.framerate} -video_size ${config.webcam-rtsp.videoSize} \ + -i ${config.webcam-rtsp.device} \ + -vcodec libx264 -tune zerolatency -preset veryfast \ + -f rtsp ${config.webcam-rtsp.rtspUrl} + ''; + }; + }; + }; +} diff --git a/moduler/wedding.nix b/moduler/wedding.nix index dd1a3e3..8577659 100644 --- a/moduler/wedding.nix +++ b/moduler/wedding.nix @@ -1,35 +1,71 @@ { config, inputs, + lib, pkgs, ... }: let + weddingPackage = + if inputs.wedding ? packages then + inputs.wedding.packages.${pkgs.system}.default + else + pkgs.buildGoModule { + pname = "wedding"; + version = "source"; + src = inputs.wedding; + subPackages = [ "internal/cmd/app" ]; + vendorHash = "sha256-rxaikaR4UGXu2hIuR9ZbOnITBsCq5zEDAlwrhhRudoo="; + env = { + CGO_ENABLED = 0; + }; + ldflags = [ + "-s" + "-w" + ]; + postInstall = '' + mkdir -p $out/share/wedding + cp -r public $out/share/wedding/public + ''; + }; in { - sops.secrets.github_password = { }; - virtualisation.oci-containers = { - backend = "podman"; - containers = { - wedding = { - login = { - username = "fwastring"; - passwordFile = config.sops.secrets.github_password.path; - registry = "https://ghcr.io"; - }; - image = "ghcr.io/fwastring/wedding:6de68dab52d1675283b8766d401088c9c541b170"; - ports = [ "127.0.0.1:8083:8080" ]; + options.wedding = { + enable = lib.mkEnableOption "Wedding site"; + }; + + config = lib.mkIf config.wedding.enable { + sops.secrets.gotify_password = { }; + + systemd.services.wedding = { + description = "Wedding site"; + wantedBy = [ "multi-user.target" ]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + serviceConfig = { + ExecStart = "${weddingPackage}/bin/app"; + Restart = "on-failure"; + DynamicUser = true; + WorkingDirectory = "${weddingPackage}/share/wedding"; + Environment = [ + "PUBLIC_DIR=${weddingPackage}/share/wedding/public" + "GOTIFY_URL=https://message.wastring.com" + "GOTIFY_TOKEN=AxlVMOKqqoohYxC" + "HTTP_ADDR=0.0.0.0:8083" + "PORT=8083" + ]; }; }; - }; - services.nginx = { - virtualHosts."wedding.wastring.com" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:8083"; - proxyWebsockets = true; + + services.nginx = { + virtualHosts."wedding.wastring.com" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://localhost:8083"; + proxyWebsockets = true; + }; }; }; };