mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
Compare commits
4 Commits
f7fe1fe8a8
...
e3f4c34ac3
| Author | SHA1 | Date | |
|---|---|---|---|
| e3f4c34ac3 | |||
| 3a9bfab5fd | |||
| fc238008c8 | |||
| f1a6b1f4f6 |
@@ -37,7 +37,7 @@ in {
|
||||
};
|
||||
scripts = [
|
||||
pkgs.mpvScripts.quality-menu
|
||||
niveumPackages.mpv-visualizer
|
||||
pkgs.mpvScripts.visualizer
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
301
flake.lock
generated
301
flake.lock
generated
@@ -53,43 +53,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"almanac": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1640984494,
|
||||
"narHash": "sha256-xxbrGJtRK6wzOR09vGPqoUvnY5f0h6hn6Uecy331Zhw=",
|
||||
"owner": "lfborjas",
|
||||
"repo": "almanac",
|
||||
"rev": "72931bd9accefccd2df59d9d64a6cbb91f2d5f17",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lfborjas",
|
||||
"repo": "almanac",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"astro-calendar": {
|
||||
"inputs": {
|
||||
"almanac": "almanac",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"swiss-ephemeris": "swiss-ephemeris",
|
||||
"swisseph": "swisseph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1759827606,
|
||||
"narHash": "sha256-JunaXkzalZtQYjGxJrMGYDEgOwullKLnpAFj/SaJaKI=",
|
||||
"owner": "kmein",
|
||||
"repo": "astro-calendar",
|
||||
"rev": "f1579f087ee49e4c6a3bcf130b20738123f8616a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "kmein",
|
||||
"repo": "astro-calendar",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"autorenkalender": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -345,7 +308,7 @@
|
||||
},
|
||||
"fenix": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_6",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"rust-analyzer-src": "rust-analyzer-src"
|
||||
},
|
||||
"locked": {
|
||||
@@ -504,36 +467,20 @@
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
"id": "flake-utils",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"flake-utils_4": {
|
||||
"inputs": {
|
||||
"systems": "systems_4"
|
||||
"systems": "systems_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701680307,
|
||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_5": {
|
||||
"locked": {
|
||||
"lastModified": 1676283394,
|
||||
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -664,25 +611,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ical-ephemeris": {
|
||||
"inputs": {
|
||||
"astro-calendar": "astro-calendar",
|
||||
"nixpkgs": "nixpkgs_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1761309163,
|
||||
"narHash": "sha256-x5BdTIoG/ANMhJJw+IMWLbdXJ7vTh3dou8zN4LCnTeU=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "949682c2ec4da9a23c414a8ca8c039652cbbef0c",
|
||||
"revCount": 22,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@code.kmein.de:22022/kfm/ical-ephemeris"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@code.kmein.de:22022/kfm/ical-ephemeris"
|
||||
}
|
||||
},
|
||||
"kellia-dictionary": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -750,15 +678,14 @@
|
||||
"menstruation-backend_2": {
|
||||
"inputs": {
|
||||
"fenix": "fenix",
|
||||
"flake-utils": "flake-utils_4",
|
||||
"nixpkgs": "nixpkgs_7"
|
||||
"nixpkgs": "nixpkgs_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1759437689,
|
||||
"narHash": "sha256-L3gLXmW+9oE+5YosaOSIDtNlXmXxnY8RXDNj2J8uIRs=",
|
||||
"lastModified": 1765657254,
|
||||
"narHash": "sha256-9kZdra5Bx3sfkcZW0eRULsWwloigv7+xQfr+JL0kX6s=",
|
||||
"owner": "kmein",
|
||||
"repo": "menstruation.rs",
|
||||
"rev": "7ae9a7affffd20eafe0158b9b7ca50cc8a77f2af",
|
||||
"rev": "cc7278fc187f1d4b1f802fbde926a6195a7a0d47",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -801,9 +728,6 @@
|
||||
},
|
||||
"menstruation-telegram_2": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"menstruation-backend": [
|
||||
"menstruation-backend"
|
||||
],
|
||||
@@ -812,11 +736,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1677075205,
|
||||
"narHash": "sha256-2+xuAhsS3y2qB0ObVPCHXrmnTsIZ8uI5HFI4+Ash8PY=",
|
||||
"lastModified": 1765657432,
|
||||
"narHash": "sha256-gzoBH783lFsQocSwjp2d6v778sWcLnKXIQPnkVTx+qU=",
|
||||
"owner": "kmein",
|
||||
"repo": "menstruation-telegram",
|
||||
"rev": "f7ddb6d9610aacb50ec66a3ce1bdc49fe4664a49",
|
||||
"rev": "63ff6b28e0609f470b63813b37320188fff7e95d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1010,7 +934,7 @@
|
||||
},
|
||||
"nixinate_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_8"
|
||||
"nixpkgs": "nixpkgs_6"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1742737607,
|
||||
@@ -1139,38 +1063,6 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_10": {
|
||||
"locked": {
|
||||
"lastModified": 1765186076,
|
||||
"narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_11": {
|
||||
"locked": {
|
||||
"lastModified": 1760878510,
|
||||
"narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5e2a59a5b1a82f89f2c7e598302a9cacebb72a67",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_12": {
|
||||
"locked": {
|
||||
"lastModified": 1659446231,
|
||||
"narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=",
|
||||
@@ -1186,7 +1078,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_13": {
|
||||
"nixpkgs_11": {
|
||||
"locked": {
|
||||
"lastModified": 1615532953,
|
||||
"narHash": "sha256-SWpaGjrp/INzorEqMz3HLi6Uuk9I0KAn4YS8B4n3q5g=",
|
||||
@@ -1230,11 +1122,11 @@
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1758035966,
|
||||
"narHash": "sha256-qqIJ3yxPiB0ZQTT9//nFGQYn8X/PBoJbofA7hRKZnmE=",
|
||||
"lastModified": 1701436327,
|
||||
"narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8d4ddb19d03c65a36ad8d189d001dc32ffb0306b",
|
||||
"rev": "91050ea1e57e50388fa87a3302ba12d188ef723a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1246,11 +1138,11 @@
|
||||
},
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1759381078,
|
||||
"narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=",
|
||||
"lastModified": 1701436327,
|
||||
"narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee",
|
||||
"rev": "91050ea1e57e50388fa87a3302ba12d188ef723a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1261,38 +1153,6 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_6": {
|
||||
"locked": {
|
||||
"lastModified": 1701436327,
|
||||
"narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "91050ea1e57e50388fa87a3302ba12d188ef723a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_7": {
|
||||
"locked": {
|
||||
"lastModified": 1701436327,
|
||||
"narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "91050ea1e57e50388fa87a3302ba12d188ef723a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_8": {
|
||||
"locked": {
|
||||
"lastModified": 1653060744,
|
||||
"narHash": "sha256-kfRusllRumpt33J1hPV+CeCCylCXEU7e0gn2/cIM7cY=",
|
||||
@@ -1308,7 +1168,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_9": {
|
||||
"nixpkgs_7": {
|
||||
"locked": {
|
||||
"lastModified": 1764983851,
|
||||
"narHash": "sha256-y7RPKl/jJ/KAP/VKLMghMgXTlvNIJMHKskl8/Uuar7o=",
|
||||
@@ -1324,6 +1184,38 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_8": {
|
||||
"locked": {
|
||||
"lastModified": 1765186076,
|
||||
"narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_9": {
|
||||
"locked": {
|
||||
"lastModified": 1760878510,
|
||||
"narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5e2a59a5b1a82f89f2c7e598302a9cacebb72a67",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nmd": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -1438,7 +1330,7 @@
|
||||
"nur_2": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs_10"
|
||||
"nixpkgs": "nixpkgs_8"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765367248,
|
||||
@@ -1510,19 +1402,16 @@
|
||||
"recht_2": {
|
||||
"inputs": {
|
||||
"blessings": "blessings_2",
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1736882697,
|
||||
"narHash": "sha256-G++JyQ6GJlQ8T/R18xb02HhSE1NWfpAboUEBleaadd8=",
|
||||
"lastModified": 1765658439,
|
||||
"narHash": "sha256-7u21xVZBEYhgEd4UX+nG86oDblxCJtG/eYT1g2S45nc=",
|
||||
"owner": "kmein",
|
||||
"repo": "recht",
|
||||
"rev": "dd49a91b1e611920889680aa2c9101166b0ce83e",
|
||||
"rev": "dbdd8fd69d6b82bce1132ceb8dd2f5715887e6ee",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1568,12 +1457,11 @@
|
||||
"coptic-dictionary": "coptic-dictionary",
|
||||
"flake-utils": "flake-utils_3",
|
||||
"home-manager": "home-manager_2",
|
||||
"ical-ephemeris": "ical-ephemeris",
|
||||
"menstruation-backend": "menstruation-backend_2",
|
||||
"menstruation-telegram": "menstruation-telegram_2",
|
||||
"nix-on-droid": "nix-on-droid_2",
|
||||
"nixinate": "nixinate_2",
|
||||
"nixpkgs": "nixpkgs_9",
|
||||
"nixpkgs": "nixpkgs_7",
|
||||
"nixpkgs-old": "nixpkgs-old_2",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable_2",
|
||||
"nur": "nur_2",
|
||||
@@ -1688,9 +1576,6 @@
|
||||
},
|
||||
"scripts_2": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
@@ -1699,11 +1584,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1763370753,
|
||||
"narHash": "sha256-sjYc9aP52GrVCPWxf+B0o0lqDGVGfpXqX9MI9eKyCZI=",
|
||||
"lastModified": 1765657698,
|
||||
"narHash": "sha256-Ic5lcBZQKw9kOU6BUl3w+r1zCj9hveHyaHsOAYB7Yhg=",
|
||||
"owner": "kmein",
|
||||
"repo": "scripts",
|
||||
"rev": "e71d09ba89bb1e210a7e103aaa3fe619dbc801e7",
|
||||
"rev": "aeea5b4cdaf39169ab469a7c31269c8360b9c403",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1716,7 +1601,7 @@
|
||||
"inputs": {
|
||||
"buildbot-nix": "buildbot-nix",
|
||||
"nix-writers": "nix-writers",
|
||||
"nixpkgs": "nixpkgs_11"
|
||||
"nixpkgs": "nixpkgs_9"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1763891069,
|
||||
@@ -1775,7 +1660,7 @@
|
||||
"nixpkgs"
|
||||
],
|
||||
"nur": "nur_3",
|
||||
"systems": "systems_5",
|
||||
"systems": "systems_4",
|
||||
"tinted-foot": "tinted-foot",
|
||||
"tinted-kitty": "tinted-kitty",
|
||||
"tinted-schemes": "tinted-schemes",
|
||||
@@ -1797,38 +1682,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"swiss-ephemeris": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1638583659,
|
||||
"narHash": "sha256-EEgKk5DDkmICteFzFzXdvdGke7aPoJa6aQ228nAYieQ=",
|
||||
"owner": "lfborjas",
|
||||
"repo": "swiss-ephemeris",
|
||||
"rev": "3094368f5f963e8756e89e3b3dd24b96796b8682",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lfborjas",
|
||||
"repo": "swiss-ephemeris",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"swisseph": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1757697308,
|
||||
"narHash": "sha256-m2Qgzhsgrv0KyJin8UfNFJ8KL/HFfoN8AmCTlcirHXE=",
|
||||
"owner": "aloistr",
|
||||
"repo": "swisseph",
|
||||
"rev": "3084917b5d2384af6fb928583552e0a299fb6d83",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "aloistr",
|
||||
"repo": "swisseph",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
@@ -1925,15 +1778,14 @@
|
||||
},
|
||||
"telebots_2": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_5",
|
||||
"nixpkgs": "nixpkgs_12"
|
||||
"nixpkgs": "nixpkgs_10"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1703313352,
|
||||
"narHash": "sha256-EV1hfkxEn6L+z6A9rcyfkmBGzu0VwA2rF1iA32nfXW8=",
|
||||
"lastModified": 1765657917,
|
||||
"narHash": "sha256-buujY0TRj+Skg1Uo8ut7kUKHDfOtsvxt/LEOiO+ehvA=",
|
||||
"owner": "kmein",
|
||||
"repo": "telebots",
|
||||
"rev": "534221956e6d9dc5528d94247dd35e9f597de169",
|
||||
"rev": "1232c6f82e7cdf80b6b76a992544db42a293f7b2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1976,9 +1828,6 @@
|
||||
},
|
||||
"tinc-graph_2": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
@@ -1987,11 +1836,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1748887042,
|
||||
"narHash": "sha256-WWQxnmKyQm/iccHxDdobdGOPfcVNf+PQwy9HQ2b9W8g=",
|
||||
"lastModified": 1765658153,
|
||||
"narHash": "sha256-cNTBy57MGlRBY9211prc/wau+CbwoJo0mydgGva1/LQ=",
|
||||
"owner": "kmein",
|
||||
"repo": "tinc-graph",
|
||||
"rev": "8847b2d0e69065bf4bbb9885fbd465f3b1b2369a",
|
||||
"rev": "119c9486460f90c45d4a157ea9b9f1cd2901d176",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -2161,10 +2010,8 @@
|
||||
},
|
||||
"wallpaper-generator_2": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": "nixpkgs_13"
|
||||
"flake-utils": "flake-utils_4",
|
||||
"nixpkgs": "nixpkgs_11"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1615819231,
|
||||
|
||||
227
flake.nix
227
flake.nix
@@ -5,10 +5,8 @@
|
||||
self.submodules = true;
|
||||
|
||||
agenix.url = "github:ryantm/agenix";
|
||||
# alew-web.url = "git+ssh://gitea@code.kmein.de:22022/kfm/alew-web.git?ref=refs/heads/master";
|
||||
autorenkalender.url = "github:kmein/autorenkalender";
|
||||
coptic-dictionary.url = "github:kmein/coptic-dictionary";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
home-manager.url = "github:nix-community/home-manager/release-25.11";
|
||||
menstruation-backend.url = "github:kmein/menstruation.rs";
|
||||
menstruation-telegram.url = "github:kmein/menstruation-telegram";
|
||||
@@ -29,7 +27,6 @@
|
||||
voidrice.url = "github:Lukesmithxyz/voidrice";
|
||||
wallpaper-generator.url = "github:pinpox/wallpaper-generator/v1.1";
|
||||
wallpapers.url = "github:kmein/wallpapers";
|
||||
ical-ephemeris.url = "git+ssh://gitea@code.kmein.de:22022/kfm/ical-ephemeris";
|
||||
|
||||
autorenkalender.inputs.nixpkgs.follows = "nixpkgs";
|
||||
agenix.inputs.home-manager.follows = "home-manager";
|
||||
@@ -39,108 +36,122 @@
|
||||
# menstruation-backend.inputs.flake-utils.follows = "flake-utils";
|
||||
# menstruation-backend.inputs.nixpkgs.follows = "nixpkgs";
|
||||
# menstruation-backend.inputs.rust-overlay.follows = "rust-overlay";
|
||||
menstruation-telegram.inputs.flake-utils.follows = "flake-utils";
|
||||
menstruation-telegram.inputs.menstruation-backend.follows = "menstruation-backend";
|
||||
menstruation-telegram.inputs.nixpkgs.follows = "nixpkgs-old";
|
||||
nix-on-droid.inputs.home-manager.follows = "home-manager";
|
||||
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
|
||||
recht.inputs.flake-utils.follows = "flake-utils";
|
||||
recht.inputs.nixpkgs.follows = "nixpkgs";
|
||||
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||
scripts.inputs.flake-utils.follows = "flake-utils";
|
||||
scripts.inputs.nixpkgs.follows = "nixpkgs";
|
||||
scripts.inputs.rust-overlay.follows = "rust-overlay";
|
||||
stylix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
tinc-graph.inputs.flake-utils.follows = "flake-utils";
|
||||
tinc-graph.inputs.nixpkgs.follows = "nixpkgs";
|
||||
tinc-graph.inputs.rust-overlay.follows = "rust-overlay";
|
||||
voidrice.flake = false;
|
||||
wallpaper-generator.inputs.flake-utils.follows = "flake-utils";
|
||||
wallpapers.flake = false;
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-substituters = [ "https://kmein.cachix.org" ];
|
||||
extra-trusted-public-keys = [ "kmein.cachix.org-1:rsJ2b6++VQHJ1W6rGuDUYsK/qUkFA3bNpO6PyEyJ9Ls=" ];
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
nur,
|
||||
home-manager,
|
||||
agenix,
|
||||
retiolum,
|
||||
nixinate,
|
||||
flake-utils,
|
||||
nix-on-droid,
|
||||
stylix,
|
||||
...
|
||||
}:
|
||||
outputs =
|
||||
inputs@{
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
nur,
|
||||
home-manager,
|
||||
agenix,
|
||||
retiolum,
|
||||
nixinate,
|
||||
flake-utils,
|
||||
nix-on-droid,
|
||||
stylix,
|
||||
...
|
||||
}:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
eachSupportedSystem = lib.genAttrs lib.systems.flakeExposed;
|
||||
in
|
||||
{
|
||||
apps = {
|
||||
x86_64-darwin = let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-darwin;
|
||||
in {
|
||||
deploy-maakaron = {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeDash "deploy-maakaron" ''
|
||||
exec $(nix build .#homeConfigurations.maakaron.activationPackage --no-link --print-out-paths)/activate
|
||||
'');
|
||||
x86_64-darwin =
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-darwin;
|
||||
in
|
||||
{
|
||||
deploy-maakaron = {
|
||||
type = "app";
|
||||
program = toString (
|
||||
pkgs.writers.writeDash "deploy-maakaron" ''
|
||||
exec $(nix build .#homeConfigurations.maakaron.activationPackage --no-link --print-out-paths)/activate
|
||||
''
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
x86_64-linux = let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
lib = nixpkgs.lib;
|
||||
in
|
||||
x86_64-linux =
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
lib = nixpkgs.lib;
|
||||
in
|
||||
nixinate.nixinate.x86_64-linux self
|
||||
// {
|
||||
mock-secrets = {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeDash "mock-secrets" ''
|
||||
${pkgs.findutils}/bin/find secrets -not -path '*/.*' -type f | ${pkgs.coreutils}/bin/sort > secrets.txt
|
||||
'');
|
||||
program = toString (
|
||||
pkgs.writers.writeDash "mock-secrets" ''
|
||||
${pkgs.findutils}/bin/find secrets -not -path '*/.*' -type f | ${pkgs.coreutils}/bin/sort > secrets.txt
|
||||
''
|
||||
);
|
||||
};
|
||||
}
|
||||
# the following error prevents remote building of ful: https://github.com/NixOS/nixpkgs/issues/177873
|
||||
// builtins.listToAttrs (map (hostname: let
|
||||
externalNetwork = import ./lib/external-network.nix;
|
||||
targets = {
|
||||
ful = "root@ful";
|
||||
zaatar = "root@zaatar";
|
||||
makanek = "root@makanek";
|
||||
manakish = "root@manakish";
|
||||
tahina = "root@tahina";
|
||||
tabula = "root@tabula";
|
||||
kabsa = "root@kabsa";
|
||||
fatteh = "root@fatteh";
|
||||
kibbeh = "root@kibbeh";
|
||||
};
|
||||
in
|
||||
lib.attrsets.nameValuePair "deploy-${hostname}" {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeDash "deploy-${hostname}" ''
|
||||
exec ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch \
|
||||
--max-jobs 2 \
|
||||
--log-format internal-json \
|
||||
--flake .#${hostname} \
|
||||
--target-host ${targets.${hostname}} 2>&1 \
|
||||
| ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
'');
|
||||
}) (builtins.attrNames self.nixosConfigurations))
|
||||
// builtins.listToAttrs (
|
||||
map (
|
||||
hostname:
|
||||
let
|
||||
externalNetwork = import ./lib/external-network.nix;
|
||||
targets = {
|
||||
ful = "root@ful";
|
||||
zaatar = "root@zaatar";
|
||||
makanek = "root@makanek";
|
||||
manakish = "root@manakish";
|
||||
tahina = "root@tahina";
|
||||
tabula = "root@tabula";
|
||||
kabsa = "root@kabsa";
|
||||
fatteh = "root@fatteh";
|
||||
kibbeh = "root@kibbeh";
|
||||
};
|
||||
in
|
||||
lib.attrsets.nameValuePair "deploy-${hostname}" {
|
||||
type = "app";
|
||||
program = toString (
|
||||
pkgs.writers.writeDash "deploy-${hostname}" ''
|
||||
exec ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch \
|
||||
--max-jobs 2 \
|
||||
--log-format internal-json \
|
||||
--flake .#${hostname} \
|
||||
--target-host ${targets.${hostname}} 2>&1 \
|
||||
| ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
''
|
||||
);
|
||||
}
|
||||
) (builtins.attrNames self.nixosConfigurations)
|
||||
)
|
||||
// {
|
||||
deploy-ful = {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeDash "deploy-ful" ''
|
||||
exec ${pkgs.nix}/bin/nix run .#nixinate.ful \
|
||||
--log-format internal-json 2>&1 \
|
||||
| ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
'');
|
||||
program = toString (
|
||||
pkgs.writers.writeDash "deploy-ful" ''
|
||||
exec ${pkgs.nix}/bin/nix run .#nixinate.ful \
|
||||
--log-format internal-json 2>&1 \
|
||||
| ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
''
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# TODO overlay for packages
|
||||
# TODO remove flake-utils dependency from my own repos
|
||||
|
||||
nixosModules = {
|
||||
htgen = import modules/htgen.nix;
|
||||
moodle-dl = import modules/moodle-dl.nix;
|
||||
@@ -159,10 +170,10 @@
|
||||
|
||||
nixOnDroidConfigurations = {
|
||||
moto = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
modules = [systems/moto/configuration.nix];
|
||||
modules = [ systems/moto/configuration.nix ];
|
||||
pkgs = import nixpkgs {
|
||||
system = "aarch64-linux";
|
||||
overlays = [nix-on-droid.overlays.default];
|
||||
overlays = [ nix-on-droid.overlays.default ];
|
||||
};
|
||||
extraSpecialArgs = {
|
||||
niveumPackages = inputs.self.packages.aarch64-linux;
|
||||
@@ -174,13 +185,14 @@
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
maakaron = let
|
||||
system = "x86_64-darwin";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
maakaron =
|
||||
let
|
||||
system = "x86_64-darwin";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [./systems/maakaron/home.nix];
|
||||
modules = [ ./systems/maakaron/home.nix ];
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
niveumPackages = inputs.self.packages.${system};
|
||||
@@ -211,7 +223,6 @@
|
||||
systems/ful/configuration.nix
|
||||
agenix.nixosModules.default
|
||||
inputs.self.nixosModules.passport
|
||||
inputs.ical-ephemeris.nixosModules.default
|
||||
inputs.self.nixosModules.panoptikon
|
||||
inputs.self.nixosModules.go-webring
|
||||
inputs.self.nixosModules.htgen
|
||||
@@ -318,30 +329,29 @@
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
// flake-utils.lib.eachSystem [flake-utils.lib.system.x86_64-linux flake-utils.lib.system.x86_64-darwin flake-utils.lib.system.aarch64-linux] (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [
|
||||
nur.overlays.default
|
||||
(self: super: {
|
||||
mpv = super.mpv.override {scripts = [inputs.self.packages.${system}.mpv-visualizer super.mpvScripts.mpris];};
|
||||
dmenu = super.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
|
||||
})
|
||||
];
|
||||
};
|
||||
unstablePackages = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
};
|
||||
wrapScript = {
|
||||
packages ? [],
|
||||
name,
|
||||
script,
|
||||
}:
|
||||
pkgs.writers.writeDashBin name ''PATH=$PATH:${nixpkgs.lib.makeBinPath (packages ++ [pkgs.findutils pkgs.coreutils pkgs.gnused pkgs.gnugrep])} ${script} "$@"'';
|
||||
in {
|
||||
packages = rec {
|
||||
|
||||
packages = eachSupportedSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [
|
||||
nur.overlays.default
|
||||
(self: super: {
|
||||
mpv = super.mpv.override {scripts = [inputs.self.packages.${system}.mpv-visualizer super.mpvScripts.mpris];};
|
||||
dmenu = super.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
|
||||
})
|
||||
];
|
||||
};
|
||||
unstablePackages = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
};
|
||||
wrapScript = {
|
||||
packages ? [],
|
||||
name,
|
||||
script,
|
||||
}:
|
||||
pkgs.writers.writeDashBin name ''PATH=$PATH:${nixpkgs.lib.makeBinPath (packages ++ [pkgs.findutils pkgs.coreutils pkgs.gnused pkgs.gnugrep])} ${script} "$@"'';
|
||||
in {
|
||||
auc = pkgs.callPackage packages/auc.nix {};
|
||||
betacode = pkgs.callPackage packages/betacode.nix {};
|
||||
brainmelter = pkgs.callPackage packages/brainmelter.nix {};
|
||||
@@ -442,9 +452,6 @@
|
||||
weechatScripts-hotlist2extern = pkgs.callPackage packages/weechatScripts/hotlist2extern.nix {};
|
||||
wttr = pkgs.callPackage packages/wttr.nix {};
|
||||
|
||||
itl = pkgs.callPackage packages/itl.nix {};
|
||||
itools = pkgs.callPackage packages/itools.nix {itl = itl;};
|
||||
|
||||
booksplit = wrapScript {
|
||||
script = inputs.voidrice.outPath + "/.local/bin/booksplit";
|
||||
name = "booksplit";
|
||||
@@ -456,6 +463,6 @@
|
||||
name = "tag";
|
||||
packages = [pkgs.ffmpeg];
|
||||
};
|
||||
};
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
default = "daily";
|
||||
};
|
||||
loadCredential = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.string;
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = ''
|
||||
This can be used to pass secrets to the systemd service without adding them to the nix store.
|
||||
'';
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../../lib) kieran retiolumAddresses restic;
|
||||
@@ -15,7 +14,6 @@ in {
|
||||
./hledger.nix
|
||||
./go-webring.nix
|
||||
./gemini.nix
|
||||
./ical-ephemeris.nix
|
||||
./wallabag.nix
|
||||
../../configs/monitoring.nix
|
||||
../../configs/mycelium.nix
|
||||
@@ -72,64 +70,6 @@ in {
|
||||
];
|
||||
};
|
||||
|
||||
users.users.servant = {
|
||||
isSystemUser = true;
|
||||
group = "servant";
|
||||
};
|
||||
users.groups.servant = {};
|
||||
systemd.services.servant = {
|
||||
enable = true;
|
||||
environment.PORT = toString 18987;
|
||||
environment.VIRTUAL_HOST = "https://openapiaiapi.kmein.de";
|
||||
serviceConfig.ExecStart = pkgs.writers.writeHaskell "server" {
|
||||
libraries = with pkgs.haskellPackages; [
|
||||
servant
|
||||
servant-server
|
||||
servant-openapi3
|
||||
servant-swagger-ui
|
||||
servant-client
|
||||
aeson
|
||||
text
|
||||
warp
|
||||
uuid
|
||||
lens
|
||||
];
|
||||
ghcArgs = ["-O3" "-threaded"];
|
||||
} ./servant-openapi.hs;
|
||||
serviceConfig.User = "servant";
|
||||
serviceConfig.Group = "servant";
|
||||
};
|
||||
|
||||
services.htgen.openapi-conversion = {
|
||||
port = 18988;
|
||||
script = ''. ${pkgs.writers.writeDash "openapi-conversion" ''
|
||||
case "$Method $Request_URI" in
|
||||
"GET /openapi-3.1.json")
|
||||
schema=$(mktemp -d)
|
||||
trap 'rm -rf $schema' EXIT
|
||||
${pkgs.wget}/bin/wget http://127.0.0.1:${toString 18987}/openapi.json -O "$schema"/openapi.json
|
||||
cat "$schema"/openapi.json >&2
|
||||
PATH=${lib.makeBinPath [pkgs.bashInteractive pkgs.nodejs]} ${pkgs.nodejs}/bin/npx --yes openapi-format "$schema"/openapi.json --convertTo "3.1" -o "$schema"/openapi-new.json
|
||||
printf 'HTTP/1.1 200 OK\r\n'
|
||||
printf 'Content-Type: %s\r\n' "$(${pkgs.file}/bin/file -ib "$schema"/openapi-new.json)"
|
||||
printf 'Server: %s\r\n' "$Server"
|
||||
printf 'Connection: close\r\n'
|
||||
printf 'Content-Length: %d\r\n' $(${pkgs.coreutils}/bin/wc -c < "$schema"/openapi-new.json)
|
||||
printf '\r\n'
|
||||
cat "$schema"/openapi-new.json
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
''}'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."openapiaiapi.kmein.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/openapi-3.1.json".proxyPass = "http://127.0.0.1:${toString 18988}";
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString 18987}";
|
||||
};
|
||||
|
||||
networking = {
|
||||
firewall.allowedTCPPorts = [80 443];
|
||||
hostName = "ful";
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
port = 9090;
|
||||
in
|
||||
{
|
||||
services.nginx.virtualHosts."ical-ephemeris.kmein.de" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString port}/";
|
||||
};
|
||||
};
|
||||
|
||||
services.ical-ephemeris = {
|
||||
enable = true;
|
||||
inherit port;
|
||||
brevoApiKeyFile = config.age.secrets.brevo-key.path;
|
||||
copecartIpnKeyFile = config.age.secrets.copecart-ipn.path;
|
||||
baseUrl = "https://ical-ephemeris.kmein.de";
|
||||
};
|
||||
|
||||
age.secrets.copecart-ipn = {
|
||||
file = ../../secrets/copecart-ipn.age;
|
||||
};
|
||||
|
||||
age.secrets.brevo-key = {
|
||||
file = ../../secrets/brevo-key.age;
|
||||
};
|
||||
}
|
||||
@@ -21,7 +21,7 @@ in {
|
||||
nginx = {
|
||||
serverName = "matomo.kmein.de";
|
||||
};
|
||||
package = pkgs.matomo_5;
|
||||
package = pkgs.matomo;
|
||||
};
|
||||
|
||||
services.mysql = {
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE TypeFamilies #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Main where
|
||||
|
||||
import Data.Aeson (ToJSON, FromJSON)
|
||||
import GHC.Generics (Generic)
|
||||
import Data.String (IsString(..))
|
||||
import Network.Wai (Application)
|
||||
import Network.Wai.Handler.Warp (run)
|
||||
import Servant
|
||||
import Servant.Client (HasClient (..))
|
||||
import Servant.OpenApi (HasOpenApi(..), toOpenApi)
|
||||
import qualified Data.Version as Version
|
||||
import Servant.Swagger.UI (SwaggerSchemaUI, swaggerSchemaUIServer)
|
||||
import Data.OpenApi (ToSchema, servers, license, info, description, version, title)
|
||||
import qualified Data.OpenApi as OpenApi
|
||||
import Control.Concurrent.MVar (MVar, newMVar, modifyMVar, readMVar)
|
||||
import System.Environment (getEnv)
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
import Control.Lens
|
||||
import qualified Data.Text as T
|
||||
import GHC.Generics
|
||||
import GHC.TypeLits
|
||||
import Data.UUID (UUID)
|
||||
import Data.UUID.V4 (nextRandom)
|
||||
import qualified Data.UUID as UUID
|
||||
|
||||
-- Define a simple data type
|
||||
data User = User
|
||||
{ userId :: UUID
|
||||
, name :: String
|
||||
, age :: Int
|
||||
} deriving (Generic, Show)
|
||||
|
||||
instance ToJSON User
|
||||
instance FromJSON User
|
||||
instance ToSchema User
|
||||
|
||||
-- Define the API type
|
||||
type API = "users" :> OperationId "getUsers" :> Get '[JSON] [User]
|
||||
:<|> "users" :> OperationId "insertUser" :> ReqBody '[JSON] User :> Post '[JSON] User
|
||||
:<|> "users" :> OperationId "updateUser" :> Capture "id" UUID :> ReqBody '[JSON] User :> Put '[JSON] User
|
||||
:<|> "users" :> OperationId "deleteUser" :> Capture "id" UUID :> Delete '[JSON] NoContent
|
||||
|
||||
-- Define the API with Swagger endpoints
|
||||
type APIWithSwagger = API
|
||||
:<|> SwaggerSchemaUI "swagger-ui" "openapi.json"
|
||||
|
||||
|
||||
data OperationId (name :: Symbol)
|
||||
|
||||
instance HasServer subApi ctx => HasServer (OperationId name :> subApi) ctx where
|
||||
type ServerT (OperationId name :> subApi) m = ServerT subApi m
|
||||
route _ = route (Proxy @subApi)
|
||||
hoistServerWithContext _ = hoistServerWithContext (Proxy @subApi)
|
||||
|
||||
instance (HasOpenApi subApi, KnownSymbol name) => HasOpenApi (OperationId name :> subApi) where
|
||||
toOpenApi _ = toOpenApi (Proxy @subApi) & OpenApi.allOperations . OpenApi.operationId ?~ apiName
|
||||
where
|
||||
apiName = T.pack $ symbolVal (Proxy @name)
|
||||
|
||||
instance HasClient m api => HasClient m (OperationId name :> api) where
|
||||
type Client m (OperationId name :> api) = Client m api
|
||||
clientWithRoute pm Proxy = clientWithRoute pm (Proxy :: Proxy api)
|
||||
hoistClientMonad pm _ = hoistClientMonad pm (Proxy :: Proxy api)
|
||||
|
||||
-- Handlers for the API
|
||||
getUsers :: MVar [User] -> Handler [User]
|
||||
getUsers usersVar = liftIO $ readMVar usersVar
|
||||
|
||||
addUser :: MVar [User] -> User -> Handler User
|
||||
addUser usersVar newUser = liftIO $ do
|
||||
newId <- nextRandom
|
||||
let userWithId = newUser { userId = newId }
|
||||
modifyMVar usersVar $ \users -> return (userWithId : users, userWithId)
|
||||
|
||||
updateUser :: MVar [User] -> UUID -> User -> Handler User
|
||||
updateUser usersVar uid updatedUser = liftIO $ do
|
||||
modifyMVar usersVar $ \users ->
|
||||
let newUsers = map (\user -> if userId user == uid then updatedUser { userId = uid } else user) users
|
||||
in return (newUsers, updatedUser { userId = uid })
|
||||
|
||||
deleteUser :: MVar [User] -> UUID -> Handler NoContent
|
||||
deleteUser usersVar uid = liftIO $ do
|
||||
modifyMVar usersVar $ \users ->
|
||||
let newUsers = filter (\user -> userId user /= uid) users
|
||||
in return (newUsers, NoContent)
|
||||
|
||||
-- Implement the server
|
||||
server :: OpenApi.Server -> MVar [User] -> Server APIWithSwagger
|
||||
server virtualHost usersVar = (getUsers usersVar
|
||||
:<|> addUser usersVar
|
||||
:<|> updateUser usersVar
|
||||
:<|> deleteUser usersVar)
|
||||
:<|> swaggerSchemaUIServer (toOpenApi (Proxy :: Proxy API)
|
||||
& info.title .~ "OpenAPI AI API"
|
||||
& info.version .~ "1.0"
|
||||
& info.description ?~ "This is an API for AI with OpenAPI"
|
||||
& info.license ?~ "MIT"
|
||||
& servers .~ [virtualHost])
|
||||
|
||||
-- Create the application
|
||||
app :: OpenApi.Server -> MVar [User] -> Application
|
||||
app virtualHost usersVar = serve (Proxy :: Proxy APIWithSwagger) (server virtualHost usersVar)
|
||||
|
||||
-- Main entry point
|
||||
main :: IO ()
|
||||
main = do
|
||||
initialUsers <- mapM (\(name, age) -> nextRandom >>= \uid -> return (User uid name age)) [("Alice", 30), ("Bob", 25)]
|
||||
usersVar <- newMVar initialUsers
|
||||
virtualHost <- getEnv "VIRTUAL_HOST"
|
||||
port <- read <$> getEnv "PORT" -- Assuming PORT is a number
|
||||
run port (app (fromString virtualHost) usersVar)
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
../../configs/sound.nix
|
||||
../../configs/printing.nix
|
||||
../../configs/nix.nix
|
||||
../../configs/flix.nix
|
||||
../../configs/fonts.nix
|
||||
../../configs/mycelium.nix
|
||||
../../configs/retiolum.nix
|
||||
|
||||
Reference in New Issue
Block a user