mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-13 09:49:23 +08:00
Compare commits
129 Commits
docker
...
vps7-beesd
| Author | SHA1 | Date | |
|---|---|---|---|
| 50aba26cfc | |||
| b72c8a43fa | |||
| 47126a7429 | |||
| be3c0e5821 | |||
| 14f62cf255 | |||
| 60f3ccc506 | |||
| 2bac21f4cf | |||
| ea02adcf4d | |||
| 7fb51ba080 | |||
| 6020e071c0 | |||
| c83c90050a | |||
| 15d89d99ad | |||
| 4b5078a76c | |||
| 073aa595d3 | |||
| 2b5349ae06 | |||
| 3f62ee0dcd | |||
| b9f5478c26 | |||
| 11ee42d876 | |||
| d7adea94eb | |||
| 990a5cf0be | |||
| 2cbe5945b7 | |||
| e06623ce79 | |||
| 4eeae31498 | |||
| 9c75d2ac8d | |||
| f2b88fa5a3 | |||
| 259a1cc6f9 | |||
| e4d1320373 | |||
| 4f24bcce18 | |||
| e3336b95f8 | |||
| 97952ec828 | |||
| a0ef3198c2 | |||
| 68b94f7216 | |||
| b533b80f31 | |||
| a7315cd8b5 | |||
| 0a6a8fdd7b | |||
| d6d0a0e230 | |||
| 8d583b626f | |||
| 14ef69b54a | |||
| b69d4648b5 | |||
| 2efb0afcfe | |||
| 70e6430750 | |||
| 3dc8a2d73a | |||
| 795d55baee | |||
| 705d279a94 | |||
| d88610f3b7 | |||
| e832412f3b | |||
| 78b27d3ae5 | |||
| a694ada2ee | |||
| bacfb9ccf2 | |||
| fbe4c21e9a | |||
| 4340106787 | |||
| f42e1df555 | |||
| 63664f4fc7 | |||
| 33b96bd46f | |||
| 106112d16f | |||
| 38b6378160 | |||
| 33f7702330 | |||
| 556ac1994d | |||
| 99aa6ecbf7 | |||
| fde802ebfc | |||
| 1118e86d62 | |||
| ca59f06646 | |||
| 9eec3611d4 | |||
| 3f54c4256c | |||
| 91d7ab5b8f | |||
| dcf7f8ace0 | |||
| b7d524671a | |||
| f9a5581410 | |||
| 8c70c96d8e | |||
| 1957d68247 | |||
| ceb91a8ed8 | |||
| 093b27a225 | |||
| 79cad7f58a | |||
| 84ad6e3ae4 | |||
| 6318b938c2 | |||
| e21c7a916a | |||
| bdd8e82b4c | |||
| e967a2511f | |||
| b509fd7a51 | |||
| 0259ee11ec | |||
| 473c4f4d17 | |||
| 469b765f99 | |||
| ad7be5bc2b | |||
| fefd22a7eb | |||
| e4076219e1 | |||
| 8dc5b34cc1 | |||
| 4f39c1a1f3 | |||
| cf6e8dff66 | |||
| cb9665bbb6 | |||
| a419838515 | |||
| 164c5737d2 | |||
| 91ba3d8ec2 | |||
| 9fd8c2d7c6 | |||
| 11efee5bb3 | |||
| 677e8111bf | |||
| d48beec819 | |||
| 6bf6eabaa3 | |||
| 273fcbb7c5 | |||
| 22aadba0da | |||
| 5555396f5d | |||
| d935330515 | |||
| a215b50761 | |||
| 52fd57469e | |||
| b003a1be43 | |||
| 4bd0b01d9b | |||
| c3901eeeb8 | |||
| 77c4a604e9 | |||
| 7c361dab09 | |||
| b9efd5eb70 | |||
| 1a2d11cef8 | |||
| bfec0e24a0 | |||
| de9945635b | |||
| 915fcc348d | |||
| 91475e40d3 | |||
| 565b7dd6bc | |||
| 5a2b46898d | |||
| 3850b9bc05 | |||
| fb8c3cf89d | |||
| df5be06957 | |||
| 894607b933 | |||
| aec4d38497 | |||
| 2312a8398c | |||
| 2e4a542c06 | |||
| 69c7177b73 | |||
| 981643af44 | |||
| 5f88cd5cf5 | |||
| a519053c2a | |||
| 34c0ee6ced | |||
| bdc7945e71 |
79
flake.lock
generated
79
flake.lock
generated
@@ -30,11 +30,11 @@
|
||||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694158470,
|
||||
"narHash": "sha256-yWx9eBDHt6WR3gr65+J85KreHdMypty/P6yM35tIYYM=",
|
||||
"lastModified": 1695052866,
|
||||
"narHash": "sha256-agn7F9Oww4oU6nPiw+YiYI9Xb4vOOE73w8PAoBRP4AA=",
|
||||
"owner": "serokell",
|
||||
"repo": "deploy-rs",
|
||||
"rev": "d0cfc042eba92eb206611c9e8784d41a2c053bab",
|
||||
"rev": "e3f41832680801d0ee9e2ed33eb63af398b090e9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -449,11 +449,11 @@
|
||||
"systems": "systems_6"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1692799911,
|
||||
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -548,11 +548,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693208669,
|
||||
"narHash": "sha256-hHFaaUsZ860wvppPeiu7nJn/nXZjJfnqAQEu9SPFE9I=",
|
||||
"lastModified": 1694465129,
|
||||
"narHash": "sha256-8BQiuobMrCfCbGM7w6Snx+OBYdtTIm0+cGVaKwQ5BFg=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "5bac4a1c06cd77cf8fc35a658ccb035a6c50cd2c",
|
||||
"rev": "9787dffff5d315c9593d3f9fb0f9bf2097e1b57b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -564,11 +564,11 @@
|
||||
},
|
||||
"impermanence": {
|
||||
"locked": {
|
||||
"lastModified": 1690797372,
|
||||
"narHash": "sha256-GImz19e33SeVcIvBB7NnhbJSbTpFFmNtWLh7Z85Y188=",
|
||||
"lastModified": 1694622745,
|
||||
"narHash": "sha256-z397+eDhKx9c2qNafL1xv75lC0Q4nOaFlhaU1TINqb8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "e3a7acd113903269a1b5c8b527e84ce7ee859851",
|
||||
"rev": "e9643d08d0d193a2e074a19d4d90c67a874d932e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -708,11 +708,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693711723,
|
||||
"narHash": "sha256-5QmlVzskLciJ0QzYmZ6ULvKA7bP6pgV9wwrLBB0V3j0=",
|
||||
"lastModified": 1694921880,
|
||||
"narHash": "sha256-yU36cs5UdzhTwsM9bUWUz43N//ELzQ1ro69C07pU/8E=",
|
||||
"owner": "Mic92",
|
||||
"repo": "nix-index-database",
|
||||
"rev": "aca56a79afb82208af2b39d8459dd29c10989135",
|
||||
"rev": "9d2bcc47110b3b6217dfebd6761ba20bc78aedf2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -730,16 +730,17 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694222210,
|
||||
"narHash": "sha256-PzfwrGQMEpJk4lMK2a47bFbJpJFlAG/ihvZsL9U1Lik=",
|
||||
"lastModified": 1693358717,
|
||||
"narHash": "sha256-OYGe2Yay1QoodZZmvPYBFGAoTrRfyKLzFs2vON4gRek=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-vscode-extensions",
|
||||
"rev": "5a63908466573a4a1c0466e38f33c42c73ec5136",
|
||||
"rev": "50c4bce16b93e7ca8565d51fafabc05e9f0515da",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-vscode-extensions",
|
||||
"rev": "50c4bce16b93e7ca8565d51fafabc05e9f0515da",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
@@ -751,11 +752,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693052712,
|
||||
"narHash": "sha256-7wrP6s4OEuR7BUasy76n7j+c09rp7wyOq7YVYviXw9s=",
|
||||
"lastModified": 1694400214,
|
||||
"narHash": "sha256-QHESodq9FQpjWshfxmdYePnEAPaNPsYEd3iBe/JYjqk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixd",
|
||||
"rev": "f88accc8a8231efdae900ff6a14cb6301a73cff9",
|
||||
"rev": "69b533e8d643c5dcbda7962d4dff808d72165783",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -794,11 +795,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694192131,
|
||||
"narHash": "sha256-nt5ypVXKh65lQFqKqWgytEzI841yUhpl6E291Briu+g=",
|
||||
"lastModified": 1694664321,
|
||||
"narHash": "sha256-NLuFP5JW2LRJTUg0zpeYXS14KjtrgTpFdhH0T7YqEpc=",
|
||||
"owner": "nixpak",
|
||||
"repo": "nixpak",
|
||||
"rev": "16bd2860238c53bb7a31f745693d7d3c33a1490c",
|
||||
"rev": "9dd948303ea4c7d531e0775146b1b7fd969994c9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -893,11 +894,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1694398355,
|
||||
"narHash": "sha256-pUthVGI70SDT4M7FDihBuu4PDOmfySaUSjfY/QI6Y3Y=",
|
||||
"lastModified": 1695562663,
|
||||
"narHash": "sha256-cnPZFTKQGldgFHWC9LHt8mDtJVTmj4WJxvKHF5uw5qA=",
|
||||
"owner": "CHN-beta",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4944d71d43387083e6b7c7530caf3b1902c5eb27",
|
||||
"rev": "82e02a1546fc59bc496f859e446ddcd412f09849",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -941,11 +942,11 @@
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1694882942,
|
||||
"narHash": "sha256-J99E0D5LQn8gMWm9r3lGAvPDF7vHyzMxvyHfo3HmXhs=",
|
||||
"lastModified": 1696407757,
|
||||
"narHash": "sha256-odgzg6AzGsP8Zq2xOGHkkokL2h84xjq4X2QGSqGeyMI=",
|
||||
"owner": "CHN-beta",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8eebdf8cffabee8bfb9b054759a5569dbd6de551",
|
||||
"rev": "f8dbe95b4cb997c8d28adda7dc37824c4d0cd16b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -957,11 +958,11 @@
|
||||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1694237951,
|
||||
"narHash": "sha256-6gql7EJIWwn3mUvG/RHf1iGUA3Ptfmalz9WdgX3noSY=",
|
||||
"lastModified": 1695048039,
|
||||
"narHash": "sha256-zbJJylG0nrr6bP4+UXK10m2h9Kae5OUeYntU6rli02o=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "19674a713837dcfbef704a16815a4bbc462cd57a",
|
||||
"rev": "e57ad2a4d59c577780da709180c36304a1d8106c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -980,11 +981,11 @@
|
||||
"nvfetcher": "nvfetcher"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694239804,
|
||||
"narHash": "sha256-C5ERSMRp8kQEqyKS2yggXSqaKZUgnNyQD+zjy6iqXm0=",
|
||||
"lastModified": 1695017238,
|
||||
"narHash": "sha256-JoGZyYAnWZnq8NPu+ptmydA9s/96kb518fY5Q56FcHE=",
|
||||
"owner": "xddxdd",
|
||||
"repo": "nur-packages",
|
||||
"rev": "ce48d1df62cab988a5e8eefdf97bec8bdc46392f",
|
||||
"rev": "6e5f2de9db2dede7f1bf350b97adff4901209352",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1113,11 +1114,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693898833,
|
||||
"narHash": "sha256-OIrMAGNYNeLs6IvBynxcXub7aSW3GEUvWNsb7zx6zuU=",
|
||||
"lastModified": 1694495315,
|
||||
"narHash": "sha256-sZEYXs9T1NVHZSSbMqBEtEm2PGa7dEDcx0ttQkArORc=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "faf21ac162173c2deb54e5fdeed002a9bd6e8623",
|
||||
"rev": "ea208e55f8742fdcc0986b256bdfa8986f5e4415",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
113
flake.nix
113
flake.nix
@@ -17,7 +17,11 @@
|
||||
nur.url = "github:nix-community/NUR";
|
||||
nixos-cn = { url = "github:nixos-cn/flakes"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
nur-xddxdd = { url = "github:xddxdd/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
nix-vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
nix-vscode-extensions =
|
||||
{
|
||||
url = "github:nix-community/nix-vscode-extensions?rev=50c4bce16b93e7ca8565d51fafabc05e9f0515da";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nix-alien = { url = "github:thiagokokada/nix-alien"; inputs.nix-index-database.follows = "nix-index-database"; };
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
qchem = { url = "github:Nix-QChem/NixOS-QChem"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
@@ -40,7 +44,7 @@
|
||||
default = inputs.nixpkgs.legacyPackages.x86_64-linux.writeText "systems"
|
||||
(builtins.concatStringsSep "\n" (builtins.map
|
||||
(system: builtins.toString inputs.self.outputs.nixosConfigurations.${system}.config.system.build.toplevel)
|
||||
[ "pc" "vps6" "vps7" "nas" "yoga" ]));
|
||||
[ "pc" "vps6" "vps7" "nas" ]));
|
||||
}
|
||||
// (
|
||||
builtins.listToAttrs (builtins.map
|
||||
@@ -194,6 +198,7 @@
|
||||
"debug.mirism.one" = "127.0.0.1";
|
||||
"initrd.vps6.chn.moe" = "74.211.99.69";
|
||||
"nix-store.chn.moe" = "127.0.0.1";
|
||||
"initrd.nas.chn.moe" = "192.168.1.185";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -208,15 +213,19 @@
|
||||
};
|
||||
nix-serve = { enable = true; hostname = "nix-store.chn.moe"; };
|
||||
smartd.enable = true;
|
||||
nginx = { enable = true; transparentProxy.enable = false; };
|
||||
misskey = { enable = true; hostname = "xn--qbtm095lrg0bfka60z.chn.moe"; };
|
||||
misskey-proxy."xn--qbtm095lrg0bfka60z.chn.moe" = {};
|
||||
huginn.enable = true;
|
||||
nginx =
|
||||
{
|
||||
enable = true;
|
||||
transparentProxy.externalIp = [ "192.168.82.3" ];
|
||||
applications.misskey.instances."xn--qbtm095lrg0bfka60z.chn.moe" = {};
|
||||
};
|
||||
misskey.instances.misskey.hostname = "xn--qbtm095lrg0bfka60z.chn.moe";
|
||||
beesd = { enable = true; instances.root = { device = "/"; hashTableSizeMB = 2048; }; };
|
||||
};
|
||||
bugs =
|
||||
[
|
||||
"intel-hdmi" "suspend-hibernate-no-platform" "hibernate-iwlwifi" "suspend-lid-no-wakeup" "xmunet"
|
||||
"suspend-hibernate-waydroid" "embree"
|
||||
"suspend-hibernate-waydroid" "embree" "nvme"
|
||||
];
|
||||
};})
|
||||
];
|
||||
@@ -270,7 +279,7 @@
|
||||
enable = true;
|
||||
transparentProxy =
|
||||
{
|
||||
externalIp = "74.211.99.69";
|
||||
externalIp = [ "74.211.99.69" "192.168.82.1" ];
|
||||
map =
|
||||
{
|
||||
"ng01.mirism.one" = 7411;
|
||||
@@ -282,20 +291,28 @@
|
||||
enable = true;
|
||||
map =
|
||||
{
|
||||
"nix-store.chn.moe" = { upstream = "internal.pc.chn.moe"; rewriteHttps = true; };
|
||||
"nix-store.chn.moe" = { upstream = "internal.pc.chn.moe:443"; rewriteHttps = true; };
|
||||
"anchor.fm" = { upstream = "anchor.fm:443"; rewriteHttps = true; };
|
||||
"podcasters.spotify.com" = { upstream = "podcasters.spotify.com:443"; rewriteHttps = true; };
|
||||
};
|
||||
};
|
||||
};
|
||||
misskey-proxy =
|
||||
{
|
||||
"xn--qbtm095lrg0bfka60z.chn.moe".upstream.address = "internal.pc.chn.moe";
|
||||
"xn--s8w913fdga.chn.moe".upstream.address = "internal.vps7.chn.moe";
|
||||
applications =
|
||||
{
|
||||
misskey.instances =
|
||||
{
|
||||
"xn--qbtm095lrg0bfka60z.chn.moe".upstream.address = "internal.pc.chn.moe";
|
||||
"xn--s8w913fdga.chn.moe".upstream.address = "internal.vps7.chn.moe";
|
||||
"misskey.chn.moe".upstream = "internal.vps7.chn.moe:9727";
|
||||
};
|
||||
synapse.instances."synapse.chn.moe".upstream.address = "internal.vps7.chn.moe";
|
||||
vaultwarden = { enable = true; upstream.address = "internal.vps7.chn.moe"; };
|
||||
element.instances."element.chn.moe" = {};
|
||||
photoprism.instances."photoprism.chn.moe".upstream.address = "internal.vps7.chn.moe";
|
||||
nextcloud.proxy = { enable = true; upstream = "internal.vps7.chn.moe"; };
|
||||
};
|
||||
};
|
||||
coturn.enable = true;
|
||||
synapse-proxy."synapse.chn.moe".upstream.address = "internal.vps7.chn.moe";
|
||||
vaultwarden-proxy = { enable = true; upstream.address = "internal.vps7.chn.moe"; };
|
||||
beesd = { enable = false; instances.root = { device = "/"; hashTableSizeMB = 32; }; };
|
||||
};
|
||||
};})
|
||||
];
|
||||
@@ -345,18 +362,39 @@
|
||||
services =
|
||||
{
|
||||
snapper = { enable = true; configs.persistent = "/nix/persistent"; };
|
||||
fontconfig.enable = true;
|
||||
sshd.enable = true;
|
||||
rsshub.enable = true;
|
||||
nginx = { enable = true; transparentProxy.externalIp = "95.111.228.40"; };
|
||||
nginx =
|
||||
{
|
||||
enable = true;
|
||||
transparentProxy.externalIp = [ "95.111.228.40" "192.168.82.2" ];
|
||||
applications =
|
||||
{
|
||||
misskey.instances =
|
||||
{
|
||||
"xn--s8w913fdga.chn.moe" = {};
|
||||
"misskey.chn.moe".upstream.port = 9727;
|
||||
};
|
||||
synapse.instances."synapse.chn.moe" = {};
|
||||
vaultwarden.enable = true;
|
||||
photoprism.instances."photoprism.chn.moe" = {};
|
||||
nextcloud.instance.enable = true;
|
||||
};
|
||||
};
|
||||
wallabag.enable = true;
|
||||
misskey = { enable = true; hostname = "xn--s8w913fdga.chn.moe"; };
|
||||
misskey-proxy."xn--s8w913fdga.chn.moe" = {};
|
||||
misskey.instances =
|
||||
{
|
||||
misskey.hostname = "xn--s8w913fdga.chn.moe";
|
||||
misskey-old = { port = 9727; redis.port = 3546; meilisearch.enable = false; };
|
||||
};
|
||||
synapse.enable = true;
|
||||
synapse-proxy."synapse.chn.moe" = {};
|
||||
xrdp = { enable = true; hostname = "vps7.chn.moe"; };
|
||||
vaultwarden.enable = true;
|
||||
vaultwarden-proxy.enable = true;
|
||||
# huginn.enable = true;
|
||||
meilisearch.ioLimitDevice = "/dev/mapper/root";
|
||||
beesd = { enable = true; instances.root = { device = "/"; hashTableSizeMB = 1024; }; };
|
||||
photoprism.enable = true;
|
||||
nextcloud.enable = true;
|
||||
};
|
||||
};})
|
||||
];
|
||||
@@ -384,14 +422,24 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
decrypt.auto =
|
||||
decrypt.manual =
|
||||
{
|
||||
"/dev/disk/by-uuid/5cf1d19d-b4a5-4e67-8e10-f63f0d5bb649".mapper = "root1";
|
||||
"/dev/disk/by-uuid/aa684baf-fd8a-459c-99ba-11eb7636cb0d".mapper = "root2";
|
||||
"/dev/disk/by-uuid/a779198f-cce9-4c3d-a64a-9ec45f6f5495" = { mapper = "nix"; ssd = true; };
|
||||
enable = true;
|
||||
devices =
|
||||
{
|
||||
"/dev/disk/by-uuid/5cf1d19d-b4a5-4e67-8e10-f63f0d5bb649".mapper = "root1";
|
||||
"/dev/disk/by-uuid/aa684baf-fd8a-459c-99ba-11eb7636cb0d".mapper = "root2";
|
||||
"/dev/disk/by-uuid/a779198f-cce9-4c3d-a64a-9ec45f6f5495" = { mapper = "nix"; ssd = true; };
|
||||
};
|
||||
delayedMount = [ "/" "/nix" ];
|
||||
};
|
||||
rollingRootfs = { device = "/dev/mapper/root1"; path = "/nix/rootfs"; };
|
||||
};
|
||||
initrd =
|
||||
{
|
||||
network.enable = true;
|
||||
sshd = { enable = true; hostKeys = [ "/nix/persistent/etc/ssh/initrd_ssh_host_ed25519_key" ]; };
|
||||
};
|
||||
grub.installDevice = "efi";
|
||||
nixpkgs.march = "silvermont";
|
||||
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
|
||||
@@ -410,7 +458,7 @@
|
||||
packages.packageSet = "desktop";
|
||||
services =
|
||||
{
|
||||
snapper = { enable = true; configs.persistent = "/nix/persistent"; };
|
||||
snapper = { enable = false; configs.persistent = "/nix/persistent"; };
|
||||
fontconfig.enable = true;
|
||||
samba =
|
||||
{
|
||||
@@ -433,8 +481,17 @@
|
||||
xrdp = { enable = true; hostname = [ "nas.chn.moe" "office.chn.moe" ]; };
|
||||
groupshare.enable = true;
|
||||
smartd.enable = true;
|
||||
beesd =
|
||||
{
|
||||
enable = false;
|
||||
instances =
|
||||
{
|
||||
root = { device = "/"; hashTableSizeMB = 2048; };
|
||||
nix = { device = "/nix"; hashTableSizeMB = 128; };
|
||||
};
|
||||
};
|
||||
};
|
||||
users = [ "root" "chn" "xll" "zem" "yjq" "yxy" ];
|
||||
users.users = [ "root" "chn" "xll" "zem" "yjq" "yxy" ];
|
||||
};})
|
||||
];
|
||||
"xmupc1" =
|
||||
|
||||
@@ -10,9 +10,4 @@
|
||||
sha256 = "4qT29YVjKEWcMrI5R5Ps8aD4grAAgz5VOxANjpp1oTo=";
|
||||
};
|
||||
nativeBuildInputs = [ cmake ];
|
||||
postInstall =
|
||||
''
|
||||
mv $out/include/concurrencpp-${version}/concurrencpp $out/include
|
||||
rm -rf $out/include/concurrencpp-${version}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, pkgs }: with pkgs;
|
||||
{ lib, pkgs }: with pkgs; rec
|
||||
{
|
||||
typora = callPackage ./typora {};
|
||||
upho = python3Packages.callPackage ./upho {};
|
||||
@@ -7,7 +7,7 @@
|
||||
oneapi = callPackage ./oneapi {};
|
||||
send = callPackage ./send {};
|
||||
rsshub = callPackage ./rsshub {};
|
||||
misskey = callPackage ./misskey {};
|
||||
misskey = callPackage ./misskey { vips = unstablePackages.vips; };
|
||||
mk-meili-mgn = callPackage ./mk-meili-mgn {};
|
||||
phonon-unfolding = callPackage ./phonon-unfolding {};
|
||||
# vasp = callPackage ./vasp
|
||||
@@ -26,4 +26,10 @@
|
||||
huginn = callPackage ./huginn {};
|
||||
v_sim = callPackage ./v_sim {};
|
||||
concurrencpp = callPackage ./concurrencpp { stdenv = gcc13Stdenv; };
|
||||
eigengdb = python3Packages.callPackage ./eigengdb {};
|
||||
nodesoup = callPackage ./nodesoup {};
|
||||
matplotplusplus = callPackage ./matplotplusplus { inherit nodesoup; };
|
||||
zpp-bits = callPackage ./zpp-bits {};
|
||||
eigen = callPackage ./eigen {};
|
||||
nameof = callPackage ./nameof {};
|
||||
}
|
||||
|
||||
12
local/pkgs/eigen/default.nix
Normal file
12
local/pkgs/eigen/default.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ lib, stdenv, fetchFromGitLab, cmake }: stdenv.mkDerivation rec
|
||||
{
|
||||
name = "eigen";
|
||||
src = fetchFromGitLab
|
||||
{
|
||||
owner = "libeigen";
|
||||
repo = name;
|
||||
rev = "6d829e766ff1b1ab867d93631163cbc63ed5798f";
|
||||
sha256 = "BXUnizcRPrOyiPpoyYJ4VVOjlG49aj80mgzPKmEYPKU=";
|
||||
};
|
||||
nativeBuildInputs = [ cmake ];
|
||||
}
|
||||
15
local/pkgs/eigengdb/default.nix
Normal file
15
local/pkgs/eigengdb/default.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ lib, fetchFromGitHub, buildPythonPackage, numpy, gdb }: buildPythonPackage
|
||||
{
|
||||
name = "eigengdb";
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "dmillard";
|
||||
repo = "eigengdb";
|
||||
rev = "c741edef3f07f33429056eff48d79a62733ed494";
|
||||
sha256 = "MTqOaWsKhWaPs3G5F/6bYZmQI5qS2hEGKGa3mwbgFaY=";
|
||||
};
|
||||
doCheck = false;
|
||||
buildInputs = [ gdb ];
|
||||
nativeBuildInputs = [ gdb ];
|
||||
propagatedBuildInputs = [ numpy ];
|
||||
}
|
||||
22
local/pkgs/matplotplusplus/default.nix
Normal file
22
local/pkgs/matplotplusplus/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
stdenv, fetchFromGitHub, cmake, pkg-config,
|
||||
gnuplot, libjpeg, libtiff, zlib, libpng, lapack, blas, fftw, opencv, nodesoup, cimg
|
||||
}: stdenv.mkDerivation rec
|
||||
{
|
||||
pname = "matplotplusplus";
|
||||
version = "1.2.0";
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "alandefreitas";
|
||||
repo = "matplotplusplus";
|
||||
rev = "v${version}";
|
||||
sha256 = "mYXAB1AbCtcd2rEuluJN6hDKE9+AowodjJt2pdyntes=";
|
||||
};
|
||||
cmakeFlags =
|
||||
[
|
||||
"-DBUILD_SHARED_LIBS=ON" "-DMATPLOTPP_BUILD_SHARED_LIBS=ON" "-DMATPLOTPP_BUILD_EXAMPLES=OFF"
|
||||
"-DMATPLOTPP_WITH_SYSTEM_NODESOUP=ON" "-DMATPLOTPP_WITH_SYSTEM_CIMG=ON"
|
||||
];
|
||||
buildInputs = [ gnuplot libjpeg libtiff zlib libpng lapack blas fftw opencv nodesoup cimg ];
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
{
|
||||
lib, stdenv, mkPnpmPackage, fetchFromGitHub, nodejs_20, writeShellScript, buildFHSEnv,
|
||||
lib, stdenv, mkPnpmPackage, fetchFromGitHub, fetchurl, nodejs_20, writeShellScript, buildFHSEnv,
|
||||
bash, cypress, vips, pkg-config
|
||||
}:
|
||||
let
|
||||
pname = "misskey";
|
||||
version = "13.14.2";
|
||||
version = "2023.9.3";
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "CHN-beta";
|
||||
repo = "misskey";
|
||||
rev = "e02ecb3819f6f05352d43b64ae59fa1bd683e2e0";
|
||||
hash = "sha256-zsYM67LYUn+bI6kbdW9blftxw5TUxCdzlfaOOEgZz+Q=";
|
||||
rev = "d88358090da8459ef6f3b01890b361ff44a007f7";
|
||||
sha256 = "JeXMnFoJuudGGHhAEXhdBRMN8EHEbm4U1yXuoz8K4hU=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
originalPnpmPackage = mkPnpmPackage
|
||||
@@ -26,14 +26,66 @@ let
|
||||
export NODE_ENV=production
|
||||
pnpm run migrateandstart
|
||||
'';
|
||||
re2 = stdenv.mkDerivation rec
|
||||
{
|
||||
pname = "re2";
|
||||
version = "1.20.3";
|
||||
srcs =
|
||||
[
|
||||
(fetchurl
|
||||
{
|
||||
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-115.br";
|
||||
sha256 = "0g2k0bki0zm0vaqpz25ww119qcs1flv63h6s5ib3103arpnzmb6d";
|
||||
})
|
||||
(fetchurl
|
||||
{
|
||||
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-115.gz";
|
||||
sha256 = "1dr9zzzm67jknzvla1l5178lzmj6cfh8i1vsp5r4gkwdwbfh3ip0";
|
||||
})
|
||||
(fetchurl
|
||||
{
|
||||
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-108.br";
|
||||
sha256 = "0wby987byhshb20np1gglj6y9ji7m7jza5jwa4hyxfxs1pkkmg1n";
|
||||
})
|
||||
(fetchurl
|
||||
{
|
||||
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-108.gz";
|
||||
sha256 = "0q3dyxm63d2x0wxx23gdwym7r2gmaw4ahvmd35dgrj179ik290pi";
|
||||
})
|
||||
(fetchurl
|
||||
{
|
||||
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-93.br";
|
||||
sha256 = "1wjmdni24353ppwfiyrv1zl9ci4g2habk0g2nz6b0sijagcy7bv3";
|
||||
})
|
||||
(fetchurl
|
||||
{
|
||||
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-93.gz";
|
||||
sha256 = "0rgkryjh412g2m7rfrl2krsb9137prkk2y9ga8akn7qp1bqsbq1i";
|
||||
})
|
||||
];
|
||||
phases = [ "installPhase" ];
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/${version}
|
||||
for i in $srcs
|
||||
do
|
||||
cp $i $out/${version}/''${i#*-}
|
||||
done
|
||||
'';
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation
|
||||
stdenv.mkDerivation rec
|
||||
{
|
||||
inherit version src pname;
|
||||
nativeBuildInputs =
|
||||
[ bash nodejs_20 nodejs_20.pkgs.typescript nodejs_20.pkgs.pnpm nodejs_20.pkgs.gulp cypress vips pkg-config ];
|
||||
buildInputs =
|
||||
[
|
||||
bash nodejs_20 nodejs_20.pkgs.typescript nodejs_20.pkgs.pnpm nodejs_20.pkgs.gulp cypress vips pkg-config
|
||||
];
|
||||
nativeBuildInputs = buildInputs;
|
||||
CYPRESS_RUN_BINARY = "${cypress}/bin/Cypress";
|
||||
NODE_ENV = "production";
|
||||
RE2_DOWNLOAD_MIRROR = "${re2}";
|
||||
RE2_DOWNLOAD_SKIP_PATH = "true";
|
||||
configurePhase =
|
||||
''
|
||||
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
|
||||
@@ -67,4 +119,8 @@ in
|
||||
mkdir -p $out/files
|
||||
runHook postInstall
|
||||
'';
|
||||
passthru =
|
||||
{
|
||||
inherit originalPnpmPackage startScript re2;
|
||||
};
|
||||
}
|
||||
|
||||
20
local/pkgs/nameof/default.nix
Normal file
20
local/pkgs/nameof/default.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation rec
|
||||
{
|
||||
pname = "nameof";
|
||||
version = "0.10.3";
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "Neargye";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "eHG0Y/BQGbwTrBHjq9SeSiIXaVqWp7PxIq7vCIECYPk=";
|
||||
};
|
||||
phases = [ "installPhase" ];
|
||||
installPhase =
|
||||
''
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
cp -r $src/include $out
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
13
local/pkgs/nodesoup/default.nix
Normal file
13
local/pkgs/nodesoup/default.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ stdenv, fetchFromGitHub, cmake, pkg-config, cairo, pcre2, xorg }: stdenv.mkDerivation rec
|
||||
{
|
||||
name = "nodesoup";
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "olvb";
|
||||
repo = "nodesoup";
|
||||
rev = "3158ad082bb0cd1abee75418b12b35522dbca74f";
|
||||
sha256 = "tFLq6QC3U3uvcuWsdRy2wnwcmAfH2MkI2oMcAiUBHSo=";
|
||||
};
|
||||
buildInputs = [ cairo pcre2.dev xorg.libXdmcp.dev ];
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
}
|
||||
@@ -3,21 +3,20 @@
|
||||
chromium, bash
|
||||
}:
|
||||
let
|
||||
pname = "rsshub";
|
||||
version = "20230829";
|
||||
name = "rsshub";
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "DIYgod";
|
||||
repo = "RSSHub";
|
||||
rev = "afcf9774260dc6505263cf0428970e890f2f7b1d";
|
||||
hash = "sha256-BQFE0Z5DsFTf0tylQ0NN89hCdXT/Y2M+YPa/10ccOVg=";
|
||||
rev = "67d4a7ed3f877a8ceac6caebe874c4ce5c210bd8";
|
||||
sha256 = "baJQWGrr1RdZoI2uAGp2uJO9epbjAUjks76knJSwVdE=";
|
||||
};
|
||||
originalPnpmPackage = mkPnpmPackage { inherit pname version src nodejs; };
|
||||
originalPnpmPackage = mkPnpmPackage { inherit name src nodejs; };
|
||||
nodeModules = originalPnpmPackage.nodeModules.overrideAttrs { PUPPETEER_SKIP_DOWNLOAD = true; };
|
||||
rsshub-unwrapped = stdenv.mkDerivation
|
||||
{
|
||||
inherit version src;
|
||||
pname = "${pname}-unwrapped";
|
||||
inherit src;
|
||||
name = "${name}-unwrapped";
|
||||
configurePhase =
|
||||
''
|
||||
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
|
||||
@@ -44,9 +43,9 @@ let
|
||||
export CHROMIUM_EXECUTABLE_PATH=chromium
|
||||
pnpm start
|
||||
'';
|
||||
in stdenv.mkDerivation rec
|
||||
in stdenv.mkDerivation
|
||||
{
|
||||
inherit pname version;
|
||||
inherit name;
|
||||
phases = [ "installPhase" ];
|
||||
installPhase =
|
||||
''
|
||||
|
||||
18
local/pkgs/zpp-bits/default.nix
Normal file
18
local/pkgs/zpp-bits/default.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ stdenv, fetchFromGitHub }: stdenv.mkDerivation rec
|
||||
{
|
||||
pname = "zpp-bits";
|
||||
version = "4.4.19";
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "eyalz800";
|
||||
repo = "zpp_bits";
|
||||
rev = "v${version}";
|
||||
sha256 = "ejIwrvCFALuBQbQhTfzjBb11oMR/akKnboB60GWbjlQ=";
|
||||
};
|
||||
phases = [ "installPhase" ];
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/include
|
||||
cp $src/zpp_bits.h $out/include
|
||||
'';
|
||||
}
|
||||
@@ -75,6 +75,7 @@ inputs:
|
||||
firefox.programs.firefox.enable = inputs.lib.mkForce false;
|
||||
embree.nixpkgs.overlays =
|
||||
[(final: prev: { embree = prev.embree.override { stdenv = final.genericPackages.stdenv; }; })];
|
||||
nvme.boot.kernelParams = [ "nvme_core.default_ps_max_latency_us=0" ];
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
@@ -29,101 +29,52 @@ inputs:
|
||||
[
|
||||
# >= server
|
||||
{
|
||||
nixos.packages = with inputs.pkgs;
|
||||
nixos =
|
||||
{
|
||||
_packages =
|
||||
[
|
||||
# shell
|
||||
ksh
|
||||
# basic tools
|
||||
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij neofetch ipfetch
|
||||
# lsxx
|
||||
pciutils usbutils lshw util-linux lsof
|
||||
# top
|
||||
iotop iftop htop btop powertop s-tui
|
||||
# editor
|
||||
nano bat
|
||||
# downloader
|
||||
wget aria2 curl
|
||||
# file manager
|
||||
tree exa trash-cli lsd broot file xdg-ninja mlocate
|
||||
# compress
|
||||
pigz rar upx unzip zip lzip p7zip
|
||||
# file system management
|
||||
sshfs e2fsprogs adb-sync duperemove compsize
|
||||
# disk management
|
||||
smartmontools hdparm
|
||||
# encryption and authentication
|
||||
apacheHttpd openssl ssh-to-age gnupg age sops pam_u2f yubico-piv-tool
|
||||
# networking
|
||||
ipset iptables iproute2 dig nettools traceroute tcping-go whois tcpdump nmap inetutils
|
||||
# nix tools
|
||||
nix-output-monitor nix-tree
|
||||
# office
|
||||
todo-txt-cli
|
||||
] ++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ]);
|
||||
_pythonPackages = [(pythonPackages: with pythonPackages;
|
||||
[
|
||||
inquirerpy requests python-telegram-bot tqdm fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
|
||||
certifi charset-normalizer idna orjson psycopg2
|
||||
])];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
nix-index-database.comma.enable = true;
|
||||
nix-index.enable = true;
|
||||
zsh =
|
||||
packages = with inputs.pkgs;
|
||||
{
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
enableCompletion = true;
|
||||
ohMyZsh =
|
||||
{
|
||||
enable = true;
|
||||
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
|
||||
customPkgs = with inputs.pkgs; [ zsh-nix-shell ];
|
||||
};
|
||||
_packages =
|
||||
[
|
||||
# shell
|
||||
ksh
|
||||
# basic tools
|
||||
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij neofetch ipfetch
|
||||
# lsxx
|
||||
pciutils usbutils lshw util-linux lsof
|
||||
# top
|
||||
iotop iftop htop btop powertop s-tui
|
||||
# editor
|
||||
nano bat
|
||||
# downloader
|
||||
wget aria2 curl
|
||||
# file manager
|
||||
tree exa trash-cli lsd broot file xdg-ninja mlocate
|
||||
# compress
|
||||
pigz rar upx unzip zip lzip p7zip
|
||||
# file system management
|
||||
sshfs e2fsprogs adb-sync duperemove compsize
|
||||
# disk management
|
||||
smartmontools hdparm
|
||||
# encryption and authentication
|
||||
apacheHttpd openssl ssh-to-age gnupg age sops pam_u2f yubico-piv-tool
|
||||
# networking
|
||||
ipset iptables iproute2 dig nettools traceroute tcping-go whois tcpdump nmap inetutils
|
||||
# nix tools
|
||||
nix-output-monitor nix-tree
|
||||
# office
|
||||
todo-txt-cli
|
||||
# development
|
||||
gdb
|
||||
] ++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ]);
|
||||
_pythonPackages = [(pythonPackages: with pythonPackages;
|
||||
[
|
||||
inquirerpy requests python-telegram-bot tqdm fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
|
||||
certifi charset-normalizer idna orjson psycopg2 localPackages.eigengdb
|
||||
])];
|
||||
};
|
||||
ccache.enable = true;
|
||||
command-not-found.enable = false;
|
||||
adb.enable = true;
|
||||
gnupg.agent = { enable = true; enableSSHSupport = true; };
|
||||
autojump.enable = true;
|
||||
git =
|
||||
users.sharedModules = [(home-inputs:
|
||||
{
|
||||
enable = true;
|
||||
package = inputs.pkgs.gitFull;
|
||||
lfs.enable = true;
|
||||
config =
|
||||
{
|
||||
init.defaultBranch = "main";
|
||||
core = { quotepath = false; editor = "vim"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
services =
|
||||
{
|
||||
fwupd.enable = true;
|
||||
udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
|
||||
};
|
||||
nix.settings.extra-sandbox-paths = [ inputs.config.programs.ccache.cacheDir ];
|
||||
nixpkgs.config =
|
||||
{
|
||||
permittedInsecurePackages = with inputs.pkgs;
|
||||
[
|
||||
openssl_1_1.name electron_19.name nodejs-16_x.name python2.name electron_12.name
|
||||
];
|
||||
allowUnfree = true;
|
||||
};
|
||||
home-manager =
|
||||
{
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
sharedModules =
|
||||
[{
|
||||
home.stateVersion = "22.11";
|
||||
programs =
|
||||
config.programs =
|
||||
{
|
||||
zsh =
|
||||
{
|
||||
@@ -131,7 +82,6 @@ inputs:
|
||||
initExtraBeforeCompInit =
|
||||
''
|
||||
# p10k instant prompt
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
|
||||
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
|
||||
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
|
||||
HYPHEN_INSENSITIVE="true"
|
||||
@@ -177,6 +127,7 @@ inputs:
|
||||
];
|
||||
history =
|
||||
{
|
||||
path = "${home-inputs.config.xdg.dataHome}/zsh/zsh_history";
|
||||
extended = true;
|
||||
save = 100000000;
|
||||
size = 100000000;
|
||||
@@ -236,82 +187,185 @@ inputs:
|
||||
'';
|
||||
};
|
||||
};
|
||||
}];
|
||||
})];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
nix-index-database.comma.enable = true;
|
||||
nix-index.enable = true;
|
||||
zsh =
|
||||
{
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
enableCompletion = true;
|
||||
ohMyZsh =
|
||||
{
|
||||
enable = true;
|
||||
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
|
||||
customPkgs = with inputs.pkgs; [ zsh-nix-shell ];
|
||||
};
|
||||
};
|
||||
ccache.enable = true;
|
||||
command-not-found.enable = false;
|
||||
adb.enable = true;
|
||||
gnupg.agent = { enable = true; enableSSHSupport = true; };
|
||||
autojump.enable = true;
|
||||
git =
|
||||
{
|
||||
enable = true;
|
||||
package = inputs.pkgs.gitFull;
|
||||
lfs.enable = true;
|
||||
config =
|
||||
{
|
||||
init.defaultBranch = "main";
|
||||
core = { quotepath = false; editor = "vim"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
services =
|
||||
{
|
||||
fwupd.enable = true;
|
||||
udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
|
||||
};
|
||||
nix.settings.extra-sandbox-paths = [ inputs.config.programs.ccache.cacheDir ];
|
||||
nixpkgs.config =
|
||||
{
|
||||
permittedInsecurePackages = with inputs.pkgs;
|
||||
[
|
||||
openssl_1_1.name electron_19.name nodejs-16_x.name python2.name electron_12.name
|
||||
];
|
||||
allowUnfree = true;
|
||||
};
|
||||
home-manager =
|
||||
{
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
};
|
||||
}
|
||||
# >= desktop
|
||||
(
|
||||
mkIf (builtins.elem inputs.config.nixos.packages.packageSet [ "desktop" "workstation" ] )
|
||||
{
|
||||
nixos.packages = with inputs.pkgs;
|
||||
nixos =
|
||||
{
|
||||
_packages =
|
||||
[
|
||||
# system management
|
||||
gparted snapper-gui libsForQt5.qtstyleplugin-kvantum wl-clipboard-x11 kio-fuse wl-mirror
|
||||
wayland-utils clinfo glxinfo vulkan-tools dracut etcher
|
||||
# nix tools
|
||||
ssh-to-age deploy-rs.deploy-rs nixpkgs-fmt
|
||||
# instant messager
|
||||
element-desktop telegram-desktop discord inputs.config.nur.repos.linyinfeng.wemeet # native
|
||||
cinny-desktop # nur-xddxdd.wine-wechat thunder
|
||||
# browser
|
||||
google-chrome
|
||||
# networking
|
||||
remmina putty mtr-gui
|
||||
# password and key management
|
||||
bitwarden yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui
|
||||
# download
|
||||
qbittorrent yt-dlp nur-xddxdd.baidupcs-go wgetpaste
|
||||
# office
|
||||
unstablePackages.crow-translate zotero pandoc
|
||||
# development
|
||||
scrcpy
|
||||
# media
|
||||
spotify yesplaymusic mpv nomacs simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc
|
||||
# text editor
|
||||
localPackages.typora
|
||||
# themes
|
||||
orchis-theme tela-circle-icon-theme plasma-overdose-kde-theme materia-kde-theme graphite-kde-theme
|
||||
arc-kde-theme materia-theme
|
||||
# news
|
||||
fluent-reader rssguard
|
||||
# davinci-resolve playonlinux
|
||||
weston cage openbox krita
|
||||
genymotion
|
||||
(
|
||||
vscode-with-extensions.override
|
||||
packages = with inputs.pkgs;
|
||||
{
|
||||
_packages =
|
||||
[
|
||||
# system management
|
||||
gparted snapper-gui libsForQt5.qtstyleplugin-kvantum wl-clipboard-x11 kio-fuse wl-mirror
|
||||
wayland-utils clinfo glxinfo vulkan-tools dracut etcher unstablePackages.btrfs-assistant
|
||||
# nix tools
|
||||
ssh-to-age deploy-rs.deploy-rs nixpkgs-fmt
|
||||
# instant messager
|
||||
element-desktop telegram-desktop discord inputs.config.nur.repos.linyinfeng.wemeet # native
|
||||
cinny-desktop # nur-xddxdd.wine-wechat thunder
|
||||
# browser
|
||||
google-chrome
|
||||
# networking
|
||||
remmina putty mtr-gui
|
||||
# password and key management
|
||||
bitwarden yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui
|
||||
# download
|
||||
qbittorrent yt-dlp nur-xddxdd.baidupcs-go wgetpaste
|
||||
# office
|
||||
unstablePackages.crow-translate zotero pandoc
|
||||
# development
|
||||
scrcpy
|
||||
# media
|
||||
spotify yesplaymusic mpv nomacs simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc
|
||||
# text editor
|
||||
localPackages.typora
|
||||
# themes
|
||||
orchis-theme tela-circle-icon-theme plasma-overdose-kde-theme materia-kde-theme graphite-kde-theme
|
||||
arc-kde-theme materia-theme
|
||||
# news
|
||||
fluent-reader rssguard
|
||||
# davinci-resolve playonlinux
|
||||
weston cage openbox krita
|
||||
genymotion hdfview
|
||||
(
|
||||
vscode-with-extensions.override
|
||||
{
|
||||
vscodeExtensions = with nix-vscode-extensions.vscode-marketplace;
|
||||
(with equinusocio; [ vsc-community-material-theme vsc-material-theme-icons ])
|
||||
++ (with github; [ copilot copilot-chat copilot-labs github-vscode-theme ])
|
||||
++ (with intellsmi; [ comment-translate deepl-translate ])
|
||||
++ (with ms-python; [ isort python vscode-pylance ])
|
||||
++ (with ms-toolsai;
|
||||
[
|
||||
jupyter jupyter-keymap jupyter-renderers vscode-jupyter-cell-tags vscode-jupyter-slideshow
|
||||
])
|
||||
++ (with ms-vscode;
|
||||
[
|
||||
cmake-tools cpptools cpptools-extension-pack cpptools-themes hexeditor remote-explorer
|
||||
test-adapter-converter
|
||||
])
|
||||
++ (with ms-vscode-remote; [ remote-ssh remote-containers remote-ssh-edit ])
|
||||
++ [
|
||||
donjayamanne.githistory genieai.chatgpt-vscode fabiospampinato.vscode-diff cschlosser.doxdocgen
|
||||
llvm-vs-code-extensions.vscode-clangd ms-ceintl.vscode-language-pack-zh-hans
|
||||
oderwat.indent-rainbow
|
||||
twxs.cmake guyutongxue.cpp-reference znck.grammarly thfriedrich.lammps leetcode.vscode-leetcode
|
||||
james-yu.latex-workshop gimly81.matlab affenwiesel.matlab-formatter ckolkman.vscode-postgres
|
||||
yzhang.markdown-all-in-one pkief.material-icon-theme bbenoist.nix ms-ossdata.vscode-postgresql
|
||||
redhat.vscode-xml dotjoshjohnson.xml jnoortheen.nix-ide xdebug.php-debug
|
||||
hbenl.vscode-test-explorer
|
||||
jeff-hykin.better-cpp-syntax fredericbonnet.cmake-test-adapter mesonbuild.mesonbuild
|
||||
hirse.vscode-ungit fortran-lang.linter-gfortran tboox.xmake-vscode ccls-project.ccls
|
||||
feiskyer.chatgpt-copilot yukiuuh2936.vscode-modern-fortran-formatter wolframresearch.wolfram
|
||||
njpipeorgan.wolfram-language-notebook brettm12345.nixfmt-vscode webfreak.debug
|
||||
];
|
||||
}
|
||||
)
|
||||
] ++ (with inputs.lib; filter isDerivation (attrValues plasma5Packages.kdeGear));
|
||||
};
|
||||
users.sharedModules =
|
||||
[{
|
||||
config =
|
||||
{
|
||||
programs =
|
||||
{
|
||||
vscodeExtensions = with nix-vscode-extensions.vscode-marketplace;
|
||||
(with equinusocio; [ vsc-community-material-theme vsc-material-theme-icons ])
|
||||
++ (with github; [ copilot copilot-chat copilot-labs github-vscode-theme ])
|
||||
++ (with intellsmi; [ comment-translate deepl-translate ])
|
||||
++ (with ms-python; [ isort python vscode-pylance ])
|
||||
++ (with ms-toolsai;
|
||||
chromium =
|
||||
{
|
||||
enable = true;
|
||||
extensions =
|
||||
[
|
||||
jupyter jupyter-keymap jupyter-renderers vscode-jupyter-cell-tags vscode-jupyter-slideshow
|
||||
])
|
||||
++ (with ms-vscode;
|
||||
[
|
||||
cmake-tools cpptools cpptools-extension-pack cpptools-themes hexeditor remote-explorer
|
||||
test-adapter-converter
|
||||
])
|
||||
++ (with ms-vscode-remote; [ remote-ssh remote-containers remote-ssh-edit ])
|
||||
++ [
|
||||
donjayamanne.githistory genieai.chatgpt-vscode fabiospampinato.vscode-diff cschlosser.doxdocgen
|
||||
llvm-vs-code-extensions.vscode-clangd ms-ceintl.vscode-language-pack-zh-hans oderwat.indent-rainbow
|
||||
twxs.cmake guyutongxue.cpp-reference znck.grammarly thfriedrich.lammps leetcode.vscode-leetcode
|
||||
james-yu.latex-workshop gimly81.matlab affenwiesel.matlab-formatter ckolkman.vscode-postgres
|
||||
yzhang.markdown-all-in-one pkief.material-icon-theme bbenoist.nix ms-ossdata.vscode-postgresql
|
||||
redhat.vscode-xml dotjoshjohnson.xml jnoortheen.nix-ide xdebug.php-debug hbenl.vscode-test-explorer
|
||||
jeff-hykin.better-cpp-syntax fredericbonnet.cmake-test-adapter mesonbuild.mesonbuild
|
||||
hirse.vscode-ungit fortran-lang.linter-gfortran tboox.xmake-vscode ccls-project.ccls
|
||||
feiskyer.chatgpt-copilot yukiuuh2936.vscode-modern-fortran-formatter wolframresearch.wolfram
|
||||
njpipeorgan.wolfram-language-notebook brettm12345.nixfmt-vscode
|
||||
{ id = "mpkodccbngfoacfalldjimigbofkhgjn"; } # Aria2 Explorer
|
||||
{ id = "nngceckbapebfimnlniiiahkandclblb"; } # Bitwarden
|
||||
{ id = "kbfnbcaeplbcioakkpcpgfkobkghlhen"; } # Grammarly
|
||||
{ id = "ihnfpdchjnmlehnoeffgcbakfmdjcckn"; } # Pixiv Fanbox Downloader
|
||||
{ id = "cimiefiiaegbelhefglklhhakcgmhkai"; } # Plasma Integration
|
||||
{ id = "dkndmhgdcmjdmkdonmbgjpijejdcilfh"; } # Powerful Pixiv Downloader
|
||||
{ id = "padekgcemlokbadohgkifijomclgjgif"; } # Proxy SwitchyOmega
|
||||
{ id = "kefjpfngnndepjbopdmoebkipbgkggaa"; } # RSSHub Radar
|
||||
{ id = "abpdnfjocnmdomablahdcfnoggeeiedb"; } # Save All Resources
|
||||
{ id = "nbokbjkabcmbfdlbddjidfmibcpneigj"; } # SmoothScroll
|
||||
{ id = "onepmapfbjohnegdmfhndpefjkppbjkm"; } # SuperCopy 超级复制
|
||||
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # uBlock Origin
|
||||
{ id = "gppongmhjkpfnbhagpmjfkannfbllamg"; } # Wappalyzer
|
||||
{ id = "hkbdddpiemdeibjoknnofflfgbgnebcm"; } # YouTube™ 双字幕
|
||||
{ id = "ekhagklcjbdpajgpjgmbionohlpdbjgc"; } # Zotero Connector
|
||||
{ id = "ikhdkkncnoglghljlkmcimlnlhkeamad"; } # 划词翻译
|
||||
{ id = "dhdgffkkebhmkfjojejmpbldmpobfkfo"; } # 篡改猴
|
||||
{ id = "hipekcciheckooncpjeljhnekcoolahp"; } # Tabliss
|
||||
];
|
||||
}
|
||||
)
|
||||
] ++ (with inputs.lib; filter isDerivation (attrValues plasma5Packages.kdeGear));
|
||||
};
|
||||
obs-studio =
|
||||
{
|
||||
enable = true;
|
||||
plugins = with inputs.pkgs.obs-studio-plugins;
|
||||
[ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
|
||||
};
|
||||
};
|
||||
home.file.".config/baloofilerc".text =
|
||||
''
|
||||
[Basic Settings]
|
||||
Indexing-Enabled=false
|
||||
'';
|
||||
};
|
||||
}];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
@@ -334,48 +388,6 @@ inputs:
|
||||
});
|
||||
};
|
||||
services.pcscd.enable = true;
|
||||
home-manager.sharedModules =
|
||||
[{
|
||||
programs =
|
||||
{
|
||||
chromium =
|
||||
{
|
||||
enable = true;
|
||||
extensions =
|
||||
[
|
||||
{ id = "mpkodccbngfoacfalldjimigbofkhgjn"; } # Aria2 Explorer
|
||||
{ id = "nngceckbapebfimnlniiiahkandclblb"; } # Bitwarden
|
||||
{ id = "kbfnbcaeplbcioakkpcpgfkobkghlhen"; } # Grammarly
|
||||
{ id = "ihnfpdchjnmlehnoeffgcbakfmdjcckn"; } # Pixiv Fanbox Downloader
|
||||
{ id = "cimiefiiaegbelhefglklhhakcgmhkai"; } # Plasma Integration
|
||||
{ id = "dkndmhgdcmjdmkdonmbgjpijejdcilfh"; } # Powerful Pixiv Downloader
|
||||
{ id = "padekgcemlokbadohgkifijomclgjgif"; } # Proxy SwitchyOmega
|
||||
{ id = "kefjpfngnndepjbopdmoebkipbgkggaa"; } # RSSHub Radar
|
||||
{ id = "abpdnfjocnmdomablahdcfnoggeeiedb"; } # Save All Resources
|
||||
{ id = "nbokbjkabcmbfdlbddjidfmibcpneigj"; } # SmoothScroll
|
||||
{ id = "onepmapfbjohnegdmfhndpefjkppbjkm"; } # SuperCopy 超级复制
|
||||
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # uBlock Origin
|
||||
{ id = "gppongmhjkpfnbhagpmjfkannfbllamg"; } # Wappalyzer
|
||||
{ id = "hkbdddpiemdeibjoknnofflfgbgnebcm"; } # YouTube™ 双字幕
|
||||
{ id = "ekhagklcjbdpajgpjgmbionohlpdbjgc"; } # Zotero Connector
|
||||
{ id = "ikhdkkncnoglghljlkmcimlnlhkeamad"; } # 划词翻译
|
||||
{ id = "dhdgffkkebhmkfjojejmpbldmpobfkfo"; } # 篡改猴
|
||||
{ id = "hipekcciheckooncpjeljhnekcoolahp"; } # Tabliss
|
||||
];
|
||||
};
|
||||
obs-studio =
|
||||
{
|
||||
enable = true;
|
||||
plugins = with inputs.pkgs.obs-studio-plugins;
|
||||
[ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
|
||||
};
|
||||
};
|
||||
home.file.".config/baloofilerc".text =
|
||||
''
|
||||
[Basic Settings]
|
||||
Indexing-Enabled=false
|
||||
'';
|
||||
}];
|
||||
}
|
||||
)
|
||||
# >= workstation
|
||||
@@ -398,11 +410,11 @@ inputs:
|
||||
# media
|
||||
nur-xddxdd.svp obs-studio waifu2x-converter-cpp inkscape blender
|
||||
# virtualization
|
||||
wine virt-viewer bottles # wine64
|
||||
wineWowPackages.stagingFull virt-viewer bottles # wine64
|
||||
# text editor
|
||||
appflowy notion-app-enhanced joplin-desktop standardnotes
|
||||
# math, physics and chemistry
|
||||
mathematica octave root ovito paraview localPackages.vesta qchem.quantum-espresso
|
||||
mathematica octaveFull root ovito paraview localPackages.vesta qchem.quantum-espresso
|
||||
localPackages.vasp localPackages.phonon-unfolding localPackages.vaspkit jmol localPackages.v_sim
|
||||
# news
|
||||
newsflash newsboat
|
||||
@@ -413,7 +425,8 @@ inputs:
|
||||
])];
|
||||
_prebuildPackages =
|
||||
[
|
||||
httplib magic-enum xtensor boost cereal cxxopts ftxui yaml-cpp gfortran gcc10 python2 gcc13Stdenv
|
||||
httplib magic-enum xtensor boost cereal cxxopts ftxui yaml-cpp gfortran gcc10 python2
|
||||
unstablePackages.gcc13Stdenv
|
||||
];
|
||||
};
|
||||
programs =
|
||||
@@ -578,4 +591,4 @@ inputs:
|
||||
# x11-misc/optimus-manager
|
||||
# x11-misc/unclutter-xfixes
|
||||
|
||||
# ++ ( with inputs.pkgs.pkgsCross.mingwW64.buildPackages; [ gcc ] );
|
||||
# ++ ( with inputs.pkgs.pkgsCross.mingwW64.buildPackages; [ gcc ] );
|
||||
|
||||
@@ -1686,7 +1686,7 @@
|
||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||
# seen the warning, or if you are unsure what this all means.
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
|
||||
|
||||
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
|
||||
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
|
||||
|
||||
50
modules/services/beesd.nix
Normal file
50
modules/services/beesd.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.beesd = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
instances = mkOption
|
||||
{
|
||||
type = types.attrsOf (types.oneOf
|
||||
[
|
||||
types.nonEmptyStr
|
||||
(types.submodule { options =
|
||||
{
|
||||
device = mkOption { type = types.nonEmptyStr; };
|
||||
hashTableSizeMB = mkOption { type = types.int; };
|
||||
};})
|
||||
]);
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services) beesd;
|
||||
inherit (inputs.lib) mkIf;
|
||||
inherit (builtins) map listToAttrs;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
in mkIf beesd.enable
|
||||
{
|
||||
services.beesd.filesystems = listToAttrs (map
|
||||
(instance:
|
||||
{
|
||||
inherit (instance) name;
|
||||
value =
|
||||
{
|
||||
spec = instance.value.device or instance.value;
|
||||
hashTableSizeMB = instance.value.hashTableSizeMB or 1024;
|
||||
extraOptions = [ "--thread-count" "1" "--scan-mode" "3" ];
|
||||
};
|
||||
})
|
||||
(attrsToList beesd.instances));
|
||||
systemd.slices.system-beesd.sliceConfig =
|
||||
{
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
IOSchedulingPriority = 4;
|
||||
IOAccounting = true;
|
||||
IOWeight = 1;
|
||||
Nice = 19;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -6,7 +6,7 @@ inputs:
|
||||
./redis.nix
|
||||
./rsshub.nix
|
||||
./misskey.nix
|
||||
./nginx.nix
|
||||
./nginx
|
||||
./meilisearch.nix
|
||||
./xray.nix
|
||||
./coturn.nix
|
||||
@@ -19,16 +19,14 @@ inputs:
|
||||
./sshd.nix
|
||||
./vaultwarden.nix
|
||||
./frp.nix
|
||||
./docker.nix
|
||||
./huginn.nix
|
||||
./beesd.nix
|
||||
./snapper.nix
|
||||
./mariadb.nix
|
||||
./photoprism.nix
|
||||
./nextcloud.nix
|
||||
];
|
||||
options.nixos.services = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
snapper =
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
configs = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
|
||||
};
|
||||
kmscon.enable = mkOption { type = types.bool; default = false; };
|
||||
fontconfig.enable = mkOption { type = types.bool; default = false; };
|
||||
firewall.trustedInterfaces = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
|
||||
@@ -49,38 +47,6 @@ inputs:
|
||||
inherit (builtins) map listToAttrs toString;
|
||||
in mkMerge
|
||||
[
|
||||
(
|
||||
mkIf services.snapper.enable
|
||||
{
|
||||
services.snapper.configs =
|
||||
let
|
||||
f = (config:
|
||||
{
|
||||
inherit (config) name;
|
||||
value =
|
||||
{
|
||||
SUBVOLUME = config.value;
|
||||
TIMELINE_CREATE = true;
|
||||
TIMELINE_CLEANUP = true;
|
||||
TIMELINE_MIN_AGE = 1800;
|
||||
TIMELINE_LIMIT_HOURLY = "10";
|
||||
TIMELINE_LIMIT_DAILY = "7";
|
||||
TIMELINE_LIMIT_WEEKLY = "1";
|
||||
TIMELINE_LIMIT_MONTHLY = "0";
|
||||
TIMELINE_LIMIT_YEARLY = "0";
|
||||
};
|
||||
});
|
||||
in
|
||||
listToAttrs (map f (attrsToList services.snapper.configs));
|
||||
nixpkgs.config.packageOverrides = pkgs:
|
||||
{
|
||||
snapper = pkgs.snapper.overrideAttrs (attrs:
|
||||
{
|
||||
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./snapper.patch ];
|
||||
});
|
||||
};
|
||||
}
|
||||
)
|
||||
(
|
||||
mkIf services.kmscon.enable
|
||||
{
|
||||
@@ -120,8 +86,8 @@ inputs:
|
||||
secretKeyFile = inputs.config.sops.secrets."store/signingKey".path;
|
||||
};
|
||||
sops.secrets."store/signingKey" = {};
|
||||
nixos.services.nginx.httpProxy.${services.nix-serve.hostname} =
|
||||
{ rewriteHttps = true; locations."/".upstream = "http://127.0.0.1:5000"; };
|
||||
nixos.services.nginx.http.${services.nix-serve.hostname} =
|
||||
{ rewriteHttps = true; locations."/".proxy.upstream = "http://127.0.0.1:5000"; };
|
||||
}
|
||||
)
|
||||
(mkIf services.smartd.enable { services.smartd.enable = true; })
|
||||
@@ -206,10 +172,10 @@ inputs:
|
||||
nginx =
|
||||
{
|
||||
enable = true;
|
||||
httpProxy."wallabag.chn.moe" =
|
||||
http."wallabag.chn.moe" =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations."/" = { upstream = "http://127.0.0.1:4398"; setHeaders.Host = "wallabag.chn.moe"; };
|
||||
locations."/".proxy = { upstream = "http://127.0.0.1:4398"; setHeaders.Host = "wallabag.chn.moe"; };
|
||||
};
|
||||
};
|
||||
postgresql.enable = true;
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.docker = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule (inputs: { options =
|
||||
{
|
||||
user = mkOption { type = types.nonEmptyStr; default = inputs.config._module.args.name; };
|
||||
image = mkOption { type = types.package; };
|
||||
imageName =
|
||||
mkOption { type = types.nonEmptyStr; default = with inputs.config.image; (imageName + ":" + imageTag); };
|
||||
ports = mkOption
|
||||
{
|
||||
type = types.listOf (types.oneOf
|
||||
[
|
||||
types.ints.unsigned
|
||||
types.submodule (inputs: { options =
|
||||
{
|
||||
hostIp = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
|
||||
hostPort = mkOption { type = types.ints.unsigned; };
|
||||
containerPort = mkOption { type = types.ints.unsigned; };
|
||||
protocol = mkOption { type = types.enum [ "tcp" "udp" ]; default = "tcp"; };
|
||||
};})
|
||||
]);
|
||||
default = [];
|
||||
};
|
||||
environmentFile = mkOption { type = types.oneOf [ types.bool types.nonEmptyStr ]; default = false; };
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
inherit (builtins) listToAttrs map concatLists;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (inputs.config.nixos.services) docker;
|
||||
in mkIf (docker != {})
|
||||
{
|
||||
virtualisation.oci-containers.containers = listToAttrs (map
|
||||
(container:
|
||||
{
|
||||
name = "${container.name}";
|
||||
value =
|
||||
{
|
||||
image = container.value.imageName;
|
||||
imageFile = container.value.image;
|
||||
ports = map
|
||||
(port:
|
||||
(
|
||||
if builtins.typeOf port == "int" then toString port
|
||||
else ("${port.value.hostIp}:${toString port.value.hostPort}"
|
||||
+ ":${toString port.value.containerPort}/${port.value.protocol}")
|
||||
))
|
||||
container.value.ports;
|
||||
extraOptions = [ "--add-host=host.docker.internal:host-gateway" ];
|
||||
environmentFiles =
|
||||
if builtins.typeOf container.value.environmentFile == "bool" && container.value.environmentFile
|
||||
then [ inputs.config.sops.templates."${container.name}.env".path ]
|
||||
else if builtins.typeOf container.value.environmentFile == "bool" then []
|
||||
else [ container.value.environmentFile ];
|
||||
};
|
||||
})
|
||||
(attrsToList docker));
|
||||
systemd =
|
||||
{
|
||||
services = listToAttrs (concatLists (map
|
||||
(container: let user = container.value.user; in
|
||||
[
|
||||
{
|
||||
name = "docker-${user}-daemon";
|
||||
value = let originalService = inputs.config.systemd.user.services.docker; in
|
||||
{
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
inherit (originalService) description path;
|
||||
environment.XDG_RUNTIME_DIR = "/run/docker-rootless/${user}";
|
||||
serviceConfig = originalService.serviceConfig //
|
||||
{
|
||||
User = user;
|
||||
Group = user;
|
||||
# AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
ExecStart = originalService.serviceConfig.ExecStart
|
||||
+ " -H unix:///var/run/docker-rootless/${user}/docker.sock";
|
||||
};
|
||||
unitConfig = { inherit (originalService.unitConfig) StartLimitInterval; };
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "docker-${container.name}";
|
||||
value =
|
||||
{
|
||||
requires = [ "docker-${user}-daemon.service" ];
|
||||
after = [ "docker-${user}-daemon.service" ];
|
||||
environment =
|
||||
{
|
||||
XDG_RUNTIME_DIR = "/run/docker-rootless/${user}";
|
||||
DOCKER_HOST = "unix:///run/docker-rootless/${user}/docker.sock";
|
||||
};
|
||||
serviceConfig =
|
||||
{
|
||||
User = user;
|
||||
Group = user;
|
||||
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
||||
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
||||
};
|
||||
};
|
||||
}
|
||||
])
|
||||
(attrsToList docker)));
|
||||
tmpfiles.rules = map
|
||||
(container: with container.value; "d /run/docker-rootless/${user} 0755 ${user} ${user}")
|
||||
(attrsToList docker);
|
||||
};
|
||||
nixos.virtualization.docker.enable = true;
|
||||
users =
|
||||
{
|
||||
users = listToAttrs (map
|
||||
(container:
|
||||
{
|
||||
name = container.value.user;
|
||||
value =
|
||||
{
|
||||
isSystemUser = true;
|
||||
group = container.value.user;
|
||||
autoSubUidGidRange = true;
|
||||
home = "/run/docker-rootless/${container.value.user}";
|
||||
};
|
||||
})
|
||||
(attrsToList docker));
|
||||
groups = listToAttrs (map
|
||||
(container: { name = container.value.user; value = {}; })
|
||||
(attrsToList docker));
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.huginn = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
inherit (inputs.config.nixos.services) huginn;
|
||||
inherit (builtins) listToAttrs;
|
||||
in mkIf huginn.enable
|
||||
{
|
||||
nixos.services =
|
||||
{
|
||||
docker.huginn =
|
||||
{
|
||||
image = inputs.pkgs.dockerTools.pullImage
|
||||
{
|
||||
imageName = "huginn/huginn";
|
||||
imageDigest = "sha256:dbe871597d43232add81d1adfc5ad9f5cf9dcb5e1f1ba3d669598c20b96ab6c1";
|
||||
sha256 = "sha256-P8bfzjW5gHCVv0kaEAi9xAe5c0aQXypJkYUfFtE8SVM=";
|
||||
finalImageName = "huginn/huginn";
|
||||
finalImageTag = "2d5fcafc507da3e8c115c3479e9116a0758c5375";
|
||||
};
|
||||
ports = [ 3000 ];
|
||||
environmentFile = true;
|
||||
};
|
||||
postgresql = { enable = true; instances.huginn = {}; };
|
||||
};
|
||||
sops =
|
||||
{
|
||||
templates."huginn.env" =
|
||||
{
|
||||
content = let placeholder = inputs.config.sops.placeholder; in
|
||||
''
|
||||
MYSQL_PORT_3306_TCP_ADDR=host.docker.internal
|
||||
HUGINN_DATABASE_NAME=huginn
|
||||
HUGINN_DATABASE_USERNAME=huginn
|
||||
HUGINN_DATABASE_PASSWORD=${placeholder."postgresql/huginn"}
|
||||
DOMAIN=huginn.chn.moe
|
||||
RAILS_ENV=production
|
||||
FORCE_SSL=true
|
||||
INVITATION_CODE=${placeholder."huginn/invitation_code"}
|
||||
SMTP_DOMAIN=mail.chn.moe
|
||||
SMTP_USER_NAME=bot@chn.moe
|
||||
SMTP_PASSWORD="${placeholder."mail/bot"}"
|
||||
SMTP_SERVER=mail.chn.moe
|
||||
SMTP_SSL=true
|
||||
EMAIL_FROM_ADDRESS=bot@chn.moe
|
||||
TIMEZONE=Beijing
|
||||
'';
|
||||
owner = inputs.config.users.users.huginn.name;
|
||||
};
|
||||
secrets = listToAttrs (map (secret: { name = secret; value = {}; }) [ "huginn/invitation_code" "mail/bot" ]);
|
||||
};
|
||||
};
|
||||
}
|
||||
62
modules/services/mariadb.nix
Normal file
62
modules/services/mariadb.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.mariadb = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
instances = mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule (submoduleInputs: { options =
|
||||
{
|
||||
database = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
|
||||
user = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
|
||||
passwordFile = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services) mariadb;
|
||||
inherit (inputs.lib) mkAfter mkIf;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (builtins) map listToAttrs concatStringsSep filter;
|
||||
in mkIf mariadb.enable
|
||||
{
|
||||
services =
|
||||
{
|
||||
mysql =
|
||||
{
|
||||
enable = true;
|
||||
package = inputs.pkgs.mariadb;
|
||||
ensureDatabases = map (db: db.value.database) (attrsToList mariadb.instances);
|
||||
ensureUsers = map
|
||||
(db:
|
||||
{
|
||||
name = db.value.user;
|
||||
ensurePermissions."${db.value.database}.*" = "ALL PRIVILEGES";
|
||||
})
|
||||
(attrsToList mariadb.instances);
|
||||
};
|
||||
mysqlBackup =
|
||||
{
|
||||
enable = true;
|
||||
databases = map (db: db.value.database) (attrsToList mariadb.instances);
|
||||
};
|
||||
};
|
||||
systemd.services.mysql.postStart = mkAfter (concatStringsSep "\n" (map
|
||||
(db:
|
||||
let
|
||||
passwordFile =
|
||||
if db.value.passwordFile or null != null then db.value.passwordFile
|
||||
else inputs.config.sops.secrets."mariadb/${db.value.user}".path;
|
||||
mysql = "${inputs.config.services.mysql.package}/bin/mysql";
|
||||
in
|
||||
# set user password
|
||||
''echo "ALTER USER '${db.value.user}'@'localhost' IDENTIFIED VIA unix_socket OR mysql_native_password ''
|
||||
+ ''USING PASSWORD('$(cat ${passwordFile})');" | ${mysql} -N'')
|
||||
(attrsToList mariadb.instances)));
|
||||
sops.secrets = listToAttrs (map
|
||||
(db: { name = "mariadb/${db.value.user}"; value.owner = inputs.config.users.users.mysql.name; })
|
||||
(filter (db: db.value.passwordFile == null) (attrsToList mariadb.instances)));
|
||||
};
|
||||
}
|
||||
@@ -11,6 +11,7 @@ inputs:
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
ioLimitDevice = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
@@ -60,7 +61,15 @@ inputs:
|
||||
IOWeight = 1;
|
||||
Nice = 19;
|
||||
Slice = "-.slice";
|
||||
};
|
||||
}
|
||||
// (if meilisearch.ioLimitDevice != null then
|
||||
{
|
||||
IOReadBandwidthMax = "${meilisearch.ioLimitDevice} 20M";
|
||||
IOWriteBandwidthMax = "${meilisearch.ioLimitDevice} 20M";
|
||||
# iostat -dx 1
|
||||
IOReadIOPSMax = "${meilisearch.ioLimitDevice} 100";
|
||||
IOWriteIOPSMax = "${meilisearch.ioLimitDevice} 100";
|
||||
} else {});
|
||||
};
|
||||
})
|
||||
(attrsToList meilisearch.instances));
|
||||
@@ -89,10 +98,10 @@ inputs:
|
||||
env = "production"
|
||||
dump_dir = "/var/lib/meilisearch/${instance.name}/dumps"
|
||||
log_level = "INFO"
|
||||
max_indexing_memory = "8Gb"
|
||||
max_indexing_memory = "16Gb"
|
||||
max_indexing_threads = 1
|
||||
'';
|
||||
owner = inputs.config.users.users.misskey.name;
|
||||
owner = instance.value.user;
|
||||
};
|
||||
})
|
||||
(attrsToList meilisearch.instances));
|
||||
|
||||
@@ -1,56 +1,47 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services = let inherit (inputs.lib) mkOption types; in
|
||||
options.nixos.services.misskey.instances = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{
|
||||
misskey =
|
||||
type = types.attrsOf (types.submodule { options =
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
autoStart = mkOption { type = types.bool; default = true; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 9726; };
|
||||
redis.port = mkOption { type = types.ints.unsigned; default = 3545; };
|
||||
hostname = mkOption { type = types.str; default = "misskey.chn.moe"; };
|
||||
};
|
||||
misskey-proxy = mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule (submoduleInputs: { options =
|
||||
meilisearch =
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
|
||||
upstream = mkOption
|
||||
{
|
||||
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
|
||||
{
|
||||
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 9726; };
|
||||
};})];
|
||||
default = "127.0.0.1:9726";
|
||||
};
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
enable = mkOption { type = types.bool; default = true; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 7700; };
|
||||
};
|
||||
};});
|
||||
default = {};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services) misskey misskey-proxy;
|
||||
inherit (inputs.localLib) stripeTabs attrsToList;
|
||||
inherit (inputs.lib) mkIf mkMerge;
|
||||
inherit (builtins) map listToAttrs toString replaceStrings;
|
||||
in mkMerge
|
||||
[
|
||||
(mkIf misskey.enable
|
||||
{
|
||||
systemd =
|
||||
inherit (inputs.config.nixos.services) misskey;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (inputs.lib) mkMerge;
|
||||
inherit (builtins) map listToAttrs toString replaceStrings filter;
|
||||
in
|
||||
{
|
||||
systemd = mkMerge (map
|
||||
(instance:
|
||||
{
|
||||
services.misskey =
|
||||
services."misskey-${instance.name}" = rec
|
||||
{
|
||||
description = "misskey";
|
||||
after = [ "network.target" "redis-misskey.service" "postgresql.service" "meilisearch-misskey.service" ];
|
||||
requires = [ "network.target" "redis-misskey.service" "postgresql.service" "meilisearch-misskey.service" ];
|
||||
enable = instance.value.autoStart;
|
||||
description = "misskey ${instance.name}";
|
||||
after = [ "network.target" "redis-misskey-${instance.name}.service" "postgresql.service" ]
|
||||
++ (if instance.value.meilisearch.enable then [ "meilisearch-misskey-${instance.name}.service" ]
|
||||
else []);
|
||||
requires = after;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment.MISSKEY_CONFIG_YML = inputs.config.sops.templates."misskey/default.yml".path;
|
||||
environment.MISSKEY_CONFIG_YML = inputs.config.sops.templates."misskey/${instance.name}.yml".path;
|
||||
serviceConfig = rec
|
||||
{
|
||||
User = inputs.config.users.users.misskey.name;
|
||||
Group = inputs.config.users.users.misskey.group;
|
||||
WorkingDirectory = "/var/lib/misskey/work";
|
||||
User = inputs.config.users.users."misskey-${instance.name}".name;
|
||||
Group = inputs.config.users.users."misskey-${instance.name}".group;
|
||||
WorkingDirectory = "/var/lib/misskey/${instance.name}/work";
|
||||
ExecStart = "${WorkingDirectory}/bin/misskey";
|
||||
CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
|
||||
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
|
||||
@@ -58,100 +49,118 @@ inputs:
|
||||
RuntimeMaxSec = "1d";
|
||||
};
|
||||
};
|
||||
tmpfiles.rules = [ "d /var/lib/misskey/files 0700 misskey misskey" ];
|
||||
};
|
||||
fileSystems =
|
||||
tmpfiles.rules =
|
||||
[ "d /var/lib/misskey/${instance.name}/files 0700 misskey-${instance.name} misskey-${instance.name}" ];
|
||||
})
|
||||
(attrsToList misskey.instances));
|
||||
fileSystems = mkMerge (map
|
||||
(instance:
|
||||
{
|
||||
"/var/lib/misskey/work" =
|
||||
"/var/lib/misskey/${instance.name}/work" =
|
||||
{
|
||||
device = "${inputs.pkgs.localPackages.misskey}";
|
||||
options = [ "bind" "private" "x-gvfs-hide" ];
|
||||
};
|
||||
"/var/lib/misskey/work/files" =
|
||||
"/var/lib/misskey/${instance.name}/work/files" =
|
||||
{
|
||||
device = "/var/lib/misskey/files";
|
||||
device = "/var/lib/misskey/${instance.name}/files";
|
||||
options = [ "bind" "private" "x-gvfs-hide" ];
|
||||
};
|
||||
};
|
||||
sops.templates."misskey/default.yml" =
|
||||
})
|
||||
(attrsToList misskey.instances));
|
||||
sops.templates = listToAttrs (map
|
||||
(instance:
|
||||
{
|
||||
content =
|
||||
let
|
||||
placeholder = inputs.config.sops.placeholder;
|
||||
misskey = inputs.config.nixos.services.misskey;
|
||||
redis = inputs.config.nixos.services.redis.instances.misskey;
|
||||
in
|
||||
''
|
||||
url: https://${misskey.hostname}/
|
||||
port: ${toString misskey.port}
|
||||
db:
|
||||
host: 127.0.0.1
|
||||
port: 5432
|
||||
db: misskey
|
||||
user: misskey
|
||||
pass: ${placeholder."postgresql/misskey"}
|
||||
extra:
|
||||
statement_timeout: 60000
|
||||
dbReplications: false
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: ${toString redis.port}
|
||||
pass: ${placeholder."redis/misskey"}
|
||||
meilisearch:
|
||||
host: 127.0.0.1
|
||||
port: 7700
|
||||
apiKey: ${placeholder."meilisearch/misskey"}
|
||||
ssl: false
|
||||
index: misskey
|
||||
scope: global
|
||||
id: 'aid'
|
||||
proxyBypassHosts:
|
||||
- api.deepl.com
|
||||
- api-free.deepl.com
|
||||
- www.recaptcha.net
|
||||
- hcaptcha.com
|
||||
- challenges.cloudflare.com
|
||||
proxyRemoteFiles: true
|
||||
signToActivityPubGet: true
|
||||
maxFileSize: 1073741824
|
||||
'';
|
||||
owner = inputs.config.users.users.misskey.name;
|
||||
};
|
||||
users =
|
||||
name = "misskey/${instance.name}.yml";
|
||||
value =
|
||||
{
|
||||
content =
|
||||
let
|
||||
placeholder = inputs.config.sops.placeholder;
|
||||
redis = inputs.config.nixos.services.redis.instances."misskey-${instance.name}";
|
||||
meilisearch = inputs.config.nixos.services.meilisearch.instances."misskey-${instance.name}";
|
||||
in
|
||||
''
|
||||
url: https://${instance.value.hostname}/
|
||||
port: ${toString instance.value.port}
|
||||
db:
|
||||
host: 127.0.0.1
|
||||
port: 5432
|
||||
db: misskey_${replaceStrings [ "-" ] [ "_" ] instance.name}
|
||||
user: misskey_${replaceStrings [ "-" ] [ "_" ] instance.name}
|
||||
pass: ${placeholder."postgresql/misskey_${replaceStrings [ "-" ] [ "_" ] instance.name}"}
|
||||
extra:
|
||||
statement_timeout: 60000
|
||||
dbReplications: false
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: ${toString redis.port}
|
||||
pass: ${placeholder."redis/misskey-${instance.name}"}
|
||||
id: 'aid'
|
||||
proxyBypassHosts:
|
||||
- api.deepl.com
|
||||
- api-free.deepl.com
|
||||
- www.recaptcha.net
|
||||
- hcaptcha.com
|
||||
- challenges.cloudflare.com
|
||||
proxyRemoteFiles: true
|
||||
signToActivityPubGet: true
|
||||
maxFileSize: 1073741824
|
||||
''
|
||||
+ (if instance.value.meilisearch.enable then
|
||||
''
|
||||
meilisearch:
|
||||
host: 127.0.0.1
|
||||
port: ${toString meilisearch.port}
|
||||
apiKey: ${placeholder."meilisearch/misskey-${instance.name}"}
|
||||
ssl: false
|
||||
index: misskey
|
||||
scope: globa
|
||||
'' else "");
|
||||
owner = inputs.config.users.users."misskey-${instance.name}".name;
|
||||
};
|
||||
})
|
||||
(attrsToList misskey.instances));
|
||||
users = mkMerge (map
|
||||
(instance:
|
||||
{
|
||||
users.misskey = { isSystemUser = true; group = "misskey"; home = "/var/lib/misskey"; createHome = true; };
|
||||
groups.misskey = {};
|
||||
};
|
||||
nixos.services =
|
||||
{
|
||||
redis.instances.misskey.port = 3545;
|
||||
postgresql = { enable = true; instances.misskey = {}; };
|
||||
meilisearch.instances.misskey = { user = inputs.config.users.users.misskey.name; port = 7700; };
|
||||
};
|
||||
})
|
||||
(mkIf (misskey-proxy != {})
|
||||
users."misskey-${instance.name}" =
|
||||
{
|
||||
isSystemUser = true;
|
||||
group = "misskey-${instance.name}";
|
||||
home = "/var/lib/misskey/${instance.name}";
|
||||
createHome = true;
|
||||
};
|
||||
groups."misskey-${instance.name}" = {};
|
||||
})
|
||||
(attrsToList misskey.instances));
|
||||
nixos.services =
|
||||
{
|
||||
nixos.services.nginx =
|
||||
redis.instances = listToAttrs (map
|
||||
(instance:
|
||||
{
|
||||
name = "misskey-${instance.name}";
|
||||
value.port = instance.value.redis.port;
|
||||
})
|
||||
(attrsToList misskey.instances));
|
||||
postgresql =
|
||||
{
|
||||
enable = true;
|
||||
httpProxy = listToAttrs (map
|
||||
(proxy: with proxy.value;
|
||||
{
|
||||
name = hostname;
|
||||
value =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations."/" =
|
||||
{
|
||||
upstream = if builtins.typeOf upstream == "string" then "http://${upstream}"
|
||||
else "http://${upstream.address}:${toString upstream.port}";
|
||||
websocket = true;
|
||||
setHeaders.Host = hostname;
|
||||
};
|
||||
};
|
||||
})
|
||||
(attrsToList misskey-proxy));
|
||||
instances = listToAttrs (map
|
||||
(instance: { name = "misskey_${replaceStrings [ "-" ] [ "_" ] instance.name}"; value = {}; })
|
||||
(attrsToList misskey.instances));
|
||||
};
|
||||
})
|
||||
];
|
||||
meilisearch.instances = listToAttrs (map
|
||||
(instance:
|
||||
{
|
||||
name = "misskey-${instance.name}";
|
||||
value =
|
||||
{
|
||||
user = inputs.config.users.users."misskey-${instance.name}".name;
|
||||
port = instance.value.meilisearch.port;
|
||||
};
|
||||
})
|
||||
(filter (instance: instance.value.meilisearch.enable) (attrsToList misskey.instances)));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
88
modules/services/nextcloud.nix
Normal file
88
modules/services/nextcloud.nix
Normal file
@@ -0,0 +1,88 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.nextcloud = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
hostname = mkOption { type = types.str; default = "nextcloud.chn.moe"; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services) nextcloud;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (inputs.lib) mkIf mkMerge;
|
||||
inherit (builtins) map listToAttrs toString replaceStrings filter toJSON;
|
||||
in mkIf nextcloud.enable
|
||||
{
|
||||
services.nextcloud =
|
||||
{
|
||||
enable = true;
|
||||
hostName = nextcloud.hostname;
|
||||
appstoreEnable = false;
|
||||
https = true;
|
||||
package = inputs.pkgs.nextcloud27;
|
||||
maxUploadSize = "10G";
|
||||
config =
|
||||
{
|
||||
dbtype = "pgsql";
|
||||
dbpassFile = inputs.config.sops.secrets."nextcloud/postgresql".path;
|
||||
dbport = 5432;
|
||||
adminuser = "admin";
|
||||
adminpassFile = inputs.config.sops.secrets."nextcloud/admin".path;
|
||||
overwriteProtocol = "https";
|
||||
defaultPhoneRegion = "CN";
|
||||
};
|
||||
configureRedis = true;
|
||||
extraOptions =
|
||||
{
|
||||
mail_domain = "chn.moe";
|
||||
mail_from_address = "bot";
|
||||
mail_smtphost = "mail.chn.moe";
|
||||
mail_smtpport = 465;
|
||||
mail_smtpsecure = "ssl";
|
||||
mail_smtpauth = true;
|
||||
mail_smtpname = "bot@chn.moe";
|
||||
};
|
||||
secretFile = inputs.config.sops.templates."nextcloud/secret".path;
|
||||
extraApps =
|
||||
{
|
||||
maps = inputs.pkgs.fetchNextcloudApp
|
||||
{
|
||||
url = "https://github.com/nextcloud/maps/releases/download/v1.1.1/maps-1.1.1.tar.gz";
|
||||
sha256 = "1rcmqnm5364h5gaq1yy6b6d7k17napgn0yc9ymrnn75bps9s71v9";
|
||||
};
|
||||
phonetrack = inputs.pkgs.fetchNextcloudApp
|
||||
{
|
||||
url = "https://github.com/julien-nc/phonetrack/releases/download/v0.7.6/phonetrack-0.7.6.tar.gz";
|
||||
sha256 = "1p15vw7c5c1h08czyxi1r6svjd5hjmnc0i6is4vl3xq2kfjmcyyx";
|
||||
};
|
||||
twofactor_webauthn = inputs.pkgs.fetchNextcloudApp
|
||||
{
|
||||
url = "https://github.com/nextcloud-releases/twofactor_webauthn/releases/download/v1.2.0/twofactor_webauthn-v1.2.0.tar.gz";
|
||||
sha256 = "1lqcw74rsnl8c4sirw9208ra3c8zl8zp93scs7y8fv2n4n60l465";
|
||||
};
|
||||
};
|
||||
};
|
||||
nixos.services =
|
||||
{
|
||||
postgresql = { enable = true; instances.nextcloud = {}; };
|
||||
redis.instances.nextcloud.port = 3499;
|
||||
};
|
||||
sops =
|
||||
{
|
||||
templates."nextcloud/secret" =
|
||||
{
|
||||
content = toJSON
|
||||
{
|
||||
redis.password = inputs.config.sops.placeholder."redis/nextcloud";
|
||||
mail_smtppassword = inputs.config.sops.placeholder."mail/bot";
|
||||
};
|
||||
owner = inputs.config.users.users.nextcloud.name;
|
||||
};
|
||||
secrets =
|
||||
{
|
||||
"nextcloud/postgresql" = { key = "postgresql/nextcloud"; owner = inputs.config.users.users.nextcloud.name; };
|
||||
"nextcloud/admin".owner = inputs.config.users.users.nextcloud.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
12
modules/services/nginx/applications/default.nix
Normal file
12
modules/services/nginx/applications/default.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
inputs:
|
||||
{
|
||||
imports = inputs.localLib.mkModules
|
||||
[
|
||||
./misskey.nix
|
||||
./synapse.nix
|
||||
./vaultwarden.nix
|
||||
./element.nix
|
||||
./photoprism.nix
|
||||
./nextcloud.nix
|
||||
];
|
||||
}
|
||||
41
modules/services/nginx/applications/element.nix
Normal file
41
modules/services/nginx/applications/element.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.nginx.applications.element.instances = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule (submoduleInputs: { options =
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
|
||||
defaultServer = mkOption { type = types.nullOr types.nonEmptyStr; default = "element.chn.moe"; };
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services.nginx.applications.element) instances;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (builtins) map listToAttrs toString;
|
||||
in
|
||||
{
|
||||
nixos.services.nginx.http = listToAttrs (map
|
||||
(instance: with instance.value;
|
||||
{
|
||||
name = hostname;
|
||||
value =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations."/".static.root =
|
||||
if defaultServer == null then toString inputs.pkgs.element-web
|
||||
else toString (inputs.pkgs.element-web.override { conf =
|
||||
{
|
||||
default_server_config."m.homeserver" =
|
||||
{
|
||||
base_url = "https://${defaultServer}";
|
||||
server_name = defaultServer;
|
||||
};
|
||||
disable_guests = false;
|
||||
};});
|
||||
};
|
||||
})
|
||||
(attrsToList instances));
|
||||
};
|
||||
}
|
||||
45
modules/services/nginx/applications/misskey.nix
Normal file
45
modules/services/nginx/applications/misskey.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.nginx.applications.misskey.instances = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule (submoduleInputs: { options =
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
|
||||
upstream = mkOption
|
||||
{
|
||||
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
|
||||
{
|
||||
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 9726; };
|
||||
};})];
|
||||
default = "127.0.0.1:9726";
|
||||
};
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services.nginx.applications.misskey) instances;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (builtins) map listToAttrs toString;
|
||||
in
|
||||
{
|
||||
nixos.services.nginx.http = listToAttrs (map
|
||||
(proxy: with proxy.value;
|
||||
{
|
||||
name = hostname;
|
||||
value =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations."/".proxy =
|
||||
{
|
||||
upstream = if builtins.typeOf upstream == "string" then "http://${upstream}"
|
||||
else "http://${upstream.address}:${toString upstream.port}";
|
||||
websocket = true;
|
||||
setHeaders.Host = hostname;
|
||||
};
|
||||
};
|
||||
})
|
||||
(attrsToList instances));
|
||||
};
|
||||
}
|
||||
48
modules/services/nginx/applications/nextcloud.nix
Normal file
48
modules/services/nginx/applications/nextcloud.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.nginx.applications.nextcloud = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
instance.enable = mkOption
|
||||
{
|
||||
type = types.addCheck types.bool (value: value -> inputs.config.nixos.services.nextcloud.enable);
|
||||
default = false;
|
||||
};
|
||||
proxy =
|
||||
{
|
||||
enable = mkOption
|
||||
{
|
||||
type = types.addCheck types.bool
|
||||
(value: value -> !inputs.config.nixos.services.nginx.applications.nextcloud.instance.enable);
|
||||
default = false;
|
||||
};
|
||||
upstream = mkOption { type = types.nonEmptyStr; };
|
||||
};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services.nginx.applications) nextcloud;
|
||||
inherit (inputs.lib) mkIf mkMerge;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (builtins) map listToAttrs;
|
||||
in mkMerge
|
||||
[
|
||||
(mkIf (nextcloud.instance.enable)
|
||||
{
|
||||
nixos.services.nginx.http.${inputs.config.nixos.services.nextcloud.hostname}.rewriteHttps = true;
|
||||
services.nginx.virtualHosts.${inputs.config.nixos.services.nextcloud.hostname} = mkMerge
|
||||
[
|
||||
(inputs.config.services.nextcloud.nginx.recommendedConfig { upstream = "127.0.0.1"; })
|
||||
{ listen = [ { addr = "0.0.0.0"; port = 8417; ssl = true; extraParameters = [ "proxy_protocol" ]; } ]; }
|
||||
];
|
||||
})
|
||||
(mkIf (nextcloud.proxy.enable)
|
||||
{
|
||||
nixos.services.nginx.streamProxy.map.${inputs.config.nixos.services.nextcloud.hostname} =
|
||||
{
|
||||
upstream = "${nextcloud.proxy.upstream}:8417";
|
||||
rewriteHttps = true;
|
||||
proxyProtocol = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
45
modules/services/nginx/applications/photoprism.nix
Normal file
45
modules/services/nginx/applications/photoprism.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.nginx.applications.photoprism.instances = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule (submoduleInputs: { options =
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
|
||||
upstream = mkOption
|
||||
{
|
||||
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
|
||||
{
|
||||
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 2342; };
|
||||
};})];
|
||||
default = "127.0.0.1:2342";
|
||||
};
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services.nginx.applications.photoprism) instances;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (builtins) map listToAttrs toString;
|
||||
in
|
||||
{
|
||||
nixos.services.nginx.http = listToAttrs (map
|
||||
(proxy: with proxy.value;
|
||||
{
|
||||
name = hostname;
|
||||
value =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations."/".proxy =
|
||||
{
|
||||
upstream = if builtins.typeOf upstream == "string" then "http://${upstream}"
|
||||
else "http://${upstream.address}:${toString upstream.port}";
|
||||
websocket = true;
|
||||
setHeaders.Host = hostname;
|
||||
};
|
||||
};
|
||||
})
|
||||
(attrsToList instances));
|
||||
};
|
||||
}
|
||||
46
modules/services/nginx/applications/synapse.nix
Normal file
46
modules/services/nginx/applications/synapse.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.nginx.applications.synapse.instances = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule (submoduleInputs: { options =
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
|
||||
upstream = mkOption
|
||||
{
|
||||
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
|
||||
{
|
||||
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 8008; };
|
||||
};})];
|
||||
default = "127.0.0.1:8008";
|
||||
};
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services.nginx.applications.synapse) instances;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (inputs.lib) mkIf mkMerge;
|
||||
inherit (builtins) map listToAttrs;
|
||||
in
|
||||
{
|
||||
nixos.services.nginx.http = listToAttrs (map
|
||||
(proxy: with proxy.value;
|
||||
{
|
||||
name = hostname;
|
||||
value =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations."/".proxy =
|
||||
{
|
||||
upstream = if builtins.typeOf upstream == "string" then "http://${upstream}"
|
||||
else "http://${upstream.address}:${toString upstream.port}";
|
||||
websocket = true;
|
||||
setHeaders.Host = hostname;
|
||||
};
|
||||
};
|
||||
})
|
||||
(attrsToList instances));
|
||||
};
|
||||
}
|
||||
44
modules/services/nginx/applications/vaultwarden.nix
Normal file
44
modules/services/nginx/applications/vaultwarden.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.nginx.applications.vaultwarden = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
hostname = mkOption { type = types.nonEmptyStr; default = "vaultwarden.chn.moe"; };
|
||||
upstream = mkOption
|
||||
{
|
||||
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
|
||||
{
|
||||
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 8000; };
|
||||
websocketPort = mkOption { type = types.ints.unsigned; default = 3012; };
|
||||
};})];
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services.nginx.applications) vaultwarden;
|
||||
inherit (builtins) listToAttrs;
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf vaultwarden.enable
|
||||
{
|
||||
nixos.services.nginx.http."${vaultwarden.hostname}" =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations = let upstream = vaultwarden.upstream; in (listToAttrs (map
|
||||
(location: { name = location; value.proxy =
|
||||
{
|
||||
upstream = "http://${upstream.address or upstream}:${builtins.toString upstream.port or 8000}";
|
||||
setHeaders = { Host = vaultwarden.hostname; Connection = ""; };
|
||||
};})
|
||||
[ "/" "/notifications/hub/negotiate" ]))
|
||||
// { "/notifications/hub".proxy =
|
||||
{
|
||||
upstream =
|
||||
"http://${upstream.address or upstream}:${builtins.toString upstream.websocketPort or 3012}";
|
||||
websocket = true;
|
||||
setHeaders.Host = vaultwarden.hostname;
|
||||
};};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
inputs:
|
||||
{
|
||||
imports = inputs.localLib.mkModules
|
||||
[
|
||||
./applications
|
||||
];
|
||||
options.nixos.services.nginx = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
transparentProxy =
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = true; };
|
||||
externalIp = mkOption { type = types.nonEmptyStr; };
|
||||
externalIp = mkOption { type = types.listOf types.nonEmptyStr; };
|
||||
map = mkOption { type = types.attrsOf types.ints.unsigned; default = {};};
|
||||
};
|
||||
httpProxy = mkOption
|
||||
http = mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule { options =
|
||||
{
|
||||
@@ -19,12 +23,31 @@ inputs:
|
||||
detectAuth = mkOption { type = types.bool; default = false; };
|
||||
locations = mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule { options =
|
||||
{
|
||||
upstream = mkOption { type = types.nonEmptyStr; };
|
||||
websocket = mkOption { type = types.bool; default = false; };
|
||||
setHeaders = mkOption { type = types.attrsOf types.str; default = {}; };
|
||||
};});
|
||||
type = types.attrsOf (types.addCheck
|
||||
(types.submodule { options =
|
||||
{
|
||||
proxy = mkOption
|
||||
{
|
||||
type = types.nullOr (types.submodule { options =
|
||||
{
|
||||
upstream = mkOption { type = types.nonEmptyStr; };
|
||||
websocket = mkOption { type = types.bool; default = false; };
|
||||
setHeaders = mkOption { type = types.attrsOf types.str; default = {}; };
|
||||
};});
|
||||
default = null;
|
||||
};
|
||||
static = mkOption
|
||||
{
|
||||
type = types.nullOr (types.submodule { options =
|
||||
{
|
||||
root = mkOption { type = types.nonEmptyStr; };
|
||||
index = mkOption { type = types.nonEmptyStr; default = "index.html"; };
|
||||
};});
|
||||
default = null;
|
||||
};
|
||||
};})
|
||||
(value: (inputs.lib.count (value: value != null) (builtins.attrValues value)) == 1));
|
||||
default = {};
|
||||
};
|
||||
};});
|
||||
default = {};
|
||||
@@ -33,6 +56,7 @@ inputs:
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 5575; };
|
||||
portWithProxyProtocol = mkOption { type = types.ints.unsigned; default = 5576; };
|
||||
map = mkOption
|
||||
{
|
||||
type = types.attrsOf (types.oneOf
|
||||
@@ -42,6 +66,7 @@ inputs:
|
||||
{
|
||||
upstream = mkOption { type = types.nonEmptyStr; };
|
||||
rewriteHttps = mkOption { type = types.bool; default = false; };
|
||||
proxyProtocol = mkOption { type = types.bool; default = false; };
|
||||
};})
|
||||
]);
|
||||
default = {};
|
||||
@@ -97,23 +122,30 @@ inputs:
|
||||
{
|
||||
inherit (location) name;
|
||||
value =
|
||||
{
|
||||
proxyPass = location.value.upstream;
|
||||
proxyWebsockets = location.value.websocket;
|
||||
recommendedProxySettings = false;
|
||||
recommendedProxySettingsNoHost = true;
|
||||
extraConfig = concatStringsSep "\n"
|
||||
(
|
||||
(map
|
||||
(header: ''proxy_set_header ${header.name} "${header.value}";'')
|
||||
(attrsToList location.value.setHeaders))
|
||||
++ (if site.value.detectAuth then ["proxy_hide_header Authorization;"] else [])
|
||||
++ (
|
||||
if site.value.addAuth then
|
||||
["include ${inputs.config.sops.templates."nginx/addAuth/${site.name}-template".path};"]
|
||||
else [])
|
||||
);
|
||||
};
|
||||
if (location.value.proxy != null) then
|
||||
{
|
||||
proxyPass = location.value.proxy.upstream;
|
||||
proxyWebsockets = location.value.proxy.websocket;
|
||||
recommendedProxySettings = false;
|
||||
recommendedProxySettingsNoHost = true;
|
||||
extraConfig = concatStringsSep "\n"
|
||||
(
|
||||
(map
|
||||
(header: ''proxy_set_header ${header.name} "${header.value}";'')
|
||||
(attrsToList location.value.proxy.setHeaders))
|
||||
++ (if site.value.detectAuth then ["proxy_hide_header Authorization;"] else [])
|
||||
++ (
|
||||
if site.value.addAuth then
|
||||
["include ${inputs.config.sops.templates."nginx/addAuth/${site.name}-template".path};"]
|
||||
else [])
|
||||
);
|
||||
}
|
||||
else if (location.value.static != null) then
|
||||
{
|
||||
root = location.value.static.root;
|
||||
index = location.value.static.index;
|
||||
}
|
||||
else {};
|
||||
})
|
||||
(attrsToList site.value.locations));
|
||||
forceSSL = site.value.rewriteHttps;
|
||||
@@ -123,7 +155,7 @@ inputs:
|
||||
else null;
|
||||
};
|
||||
})
|
||||
(attrsToList nginx.httpProxy));
|
||||
(attrsToList nginx.http));
|
||||
recommendedZstdSettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedProxySettings = true;
|
||||
@@ -184,14 +216,14 @@ inputs:
|
||||
owner = inputs.config.users.users.nginx.name;
|
||||
};
|
||||
})
|
||||
(filter (site: site.value.addAuth) (attrsToList nginx.httpProxy)));
|
||||
(filter (site: site.value.addAuth) (attrsToList nginx.http)));
|
||||
secrets = { "nginx/maxmind-license".owner = inputs.config.users.users.nginx.name; }
|
||||
// (listToAttrs (map
|
||||
(site: { name = "nginx/detectAuth/${site.name}"; value.owner = inputs.config.users.users.nginx.name; })
|
||||
(filter (site: site.value.detectAuth) (attrsToList nginx.httpProxy))))
|
||||
(filter (site: site.value.detectAuth) (attrsToList nginx.http))))
|
||||
// (listToAttrs (map
|
||||
(site: { name = "nginx/addAuth/${site.name}"; value = {}; })
|
||||
(filter (site: site.value.addAuth) (attrsToList nginx.httpProxy))));
|
||||
(filter (site: site.value.addAuth) (attrsToList nginx.http))));
|
||||
};
|
||||
systemd.services.nginx.serviceConfig =
|
||||
{
|
||||
@@ -203,11 +235,11 @@ inputs:
|
||||
nixos.services.acme =
|
||||
{
|
||||
enable = true;
|
||||
certs = map (cert: cert.name) (attrsToList nginx.httpProxy);
|
||||
certs = map (cert: cert.name) (attrsToList nginx.http);
|
||||
};
|
||||
security.acme.certs = listToAttrs (map
|
||||
(cert: { inherit (cert) name; value.group = inputs.config.services.nginx.group; })
|
||||
(attrsToList nginx.httpProxy));
|
||||
(attrsToList nginx.http));
|
||||
})
|
||||
(mkIf nginx.transparentProxy.enable
|
||||
{
|
||||
@@ -223,14 +255,14 @@ inputs:
|
||||
(attrsToList nginx.transparentProxy.map)
|
||||
++ (map
|
||||
(site: { name = site.name; value = (if site.value.http2 then 443 else 3065); })
|
||||
(attrsToList nginx.httpProxy)
|
||||
(attrsToList nginx.http)
|
||||
)
|
||||
))}
|
||||
default 127.0.0.1:443;
|
||||
}
|
||||
server
|
||||
{
|
||||
listen ${nginx.transparentProxy.externalIp}:443;
|
||||
${concatStringsSep "\n " (map (ip: "listen ${ip}:443;") nginx.transparentProxy.externalIp)}
|
||||
ssl_preread on;
|
||||
proxy_bind $remote_addr transparent;
|
||||
proxy_pass $transparent_proxy_backend;
|
||||
@@ -316,6 +348,17 @@ inputs:
|
||||
proxy_buffer_size 128k;
|
||||
access_log syslog:server=unix:/dev/log stream_proxy;
|
||||
}
|
||||
server
|
||||
{
|
||||
listen 127.0.0.1:${toString nginx.streamProxy.portWithProxyProtocol};
|
||||
proxy_protocol on;
|
||||
ssl_preread on;
|
||||
proxy_pass $stream_proxy_backend;
|
||||
proxy_connect_timeout 10s;
|
||||
proxy_socket_keepalive on;
|
||||
proxy_buffer_size 128k;
|
||||
access_log syslog:server=unix:/dev/log stream_proxy;
|
||||
}
|
||||
'';
|
||||
virtualHosts = listToAttrs (map
|
||||
(site:
|
||||
@@ -330,9 +373,15 @@ inputs:
|
||||
})
|
||||
(filter (site: site.value.rewriteHttps or false) (attrsToList nginx.streamProxy.map)));
|
||||
};
|
||||
nixos.services.nginx.transparentProxy.map = listToAttrs (map
|
||||
(site: { name = site.name; value = nginx.streamProxy.port; })
|
||||
(attrsToList nginx.streamProxy.map));
|
||||
nixos.services.nginx.transparentProxy.map = listToAttrs
|
||||
(
|
||||
(map
|
||||
(site: { name = site.name; value = nginx.streamProxy.port; })
|
||||
(filter (site: !(site.value.proxyProtocol or false)) (attrsToList nginx.streamProxy.map)))
|
||||
++ (map
|
||||
(site: { name = site.name; value = nginx.streamProxy.portWithProxyProtocol; })
|
||||
(filter (site: site.value.proxyProtocol or false) (attrsToList nginx.streamProxy.map)))
|
||||
);
|
||||
})
|
||||
];
|
||||
}
|
||||
47
modules/services/photoprism.nix
Normal file
47
modules/services/photoprism.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.photoprism = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
hostname = mkOption { type = types.str; default = "photoprism.chn.moe"; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 2342; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
inherit (inputs.config.nixos.services) photoprism;
|
||||
in mkIf photoprism.enable
|
||||
{
|
||||
services.photoprism =
|
||||
{
|
||||
enable = true;
|
||||
originalsPath = inputs.config.services.photoprism.storagePath + "/originals";
|
||||
settings =
|
||||
{
|
||||
PHOTOPRISM_SITE_URL = "https://${photoprism.hostname}";
|
||||
PHOTOPRISM_HTTP_PORT = "${toString photoprism.port}";
|
||||
PHOTOPRISM_DISABLE_TLS = "true";
|
||||
PHOTOPRISM_DETECT_NSFW = "true";
|
||||
PHOTOPRISM_UPLOAD_NSFW = "true";
|
||||
PHOTOPRISM_DATABASE_DRIVER = "mysql";
|
||||
PHOTOPRISM_DATABASE_SERVER = "127.0.0.1:3306";
|
||||
};
|
||||
};
|
||||
systemd.services.photoprism =
|
||||
{
|
||||
after = [ "mariadb.service" ];
|
||||
requires = [ "mariadb.service" ];
|
||||
serviceConfig.EnvironmentFile = inputs.config.sops.templates."photoprism/env".path;
|
||||
};
|
||||
sops =
|
||||
{
|
||||
templates."photoprism/env".content = let placeholder = inputs.config.sops.placeholder; in
|
||||
''
|
||||
PHOTOPRISM_ADMIN_PASSWORD=${placeholder."photoprism/adminPassword"}
|
||||
PHOTOPRISM_DATABASE_PASSWORD=${placeholder."mariadb/photoprism"}
|
||||
'';
|
||||
secrets."photoprism/adminPassword" = {};
|
||||
};
|
||||
nixos.services.mariadb = { enable = true; instances.photoprism = {}; };
|
||||
};
|
||||
}
|
||||
@@ -17,8 +17,8 @@ inputs:
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services) postgresql;
|
||||
inherit (inputs.lib) mkMerge mkAfter concatStringsSep mkIf;
|
||||
inherit (inputs.localLib) stripeTabs attrsToList;
|
||||
inherit (inputs.lib) mkAfter concatStringsSep mkIf;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (builtins) map listToAttrs filter;
|
||||
in mkIf postgresql.enable
|
||||
{
|
||||
|
||||
@@ -60,10 +60,10 @@ inputs:
|
||||
nginx =
|
||||
{
|
||||
enable = true;
|
||||
httpProxy.${rsshub.hostname} =
|
||||
http.${rsshub.hostname} =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations."/" =
|
||||
locations."/".proxy =
|
||||
{ upstream = "http://127.0.0.1:${toString rsshub.port}"; setHeaders.Host = rsshub.hostname; };
|
||||
};
|
||||
};
|
||||
|
||||
37
modules/services/snapper.nix
Normal file
37
modules/services/snapper.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services.snapper = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
configs = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkMerge mkIf;
|
||||
inherit (inputs.localLib) stripeTabs attrsToList;
|
||||
inherit (inputs.config.nixos) services;
|
||||
inherit (builtins) map listToAttrs toString;
|
||||
in mkIf services.snapper.enable
|
||||
{
|
||||
services.snapper.configs =
|
||||
let
|
||||
f = (config:
|
||||
{
|
||||
inherit (config) name;
|
||||
value =
|
||||
{
|
||||
SUBVOLUME = config.value;
|
||||
TIMELINE_CREATE = true;
|
||||
TIMELINE_CLEANUP = true;
|
||||
TIMELINE_MIN_AGE = 1800;
|
||||
TIMELINE_LIMIT_HOURLY = "10";
|
||||
TIMELINE_LIMIT_DAILY = "7";
|
||||
TIMELINE_LIMIT_WEEKLY = "1";
|
||||
TIMELINE_LIMIT_MONTHLY = "0";
|
||||
TIMELINE_LIMIT_YEARLY = "0";
|
||||
};
|
||||
});
|
||||
in
|
||||
listToAttrs (map f (attrsToList services.snapper.configs));
|
||||
};
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git a/snapper/FileUtils.cc b/snapper/FileUtils.cc
|
||||
index 9da572f..48f60fa 100644
|
||||
--- a/snapper/FileUtils.cc
|
||||
+++ b/snapper/FileUtils.cc
|
||||
@@ -424,7 +424,7 @@ namespace snapper
|
||||
v /= 62;
|
||||
}
|
||||
|
||||
- int fd = open(name, O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, S_IRUSR | S_IWUSR);
|
||||
+ int fd = open(name, O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
if (fd >= 0)
|
||||
return fd;
|
||||
else if (errno != EEXIST)
|
||||
@@ -1 +0,0 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDV9egbTbIbVCV4TNr6IgvXw7fMEK4v/WKAHddkX4uvysL7l+H1cLM0TRDvGefUFoU7eYcEIRV9lwvjMo/xy0GKao76fylQ03gkrzTiPvztThpAfKKOIniXvzWoIP7/fzNwuW6GgUiM4JKvgJEieRTybclLRgauy2gqiwVZMAFksxG1fAPYGXIrhtVQ+WjN+0IIiayNlj1J6tJ9fQWc+BkNsoJJZBADf+qjTsqsVHjcABoo2vYRTYnSVzrsnjSu6ivGjSY0ImG+ASPqyluA7eSXe4XQkyxjuyBVTwwqTpZ0Y+DMESr/Fd5rQ3N/iylLcUVGexl7gHHFtJGiERloG8Bv Public key for Digital Signature
|
||||
@@ -17,19 +17,11 @@ inputs:
|
||||
settings =
|
||||
{
|
||||
X11Forwarding = true;
|
||||
TrustedUserCAKeys = "${./ssh-ca.pub}";
|
||||
ChallengeResponseAuthentication = false;
|
||||
PasswordAuthentication = sshd.passwordAuthentication;
|
||||
KbdInteractiveAuthentication = false;
|
||||
UsePAM = true;
|
||||
};
|
||||
extraConfig =
|
||||
''
|
||||
Match User root
|
||||
PasswordAuthentication no
|
||||
Match User chn
|
||||
PasswordAuthentication no
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,150 +1,102 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services = let inherit (inputs.lib) mkOption types; in
|
||||
options.nixos.services.synapse = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
synapse =
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
autoStart = mkOption { type = types.bool; default = true; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 8008; };
|
||||
hostname = mkOption { type = types.str; default = "synapse.chn.moe"; };
|
||||
};
|
||||
synapse-proxy = mkOption
|
||||
{
|
||||
type = types.attrsOf (types.submodule (submoduleInputs: { options =
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
|
||||
upstream = mkOption
|
||||
{
|
||||
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
|
||||
{
|
||||
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 8008; };
|
||||
};})];
|
||||
default = "127.0.0.1:8008";
|
||||
};
|
||||
};}));
|
||||
default = {};
|
||||
};
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
autoStart = mkOption { type = types.bool; default = true; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 8008; };
|
||||
hostname = mkOption { type = types.str; default = "synapse.chn.moe"; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services) synapse synapse-proxy;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
inherit (inputs.lib) mkIf mkMerge;
|
||||
inherit (inputs.config.nixos.services) synapse;
|
||||
inherit (inputs.lib) mkIf;
|
||||
inherit (builtins) map listToAttrs;
|
||||
in mkMerge
|
||||
[
|
||||
(mkIf synapse.enable
|
||||
in mkIf synapse.enable
|
||||
{
|
||||
services.matrix-synapse =
|
||||
{
|
||||
services.matrix-synapse =
|
||||
enable = true;
|
||||
settings =
|
||||
{
|
||||
enable = true;
|
||||
settings =
|
||||
server_name = synapse.hostname;
|
||||
listeners =
|
||||
[{
|
||||
bind_addresses = [ "0.0.0.0" ];
|
||||
port = 8008;
|
||||
resources = [{ names = [ "client" "federation" ]; compress = false; }];
|
||||
tls = false;
|
||||
type = "http";
|
||||
x_forwarded = true;
|
||||
}];
|
||||
database.name = "psycopg2";
|
||||
admin_contact = "mailto:chn@chn.moe";
|
||||
enable_registration = true;
|
||||
registrations_require_3pid = [ "email" ];
|
||||
turn_uris = [ "turns:coturn.chn.moe" "turn:coturn.chn.moe" ];
|
||||
max_upload_size = "1024M";
|
||||
web_client_location = "https://element.chn.moe/";
|
||||
serve_server_wellknown = true;
|
||||
report_stats = true;
|
||||
trusted_key_servers = [{ server_name = "matrix.org"; }];
|
||||
suppress_key_server_warning = true;
|
||||
log_config = (inputs.pkgs.formats.yaml {}).generate "log.yaml"
|
||||
{
|
||||
server_name = synapse.hostname;
|
||||
listeners =
|
||||
[{
|
||||
bind_addresses = [ "0.0.0.0" ];
|
||||
port = 8008;
|
||||
resources = [{ names = [ "client" "federation" ]; compress = false; }];
|
||||
tls = false;
|
||||
type = "http";
|
||||
x_forwarded = true;
|
||||
}];
|
||||
database.name = "psycopg2";
|
||||
admin_contact = "mailto:chn@chn.moe";
|
||||
enable_registration = true;
|
||||
registrations_require_3pid = [ "email" ];
|
||||
turn_uris = [ "turns:coturn.chn.moe" "turn:coturn.chn.moe" ];
|
||||
max_upload_size = "1024M";
|
||||
web_client_location = "https://element.chn.moe/";
|
||||
serve_server_wellknown = true;
|
||||
report_stats = true;
|
||||
trusted_key_servers = [{ server_name = "matrix.org"; }];
|
||||
suppress_key_server_warning = true;
|
||||
log_config = (inputs.pkgs.formats.yaml {}).generate "log.yaml"
|
||||
version = 1;
|
||||
formatters.precise.format =
|
||||
"%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s";
|
||||
handlers.console = { class = "logging.StreamHandler"; formatter = "precise"; };
|
||||
root = { level = "INFO"; handlers = [ "console" ]; };
|
||||
disable_existing_loggers = true;
|
||||
};
|
||||
};
|
||||
extraConfigFiles = [ inputs.config.sops.templates."synapse/password.yaml".path ];
|
||||
};
|
||||
sops =
|
||||
{
|
||||
templates."synapse/password.yaml" =
|
||||
{
|
||||
owner = inputs.config.systemd.services.matrix-synapse.serviceConfig.User;
|
||||
group = inputs.config.systemd.services.matrix-synapse.serviceConfig.Group;
|
||||
content = builtins.readFile ((inputs.pkgs.formats.yaml {}).generate "password.yaml"
|
||||
{
|
||||
database =
|
||||
{
|
||||
version = 1;
|
||||
formatters.precise.format =
|
||||
"%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s";
|
||||
handlers.console = { class = "logging.StreamHandler"; formatter = "precise"; };
|
||||
root = { level = "INFO"; handlers = [ "console" ]; };
|
||||
disable_existing_loggers = true;
|
||||
name = "psycopg2";
|
||||
args =
|
||||
{
|
||||
user = "synapse";
|
||||
password = inputs.config.sops.placeholder."postgresql/synapse";
|
||||
database = "synapse";
|
||||
host = "127.0.0.1";
|
||||
port = "5432";
|
||||
};
|
||||
allow_unsafe_locale = true;
|
||||
};
|
||||
};
|
||||
extraConfigFiles = [ inputs.config.sops.templates."synapse/password.yaml".path ];
|
||||
};
|
||||
sops =
|
||||
{
|
||||
templates."synapse/password.yaml" =
|
||||
{
|
||||
owner = inputs.config.systemd.services.matrix-synapse.serviceConfig.User;
|
||||
group = inputs.config.systemd.services.matrix-synapse.serviceConfig.Group;
|
||||
content = builtins.readFile ((inputs.pkgs.formats.yaml {}).generate "password.yaml"
|
||||
turn_shared_secret = inputs.config.sops.placeholder."synapse/coturn";
|
||||
registration_shared_secret = inputs.config.sops.placeholder."synapse/registration";
|
||||
macaroon_secret_key = inputs.config.sops.placeholder."synapse/macaroon";
|
||||
form_secret = inputs.config.sops.placeholder."synapse/form";
|
||||
signing_key_path = inputs.config.sops.secrets."synapse/signing-key".path;
|
||||
email =
|
||||
{
|
||||
database =
|
||||
{
|
||||
name = "psycopg2";
|
||||
args =
|
||||
{
|
||||
user = "synapse";
|
||||
password = inputs.config.sops.placeholder."postgresql/synapse";
|
||||
database = "synapse";
|
||||
host = "127.0.0.1";
|
||||
port = "5432";
|
||||
};
|
||||
allow_unsafe_locale = true;
|
||||
};
|
||||
turn_shared_secret = inputs.config.sops.placeholder."synapse/coturn";
|
||||
registration_shared_secret = inputs.config.sops.placeholder."synapse/registration";
|
||||
macaroon_secret_key = inputs.config.sops.placeholder."synapse/macaroon";
|
||||
form_secret = inputs.config.sops.placeholder."synapse/form";
|
||||
signing_key_path = inputs.config.sops.secrets."synapse/signing-key".path;
|
||||
email =
|
||||
{
|
||||
smtp_host = "mail.chn.moe";
|
||||
smtp_port = 25;
|
||||
smtp_user = "bot@chn.moe";
|
||||
smtp_pass = inputs.config.sops.placeholder."mail/bot";
|
||||
require_transport_security = true;
|
||||
notif_from = "Your Friendly %(app)s homeserver <bot@chn.moe>";
|
||||
app_name = "Haonan Chen's synapse";
|
||||
};
|
||||
});
|
||||
};
|
||||
secrets = (listToAttrs (map
|
||||
(secret: { name = "synapse/${secret}"; value = {}; })
|
||||
[ "coturn" "registration" "macaroon" "form" ]))
|
||||
// { "synapse/signing-key".owner = inputs.config.systemd.services.matrix-synapse.serviceConfig.User; }
|
||||
// { "mail/bot" = {}; };
|
||||
smtp_host = "mail.chn.moe";
|
||||
smtp_port = 25;
|
||||
smtp_user = "bot@chn.moe";
|
||||
smtp_pass = inputs.config.sops.placeholder."mail/bot";
|
||||
require_transport_security = true;
|
||||
notif_from = "Your Friendly %(app)s homeserver <bot@chn.moe>";
|
||||
app_name = "Haonan Chen's synapse";
|
||||
};
|
||||
});
|
||||
};
|
||||
nixos.services.postgresql = { enable = true; instances.synapse = {}; };
|
||||
systemd.services.matrix-synapse.enable = synapse.autoStart;
|
||||
})
|
||||
(mkIf (synapse-proxy != {})
|
||||
{
|
||||
nixos.services.nginx =
|
||||
{
|
||||
enable = true;
|
||||
httpProxy = listToAttrs (map
|
||||
(proxy: with proxy.value;
|
||||
{
|
||||
name = hostname;
|
||||
value =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations."/" =
|
||||
{
|
||||
upstream = if builtins.typeOf upstream == "string" then "http://${upstream}"
|
||||
else "http://${upstream.address}:${toString upstream.port}";
|
||||
websocket = true;
|
||||
setHeaders.Host = hostname;
|
||||
};
|
||||
};
|
||||
})
|
||||
(attrsToList synapse-proxy));
|
||||
};
|
||||
})
|
||||
];
|
||||
secrets = (listToAttrs (map
|
||||
(secret: { name = "synapse/${secret}"; value = {}; })
|
||||
[ "coturn" "registration" "macaroon" "form" ]))
|
||||
// { "synapse/signing-key".owner = inputs.config.systemd.services.matrix-synapse.serviceConfig.User; }
|
||||
// { "mail/bot" = {}; };
|
||||
};
|
||||
nixos.services.postgresql = { enable = true; instances.synapse = {}; };
|
||||
systemd.services.matrix-synapse.enable = synapse.autoStart;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,117 +1,67 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.services = let inherit (inputs.lib) mkOption types; in
|
||||
options.nixos.services.vaultwarden = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
vaultwarden =
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
autoStart = mkOption { type = types.bool; default = true; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 8000; };
|
||||
websocketPort = mkOption { type = types.ints.unsigned; default = 3012; };
|
||||
hostname = mkOption { type = types.str; default = "vaultwarden.chn.moe"; };
|
||||
};
|
||||
vaultwarden-proxy =
|
||||
{
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
hostname = mkOption { type = types.nonEmptyStr; default = "vaultwarden.chn.moe"; };
|
||||
upstream = mkOption
|
||||
{
|
||||
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
|
||||
{
|
||||
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 8000; };
|
||||
websocketPort = mkOption { type = types.ints.unsigned; default = 3012; };
|
||||
};})];
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
enable = mkOption { type = types.bool; default = false; };
|
||||
autoStart = mkOption { type = types.bool; default = true; };
|
||||
port = mkOption { type = types.ints.unsigned; default = 8000; };
|
||||
websocketPort = mkOption { type = types.ints.unsigned; default = 3012; };
|
||||
hostname = mkOption { type = types.str; default = "vaultwarden.chn.moe"; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (inputs.config.nixos.services) vaultwarden vaultwarden-proxy;
|
||||
inherit (inputs.config.nixos.services) vaultwarden;
|
||||
inherit (builtins) listToAttrs;
|
||||
inherit (inputs.lib) mkIf mkMerge;
|
||||
in mkMerge
|
||||
[
|
||||
(
|
||||
mkIf vaultwarden.enable
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf vaultwarden.enable
|
||||
{
|
||||
services.vaultwarden =
|
||||
{
|
||||
enable = true;
|
||||
dbBackend = "postgresql";
|
||||
config =
|
||||
{
|
||||
services.vaultwarden =
|
||||
DATA_FOLDER = "/var/lib/vaultwarden";
|
||||
WEB_VAULT_ENABLED = true;
|
||||
WEBSOCKET_ENABLED = true;
|
||||
ROCKET_PORT = vaultwarden.port;
|
||||
WEBSOCKET_PORT = toString vaultwarden.websocketPort;
|
||||
SIGNUPS_VERIFY = true;
|
||||
DOMAIN = "https://${vaultwarden.hostname}";
|
||||
SMTP_HOST = "mail.chn.moe";
|
||||
SMTP_FROM = "bot@chn.moe";
|
||||
SMTP_FROM_NAME = "vaultwarden";
|
||||
SMTP_SECURITY = "force_tls";
|
||||
SMTP_USERNAME = "bot@chn.moe";
|
||||
};
|
||||
environmentFile = inputs.config.sops.templates."vaultwarden.env".path;
|
||||
};
|
||||
sops =
|
||||
{
|
||||
templates."vaultwarden.env" =
|
||||
let
|
||||
serviceConfig = inputs.config.systemd.services.vaultwarden.serviceConfig;
|
||||
placeholder = inputs.config.sops.placeholder;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
dbBackend = "postgresql";
|
||||
config =
|
||||
{
|
||||
DATA_FOLDER = "/var/lib/vaultwarden";
|
||||
WEB_VAULT_ENABLED = true;
|
||||
WEBSOCKET_ENABLED = true;
|
||||
ROCKET_PORT = vaultwarden.port;
|
||||
WEBSOCKET_PORT = toString vaultwarden.websocketPort;
|
||||
SIGNUPS_VERIFY = true;
|
||||
DOMAIN = "https://${vaultwarden.hostname}";
|
||||
SMTP_HOST = "mail.chn.moe";
|
||||
SMTP_FROM = "bot@chn.moe";
|
||||
SMTP_FROM_NAME = "vaultwarden";
|
||||
SMTP_SECURITY = "force_tls";
|
||||
SMTP_USERNAME = "bot@chn.moe";
|
||||
};
|
||||
environmentFile = inputs.config.sops.templates."vaultwarden.env".path;
|
||||
owner = serviceConfig.User;
|
||||
group = serviceConfig.Group;
|
||||
content =
|
||||
''
|
||||
DATABASE_URL=postgresql://vaultwarden:${placeholder."postgresql/vaultwarden"}@localhost/vaultwarden
|
||||
ADMIN_TOKEN=${placeholder."vaultwarden/admin_token"}
|
||||
SMTP_PASSWORD=${placeholder."mail/bot"}
|
||||
'';
|
||||
};
|
||||
sops =
|
||||
{
|
||||
templates."vaultwarden.env" =
|
||||
let
|
||||
serviceConfig = inputs.config.systemd.services.vaultwarden.serviceConfig;
|
||||
placeholder = inputs.config.sops.placeholder;
|
||||
in
|
||||
{
|
||||
owner = serviceConfig.User;
|
||||
group = serviceConfig.Group;
|
||||
content =
|
||||
''
|
||||
DATABASE_URL=postgresql://vaultwarden:${placeholder."postgresql/vaultwarden"}@localhost/vaultwarden
|
||||
ADMIN_TOKEN=${placeholder."vaultwarden/admin_token"}
|
||||
SMTP_PASSWORD=${placeholder."mail/bot"}
|
||||
'';
|
||||
};
|
||||
secrets = listToAttrs (map
|
||||
(secret: { name = secret; value = {}; })
|
||||
[ "vaultwarden/admin_token" "mail/bot" ]);
|
||||
};
|
||||
systemd.services.vaultwarden =
|
||||
{
|
||||
enable = vaultwarden.autoStart;
|
||||
after = [ "postgresql.service" ];
|
||||
};
|
||||
nixos.services.postgresql = { enable = true; instances.vaultwarden = {}; };
|
||||
}
|
||||
)
|
||||
(
|
||||
mkIf vaultwarden-proxy.enable
|
||||
{
|
||||
nixos.services.nginx =
|
||||
{
|
||||
enable = true;
|
||||
httpProxy."${vaultwarden-proxy.hostname}" =
|
||||
{
|
||||
rewriteHttps = true;
|
||||
locations = let upstream = vaultwarden-proxy.upstream; in (listToAttrs (map
|
||||
(location: { name = location; value =
|
||||
{
|
||||
upstream = "http://${upstream.address or upstream}:${builtins.toString upstream.port or 8000}";
|
||||
setHeaders = { Host = vaultwarden-proxy.hostname; Connection = ""; };
|
||||
};})
|
||||
[ "/" "/notifications/hub/negotiate" ]))
|
||||
// { "/notifications/hub" =
|
||||
{
|
||||
upstream =
|
||||
"http://${upstream.address or upstream}:${builtins.toString upstream.websocketPort or 3012}";
|
||||
websocket = true;
|
||||
setHeaders.Host = vaultwarden-proxy.hostname;
|
||||
};};
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
secrets = listToAttrs (map
|
||||
(secret: { name = secret; value = {}; })
|
||||
[ "vaultwarden/admin_token" "mail/bot" ]);
|
||||
};
|
||||
systemd.services.vaultwarden =
|
||||
{
|
||||
enable = vaultwarden.autoStart;
|
||||
after = [ "postgresql.service" ];
|
||||
};
|
||||
nixos.services.postgresql = { enable = true; instances.vaultwarden = {}; };
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ inputs:
|
||||
imports = inputs.localLib.mkModules
|
||||
[
|
||||
./nix.nix
|
||||
./fileSystems.nix
|
||||
./fileSystems
|
||||
./grub.nix
|
||||
./initrd.nix
|
||||
./kernel.nix
|
||||
@@ -66,5 +66,6 @@ inputs:
|
||||
# environment.variables.CPATH = "/run/current-system/sw/include";
|
||||
# environment.variables.LIBRARY_PATH = "/run/current-system/sw/lib";
|
||||
virtualisation.oci-containers.backend = "docker";
|
||||
home-manager.sharedModules = [{ home.stateVersion = "22.11"; }];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -39,6 +39,11 @@ inputs:
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
keyFile = mkOption
|
||||
{
|
||||
type = types.path;
|
||||
default = ./. + "/${inputs.config.nixos.system.networking.hostname}.key";
|
||||
};
|
||||
delayedMount = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
|
||||
};
|
||||
};
|
||||
@@ -236,7 +241,9 @@ inputs:
|
||||
mount ${device} /mnt -m
|
||||
if [ -f /mnt${path}/current/.timestamp ]
|
||||
then
|
||||
mv /mnt${path}/current /mnt${path}/$(cat /mnt${path}/current/.timestamp)
|
||||
timestamp=$(cat /mnt${path}/current/.timestamp)
|
||||
mv /mnt${path}/current /mnt${path}/$timestamp
|
||||
btrfs property set -ts /mnt${path}/$timestamp ro true
|
||||
fi
|
||||
btrfs subvolume create /mnt${path}/current
|
||||
echo $(date '+%Y%m%d%H%M%S') > /mnt${path}/current/.timestamp
|
||||
BIN
modules/system/fileSystems/nas.key
Normal file
BIN
modules/system/fileSystems/nas.key
Normal file
Binary file not shown.
BIN
modules/system/fileSystems/vps6.key
Normal file
BIN
modules/system/fileSystems/vps6.key
Normal file
Binary file not shown.
BIN
modules/system/fileSystems/vps7.key
Normal file
BIN
modules/system/fileSystems/vps7.key
Normal file
Binary file not shown.
@@ -41,10 +41,20 @@ inputs:
|
||||
"${impermanence.root}" =
|
||||
{
|
||||
hideMounts = true;
|
||||
directories = []
|
||||
directories = [ "/var/lib/systemd/linger" ]
|
||||
++ (if inputs.config.services.xserver.displayManager.sddm.enable then
|
||||
[{ directory = "/var/lib/sddm"; user = "sddm"; group = "sddm"; mode = "0700"; }] else []);
|
||||
};
|
||||
}
|
||||
// (if builtins.elem "chn" inputs.config.nixos.users.users then
|
||||
{
|
||||
users.chn =
|
||||
{
|
||||
directories =
|
||||
[
|
||||
".cache"
|
||||
];
|
||||
};
|
||||
} else {});
|
||||
"${impermanence.nodatacow}" =
|
||||
{
|
||||
hideMounts = true;
|
||||
@@ -54,7 +64,17 @@ inputs:
|
||||
[{ directory = "/var/lib/postgresql"; user = user.name; group = user.group; mode = "0750"; }]
|
||||
else []
|
||||
)
|
||||
++ (if inputs.config.nixos.services.meilisearch.instances != {} then [ "/var/lib/meilisearch" ] else []);
|
||||
++ (if inputs.config.nixos.services.meilisearch.instances != {} then [ "/var/lib/meilisearch" ] else [])
|
||||
++ (
|
||||
if inputs.config.nixos.virtualization.kvmHost.enable then
|
||||
[{ directory = "/var/lib/libvirt/images"; mode = "0711"; }]
|
||||
else []
|
||||
)
|
||||
++ (
|
||||
if inputs.config.nixos.services.mariadb.enable then let user = inputs.config.users.users.mysql; in
|
||||
[{ directory = "/var/lib/mysql"; user = user.name; group = user.group; mode = "0750"; }]
|
||||
else []
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -25,22 +25,13 @@ inputs:
|
||||
"ahci" "ata_piix" "bfq" "failover" "net_failover" "nls_cp437" "nls_iso8859-1" "nvme" "sdhci_acpi" "sd_mod"
|
||||
"sr_mod" "usbcore" "usbhid" "usbip-core" "usb-common" "usb_storage" "vhci-hcd" "virtio" "virtio_blk"
|
||||
"virtio_net" "virtio_pci" "xhci_pci" "virtio_ring" "virtio_scsi" "cryptd" "crypto_simd" "libaes"
|
||||
# networking for nas
|
||||
"igb"
|
||||
] ++ kernel.modules.initrd;
|
||||
extraModulePackages = (with inputs.config.boot.kernelPackages; [ v4l2loopback ]) ++ kernel.modules.install;
|
||||
extraModprobeConfig = builtins.concatStringsSep "\n" kernel.modules.modprobeConfig;
|
||||
kernelParams = [ "delayacct" "acpi_osi=Linux" ];
|
||||
kernelPackages = inputs.pkgs.linuxPackagesFor (inputs.pkgs.linuxPackages_xanmod.kernel.override rec
|
||||
{
|
||||
src = inputs.pkgs.fetchFromGitHub
|
||||
{
|
||||
owner = "xanmod";
|
||||
repo = "linux";
|
||||
rev = modDirVersion;
|
||||
hash = "sha256-EugTfBbeH9VTpIg1aDNfaY57NDCA70QIdsOfzxWMSeA=";
|
||||
};
|
||||
version = "6.4.14";
|
||||
modDirVersion = "6.4.14-xanmod1";
|
||||
});
|
||||
kernelPackages = inputs.pkgs.linuxPackages_xanmod_latest;
|
||||
kernelPatches =
|
||||
let
|
||||
patches =
|
||||
|
||||
@@ -49,5 +49,10 @@ inputs:
|
||||
secrets."nebula/key" = {};
|
||||
};
|
||||
networking.firewall.trustedInterfaces = [ "nebula.nebula" ];
|
||||
systemd.services."nebula@nebula" =
|
||||
{
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig.Restart = "always";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ inputs:
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
keep-outputs = nix.keepOutputs;
|
||||
keep-failed = true;
|
||||
auto-optimise-store = true;
|
||||
substituters = if nix.substituters == null then [ "https://cache.nixos.org/" ] else nix.substituters;
|
||||
trusted-public-keys = [ "chn:Cc+nowW1LIpe1kyXOZmNaznFDiH1glXmpb4A+WD/DTE=" ];
|
||||
show-trace = true;
|
||||
|
||||
@@ -33,6 +33,7 @@ inputs:
|
||||
(
|
||||
mkConditional (nixpkgs.march != null)
|
||||
{
|
||||
programs.ccache.enable = true;
|
||||
nixpkgs =
|
||||
{
|
||||
hostPlatform = { system = "x86_64-linux"; gcc = { arch = nixpkgs.march; tune = nixpkgs.march; }; };
|
||||
|
||||
@@ -25,13 +25,6 @@ inputs:
|
||||
"es256"
|
||||
"+presence"
|
||||
])
|
||||
(builtins.concatStringsSep ","
|
||||
[
|
||||
"WgLCnlQcGP4uVHI8OZrJWoLK6ezHtl404NVGsfH2LXsq0TNVZ7l2OidGpbYqIJwTn5yKu6t0MI7KdHYD18T/HA=="
|
||||
"GVPuwp38yb+A1Uur22hywW7mQJPOxuLXXKLlM9FU2bvVhpwdjWDvg+BB5YFAL9NjTW22V7Hy/a9UuSmZejs7dw=="
|
||||
"es256"
|
||||
"+presence"
|
||||
])
|
||||
])
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -1,26 +1,33 @@
|
||||
inputs:
|
||||
let
|
||||
inherit (builtins) map attrNames;
|
||||
inherit (inputs.lib) mkMerge mkIf mkOption types;
|
||||
users =
|
||||
allUsers =
|
||||
{
|
||||
root =
|
||||
{
|
||||
users.users.root =
|
||||
{
|
||||
shell = inputs.pkgs.zsh;
|
||||
autoSubUidGidRange = true;
|
||||
hashedPassword = "$y$j9T$.UyKKvDnmlJaYZAh6./rf/$65dRqishAiqxCE6LEMjqruwJPZte7uiyYLVKpzdZNH5";
|
||||
openssh.authorizedKeys.keys =
|
||||
[
|
||||
("sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIPLByi05vCA95EfpgrCIXzkuyUWsyh"
|
||||
+ "+Vso8FsUNFwPXFAAAABHNzaDo= chn@chn.moe")
|
||||
(builtins.concatStringsSep ""
|
||||
[
|
||||
"sk-ssh-ed25519@openssh.com "
|
||||
"AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEU/JPpLxsk8UWXiZr8CPNG+4WKFB92o1Ep9OEstmPLzAAAABHNzaDo= "
|
||||
"chn@pc"
|
||||
])
|
||||
];
|
||||
};
|
||||
home-manager.users.root.programs.git =
|
||||
home-manager.users.root =
|
||||
{
|
||||
extraConfig.core.editor = inputs.lib.mkForce "vim";
|
||||
userName = "chn";
|
||||
userEmail = "chn@chn.moe";
|
||||
imports = inputs.config.nixos.users.sharedModules;
|
||||
config.programs.git =
|
||||
{
|
||||
extraConfig.core.editor = inputs.lib.mkForce "vim";
|
||||
userName = "chn";
|
||||
userEmail = "chn@chn.moe";
|
||||
};
|
||||
};
|
||||
};
|
||||
chn =
|
||||
@@ -36,87 +43,144 @@ inputs:
|
||||
hashedPassword = "$y$j9T$xJwVBoGENJEDSesJ0LfkU1$VEExaw7UZtFyB4VY1yirJvl7qS7oiF49KbEBrV0.hhC";
|
||||
openssh.authorizedKeys.keys =
|
||||
[
|
||||
# ykman fido credentials list
|
||||
# ykman fido credentials delete f2c1ca2d
|
||||
# ssh-keygen -t ed25519-sk -O resident
|
||||
# ssh-keygen -K
|
||||
(builtins.concatStringsSep ""
|
||||
[
|
||||
"sk-ssh-ed25519@openssh.com "
|
||||
"AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIPLByi05vCA95EfpgrCIXzkuyUWsyh+Vso8FsUNFwPXFAAAABHNzaDo= "
|
||||
"chn@chn.moe"
|
||||
"AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEU/JPpLxsk8UWXiZr8CPNG+4WKFB92o1Ep9OEstmPLzAAAABHNzaDo= "
|
||||
"chn@pc"
|
||||
])
|
||||
];
|
||||
};
|
||||
home-manager.users.chn.programs =
|
||||
home-manager.users.chn =
|
||||
{
|
||||
git =
|
||||
imports = inputs.config.nixos.users.sharedModules;
|
||||
config =
|
||||
{
|
||||
userName = "chn";
|
||||
userEmail = "chn@chn.moe";
|
||||
};
|
||||
ssh.matchBlocks = builtins.listToAttrs
|
||||
(
|
||||
(map
|
||||
(host:
|
||||
programs =
|
||||
{
|
||||
git =
|
||||
{
|
||||
name = host.name;
|
||||
value = { host = host.name; hostname = host.value; user = "chn"; };
|
||||
})
|
||||
(inputs.localLib.attrsToList
|
||||
{
|
||||
vps3 = "vps3.chn.moe";
|
||||
vps4 = "vps4.chn.moe";
|
||||
vps5 = "vps5.chn.moe";
|
||||
vps6 = "vps6.chn.moe";
|
||||
vps7 = "vps7.chn.moe";
|
||||
}))
|
||||
++ (map
|
||||
(host:
|
||||
{
|
||||
name = host;
|
||||
value =
|
||||
userName = "chn";
|
||||
userEmail = "chn@chn.moe";
|
||||
};
|
||||
ssh.matchBlocks = builtins.listToAttrs
|
||||
(
|
||||
(builtins.map
|
||||
(host:
|
||||
{
|
||||
name = host.name;
|
||||
value = { host = host.name; hostname = host.value; user = "chn"; };
|
||||
})
|
||||
(inputs.localLib.attrsToList
|
||||
{
|
||||
vps3 = "vps3.chn.moe";
|
||||
vps4 = "vps4.chn.moe";
|
||||
vps5 = "vps5.chn.moe";
|
||||
vps6 = "vps6.chn.moe";
|
||||
vps7 = "vps7.chn.moe";
|
||||
}))
|
||||
++ (builtins.map
|
||||
(host:
|
||||
{
|
||||
name = host;
|
||||
value =
|
||||
{
|
||||
host = host;
|
||||
hostname = "hpc.xmu.edu.cn";
|
||||
user = host;
|
||||
extraOptions =
|
||||
{
|
||||
PubkeyAcceptedAlgorithms = "+ssh-rsa";
|
||||
HostkeyAlgorithms = "+ssh-rsa";
|
||||
SetEnv = "TERM=chn_unset_ls_colors:xterm-256color";
|
||||
# in .bash_profile:
|
||||
# if [[ $TERM == chn_unset_ls_colors* ]]; then
|
||||
# export TERM=${TERM#*:}
|
||||
# export CHN_LS_USE_COLOR=1
|
||||
# fi
|
||||
# in .bashrc
|
||||
# [ -n "$CHN_LS_USE_COLOR" ] && alias ls="ls --color=auto"
|
||||
};
|
||||
};
|
||||
})
|
||||
[ "wlin" "jykang" "hwang" ])
|
||||
)
|
||||
// {
|
||||
xmupc1 =
|
||||
{
|
||||
host = host;
|
||||
hostname = "hpc.xmu.edu.cn";
|
||||
user = host;
|
||||
extraOptions = { PubkeyAcceptedAlgorithms = "+ssh-rsa"; HostkeyAlgorithms = "+ssh-rsa"; };
|
||||
host = "xmupc1";
|
||||
hostname = "office.chn.moe";
|
||||
user = "chn";
|
||||
port = 6007;
|
||||
};
|
||||
})
|
||||
[ "wlin" "jykang" "hwang" ])
|
||||
)
|
||||
// {
|
||||
xmupc1 =
|
||||
{
|
||||
host = "xmupc1";
|
||||
hostname = "office.chn.moe";
|
||||
user = "chn";
|
||||
port = 6007;
|
||||
};
|
||||
nas =
|
||||
{
|
||||
host = "nas";
|
||||
hostname = "office.chn.moe";
|
||||
user = "chn";
|
||||
port = 5440;
|
||||
};
|
||||
xmupc1-ext =
|
||||
{
|
||||
host = "xmupc1-ext";
|
||||
hostname = "vps3.chn.moe";
|
||||
user = "chn";
|
||||
port = 6007;
|
||||
};
|
||||
xmuhk =
|
||||
{
|
||||
host = "xmuhk";
|
||||
hostname = "10.26.14.56";
|
||||
user = "xmuhk";
|
||||
# identityFile = "~/.ssh/xmuhk_id_rsa";
|
||||
};
|
||||
xmuhk2 =
|
||||
{
|
||||
host = "xmuhk2";
|
||||
hostname = "183.233.219.132";
|
||||
user = "xmuhk";
|
||||
port = 62022;
|
||||
nas =
|
||||
{
|
||||
host = "nas";
|
||||
hostname = "office.chn.moe";
|
||||
user = "chn";
|
||||
port = 5440;
|
||||
};
|
||||
xmupc1-ext =
|
||||
{
|
||||
host = "xmupc1-ext";
|
||||
hostname = "vps3.chn.moe";
|
||||
user = "chn";
|
||||
port = 6007;
|
||||
};
|
||||
xmuhk =
|
||||
{
|
||||
host = "xmuhk";
|
||||
hostname = "10.26.14.56";
|
||||
user = "xmuhk";
|
||||
# identityFile = "~/.ssh/xmuhk_id_rsa";
|
||||
};
|
||||
xmuhk2 =
|
||||
{
|
||||
host = "xmuhk2";
|
||||
hostname = "183.233.219.132";
|
||||
user = "xmuhk";
|
||||
port = 62022;
|
||||
};
|
||||
};
|
||||
};
|
||||
home.packages =
|
||||
[
|
||||
(
|
||||
let
|
||||
servers = builtins.filter
|
||||
(system: system.value.enable)
|
||||
(builtins.map
|
||||
(system:
|
||||
{
|
||||
name = system.config.nixos.system.networking.hostname;
|
||||
value = system.config.nixos.system.fileSystems.decrypt.manual;
|
||||
})
|
||||
(builtins.attrValues inputs.topInputs.self.nixosConfigurations));
|
||||
cat = "${inputs.pkgs.coreutils}/bin/cat";
|
||||
gpg = "${inputs.pkgs.gnupg}/bin/gpg";
|
||||
ssh = "${inputs.pkgs.openssh}/bin/ssh";
|
||||
in inputs.pkgs.writeShellScriptBin "remote-decrypt" (builtins.concatStringsSep "\n"
|
||||
(
|
||||
(builtins.map (system: builtins.concatStringsSep "\n"
|
||||
[
|
||||
"decrypt-${system.name}() {"
|
||||
" key=$(${cat} ${system.value.keyFile} | ${gpg} --decrypt)"
|
||||
(builtins.concatStringsSep "\n" (builtins.map
|
||||
(device: " echo $key | ${ssh} root@initrd.${system.name}.chn.moe cryptsetup luksOpen "
|
||||
+ (if device.value.ssd then "--allow-discards " else "")
|
||||
+ "${device.name} ${device.value.mapper} -")
|
||||
(inputs.localLib.attrsToList system.value.devices)))
|
||||
"}"
|
||||
])
|
||||
servers)
|
||||
++ [ "decrypt-$1" ]
|
||||
))
|
||||
)
|
||||
];
|
||||
};
|
||||
};
|
||||
nixos.services.groupshare.mountPoints = [ "/home/chn/groupshare" ];
|
||||
@@ -134,7 +198,7 @@ inputs:
|
||||
shell = inputs.pkgs.zsh;
|
||||
autoSubUidGidRange = true;
|
||||
};
|
||||
home-manager.users.xll = {};
|
||||
home-manager.users.xll.imports = inputs.config.nixos.users.sharedModules;
|
||||
sops.secrets."users/xll".neededForUsers = true;
|
||||
nixos.services.groupshare.mountPoints = [ "/home/xll/groupshare" ];
|
||||
};
|
||||
@@ -151,7 +215,7 @@ inputs:
|
||||
shell = inputs.pkgs.zsh;
|
||||
autoSubUidGidRange = true;
|
||||
};
|
||||
home-manager.users.zem = {};
|
||||
home-manager.users.zem.imports = inputs.config.nixos.users.sharedModules;
|
||||
sops.secrets."users/zem".neededForUsers = true;
|
||||
nixos.services.groupshare.mountPoints = [ "/home/zem/groupshare" ];
|
||||
};
|
||||
@@ -168,7 +232,7 @@ inputs:
|
||||
shell = inputs.pkgs.zsh;
|
||||
autoSubUidGidRange = true;
|
||||
};
|
||||
home-manager.users.yjq = {};
|
||||
home-manager.users.yjq.imports = inputs.config.nixos.users.sharedModules;
|
||||
sops.secrets."users/yjq".neededForUsers = true;
|
||||
nixos.services.groupshare.mountPoints = [ "/home/yjq/groupshare" ];
|
||||
};
|
||||
@@ -181,18 +245,31 @@ inputs:
|
||||
[ "groupshare" "video" ]
|
||||
(builtins.attrNames inputs.config.users.groups);
|
||||
passwordFile = inputs.config.sops.secrets."users/yxy".path;
|
||||
openssh.authorizedKeys.keys = [ (builtins.readFile ./yxy_id_rsa.pub) ];
|
||||
shell = inputs.pkgs.zsh;
|
||||
autoSubUidGidRange = true;
|
||||
};
|
||||
home-manager.users.yxy = {};
|
||||
home-manager.users.yxy.imports = inputs.config.nixos.users.sharedModules;
|
||||
sops.secrets."users/yxy".neededForUsers = true;
|
||||
nixos.services.groupshare.mountPoints = [ "/home/yxy/groupshare" ];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.nixos.users = mkOption { type = types.listOf (types.enum (attrNames users)); default = [ "root" "chn" ]; };
|
||||
config = mkMerge (map (user: mkIf (builtins.elem user inputs.config.nixos.users) users.${user}) (attrNames users));
|
||||
options.nixos.users = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
users = mkOption { type = types.listOf (types.enum (builtins.attrNames allUsers)); default = [ "root" "chn" ]; };
|
||||
sharedModules = mkOption { type = types.listOf types.anything; default = []; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (builtins) map attrNames;
|
||||
inherit (inputs.lib) mkMerge mkIf;
|
||||
inherit (inputs.config.nixos) users;
|
||||
in mkMerge
|
||||
[
|
||||
(mkMerge (map (user: mkIf (builtins.elem user users.users) allUsers.${user}) (attrNames allUsers)))
|
||||
];
|
||||
}
|
||||
|
||||
# environment.persistence."/impermanence".users.chn =
|
||||
@@ -236,4 +313,4 @@ inputs:
|
||||
# ".viminfo"
|
||||
# ".zsh_history"
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
|
||||
1
modules/users/yxy_id_rsa.pub
Normal file
1
modules/users/yxy_id_rsa.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3D1PKR7xwlFBT/XdvGl9JkKTR0opBOQwxokR0Ri+zy0a6PgFFE6/L2NhgbHLQZt96J4lHl9ZxPdRgQ8Tc4+rptJiEX5VvZaNXmOC5wa5fGZuSj93HPEUzrtOv1sFzh2WgAeWd2nf7r/DoSYY91W1Bpsjx1YaeI6KvTHMeqoidTd17CcrMkIcOuYlgAHDeZ+vnxljTOddjK17D+AsG1+ThbDNwd97AlRv/pRkL2BAnHHNvL1UXVKg47IV4+60guB0Xqr947mSdCAomW1Oe9XbYooVRZZaVov1cv6NTQ0dZ6ktV3i+s7VXZh8dNkp46Hw68gI+fHp0I3mze5MblffpaGo2f0qQrJOROQygOyj/ihK1eMkPNKfdJE0odQ0z+1mwnwq5bhP5UPBvz6Z11M9Ez+/VtX3MG27RdVPMtoLSgHV7XwvVsvJQ5V+O+TkdO95IIlPuA2+1wj9O+Tsz4u4IS5xC7XXr9Jo+Mj1gbYnZqmTSldyBIkSUuKRgDF6oC4Fs= yxy@chn-xmupc1
|
||||
@@ -31,7 +31,6 @@ inputs:
|
||||
{
|
||||
features.buildkit = true;
|
||||
dns = [ "1.1.1.1" ];
|
||||
storage-driver = "fuse-overlayfs";
|
||||
};
|
||||
};
|
||||
enableNvidia = builtins.elem "nvidia" inputs.config.nixos.hardware.gpus;
|
||||
@@ -68,7 +67,14 @@ inputs:
|
||||
};
|
||||
virtualisation =
|
||||
{
|
||||
libvirtd = { enable = true; qemu.runAsRoot = false; onBoot = "ignore"; onShutdown = "shutdown"; };
|
||||
libvirtd =
|
||||
{
|
||||
enable = true;
|
||||
qemu.runAsRoot = false;
|
||||
onBoot = "ignore";
|
||||
onShutdown = "shutdown";
|
||||
parallelShutdown = 4;
|
||||
};
|
||||
spiceUSBRedirection.enable = true;
|
||||
};
|
||||
environment.systemPackages = with inputs.pkgs; [ qemu_full win-spice ] ++
|
||||
|
||||
@@ -7,22 +7,15 @@ frp:
|
||||
store:
|
||||
signingKey: ENC[AES256_GCM,data:TsB1nA0Rf2AsYyH59WpUK53pTCX2JdrGQjkJ9A9BfWLLmw3EMnPoaLHG12rv1R2/xRU7rP+iVhXb77g60I/Kn4ehun3ogMmK1oEAKyQcxudBUJFk+SeijaQLr2A=,iv:e2rdGBVOPS1nyC3pXhs5r0WyEkqxcpCnX3eAcBCj93M=,tag:HwccjH2Wms5/TevU2IuzNw==,type:str]
|
||||
nginx:
|
||||
#ENC[AES256_GCM,data:sHSfWhEO9PHWTY0r,iv:XSyOSkzEVOjMF/9vjEVpcuKH6B2mdE5D7l9VKrSILO0=,tag:2YkAoPW5GqOjFpPF5IvApg==,type:comment]
|
||||
#ENC[AES256_GCM,data:Oaxg1nXYHLNOAF2V8lNF+4OtJz5bXOdEleXi89AW+dQvDgj0HMAAlxLiixlfhFW48Clcu+C+4opFZUk+4Q3GBePTQWeabgEFAZi+MgnVoiXzfizQpmve,iv:/NyV6W0vaXvS5qFKPw+7Iqe9po1VKQDLbHaC9Fa8Mto=,tag:JiCKJxhpAI9k11N9WxfZew==,type:comment]
|
||||
maxmind-license: ENC[AES256_GCM,data:PVV4VAvB22KoA8EM8Honb+KWYhydXdmTAVlDw/XnTcbaIY+5Km2gGA==,iv:7PfytRbpW4G2iDNqysvZnB0YsQFVUL5Kr1DNsBzuhCA=,tag:z2J14fdD7AUNabN+6kUojA==,type:str]
|
||||
postgresql:
|
||||
misskey: ENC[AES256_GCM,data:KiJ2smpRwJ1pzauCgVsmFH4aCiw4sEkCQ9JSTao5NdI=,iv:jIc0a797dokfByN2vJcYcAFfPC8MP7wCV5qsxoCDxcE=,tag:L5n1/xszwB0lhqYcbLqp2Q==,type:str]
|
||||
huginn: ENC[AES256_GCM,data:Hb3Lkg==,iv:jhYobzvZUhIF4qzD7bzH0M78HtoQiTUuxqULMkk/i1w=,tag:MKqehVphO+jKb1L6E0c6NQ==,type:str]
|
||||
misskey_misskey: ENC[AES256_GCM,data:MSDbQffk/WjZ6EYiwVuUMdhdv9VE59ZM7t4XldOKRO0=,iv:J/x9t4Pk5zi7Av9fbzxgAbbtbEUZttSx/JGRmmgmvE4=,tag:CwFR9K++T7YqYR932z3IAg==,type:str]
|
||||
redis:
|
||||
misskey: ENC[AES256_GCM,data:SAcZsRrhNB+CjpcvUcWLi5nhEA49bFM+HYHEkszNdZs=,iv:fOLletIWzCrhHZrgwl5dpdCnwUbcEeTaKNosXna8pfU=,tag:EpdBW/RexAoJ0z1G2Emvww==,type:str]
|
||||
misskey-misskey: ENC[AES256_GCM,data:vcvQ/hs/F3BZd1sfvWwfEeB8vVoqdnprxobcmL6xsmg=,iv:S32yrjrjj56HbxTlfFGjOb+sO2M9KKEDEazCrpQWj6Q=,tag:iwnvqwQEdd6jicx9jJBdbg==,type:str]
|
||||
meilisearch:
|
||||
misskey: ENC[AES256_GCM,data:oBYIwQyfPyjsp1dfveVGqO7mY9LO7jaD+Mpe9nTm8Sd8XKgRPJWkce4tnBXBRzkdLURvDDD25uODUekdkkO1gA==,iv:/Gw3PX1w7dWWzEMCWrETGees8CjONwzIpTZSCkQsZXc=,tag:59GHYNPRTv3KFqhpUDXBLg==,type:str]
|
||||
misskey-misskey: ENC[AES256_GCM,data:/wYR3Bz4LRk/Ks0vizlZS3Ebf5qVfnlBBqZEm/ZIBFdDuhddgu71cqCjTHIKQ6CYh3CoUyguKIIFWku/kOCHKA==,iv:dllKvZwxvZC4pVyEMOB9WNiVBsVxzo5kwbdYKCzzyrY=,tag:MvzqalVvBkyJoLbirN0V8Q==,type:str]
|
||||
nebula:
|
||||
key: ENC[AES256_GCM,data:kNm9hwMa/EhDeOCeZw1jEnroolTkeEeAxpSEDko6tHSDHwHbhfjr01ZzHKE=,iv:q2qCi99XgZJvRuF1dm16sK6BFIoa9QUN8p4LSiZq28o=,tag:ApOKdA91LBiWHv6TuXMkpA==,type:str]
|
||||
huginn:
|
||||
invitation_code: ENC[AES256_GCM,data:RVvK+w==,iv:lv/d3J2Ua1CcZiMugsbuHsSKHlXt6t7HmeTB+Szk91U=,tag:n3mgg6FabiLxvMIGeOgHIA==,type:str]
|
||||
mail:
|
||||
bot: ENC[AES256_GCM,data:+0C08g==,iv:V5BvmArE5+CkhK+yECLQwV4Nxpd/SiUVLj9iTF+kV0s=,tag:58dXyIZx43FOi51jSpWNkA==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
@@ -47,8 +40,8 @@ sops:
|
||||
OUlxNjdQaXdXMkZ6bnV1ek4yZ2dpbkEKpKGOAxo5Eef2jtGrg4iSzmGCeg+vTgvu
|
||||
+K8b+O19MIkGMDBm6UbYUPtc/7eqoEZRiTUzNMTmfkLVS4ul5zou9A==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2023-09-16T11:06:32Z"
|
||||
mac: ENC[AES256_GCM,data:hZCeW25Tp5+f0pdnysxGIYMBDHC+/nFJTBFvWDrL3s86cyjsrQRcEI8levSHAayEL7eFSD7t1syNSmwD13H74xiWwqroQfRKUfURze1mg8GLkT/sBoL8aw2cZdboE5OE8jfQxGYgovZUuBEtfgVCi6QDR+Q21uXtsDhp3MnwOI0=,iv:shA2SmoVv9LqP5fRvCUNq3Ts8gvuAcOyIARwsXhUPKw=,tag:BEOMEzyeuCAZrCRTxxz8Kg==,type:str]
|
||||
lastmodified: "2023-10-03T10:45:13Z"
|
||||
mac: ENC[AES256_GCM,data:9O1o1uNvrSu4yEpVmvPLESrCqtkf+MXUud54hVgjd/Mmchsy0eTi3gMzbAb0i6vaaNH7hHVOT0GnSNiS67UjYemvx9xHOPuJxysmoUAvT6aVzap4XZirnnsKgfYGUwn/iECsEF3dGa2c4nCiPxdtac2BaGBlxFKuh1fWBKWrow0=,iv:a+xHAakjIPhDQRYJnb0BFxdXc0uXZmmZYv8kvOPoKBA=,tag:hWpzT1tMILYZKhQXgdmhXg==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.7.3
|
||||
|
||||
@@ -22,7 +22,9 @@ xray-server:
|
||||
user7: ENC[AES256_GCM,data:7rxvmKbtYrDKBlo8kZIfd86KLd9EcSWB0ikasIRqfCZ24W0h,iv:Uplz4fnFymmBVZ9YTniHFFY3EVSrTYsg1+CTFqBu1WY=,tag:l3EPeYRHSeRsCyRhqFRrEg==,type:str]
|
||||
#ENC[AES256_GCM,data:8FxApg==,iv:vPa5p3QVHAvw+ECusWGqx1ugTcHh42CVFDQcMhG59wM=,tag:lHiZtydcYFBQiXnWh8pCrw==,type:comment]
|
||||
user8: ENC[AES256_GCM,data:FNT3hHMwPJu3iI1LuOP1KvsoOonh+J/ecrNrRQO5TpunDPUq,iv:tTEB0MSUmQ39tNq9v1BTfaEcJY7Y59CPHRASMC1a4U8=,tag:klDm6Isk52hG8ubcFu6yHA==,type:str]
|
||||
#ENC[AES256_GCM,data:QdaYYH3RGJ4qIg==,iv:79NBTEKCPtgVVv3G7wg+vdoLOWxc+bdqT1lF4HJpTC8=,tag:8mRFGjy7lBrdyGyX9vaSOQ==,type:comment]
|
||||
user9: ENC[AES256_GCM,data:4BD/4MXAVLhDm3EXdgTiEgPketf0WgflVPGb3/JMWXfycEKY,iv:jwE5sFVxZjORwoqCBdufP2EhetVtFGHyCP58AzJwle0=,tag:OCteA20hDBLI9zt1ET0tUQ==,type:str]
|
||||
#ENC[AES256_GCM,data:U48hPlrJn2dF9g==,iv:W+6QEgemNa41VCT2OfBvEhuLAucLxfR+YZiDgdkkSnk=,tag:IhVstGnQ4EviT5ctMgyKiA==,type:comment]
|
||||
user10: ENC[AES256_GCM,data:d9qxJQH9Jo8gJKUi5jjSdVwqzuHG+dj08Tk+TxhczJmlSaFT,iv:DS+9isZX2B9AYAyV4Yle4fpHzA/SHcR56B/GW8QdALw=,tag:9nUQ0OuMCuXGSZs2kjfnIQ==,type:str]
|
||||
user11: ENC[AES256_GCM,data:RPIH0DudfPJwPsa0yFLNqUy2EMwQh1bIqkmhCfteVTkUQGWP,iv:NH0aGTZ6nVqz2nn+o1HQS0PKpqHTBMkAhy0oFeyX/8k=,tag:kgd5zkHXW+oxRFC9x2VTUg==,type:str]
|
||||
user12: ENC[AES256_GCM,data:Q+XcMYPWWeHqXZZt3lf9OurlWwVQGBJWTnRwDUvg7np19g3+,iv:ybREjo5/SFRN5LMSyYdm0ygkYoq/G1uBv9K0iGPqrh4=,tag:g2y8IJeXtHW1XjelOvT+/A==,type:str]
|
||||
@@ -86,8 +88,8 @@ sops:
|
||||
ZXFTU3ZCaW1pTVh0RUJzdDdGdHlPYTgK2mlgcX2kEc8+2UDdBnhUm6IIuh8V6agW
|
||||
ooxH9OEPXUVI/4JcDo4v8ZUhAyU1ehLH0Ef7PJCChOZe2KZmWSNbhA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2023-09-03T08:50:37Z"
|
||||
mac: ENC[AES256_GCM,data:+w04X4hdgiBO3VpCI5tM2h+X13m3QOQeMdcmKGavqBoC9S+jx9dOoy2H9FdhjyYN/dkhglFqG5LMnHqEsdLGSwSxUsJDmHMm3MvFLJYIybvanNB+Gxb9+ooBNpC/e+d1iLg85mAUTXhLlezw5gaRHtwiQ4llOXZesE+c+Wnbbws=,iv:mM5lw8pFJoqYvz8uIi+oTqJFyIHq6HjspYTaEJp2xzY=,tag:9AqRnzwUxIV/ClJATxz95g==,type:str]
|
||||
lastmodified: "2023-09-30T12:43:07Z"
|
||||
mac: ENC[AES256_GCM,data:78zZudkrqLTqFy2B2G5hTj4y1e7ApVfKSWUPlx+7nojZb0PdyoRE7q0ZSdOv5qKi2dU5+DLxfwJIDLBOQyquQKHKaPSZ4kL9iY9dEH1ySAYUcSuVs/+kXB4SbLPEO9zcgJmI3BCu/A3dbnRCNB3yotjfwHQ4cwDp09k/8DcN/Gw=,iv:h2qx6Izx7N8tdEUD/rknauQ7Tn6eSNgJrXg/pIZsQpA=,tag:sz+LGutIsRx200hAbCeSOw==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.7.3
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
acme:
|
||||
cloudflare.ini: ENC[AES256_GCM,data:PJ3JhdSPCyxzdcRI4UFdESWgyAjIYGyuVaU9l0R3s8mJidtgavvSSMy0hC0G/2fauLB/Eqc3L3NppXFjlKVywVE=,iv:lZVlOf7P/Vs/+u/5YPKFXmdeYV9NP9kcVWd00w1OjB4=,tag:LfWZTvPQH4QPrNrYfZ/Z6Q==,type:str]
|
||||
nginx:
|
||||
#ENC[AES256_GCM,data:BwkND2sU5FkdN72C,iv:DNIdyY35BfBYtlJijfI17s7aP8zj5Y/kUAieAYSTr3w=,tag:016xmeOvZC3Grc8JLGcVaQ==,type:comment]
|
||||
#ENC[AES256_GCM,data:NX8myRAMhMS7qx0T+471E9Wz//AKXt7FoY7P8cUOvJ/Xz+AKkB2VfP45gyPvds6zwwKuYtRLqvPD84afjE/mf2wAij3VEkprJKd5VMl+RQ==,iv:LYdigyW2VUlqo/3IvC7CRaiFsnxMyQIryHf2yFMJ+Yw=,tag:ttNAzJRCz/owZSe/V3eOPw==,type:comment]
|
||||
#ENC[AES256_GCM,data:Ss47U7TQO6OS21/eLVnLGO/Gpz7V7I1mlQS2SC/6DQk3bySZK0Omyd3Nyctz7FX+ix1RbeRd7//JKNc8Dtj19jpicBFQpZMV,iv:j9QD7TmRvfzFLkLLlRcwrAHcklfGJ0R6Z3cpbli97vk=,tag:lhEkAmm/AV0gTLItdVcZ4A==,type:comment]
|
||||
maxmind-license: ENC[AES256_GCM,data:9aW4QR3K6S+eTqzIjVlNEwkG0wZ4u5jgRfe7CMwRlJlK4AmcS6c45Q==,iv:cPTN1K4Aag5sohGbCQUZHYTvcwAL7AhF+rrY3OvXGPs=,tag:d9GGUMHnfzRz9Cf2U+dBfw==,type:str]
|
||||
redis:
|
||||
rsshub: ENC[AES256_GCM,data:uPnZIjbnRRoWIHlWkZNZkMpIb3Ujnnpb+AisVSVGFv4sfDAuDlAjt39pRdnWkCXJPqtXjJzQ+FeT34cqxTf8Bg==,iv:/jcyAHkxByFnbkmCAYQwda2QRmhW7L/ICoLuCgsVLCI=,tag:M5Q+dh/Bn7FiNpqQGYus4Q==,type:str]
|
||||
wallabag: ENC[AES256_GCM,data:WkiqS9TOHxYalDp7Ssgg2x7vj4D58psQ5au4a0e3LZBecERwzUKmrhbVKRuDvNTwWbYxSds9SAca0wN+pWmrmA==,iv:QqHlzSXG1I4+p8wd58lcQs8TqAF3foxiYVdgL8L3IpA=,tag:CPtFgIeFL5W25gtd6NFkrg==,type:str]
|
||||
misskey: ENC[AES256_GCM,data:eT0zEdnFyNNr7G6QMn5JpTa5M+iI9B4HdvPLvfwCGRZ6MyeYrpsO97B2V0YzIaJAi2Md20hMgJdD6BVXcDp9pA==,iv:e/2/ITEHCKATyAtGxWm9hJ8T/pcV6Je/RgU1AowXEfs=,tag:Ohdxg2Y/Hl5ewrv0Kv8ywA==,type:str]
|
||||
misskey-misskey: ENC[AES256_GCM,data:OHjt9o+m++NT5aaFbwBT/wSMdUdgf4zscd/JxjCo5HDhC3WeWMJV7z//kATI5Dg4BWAhvPlL02Vrly4RraIzLw==,iv:sQB4/D2SsOuDR3bTrmlNg7o+6ehFznDsqVc3BX9pK20=,tag:tcwTBt/JhyW8ZTAIWIkWBA==,type:str]
|
||||
misskey-misskey-old: ENC[AES256_GCM,data:amUqMycdXUFvjg66pXKnlZqiESBYMci0k8iYzj824SaEqHl3Nq/I0TjYX++xEUg+RGYyTIcSaj96HUANTKpc1A==,iv:ND1mQLHxltRlOdpJ80ywheGo6hkl7OgRyk9TguJMuTw=,tag:dhCCwnCOnyT2iXdEMK0szg==,type:str]
|
||||
nextcloud: ENC[AES256_GCM,data:jwN/CqwkU/5Rd6w75/bV2Yej9b0CoxZaiJEcZXFx+9XUPY3Xg1tQdEr1SALG8xzOEdoL6WBVs14NvrrL25GeTQ==,iv:p5+0AB52QqScJwMhNIrM/7HAcRPdD9Z8xV6uwIDOwIg=,tag:f1XbNDDRXvGl/dkV9Wp2Ug==,type:str]
|
||||
postgresql:
|
||||
wallabag: ENC[AES256_GCM,data:ANwvEE3K/W/hU34Y7RvlbUuJNo2bOaRfeusYM9pRxXQOdG4XpwYfd/DprsrVjlkrMFuTurUR5j6UNHWh+ILDbQ==,iv:K8doqhVosz+OosMrLJXrSxairr84EeGs3EWgVQjpkS8=,tag:WjDzy7ubm/GVlBkW0O3znQ==,type:str]
|
||||
misskey: ENC[AES256_GCM,data:OXKLrkPDgVTdsZolzLVOlkYswLVFy0LSXiGjohic4j3t9cTrMIfBa7LbA5J7VlLryO/ISzLpu8lt9aEsmjYSSw==,iv:V4n3MUkAnbLs5gBOOqCubHxuKJGvfH9dND1YgD1YgCs=,tag:RXiXeekS76pGHUz3oEPQ9w==,type:str]
|
||||
misskey_misskey: ENC[AES256_GCM,data:lRbSz7bbiWEdK/cRD41fLvFJF4WYsclKHVykFcU3LIz9vnKlR3VdczzznVqpT7JvG6OUi+TmipJii+0KzXHtdA==,iv:8sBKgVwuDJdThup0KQ6cnAV5O2liwVra1yIpDHVfpMI=,tag:DyUpaHai8ZUyllvZBUm8sg==,type:str]
|
||||
misskey_misskey_old: ENC[AES256_GCM,data:Wwtd+hKI0s7m3PbEPHbnSyTsCkW0x8SYHUiCYuNSNCG8i4RAmiAbONNFfWN2hXnmTmRK79Tx/3GR+L0KMzmNGQ==,iv:BekTELToPQXUdZHyNtkuqKyZeez+moI6k907P7NhA3Q=,tag:A5YB0WIa1RkDCtzeBhiuyA==,type:str]
|
||||
synapse: ENC[AES256_GCM,data:Orfse2arRGMujA8MloqOp+iVr0+uCVtlMZJNAA36J3UCog5ExE8HE6G5wIvvoP0o/PNToYc9Jgn8T7iWdU6FIA==,iv:XQ6/bDfIRmvZ3VdTqH5Gaiu2emd5kV+q6RjNXDQEtkc=,tag:Yq+w9oxv2yhpsQfMRp4HaQ==,type:str]
|
||||
vaultwarden: ENC[AES256_GCM,data:Uz8GJMaLUTQ9pQbZyZLWS4bL5wmt9RvbAwNctAIDt9JrV3FaXxgKjE0MJSGklS55yj/Z/wbO6RCuCK2AWR2VKw==,iv:7hA8YcB88M1qCV8EhFYpHbfPmAZ/7xNqvTMJYZ/UcAY=,tag:mkDHJYmRoYZ/Ct0UmOp9FA==,type:str]
|
||||
huginn: ENC[AES256_GCM,data:s9Y9VGq4UYZael28LEwA0fF97HVZd7neM45zXxZUsRj75WCjif0jcl8nc2cLHhys7yfsZNxNgsDuOmLWX1l8mA==,iv:Hnx8Py6NELPkj0mVn4OQaU8+CIq3FMC/UZElY4WsB08=,tag:+5+Nyqvr2udUprIBm9dsaw==,type:str]
|
||||
nextcloud: ENC[AES256_GCM,data:5UpYSMsZgUgEJHg0ou9Z1RTE+YFFUKuXwPtc6L5XxD4GNo8Gd3CvcQSNGAol+5DtyPKF3q1+ZgtScWGrqU1RyA==,iv:Zfm+Oa4eON8WiJzYUkMFawafDwo9pOnOpWkwHYLIKkk=,tag:4ECMla1dFfCrn7lILwWFNA==,type:str]
|
||||
meilisearch:
|
||||
misskey: ENC[AES256_GCM,data:+oLR/0G6bjSz3jbZxeoGbLd7I4AiJDxodpc8DEHmHjYaNS6UrQEO50ekNSm3DpcK9+bqMJl4q+d1PWXgHRJbIw==,iv:rQcq7LksBhJr26D3112y41ryW3cEwnG6XLgiFhLv3d4=,tag:/PaX7MIERrtqJoayzdf/AA==,type:str]
|
||||
misskey-misskey: ENC[AES256_GCM,data:4s+qqd6mmstioC0XmG/vA6ED9mzu1vRJVPFFalRiqnnsFy0dYEU87H+y12eOp/KDSLdTNvpp6Z6jCNvxnpDXzQ==,iv:x6L9OPu/dwVsD9pYb4dqavw9NesMbo7LB+rwz6veAR4=,tag:/BBqV2sHIgPas7XsZydh2g==,type:str]
|
||||
rsshub:
|
||||
pixiv-refreshtoken: ENC[AES256_GCM,data:EeSOTSAAh+1Dc8+a/AaPJ0aBK5DTa3pdS6DrIMQmRw/n0SRu2QoynIF76w==,iv:dnZxi8jM1I4w3C2duYielpP/8wOAdHDjcqDIrowM0dM=,tag:8irGvLEbRJHV9TB8Jibs9g==,type:str]
|
||||
youtube-key: ENC[AES256_GCM,data:OEm/ynOUPUq7ZEVzL2jgs9d+utkLTIdNq0MHE0JDujb9ndAwyJJI,iv:RRae6Cg6GdDnXAQOdtBYmcA7ZNuu70VpIg2MEezBn5k=,tag:gX4ZG345cT3Jh3ovUxtLGw==,type:str]
|
||||
@@ -33,8 +39,12 @@ nebula:
|
||||
key: ENC[AES256_GCM,data:9o6EkfTWOU0KwnJsgHML4E7VOfzo3LHnlOkV8ubhi6aayXImC3lAaoPrqUI=,iv:KHprijN7z+4FIIW+D5klDM9a9VzMJ5xawPc7jJtbHmk=,tag:0DAmxoz8D5f38ndPbkNW+g==,type:str]
|
||||
vaultwarden:
|
||||
admin_token: ENC[AES256_GCM,data:muavuOY88Lm4rSEoCp4IIPp7Z+sqf36VwpnPgf+K6IwwFkUgYM1GO80ogReYWqqUM6ij1Yzl5D9ncUbq+aGTKQ==,iv:jA4MRJlz71CMmPnWjb2tGbbIoMkEsESUowhXDckKKMI=,tag:l0HaJmnU29YeFUxjOgN3Kg==,type:str]
|
||||
huginn:
|
||||
invitation_code: ENC[AES256_GCM,data:8YxfbtlHhzaQpEXpFua81W/Uifd9b2Pv,iv:7BfoOxA1B0ZzRrhoKG1R1f1nT5GkNqGB/gpgl7oa2oQ=,tag:cKoWVqCuaiwEuQdYUDgbSg==,type:str]
|
||||
mariadb:
|
||||
photoprism: ENC[AES256_GCM,data:TF1SZVFnvzyE+7vrHYYUS4Juqhbiw9QcJx7p3Xj88xyBFcTqS1YjzAKs/9GQ1PuzdBrt6hXm/XtJILHiuktnSg==,iv:sd9sQEuIePL6LzUYbFtmdecJ57sMrkF0coalBf8KFqQ=,tag:P/knaKYTJ+aXu4l6IixISA==,type:str]
|
||||
photoprism:
|
||||
adminPassword: ENC[AES256_GCM,data:gB81joOfS8h05BNy2YmD/N0cpLPa/vAduDcQBeHiY/WkcnvqSXnXsOfnvbP74KQfoP4W35oFkfyGVPUBSB83tg==,iv:AkN2NoqMXVHQA9fHTTR7xbEapEqy/D61mHn7O23hyYk=,tag:WV+siDA3VnRkOYnP4Z9Qhw==,type:str]
|
||||
nextcloud:
|
||||
admin: ENC[AES256_GCM,data:1rglLrLtRf3yXQwfHDMZLewk8ueIbMFOC+1mtoAyLKnDmcQAoEQZ1vHw/hpKkFXJQ+QyX3sP8eUjRXuBEIVl3A==,iv:lfEGPEw9ybSdOYLDdaGCLXKgCvgRxn3k9eIy2DJHDYU=,tag:j4qRexbEAgK5HAGhr/wxfA==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
@@ -59,8 +69,8 @@ sops:
|
||||
SnFHS1Z0SXUzTFdEd29KTy9DU3Y3R0UKfhh+rUmWDrf+UGjclP57dHipPLFoXSqy
|
||||
HdelmfV6q4/c7ppx2E+oZw3VNgoZCsrxxzYZfwxHJiZb+5vkE0D8iA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2023-09-16T10:57:23Z"
|
||||
mac: ENC[AES256_GCM,data:FXdxVeb2r36ONCfNBUcOOjjcnAx+uIlf1bIDpYdOZHKdVOEx1PMUMgBngnMgzuiMXIILOeH9tFE6gerkaaKnSao1RUE65UScLnqwzpRFlgwqI+gFS+Ng8gWUaZO3qVCr2lQCegYBtevqhAy8+Dmew4EkYEiD0MTIomZgnlPu5+I=,iv:wKqLmD4Vjr5mtA59e3O2dMYMK0LANBODVHAN2R8CEsY=,tag:dFUhQe09u0AAz15CWtiXkQ==,type:str]
|
||||
lastmodified: "2023-10-04T07:35:42Z"
|
||||
mac: ENC[AES256_GCM,data:fa8ZjjFpm+j+HJtT1yv9Oyhdw7o9fQji6p9rAf+kBx7hR5mzVFO7hnH5a2Lbuw/cWuow8jSJjrVf1eg1ChXaL02GM38r8bnJy6Xwp/Yqg2crddrEIwzlS3yjkWWB1L/tPcd6VqWHmfKtPHaUpBtpOX6QarBTJ5xhh28E913im4U=,iv:v7CT8PiLpddOJvs44aRxsJ5iIgjOdOCKHD/FHsF2sII=,tag:R1PaS1g3yNk+yjMjXisqBA==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.7.3
|
||||
|
||||
Reference in New Issue
Block a user