nix formating, sops secrets migration, vps-init auto update
This commit is contained in:
parent
db022df80b
commit
fcee389f8e
17 changed files with 950 additions and 818 deletions
|
|
@ -1,11 +1,18 @@
|
||||||
root-passwd: ENC[AES256_GCM,data:taTvrqyI90UsBufUi+tFSNhcJNBo/+Owb9Zy+83PFA8J9I2ukz0TUafDMzxN/bI1whSlOnb/fq/ESi+ewGj5wxrIVimYE6/jJQ==,iv:ze9UccF64S113wLP/6lFunk5KqIAf8d5hISXHkFg5t8=,tag:dzozycgw77PXIyqio58Qkg==,type:str]
|
|
||||||
bogale-passwd: ENC[AES256_GCM,data:jPm/6XkoN66AWj5xPHGfI/IyKKOiUhP7nY9bVP0gWKLUGDemIannbHMA8RQeN7FQEwDocqPdkawNq5MWu+mb8uECMAyMyE5FSg==,iv:eEzG393tJNFKWI2Qeg9Fc6o7x7KblBBRJj9HDT3R70I=,tag:klbG/O/w0VWR4do+1pzfhQ==,type:str]
|
|
||||||
wifi-env: ENC[AES256_GCM,data:22s1o+2Dvf6HcDlfUPWVgMldjKl7k8wNicsisoX7p7uIP+BBx4WPpNFINtYO/UllDL22XiJs+4k1+7W+o+baCHFXdTZAi+psF9CeYqdogRUUrUIOokdEuxRFZFTsANDU8ljb88THz5Pn3wuZyhoVVaM=,iv:c3lEYdzh+nW/vATGiv4BRD70rP8qwwI1hZnT8LG6DE0=,tag:gQTZR3c6womkaQCHvb4ozg==,type:str]
|
|
||||||
awg-obf: ENC[AES256_GCM,data:8m0wlQO1pXgnTptYThZoCIqqef/cjjhg5P7iW6hE08Zbm9DadIbi4e2h1owH/O/+T5MKyOfIFONl2r6G/3ctDY1XGkbcwPaLN6z8/SE21k5PrKivMaTdEKGd5J0U0ny5s+sZZSqJxtBnb62czsXZ5ZrZSmvg/IsL72ObmwmcdC57nP9MFC/3/Gaawaz2bEjaaSVikLk22wZw7GRwbUSXsh/m9vBH02EyVhGqYcRcodNIzkdeMowPuhyEeVQmj9o0ODIDOWvMD71h9N5t6xkzApjLQXxdxxQon7YiQVxOCFsKibsfiTVTVl7wvWFqICKveEkXIzVlN6ubP/upspKiC3YtKUIU/ix4m4Lqk/e8HlStjeQWDOhaM/1n3p2M5NHNGf/X5vAvK0DGv+e1CoUd1FN3l0rm4SUGgi/mpQ0sOJb9zuPqv4OB8SmgYdnHNlW7GBFqJVD07s6otgQH+PQz04jL2EMw7JNBtXWk3t7fV15Ps31UqPiHfCLRtbakj/z7A2ljTDDl/PXQkfx7gl3j0an/R/Z/DFol1mLjdbgUhOEHWlNu23DCw4JCKGrLAw==,iv:kvpR3C/rDp++9EjM/9hKb8CAwiR29y5xmXZm4kWtsHU=,tag:iRtXdsdUcCzS7pRYb26uHA==,type:str]
|
awg-obf: ENC[AES256_GCM,data:8m0wlQO1pXgnTptYThZoCIqqef/cjjhg5P7iW6hE08Zbm9DadIbi4e2h1owH/O/+T5MKyOfIFONl2r6G/3ctDY1XGkbcwPaLN6z8/SE21k5PrKivMaTdEKGd5J0U0ny5s+sZZSqJxtBnb62czsXZ5ZrZSmvg/IsL72ObmwmcdC57nP9MFC/3/Gaawaz2bEjaaSVikLk22wZw7GRwbUSXsh/m9vBH02EyVhGqYcRcodNIzkdeMowPuhyEeVQmj9o0ODIDOWvMD71h9N5t6xkzApjLQXxdxxQon7YiQVxOCFsKibsfiTVTVl7wvWFqICKveEkXIzVlN6ubP/upspKiC3YtKUIU/ix4m4Lqk/e8HlStjeQWDOhaM/1n3p2M5NHNGf/X5vAvK0DGv+e1CoUd1FN3l0rm4SUGgi/mpQ0sOJb9zuPqv4OB8SmgYdnHNlW7GBFqJVD07s6otgQH+PQz04jL2EMw7JNBtXWk3t7fV15Ps31UqPiHfCLRtbakj/z7A2ljTDDl/PXQkfx7gl3j0an/R/Z/DFol1mLjdbgUhOEHWlNu23DCw4JCKGrLAw==,iv:kvpR3C/rDp++9EjM/9hKb8CAwiR29y5xmXZm4kWtsHU=,tag:iRtXdsdUcCzS7pRYb26uHA==,type:str]
|
||||||
awg0-spec: ENC[AES256_GCM,data:Ml+zSgMPymoMM7tTYrzfyjzavZUPjLuI22TCz58UGxRTK0YF7ip6ScBgxKwvF1sRD9qxS1wRWbRE/h8HSE5CbKELYjrCg3aiKRVY8bGv0dxrYQjV/BjljvLy1+8sVnjpD1IFVEOFJmpjkGaFUc8/7Xb0rVAmK6XTa5g+f55kp5n557UalfS29FwOcr8HgW1hZVTYiRZlaW3FxUDGZDjEP3Y1pG2h5MEsAQCTlkUv6dy+VdeUxN6G15v9dNF1CplvFXsi+sVqxmcPOANiKqaWmB5OYaE6C6RMuuPNJsbV6zecYOm2thQJALgHbX/Wq3Nqegxt+0CVHm7devnOsZhE2aSjsGTmI+KBDtUedY78qkSvHQhzhWfNAkptj9JUyJmXhBvT5yz56KHTCqDIKj/l8Hu+ZWbsXc3bH3r9nRXrJseTrGed9Y3sI+YgcNnEcTPWBU4xsveOTVHP2Y8KtZ9fM6iGJns/qxzmNbS6xKX8T2028feMu15CHdF2X3UVxDlIjla2MB7KX+BG+masyzxcTs4ThG1U6eWA/MsUVt/PXVpyMBrKLmuSsWWD90j17/X0ZVCJFRl0h8+vTq4pPWp8sclCiXtu0rxNlM9VL45VeUxvkWYebcR9aHdk2EaJnR2Qm5Jr3KKf8+Mf6WLvX6/PlRbKnSx24UZppC9gQiNVEoCsHfVkgKL5mG3gnGLARCZ6Y2imj0fJr692HV7RYCgzqVkPizSVBJqvTusCgWhlmTwVKXag6KJFVz2q9f6QRDM0Rb/ImC066XT+8wVzC3RJzEruxTW15aR8TdrlQytTtpmiK4z+WwI9UmLhrzsrSwPvWMdR,iv:WoJpKHNjTIuQWIgdKkgvqCmC+1DE5UsgqrvJ3M9wqj4=,tag:quE06vOF5tvlrnGbxaBVPQ==,type:str]
|
awg0-spec: ENC[AES256_GCM,data:Ml+zSgMPymoMM7tTYrzfyjzavZUPjLuI22TCz58UGxRTK0YF7ip6ScBgxKwvF1sRD9qxS1wRWbRE/h8HSE5CbKELYjrCg3aiKRVY8bGv0dxrYQjV/BjljvLy1+8sVnjpD1IFVEOFJmpjkGaFUc8/7Xb0rVAmK6XTa5g+f55kp5n557UalfS29FwOcr8HgW1hZVTYiRZlaW3FxUDGZDjEP3Y1pG2h5MEsAQCTlkUv6dy+VdeUxN6G15v9dNF1CplvFXsi+sVqxmcPOANiKqaWmB5OYaE6C6RMuuPNJsbV6zecYOm2thQJALgHbX/Wq3Nqegxt+0CVHm7devnOsZhE2aSjsGTmI+KBDtUedY78qkSvHQhzhWfNAkptj9JUyJmXhBvT5yz56KHTCqDIKj/l8Hu+ZWbsXc3bH3r9nRXrJseTrGed9Y3sI+YgcNnEcTPWBU4xsveOTVHP2Y8KtZ9fM6iGJns/qxzmNbS6xKX8T2028feMu15CHdF2X3UVxDlIjla2MB7KX+BG+masyzxcTs4ThG1U6eWA/MsUVt/PXVpyMBrKLmuSsWWD90j17/X0ZVCJFRl0h8+vTq4pPWp8sclCiXtu0rxNlM9VL45VeUxvkWYebcR9aHdk2EaJnR2Qm5Jr3KKf8+Mf6WLvX6/PlRbKnSx24UZppC9gQiNVEoCsHfVkgKL5mG3gnGLARCZ6Y2imj0fJr692HV7RYCgzqVkPizSVBJqvTusCgWhlmTwVKXag6KJFVz2q9f6QRDM0Rb/ImC066XT+8wVzC3RJzEruxTW15aR8TdrlQytTtpmiK4z+WwI9UmLhrzsrSwPvWMdR,iv:WoJpKHNjTIuQWIgdKkgvqCmC+1DE5UsgqrvJ3M9wqj4=,tag:quE06vOF5tvlrnGbxaBVPQ==,type:str]
|
||||||
awg1-spec: ENC[AES256_GCM,data:qAKqA3ng760utSYHJGda0q9nwiWXpubGXGhMah9d6RMI8o67JAadyLVhSPGARibfsxmINiltrHVQU3KO6cFYkbPcGuKO0/YQq5MOukVp/8LnFHFN4tKUJpHZdt4JOEHJE9js1u7pJdg5jE+orIKl60iPccm9xunl/XYI7IdAjMGuVk9yMHvjOsQK9xK8w4qgMrWCj7XhZ9CmKk4yAwmN6Qivwv5AEwjyqRMWRvWRLxKyzjvoitsGo/EW+c54/t6MByH+ypXn7/jnZykc9usptyqhsOdNfYkoOgU9EHPzZ9uCnX2yinJBq5OTIvuuy5CX7svpRQ6LY+d0ha2b+IcPGAjsjtd9PmHv0miW/Hb0wMNNFy8xG7uN9mmdwmJnNVAJ2d0LI4tfFvLJIOzZF+ZVkf8=,iv:FapQlYAbfmkNgXCjIO18rjtS4dEFpGsjeoKwTannu2k=,tag:ZyquPLykqROF3HVEKbNr3w==,type:str]
|
awg1-spec: ENC[AES256_GCM,data:qAKqA3ng760utSYHJGda0q9nwiWXpubGXGhMah9d6RMI8o67JAadyLVhSPGARibfsxmINiltrHVQU3KO6cFYkbPcGuKO0/YQq5MOukVp/8LnFHFN4tKUJpHZdt4JOEHJE9js1u7pJdg5jE+orIKl60iPccm9xunl/XYI7IdAjMGuVk9yMHvjOsQK9xK8w4qgMrWCj7XhZ9CmKk4yAwmN6Qivwv5AEwjyqRMWRvWRLxKyzjvoitsGo/EW+c54/t6MByH+ypXn7/jnZykc9usptyqhsOdNfYkoOgU9EHPzZ9uCnX2yinJBq5OTIvuuy5CX7svpRQ6LY+d0ha2b+IcPGAjsjtd9PmHv0miW/Hb0wMNNFy8xG7uN9mmdwmJnNVAJ2d0LI4tfFvLJIOzZF+ZVkf8=,iv:FapQlYAbfmkNgXCjIO18rjtS4dEFpGsjeoKwTannu2k=,tag:ZyquPLykqROF3HVEKbNr3w==,type:str]
|
||||||
awg2-spec: ENC[AES256_GCM,data:lKf1YU5LDL4Kgl4cTy9ZdBPFz/WbfTvUdf9D4KejTsqnRMnxLieIgS3HWwEK4oGup5aKZgx2PL0T/bCFkRnxujJEOIdNqBa7a8esvsmzkVInEMMq7Z4Ofnnlz3S+y7o/WPFil2Oik+uE3HhS77uSOWrrq7bW2RMQcKUzlIEYbtUsFFcMkdEoh2sUqXSqUxX1L/lg8VtCIhsulEE8GjGJ8p/dzURZ9LHWPah95hW7bFU5j4rPF6NRGv4OMf7sHX+g5mc4tiTWV9H5NKoTtuxFVhVw3mQzxteIRMZPdvgKFnSIuVlb7JrWAL0sd3DPln7le8D3JRdTgZScQc24G9oCpH+IYaUbqKJ633MWzm/oZQDMqALwMKZbXP/uoDe2SBUl37C55B3r4oJsWT9FpQH8YEI=,iv:nvkJ1CzRKyluqxMTLtPkXBpUGhDeCzDdXl/aXNOP9BU=,tag:aC51Eo5mZ0zA7KdlJS6niQ==,type:str]
|
awg2-spec: ENC[AES256_GCM,data:lKf1YU5LDL4Kgl4cTy9ZdBPFz/WbfTvUdf9D4KejTsqnRMnxLieIgS3HWwEK4oGup5aKZgx2PL0T/bCFkRnxujJEOIdNqBa7a8esvsmzkVInEMMq7Z4Ofnnlz3S+y7o/WPFil2Oik+uE3HhS77uSOWrrq7bW2RMQcKUzlIEYbtUsFFcMkdEoh2sUqXSqUxX1L/lg8VtCIhsulEE8GjGJ8p/dzURZ9LHWPah95hW7bFU5j4rPF6NRGv4OMf7sHX+g5mc4tiTWV9H5NKoTtuxFVhVw3mQzxteIRMZPdvgKFnSIuVlb7JrWAL0sd3DPln7le8D3JRdTgZScQc24G9oCpH+IYaUbqKJ633MWzm/oZQDMqALwMKZbXP/uoDe2SBUl37C55B3r4oJsWT9FpQH8YEI=,iv:nvkJ1CzRKyluqxMTLtPkXBpUGhDeCzDdXl/aXNOP9BU=,tag:aC51Eo5mZ0zA7KdlJS6niQ==,type:str]
|
||||||
awg3-spec: ENC[AES256_GCM,data:2F+edwAugIjiPbPbanXl8GsfDcijHxg0N4jIExgcbn0AaAJpx78bJq7dwk4ahuVZX6HcYH+07d7ZYOf+m5080YDEf9gnFnL+DJNmMbWXISixe9zFv/t/FhdceHHf1xKWp4dFFhCjMv18xMIEVVEzIyLwNwL4UpF+p3Kks6RdysclAS0FFX/gFTNH5io5xTp7UprtIKvSYz4oPl1NSp8qYMWuHV7J8KN5Jh1zPfx7OGk7UemyYwNQbasfsxpoYC6Zb8a8W+1684xRqioEZLSL4IhGcz0GsjpP+Yt+KOjZoqcWfro5OdjR+Yz4uxFANi/FN3xerIwS4Keqlk164YA/n42O0nY0sebQ88daIwpEYkW6HsqnUd7Q6WmeCu66DunAcKERp+gxqf13fFHvf35QfeQ=,iv:Pj+Klu+N9UJAEffVRU+otBN2kJTpTEYXSmAlXH22NNM=,tag:FLvtFwm4bo2HumU8/q1Ckw==,type:str]
|
awg3-spec: ENC[AES256_GCM,data:2F+edwAugIjiPbPbanXl8GsfDcijHxg0N4jIExgcbn0AaAJpx78bJq7dwk4ahuVZX6HcYH+07d7ZYOf+m5080YDEf9gnFnL+DJNmMbWXISixe9zFv/t/FhdceHHf1xKWp4dFFhCjMv18xMIEVVEzIyLwNwL4UpF+p3Kks6RdysclAS0FFX/gFTNH5io5xTp7UprtIKvSYz4oPl1NSp8qYMWuHV7J8KN5Jh1zPfx7OGk7UemyYwNQbasfsxpoYC6Zb8a8W+1684xRqioEZLSL4IhGcz0GsjpP+Yt+KOjZoqcWfro5OdjR+Yz4uxFANi/FN3xerIwS4Keqlk164YA/n42O0nY0sebQ88daIwpEYkW6HsqnUd7Q6WmeCu66DunAcKERp+gxqf13fFHvf35QfeQ=,iv:Pj+Klu+N9UJAEffVRU+otBN2kJTpTEYXSmAlXH22NNM=,tag:FLvtFwm4bo2HumU8/q1Ckw==,type:str]
|
||||||
|
bogale-passwd: ENC[AES256_GCM,data:jPm/6XkoN66AWj5xPHGfI/IyKKOiUhP7nY9bVP0gWKLUGDemIannbHMA8RQeN7FQEwDocqPdkawNq5MWu+mb8uECMAyMyE5FSg==,iv:eEzG393tJNFKWI2Qeg9Fc6o7x7KblBBRJj9HDT3R70I=,tag:klbG/O/w0VWR4do+1pzfhQ==,type:str]
|
||||||
|
cf-token: ENC[AES256_GCM,data:AZoJXvWKZJ/BsiUzWcThh0wpIuQOM5eedt5bQh7gVdTIsjzqX3rDYjZx6qD3rh0TrNzStHs=,iv:CgocnA9+RqC3ZyQbBtw+QMNk/CXkVO+k0/OhM9OkSVA=,tag:ag+mwaidSloklqNHwwBchw==,type:str]
|
||||||
|
dovecot-pw: ENC[AES256_GCM,data:KzSipWmrm4zHq/aj6lfPSkyk20EB2Qqfn8nKLks4x/OsHz0KxJukGgM3K7ZVFIn2yXoUvw30KdmXwJC0pkFpr4G9wprQFjgL7FwYVPi+RQpd9ZAIjT4x56IxTkIIreU95mNkuVTid5fdpN5hBDH2XwUrMlUAhpTR6twtOd8=,iv:Y56qjTrGIfk8/kF4BqtodrN/gQ2f3y68M6fpJA1ZhX4=,tag:EYPyhwlFIX6SdD2azox20Q==,type:str]
|
||||||
|
grafana-key: ENC[AES256_GCM,data:fN1Uysxlw79XB4LpW2V0WUTqVxRaWbC9KMurszwHI/gHY4CUgCYTOXxQHjJ31FNfXQXt5HIi6VqQnK0PKpwlcw==,iv:ah5/weyVPeK0jj/nmOp2XChPIYBaPi4m6q22bUt4J/8=,tag:RQNkwUiJQ3x5sDFRrKnzzA==,type:str]
|
||||||
|
nextcloud-pw: ENC[AES256_GCM,data:9eygcJ43j90OUdxXynD5UlwCl9w=,iv:XIb/fg4zHu6s3MpR+YgCc6Myy99WVniIBxYjyTuD3fo=,tag:pUVcu7bow2loR0IQWxm7Tw==,type:str]
|
||||||
|
root-passwd: ENC[AES256_GCM,data:taTvrqyI90UsBufUi+tFSNhcJNBo/+Owb9Zy+83PFA8J9I2ukz0TUafDMzxN/bI1whSlOnb/fq/ESi+ewGj5wxrIVimYE6/jJQ==,iv:ze9UccF64S113wLP/6lFunk5KqIAf8d5hISXHkFg5t8=,tag:dzozycgw77PXIyqio58Qkg==,type:str]
|
||||||
|
smtp-sasl: ENC[AES256_GCM,data:SmAYdhcMNFqLqGgLOCcvAT+V6K5Mzd45aoAczPtHk3G9THDCJttI/hxYLTa8xw32opzPPackboSB71kytRNnhA==,iv:dGwsbKsKT0TnUSw7KJX9AIvpEr9qoGdBFi9QHNV9kS0=,tag:LTfVAjQ3TF//jUvq9E6Bog==,type:str]
|
||||||
|
tgbot-env: ENC[AES256_GCM,data:B/MNagCs/j7rQKMqSobQMbV5fcEWoJ+8Xpecv00L69Z7vFRMa7TlBCCztCFGAS0ahO27BPDW/FZfcgfFui6oGR5fgqCb/oGQXLPvk/0vEAliCyneeVSgTZZu1ODJUOGXF5msBdmLDbWO/3Rw3fZWsxf2+GizFKLacT9FnSXqm0E+CM5fcZRpn8Ofv5c+fCDGtlhBGilotGgYGkmAMZEQEnj/b3HzJw==,iv:hpVo3+wiqDWxAVWcGB1jUKcuwUg8KyjIZ5u7CQKrm3g=,tag:pHpvNI3H/rGYqy5G8a1PKA==,type:str]
|
||||||
|
vaultwarden-env: ENC[AES256_GCM,data:d9C9Nm+dQUOlK3Un5sw3nSY0gRLfXRDL0/rBNQ4EMze5FV+3kDN6O2C1TN0+cO1a3nCxKlrhIPqqFvSI/PoSp+axrVle//aWxZd/aON0x/y7LkSrupd+lpzMqDtG9lHZH+dDoMCOfuEgANBWur6Mw3xZsC8YjLnb8iGw8xDcxEUrJ88t,iv:XGz7G42xYR5TxlOrKYJK7nOAZZacQcLEPzkSktg3Gag=,tag:DofrMeGGf+xELSpN+YEguw==,type:str]
|
||||||
|
wifi-env: ENC[AES256_GCM,data:22s1o+2Dvf6HcDlfUPWVgMldjKl7k8wNicsisoX7p7uIP+BBx4WPpNFINtYO/UllDL22XiJs+4k1+7W+o+baCHFXdTZAi+psF9CeYqdogRUUrUIOokdEuxRFZFTsANDU8ljb88THz5Pn3wuZyhoVVaM=,iv:c3lEYdzh+nW/vATGiv4BRD70rP8qwwI1hZnT8LG6DE0=,tag:gQTZR3c6womkaQCHvb4ozg==,type:str]
|
||||||
sops:
|
sops:
|
||||||
age:
|
age:
|
||||||
- enc: |
|
- enc: |
|
||||||
|
|
@ -17,7 +24,7 @@ sops:
|
||||||
xofUgJG+4M8o0libyI7KjGrOiQNqIe6/WVbR+KcbNwxPtOA1+mfYyQ==
|
xofUgJG+4M8o0libyI7KjGrOiQNqIe6/WVbR+KcbNwxPtOA1+mfYyQ==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
recipient: age1gqcjvqqaf6mh2p4uhtx2cym69xhu3n3tr82dzzqp8qrmh6nsaurqed3zqy
|
recipient: age1gqcjvqqaf6mh2p4uhtx2cym69xhu3n3tr82dzzqp8qrmh6nsaurqed3zqy
|
||||||
lastmodified: "2026-10-24T07:56:22Z"
|
lastmodified: "2026-10-25T03:43:35Z"
|
||||||
mac: ENC[AES256_GCM,data:/p2O0wvj9FsRMfE5P3XO7eagkGOc9t2P10mCL+frlvDqiTql4DQIhP1TslSNCroiwkvvkCQsfeXTOHaibJXZUIM0BAx8/C/3cGH9qaWlSWjXS0H3ItiiJ3q/NHSJol5YnQP/Z7GTyD2WGBgNrffA3eL4pqP1zJ84wTbzyOzcPVo=,iv:khmzu/WXlek6I9pLj1+j5f/gzHIcGZCIqct7IvmNdXs=,tag:WtitTkufK5nyPhRN98Tj/A==,type:str]
|
mac: ENC[AES256_GCM,data:AMHkVxOjMUb5hUC36XPwItPtygxvko6QaQJkQJ8xrdaExWogeeJR3AUeXqidEz6CPQeMhd/iOd6H7UrRija14Oxy3nIj6sY4CLoCkXfwYneC1gXJT+ruErgjgOCinOuYhof/ROtwuTYnMfX8bwyDstn24vnOyhnGPwySi+LKLSs=,iv:Zld3CIQtvzdi4Ta+rp4Q+cnvae8AQPWZk+JxP372pOM=,tag:j2sMObA0bUAsfDwWv/h96Q==,type:str]
|
||||||
unencrypted_suffix: _unencrypted
|
unencrypted_suffix: _unencrypted
|
||||||
version: 3.13.3
|
version: 3.13.3
|
||||||
|
|
|
||||||
175
common.nix
175
common.nix
|
|
@ -1,102 +1,123 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
boot = {
|
||||||
time.timeZone = "Asia/Chita";
|
extraModulePackages = [ config.boot.kernelPackages.amneziawg ];
|
||||||
system.stateVersion = "26.11";
|
kernelModules = [ "amneziawg" ];
|
||||||
i18n.defaultLocale = "ru_RU.UTF-8";
|
kernelPackages = pkgs.linuxPackages_latest;
|
||||||
swapDevices = [ { device = "/var/swapfile"; } ];
|
loader.limine = {
|
||||||
imports = [ ./mods/pxeboot.nix ./mods/vps-init.nix ];
|
enable = true;
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
panicOnChecksumMismatch = true;
|
||||||
users.users.root.hashedPasswordFile = sops.secrets.root-passwd.path;
|
secureBoot.enable = true;
|
||||||
|
};
|
||||||
|
zswap = {
|
||||||
|
enable = true;
|
||||||
|
maxPoolPercent = 15;
|
||||||
|
};
|
||||||
|
};
|
||||||
console = {
|
console = {
|
||||||
font = "cyr-sun16";
|
font = "${pkgs.kbd}/share/consolefonts/cyr-sun16.psfu.gz";
|
||||||
keyMap = "ruwin_alt_sh-UTF-8";
|
keyMap = "ruwin_alt_sh-UTF-8";
|
||||||
};
|
};
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
_7zz
|
||||||
|
binutils
|
||||||
|
file
|
||||||
|
jq
|
||||||
|
openssl
|
||||||
|
python314
|
||||||
|
qrencode
|
||||||
|
sbctl
|
||||||
|
sops
|
||||||
|
speedtest-go
|
||||||
|
];
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/".options = [ "noatime" ];
|
"/".options = [ "noatime" ];
|
||||||
"/boot".options = [ "noatime" ];
|
"/boot".options = [ "noatime" ];
|
||||||
};
|
};
|
||||||
systemd.tmpfiles.rules = [
|
i18n.defaultLocale = "ru_RU.UTF-8";
|
||||||
"d /root/backup"
|
imports = [
|
||||||
"d /root/backup/base"
|
./mods/pxeboot.nix
|
||||||
"L /root/backup/base/root - - - - /root"
|
./mods/vps-init.nix
|
||||||
"L /root/backup/base/nixos - - - - /etc/nixos"
|
|
||||||
"L /root/backup/base/sbctl - - - - /var/lib/sbctl"
|
|
||||||
];
|
];
|
||||||
boot = {
|
|
||||||
kernelModules = [ "amneziawg" ];
|
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
extraModulePackages = [ config.boot.kernelPackages.amneziawg ];
|
|
||||||
loader.limine = {
|
|
||||||
enable = true;
|
|
||||||
secureBoot.enable = true;
|
|
||||||
panicOnChecksumMismatch = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services.dnsmasq = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
enable-ra = true;
|
|
||||||
no-resolv = true;
|
|
||||||
bogus-priv = true;
|
|
||||||
cache-size = 4096;
|
|
||||||
domain-needed = true;
|
|
||||||
server = [ "1.1.1.2" "1.0.0.2" "2606:4700:4700::1112" "2606:4700:4700::1002" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
jq
|
|
||||||
_7zz
|
|
||||||
file
|
|
||||||
sops
|
|
||||||
sbctl
|
|
||||||
openssl
|
|
||||||
binutils
|
|
||||||
qrencode
|
|
||||||
python314
|
|
||||||
speedtest-go
|
|
||||||
];
|
|
||||||
sops = {
|
|
||||||
defaultSopsFile = ./.secrets.yaml;
|
|
||||||
secrets = {
|
|
||||||
awg-obf = {};
|
|
||||||
wifi-env = {};
|
|
||||||
root-passwd = {};
|
|
||||||
};
|
|
||||||
age = {
|
|
||||||
generateKey = true;
|
|
||||||
sshKeyPaths = [ "/root/.ssh/sops" ];
|
|
||||||
keyFile = "/var/lib/sops-nix/key.txt";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
networking = {
|
networking = {
|
||||||
wg-quick.interfaces.awg0 = {
|
|
||||||
type = "amneziawg";
|
|
||||||
peers = [ {
|
|
||||||
endpoint = "bogaledev.ru";
|
|
||||||
allowedIPs = [ "::/0" "0.0.0.0/0" ];
|
|
||||||
} ];
|
|
||||||
};
|
|
||||||
networkmanager = {
|
networkmanager = {
|
||||||
enable = true;
|
|
||||||
dns = "dnsmasq";
|
dns = "dnsmasq";
|
||||||
|
enable = true;
|
||||||
ensureProfiles = {
|
ensureProfiles = {
|
||||||
environmentFiles = [ config.sops.secrets.wifi-env.path ];
|
environmentFiles = [ config.sops.secrets.wifi-env.path ];
|
||||||
profiles.home-wifi = {
|
profiles.home-wifi = {
|
||||||
wifi-security.key-mgmt = "sae";
|
|
||||||
connection = {
|
connection = {
|
||||||
type = "wifi";
|
|
||||||
id = "home-wifi";
|
id = "home-wifi";
|
||||||
};
|
type = "wifi";
|
||||||
ipv6 = {
|
|
||||||
method = "manual";
|
|
||||||
gateway = "fc01::1";
|
|
||||||
};
|
};
|
||||||
ipv4 = {
|
ipv4 = {
|
||||||
method = "manual";
|
|
||||||
gateway = "10.1.0.1";
|
gateway = "10.1.0.1";
|
||||||
|
method = "manual";
|
||||||
|
};
|
||||||
|
ipv6 = {
|
||||||
|
gateway = "fc01::1";
|
||||||
|
method = "manual";
|
||||||
|
};
|
||||||
|
wifi-security.key-mgmt = "sae";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
wg-quick.interfaces.awg0 = {
|
||||||
|
peers = [
|
||||||
|
{
|
||||||
|
allowedIPs = [
|
||||||
|
"::/0"
|
||||||
|
"0.0.0.0/0"
|
||||||
|
];
|
||||||
|
endpoint = "bogaledev.ru";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "amneziawg";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
nix.settings.experimental-features = [
|
||||||
|
"flakes"
|
||||||
|
"nix-command"
|
||||||
|
];
|
||||||
|
services = {
|
||||||
|
dnsmasq = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
bogus-priv = true;
|
||||||
|
cache-size = 4096;
|
||||||
|
domain-needed = true;
|
||||||
|
enable-ra = true;
|
||||||
|
no-resolv = true;
|
||||||
|
server = [
|
||||||
|
"1.0.0.2"
|
||||||
|
"1.1.1.2"
|
||||||
|
"2606:4700:4700::1002"
|
||||||
|
"2606:4700:4700::1112"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
swapspace.enable = true;
|
||||||
|
};
|
||||||
|
sops = {
|
||||||
|
age = {
|
||||||
|
generateKey = true;
|
||||||
|
keyFile = "/var/lib/sops-nix/key.txt";
|
||||||
|
sshKeyPaths = [ "/root/.ssh/sops" ];
|
||||||
|
};
|
||||||
|
defaultSopsFile = ./.secrets.yaml;
|
||||||
|
secrets = {
|
||||||
|
awg-obf = { };
|
||||||
|
root-passwd = { };
|
||||||
|
wifi-env = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
system.stateVersion = "26.11";
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"L /root/backup/base/nixos - - - - /etc/nixos"
|
||||||
|
"L /root/backup/base/root - - - - /root"
|
||||||
|
"L /root/backup/base/sbctl - - - - /var/lib/sbctl"
|
||||||
|
"d /root/backup"
|
||||||
|
"d /root/backup/base"
|
||||||
|
];
|
||||||
|
time.timeZone = "Asia/Chita";
|
||||||
|
users.users.root.hashedPasswordFile = config.sops.secrets.root-passwd.path;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,84 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
|
||||||
imports = [ ../common.nix ./hardware.nix ];
|
|
||||||
boot.kernelParams = [ "hibernate.compressor=lz4" ];
|
boot.kernelParams = [ "hibernate.compressor=lz4" ];
|
||||||
environment.systemPackages = with pkgs; [ qemu binwalk android-tools ];
|
environment.systemPackages = with pkgs; [
|
||||||
programs = {
|
android-tools
|
||||||
niri.enable = true;
|
binwalk
|
||||||
virt-manager.enable = true;
|
qemu
|
||||||
};
|
];
|
||||||
hardware = {
|
hardware = {
|
||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
graphics.enable32Bit = true;
|
graphics.enable32Bit = true;
|
||||||
};
|
};
|
||||||
users.users.bogale = {
|
imports = [
|
||||||
uid = 1551;
|
../common.nix
|
||||||
isNormalUser = true;
|
./hardware.nix
|
||||||
extraGroups = [ "wheel" "libvirtd" "networkmanager" ];
|
];
|
||||||
users.users.root.hashedPasswordFile = sops.secrets.bogale-passwd.path;
|
networking = {
|
||||||
|
firewall.allowedTCPPorts = [ 8000 ];
|
||||||
|
hostName = "nixos-desktop";
|
||||||
|
networkmanager.ensureProfiles.profiles = {
|
||||||
|
dhcp-eth.connection = {
|
||||||
|
id = "dhcp-eth";
|
||||||
|
type = "ethernet";
|
||||||
|
};
|
||||||
|
home-wifi = {
|
||||||
|
ipv4.addresses = "10.1.0.3/16";
|
||||||
|
ipv6.addresses = "fc01::3/64";
|
||||||
|
wifi-security.psk = "$BOGALE_5_PSK";
|
||||||
|
wifi.ssid = "bogale_5";
|
||||||
|
};
|
||||||
|
phone-wifi = {
|
||||||
|
connection = {
|
||||||
|
id = "phone-wifi";
|
||||||
|
type = "wifi";
|
||||||
|
};
|
||||||
|
wifi-security = {
|
||||||
|
key-mgmt = "sae";
|
||||||
|
psk = "$HELLO_WORLD_PSK";
|
||||||
|
};
|
||||||
|
wifi.ssid = "Hello world";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
wg-quick.interfaces.awg0 = {
|
||||||
|
address = [
|
||||||
|
"10.0.0.3/32"
|
||||||
|
"fc00::3/128"
|
||||||
|
];
|
||||||
|
configFile = config.sops.templates.awg2-conf.path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs = {
|
||||||
|
niri.enable = true;
|
||||||
|
virt-manager.enable = true;
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
displayManager.noctalia-greeter = {
|
||||||
|
cursorTheme = {
|
||||||
|
name = "Bibata-Modern-Amber";
|
||||||
|
package = pkgs.bibata-cursors;
|
||||||
|
};
|
||||||
|
enable = true;
|
||||||
|
passwordlessSyncUsers = [ "bogale" ];
|
||||||
|
settings.cursor.size = 24;
|
||||||
|
};
|
||||||
|
greetd = {
|
||||||
|
enable = true;
|
||||||
|
settings.default_session = {
|
||||||
|
command = "${pkgs.noctalia-greeter}/bin/noctalia-greeter-session";
|
||||||
|
user = "greeter";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
tuned.enable = true;
|
||||||
|
upower = {
|
||||||
|
allowRiskyCriticalPowerAction = true;
|
||||||
|
criticalPowerAction = "Suspend";
|
||||||
|
enable = true;
|
||||||
|
percentageCritical = 10;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
sops = {
|
sops = {
|
||||||
secrets = {
|
secrets = {
|
||||||
|
|
@ -27,8 +90,17 @@
|
||||||
${config.sops.placeholder.awg2-spec}
|
${config.sops.placeholder.awg2-spec}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
users.users.bogale = {
|
||||||
|
extraGroups = [
|
||||||
|
"libvirtd"
|
||||||
|
"networkmanager"
|
||||||
|
"wheel"
|
||||||
|
];
|
||||||
|
hashedPasswordFile = config.sops.secrets.bogale-passwd.path;
|
||||||
|
isNormalUser = true;
|
||||||
|
uid = 1551;
|
||||||
|
};
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
spiceUSBRedirection.enable = true;
|
|
||||||
libvirtd = {
|
libvirtd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
qemu = {
|
qemu = {
|
||||||
|
|
@ -36,65 +108,6 @@
|
||||||
vhostUserPackages = [ pkgs.virtiofsd ];
|
vhostUserPackages = [ pkgs.virtiofsd ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
spiceUSBRedirection.enable = true;
|
||||||
networking = {
|
|
||||||
hostName = "nixos-desktop";
|
|
||||||
firewall.allowedTCPPorts = [ 8000 ];
|
|
||||||
wg-quick.interfaces.awg0 = {
|
|
||||||
address = [ "10.0.0.3/32" "fc00::3/128" ];
|
|
||||||
configFile = config.sops.templates.awg2-conf.path;
|
|
||||||
};
|
|
||||||
networkmanager.ensureProfiles.profiles = {
|
|
||||||
dhcp-eth.connection = {
|
|
||||||
id = "dhcp-eth";
|
|
||||||
type = "ethernet";
|
|
||||||
};
|
|
||||||
home-wifi = {
|
|
||||||
wifi.ssid = "bogale_5";
|
|
||||||
ipv6.addresses = "fc01::3/64";
|
|
||||||
ipv4.addresses = "10.1.0.3/16";
|
|
||||||
wifi-security.psk = "$BOGALE_5_PSK";
|
|
||||||
};
|
|
||||||
phone-wifi = {
|
|
||||||
wifi.ssid = "Hello world";
|
|
||||||
connection = {
|
|
||||||
type = "wifi";
|
|
||||||
id = "phone-wifi";
|
|
||||||
};
|
|
||||||
wifi-security = {
|
|
||||||
key-mgmt = "sae";
|
|
||||||
psk = "$HELLO_WORLD_PSK";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services = {
|
|
||||||
tuned.enable = true;
|
|
||||||
pipewire = {
|
|
||||||
enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
upower = {
|
|
||||||
enable = true;
|
|
||||||
percentageCritical = 10;
|
|
||||||
criticalPowerAction = "Suspend";
|
|
||||||
allowRiskyCriticalPowerAction = true;
|
|
||||||
};
|
|
||||||
greetd = {
|
|
||||||
enable = true;
|
|
||||||
settings.default_session = {
|
|
||||||
user = "greeter";
|
|
||||||
command = "${pkgs.noctalia-greeter}/bin/noctalia-greeter-session";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
displayManager.noctalia-greeter = {
|
|
||||||
enable = true;
|
|
||||||
settings.cursor.size = 24;
|
|
||||||
passwordlessSyncUsers = [ "bogale" ];
|
|
||||||
cursorTheme = {
|
|
||||||
name = "Bibata-Modern-Amber";
|
|
||||||
package = pkgs.bibata-cursors;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,45 @@
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
config,
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
lib,
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
boot = {
|
boot = {
|
||||||
|
initrd = {
|
||||||
|
availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"rtsx_usb_sdmmc"
|
||||||
|
"sd_mod"
|
||||||
|
"usb_storage"
|
||||||
|
"xhci_pci"
|
||||||
|
];
|
||||||
|
luks.devices.root.device = "/dev/disk/by-uuid/70ac6613-2e6c-4817-a0ce-43a97efb8bab";
|
||||||
|
};
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
kernelParams = [ "ttm.pages_limit=3014656" ];
|
kernelParams = [ "ttm.pages_limit=3014656" ];
|
||||||
initrd = {
|
|
||||||
luks.devices.root.device = "/dev/disk/by-uuid/70ac6613-2e6c-4817-a0ce-43a97efb8bab";
|
|
||||||
availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/" = {
|
"/" = {
|
||||||
fsType = "ext4";
|
|
||||||
device = "/dev/mapper/root";
|
device = "/dev/mapper/root";
|
||||||
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
"/boot" = {
|
"/boot" = {
|
||||||
fsType = "vfat";
|
|
||||||
device = "/dev/disk/by-uuid/2610-A769";
|
device = "/dev/disk/by-uuid/2610-A769";
|
||||||
options = [ "fmask=0077" "dmask=0077" ];
|
fsType = "vfat";
|
||||||
|
options = [
|
||||||
|
"dmask=0077"
|
||||||
|
"fmask=0077"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
swapDevices = [
|
||||||
|
{
|
||||||
|
device = "/var/lib/swapfile";
|
||||||
|
size = 15 * 1024;
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
70
flake.nix
70
flake.nix
|
|
@ -1,38 +1,60 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
sops-nix = {
|
|
||||||
url = "github:Mic92/sops-nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
};
|
};
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
sops-nix = {
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
url = "github:Mic92/sops-nix";
|
||||||
};
|
};
|
||||||
outputs = inputs@{ self, nixpkgs, sops-nix, home-manager, ... }: { nixosConfigurations = {
|
};
|
||||||
nixos-server = nixpkgs.lib.nixosSystem { modules = [
|
outputs =
|
||||||
./server/configuration.nix
|
inputs@{
|
||||||
sops-nix.nixosModules.sops
|
home-manager,
|
||||||
home-manager.nixosModules.home-manager { home-manager = {
|
nixpkgs,
|
||||||
useGlobalPkgs = true;
|
sops-nix,
|
||||||
useUserPackages = true;
|
...
|
||||||
extraSpecialArgs = { inherit inputs; };
|
}:
|
||||||
users.root = ./home/root.nix;
|
{
|
||||||
}; }
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;
|
||||||
]; };
|
nixosConfigurations = {
|
||||||
nixos-desktop = nixpkgs.lib.nixosSystem { modules = [
|
nixos-desktop = nixpkgs.lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
./desktop/configuration.nix
|
./desktop/configuration.nix
|
||||||
sops-nix.nixosModules.sops
|
home-manager.nixosModules.home-manager
|
||||||
home-manager.nixosModules.home-manager { home-manager = {
|
{
|
||||||
|
home-manager = {
|
||||||
|
extraSpecialArgs = { inherit inputs; };
|
||||||
|
sharedModules = [ inputs.sops-nix.homeManagerModules.sops ];
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
extraSpecialArgs = { inherit inputs; };
|
|
||||||
users = {
|
users = {
|
||||||
root = ./home/root.nix;
|
|
||||||
bogale = ./home/bogale.nix;
|
bogale = ./home/bogale.nix;
|
||||||
|
root = ./home/root.nix;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
];
|
||||||
|
};
|
||||||
|
nixos-server = nixpkgs.lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
|
./server/configuration.nix
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager = {
|
||||||
|
extraSpecialArgs = { inherit inputs; };
|
||||||
|
sharedModules = [ inputs.sops-nix.homeManagerModules.sops ];
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
users.root = ./home/root.nix;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}; }
|
|
||||||
]; };
|
|
||||||
}; };
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,67 +1,66 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
|
||||||
imports = [ ./common.nix ];
|
|
||||||
wayland.windowManager.niri.enable = true;
|
|
||||||
xdg.configFile."niri/config.kdl".source = ./mods/niri.kdl;
|
|
||||||
systemd.user.sessionVariables.QT_QPA_PLATFORMTHEME = "gtk3";
|
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
|
||||||
colorScheme = "dark";
|
colorScheme = "dark";
|
||||||
};
|
|
||||||
programs = {
|
|
||||||
noctalia = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd.enable = true;
|
|
||||||
settings = ./mods/noctalia.toml;
|
|
||||||
};
|
};
|
||||||
|
home = {
|
||||||
|
homeDirectory = "/home/bogale";
|
||||||
|
packages = with pkgs; [
|
||||||
|
alacritty
|
||||||
|
bibata-cursors
|
||||||
|
bluez
|
||||||
|
brave-origin
|
||||||
|
ffmpeg-headless
|
||||||
|
heroic
|
||||||
|
libqalculate
|
||||||
|
libreoffice
|
||||||
|
llama-cpp-vulkan
|
||||||
|
mpv
|
||||||
|
nvtopPackages.full
|
||||||
|
qbittorrent
|
||||||
|
telegram-desktop
|
||||||
|
thunderbird
|
||||||
|
];
|
||||||
|
pointerCursor = {
|
||||||
|
enable = true;
|
||||||
|
gtk.enable = true;
|
||||||
|
name = "Bibata-Modern-Amber";
|
||||||
|
package = pkgs.bibata-cursors;
|
||||||
|
size = 24;
|
||||||
|
x11.enable = true;
|
||||||
|
};
|
||||||
|
username = "bogale";
|
||||||
|
};
|
||||||
|
imports = [ ./common.nix ];
|
||||||
|
programs = {
|
||||||
bash = {
|
bash = {
|
||||||
sessionVariables.TTS_MODEL = "ggml-org/Qwen3-TTS-12Hz-1.7B-Base-GGUF";
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
session() {
|
session() {
|
||||||
sudo machinectl shell root@
|
sudo machinectl shell root@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
sessionVariables.TTS_MODEL = "ggml-org/Qwen3-TTS-12Hz-1.7B-Base-GGUF";
|
||||||
|
};
|
||||||
|
noctalia = {
|
||||||
|
enable = true;
|
||||||
|
settings = ./mods/noctalia.toml;
|
||||||
|
systemd.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.gammastep = {
|
services.gammastep = {
|
||||||
enable = true;
|
enable = true;
|
||||||
latitude = 52.0;
|
latitude = 52.0;
|
||||||
longitude = 113.5;
|
longitude = 113.5;
|
||||||
temperature = {
|
|
||||||
day = 6000;
|
|
||||||
night = 3000;
|
|
||||||
};
|
|
||||||
settings.general = {
|
settings.general = {
|
||||||
brightness-day = 0.9;
|
brightness-day = 0.9;
|
||||||
brightness-night = 0.6;
|
brightness-night = 0.6;
|
||||||
};
|
};
|
||||||
|
temperature = {
|
||||||
|
day = 6000;
|
||||||
|
night = 3000;
|
||||||
};
|
};
|
||||||
home = {
|
|
||||||
username = "bogale";
|
|
||||||
homeDirectory = "/home/bogale";
|
|
||||||
pointerCursor = {
|
|
||||||
size = 24;
|
|
||||||
enable = true;
|
|
||||||
gtk.enable = true;
|
|
||||||
x11.enable = true;
|
|
||||||
name = "Bibata-Modern-Amber";
|
|
||||||
package = pkgs.bibata-cursors;
|
|
||||||
};
|
|
||||||
packages = with pkgs; [
|
|
||||||
mpv
|
|
||||||
bluez
|
|
||||||
heroic
|
|
||||||
alacritty
|
|
||||||
libreoffice
|
|
||||||
qbittorrent
|
|
||||||
thunderbird
|
|
||||||
brave-origin
|
|
||||||
libqalculate
|
|
||||||
bibata-cursors
|
|
||||||
ffmpeg-headless
|
|
||||||
llama-cpp-vulkan
|
|
||||||
telegram-desktop
|
|
||||||
nvtopPackages.amd
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
systemd.user.sessionVariables.QT_QPA_PLATFORMTHEME = "gtk3";
|
||||||
|
wayland.windowManager.niri.enable = true;
|
||||||
|
xdg.configFile."niri/config.kdl".source = ./mods/niri.kdl;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,43 +1,45 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
|
||||||
services.ssh-agent.enable = true;
|
|
||||||
home = {
|
home = {
|
||||||
|
packages = [
|
||||||
|
pkgs.ncdu
|
||||||
|
pkgs.yt-dlp
|
||||||
|
];
|
||||||
stateVersion = "26.11";
|
stateVersion = "26.11";
|
||||||
packages = with pkgs; [ ncdu yt-dlp ];
|
|
||||||
};
|
};
|
||||||
programs = {
|
programs = {
|
||||||
ssh = {
|
|
||||||
enable = true;
|
|
||||||
enableDefaultConfig = false;
|
|
||||||
settings."*".SetEnv.TERM = "xterm-256color";
|
|
||||||
};
|
|
||||||
bash = {
|
bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
shellAliases.la = "ls -lAtr";
|
|
||||||
historyControl = [ "ignoreboth" ];
|
historyControl = [ "ignoreboth" ];
|
||||||
sessionVariables.PROMPT_COMMAND = "history -a";
|
sessionVariables.PROMPT_COMMAND = "history -a";
|
||||||
|
shellAliases.la = "ls -lAtr";
|
||||||
};
|
};
|
||||||
git = {
|
git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
init.defaultbranch = "main";
|
init.defaultbranch = "main";
|
||||||
user = {
|
user = {
|
||||||
name = "bogale";
|
|
||||||
email = "git@bogaledev.ru";
|
email = "git@bogaledev.ru";
|
||||||
|
name = "bogale";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
neovim = {
|
neovim = {
|
||||||
enable = true;
|
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
|
enable = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
set number
|
autocmd FileType nix set shiftwidth=2 tabstop=2
|
||||||
set expandtab
|
set expandtab
|
||||||
set tabstop=4
|
set number
|
||||||
set shiftwidth=4
|
|
||||||
set relativenumber
|
set relativenumber
|
||||||
autocmd FileType nix set tabstop=2 shiftwidth=2
|
set shiftwidth=4
|
||||||
|
set tabstop=4
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
ssh = {
|
||||||
|
enable = true;
|
||||||
|
enableDefaultConfig = false;
|
||||||
|
settings."*".SetEnv.TERM = "xterm-256color";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
services.ssh-agent.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,6 @@
|
||||||
include "./noctalia.kdl";
|
|
||||||
gestures { hot-corners { off; }; };
|
|
||||||
hotkey-overlay { skip-at-startup; };
|
|
||||||
screenshot-path "~/Multimedia/Screenshots/%Y-%m-%d_%H-%M-%S.png";
|
|
||||||
window-rule {
|
|
||||||
match app-id="mpv";
|
|
||||||
open-fullscreen true;
|
|
||||||
};
|
|
||||||
cursor {
|
|
||||||
xcursor-size 24;
|
|
||||||
xcursor-theme "Bibata-Modern-Amber";
|
|
||||||
};
|
|
||||||
layout {
|
|
||||||
center-focused-column "always";
|
|
||||||
default-column-width { proportion 0.8; };
|
|
||||||
};
|
|
||||||
window-rule {
|
|
||||||
open-floating false;
|
|
||||||
clip-to-geometry true;
|
|
||||||
geometry-corner-radius 8;
|
|
||||||
};
|
|
||||||
input {
|
|
||||||
touchpad {
|
|
||||||
dwt;
|
|
||||||
tap;
|
|
||||||
natural-scroll;
|
|
||||||
};
|
|
||||||
keyboard {
|
|
||||||
numlock;
|
|
||||||
xkb {
|
|
||||||
layout "us,ru";
|
|
||||||
options "grp:alt_shift_toggle";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
binds {
|
binds {
|
||||||
Mod+T { spawn "alacritty"; };
|
Alt+Print { screenshot-window; };
|
||||||
Mod+D { spawn-sh "noctalia msg panel-toggle launcher"; };
|
Ctrl+Print { screenshot-screen; };
|
||||||
Mod+E { spawn-sh "noctalia msg panel-toggle session"; };
|
|
||||||
Mod+S { spawn-sh "noctalia msg panel-toggle control-center"; };
|
|
||||||
Mod+Shift+S { spawn-sh "noctalia msg settings-open"; };
|
|
||||||
|
|
||||||
Mod+H { focus-column-left; };
|
|
||||||
Mod+J { focus-window-or-workspace-down; };
|
|
||||||
Mod+K { focus-window-or-workspace-up; };
|
|
||||||
Mod+L { focus-column-right; };
|
|
||||||
Mod+Shift+H { move-column-left; };
|
|
||||||
Mod+Shift+J { move-window-down-or-to-workspace-down; };
|
|
||||||
Mod+Shift+K { move-window-up-or-to-workspace-up; };
|
|
||||||
Mod+Shift+L { move-column-right; };
|
|
||||||
|
|
||||||
Mod+Ctrl+H { focus-monitor-left; };
|
Mod+Ctrl+H { focus-monitor-left; };
|
||||||
Mod+Ctrl+J { focus-monitor-down; };
|
Mod+Ctrl+J { focus-monitor-down; };
|
||||||
Mod+Ctrl+K { focus-monitor-up; };
|
Mod+Ctrl+K { focus-monitor-up; };
|
||||||
|
|
@ -57,22 +9,66 @@ binds {
|
||||||
Mod+Ctrl+Shift+J { move-column-to-monitor-down; };
|
Mod+Ctrl+Shift+J { move-column-to-monitor-down; };
|
||||||
Mod+Ctrl+Shift+K { move-column-to-monitor-up; };
|
Mod+Ctrl+Shift+K { move-column-to-monitor-up; };
|
||||||
Mod+Ctrl+Shift+L { move-column-to-monitor-right; };
|
Mod+Ctrl+Shift+L { move-column-to-monitor-right; };
|
||||||
|
Mod+D { spawn-sh "noctalia msg panel-toggle launcher"; };
|
||||||
XF86MonBrightnessUp { spawn-sh "noctalia msg brightness-up"; };
|
Mod+E { spawn-sh "noctalia msg panel-toggle session"; };
|
||||||
XF86MonBrightnessDown { spawn-sh "noctalia msg brightness-down"; };
|
Mod+F { maximize-column; };
|
||||||
XF86AudioRaiseVolume { spawn-sh "noctalia msg volume-up"; };
|
Mod+H { focus-column-left; };
|
||||||
XF86AudioLowerVolume { spawn-sh "noctalia msg volume-down"; };
|
Mod+J { focus-window-or-workspace-down; };
|
||||||
XF86AudioMute { spawn-sh "noctalia msg volume-mute"; };
|
Mod+K { focus-window-or-workspace-up; };
|
||||||
Shift+XF86AudioRaiseVolume { spawn-sh "noctalia msg mic-volume-up"; };
|
Mod+L { focus-column-right; };
|
||||||
Shift+XF86AudioLowerVolume { spawn-sh "noctalia msg mic-volume-down"; };
|
|
||||||
Shift+XF86AudioMute { spawn-sh "noctalia msg mic-mute"; };
|
|
||||||
|
|
||||||
Mod+O { toggle-overview; };
|
Mod+O { toggle-overview; };
|
||||||
Mod+Q { close-window; };
|
Mod+Q { close-window; };
|
||||||
Mod+F { maximize-column; };
|
Mod+S { spawn-sh "noctalia msg panel-toggle control-center"; };
|
||||||
Mod+Shift+F { fullscreen-window; };
|
Mod+Shift+F { fullscreen-window; };
|
||||||
|
Mod+Shift+H { move-column-left; };
|
||||||
|
Mod+Shift+J { move-window-down-or-to-workspace-down; };
|
||||||
|
Mod+Shift+K { move-window-up-or-to-workspace-up; };
|
||||||
|
Mod+Shift+L { move-column-right; };
|
||||||
Mod+Shift+P { power-off-monitors; };
|
Mod+Shift+P { power-off-monitors; };
|
||||||
|
Mod+Shift+S { spawn-sh "noctalia msg settings-open"; };
|
||||||
|
Mod+T { spawn "alacritty"; };
|
||||||
Print { screenshot; };
|
Print { screenshot; };
|
||||||
Alt+Print { screenshot-window; };
|
Shift+XF86AudioLowerVolume { spawn-sh "noctalia msg mic-volume-down"; };
|
||||||
Ctrl+Print { screenshot-screen; };
|
Shift+XF86AudioMute { spawn-sh "noctalia msg mic-mute"; };
|
||||||
|
Shift+XF86AudioRaiseVolume { spawn-sh "noctalia msg mic-volume-up"; };
|
||||||
|
XF86AudioLowerVolume { spawn-sh "noctalia msg volume-down"; };
|
||||||
|
XF86AudioMute { spawn-sh "noctalia msg volume-mute"; };
|
||||||
|
XF86AudioRaiseVolume { spawn-sh "noctalia msg volume-up"; };
|
||||||
|
XF86MonBrightnessDown { spawn-sh "noctalia msg brightness-down"; };
|
||||||
|
XF86MonBrightnessUp { spawn-sh "noctalia msg brightness-up"; };
|
||||||
|
};
|
||||||
|
cursor {
|
||||||
|
xcursor-size 24;
|
||||||
|
xcursor-theme "Bibata-Modern-Amber";
|
||||||
|
};
|
||||||
|
gestures { hot-corners { off; }; };
|
||||||
|
hotkey-overlay { skip-at-startup; };
|
||||||
|
include "./noctalia.kdl";
|
||||||
|
input {
|
||||||
|
keyboard {
|
||||||
|
numlock;
|
||||||
|
xkb {
|
||||||
|
layout "us,ru";
|
||||||
|
options "grp:alt_shift_toggle";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
touchpad {
|
||||||
|
dwt;
|
||||||
|
natural-scroll;
|
||||||
|
tap;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
layout {
|
||||||
|
center-focused-column "always";
|
||||||
|
default-column-width { proportion 0.8; };
|
||||||
|
};
|
||||||
|
screenshot-path "~/Multimedia/Screenshots/%Y-%m-%d_%H-%M-%S.png";
|
||||||
|
window-rule {
|
||||||
|
clip-to-geometry true;
|
||||||
|
geometry-corner-radius 8;
|
||||||
|
open-floating false;
|
||||||
|
};
|
||||||
|
window-rule {
|
||||||
|
match app-id="mpv";
|
||||||
|
open-fullscreen true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,112 +1,43 @@
|
||||||
[bar]
|
[bar]
|
||||||
order = [ "default" ]
|
order = [ "default" ]
|
||||||
|
|
||||||
[bar.default]
|
[bar.default]
|
||||||
center = [ "workspaces" ]
|
center = [ "workspaces" ]
|
||||||
enabled = true
|
|
||||||
end = [ "tray", "keyboard_layout", "battery", "notifications" ]
|
end = [ "tray", "keyboard_layout", "battery", "notifications" ]
|
||||||
margin_ends = 0
|
margin_ends = 0
|
||||||
start = [ "date", "clock", "sysmon" ]
|
start = [ "date", "clock", "sysmon" ]
|
||||||
widget_spacing = 12
|
widget_spacing = 12
|
||||||
|
|
||||||
[bar.default.dead_zone.actions]
|
[bar.default.dead_zone.actions]
|
||||||
right = "none"
|
right = "none"
|
||||||
|
|
||||||
[control_center]
|
[control_center]
|
||||||
hidden_tabs = [ "media", "audio", "monitor", "notifications" ]
|
|
||||||
|
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "wifi"
|
type = "wifi"
|
||||||
|
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "bluetooth"
|
type = "bluetooth"
|
||||||
|
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "caffeine"
|
type = "caffeine"
|
||||||
|
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "notification"
|
type = "notification"
|
||||||
|
|
||||||
[[control_center.shortcuts]]
|
[[control_center.shortcuts]]
|
||||||
type = "power_profile"
|
type = "power_profile"
|
||||||
|
|
||||||
[desktop_widgets]
|
|
||||||
enabled = false
|
|
||||||
schema_version = 2
|
|
||||||
widget_order = []
|
|
||||||
|
|
||||||
[desktop_widgets.grid]
|
|
||||||
cell_size = 16
|
|
||||||
major_interval = 4
|
|
||||||
visible = true
|
|
||||||
|
|
||||||
[desktop_widgets.widget]
|
|
||||||
|
|
||||||
[idle]
|
[idle]
|
||||||
behavior_order = [ "screen-off", "lock", "lock-and-suspend" ]
|
behavior_order = [ "screen-off", "lock", "lock-and-suspend" ]
|
||||||
|
|
||||||
[idle.behavior.lock]
|
[idle.behavior.lock]
|
||||||
action = "lock"
|
action = "lock"
|
||||||
enabled = true
|
enabled = true
|
||||||
timeout = 600.0
|
timeout = 600.0
|
||||||
|
|
||||||
[idle.behavior.lock-and-suspend]
|
[idle.behavior.lock-and-suspend]
|
||||||
action = "lock_and_suspend"
|
action = "lock_and_suspend"
|
||||||
enabled = true
|
enabled = true
|
||||||
timeout = 900.0
|
timeout = 900.0
|
||||||
|
|
||||||
[idle.behavior.screen-off]
|
[idle.behavior.screen-off]
|
||||||
action = "screen_off"
|
action = "screen_off"
|
||||||
enabled = true
|
enabled = true
|
||||||
timeout = 300.0
|
timeout = 300.0
|
||||||
|
|
||||||
[location]
|
[location]
|
||||||
address = "Chita"
|
address = "Chita"
|
||||||
|
|
||||||
[lockscreen]
|
|
||||||
fingerprint = false
|
|
||||||
|
|
||||||
[lockscreen_widgets]
|
|
||||||
enabled = false
|
|
||||||
schema_version = 2
|
|
||||||
widget_order = [ "lockscreen-login-box@eDP-1" ]
|
|
||||||
|
|
||||||
[lockscreen_widgets.grid]
|
|
||||||
cell_size = 16
|
|
||||||
major_interval = 4
|
|
||||||
visible = true
|
|
||||||
|
|
||||||
[lockscreen_widgets.widget."lockscreen-login-box@eDP-1"]
|
|
||||||
box_height = 196.0
|
|
||||||
box_width = 810.0
|
|
||||||
cx = 960.0
|
|
||||||
cy = 898.0
|
|
||||||
output = "eDP-1"
|
|
||||||
placement_height = 1080.0
|
|
||||||
placement_width = 1920.0
|
|
||||||
rotation = 0.0
|
|
||||||
type = "login_box"
|
|
||||||
|
|
||||||
[lockscreen_widgets.widget."lockscreen-login-box@eDP-1".settings]
|
|
||||||
background_color = "surface_variant"
|
|
||||||
background_opacity = 0.88
|
|
||||||
background_radius = 12.0
|
|
||||||
center_password_text = false
|
|
||||||
input_opacity = 1.0
|
|
||||||
input_radius = 6.0
|
|
||||||
layout = "regular"
|
|
||||||
show_caps_lock = true
|
|
||||||
show_keyboard_layout = true
|
|
||||||
show_login_button = true
|
|
||||||
show_media = true
|
|
||||||
show_session_buttons = true
|
|
||||||
show_unlock_hint = true
|
|
||||||
show_weather = true
|
|
||||||
|
|
||||||
[notification]
|
[notification]
|
||||||
history_retention_hours = 8
|
history_retention_hours = 8
|
||||||
layer = "overlay"
|
layer = "overlay"
|
||||||
|
|
||||||
[osd.kinds]
|
[osd.kinds]
|
||||||
bluetooth = false
|
bluetooth = false
|
||||||
caffeine = false
|
caffeine = false
|
||||||
|
|
@ -117,32 +48,26 @@ media = false
|
||||||
nightlight = false
|
nightlight = false
|
||||||
power_profile = false
|
power_profile = false
|
||||||
wifi = false
|
wifi = false
|
||||||
|
|
||||||
[shell]
|
[shell]
|
||||||
clipboard_enabled = false
|
clipboard_enabled = false
|
||||||
launch_apps_as_systemd_services = true
|
launch_apps_as_systemd_services = true
|
||||||
screen_time_enabled = true
|
screen_time_enabled = true
|
||||||
|
|
||||||
[shell.greeter_sync]
|
[shell.greeter_sync]
|
||||||
auto_sync = true
|
auto_sync = true
|
||||||
|
|
||||||
[shell.screen_corners]
|
[shell.screen_corners]
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "lock"
|
action = "lock"
|
||||||
countdown_seconds = 0.0
|
countdown_seconds = 0.0
|
||||||
enabled = true
|
enabled = true
|
||||||
shortcut = "1"
|
shortcut = "1"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
|
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "lock_and_suspend"
|
action = "lock_and_suspend"
|
||||||
countdown_seconds = 0.0
|
countdown_seconds = 0.0
|
||||||
enabled = true
|
enabled = true
|
||||||
shortcut = "2"
|
shortcut = "2"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
|
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "command"
|
action = "command"
|
||||||
command = "systemctl hibernate"
|
command = "systemctl hibernate"
|
||||||
|
|
@ -152,40 +77,26 @@ screen_time_enabled = true
|
||||||
label = "Гибернация"
|
label = "Гибернация"
|
||||||
shortcut = "3"
|
shortcut = "3"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
|
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "reboot"
|
action = "reboot"
|
||||||
countdown_seconds = 0.0
|
countdown_seconds = 0.0
|
||||||
enabled = true
|
enabled = true
|
||||||
shortcut = "4"
|
shortcut = "4"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
|
|
||||||
[[shell.session.actions]]
|
[[shell.session.actions]]
|
||||||
action = "shutdown"
|
action = "shutdown"
|
||||||
countdown_seconds = 0.0
|
countdown_seconds = 0.0
|
||||||
enabled = true
|
enabled = true
|
||||||
shortcut = "5"
|
shortcut = "5"
|
||||||
variant = "default"
|
variant = "default"
|
||||||
|
|
||||||
[theme]
|
[theme]
|
||||||
builtin = "Tokyo-Night"
|
builtin = "Tokyo-Night"
|
||||||
|
|
||||||
[theme.templates]
|
[theme.templates]
|
||||||
builtin_ids = [ "alacritty", "gtk3", "gtk4", "niri" ]
|
builtin_ids = [ "alacritty", "gtk3", "gtk4", "niri" ]
|
||||||
enable_community_templates = false
|
|
||||||
|
|
||||||
[wallpaper]
|
[wallpaper]
|
||||||
directory = "/home/bogale/Multimedia/Wallpapers"
|
directory = "/home/bogale/Multimedia/Wallpapers"
|
||||||
transition_on_startup = true
|
transition_on_startup = true
|
||||||
|
|
||||||
[wallpaper.default]
|
[wallpaper.default]
|
||||||
path = "/home/bogale/Multimedia/Wallpapers/main.jpg"
|
path = "/home/bogale/Multimedia/Wallpapers/main.jpg"
|
||||||
|
|
||||||
[wallpaper.last]
|
|
||||||
path = "/home/bogale/Multimedia/Wallpapers/main.jpg"
|
|
||||||
|
|
||||||
[wallpaper.monitors.eDP-1]
|
|
||||||
path = "/home/bogale/Multimedia/Wallpapers/main.jpg"
|
|
||||||
|
|
||||||
[weather]
|
[weather]
|
||||||
refresh_minutes = 10
|
refresh_minutes = 10
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,48 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
|
||||||
imports = [ ./common.nix ];
|
|
||||||
home = {
|
home = {
|
||||||
username = "root";
|
|
||||||
homeDirectory = "/root";
|
homeDirectory = "/root";
|
||||||
|
username = "root";
|
||||||
};
|
};
|
||||||
|
imports = [ ./common.nix ];
|
||||||
programs = {
|
programs = {
|
||||||
bash = {
|
bash = {
|
||||||
shellAliases.dd = "dd bs=1M conv=fsync status=progress";
|
|
||||||
sessionVariables.SOPS_AGE_KEY_FILE = "/var/lib/sops-nix/key.txt";
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
session() {
|
|
||||||
systemd-run -tGM bogale@ --user --wait $SHELL
|
|
||||||
}
|
|
||||||
awg-gen() {
|
awg-gen() {
|
||||||
PRIVATE=$(awg genkey)
|
PRIVATE=$(awg genkey)
|
||||||
|
echo "private: $PRIVATE"
|
||||||
printf "public: "
|
printf "public: "
|
||||||
echo $PRIVATE | awg pubkey
|
echo $PRIVATE | awg pubkey
|
||||||
echo "private: $PRIVATE"
|
|
||||||
printf "preshared: "
|
printf "preshared: "
|
||||||
awg genpsk
|
awg genpsk
|
||||||
}
|
}
|
||||||
|
session() {
|
||||||
|
systemd-run -tGM bogale@ --user --wait $SHELL
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
|
sessionVariables.SOPS_AGE_KEY_FILE = config.sops.age.keyFile;
|
||||||
|
shellAliases.dd = "dd bs=1M conv=fsync status=progress";
|
||||||
};
|
};
|
||||||
tmux = {
|
tmux = {
|
||||||
enable = true;
|
|
||||||
clock24 = true;
|
clock24 = true;
|
||||||
|
enable = true;
|
||||||
escapeTime = 0;
|
escapeTime = 0;
|
||||||
keyMode = "vi";
|
|
||||||
terminal = "screen-256color";
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
unbind C-b
|
|
||||||
set -g mouse on
|
|
||||||
set -g prefix M-f
|
|
||||||
bind f send-prefix
|
bind f send-prefix
|
||||||
bind h select-pane -L
|
bind h select-pane -L
|
||||||
|
bind i split-window -v
|
||||||
bind j select-pane -D
|
bind j select-pane -D
|
||||||
bind k select-pane -U
|
bind k select-pane -U
|
||||||
bind l select-pane -R
|
bind l select-pane -R
|
||||||
bind i split-window -v
|
|
||||||
bind u split-window -h
|
bind u split-window -h
|
||||||
|
set -g mouse on
|
||||||
|
set -g prefix M-f
|
||||||
set -s set-clipboard external
|
set -s set-clipboard external
|
||||||
set-option -g focus-events on
|
|
||||||
set-option -a terminal-features "xterm-256color:RGB"
|
set-option -a terminal-features "xterm-256color:RGB"
|
||||||
|
set-option -g focus-events on
|
||||||
|
unbind C-b
|
||||||
'';
|
'';
|
||||||
|
keyMode = "vi";
|
||||||
|
terminal = "screen-256color";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
environment.systemPackages = [ pkgs.grub2_efi ];
|
environment.systemPackages = [ pkgs.grub2_efi ];
|
||||||
virtualisation.oci-containers.containers.fedora-dracut = {
|
virtualisation.oci-containers.containers.fedora-dracut = {
|
||||||
|
|
@ -20,13 +24,22 @@
|
||||||
interface = "enp1s0";
|
interface = "enp1s0";
|
||||||
tftp-root = "/srv/tftp";
|
tftp-root = "/srv/tftp";
|
||||||
dhcp-boot = "grubx64.efi";
|
dhcp-boot = "grubx64.efi";
|
||||||
dhcp-range = [ "10.2.0.2,10.2.255.254,12h" "fc02::2,fc02::ffff:ffff:ffff:ffff,12h" ];
|
dhcp-range = [
|
||||||
|
"10.2.0.2,10.2.255.254,12h"
|
||||||
|
"fc02::2,fc02::ffff:ffff:ffff:ffff,12h"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
nfs.server = {
|
nfs.server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
exports = let
|
exports =
|
||||||
clients."10.2.0.0/16" = [ "mp" "rw" "no_root_squash" ];
|
let
|
||||||
in {
|
clients."10.2.0.0/16" = [
|
||||||
|
"mp"
|
||||||
|
"rw"
|
||||||
|
"no_root_squash"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
"/srv/nfs/arch/root" = clients;
|
"/srv/nfs/arch/root" = clients;
|
||||||
"/srv/nfs/fedora/root" = clients;
|
"/srv/nfs/fedora/root" = clients;
|
||||||
};
|
};
|
||||||
|
|
@ -34,8 +47,16 @@
|
||||||
};
|
};
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [ 53 2049 ];
|
allowedTCPPorts = [
|
||||||
allowedUDPPorts = [ 53 67 69 547 ];
|
53
|
||||||
|
2049
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
53
|
||||||
|
67
|
||||||
|
69
|
||||||
|
547
|
||||||
|
];
|
||||||
};
|
};
|
||||||
nat = {
|
nat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -62,7 +83,13 @@
|
||||||
services.pxeboot = {
|
services.pxeboot = {
|
||||||
before = [ "nfs-server.service" ];
|
before = [ "nfs-server.service" ];
|
||||||
requiredBy = [ "nfs-server.service" ];
|
requiredBy = [ "nfs-server.service" ];
|
||||||
path = with pkgs; [ xz curl e2fsprogs grub2_efi util-linux ];
|
path = with pkgs; [
|
||||||
|
xz
|
||||||
|
curl
|
||||||
|
e2fsprogs
|
||||||
|
grub2_efi
|
||||||
|
util-linux
|
||||||
|
];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
|
|
@ -77,7 +104,8 @@
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
script = let
|
script =
|
||||||
|
let
|
||||||
resolv = pkgs.writeText "resolv.conf" ''
|
resolv = pkgs.writeText "resolv.conf" ''
|
||||||
nameserver fc02::1
|
nameserver fc02::1
|
||||||
nameserver 10.2.0.1
|
nameserver 10.2.0.1
|
||||||
|
|
@ -117,7 +145,8 @@
|
||||||
load fedora selinux=0
|
load fedora selinux=0
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
for distro in arch fedora; do
|
for distro in arch fedora; do
|
||||||
case $distro in
|
case $distro in
|
||||||
arch) url=${archIso.url}
|
arch) url=${archIso.url}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
|
||||||
sops = {
|
sops = {
|
||||||
secrets.awg0-spec = { };
|
secrets.awg0-spec = { };
|
||||||
templates.awg0-conf.content = ''
|
templates.awg0-conf.content = ''
|
||||||
|
|
@ -9,10 +8,9 @@
|
||||||
};
|
};
|
||||||
systemd.services.vps-init = {
|
systemd.services.vps-init = {
|
||||||
path = [ pkgs.openssh ];
|
path = [ pkgs.openssh ];
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
script = ''
|
script = ''
|
||||||
cd /root/run/awg
|
cd /root/run
|
||||||
date +%s > start-time
|
date +%s > awg-start-time
|
||||||
. vps-init.env
|
. vps-init.env
|
||||||
scp -i /root/.ssh/vps ${config.sops.templates.awg0-conf.path} $SSHCONN:awg0.conf
|
scp -i /root/.ssh/vps ${config.sops.templates.awg0-conf.path} $SSHCONN:awg0.conf
|
||||||
until cat <<'EOF' | ssh -i /root/.ssh/vps $SSHCONN
|
until cat <<'EOF' | ssh -i /root/.ssh/vps $SSHCONN
|
||||||
|
|
@ -26,18 +24,30 @@
|
||||||
FILENAME="$(mktemp)"
|
FILENAME="$(mktemp)"
|
||||||
(echo PasswordAuthentication no; cat sshd_config) > "$FILENAME"
|
(echo PasswordAuthentication no; cat sshd_config) > "$FILENAME"
|
||||||
mv "$FILENAME" sshd_config
|
mv "$FILENAME" sshd_config
|
||||||
fallocate -l 1GiB /var/swapfile
|
SIZE="$(awk '/MemTotal:/ { print $2 "KiB" }' /proc/meminfo)"
|
||||||
chmod 600 /var/swapfile
|
fallocate -l $SIZE /swapfile
|
||||||
mkswap /var/swapfile
|
chmod 600 /swapfile
|
||||||
echo "/var/swapfile none swap defaults 0 0" >> /etc/fstab
|
mkswap /swapfile
|
||||||
|
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
|
||||||
|
cd /etc/apt/apt.conf.d
|
||||||
|
cat <<' EOF' > 99policy
|
||||||
|
Dpkg::Options { "--force-confnew"; };
|
||||||
|
Unattended-Upgrade::Automatic-Reboot "true";
|
||||||
|
Unattended-Upgrade::Remove-Unused-Dependencies "true";
|
||||||
|
EOF
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y unattended-upgrades
|
||||||
|
cat <<' EOF' > 20auto-upgrades
|
||||||
|
APT::Periodic::Unattended-Upgrade "1";
|
||||||
|
APT::Periodic::Update-Package-Lists "1";
|
||||||
|
EOF
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold";;
|
apt-get dist-upgrade -y;;
|
||||||
1)
|
1)
|
||||||
cat <<' EOF' >> /etc/sysctl.conf
|
cat <<' EOF' >> /etc/sysctl.conf
|
||||||
net.ipv6.conf.all.forwarding = 1
|
|
||||||
net.ipv4.ip_forward = 1
|
|
||||||
net.ipv4.conf.all.forwarding = 1
|
net.ipv4.conf.all.forwarding = 1
|
||||||
|
net.ipv4.ip_forward = 1
|
||||||
|
net.ipv6.conf.all.forwarding = 1
|
||||||
EOF
|
EOF
|
||||||
for v in 6 ""; do
|
for v in 6 ""; do
|
||||||
ip''${v}tables -P FORWARD DROP
|
ip''${v}tables -P FORWARD DROP
|
||||||
|
|
@ -83,7 +93,8 @@
|
||||||
exit 1
|
exit 1
|
||||||
EOF
|
EOF
|
||||||
do sleep 1; done
|
do sleep 1; done
|
||||||
echo Installed in $(($(date +%s)-$(cat start-time)))s
|
echo Installed in $(($(date +%s)-$(cat awg-start-time)))s
|
||||||
'';
|
'';
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,71 +1,98 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
|
||||||
boot.kernelParams = [ "consoleblank=60" ];
|
boot.kernelParams = [ "consoleblank=60" ];
|
||||||
imports = [ ../common.nix ./hardware.nix ./mods/web.nix ./mods/mail.nix ./mods/system.nix ];
|
imports = [
|
||||||
|
../common.nix
|
||||||
|
./hardware.nix
|
||||||
|
./mods/mail.nix
|
||||||
|
./mods/system.nix
|
||||||
|
./mods/web.nix
|
||||||
|
];
|
||||||
|
networking = {
|
||||||
|
firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
25
|
||||||
|
443
|
||||||
|
465
|
||||||
|
80
|
||||||
|
993
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [ 443 ];
|
||||||
|
};
|
||||||
|
hostName = "nixos-server";
|
||||||
|
networkmanager.ensureProfiles.profiles.home-wifi = {
|
||||||
|
ipv4.addresses = "10.1.0.2/16";
|
||||||
|
ipv6.addresses = "fc01::2/64";
|
||||||
|
wifi-security.psk = "$BOGALE_2_4_PSK";
|
||||||
|
wifi.ssid = "bogale_2.4";
|
||||||
|
};
|
||||||
|
wg-quick.interfaces.awg0 = {
|
||||||
|
address = [
|
||||||
|
"10.0.0.2/32"
|
||||||
|
"fc00::2/128"
|
||||||
|
];
|
||||||
|
configFile = config.sops.templates.awg1-conf.path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
certs."bogaledev.ru" = {
|
||||||
|
credentialFiles.CF_DNS_API_TOKEN_FILE = config.sops.secrets.cf-token.path;
|
||||||
|
dnsProvider = "cloudflare";
|
||||||
|
extraDomainNames = [ "*.bogaledev.ru" ];
|
||||||
|
reloadServices = [
|
||||||
|
"dovecot.service"
|
||||||
|
"nginx.service"
|
||||||
|
"postfix.service"
|
||||||
|
];
|
||||||
|
validMinDays = 3;
|
||||||
|
};
|
||||||
|
defaults.email = "letsencrypt@bogaledev.ru";
|
||||||
|
};
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.PasswordAuthentication = false;
|
settings.PasswordAuthentication = false;
|
||||||
};
|
};
|
||||||
sops = {
|
sops = {
|
||||||
secrets.awg1-spec = {};
|
secrets = {
|
||||||
|
awg1-spec = { };
|
||||||
|
cf-token = { };
|
||||||
|
};
|
||||||
templates.awg1-conf.content = ''
|
templates.awg1-conf.content = ''
|
||||||
${config.sops.placeholder.awg-obf}
|
${config.sops.placeholder.awg-obf}
|
||||||
${config.sops.placeholder.awg1-spec}
|
${config.sops.placeholder.awg1-spec}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d /root/backup/server"
|
|
||||||
"L /root/backup/server/http - - - - /srv/http"
|
|
||||||
"L /root/backup/server/acme - - - - /var/lib/acme"
|
"L /root/backup/server/acme - - - - /var/lib/acme"
|
||||||
"L /root/backup/server/mail - - - - /var/spool/mail"
|
|
||||||
"L /root/backup/server/forgejo - - - - /var/lib/forgejo"
|
"L /root/backup/server/forgejo - - - - /var/lib/forgejo"
|
||||||
|
"L /root/backup/server/http - - - - /srv/http"
|
||||||
|
"L /root/backup/server/mail - - - - /var/spool/mail"
|
||||||
"L /root/backup/server/postgresql - - - - /var/backup/postgresql"
|
"L /root/backup/server/postgresql - - - - /var/backup/postgresql"
|
||||||
|
"d /root/backup/server"
|
||||||
];
|
];
|
||||||
security.acme = {
|
|
||||||
acceptTerms = true;
|
|
||||||
defaults.email = "letsencrypt@bogaledev.ru";
|
|
||||||
certs."bogaledev.ru" = {
|
|
||||||
validMinDays = 3;
|
|
||||||
dnsProvider = "cloudflare";
|
|
||||||
extraDomainNames = [ "*.bogaledev.ru" ];
|
|
||||||
credentialFiles = { "CF_DNS_API_TOKEN_FILE" = "/secrets/cf-token"; };
|
|
||||||
reloadServices = [ "nginx.service" "dovecot.service" "postfix.service" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
networking = {
|
|
||||||
hostName = "nixos-server";
|
|
||||||
firewall = {
|
|
||||||
allowedUDPPorts = [ 443 ];
|
|
||||||
allowedTCPPorts = [ 25 80 443 465 993 ];
|
|
||||||
};
|
|
||||||
wg-quick.interfaces.awg0 = {
|
|
||||||
address = [ "10.0.0.2/32" "fc00::2/128" ];
|
|
||||||
configFile = config.sops.templates.awg1-conf.path;
|
|
||||||
};
|
|
||||||
networkmanager.ensureProfiles.profiles.home-wifi = {
|
|
||||||
wifi.ssid = "bogale_2.4";
|
|
||||||
ipv6.addresses = "fc01::2/64";
|
|
||||||
ipv4.addresses = "10.1.0.2/16";
|
|
||||||
wifi-security.psk = "$BOGALE_2_4_PSK";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
users = {
|
users = {
|
||||||
groups = {
|
groups = {
|
||||||
php.gid = 1568;
|
php.gid = 1568;
|
||||||
vmail.gid = 1819;
|
vmail.gid = 1819;
|
||||||
};
|
};
|
||||||
users = {
|
users = {
|
||||||
nginx.extraGroups = [ "php" "acme" "grafana" ];
|
nginx.extraGroups = [
|
||||||
root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTb4c1ISQSV34GN27GgaJ08jpiRM3Wul/iSWjQ6emTq" ];
|
"acme"
|
||||||
|
"grafana"
|
||||||
|
"php"
|
||||||
|
];
|
||||||
php = {
|
php = {
|
||||||
uid = 1568;
|
|
||||||
group = "php";
|
group = "php";
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
|
uid = 1568;
|
||||||
};
|
};
|
||||||
|
root.openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTb4c1ISQSV34GN27GgaJ08jpiRM3Wul/iSWjQ6emTq"
|
||||||
|
];
|
||||||
vmail = {
|
vmail = {
|
||||||
uid = 1819;
|
|
||||||
group = "vmail";
|
group = "vmail";
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
|
uid = 1819;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,41 @@
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
config,
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
lib,
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
boot = {
|
boot = {
|
||||||
|
initrd = {
|
||||||
|
availableKernelModules = [
|
||||||
|
"ahci"
|
||||||
|
"ehci_pci"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
"xhci_pci"
|
||||||
|
];
|
||||||
|
luks.devices.root.device = "/dev/disk/by-uuid/e0288e5e-87eb-453f-ab22-0d6e54576609";
|
||||||
|
};
|
||||||
kernelParams = [
|
kernelParams = [
|
||||||
"memmap=0x4000%0xbfb76000-4"
|
"memmap=0x4000%0xbfb76000-4"
|
||||||
"memmap=0x4000%0xbfb7a000-4"
|
"memmap=0x4000%0xbfb7a000-4"
|
||||||
];
|
];
|
||||||
initrd = {
|
|
||||||
availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "sd_mod" "sdhci_pci" ];
|
|
||||||
luks.devices.root.device = "/dev/disk/by-uuid/e0288e5e-87eb-453f-ab22-0d6e54576609";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/" = {
|
"/" = {
|
||||||
fsType = "ext4";
|
|
||||||
device = "/dev/mapper/root";
|
device = "/dev/mapper/root";
|
||||||
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
"/boot" = {
|
"/boot" = {
|
||||||
fsType = "vfat";
|
|
||||||
device = "/dev/disk/by-uuid/86F4-A8F1";
|
device = "/dev/disk/by-uuid/86F4-A8F1";
|
||||||
options = [ "fmask=0077" "dmask=0077" ];
|
fsType = "vfat";
|
||||||
|
options = [
|
||||||
|
"dmask=0077"
|
||||||
|
"fmask=0077"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,87 +1,111 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
postfixDir = "/var/spool/postfix";
|
postfixDir = "/var/spool/postfix";
|
||||||
in {
|
in
|
||||||
systemd.tmpfiles.rules = [ "d ${postfixDir} 0700 postfix postfix" ];
|
{
|
||||||
services = let
|
services =
|
||||||
|
let
|
||||||
sslCertDir = config.security.acme.certs."bogaledev.ru".directory;
|
sslCertDir = config.security.acme.certs."bogaledev.ru".directory;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
|
dovecot2 = {
|
||||||
|
enable = true;
|
||||||
|
settings =
|
||||||
|
let
|
||||||
|
postfix-mode = {
|
||||||
|
group = "postfix";
|
||||||
|
mode = "0600";
|
||||||
|
user = "postfix";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"namespace inbox" =
|
||||||
|
let
|
||||||
|
mailbox = name: {
|
||||||
|
auto = "subscribe";
|
||||||
|
mailbox_special_use = "\\${name}";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"mailbox Archive" = mailbox "Archive";
|
||||||
|
"mailbox Important" = mailbox "Flagged";
|
||||||
|
"mailbox Sent" = mailbox "Sent";
|
||||||
|
"mailbox Spam" = mailbox "Junk" // {
|
||||||
|
mailbox_autoexpunge = "45d";
|
||||||
|
};
|
||||||
|
"mailbox Trash" = mailbox "Trash" // {
|
||||||
|
mailbox_autoexpunge = "45d";
|
||||||
|
};
|
||||||
|
inbox = true;
|
||||||
|
};
|
||||||
|
"passdb passwd-file".passwd_file_path = config.sops.secrets.dovecot-pw.path;
|
||||||
|
"service auth"."unix_listener ${postfixDir}/auth" = postfix-mode;
|
||||||
|
"service lmtp"."unix_listener ${postfixDir}/lmtp" = postfix-mode;
|
||||||
|
auth_mechanisms = [ "plain" ];
|
||||||
|
dovecot_config_version = "2.4.5";
|
||||||
|
dovecot_storage_version = "2.4.5";
|
||||||
|
mail_driver = "maildir";
|
||||||
|
mail_gid = "vmail";
|
||||||
|
mail_path = "/var/spool/mail/vmail";
|
||||||
|
mail_uid = "vmail";
|
||||||
|
protocols = [
|
||||||
|
"imap"
|
||||||
|
"lmtp"
|
||||||
|
];
|
||||||
|
ssl = "required";
|
||||||
|
ssl_server_cert_file = "${sslCertDir}/fullchain.pem";
|
||||||
|
ssl_server_key_file = "${sslCertDir}/key.pem";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
postfix = {
|
||||||
|
enable = true;
|
||||||
|
enableSubmissions = true;
|
||||||
|
mapFiles.smtp-sasl = config.sops.secrets.smtp-sasl.path;
|
||||||
|
settings.main = {
|
||||||
|
relayhost = [ "smtp.resend.com:2465" ];
|
||||||
|
smtp_sasl_auth_enable = true;
|
||||||
|
smtp_sasl_password_maps = "hash:/etc/postfix/smtp-sasl";
|
||||||
|
smtp_sasl_tls_security_options = "noanonymous";
|
||||||
|
smtp_tls_security_level = "verify";
|
||||||
|
smtp_tls_wrappermode = true;
|
||||||
|
smtpd_tls_chain_files = [
|
||||||
|
"${sslCertDir}/key.pem"
|
||||||
|
"${sslCertDir}/fullchain.pem"
|
||||||
|
];
|
||||||
|
smtpd_tls_security_level = "encrypt";
|
||||||
|
virtual_mailbox_domains = "bogaledev.ru";
|
||||||
|
virtual_transport = "lmtp:unix:${postfixDir}/lmtp";
|
||||||
|
};
|
||||||
|
submissionsOptions = {
|
||||||
|
milter_macro_daemon_name = "ORIGINATING";
|
||||||
|
smtpd_client_restrictions = "permit_sasl_authenticated,reject";
|
||||||
|
smtpd_sasl_auth_enable = "yes";
|
||||||
|
smtpd_sasl_path = "${postfixDir}/auth";
|
||||||
|
smtpd_sasl_type = "dovecot";
|
||||||
|
smtpd_tls_wrappermode = true;
|
||||||
|
};
|
||||||
|
virtual = "/.*@bogaledev.ru/ mail@bogaledev.ru";
|
||||||
|
virtualMapType = "regexp";
|
||||||
|
};
|
||||||
redis.servers.rspamd = {
|
redis.servers.rspamd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "rspamd";
|
user = "rspamd";
|
||||||
};
|
};
|
||||||
rspamd = {
|
rspamd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
postfix.enable = true;
|
|
||||||
locals = {
|
locals = {
|
||||||
"classifier-bayes.conf".text = "autolearn = true;";
|
"classifier-bayes.conf".text = "autolearn = true;";
|
||||||
"redis.conf".text = ''servers = "${config.services.redis.servers.rspamd.unixSocket}";'';
|
"redis.conf".text = ''servers = "${config.services.redis.servers.rspamd.unixSocket}";'';
|
||||||
};
|
};
|
||||||
};
|
postfix.enable = true;
|
||||||
postfix = {
|
|
||||||
enable = true;
|
|
||||||
enableSubmissions = true;
|
|
||||||
virtualMapType = "regexp";
|
|
||||||
mapFiles.smtp_passwd = "/secrets/smtp_passwd";
|
|
||||||
virtual = "/.*@bogaledev.ru/ mail@bogaledev.ru";
|
|
||||||
submissionsOptions = {
|
|
||||||
smtpd_sasl_type = "dovecot";
|
|
||||||
smtpd_tls_wrappermode = true;
|
|
||||||
smtpd_sasl_auth_enable = "yes";
|
|
||||||
smtpd_sasl_path = "${postfixDir}/auth";
|
|
||||||
milter_macro_daemon_name = "ORIGINATING";
|
|
||||||
smtpd_client_restrictions = "permit_sasl_authenticated,reject";
|
|
||||||
};
|
|
||||||
settings.main = {
|
|
||||||
smtp_tls_wrappermode = true;
|
|
||||||
smtp_sasl_auth_enable = true;
|
|
||||||
smtp_tls_security_level = "verify";
|
|
||||||
smtpd_tls_security_level = "encrypt";
|
|
||||||
relayhost = [ "smtp.resend.com:2465" ];
|
|
||||||
virtual_mailbox_domains = "bogaledev.ru";
|
|
||||||
smtp_sasl_tls_security_options = "noanonymous";
|
|
||||||
virtual_transport = "lmtp:unix:${postfixDir}/lmtp";
|
|
||||||
smtp_sasl_password_maps = "hash:/etc/postfix/smtp_passwd";
|
|
||||||
smtpd_tls_chain_files = [ "${sslCertDir}/key.pem" "${sslCertDir}/fullchain.pem" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
dovecot2 = {
|
|
||||||
enable = true;
|
|
||||||
settings = let
|
|
||||||
postfix-mode = {
|
|
||||||
mode = "0600";
|
|
||||||
user = "postfix";
|
|
||||||
group = "postfix";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
ssl = "required";
|
|
||||||
mail_gid = "vmail";
|
|
||||||
mail_uid = "vmail";
|
|
||||||
mail_driver = "maildir";
|
|
||||||
auth_mechanisms = [ "plain" ];
|
|
||||||
protocols = [ "imap" "lmtp" ];
|
|
||||||
dovecot_config_version = "2.4.5";
|
|
||||||
dovecot_storage_version = "2.4.5";
|
|
||||||
mail_path = "/var/spool/mail/vmail";
|
|
||||||
ssl_server_key_file = "${sslCertDir}/key.pem";
|
|
||||||
ssl_server_cert_file = "${sslCertDir}/fullchain.pem";
|
|
||||||
"passdb passwd-file".passwd_file_path = "/secrets/dovecot-pw";
|
|
||||||
"service auth"."unix_listener ${postfixDir}/auth" = postfix-mode;
|
|
||||||
"service lmtp"."unix_listener ${postfixDir}/lmtp" = postfix-mode;
|
|
||||||
"namespace inbox" = let
|
|
||||||
mailbox = name: {
|
|
||||||
auto = "subscribe";
|
|
||||||
mailbox_special_use = "\\${name}";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
inbox = true;
|
|
||||||
"mailbox Sent" = mailbox "Sent";
|
|
||||||
"mailbox Archive" = mailbox "Archive";
|
|
||||||
"mailbox Important" = mailbox "Flagged";
|
|
||||||
"mailbox Spam" = mailbox "Junk" // { mailbox_autoexpunge = "45d"; };
|
|
||||||
"mailbox Trash" = mailbox "Trash" // { mailbox_autoexpunge = "45d"; };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
sops.secrets = {
|
||||||
|
dovecot-pw = {
|
||||||
|
group = "dovecot2";
|
||||||
|
mode = "0440";
|
||||||
};
|
};
|
||||||
|
smtp-sasl = { };
|
||||||
};
|
};
|
||||||
|
systemd.tmpfiles.rules = [ "d ${postfixDir} 0700 postfix" ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,69 +1,27 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
services.prometheus = {
|
||||||
services = {
|
|
||||||
prometheus = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
exporters.node.enable = true;
|
exporters.node.enable = true;
|
||||||
scrapeConfigs = [ {
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
job_name = "node";
|
job_name = "node";
|
||||||
static_configs = [ { targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; } ];
|
static_configs = [
|
||||||
} ];
|
{
|
||||||
};
|
targets = [
|
||||||
grafana = {
|
"localhost:${toString config.services.prometheus.exporters.node.port}"
|
||||||
enable = true;
|
];
|
||||||
settings = {
|
}
|
||||||
security.secret_key = "$__file{/secrets/grafana-key}";
|
];
|
||||||
database = {
|
}
|
||||||
user = "grafana";
|
];
|
||||||
type = "postgres";
|
|
||||||
host = "/run/postgresql";
|
|
||||||
};
|
|
||||||
server = {
|
|
||||||
enable_gzip = true;
|
|
||||||
protocol = "socket";
|
|
||||||
root_url = "https://bogaledev.ru/grafana";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
sops.secrets.tgbot-env = { };
|
||||||
systemd = {
|
systemd = {
|
||||||
timers = {
|
|
||||||
tgbot-send = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
timerConfig = {
|
|
||||||
Persistent = true;
|
|
||||||
OnCalendar = "*-*-01 16:00";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
network-watchdog = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
timerConfig = {
|
|
||||||
OnBootSec = 30;
|
|
||||||
AccuracySec = 1;
|
|
||||||
OnUnitActiveSec = 10;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services = {
|
services = {
|
||||||
tgbot-send = {
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
script = ''
|
|
||||||
. /secrets/tgbot.env
|
|
||||||
for msg in "''${MESSAGES[@]}"; do
|
|
||||||
TEXT="''${msg#*:}"
|
|
||||||
CHAT_ID="''${msg%%:*}"
|
|
||||||
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/$BOT/sendMessage" -d "chat_id=$CHAT_ID" -d "text=$TEXT" 2> /dev/null | ${pkgs.jq}/bin/jq
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
network-watchdog = {
|
network-watchdog = {
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
LogLevelMax = "warning";
|
|
||||||
};
|
|
||||||
script = ''
|
script = ''
|
||||||
if [ ! -e /run/network.failures ] || [ ! -e /run/network.limit ] || ${pkgs.curl}/bin/curl --head --max-time 3 https://www.google.com; then
|
if [ ! -e /run/network.failures ] || [ ! -e /run/network.limit ] || \
|
||||||
|
${pkgs.curl}/bin/curl --head --max-time 3 https://bogaledev.ru; then
|
||||||
limit=3
|
limit=3
|
||||||
failures=0
|
failures=0
|
||||||
else
|
else
|
||||||
|
|
@ -73,12 +31,48 @@
|
||||||
if [ $failures -ge $limit ]; then
|
if [ $failures -ge $limit ]; then
|
||||||
echo "<4>restarting network"
|
echo "<4>restarting network"
|
||||||
systemctl restart NetworkManager.service
|
systemctl restart NetworkManager.service
|
||||||
|
sleep 1
|
||||||
|
systemctl restart wg-quick-awg0.service
|
||||||
[ $limit -lt 360 ] && limit=$((2*$limit))
|
[ $limit -lt 360 ] && limit=$((2*$limit))
|
||||||
failures=0
|
failures=0
|
||||||
fi
|
fi
|
||||||
echo $limit > /run/network.limit
|
echo $limit > /run/network.limit
|
||||||
echo $failures > /run/network.failures
|
echo $failures > /run/network.failures
|
||||||
'';
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
LogLevelMax = "warning";
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tgbot-send = {
|
||||||
|
script = ''
|
||||||
|
. ${config.sops.secrets.tgbot-env.path}
|
||||||
|
for msg in "''${MESSAGES[@]}"; do
|
||||||
|
CHAT_ID="''${msg%%:*}"
|
||||||
|
TEXT="''${msg#*:}"
|
||||||
|
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/$BOT/sendMessage" \
|
||||||
|
-d "chat_id=$CHAT_ID" -d "text=$TEXT" 2> /dev/null | ${pkgs.jq}/bin/jq
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
timers = {
|
||||||
|
network-watchdog = {
|
||||||
|
timerConfig = {
|
||||||
|
AccuracySec = 1;
|
||||||
|
OnBootSec = 30;
|
||||||
|
OnUnitActiveSec = 10;
|
||||||
|
};
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
};
|
||||||
|
tgbot-send = {
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "*-*-01 16:00";
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,141 +1,184 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, ... }: {
|
||||||
{
|
services =
|
||||||
services = let
|
let
|
||||||
sslCertDir = config.security.acme.certs."bogaledev.ru".directory;
|
|
||||||
phpSettings = {
|
phpSettings = {
|
||||||
"pm" = "ondemand";
|
|
||||||
"pm.max_children" = 4;
|
|
||||||
"listen.group" = "nginx";
|
"listen.group" = "nginx";
|
||||||
"listen.owner" = "nginx";
|
"listen.owner" = "nginx";
|
||||||
|
"pm" = "ondemand";
|
||||||
|
"pm.max_children" = 4;
|
||||||
};
|
};
|
||||||
in {
|
sslCertDir = config.security.acme.certs."bogaledev.ru".directory;
|
||||||
dnsmasq.settings.cname = "nextcloud-local,localhost";
|
in
|
||||||
phpfpm.pools.php = {
|
{
|
||||||
user = "php";
|
|
||||||
group = "php";
|
|
||||||
settings = phpSettings;
|
|
||||||
};
|
|
||||||
postgresqlBackup = {
|
|
||||||
enable = true;
|
|
||||||
startAt = "16:00";
|
|
||||||
compression = "none";
|
|
||||||
databases = [ "php" "forgejo" "grafana" "nextcloud" "vaultwarden" ];
|
|
||||||
};
|
|
||||||
postgresql = {
|
|
||||||
enable = true;
|
|
||||||
ensureDatabases = [ "php" "grafana" ];
|
|
||||||
ensureUsers = let
|
|
||||||
user = name: {
|
|
||||||
inherit name;
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
};
|
|
||||||
in map user [ "php" "grafana" ];
|
|
||||||
};
|
|
||||||
nextcloud = {
|
|
||||||
enable = true;
|
|
||||||
poolSettings = phpSettings;
|
|
||||||
hostName = "nextcloud-local";
|
|
||||||
database.createLocally = true;
|
|
||||||
config = {
|
|
||||||
dbtype = "pgsql";
|
|
||||||
adminpassFile = "/secrets/nextcloud-pw";
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
overwritewebroot = "/nextcloud";
|
|
||||||
trusted_domains = [ "bogaledev.ru" "wl.bogaledev.ru" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
vaultwarden = {
|
|
||||||
enable = true;
|
|
||||||
configurePostgres = true;
|
|
||||||
dbBackend = "postgresql";
|
|
||||||
package = pkgs.vaultwarden-postgresql;
|
|
||||||
environmentFile = "/secrets/vw-token.env";
|
|
||||||
config = {
|
|
||||||
ROCKET_PORT = 46151;
|
|
||||||
SIGNUPS_ALLOWED = false;
|
|
||||||
TRASH_AUTO_DELETE_DAYS = 90;
|
|
||||||
PASSWORD_HINTS_ALLOWED = false;
|
|
||||||
EMERGENCY_ACCESS_ALLOWED = false;
|
|
||||||
DOMAIN = "https://bogaledev.ru/vaultwarden/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
forgejo = {
|
forgejo = {
|
||||||
enable = true;
|
|
||||||
database.type = "postgres";
|
database.type = "postgres";
|
||||||
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
mailer = {
|
||||||
|
ENABLED = true;
|
||||||
|
FROM = "Forgejo <forgejo@bogaledev.ru>";
|
||||||
|
SMTP_ADDR = "localhost";
|
||||||
|
SMTP_PORT = 25;
|
||||||
|
};
|
||||||
|
server = {
|
||||||
|
HTTP_ADDR = "/run/forgejo/forgejo.sock";
|
||||||
|
PROTOCOL = "http+unix";
|
||||||
|
ROOT_URL = "https://bogaledev.ru/git/";
|
||||||
|
SSH_PORT = 32831;
|
||||||
|
};
|
||||||
service = {
|
service = {
|
||||||
ENABLE_CAPTCHA = true;
|
ENABLE_CAPTCHA = true;
|
||||||
REGISTER_EMAIL_CONFIRM = true;
|
REGISTER_EMAIL_CONFIRM = true;
|
||||||
};
|
};
|
||||||
mailer = {
|
|
||||||
ENABLED = true;
|
|
||||||
SMTP_PORT = 25;
|
|
||||||
SMTP_ADDR = "localhost";
|
|
||||||
FROM = "Forgejo <forgejo@bogaledev.ru>";
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
grafana = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
database = {
|
||||||
|
host = "/run/postgresql";
|
||||||
|
type = "postgres";
|
||||||
|
user = "grafana";
|
||||||
|
};
|
||||||
|
security.secret_key = "$__file{${config.sops.secrets.grafana-key.path}}";
|
||||||
server = {
|
server = {
|
||||||
SSH_PORT = 32831;
|
enable_gzip = true;
|
||||||
PROTOCOL = "http+unix";
|
protocol = "socket";
|
||||||
ROOT_URL = "https://bogaledev.ru/git/";
|
root_url = "https://bogaledev.ru/grafana";
|
||||||
HTTP_ADDR = "/run/forgejo/forgejo.sock";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
nextcloud = {
|
||||||
|
config = {
|
||||||
|
adminpassFile = config.sops.secrets.nextcloud-pw.path;
|
||||||
|
dbtype = "pgsql";
|
||||||
|
};
|
||||||
|
database.createLocally = true;
|
||||||
|
enable = true;
|
||||||
|
hostName = "nextcloud-local";
|
||||||
|
poolSettings = phpSettings;
|
||||||
|
settings = {
|
||||||
|
htaccess.RewriteBase = "/nextcloud";
|
||||||
|
overwritewebroot = "/nextcloud";
|
||||||
|
trusted_domains = [
|
||||||
|
"bogaledev.ru"
|
||||||
|
"wl.bogaledev.ru"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
nginx = {
|
nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedBrotliSettings = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
recommendedOptimisation = true;
|
recommendedOptimisation = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedBrotliSettings = true;
|
recommendedTlsSettings = true;
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
nextcloud-local.listen = [ {
|
nextcloud-local.listen = [
|
||||||
|
{
|
||||||
|
addr = "localhost";
|
||||||
port = 45837;
|
port = 45837;
|
||||||
addr = "nextcloud-local";
|
}
|
||||||
} ];
|
];
|
||||||
main = let
|
main =
|
||||||
|
let
|
||||||
|
localNetworks = ''
|
||||||
|
allow 10.0.0.0/16;
|
||||||
|
allow 10.1.0.0/24;
|
||||||
|
allow fc00::/64;
|
||||||
|
allow fc01::/96;
|
||||||
|
deny all;
|
||||||
|
'';
|
||||||
phpPool = ''
|
phpPool = ''
|
||||||
index index.php index.html;
|
index index.php index.html;
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_pass unix:${config.services.phpfpm.pools.php.socket};
|
fastcgi_pass unix:${config.services.phpfpm.pools.php.socket};
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
localNetworks = ''
|
in
|
||||||
allow fc00::/64;
|
{
|
||||||
allow fc01::/96;
|
|
||||||
allow 10.0.0.0/16;
|
|
||||||
allow 10.1.0.0/24;
|
|
||||||
deny all;
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
quic = true;
|
|
||||||
default = true;
|
default = true;
|
||||||
forceSSL = true;
|
|
||||||
root = "/srv/http";
|
|
||||||
useACMEHost = "bogaledev.ru";
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Alt-Svc 'h3=":443"; ma=2592000' always;
|
add_header Alt-Svc 'h3=":443"; ma=2592000' always;
|
||||||
add_header X-Content-Type-Options 'nosniff' always;
|
add_header X-Content-Type-Options 'nosniff' always;
|
||||||
'';
|
'';
|
||||||
|
forceSSL = true;
|
||||||
locations = {
|
locations = {
|
||||||
"/".extraConfig = phpPool;
|
"/".extraConfig = phpPool;
|
||||||
"/local/".extraConfig = "${phpPool} ${localNetworks}";
|
|
||||||
"/nextcloud/".proxyPass = "http://nextcloud-local:45837/";
|
|
||||||
"/git/".proxyPass = "http://unix:/run/forgejo/forgejo.sock:/";
|
"/git/".proxyPass = "http://unix:/run/forgejo/forgejo.sock:/";
|
||||||
"/vaultwarden/" = {
|
|
||||||
proxyWebsockets = true;
|
|
||||||
extraConfig = localNetworks;
|
|
||||||
proxyPass = "http://localhost:46151";
|
|
||||||
};
|
|
||||||
"/grafana/" = {
|
"/grafana/" = {
|
||||||
proxyWebsockets = true;
|
|
||||||
extraConfig = localNetworks;
|
extraConfig = localNetworks;
|
||||||
proxyPass = "http://unix:/run/grafana/grafana.sock:/";
|
proxyPass = "http://unix:/run/grafana/grafana.sock:/";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
"/local/".extraConfig = "${phpPool} ${localNetworks}";
|
||||||
|
"/nextcloud/".proxyPass = "http://localhost:45837/";
|
||||||
|
"/vaultwarden/" = {
|
||||||
|
extraConfig = localNetworks;
|
||||||
|
proxyPass = "http://localhost:46151";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
quic = true;
|
||||||
|
root = "/srv/http";
|
||||||
|
useACMEHost = "bogaledev.ru";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
phpfpm.pools.php = {
|
||||||
|
group = "php";
|
||||||
|
settings = phpSettings;
|
||||||
|
user = "php";
|
||||||
|
};
|
||||||
|
postgresql = {
|
||||||
|
enable = true;
|
||||||
|
ensureDatabases = [
|
||||||
|
"grafana"
|
||||||
|
"php"
|
||||||
|
];
|
||||||
|
ensureUsers =
|
||||||
|
let
|
||||||
|
user = name: {
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
inherit name;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
map user [
|
||||||
|
"grafana"
|
||||||
|
"php"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
postgresqlBackup = {
|
||||||
|
compression = "none";
|
||||||
|
databases = [
|
||||||
|
"forgejo"
|
||||||
|
"grafana"
|
||||||
|
"nextcloud"
|
||||||
|
"php"
|
||||||
|
"vaultwarden"
|
||||||
|
];
|
||||||
|
enable = true;
|
||||||
|
startAt = "16:00";
|
||||||
|
};
|
||||||
|
vaultwarden = {
|
||||||
|
config = {
|
||||||
|
DOMAIN = "https://bogaledev.ru/vaultwarden/";
|
||||||
|
EMERGENCY_ACCESS_ALLOWED = false;
|
||||||
|
PASSWORD_HINTS_ALLOWED = false;
|
||||||
|
ROCKET_PORT = 46151;
|
||||||
|
SIGNUPS_ALLOWED = false;
|
||||||
|
TRASH_AUTO_DELETE_DAYS = 90;
|
||||||
|
};
|
||||||
|
configurePostgres = true;
|
||||||
|
dbBackend = "postgresql";
|
||||||
|
enable = true;
|
||||||
|
environmentFile = config.sops.secrets.vaultwarden-env.path;
|
||||||
|
package = pkgs.vaultwarden-postgresql;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
sops.secrets = {
|
||||||
|
grafana-key = { };
|
||||||
|
nextcloud-pw = { };
|
||||||
|
vaultwarden-env = { };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue