Compare commits
274 commits
a9267ed2b5
...
6a77f5dccc
Author | SHA1 | Date | |
---|---|---|---|
6a77f5dccc | |||
68fcbdb801 | |||
681fda20b4 | |||
426ec123e7 | |||
9068d571b6 | |||
6fb6eb40ba | |||
4b866be8d0 | |||
911791ed82 | |||
8bc4b1b212 | |||
b120cf124f | |||
5501cb2013 | |||
a003b2c485 | |||
fd8767339d | |||
9cc49198d8 | |||
723a2bfeaf | |||
68c7c97fb7 | |||
8d9c48d2b1 | |||
bc3aa28ff3 | |||
858caf82b8 | |||
37b218faf3 | |||
67d18985f6 | |||
66f6d92a40 | |||
7b775f79dd | |||
8e60859b12 | |||
726fd59717 | |||
fd32ee5f98 | |||
d62aa6471d | |||
075a0c1c18 | |||
9a1badafdf | |||
3cfad7689b | |||
92496ee96c | |||
f629a5f45e | |||
40f8cb5d03 | |||
b3e13afbb9 | |||
ca2e1a47d9 | |||
4efcd64030 | |||
fff02fed26 | |||
5b485226f2 | |||
7ef869da34 | |||
956e5d605d | |||
e8317fa408 | |||
c453fafc38 | |||
803d5dfef7 | |||
1f92eab5e2 | |||
3dd4201a3e | |||
4e4238fbef | |||
65f6c69ec3 | |||
3b334b3fe7 | |||
0ecd208b50 | |||
c1a216090b | |||
728d390197 | |||
8270fb3dfe | |||
7e4528b539 | |||
53ae20ad12 | |||
42e61c859b | |||
3c08169968 | |||
e8711b9ad6 | |||
d62dbe2f81 | |||
7a632f88bc | |||
e2e2d2327c | |||
ac6e778fe7 | |||
04dcc1b594 | |||
85d651de77 | |||
b8085b2f00 | |||
f6d15928f5 | |||
ba5b6bb554 | |||
ff0045605c | |||
ff4c1c33bf | |||
d6096e7a88 | |||
1c1ac1ae34 | |||
7f63055615 | |||
b9dda18e09 | |||
aa1a9244db | |||
8248693082 | |||
69fd18508b | |||
a94ffa8e08 | |||
28f65fde23 | |||
d298d246c8 | |||
9e97ffb3ac | |||
276635951a | |||
541cb406fc | |||
4d276825dd | |||
70a10ed565 | |||
931a59b955 | |||
9c7ac68ae4 | |||
6ba8f3d21b | |||
228113a72c | |||
bb17130b09 | |||
242a87bedb | |||
11fb5b4921 | |||
573ce0d8e6 | |||
94ae33a7a0 | |||
d6811693bd | |||
0420878a32 | |||
7a637dc987 | |||
60084cfedf | |||
2924558db7 | |||
893340ae2b | |||
da2fb2a9c9 | |||
f2b4a662c7 | |||
0941d18dc6 | |||
703454fdca | |||
9725a37086 | |||
111e14cd2b | |||
33b0f3301a | |||
58aa58a078 | |||
72fe2723e5 | |||
f69ede8bc4 | |||
82ef5d1848 | |||
bdd4df968e | |||
5528b19d44 | |||
543e37ca95 | |||
61a88dff79 | |||
b0f6e56835 | |||
8d01e58cd5 | |||
b5616da21c | |||
0dfd3bb736 | |||
5cc668f93c | |||
1574d0ec2e | |||
57db46b51f | |||
3bfa43f31b | |||
e2bc23bb79 | |||
ab187ece00 | |||
5aa32dd872 | |||
f07cbf3deb | |||
c6e1dc19e2 | |||
d0ed58da5e | |||
1cecf718b5 | |||
4c643fe244 | |||
a60bb467ab | |||
503f466b03 | |||
9b5df7f4cf | |||
2352c82eda | |||
439365c8d4 | |||
397c434015 | |||
5038964733 | |||
49837d8d32 | |||
0ea405fa8f | |||
c5528719bf | |||
5cf310fbd2 | |||
1571575191 | |||
1a57ce180b | |||
ac9daca0ea | |||
c027c6459f | |||
13c32dcf44 | |||
ec79999bec | |||
501be0b107 | |||
dd247bd85d | |||
565103a656 | |||
2bd724cf19 | |||
cd210a1516 | |||
d9ff56dadc | |||
f23a0aa43d | |||
9e58857991 | |||
2a1b5eb42f | |||
0fb1cd7e63 | |||
33595ac317 | |||
e541ce8951 | |||
34f4b4b849 | |||
9c7a918b1f | |||
cfdc86aa20 | |||
653c87dcf4 | |||
2fe93a3199 | |||
61e84067f2 | |||
1cb0e12246 | |||
4ae418e39d | |||
243379f73e | |||
6b74c299bd | |||
0f348a9fae | |||
2d6e3f944a | |||
5380a6d2e3 | |||
09d9ab05fb | |||
ebb41b6a1f | |||
54ddf63ea5 | |||
dfdddc46e1 | |||
579f3276e0 | |||
9d6a74e7fa | |||
449ab039e1 | |||
b1f0ed6112 | |||
ff3eba7c9d | |||
79c7daccfd | |||
d5aa5ac42f | |||
845873ced6 | |||
b7634b24a9 | |||
165cdc41ce | |||
e9db5fd1ed | |||
aba0f20134 | |||
a12e3b1d94 | |||
796be72e3c | |||
dcf230a546 | |||
7de7cf0ab1 | |||
2db6789f5d | |||
ab74a05de6 | |||
173aa0977e | |||
067db9bb0f | |||
01e8b44ae9 | |||
3c1a31e281 | |||
d170d40ae4 | |||
3ffd84ff4c | |||
835badd15d | |||
980c04b760 | |||
cdfd2c0477 | |||
83999a3b73 | |||
df749a0cdd | |||
1bd9057a67 | |||
30001135a9 | |||
10f6dc66b3 | |||
8dbc49b8e8 | |||
18174df8fe | |||
2b2a06e98b | |||
0865074af4 | |||
81a9301000 | |||
11b24d43e7 | |||
557b169ed0 | |||
bbf5a6a4f3 | |||
d4363a4be9 | |||
e138af419c | |||
e93b65fff5 | |||
f85bc4780a | |||
fb4903f4a0 | |||
7295e83668 | |||
c4f8c093a2 | |||
b8e9eb31b3 | |||
30c75a44a0 | |||
49ba083745 | |||
54d7573541 | |||
a6fb91aa4c | |||
bef7d89542 | |||
4cd9b0c535 | |||
474b8433ea | |||
5262080b2b | |||
93277c7c2b | |||
4d54568c62 | |||
15b0695e83 | |||
42193845a0 | |||
902af29943 | |||
54746d5b11 | |||
0e91cf41d5 | |||
0993c0a625 | |||
7074bf8de9 | |||
46099c947e | |||
cc252a1ea8 | |||
e79e43c513 | |||
0cedbe7b87 | |||
1bcec42adb | |||
54af9c23be | |||
839bec39db | |||
13cae9ba89 | |||
816422ebea | |||
ec24aaaf1f | |||
a6f2a81fc4 | |||
cda19fc379 | |||
c7adeb3e82 | |||
8bf875ba64 | |||
3bbb1fbd83 | |||
686eae0cdb | |||
819e55bba0 | |||
2367044b4a | |||
ae25a54553 | |||
8ef45fe1b7 | |||
971b6f79ab | |||
a67c5090c3 | |||
31f16868ec | |||
c454ec7527 | |||
ce1313f222 | |||
4b5cb04d72 | |||
abc5cf8910 | |||
35ac5ad932 | |||
c0c5dd68ae | |||
c9b7059f3f | |||
8ecb10c72c | |||
fd767921a2 | |||
8eedcbf3c2 | |||
054dda07a7 |
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
|
result-*
|
||||||
result
|
result
|
||||||
|
repl-result-*
|
||||||
|
|
204
flake.lock
generated
|
@ -1,30 +1,33 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"catppuccin": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1734057772,
|
||||||
|
"narHash": "sha256-waF/2Y39JXJ4kG3zawmw1J1GxPHopyoOkJKJhfJ7RBs=",
|
||||||
|
"owner": "catppuccin",
|
||||||
|
"repo": "nix",
|
||||||
|
"rev": "20b6328df20ae45752c81311d225fd47cba32483",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "catppuccin",
|
||||||
|
"repo": "nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"crane": {
|
"crane": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
|
||||||
"lanzaboote",
|
|
||||||
"flake-compat"
|
|
||||||
],
|
|
||||||
"flake-utils": [
|
|
||||||
"lanzaboote",
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"lanzaboote",
|
"lanzaboote",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
|
||||||
"rust-overlay": [
|
|
||||||
"lanzaboote",
|
|
||||||
"rust-overlay"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681177078,
|
"lastModified": 1717535930,
|
||||||
"narHash": "sha256-ZNIjBDou2GOabcpctiQykEQVkI8BDwk7TyvlWlI4myE=",
|
"narHash": "sha256-1hZ/txnbd/RmiBPNUs7i8UQw2N89uAK3UzrGAWdnFfU=",
|
||||||
"owner": "ipetkov",
|
"owner": "ipetkov",
|
||||||
"repo": "crane",
|
"repo": "crane",
|
||||||
"rev": "0c9f468ff00576577d83f5019a66c557ede5acf6",
|
"rev": "55e7754ec31dac78980c8be45f8a28e80e370946",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,11 +39,11 @@
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673956053,
|
"lastModified": 1696426674,
|
||||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -56,11 +59,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1706830856,
|
"lastModified": 1733312601,
|
||||||
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
|
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
|
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -77,11 +80,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1680392223,
|
"lastModified": 1717285511,
|
||||||
"narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=",
|
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5",
|
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -95,11 +98,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705309234,
|
"lastModified": 1731533236,
|
||||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -113,11 +116,11 @@
|
||||||
"systems": "systems_2"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681202837,
|
"lastModified": 1710146030,
|
||||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -135,11 +138,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1660459072,
|
"lastModified": 1709087332,
|
||||||
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "gitignore.nix",
|
"repo": "gitignore.nix",
|
||||||
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -155,11 +158,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707175763,
|
"lastModified": 1734093295,
|
||||||
"narHash": "sha256-0MKHC6tQ4KEuM5rui6DjKZ/VNiSANB4E+DJ/+wPS1PU=",
|
"narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "f99eace7c167b8a6a0871849493b1c613d0f1b80",
|
"rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -170,11 +173,11 @@
|
||||||
},
|
},
|
||||||
"impermanence": {
|
"impermanence": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1706639736,
|
"lastModified": 1731242966,
|
||||||
"narHash": "sha256-CaG4j9+UwBDfinxxvJMo6yOonSmSo0ZgnbD7aj2Put0=",
|
"narHash": "sha256-B3C3JLbGw0FtLSWCjBxU961gLNv+BOOBC6WvstKLYMw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "impermanence",
|
"repo": "impermanence",
|
||||||
"rev": "cd13c2917eaa68e4c49fea0ff9cada45440d7045",
|
"rev": "3ed3f0eaae9fcc0a8331e77e9319c8a4abd8a71a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -184,6 +187,25 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"jovian": {
|
||||||
|
"inputs": {
|
||||||
|
"nix-github-actions": "nix-github-actions",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1734162608,
|
||||||
|
"narHash": "sha256-m2AX+3eiVqIK6uO7GbGY7SFnkkYOlR5fQiNI0eRvWOQ=",
|
||||||
|
"owner": "Jovian-Experiments",
|
||||||
|
"repo": "Jovian-NixOS",
|
||||||
|
"rev": "31bdf4c7c91204d65afbde01146deee0259a8fb7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Jovian-Experiments",
|
||||||
|
"repo": "Jovian-NixOS",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"lanzaboote": {
|
"lanzaboote": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"crane": "crane",
|
"crane": "crane",
|
||||||
|
@ -197,27 +219,49 @@
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682802423,
|
"lastModified": 1718178907,
|
||||||
"narHash": "sha256-Fb5TeRTdvUlo/5Yi2d+FC8a6KoRLk2h1VE0/peMhWPs=",
|
"narHash": "sha256-eSZyrQ9uoPB9iPQ8Y5H7gAmAgAvCw3InStmU3oEjqsE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "lanzaboote",
|
"repo": "lanzaboote",
|
||||||
"rev": "64b903ca87d18cef2752c19c098af275c6e51d63",
|
"rev": "b627ccd97d0159214cee5c7db1412b75e4be6086",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "v0.3.0",
|
"ref": "v0.4.1",
|
||||||
"repo": "lanzaboote",
|
"repo": "lanzaboote",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-github-actions": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"jovian",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1729697500,
|
||||||
|
"narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=",
|
||||||
|
"owner": "zhaofengli",
|
||||||
|
"repo": "nix-github-actions",
|
||||||
|
"rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "zhaofengli",
|
||||||
|
"ref": "matrix-name",
|
||||||
|
"repo": "nix-github-actions",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1706913249,
|
"lastModified": 1733392399,
|
||||||
"narHash": "sha256-x3M7iV++CsvRXI1fpyFPduGELUckZEhSv0XWnUopAG8=",
|
"narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e92b6015881907e698782c77641aa49298330223",
|
"rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -229,30 +273,65 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1678872516,
|
"lastModified": 1710695816,
|
||||||
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
|
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
|
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-22.11",
|
"ref": "nixos-23.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1733940404,
|
||||||
|
"narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plasma-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": [
|
||||||
|
"home-manager"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1733858086,
|
||||||
|
"narHash": "sha256-h2BDIDKiqgMpA6E+mu0RgMGy3FeM6k+EuJ9xgOQ1+zw=",
|
||||||
|
"owner": "pjones",
|
||||||
|
"repo": "plasma-manager",
|
||||||
|
"rev": "7e2010249529931a3848054d5ff0dbf24675ab68",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "pjones",
|
||||||
|
"repo": "plasma-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"pre-commit-hooks-nix": {
|
"pre-commit-hooks-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
"lanzaboote",
|
"lanzaboote",
|
||||||
"flake-compat"
|
"flake-compat"
|
||||||
],
|
],
|
||||||
"flake-utils": [
|
|
||||||
"lanzaboote",
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"lanzaboote",
|
"lanzaboote",
|
||||||
|
@ -261,11 +340,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681413034,
|
"lastModified": 1717664902,
|
||||||
"narHash": "sha256-/t7OjNQcNkeWeSq/CFLYVBfm+IEnkjoSm9iKvArnUUI=",
|
"narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "d3de8f69ca88fb6f8b09e5b598be5ac98d28ede5",
|
"rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -276,12 +355,15 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"catppuccin": "catppuccin",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
|
"jovian": "jovian",
|
||||||
"lanzaboote": "lanzaboote",
|
"lanzaboote": "lanzaboote",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"plasma-manager": "plasma-manager"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
|
@ -296,11 +378,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682129965,
|
"lastModified": 1717813066,
|
||||||
"narHash": "sha256-1KRPIorEL6pLpJR04FwAqqnt4Tzcm4MqD84yhlD+XSk=",
|
"narHash": "sha256-wqbRwq3i7g5EHIui0bIi84mdqZ/It1AXBSLJ5tafD28=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "2c417c0460b788328220120c698630947547ee83",
|
"rev": "6dc3e45fe4aee36efeed24d64fc68b1f989d5465",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
27
flake.nix
|
@ -3,24 +3,21 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
flake-parts = {
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
url = "github:hercules-ci/flake-parts";
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
impermanence.url = "github:nix-community/impermanence/master";
|
impermanence.url = "github:nix-community/impermanence/master";
|
||||||
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
plasma-manager.url = "github:pjones/plasma-manager";
|
||||||
|
plasma-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
plasma-manager.inputs.home-manager.follows = "home-manager";
|
||||||
|
catppuccin.url = "github:catppuccin/nix";
|
||||||
|
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1";
|
||||||
|
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
home-manager = {
|
# steamdeck
|
||||||
url = "github:nix-community/home-manager";
|
jovian.url = "github:Jovian-Experiments/Jovian-NixOS";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
lanzaboote = {
|
|
||||||
url = "github:nix-community/lanzaboote/v0.3.0";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs:
|
outputs = inputs:
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
builtins.readDir
|
builtins.readDir
|
||||||
(lib.filterAttrs (n: ty: ty == "regular"))
|
(lib.filterAttrs (n: ty: ty == "regular"))
|
||||||
(lib.mapAttrsToList (n: _: builtins.readFile ./pub/${n}))
|
(lib.mapAttrsToList (n: _: builtins.readFile ./pub/${n}))
|
||||||
|
(foldr (payload: keys: (splitString "\n" payload) ++ keys) [ ])
|
||||||
|
(foldr (candidate: keys: keys ++ (if candidate == "" then [ ] else [ candidate ])) [ ])
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
options.global.auth = {
|
options.global.auth = {
|
||||||
|
@ -15,7 +17,7 @@ in {
|
||||||
enable = mkEnableOption "openssh server";
|
enable = mkEnableOption "openssh server";
|
||||||
password = mkEnableOption "password authentication";
|
password = mkEnableOption "password authentication";
|
||||||
publicKeys = mkOption {
|
publicKeys = mkOption {
|
||||||
type = with types; listOf str;
|
type = with types; listOf singleLineStr;
|
||||||
default = pub;
|
default = pub;
|
||||||
description = "list of trusted openssh keys";
|
description = "list of trusted openssh keys";
|
||||||
};
|
};
|
||||||
|
@ -40,7 +42,7 @@ in {
|
||||||
settings.PasswordAuthentication = cfg.openssh.password;
|
settings.PasswordAuthentication = cfg.openssh.password;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ ] ++
|
networking.firewall.allowedTCPPorts = [ 1300 ] ++ # utility port
|
||||||
optional (cfg.openssh.enable && (cfg.openssh.port != null)) cfg.openssh.port;
|
optional (cfg.openssh.enable && (cfg.openssh.port != null)) cfg.openssh.port;
|
||||||
|
|
||||||
environment.persistence."/nix/persist/fhs".directories = [ ] ++
|
environment.persistence."/nix/persist/fhs".directories = [ ] ++
|
||||||
|
|
1
global/auth/pub/hakugyokurou.pub
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHKCA0/6dsdVyLEgzWt8+u5lWVc0o6A3MY4M2Hf2BT8h koishi@hakugyokurou
|
1
global/auth/pub/koumakyou.pub
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINJOoXrfB4D8Vi6HH4E7RqHHIWhPPqEiiOeLRfggW1XZ koishi@koumakyou
|
1
global/auth/pub/shinkirou.pub
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDwV7Z+PDC8ARRj1LxUJlv59gJ3A84LCMMyMSqLtRtuQ koishi@shinkirou
|
17
global/flatpak/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.global.flatpak;
|
||||||
|
in {
|
||||||
|
options.global.flatpak = {
|
||||||
|
enable = mkEnableOption "flatpak sandbox";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
xdg.portal.enable = true;
|
||||||
|
users.home.persist.directories = [ ".local/share/flatpak" ".var" ];
|
||||||
|
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/flatpak" ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -8,8 +8,8 @@ in {
|
||||||
./ext4.nix
|
./ext4.nix
|
||||||
./f2fs.nix
|
./f2fs.nix
|
||||||
./xfs.nix
|
./xfs.nix
|
||||||
./zfs.nix
|
|
||||||
./bcachefs.nix
|
./bcachefs.nix
|
||||||
|
./zfs
|
||||||
];
|
];
|
||||||
|
|
||||||
options.global.fs = {
|
options.global.fs = {
|
||||||
|
@ -90,5 +90,10 @@ in {
|
||||||
inherit (cfg.cryptsetup) allowDiscards bypassWorkqueues;
|
inherit (cfg.cryptsetup) allowDiscards bypassWorkqueues;
|
||||||
device = "/dev/disk/by-uuid/${uuid}";
|
device = "/dev/disk/by-uuid/${uuid}";
|
||||||
}) cfg.cryptsetup.uuids);
|
}) cfg.cryptsetup.uuids);
|
||||||
|
|
||||||
|
environment.persistence."/nix/persist/fhs".files = [ {
|
||||||
|
file = "/var/lib/private/mode";
|
||||||
|
parentDirectory.mode = "0700";
|
||||||
|
} ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
{ pkgs
|
|
||||||
, lib
|
|
||||||
, config
|
|
||||||
, ... }: with lib; let
|
|
||||||
cfg = config.global.fs;
|
|
||||||
in {
|
|
||||||
# -o ashift=12
|
|
||||||
# -O encryption=on -O keyformat=passphrase -O keylocation=prompt
|
|
||||||
# -O compression=on -O mountpoint=none -O xattr=sa -O acltype=posixacl
|
|
||||||
options.global.fs.zfs = {
|
|
||||||
persist = mkOption {
|
|
||||||
type = with types; str;
|
|
||||||
default = cfg.store;
|
|
||||||
description = ''
|
|
||||||
pool for persist dataset
|
|
||||||
defaults to nix store dataset
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
mountpoints = mkOption {
|
|
||||||
type = with types; attrsOf str;
|
|
||||||
description = "zfs dataset mountpoints";
|
|
||||||
};
|
|
||||||
externalStore = mkEnableOption "external nix store filesystem";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf (cfg.type == "zfs") {
|
|
||||||
fileSystems = (mapAttrs (path: dataset: {
|
|
||||||
device = "${cfg.zfs.persist}/${dataset}";
|
|
||||||
fsType = "zfs";
|
|
||||||
# required by impermanence
|
|
||||||
neededForBoot = true;
|
|
||||||
}) cfg.zfs.mountpoints) // {
|
|
||||||
"/nix" = (if !cfg.zfs.externalStore then
|
|
||||||
{ device = "${cfg.store}/nix";
|
|
||||||
fsType = "zfs";
|
|
||||||
} else
|
|
||||||
{ inherit (cfg.external) device fsType options; });
|
|
||||||
};
|
|
||||||
global.fs.zfs.mountpoints."/nix/persist" = "persist";
|
|
||||||
|
|
||||||
services.zfs.trim.enable = true;
|
|
||||||
services.zfs.autoSnapshot.enable = true;
|
|
||||||
services.zfs.autoScrub.enable = true;
|
|
||||||
boot.zfs.devNodes = mkDefault "/dev/disk/by-partuuid";
|
|
||||||
boot.kernelPackages = mkDefault config.boot.zfs.package.latestCompatibleLinuxPackages;
|
|
||||||
};
|
|
||||||
}
|
|
122
global/fs/zfs/alert.nix
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.global.fs.zfs.alert;
|
||||||
|
|
||||||
|
backend = {
|
||||||
|
text = pkgs.writeShellScript "telegram-text" ''
|
||||||
|
set -e
|
||||||
|
source ${cfg.secret}
|
||||||
|
|
||||||
|
${pkgs.curl}/bin/curl -sG \
|
||||||
|
--data-urlencode "chat_id=$CHATID" \
|
||||||
|
--data-urlencode "text=$ALERT" \
|
||||||
|
$CURL_EXTRA_ARGS \
|
||||||
|
"https://api.telegram.org/bot$APIKEY/sendMessage"
|
||||||
|
'';
|
||||||
|
image = pkgs.writeShellScript "telegram-image" ''
|
||||||
|
set -e
|
||||||
|
source ${cfg.secret}
|
||||||
|
|
||||||
|
${pkgs.curl}/bin/curl -sG \
|
||||||
|
-F "chat_id=$CHATID" \
|
||||||
|
-F "caption=$ALERT" \
|
||||||
|
-F "photo=@-" \
|
||||||
|
$CURL_EXTRA_ARGS \
|
||||||
|
"https://api.telegram.org/bot$APIKEY/sendPhoto"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
zedAlert = pkgs.writeShellScript "zed-alert" ''
|
||||||
|
set -e
|
||||||
|
export BODY="$(cat)"
|
||||||
|
|
||||||
|
# add tag
|
||||||
|
ALERT="$1 #zfs"
|
||||||
|
|
||||||
|
export ALERT
|
||||||
|
echo -e "$BODY" | \
|
||||||
|
${pkgs.imagemagick}/bin/convert \
|
||||||
|
-size 1500x2000 xc:black \
|
||||||
|
-font "${pkgs.freefont_ttf}/share/fonts/truetype/FreeMono.ttf" \
|
||||||
|
-pointsize 16 \
|
||||||
|
-fill white -annotate +15+80 "@-" \
|
||||||
|
-trim -bordercolor "#000" \
|
||||||
|
-border 32 +repage \
|
||||||
|
png:- | \
|
||||||
|
${backend.image}
|
||||||
|
'';
|
||||||
|
|
||||||
|
mdadmAlert = pkgs.writeShellScript "mdadm-alert" ''
|
||||||
|
set -e
|
||||||
|
|
||||||
|
EVENT="$1"
|
||||||
|
ARRAY="$2"
|
||||||
|
DEVICE="$3"
|
||||||
|
|
||||||
|
# fallback alert
|
||||||
|
ALERT="$EVENT | $ARRAY | $DEVICE"
|
||||||
|
|
||||||
|
case $EVENT in
|
||||||
|
DegradedArray)
|
||||||
|
ALERT="Array $ARRAY is in a degraded state"
|
||||||
|
;;
|
||||||
|
DeviceDisappeared)
|
||||||
|
ALERT="Array $ARRAY disappeared"
|
||||||
|
;;
|
||||||
|
Fail)
|
||||||
|
ALERT="Array $ARRAY encountered failure of component $DEVICE"
|
||||||
|
;;
|
||||||
|
FailSpare)
|
||||||
|
ALERT="Array $ARRAY encountered failure of spare component $DEVICE during rebuild"
|
||||||
|
;;
|
||||||
|
MoveSpare)
|
||||||
|
ALERT="Spare $DEVICE moved to array $ARRAY"
|
||||||
|
;;
|
||||||
|
NewArray)
|
||||||
|
ALERT="Array $ARRAY appeared"
|
||||||
|
;;
|
||||||
|
Rebuild??)
|
||||||
|
ALERT="Array $ARRAY rebuild is now $(echo $EVENT | ${pkgs.sedutil}/bin/sed 's/Rebuild//')% complete"
|
||||||
|
;;
|
||||||
|
RebuildFinished)
|
||||||
|
ALERT="Rebuild of array $ARRAY has concluded"
|
||||||
|
;;
|
||||||
|
RebuildStarted)
|
||||||
|
ALERT="Rebuild of array $ARRAY has started"
|
||||||
|
;;
|
||||||
|
SpareActive)
|
||||||
|
ALERT="Spare $DEVICE activated in array $ARRAY"
|
||||||
|
;;
|
||||||
|
SparesMissing)
|
||||||
|
ALERT="Array $ARRAY missing one or more spares"
|
||||||
|
;;
|
||||||
|
TestMessage)
|
||||||
|
ALERT="Test message generated for array $ARRAY"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# add tag
|
||||||
|
ALERT="$ALERT #swraid"
|
||||||
|
|
||||||
|
export ALERT
|
||||||
|
exec ${backend.text}
|
||||||
|
'';
|
||||||
|
in mkIf (cfg.secret != null) {
|
||||||
|
services.zfs.zed = mkIf cfg.zed {
|
||||||
|
settings = {
|
||||||
|
ZED_EMAIL_ADDR = [ "root" ];
|
||||||
|
ZED_EMAIL_PROG = toString zedAlert;
|
||||||
|
ZED_EMAIL_OPTS = "'@SUBJECT@'";
|
||||||
|
|
||||||
|
ZED_NOTIFY_INTERVAL_SECS = 3600;
|
||||||
|
ZED_NOTIFY_VERBOSE = false;
|
||||||
|
|
||||||
|
ZED_USE_ENCLOSURE_LEDS = true;
|
||||||
|
ZED_SCRUB_AFTER_RESILVER = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
global.fs.zfs.split.mdProg = mkIf cfg.swraid (toString mdadmAlert);
|
||||||
|
}
|
105
global/fs/zfs/default.nix
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.global.fs;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./alert.nix
|
||||||
|
./split.nix
|
||||||
|
./replication.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# -o ashift=12
|
||||||
|
# -O encryption=on -O keyformat=passphrase -O keylocation=prompt
|
||||||
|
# -O compression=on -O mountpoint=none -O xattr=sa -O acltype=posixacl
|
||||||
|
options.global.fs.zfs = {
|
||||||
|
alert = {
|
||||||
|
zed = mkEnableOption "zfs event alerts" // { default = true; };
|
||||||
|
swraid = mkEnableOption "software raid alerts" // { default = true; };
|
||||||
|
secret = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "path to alert secrets";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
persist = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = cfg.store;
|
||||||
|
description = ''
|
||||||
|
pool for persist dataset
|
||||||
|
defaults to nix store dataset
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
mountpoints = mkOption {
|
||||||
|
type = with types; attrsOf str;
|
||||||
|
description = "zfs dataset mountpoints";
|
||||||
|
};
|
||||||
|
externalStore = mkEnableOption "external nix store filesystem";
|
||||||
|
|
||||||
|
split = {
|
||||||
|
enable = mkEnableOption "zfs state with split nix store";
|
||||||
|
mdProg = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "/usr/bin/true";
|
||||||
|
description = "mdadm PROGRAM config value";
|
||||||
|
};
|
||||||
|
secret = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
description = "UUID of secret filesystem";
|
||||||
|
};
|
||||||
|
store = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
description = "UUID of store filesystem";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
replication = {
|
||||||
|
enable = mkEnableOption "zfs replication to remote";
|
||||||
|
remote = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
description = "remote host as replication destination";
|
||||||
|
};
|
||||||
|
port = mkOption {
|
||||||
|
type = with types; port;
|
||||||
|
description = "ssh port of replication target";
|
||||||
|
default = 22;
|
||||||
|
};
|
||||||
|
datasets = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
default = [ "persist" "service" "storage" ];
|
||||||
|
description = "list of filesystems to perform replication for";
|
||||||
|
};
|
||||||
|
sendOptions = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "w";
|
||||||
|
description = "send options for all datasets";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.type == "zfs") {
|
||||||
|
fileSystems = (mapAttrs (path: dataset: {
|
||||||
|
device = "${cfg.zfs.persist}/${dataset}";
|
||||||
|
fsType = "zfs";
|
||||||
|
options = [ "zfsutil" ];
|
||||||
|
# required by impermanence
|
||||||
|
neededForBoot = true;
|
||||||
|
}) cfg.zfs.mountpoints) // {
|
||||||
|
"/nix" = (if !cfg.zfs.externalStore then
|
||||||
|
{ device = "${cfg.store}/nix";
|
||||||
|
fsType = "zfs";
|
||||||
|
} else
|
||||||
|
{ inherit (cfg.external) device fsType options; });
|
||||||
|
};
|
||||||
|
global.fs.zfs.mountpoints."/nix/persist" = "persist";
|
||||||
|
|
||||||
|
services.zfs.trim.enable = true;
|
||||||
|
services.zfs.autoSnapshot.enable = true;
|
||||||
|
services.zfs.autoScrub.enable = true;
|
||||||
|
boot.zfs.devNodes = mkDefault "/dev/disk/by-partuuid";
|
||||||
|
#boot.kernelPackages = mkDefault config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
|
global.kernel.lts = mkDefault true;
|
||||||
|
};
|
||||||
|
}
|
30
global/fs/zfs/replication.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.global.fs.zfs.replication;
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
services.syncoid = {
|
||||||
|
enable = mkDefault true;
|
||||||
|
interval = mkDefault "daily";
|
||||||
|
sshKey = mkDefault "/var/lib/syncoid/.ssh/id_ed25519";
|
||||||
|
commonArgs = [
|
||||||
|
"--recursive"
|
||||||
|
"--mbuffer-size=128M"
|
||||||
|
"--delete-target-snapshots"
|
||||||
|
"--sshport=${toString cfg.port}"
|
||||||
|
];
|
||||||
|
localSourceAllow = mkOptionDefault [ "mount" ];
|
||||||
|
|
||||||
|
commands = (lists.foldr (name: commands: commands // {
|
||||||
|
"${config.global.fs.store}/${name}" = {
|
||||||
|
inherit (cfg) sendOptions;
|
||||||
|
target = "${cfg.remote}/${name}";
|
||||||
|
};
|
||||||
|
}) { }) cfg.datasets;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.syncoid.uid = 82;
|
||||||
|
users.groups.syncoid.gid = 82;
|
||||||
|
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/syncoid" ];
|
||||||
|
}
|
35
global/fs/zfs/split.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.global.fs.zfs.split;
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
# unconditionally enable fstrim for xfs and ext4
|
||||||
|
services.fstrim.enable = mkDefault true;
|
||||||
|
|
||||||
|
# enable swraid for split raid1 system array
|
||||||
|
boot.swraid.enable = mkDefault true;
|
||||||
|
boot.swraid.mdadmConf = mkDefault ''
|
||||||
|
PROGRAM ${cfg.mdProg}
|
||||||
|
'';
|
||||||
|
|
||||||
|
# secret filesystem backed by swraid
|
||||||
|
fileSystems."/nix/var/secret" =
|
||||||
|
{ device = "/dev/disk/by-uuid/${cfg.secret}";
|
||||||
|
fsType = "ext4";
|
||||||
|
options = [ "noatime" ];
|
||||||
|
neededForBoot = true;
|
||||||
|
depends = [ "/nix/var" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# external store backed by swraid
|
||||||
|
global.fs = {
|
||||||
|
zfs.externalStore = mkDefault true;
|
||||||
|
external.device = "/dev/disk/by-uuid/${cfg.store}";
|
||||||
|
external.fsType = "xfs";
|
||||||
|
external.options = [ "noatime" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# import system state pool after encrypted filesystems become available for key loading
|
||||||
|
boot.initrd.systemd.services."zfs-import-${config.global.fs.store}".after = [ "sysroot-nix-var-secret.mount" "cryptsetup.target" ];
|
||||||
|
}
|
|
@ -29,10 +29,9 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
hardware.opengl = {
|
hardware.graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport = true;
|
enable32Bit = true;
|
||||||
driSupport32Bit = true;
|
|
||||||
|
|
||||||
# https://nixos.wiki/wiki/Accelerated_Video_Playback
|
# https://nixos.wiki/wiki/Accelerated_Video_Playback
|
||||||
extraPackages = with pkgs; optionals intel [
|
extraPackages = with pkgs; optionals intel [
|
||||||
|
@ -46,11 +45,14 @@ in {
|
||||||
optional (cfg.type == "nvidia") vulkan-validation-layers;
|
optional (cfg.type == "nvidia") vulkan-validation-layers;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.videoDrivers =
|
services.xserver = mkIf cfg.session {
|
||||||
optional nvidia "nvidia" ++
|
videoDrivers =
|
||||||
optional (cfg.type == "amdgpu") "amdgpu";
|
optional nvidia "nvidia" ++
|
||||||
# inhibits default display manager
|
optional (cfg.type == "amdgpu") "amdgpu";
|
||||||
services.xserver.displayManager.startx.enable = mkDefault true;
|
# inhibits default display manager
|
||||||
|
|
||||||
|
displayManager.startx.enable = mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
hardware.nvidia = mkIf nvidia {
|
hardware.nvidia = mkIf nvidia {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
|
@ -72,7 +74,7 @@ in {
|
||||||
# work around broken nvidia hw cursor on wayland
|
# work around broken nvidia hw cursor on wayland
|
||||||
WLR_NO_HARDWARE_CURSORS = mkIf (cfg.type == "nvidia") "1";
|
WLR_NO_HARDWARE_CURSORS = mkIf (cfg.type == "nvidia") "1";
|
||||||
# work around wlroots flickering on pure nvidia
|
# work around wlroots flickering on pure nvidia
|
||||||
WLR_RENDERER = mkIf (cfg.type == "nvidia") "vulkan";
|
#WLR_RENDERER = mkIf (cfg.type == "nvidia") "vulkan";
|
||||||
};
|
};
|
||||||
|
|
||||||
specialisation.integratedGraphics = mkIf (cfg.type == "prime") {
|
specialisation.integratedGraphics = mkIf (cfg.type == "prime") {
|
||||||
|
@ -91,7 +93,7 @@ in {
|
||||||
|
|
||||||
boot.initrd.kernelModules =
|
boot.initrd.kernelModules =
|
||||||
optional amdgpu "amdgpu" ++
|
optional amdgpu "amdgpu" ++
|
||||||
optional intel "i915" ++
|
optional (intel && cfg.arc == null) "i915" ++
|
||||||
optionals nvidia [ "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" ] ++
|
optionals nvidia [ "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" ] ++
|
||||||
optional (cfg.arc != null) "vfio-pci";
|
optional (cfg.arc != null) "vfio-pci";
|
||||||
|
|
||||||
|
@ -102,6 +104,8 @@ in {
|
||||||
options vfio-pci ids=${cfg.arc}
|
options vfio-pci ids=${cfg.arc}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
boot.kernelParams = optional intel "i915.fastboot=1";
|
boot.kernelParams =
|
||||||
|
optional intel "i915.fastboot=1" ++
|
||||||
|
optionals nvidia [ "nvidia_drm.modeset=1" "nvidia_drm.fbdev=1" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,18 +3,19 @@
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.global.gpu;
|
cfg = config.global.gpu;
|
||||||
in mkIf (cfg.enable && cfg.session) {
|
gui = with cfg; enable && session;
|
||||||
|
in mkIf gui {
|
||||||
programs.regreet = {
|
programs.regreet = {
|
||||||
enable = mkDefault true;
|
enable = mkDefault true;
|
||||||
cageArgs = [ "-s" "-d" "-m" "last" ];
|
cageArgs = [ "-s" "-d" "-m" "last" ];
|
||||||
settings = {
|
settings = {
|
||||||
background.path = ../../share/54345906_p0.jpg;
|
background.path = mkDefault ../../share/54345906_p0.jpg;
|
||||||
background.fit = "Fill";
|
background.fit = "Fill";
|
||||||
GTK = {
|
GTK = {
|
||||||
application_prefer_dark_theme = true;
|
application_prefer_dark_theme = mkDefault true;
|
||||||
cursor_theme_name = "Bibata-Modern-Classic";
|
cursor_theme_name = mkDefault "Bibata-Modern-Classic";
|
||||||
icon_theme_name = "Papirus-Dark";
|
icon_theme_name = mkDefault "Papirus-Dark";
|
||||||
theme_name = "WhiteSur-Dark";
|
theme_name = mkDefault "WhiteSur-Dark";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.global.gpu;
|
cfg = config.global.gpu;
|
||||||
in mkIf cfg.enable {
|
gui = with cfg; enable && session;
|
||||||
|
in mkIf gui {
|
||||||
boot = {
|
boot = {
|
||||||
loader.timeout = mkDefault 0;
|
loader.timeout = mkDefault 0;
|
||||||
consoleLogLevel = 0;
|
consoleLogLevel = 0;
|
||||||
|
|
|
@ -13,31 +13,50 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
services.udev.extraRules = "" + (if cfg.betaflight then ''
|
services.udev.extraRules = ''
|
||||||
|
# ignore zvols
|
||||||
|
KERNEL=="zd*", ENV{UDISKS_IGNORE}="1"
|
||||||
|
'' + (if cfg.betaflight then ''
|
||||||
# DFU (Internal bootloader for STM32 and AT32 MCUs)
|
# DFU (Internal bootloader for STM32 and AT32 MCUs)
|
||||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
||||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
||||||
'' else "");
|
'' else "");
|
||||||
|
|
||||||
networking.networkmanager.enable = mkDefault true;
|
networking.networkmanager.enable = mkDefault true;
|
||||||
|
networking.hosts = {
|
||||||
|
"10.5.14.0" = [ "codec" ];
|
||||||
|
"10.5.14.1" = [ "redir" ];
|
||||||
|
"10.5.14.2" = [ "compat" ];
|
||||||
|
|
||||||
|
"192.168.123.1" = [ "netvm" ];
|
||||||
|
};
|
||||||
|
networking.firewall.logRefusedConnections = true;
|
||||||
hardware.bluetooth.enable = mkDefault cfg.bluetooth;
|
hardware.bluetooth.enable = mkDefault cfg.bluetooth;
|
||||||
|
|
||||||
hardware.pulseaudio = mkIf cfg.audio {
|
# rtkit is optional but recommended
|
||||||
|
security.rtkit.enable = cfg.audio;
|
||||||
|
services.pipewire = mkIf cfg.audio {
|
||||||
enable = true;
|
enable = true;
|
||||||
support32Bit = true;
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
jack.enable = true;
|
||||||
};
|
};
|
||||||
#nixpkgs.config.pulseaudio = mkIf cfg.audio;
|
|
||||||
|
|
||||||
security.pam.loginLimits = mkIf (!cfg.coredump) (singleton { domain = "*"; item = "core"; type = "hard"; value = "0"; });
|
security.pam.loginLimits = mkIf (!cfg.coredump) (singleton { domain = "*"; item = "core"; type = "hard"; value = "0"; });
|
||||||
systemd.coredump.extraConfig = mkIf (!cfg.coredump) "Storage=none";
|
systemd.coredump.extraConfig = mkIf (!cfg.coredump) "Storage=none";
|
||||||
|
|
||||||
environment.persistence."/nix/persist/fhs".directories = [
|
environment.persistence."/nix/persist/fhs".directories = [
|
||||||
"/var/log"
|
"/var/log"
|
||||||
|
"/var/lib/nixos"
|
||||||
"/var/lib/systemd/backlight"
|
"/var/lib/systemd/backlight"
|
||||||
] ++
|
] ++
|
||||||
optional config.networking.networkmanager.enable "/etc/NetworkManager/system-connections" ++
|
optional config.networking.networkmanager.enable "/etc/NetworkManager/system-connections" ++
|
||||||
optional cfg.bluetooth "/var/lib/bluetooth" ++
|
optional cfg.bluetooth "/var/lib/bluetooth" ++
|
||||||
optional cfg.coredump "/var/lib/systemd/coredump";
|
optional cfg.coredump "/var/lib/systemd/coredump";
|
||||||
environment.persistence."/nix/persist/fhs".hideMounts = true;
|
environment.persistence."/nix/persist/fhs".hideMounts = true;
|
||||||
|
|
||||||
|
users.home.persist.directories = [ ] ++
|
||||||
|
optional cfg.audio ".local/state/wireplumber";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ in {
|
||||||
parallelShutdown = 5;
|
parallelShutdown = 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [ virtiofsd ];
|
||||||
|
|
||||||
# USB redirection requires a setuid wrapper
|
# USB redirection requires a setuid wrapper
|
||||||
virtualisation.spiceUSBRedirection.enable = true;
|
virtualisation.spiceUSBRedirection.enable = true;
|
||||||
|
|
||||||
|
|
52
global/netdata/default.nix
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.global.netdata;
|
||||||
|
in {
|
||||||
|
options.global.netdata = {
|
||||||
|
enable = mkEnableOption "netdata";
|
||||||
|
host = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "localhost";
|
||||||
|
description = "hostname of netdata web interface";
|
||||||
|
};
|
||||||
|
addSSL = mkEnableOption "add SSL to netdata proxy";
|
||||||
|
useACMEHost = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "existing acme host";
|
||||||
|
};
|
||||||
|
basicAuthFile = mkOption {
|
||||||
|
type = with types; nullOr path;
|
||||||
|
default = "/nix/persist/secret/netdata";
|
||||||
|
description = "path to passwd file";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.netdata = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
global = {
|
||||||
|
"error log" = "syslog";
|
||||||
|
"access log" = "none";
|
||||||
|
"debug log" = "syslog";
|
||||||
|
};
|
||||||
|
web."bind to" = "unix:/var/run/netdata/netdata.sock";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.netdata.uid = 287;
|
||||||
|
users.groups.netdata.gid = 287;
|
||||||
|
|
||||||
|
services.nginx.enable = mkDefault true;
|
||||||
|
services.nginx.virtualHosts.${cfg.host} = {
|
||||||
|
inherit (cfg) addSSL useACMEHost basicAuthFile;
|
||||||
|
locations."/".proxyPass = "http://unix:/var/run/netdata/netdata.sock";
|
||||||
|
};
|
||||||
|
users.users.nginx.extraGroups = [ "netdata" ];
|
||||||
|
|
||||||
|
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/netdata" ];
|
||||||
|
};
|
||||||
|
}
|
34
global/virtualbox/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.global.virtualbox;
|
||||||
|
in {
|
||||||
|
options.global.virtualbox = {
|
||||||
|
enable = mkEnableOption "virtualbox host (kvm)";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
virtualisation.virtualbox.host = {
|
||||||
|
enable = true;
|
||||||
|
enableKvm = true;
|
||||||
|
enableExtensionPack = true;
|
||||||
|
|
||||||
|
enableHardening = false;
|
||||||
|
addNetworkInterface = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# allow virtualbox USB passthrough
|
||||||
|
users.adminGroups = [ "vboxusers" ];
|
||||||
|
|
||||||
|
users.home.persist.directories = [
|
||||||
|
".config/VirtualBox"
|
||||||
|
];
|
||||||
|
|
||||||
|
users.homeModules = [ {
|
||||||
|
wayland.windowManager.sway.config.window.commands = [
|
||||||
|
{ criteria.class = "VirtualBox Manager"; command = "floating enable"; }
|
||||||
|
];
|
||||||
|
} ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -17,9 +17,21 @@
|
||||||
# compiled from trusted keys in auth module
|
# compiled from trusted keys in auth module
|
||||||
ssh.allowedSignersFile = toString (pkgs.writeText
|
ssh.allowedSignersFile = toString (pkgs.writeText
|
||||||
"allowed_signers" (foldr (key: folded:
|
"allowed_signers" (foldr (key: folded:
|
||||||
folded + "koishi@514fpv.one ${key}") ""
|
folded + "koishi@514fpv.one ${key}\n") ""
|
||||||
config.passthrough.publicKeys));
|
config.passthrough.publicKeys));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
matchBlocks = {
|
||||||
|
"edge.514fpv.io".port = 8086;
|
||||||
|
"sf.514fpv.io".port = 8087;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
wayland.windowManager.sway.config.window.commands = mkIf config.passthrough.gui [
|
||||||
|
{ criteria.title = "Bitwarden"; command = "floating enable"; }
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
13
home/btop/home.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.passthrough.btop;
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
programs.btop = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
theme_background = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
17
home/btop/nixos.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.home.btop;
|
||||||
|
in {
|
||||||
|
options.home.btop = {
|
||||||
|
enable = mkEnableOption "btop" // { default = !config.home.util.minimal; };
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
users.homeModules = [
|
||||||
|
# this module passes gyroflow configuration to home-manager
|
||||||
|
{ passthrough.btop = cfg; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
BIN
home/catppuccin/flake.png
Normal file
After Width: | Height: | Size: 47 KiB |
62
home/catppuccin/gui.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.passthrough.catppuccin;
|
||||||
|
palette = (lib.importJSON "${config.catppuccin.sources.palette}/palette.json").${config.catppuccin.flavor}.colors;
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
gtk.theme = { inherit (cfg.gtk) package name; };
|
||||||
|
qt.style.name = "kvantum";
|
||||||
|
qt.platformTheme.name = "kvantum";
|
||||||
|
home.pointerCursor = { inherit (cfg.cursor) package name; };
|
||||||
|
|
||||||
|
# sway colour palette override
|
||||||
|
wayland.windowManager.sway.config = {
|
||||||
|
colors = {
|
||||||
|
focused = { border = "$lavender"; background = "$base"; text = "$text"; indicator = "$rosewater"; childBorder = "$lavender"; };
|
||||||
|
focusedInactive = { border = "$overlay0"; background = "$base"; text = "$text"; indicator = "$rosewater"; childBorder = "$overlay0"; };
|
||||||
|
unfocused = { border = "$overlay0"; background = "$base"; text = "$text"; indicator = "$rosewater"; childBorder = "$overlay0"; };
|
||||||
|
urgent = { border = "$peach"; background = "$base"; text = "$peach"; indicator = "$overlay0"; childBorder = "$peach"; };
|
||||||
|
placeholder = { border = "$overlay0"; background = "$base"; text = "$text"; indicator = "$overlay0"; childBorder = "$overlay0"; };
|
||||||
|
background = "$base";
|
||||||
|
};
|
||||||
|
|
||||||
|
bars = mkForce [ {
|
||||||
|
colors = {
|
||||||
|
background = "$base";
|
||||||
|
statusline = "$text";
|
||||||
|
focusedStatusline = "$text";
|
||||||
|
focusedSeparator = "$base";
|
||||||
|
focusedWorkspace = { border = "$base"; background = "$base"; text = "$green"; };
|
||||||
|
activeWorkspace = { border = "$base"; background = "$base"; text = "$blue"; };
|
||||||
|
inactiveWorkspace = { border = "$base"; background = "$base"; text = "$surface1"; };
|
||||||
|
urgentWorkspace = { border = "$base"; background = "$base"; text = "$surface1"; };
|
||||||
|
bindingMode = { border = "$base"; background = "$base"; text = "$surface1"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
mode = "dock";
|
||||||
|
position = "bottom";
|
||||||
|
workspaceButtons = true;
|
||||||
|
workspaceNumbers = true;
|
||||||
|
statusCommand = "${pkgs.i3status}/bin/i3status";
|
||||||
|
fonts = {
|
||||||
|
names = [ "monospace" ];
|
||||||
|
size = 8.0;
|
||||||
|
};
|
||||||
|
trayOutput = "primary";
|
||||||
|
} ];
|
||||||
|
|
||||||
|
output."*".bg = mkForce "${./flake.png} fill";
|
||||||
|
gaps.inner = 12;
|
||||||
|
gaps.outer = 5;
|
||||||
|
# dodge the status bar
|
||||||
|
gaps.bottom = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
# i3status colour palette override
|
||||||
|
programs.i3status.general = with palette; {
|
||||||
|
color_good = lavender.hex;
|
||||||
|
color_degraded = yellow.hex;
|
||||||
|
color_bad = red.hex;
|
||||||
|
};
|
||||||
|
}
|
9
home/catppuccin/home.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
catppuccin = {
|
||||||
|
enable = true;
|
||||||
|
accent = "pink";
|
||||||
|
flavor = "mocha";
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [ ./gui.nix ];
|
||||||
|
}
|
79
home/catppuccin/nixos.nix
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
gui = with config.global.gpu; enable && session;
|
||||||
|
cfg = config.home.catppuccin;
|
||||||
|
in {
|
||||||
|
options.home.catppuccin = {
|
||||||
|
enable = mkEnableOption "catppuccin colour scheme" // { default = gui; };
|
||||||
|
|
||||||
|
gtk = {
|
||||||
|
package = mkOption {
|
||||||
|
type = with types; package;
|
||||||
|
default = (pkgs.catppuccin-gtk.overrideAttrs {
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "catppuccin";
|
||||||
|
repo = "gtk";
|
||||||
|
rev = "v1.0.3";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
hash = "sha256-q5/VcFsm3vNEw55zq/vcM11eo456SYE5TQA3g2VQjGc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postUnpack = "";
|
||||||
|
}).override {
|
||||||
|
accents = [ "pink" ];
|
||||||
|
size = "compact";
|
||||||
|
#tweaks = [ "rimless" "black" ];
|
||||||
|
variant = "mocha";
|
||||||
|
};
|
||||||
|
description = "catppuccin gtk theme package";
|
||||||
|
};
|
||||||
|
name = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "catppuccin-mocha-pink-compact";
|
||||||
|
description = "name of catppuccin gtk theme";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
cursor = {
|
||||||
|
package = mkOption {
|
||||||
|
type = with types; package;
|
||||||
|
default = pkgs.catppuccin-cursors.mochaDark;
|
||||||
|
description = "catppuccin cursor theme package";
|
||||||
|
};
|
||||||
|
name = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "catppuccin-mocha-dark-cursors";
|
||||||
|
description = "name of catppuccin cursor theme";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
users.homeModules = [
|
||||||
|
# this module passes catppuccin configuration to home-manager
|
||||||
|
{ passthrough.catppuccin = cfg; }
|
||||||
|
];
|
||||||
|
|
||||||
|
catppuccin.enable = cfg.enable;
|
||||||
|
|
||||||
|
# gtk and cursor themes
|
||||||
|
environment.systemPackages = with cfg; mkIf enable [
|
||||||
|
gtk.package cursor.package
|
||||||
|
];
|
||||||
|
|
||||||
|
# override greetd theme
|
||||||
|
programs.regreet = mkIf cfg.enable {
|
||||||
|
theme = {
|
||||||
|
inherit (cfg.gtk) name package;
|
||||||
|
};
|
||||||
|
cursorTheme = {
|
||||||
|
inherit (cfg.cursor) name package;
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
background.path = ./solid.png;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
BIN
home/catppuccin/solid.png
Normal file
After Width: | Height: | Size: 33 KiB |
|
@ -6,4 +6,5 @@
|
||||||
in {
|
in {
|
||||||
users.home.persist.directories = mkIf gui [ ".config/google-chrome" ];
|
users.home.persist.directories = mkIf gui [ ".config/google-chrome" ];
|
||||||
security.chromiumSuidSandbox.enable = mkIf gui true;
|
security.chromiumSuidSandbox.enable = mkIf gui true;
|
||||||
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,6 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.main.term = "xterm-256color";
|
settings.main.term = "xterm-256color";
|
||||||
settings.main.font = "DejaVu Sans Mono:size=11";
|
settings.main.font = "DejaVu Sans Mono:size=11";
|
||||||
|
#settings.colors.alpha = 0.8;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.passthrough.gnome;
|
cfg = config.passthrough.gnome;
|
||||||
|
bg = ../../../share/54345906_p0.jpg;
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
dconf.settings = let
|
dconf.settings = let
|
||||||
p = "org/gnome";
|
p = "org/gnome";
|
||||||
|
@ -26,18 +27,18 @@ in mkIf cfg.enable {
|
||||||
"${pd}/background" = {
|
"${pd}/background" = {
|
||||||
color-shading-type = "solid";
|
color-shading-type = "solid";
|
||||||
picture-options = "zoom";
|
picture-options = "zoom";
|
||||||
picture-uri = "file://${./catppuccin-nix.png}";
|
picture-uri = "file://${bg}";
|
||||||
picture-uri-dark = "file://${./catppuccin-nix.png}";
|
picture-uri-dark = "file://${bg}";
|
||||||
primary-color = "#000000000000";
|
primary-color = "#000000000000";
|
||||||
secondary-color = "#000000000000";
|
secondary-color = "#000000000000";
|
||||||
};
|
};
|
||||||
|
|
||||||
"${pd}/interface" = {
|
"${pd}/interface" = {
|
||||||
color-scheme = "prefer-dark";
|
color-scheme = "prefer-dark";
|
||||||
cursor-theme = "Catppuccin-Frappe-Dark-Cursors";
|
cursor-theme = "Bibata-Modern-Classic";
|
||||||
font-antialiasing = "grayscale";
|
font-antialiasing = "grayscale";
|
||||||
font-hinting = "slight";
|
font-hinting = "slight";
|
||||||
gtk-theme = "Catppuccin-Frappe-Compact-Pink-Dark";
|
gtk-theme = "adw-gtk3-dark";
|
||||||
icon-theme = "Papirus-Dark";
|
icon-theme = "Papirus-Dark";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,7 +46,7 @@ in mkIf cfg.enable {
|
||||||
color-shading-type = "solid";
|
color-shading-type = "solid";
|
||||||
lock-enabled = false;
|
lock-enabled = false;
|
||||||
picture-options = "zoom";
|
picture-options = "zoom";
|
||||||
picture-uri = "file://${./catppuccin-nix.png}";
|
picture-uri = "file://${bg}";
|
||||||
primary-color = "#000000000000";
|
primary-color = "#000000000000";
|
||||||
secondary-color = "#000000000000";
|
secondary-color = "#000000000000";
|
||||||
};
|
};
|
||||||
|
@ -53,11 +54,64 @@ in mkIf cfg.enable {
|
||||||
"${pd}/wm/preferences" = {
|
"${pd}/wm/preferences" = {
|
||||||
action-double-click-titlebar = "toggle-maximize";
|
action-double-click-titlebar = "toggle-maximize";
|
||||||
action-middle-click-titlebar = "minimize";
|
action-middle-click-titlebar = "minimize";
|
||||||
button-layout = "close,minimize,maximize:appmenu";
|
button-layout = "close:appmenu";
|
||||||
|
resize-with-right-button = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"${pd}/wm/keybindings" = {
|
||||||
|
panel-run-dialog = [ ];
|
||||||
|
begin-resize = [ "<Super>r" ];
|
||||||
|
close = [ "<Shift><Super>q" ];
|
||||||
|
minimize = [ "<Super>BackSpace" ];
|
||||||
|
move-to-workspace-1 = [ "<Shift><Super>1" ];
|
||||||
|
move-to-workspace-2 = [ "<Shift><Super>2" ];
|
||||||
|
move-to-workspace-3 = [ "<Shift><Super>3" ];
|
||||||
|
move-to-workspace-4 = [ "<Shift><Super>4" ];
|
||||||
|
move-to-workspace-left = [ "<Shift><Super>h" ];
|
||||||
|
move-to-workspace-right = [ "<Shift><Super>l" ];
|
||||||
|
switch-to-workspace-1 = [ "<Super>1" ];
|
||||||
|
switch-to-workspace-2 = [ "<Super>2" ];
|
||||||
|
switch-to-workspace-3 = [ "<Super>3" ];
|
||||||
|
switch-to-workspace-4 = [ "<Super>4" ];
|
||||||
|
toggle-maximized = [ "<Super>f" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"${ps}/keybindings" = {
|
||||||
|
switch-to-application-1 = [ ];
|
||||||
|
switch-to-application-2 = [ ];
|
||||||
|
switch-to-application-3 = [ ];
|
||||||
|
switch-to-application-4 = [ ];
|
||||||
|
switch-to-application-5 = [ ];
|
||||||
|
switch-to-application-6 = [ ];
|
||||||
|
switch-to-application-7 = [ ];
|
||||||
|
switch-to-application-8 = [ ];
|
||||||
|
switch-to-application-9 = [ ];
|
||||||
|
toggle-application-view = [ "<Super>d" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"${p}/settings-daemon/plugins/media-keys" = {
|
||||||
|
custom-keybindings = [
|
||||||
|
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
|
||||||
|
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/"
|
||||||
|
];
|
||||||
|
logout = [ ];
|
||||||
|
screensaver = [ "<Control><Alt>l" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"${p}/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
|
||||||
|
binding = "<Super>Return";
|
||||||
|
command = "kgx";
|
||||||
|
name = "Launch console";
|
||||||
|
};
|
||||||
|
|
||||||
|
"${p}/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
|
||||||
|
binding = "<Super>q";
|
||||||
|
command = "google-chrome-stable";
|
||||||
|
name = "Launch Google Chrome";
|
||||||
};
|
};
|
||||||
|
|
||||||
"${ptlp}" = {
|
"${ptlp}" = {
|
||||||
default = "71a9971e-e829-43a9-9b2f-4565c855d664";
|
#default = "95894cfd-82f7-430d-af6e-84d168bc34f5";
|
||||||
list = [
|
list = [
|
||||||
"de8a9081-8352-4ce4-9519-5de655ad9361"
|
"de8a9081-8352-4ce4-9519-5de655ad9361"
|
||||||
"71a9971e-e829-43a9-9b2f-4565c855d664"
|
"71a9971e-e829-43a9-9b2f-4565c855d664"
|
||||||
|
@ -151,41 +205,80 @@ in mkIf cfg.enable {
|
||||||
"windowsNavigator@gnome-shell-extensions.gcampax.github.com"
|
"windowsNavigator@gnome-shell-extensions.gcampax.github.com"
|
||||||
"window-list@gnome-shell-extensions.gcampax.github.com"
|
"window-list@gnome-shell-extensions.gcampax.github.com"
|
||||||
"workspace-indicator@gnome-shell-extensions.gcampax.github.com"
|
"workspace-indicator@gnome-shell-extensions.gcampax.github.com"
|
||||||
"dash-to-panel@jderose9.github.com"
|
"dash-to-dock@micxgx.gmail.com"
|
||||||
];
|
];
|
||||||
enabled-extensions = [
|
enabled-extensions = [
|
||||||
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
||||||
"apps-menu@gnome-shell-extensions.gcampax.github.com"
|
"apps-menu@gnome-shell-extensions.gcampax.github.com"
|
||||||
"drive-menu@gnome-shell-extensions.gcampax.github.com"
|
"drive-menu@gnome-shell-extensions.gcampax.github.com"
|
||||||
"dash-to-dock@micxgx.gmail.com"
|
"appindicatorsupport@rgcjonas.gmail.com"
|
||||||
|
"dash-to-panel@jderose9.github.com"
|
||||||
|
"caffeine@patapon.info"
|
||||||
|
"PrivacyMenu@stuarthayhurst"
|
||||||
];
|
];
|
||||||
|
last-selected-power-profile = "performance";
|
||||||
welcome-dialog-last-shown-version = "45.3";
|
welcome-dialog-last-shown-version = "45.3";
|
||||||
};
|
};
|
||||||
|
|
||||||
"${pse}/user-theme".name = "Catppuccin-Frappe-Compact-Pink-Dark";
|
#"${pse}/user-theme".name = "catppuccin-mocha-pink-compact";
|
||||||
|
|
||||||
|
"${pse}/caffeine" = {
|
||||||
|
screen-blank = "never";
|
||||||
|
};
|
||||||
|
|
||||||
"${pse}/dash-to-dock" = {
|
"${pse}/dash-to-dock" = {
|
||||||
background-opacity = 0.80000000000000004;
|
background-opacity = 0.80000000000000004;
|
||||||
dash-max-icon-size = 48;
|
dash-max-icon-size = 48;
|
||||||
dock-position = "BOTTOM";
|
dock-position = "BOTTOM";
|
||||||
height-fraction = 0.90000000000000002;
|
height-fraction = 0.90000000000000002;
|
||||||
multi-monitor = true;
|
multi-monitor = false;
|
||||||
|
running-indicator-style = "DOTS";
|
||||||
|
custom-theme-shrink = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
"${pse}/dash-to-panel" = {
|
"${pse}/dash-to-panel" = {
|
||||||
animate-appicon-hover-animation-extent = ''{'RIPPLE': 4, 'PLANK': 4, 'SIMPLE': 1}'';
|
animate-appicon-hover = false;
|
||||||
|
animate-appicon-hover-animation-type = "SIMPLE";
|
||||||
appicon-margin = 0;
|
appicon-margin = 0;
|
||||||
appicon-padding = 4;
|
appicon-padding = 4;
|
||||||
|
appicon-style= "NORMAL";
|
||||||
available-monitors = [ 0 ];
|
available-monitors = [ 0 ];
|
||||||
dot-position = "BOTTOM";
|
dot-position = "BOTTOM";
|
||||||
|
dot-style-focused = "METRO";
|
||||||
|
dot-style-unfocused = "DOTS";
|
||||||
|
group-apps = true;
|
||||||
|
hide-overview-on-startup = true;
|
||||||
hotkeys-overlay-combo = "TEMPORARILY";
|
hotkeys-overlay-combo = "TEMPORARILY";
|
||||||
|
intellihide = true;
|
||||||
|
intellihide-behaviour = "FOCUSED_WINDOWS";
|
||||||
|
intellihide-hide-from-windows = true;
|
||||||
|
isolate-workspaces = false;
|
||||||
leftbox-padding = -1;
|
leftbox-padding = -1;
|
||||||
|
overview-click-to-exit = true;
|
||||||
panel-anchors = ''{"0":"MIDDLE"}'';
|
panel-anchors = ''{"0":"MIDDLE"}'';
|
||||||
panel-lengths=''{"0":100}'';
|
panel-element-positions = ''{"0":[{"element":"showAppsButton","visible":true,"position":"stackedTL"},{"element":"activitiesButton","visible":true,"position":"stackedTL"},{"element":"leftBox","visible":false,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"centerMonitor"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":false,"position":"stackedBR"}]}'';
|
||||||
panel-sizes=''{"0":42}'';
|
panel-lengths = ''{"0":100}'';
|
||||||
|
panel-positions = ''{"0":"BOTTOM"}'';
|
||||||
|
panel-sizes = ''{"0":42}'';
|
||||||
primary-monitor = 0;
|
primary-monitor = 0;
|
||||||
|
secondarymenu-contains-showdetails = true;
|
||||||
|
show-showdesktop-hover = true;
|
||||||
status-icon-padding = -1;
|
status-icon-padding = -1;
|
||||||
trans-use-custom-bg = false;
|
stockgs-force-hotcorner = false;
|
||||||
|
stockgs-keep-dash = false;
|
||||||
|
stockgs-keep-top-panel = false;
|
||||||
|
stockgs-panelbtn-click-only = false;
|
||||||
|
trans-bg-color = "#2a2a2a";
|
||||||
|
trans-dynamic-anim-target = 1.0;
|
||||||
|
trans-dynamic-behavior = "MAXIMIZED_WINDOWS";
|
||||||
|
trans-gradient-bottom-color = "#000000";
|
||||||
|
trans-gradient-bottom-opacity = 0.5;
|
||||||
|
trans-gradient-top-opacity = 0.0;
|
||||||
|
trans-panel-opacity = 0.0;
|
||||||
|
trans-use-custom-bg = true;
|
||||||
|
trans-use-custom-gradient = true;
|
||||||
|
trans-use-custom-opacity = true;
|
||||||
|
trans-use-dynamic-opacity = true;
|
||||||
tray-padding = -1;
|
tray-padding = -1;
|
||||||
window-preview-title-position = "TOP";
|
window-preview-title-position = "TOP";
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,33 +4,29 @@
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.passthrough.gnome;
|
cfg = config.passthrough.gnome;
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
# cursor theme
|
|
||||||
home.pointerCursor = {
|
|
||||||
package = pkgs.catppuccin-cursors.frappeDark;
|
|
||||||
name = "Catppuccin-Frappe-Dark-Cursors";
|
|
||||||
};
|
|
||||||
|
|
||||||
# gtk theme
|
|
||||||
gtk.theme = {
|
|
||||||
package = pkgs.catppuccin-gtk.override {
|
|
||||||
accents = [ "pink" ];
|
|
||||||
size = "compact";
|
|
||||||
#tweaks = [ "rimless" "black" ];
|
|
||||||
variant = "frappe";
|
|
||||||
};
|
|
||||||
name = "Catppuccin-Frappe-Compact-Pink-Dark";
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages =
|
home.packages =
|
||||||
with pkgs;
|
with pkgs;
|
||||||
with gnome;
|
with gnome;
|
||||||
with gnomeExtensions; [
|
with gnomeExtensions; [
|
||||||
# gnome
|
# gtk3 theme
|
||||||
gnome-terminal
|
adw-gtk3
|
||||||
|
|
||||||
# gnomeExtensions
|
# gnomeExtensions
|
||||||
|
caffeine
|
||||||
dash-to-panel
|
dash-to-panel
|
||||||
dash-to-dock
|
dash-to-dock
|
||||||
appindicator
|
appindicator
|
||||||
|
privacy-settings-menu
|
||||||
];
|
];
|
||||||
|
|
||||||
|
catppuccin.enable = mkForce false;
|
||||||
|
home.pointerCursor = mkForce null;
|
||||||
|
gtk.enable = false;
|
||||||
|
|
||||||
|
home.persistence."/nix/persist/home/${config.home.username}" = {
|
||||||
|
removePrefixDirectory = true;
|
||||||
|
files = [
|
||||||
|
(if config.specialisation != {} then "gnome/.config/monitors.xml" else "extern/.config/monitors.xml")
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,46 @@
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.home.gnome;
|
cfg = config.home.gnome;
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
|
global.flatpak.enable = mkDefault true;
|
||||||
|
home.catppuccin.enable = mkDefault false;
|
||||||
|
catppuccin.enable = false;
|
||||||
programs.regreet.enable = false;
|
programs.regreet.enable = false;
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
services.xserver.displayManager.startx.enable = false;
|
services.xserver.displayManager.startx.enable = false;
|
||||||
services.xserver.displayManager.gdm.enable = true;
|
services.xserver.displayManager.gdm.enable = true;
|
||||||
services.xserver.desktopManager.gnome.enable = true;
|
services.xserver.desktopManager.gnome.enable = true;
|
||||||
services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
|
services.udev.packages = with pkgs; [ gnome-settings-daemon ];
|
||||||
|
services.hardware.bolt.enable = true;
|
||||||
|
xdg.portal.configPackages = with pkgs; [ gnome-session ];
|
||||||
|
hardware.pulseaudio.enable = false;
|
||||||
|
|
||||||
users.home.persist.directories = [ ];
|
environment.gnome.excludePackages = (with pkgs; [
|
||||||
environment.persistence."/nix/persist/fhs".directories = [ ];
|
snapshot
|
||||||
|
gnome-tour
|
||||||
|
] ++ optionals config.global.flatpak.enable [
|
||||||
|
baobab
|
||||||
|
simple-scan
|
||||||
|
evince
|
||||||
|
file-roller
|
||||||
|
geary
|
||||||
|
loupe
|
||||||
|
seahorse
|
||||||
|
totem
|
||||||
|
epiphany
|
||||||
|
gnome-calculator
|
||||||
|
gnome-calendar
|
||||||
|
gnome-connections
|
||||||
|
gnome-font-viewer
|
||||||
|
gnome-text-editor
|
||||||
|
gnome-characters
|
||||||
|
gnome-clocks
|
||||||
|
gnome-contacts
|
||||||
|
gnome-logs
|
||||||
|
gnome-maps
|
||||||
|
gnome-music
|
||||||
|
gnome-weather
|
||||||
|
]) ++ (with pkgs.gnome; [ ] ++ optionals config.global.flatpak.enable [
|
||||||
|
]);
|
||||||
|
|
||||||
|
users.home.persist.directories = [ ".config/dconf" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ in {
|
||||||
config = {
|
config = {
|
||||||
users.homeModules = [
|
users.homeModules = [
|
||||||
# this module passes gnome configuration to home-manager
|
# this module passes gnome configuration to home-manager
|
||||||
{ passthrough.gnome= cfg; }
|
{ passthrough.gnome = cfg; }
|
||||||
];
|
];
|
||||||
|
|
||||||
specialisation.nognome = with cfg; mkIf enable {
|
specialisation.nognome = with cfg; mkIf enable {
|
||||||
|
|
|
@ -1,29 +1,35 @@
|
||||||
{ pkgs
|
{ pkgs
|
||||||
, lib
|
, lib
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; mkIf config.passthrough.gui {
|
, ... }: with lib; let
|
||||||
# cursor theme
|
catppuccin = config.passthrough.catppuccin.enable;
|
||||||
home.pointerCursor = {
|
in {
|
||||||
package = mkDefault pkgs.bibata-cursors;
|
config = mkIf config.passthrough.gui {
|
||||||
name = mkDefault "Bibata-Modern-Classic";
|
# cursor theme
|
||||||
size = 24;
|
home.pointerCursor = {
|
||||||
|
package = mkDefault pkgs.bibata-cursors;
|
||||||
|
name = mkDefault "Bibata-Modern-Classic";
|
||||||
|
size = 24;
|
||||||
|
x11.enable = true;
|
||||||
|
gtk.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# gtk theme
|
||||||
|
gtk.theme = mkDefault {
|
||||||
|
package = pkgs.whitesur-gtk-theme;
|
||||||
|
name = "WhiteSur-Dark";
|
||||||
|
};
|
||||||
|
|
||||||
|
# gtk icons
|
||||||
|
gtk.iconTheme = mkDefault {
|
||||||
|
package = pkgs.papirus-icon-theme;
|
||||||
|
name = "Papirus-Dark";
|
||||||
|
};
|
||||||
|
|
||||||
|
# unify qt theme
|
||||||
|
qt.platformTheme.name = mkDefault "gtk";
|
||||||
|
|
||||||
|
gtk.enable = mkDefault true;
|
||||||
|
qt.enable = mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# gtk theme
|
|
||||||
gtk.theme = {
|
|
||||||
package = mkDefault pkgs.whitesur-gtk-theme;
|
|
||||||
name = mkDefault "WhiteSur-Dark";
|
|
||||||
};
|
|
||||||
|
|
||||||
# gtk icons
|
|
||||||
gtk.iconTheme = {
|
|
||||||
package = mkDefault pkgs.papirus-icon-theme;
|
|
||||||
name = mkDefault "Papirus-Dark";
|
|
||||||
};
|
|
||||||
|
|
||||||
# unify qt theme
|
|
||||||
qt.platformTheme = mkDefault "gtk";
|
|
||||||
|
|
||||||
gtk.enable = mkDefault true;
|
|
||||||
qt.enable = mkDefault true;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
gui = with config.global.gpu; enable && session;
|
gui = with config.global.gpu; enable && session;
|
||||||
|
catppuccin = config.home.catppuccin;
|
||||||
in {
|
in {
|
||||||
config = {
|
config = {
|
||||||
users.homeModules = [
|
users.homeModules = [
|
||||||
|
@ -12,10 +13,13 @@ in {
|
||||||
users.adminGroups = mkIf gui [ "video" ];
|
users.adminGroups = mkIf gui [ "video" ];
|
||||||
|
|
||||||
# themes and icons
|
# themes and icons
|
||||||
environment.systemPackages = with pkgs; mkIf gui [
|
environment.systemPackages = with pkgs; mkIf gui ([
|
||||||
whitesur-gtk-theme whitesur-icon-theme
|
papirus-icon-theme
|
||||||
papirus-icon-theme bibata-cursors
|
] ++ optionals (!catppuccin.enable) [
|
||||||
];
|
whitesur-gtk-theme
|
||||||
|
whitesur-icon-theme
|
||||||
|
bibata-cursors
|
||||||
|
]);
|
||||||
|
|
||||||
fonts.enableDefaultPackages = mkIf gui true;
|
fonts.enableDefaultPackages = mkIf gui true;
|
||||||
|
|
||||||
|
@ -26,7 +30,7 @@ in {
|
||||||
dconf.enable = true;
|
dconf.enable = true;
|
||||||
};
|
};
|
||||||
services = mkIf gui {
|
services = mkIf gui {
|
||||||
blueman.enable = true;
|
blueman.enable = !config.global.flatpak.enable;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,10 @@
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.passthrough.gyroflow;
|
cfg = config.passthrough.gyroflow;
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [ gyroflow ];
|
# temporarily gone until regression is fixed
|
||||||
|
#home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
wayland.windowManager.sway.config.window.commands = [
|
||||||
|
{ criteria.app_id = "xyz.gyroflow.gyroflow"; command = "floating enable"; }
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,13 @@
|
||||||
in {
|
in {
|
||||||
options.home.gyroflow = {
|
options.home.gyroflow = {
|
||||||
enable = mkEnableOption "gyroflow stabilisation software";
|
enable = mkEnableOption "gyroflow stabilisation software";
|
||||||
|
package = mkOption {
|
||||||
|
type = with types; package;
|
||||||
|
default = pkgs.gyroflow.overrideAttrs (finalAttrs: previousAttrs: {
|
||||||
|
buildInputs = previousAttrs.buildInputs ++ [ pkgs.qt6Packages.qtwayland ];
|
||||||
|
});
|
||||||
|
description = "gyroflow package";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
24
home/headless/home.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.passthrough.headless;
|
||||||
|
in mkIf (cfg.enable != null) {
|
||||||
|
wayland.windowManager.sway.config = {
|
||||||
|
output = {
|
||||||
|
${cfg.enable}.pos = "0 0";
|
||||||
|
HEADLESS-1 = cfg.output;
|
||||||
|
};
|
||||||
|
|
||||||
|
startup = [ { command = "swaymsg create_output && swaymsg output HEADLESS-1 disable"; } ];
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = [ (pkgs.writeShellScriptBin "headless" ''
|
||||||
|
swaymsg output HEADLESS-1 enable
|
||||||
|
${pkgs.wayvnc}/bin/wayvnc \
|
||||||
|
--output=HEADLESS-1 \
|
||||||
|
${cfg.extraArgs} \
|
||||||
|
${cfg.host} ${toString cfg.port}
|
||||||
|
swaymsg output HEADLESS-1 disable
|
||||||
|
'') ];
|
||||||
|
}
|
51
home/headless/nixos.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.home.headless;
|
||||||
|
in {
|
||||||
|
options.home.headless = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "a headless, remotely viewed sway display";
|
||||||
|
};
|
||||||
|
|
||||||
|
output = mkOption {
|
||||||
|
type = with types; attrsOf str;
|
||||||
|
default = {
|
||||||
|
# pixel tablet
|
||||||
|
mode = "2560x1600";
|
||||||
|
scale = "2";
|
||||||
|
pos = "1920 0";
|
||||||
|
};
|
||||||
|
description = "headless display configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
host = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "0.0.0.0";
|
||||||
|
description = "wayvnc listen host";
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = with types; port;
|
||||||
|
# utility port
|
||||||
|
default = 1300;
|
||||||
|
description = "wayvnc listen port";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraArgs = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "--max-fps=60";
|
||||||
|
description = "extra wayvnc args";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
users.homeModules = [
|
||||||
|
# this module passes headless configuration to home-manager
|
||||||
|
{ passthrough.headless = cfg; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
11
home/jetbrains/home.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.passthrough.jetbrains;
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs.jetbrains; [ pkgs.go ] ++
|
||||||
|
optional cfg.idea idea-community ++
|
||||||
|
optional cfg.clion clion ++
|
||||||
|
optional cfg.goland goland;
|
||||||
|
}
|
27
home/jetbrains/nixos.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.home.jetbrains;
|
||||||
|
in {
|
||||||
|
options.home.jetbrains = {
|
||||||
|
enable = mkEnableOption "jetbrains text editor";
|
||||||
|
idea = mkEnableOption "intellij idea";
|
||||||
|
clion = mkEnableOption "clion ide";
|
||||||
|
goland = mkEnableOption "goland ide" // { default = true; };
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
users.homeModules = [
|
||||||
|
# this module passes jetbrains configuration to home-manager
|
||||||
|
{ passthrough.jetbrains = cfg; }
|
||||||
|
];
|
||||||
|
|
||||||
|
users.home.persist.directories = mkIf cfg.enable [
|
||||||
|
"go"
|
||||||
|
".java/.userPrefs"
|
||||||
|
".config/JetBrains"
|
||||||
|
".local/share/JetBrains"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -2,15 +2,15 @@
|
||||||
, lib
|
, lib
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
|
inherit (config.passthrough) gui;
|
||||||
cfg = config.passthrough.minecraft;
|
cfg = config.passthrough.minecraft;
|
||||||
enable = cfg.enable && (cfg.allUsers || (config.home.username == "app"));
|
enable = cfg.enable && config.home.username == cfg.user;
|
||||||
in mkIf enable {
|
in mkIf enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
prismlauncher
|
|
||||||
jdk8
|
jdk8
|
||||||
];
|
] ++ optional gui prismlauncher;
|
||||||
|
|
||||||
wayland.windowManager.sway.config.window.commands = [
|
wayland.windowManager.sway.config.window.commands = mkIf gui [
|
||||||
{ criteria.app_id = "org.prismlauncher.PrismLauncher"; command = "floating enable"; }
|
{ criteria.app_id = "org.prismlauncher.PrismLauncher"; command = "floating enable"; }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,15 @@
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.home.minecraft;
|
cfg = config.home.minecraft;
|
||||||
persist = [ ".local/share/PrismLauncher" ];
|
gui = with config.global.gpu; enable && session;
|
||||||
in {
|
in {
|
||||||
options.home.minecraft = {
|
options.home.minecraft = {
|
||||||
enable = mkEnableOption "minecraft game launcher and jvm";
|
enable = mkEnableOption "minecraft game launcher and jvm";
|
||||||
allUsers = mkEnableOption "set up for all users";
|
user = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "minecraft";
|
||||||
|
description = "username which minecraft game client runs under";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
@ -16,7 +20,14 @@ in {
|
||||||
{ passthrough.minecraft = cfg; }
|
{ passthrough.minecraft = cfg; }
|
||||||
];
|
];
|
||||||
|
|
||||||
users.home.persist.directories = with cfg; mkIf (enable && allUsers) persist;
|
users.profiles.minecraft = mkIf (cfg.enable && cfg.user == "minecraft") {
|
||||||
users.home.persistApp.directories = with cfg; mkIf (enable && !allUsers) persist;
|
uid = 5801;
|
||||||
|
description = "Minecraft";
|
||||||
|
picture = ../picture/aux.png;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/nix/persist".users.${cfg.user} = mkIf (cfg.enable && gui) {
|
||||||
|
directories = [ ".local/share/PrismLauncher" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 114 KiB |
BIN
home/picture/aux.png
Normal file
After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 99 KiB |
13
home/plasma/config.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
programs.plasma = {
|
||||||
|
workspace = {
|
||||||
|
lookAndFeel = "org.kde.breezedark.desktop";
|
||||||
|
#clickItemTo = "select";
|
||||||
|
};
|
||||||
|
|
||||||
|
configFile = {
|
||||||
|
baloofilerc."Basic Settings"."Indexing-Enabled" = false;
|
||||||
|
kcminputrc.Libinput."2362"."597"."UNIW0001:00 093A:0255 Touchpad".NaturalScroll = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
51
home/plasma/home.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.passthrough.plasma;
|
||||||
|
image = ../../share/54345906_p0.jpg;
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
programs.plasma = {
|
||||||
|
# https://github.com/pjones/plasma-manager
|
||||||
|
enable = true;
|
||||||
|
#overrideConfig = true;
|
||||||
|
|
||||||
|
workspace = {
|
||||||
|
lookAndFeel = "org.kde.breezedark.desktop";
|
||||||
|
wallpaper = image;
|
||||||
|
};
|
||||||
|
|
||||||
|
hotkeys.commands = {
|
||||||
|
launch-konsole = {
|
||||||
|
name = "Launch Konsole";
|
||||||
|
key = "Meta+Enter";
|
||||||
|
command = "konsole";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
configFile = {
|
||||||
|
baloofilerc."Basic Settings"."Indexing-Enabled" = false;
|
||||||
|
kscreenlockerrc.Greeter.Wallpaper."org.kde.image".General.Image = image;
|
||||||
|
kscreenlockerrc.Greeter.Wallpaper."org.kde.image".General.PreviewImage = image;
|
||||||
|
};
|
||||||
|
} // cfg.extraConfig;
|
||||||
|
|
||||||
|
home.activation.gtkCleanup = hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
$DRY_RUN_CMD rm -f $HOME/.gtkrc-2.0.old
|
||||||
|
'';
|
||||||
|
|
||||||
|
qt.enable = false;
|
||||||
|
qt.platformTheme.name = null;
|
||||||
|
|
||||||
|
# gtk theme
|
||||||
|
gtk.theme = {
|
||||||
|
package = pkgs.kdePackages.breeze-gtk;
|
||||||
|
name = "Breeze-Dark";
|
||||||
|
};
|
||||||
|
|
||||||
|
# gtk icons
|
||||||
|
gtk.iconTheme = {
|
||||||
|
package = pkgs.kdePackages.breeze-icons;
|
||||||
|
name = "breeze-dark";
|
||||||
|
};
|
||||||
|
}
|
52
home/plasma/nixos.nix
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, plasma-manager
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.home.plasma;
|
||||||
|
in {
|
||||||
|
options.home.plasma = {
|
||||||
|
enable = mkEnableOption "plasma desktop and configuration";
|
||||||
|
specialise = mkEnableOption "enable plasma in a specialisation";
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = with types; anything;
|
||||||
|
default = { };
|
||||||
|
description = "extra plasma-manager configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
users.homeModules = [
|
||||||
|
# this module passes plasma configuration to home-manager
|
||||||
|
{ passthrough.plasma = cfg; }
|
||||||
|
];
|
||||||
|
|
||||||
|
users.home.persist.files = mkIf cfg.enable [
|
||||||
|
".config/kwinoutputconfig.json"
|
||||||
|
];
|
||||||
|
users.home.persist.directories = mkIf cfg.enable [
|
||||||
|
".local/share/kwalletd"
|
||||||
|
];
|
||||||
|
|
||||||
|
services.desktopManager.plasma6 = mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.backupFileExtension = mkIf cfg.enable "old";
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
plasma-manager.homeManagerModules.plasma-manager
|
||||||
|
];
|
||||||
|
|
||||||
|
services.blueman = mkIf cfg.enable {
|
||||||
|
enable = mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
home = mkIf cfg.enable {
|
||||||
|
catppuccin.enable = mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
specialisation.plasma = mkIf cfg.specialise {
|
||||||
|
configuration.home.plasma.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{ pkgs
|
{ pkgs
|
||||||
, lib
|
, lib
|
||||||
, config
|
, config
|
||||||
|
, inputs
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.users;
|
cfg = config.users;
|
||||||
in {
|
in {
|
||||||
|
@ -86,6 +87,7 @@ in {
|
||||||
adminGroups = [
|
adminGroups = [
|
||||||
"wheel" "kvm"
|
"wheel" "kvm"
|
||||||
"systemd-journal"
|
"systemd-journal"
|
||||||
|
"networkmanager"
|
||||||
];
|
];
|
||||||
|
|
||||||
# base home modules in current directory
|
# base home modules in current directory
|
||||||
|
@ -136,13 +138,36 @@ in {
|
||||||
(filterAttrs (n: _: n != "root") config.users.profiles);
|
(filterAttrs (n: _: n != "root") config.users.profiles);
|
||||||
|
|
||||||
home-manager.users = mapAttrs (name: opts: {
|
home-manager.users = mapAttrs (name: opts: {
|
||||||
imports = cfg.homeModules;
|
imports = with inputs; cfg.homeModules ++ [
|
||||||
|
impermanence.homeManagerModules.impermanence
|
||||||
|
catppuccin.homeManagerModules.catppuccin
|
||||||
|
];
|
||||||
home.file.".face" = mkIf (opts.picture != null) {
|
home.file.".face" = mkIf (opts.picture != null) {
|
||||||
source = opts.picture;
|
source = opts.picture;
|
||||||
};
|
};
|
||||||
home.stateVersion = "23.11";
|
home.stateVersion = "23.11";
|
||||||
}) cfg.profiles;
|
}) cfg.profiles;
|
||||||
|
|
||||||
|
system.activationScripts = mapAttrs'
|
||||||
|
(name: opts: nameValuePair
|
||||||
|
"${name}-profile-icon"
|
||||||
|
{
|
||||||
|
deps = [ "users" ];
|
||||||
|
text = let
|
||||||
|
iconDest = "/var/lib/AccountsService/icons/${name}";
|
||||||
|
userConf = pkgs.writeText "${name}-config" ''
|
||||||
|
[User]
|
||||||
|
Session=
|
||||||
|
Icon=${iconDest}
|
||||||
|
SystemAccount=false
|
||||||
|
'';
|
||||||
|
in ''
|
||||||
|
install -Dm 0444 ${opts.picture} ${iconDest}
|
||||||
|
install -Dm 0400 ${userConf} /var/lib/AccountsService/users/${name}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
(filterAttrs (n: _: n != "root") config.users.profiles);
|
||||||
|
|
||||||
# set up standard persistence for users
|
# set up standard persistence for users
|
||||||
# this is registered internally for each software's configuration
|
# this is registered internally for each software's configuration
|
||||||
environment.persistence."/nix/persist" = {
|
environment.persistence."/nix/persist" = {
|
||||||
|
@ -158,6 +183,12 @@ in {
|
||||||
|
|
||||||
# enable passwordless sudo
|
# enable passwordless sudo
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
|
# enable access in build-vm
|
||||||
|
virtualisation.vmVariant = {
|
||||||
|
users.users.koishi.password = "passwd";
|
||||||
|
users.users.koishi.hashedPasswordFile = mkForce null;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# this is for home components that need to extend nixos
|
# this is for home components that need to extend nixos
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
swaynag.enable = true;
|
swaynag.enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
defaultWorkspace = "workspace number 1";
|
||||||
modifier = "Mod4";
|
modifier = "Mod4";
|
||||||
keybindings = let
|
keybindings = let
|
||||||
modifier = config.wayland.windowManager.sway.config.modifier;
|
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||||
|
@ -17,7 +18,7 @@
|
||||||
XF86MonBrightnessUp = "light -A 5";
|
XF86MonBrightnessUp = "light -A 5";
|
||||||
XF86MonBrightnessDown = "light -U 5";
|
XF86MonBrightnessDown = "light -U 5";
|
||||||
|
|
||||||
"Control+Alt+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 000000";
|
"Control+Alt+l" = "exec swaylock -f --grace 0";
|
||||||
"Print" = "exec ${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy";
|
"Print" = "exec ${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy";
|
||||||
"${modifier}+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy";
|
"${modifier}+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy";
|
||||||
"${modifier}+q" = "exec google-chrome-stable";
|
"${modifier}+q" = "exec google-chrome-stable";
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
gui = with config.global.gpu; enable && session;
|
gui = with config.global.gpu; enable && session;
|
||||||
nvidia = with config.global.gpu; type == "nvidia" || type == "prime";
|
nvidia = with config.global.gpu; type == "nvidia" || type == "prime";
|
||||||
in mkIf gui {
|
in mkIf gui {
|
||||||
services.xserver.displayManager.sessionPackages = [
|
services.displayManager.sessionPackages = [
|
||||||
(pkgs.writeTextFile {
|
(pkgs.writeTextFile {
|
||||||
name = "sway-session";
|
name = "sway-session";
|
||||||
destination = "/share/wayland-sessions/sway.desktop";
|
destination = "/share/wayland-sessions/sway.desktop";
|
||||||
|
@ -22,7 +22,7 @@ in mkIf gui {
|
||||||
for profile in ''${(z)NIX_PROFILES}; do
|
for profile in ''${(z)NIX_PROFILES}; do
|
||||||
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
|
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
|
||||||
done
|
done
|
||||||
exec sway ${if nvidia then "--unsupported-gpu" else ""}
|
exec sway${if nvidia then " --unsupported-gpu" else ""} 2>&1 >> $XDG_CACHE_HOME/sway
|
||||||
'';
|
'';
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
${pkgs.stdenv.shellDryRun} "$target"
|
${pkgs.stdenv.shellDryRun} "$target"
|
||||||
|
@ -33,6 +33,5 @@ in mkIf gui {
|
||||||
} // { providedSessions = [ pkgs.sway.meta.mainProgram ]; })
|
} // { providedSessions = [ pkgs.sway.meta.mainProgram ]; })
|
||||||
];
|
];
|
||||||
|
|
||||||
security.pam.services.swaylock = { };
|
|
||||||
programs.light.enable = true;
|
programs.light.enable = true;
|
||||||
}
|
}
|
||||||
|
|
24
home/swayidle/home.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; mkIf config.passthrough.gui {
|
||||||
|
services.swayidle = let
|
||||||
|
sway = config.wayland.windowManager.sway.package;
|
||||||
|
swaymsg = "${sway}/bin/swaymsg";
|
||||||
|
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
|
||||||
|
in {
|
||||||
|
enable = true;
|
||||||
|
systemdTarget = "sway-session.target";
|
||||||
|
timeouts = [
|
||||||
|
{ timeout = 600; command = "${swaymsg} 'output * dpms off'"; resumeCommand = "${swaymsg} 'output * dpms on'"; }
|
||||||
|
];
|
||||||
|
events = [
|
||||||
|
{ event = "before-sleep"; command = "${swaylock} -f --grace 0"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# fullscreen as simple idle inhibitor shortcut
|
||||||
|
wayland.windowManager.sway.config.window.commands = [
|
||||||
|
{ criteria.shell = ".*"; command = "inhibit_idle fullscreen"; }
|
||||||
|
];
|
||||||
|
}
|
24
home/swaylock/home.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; mkIf config.passthrough.gui {
|
||||||
|
programs.swaylock = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.swaylock-effects;
|
||||||
|
settings = {
|
||||||
|
indicator-caps-lock = true;
|
||||||
|
font-size = 20;
|
||||||
|
ignore-empty-password = true;
|
||||||
|
show-failed-attempts = true;
|
||||||
|
color = mkDefault "#00000000";
|
||||||
|
|
||||||
|
# Ring
|
||||||
|
indicator-radius = 115;
|
||||||
|
|
||||||
|
# Swaylock-effects specific settings
|
||||||
|
clock = true;
|
||||||
|
timestr = "%r";
|
||||||
|
grace = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
8
home/swaylock/nixos.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
gui = with config.global.gpu; enable && session;
|
||||||
|
in mkIf gui {
|
||||||
|
security.pam.services.swaylock = { };
|
||||||
|
}
|
|
@ -7,19 +7,22 @@ in {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
pv file wget e2fsprogs
|
pv file wget e2fsprogs
|
||||||
] ++ optionals (!cfg.minimal) [
|
] ++ optionals (!cfg.minimal) [
|
||||||
|
tio mbuffer sedutil
|
||||||
lsscsi zip unzip
|
lsscsi zip unzip
|
||||||
nix-index dnsutils whois
|
nix-index dnsutils whois
|
||||||
pciutils usbutils nvme-cli
|
pciutils usbutils nvme-cli
|
||||||
] ++ optionals config.passthrough.gui [
|
] ++ optionals config.passthrough.gui [
|
||||||
gtk-engine-murrine
|
gtk-engine-murrine
|
||||||
gnome-themes-extra
|
gnome-themes-extra
|
||||||
xfce.thunar gimp
|
|
||||||
|
|
||||||
mission-planner
|
mission-planner
|
||||||
betaflight-configurator
|
|
||||||
inav-configurator
|
inav-configurator
|
||||||
inav-blackbox-tools
|
inav-blackbox-tools
|
||||||
(blhelisuite32.override { workdir = "${config.home.homeDirectory}/.blhelisuite32"; })
|
(blhelisuite32.override { workdir = "${config.home.homeDirectory}/.blhelisuite32"; })
|
||||||
|
] ++ optionals (config.passthrough.gui && !config.passthrough.flatpak.enable) [
|
||||||
|
xfce.thunar gimp
|
||||||
|
jellyfin-media-player
|
||||||
|
betaflight-configurator
|
||||||
expresslrs-configurator
|
expresslrs-configurator
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ in {
|
||||||
users.homeModules = [
|
users.homeModules = [
|
||||||
# this module passes util configuration to home-manager
|
# this module passes util configuration to home-manager
|
||||||
{ passthrough.util = cfg; }
|
{ passthrough.util = cfg; }
|
||||||
|
# this module passes flatpak configuration to home-manager
|
||||||
|
{ passthrough.flatpak = config.global.flatpak; }
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
@ -23,10 +25,20 @@ in {
|
||||||
".cache/nix-index"
|
".cache/nix-index"
|
||||||
] ++
|
] ++
|
||||||
optionals gui [
|
optionals gui [
|
||||||
|
# mission-planner
|
||||||
".local/share/Mission Planner"
|
".local/share/Mission Planner"
|
||||||
".config/ExpressLRS Configurator"
|
# inav-configurator
|
||||||
".config/betaflight-configurator"
|
|
||||||
".config/inav-configurator"
|
".config/inav-configurator"
|
||||||
|
] ++
|
||||||
|
optionals (gui && !config.global.flatpak.enable) [
|
||||||
|
# jellyfin-media-player
|
||||||
|
".config/jellyfin.org"
|
||||||
|
".local/share/jellyfinmediaplayer"
|
||||||
|
".local/share/Jellyfin Media Player"
|
||||||
|
# expresslrs-configurator
|
||||||
|
".config/ExpressLRS Configurator"
|
||||||
|
# betaflight-configurator
|
||||||
|
".config/betaflight-configurator"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
24
home/vscode/home.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.passthrough.vscode;
|
||||||
|
theme = config.passthrough.catppuccin.enable;
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
programs.vscode = {
|
||||||
|
enable = true;
|
||||||
|
mutableExtensionsDir = false;
|
||||||
|
enableUpdateCheck = false;
|
||||||
|
enableExtensionUpdateCheck = false;
|
||||||
|
package = pkgs.vscodium;
|
||||||
|
extensions = with pkgs.vscode-extensions; [
|
||||||
|
catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons
|
||||||
|
bbenoist.nix golang.go rust-lang.rust-analyzer
|
||||||
|
];
|
||||||
|
userSettings = {
|
||||||
|
"workbench.colorTheme" = mkIf theme "Catppuccin Mocha";
|
||||||
|
"workbench.iconTheme" = mkIf theme "catppuccin-mocha";
|
||||||
|
"[nix]"."editor.tabSize" = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
19
home/vscode/nixos.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.home.vscode;
|
||||||
|
in {
|
||||||
|
options.home.vscode = {
|
||||||
|
enable = mkEnableOption "vscode text editor";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
users.homeModules = [
|
||||||
|
# this module passes vscode configuration to home-manager
|
||||||
|
{ passthrough.vscode = cfg; }
|
||||||
|
];
|
||||||
|
|
||||||
|
users.home.persist.directories = mkIf cfg.enable [ ".config/VSCodium" ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -65,7 +65,7 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in buildFHSUserEnv {
|
in buildFHSUserEnv {
|
||||||
inherit pname;
|
inherit pname version;
|
||||||
targetPkgs = pkgs: (with pkgs; [
|
targetPkgs = pkgs: (with pkgs; [
|
||||||
glib libGL curl
|
glib libGL curl
|
||||||
libgcc gtk3
|
libgcc gtk3
|
||||||
|
|
|
@ -10,4 +10,10 @@
|
||||||
else { });
|
else { });
|
||||||
}) (builtins.attrNames (builtins.readDir ./.)))
|
}) (builtins.attrNames (builtins.readDir ./.)))
|
||||||
) ];
|
) ];
|
||||||
|
|
||||||
|
imports = lib.pipe ./. [
|
||||||
|
builtins.readDir
|
||||||
|
(lib.filterAttrs (n: ty: ty == "directory" && builtins.pathExists ./${n}/nixos.nix))
|
||||||
|
(lib.mapAttrsToList (n: _: ./${n}/nixos.nix))
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
, buildFHSUserEnv }: let
|
, buildFHSUserEnv }: let
|
||||||
name = "ExpressLRS-Configurator";
|
name = "ExpressLRS-Configurator";
|
||||||
pname = "expresslrs-configurator";
|
pname = "expresslrs-configurator";
|
||||||
version = "1.6.1";
|
version = "1.7.2";
|
||||||
|
|
||||||
dist = fetchzip {
|
dist = fetchzip {
|
||||||
name = "${pname}-dist";
|
name = "${pname}-dist";
|
||||||
url = "https://github.com/ExpressLRS/ExpressLRS-Configurator/releases/download/v${version}/${pname}-${version}.zip";
|
url = "https://github.com/ExpressLRS/ExpressLRS-Configurator/releases/download/v${version}/${pname}-${version}.zip";
|
||||||
stripRoot = false;
|
stripRoot = false;
|
||||||
hash = "sha256-m/e8dsOadjk63cwfnnCBbjXzI/ooWZUGRM5n267JmhQ=";
|
hash = "sha256-pXmJ420HeJaMjAZCzlIriuFrTK5xabxTrSy3PDVisgU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
genericName = "radio link configuration & build tool";
|
genericName = "radio link configuration & build tool";
|
||||||
};
|
};
|
||||||
in buildFHSUserEnv {
|
in buildFHSUserEnv {
|
||||||
inherit pname;
|
inherit pname version;
|
||||||
# copied from chromium deps
|
# copied from chromium deps
|
||||||
targetPkgs = pkgs: (with pkgs; [
|
targetPkgs = pkgs: (with pkgs; [
|
||||||
glib fontconfig freetype pango cairo xorg.libX11 xorg.libXi atk nss nspr
|
glib fontconfig freetype pango cairo xorg.libX11 xorg.libXi atk nss nspr
|
||||||
|
|
74
package/photoview/default.nix
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
{ lib
|
||||||
|
, pkg-config
|
||||||
|
, libjpeg_turbo
|
||||||
|
, libheif
|
||||||
|
, lapack
|
||||||
|
, dlib
|
||||||
|
, blas
|
||||||
|
, ffmpeg
|
||||||
|
, exiftool
|
||||||
|
, darktable
|
||||||
|
, fetchFromGitHub
|
||||||
|
, buildGoModule
|
||||||
|
, buildNpmPackage
|
||||||
|
, runCommandLocal
|
||||||
|
, makeWrapper }: buildGoModule rec {
|
||||||
|
pname = "photoview";
|
||||||
|
version = "2.4.0";
|
||||||
|
|
||||||
|
source = fetchFromGitHub {
|
||||||
|
name = "${pname}-src";
|
||||||
|
owner = pname;
|
||||||
|
repo = pname;
|
||||||
|
rev = "refs/tags/v${version}";
|
||||||
|
hash = "sha256-ZfvBdQlyqONsrviZGL22Kt+AiPaVWwdoREDUrHDYyIs=";
|
||||||
|
};
|
||||||
|
|
||||||
|
src = source + "/api";
|
||||||
|
vendorHash = "sha256-Tn4OxSV41s/4n2Q3teJRJNc39s6eKW4xE9wW/CIR5Fg=";
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkg-config
|
||||||
|
makeWrapper
|
||||||
|
];
|
||||||
|
buildInputs = [
|
||||||
|
libjpeg_turbo
|
||||||
|
libheif
|
||||||
|
lapack
|
||||||
|
dlib
|
||||||
|
blas
|
||||||
|
];
|
||||||
|
|
||||||
|
ui = buildNpmPackage {
|
||||||
|
pname = "${pname}-ui";
|
||||||
|
inherit version;
|
||||||
|
src = source + "/ui";
|
||||||
|
|
||||||
|
#REACT_APP_API_ENDPOINT = "";
|
||||||
|
REACT_APP_BUILD_VERSION = version;
|
||||||
|
REACT_APP_BUILD_DATE = builtins.readFile (runCommandLocal "date" { } "date -uI > $out" );
|
||||||
|
REACT_APP_BUILD_COMMIT_SHA = "nix";
|
||||||
|
|
||||||
|
npmDepsHash = "sha256-wUbfq+7SuJUBxfy9TxHVda8A0g4mmYCbzJT64XBN2mI=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
mkdir -p "$out/lib/${pname}"
|
||||||
|
|
||||||
|
mv "$out/bin/api" "$out/bin/${pname}"
|
||||||
|
wrapProgram $out/bin/${pname} \
|
||||||
|
--prefix PATH ":" "${lib.makeBinPath [
|
||||||
|
ffmpeg
|
||||||
|
exiftool
|
||||||
|
darktable
|
||||||
|
]}" \
|
||||||
|
--set PHOTOVIEW_SERVE_UI 1 \
|
||||||
|
--set PHOTOVIEW_UI_PATH "$out/lib/${pname}/ui"
|
||||||
|
cp -r \
|
||||||
|
"${src}/data/" \
|
||||||
|
"$out/lib/${pname}/data/"
|
||||||
|
|
||||||
|
cp -r \
|
||||||
|
"${ui}/lib/node_modules/photoview-ui/dist" \
|
||||||
|
"$out/lib/${pname}/ui"
|
||||||
|
'';
|
||||||
|
}
|
148
package/photoview/nixos.nix
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.services.photoview;
|
||||||
|
in {
|
||||||
|
options.services.photoview = {
|
||||||
|
enable = mkEnableOption "photoview server";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = with types; package;
|
||||||
|
default = pkgs.photoview;
|
||||||
|
description = "photoview package";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "photoview";
|
||||||
|
description = "user under which photoview runs";
|
||||||
|
};
|
||||||
|
group = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "photoview";
|
||||||
|
description = "group under which photoview runs";
|
||||||
|
};
|
||||||
|
|
||||||
|
listen = {
|
||||||
|
host = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "127.0.0.1";
|
||||||
|
description = "host to listen on";
|
||||||
|
};
|
||||||
|
port = mkOption {
|
||||||
|
type = with types; port;
|
||||||
|
default = 8000;
|
||||||
|
description = "port to listen on";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
database = {
|
||||||
|
driver = mkOption {
|
||||||
|
type = with types; enum [ "sqlite" "mysql" "postgres" ];
|
||||||
|
default = "sqlite";
|
||||||
|
description = "database driver";
|
||||||
|
};
|
||||||
|
string = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
description = "database connection string";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
stateDir = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "/var/lib/photoview";
|
||||||
|
description = "path to photoview state directory";
|
||||||
|
};
|
||||||
|
|
||||||
|
cacheDir = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "${cfg.stateDir}/media_cache";
|
||||||
|
description = "path to photoview media cache";
|
||||||
|
};
|
||||||
|
|
||||||
|
secrets = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "path to secrets environment file";
|
||||||
|
example = ''
|
||||||
|
MAPBOX_TOKEN=
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.services.photoview = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
description = "Photoview - Photo gallery for self-hosted personal servers";
|
||||||
|
environment = with cfg; {
|
||||||
|
PHOTOVIEW_LISTEN_IP = listen.host;
|
||||||
|
PHOTOVIEW_LISTEN_PORT = toString listen.port;
|
||||||
|
PHOTOVIEW_MEDIA_CACHE = cacheDir;
|
||||||
|
PHOTOVIEW_DATABASE_DRIVER = database.driver;
|
||||||
|
"PHOTOVIEW_${toUpper database.driver}_URL" = database.string;
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStartPre = pkgs.writeShellScript "photoview-pre" ''
|
||||||
|
rm -f "${cfg.stateDir}/data"
|
||||||
|
ln -s "${cfg.package}/lib/photoview/data" "${cfg.stateDir}/data"
|
||||||
|
'';
|
||||||
|
ExecStart = "${cfg.package}/bin/photoview";
|
||||||
|
WorkingDirectory = cfg.stateDir;
|
||||||
|
User = cfg.user;
|
||||||
|
Group = cfg.group;
|
||||||
|
EnvironmentFile = mkIf (cfg.secrets != null) cfg.secrets;
|
||||||
|
|
||||||
|
DevicePolicy = "closed";
|
||||||
|
LockPersonality = true;
|
||||||
|
MemoryDenyWriteExecute = true;
|
||||||
|
NoNewPrivileges = true;
|
||||||
|
PrivateTmp = true;
|
||||||
|
PrivateUsers = true;
|
||||||
|
ProtectClock = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
ProtectHostname = true;
|
||||||
|
ProtectKernelLogs = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
ProtectProc = "invisible";
|
||||||
|
ProcSubset = "all";
|
||||||
|
ProtectSystem = "strict";
|
||||||
|
RemoveIPC = true;
|
||||||
|
ReadWritePaths = [ cfg.stateDir ];
|
||||||
|
RestrictAddressFamilies = [
|
||||||
|
"AF_INET"
|
||||||
|
"AF_INET6"
|
||||||
|
"AF_NETLINK"
|
||||||
|
"AF_UNIX"
|
||||||
|
];
|
||||||
|
RestrictNamespaces = true;
|
||||||
|
RestrictRealtime = true;
|
||||||
|
RestrictSUIDSGID = true;
|
||||||
|
SystemCallArchitectures = "native";
|
||||||
|
SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
"~@privileged"
|
||||||
|
];
|
||||||
|
UMask = "0077";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users = mkIf (cfg.user == "photoview") {
|
||||||
|
photoview = {
|
||||||
|
description = "photoview service account";
|
||||||
|
group = cfg.group;
|
||||||
|
uid = config.ids.uids.photoview;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups = mkIf (cfg.group == "photoview") {
|
||||||
|
photoview.gid = config.ids.gids.photoview;
|
||||||
|
};
|
||||||
|
|
||||||
|
ids.uids.photoview = 287;
|
||||||
|
ids.gids.photoview = 287;
|
||||||
|
};
|
||||||
|
}
|
27
package/tubesync/database-local-socket.patch
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
diff --git a/tubesync/tubesync/local_settings.py.container b/tubesync/tubesync/local_settings.py.container
|
||||||
|
index a7a07ab..7564138 100644
|
||||||
|
--- a/tubesync/tubesync/local_settings.py.container
|
||||||
|
+++ b/tubesync/tubesync/local_settings.py.container
|
||||||
|
@@ -34,14 +34,20 @@ if database_connection_env:
|
||||||
|
database_dict = parse_database_connection_string(database_connection_env)
|
||||||
|
|
||||||
|
|
||||||
|
+database_host = database_dict.get("HOST")
|
||||||
|
+if database_host == "localhost":
|
||||||
|
+ database_dict["HOST"] = None
|
||||||
|
+ database_dict["PASSWORD"] = None
|
||||||
|
+
|
||||||
|
+
|
||||||
|
if database_dict:
|
||||||
|
log.info(f'Using database connection: {database_dict["ENGINE"]}://'
|
||||||
|
- f'{database_dict["USER"]}:[hidden]@{database_dict["HOST"]}:'
|
||||||
|
+ f'{database_dict["USER"]}:[hidden]@{database_host}:'
|
||||||
|
f'{database_dict["PORT"]}/{database_dict["NAME"]}')
|
||||||
|
DATABASES = {
|
||||||
|
'default': database_dict,
|
||||||
|
}
|
||||||
|
- DATABASE_CONNECTION_STR = (f'{database_dict["DRIVER"]} at "{database_dict["HOST"]}:'
|
||||||
|
+ DATABASE_CONNECTION_STR = (f'{database_dict["DRIVER"]} at "{database_host}:'
|
||||||
|
f'{database_dict["PORT"]}" database '
|
||||||
|
f'"{database_dict["NAME"]}"')
|
||||||
|
else:
|
139
package/tubesync/default.nix
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
{ lib
|
||||||
|
, stdenvNoCC
|
||||||
|
, ffmpeg
|
||||||
|
, rtmpdump
|
||||||
|
, atomicparsley
|
||||||
|
, callPackage
|
||||||
|
, fetchFromGitHub
|
||||||
|
, fetchPypi
|
||||||
|
, fetchpatch
|
||||||
|
, makeWrapper
|
||||||
|
, python3Packages }: with python3Packages; let
|
||||||
|
mkPypi = pname: version: src: format: buildPythonPackage {
|
||||||
|
inherit pname version src format;
|
||||||
|
doCheck = false;
|
||||||
|
nativeBuildInputs = [ setuptools ];
|
||||||
|
};
|
||||||
|
|
||||||
|
mkPypi' = pname: version: hash: format: mkPypi pname version
|
||||||
|
(fetchPypi {
|
||||||
|
inherit pname version hash;
|
||||||
|
}) format;
|
||||||
|
|
||||||
|
mkPypi'' = pname: version: hash: mkPypi' pname version hash
|
||||||
|
"setuptools";
|
||||||
|
|
||||||
|
django-compat = mkPypi'' "django-compat" "1.0.15" "sha256-OsmjvtxWuTZdnrJBvFFX0MGTdpv5lfmnjcG8JOfCMxs=";
|
||||||
|
django-appconf = mkPypi'' "django-appconf" "1.0.6" "sha256-z+h+qCfE7gS5pw+rkLhtcEywLymB+J2oQjyw+r+I778=";
|
||||||
|
django-basicauth = mkPypi'' "django-basicauth" "0.5.3" "sha256-FenjZvaY9TxxseeU2v6gYPmQoqxVa65rczDdJTJKCRw=";
|
||||||
|
django-sass-processor = mkPypi'' "django-sass-processor" "1.4" "sha256-sX850H06dRCuxCXBkZN+IwUC3ut8pr9pUKGt+LS3wcM=";
|
||||||
|
django-background-tasks = mkPypi'' "django-background-tasks" "1.2.5" "sha256-4bGejUlaJ2ydZMWh/4tBEy910vWORb5xt4ZQ2tWa+d4=";
|
||||||
|
|
||||||
|
django-compressor = let
|
||||||
|
pname = "django-compressor";
|
||||||
|
version = "4.4";
|
||||||
|
in mkPypi pname version (fetchFromGitHub {
|
||||||
|
owner = pname;
|
||||||
|
repo = pname;
|
||||||
|
rev = "refs/tags/${version}";
|
||||||
|
hash = "sha256-c9uS5Z077b23Aj8jV30XNsshbEfrLRX3ozXasitQ6UQ=";
|
||||||
|
}) "setuptools";
|
||||||
|
|
||||||
|
app = buildPythonApplication rec {
|
||||||
|
pname = "tubesync";
|
||||||
|
version = "0.13.6";
|
||||||
|
format = "other";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
name = "${pname}-src";
|
||||||
|
owner = "meeb";
|
||||||
|
repo = pname;
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-5l1HkMoTn99rNeeK5u+KoFejTFi2LfLyt8upq7xwrj0=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./gunicorn-env.patch
|
||||||
|
./state-dir-env.patch
|
||||||
|
./database-local-socket.patch
|
||||||
|
./ensure-fragments.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
yt-dlp requests
|
||||||
|
httptools pillow
|
||||||
|
gunicorn whitenoise
|
||||||
|
psycopg2 mysqlclient
|
||||||
|
redis hiredis
|
||||||
|
libsass six
|
||||||
|
] ++ [
|
||||||
|
django_3
|
||||||
|
django-compat
|
||||||
|
django-appconf
|
||||||
|
django-compressor
|
||||||
|
django-basicauth
|
||||||
|
django-sass-processor
|
||||||
|
django-background-tasks
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
mv "tubesync/tubesync/local_settings.py.container" "tubesync/tubesync/local_settings.py"
|
||||||
|
rm "tubesync/tubesync/local_settings.py.example"
|
||||||
|
rm "tubesync/tubesync/local_settings.py.container.orig"
|
||||||
|
|
||||||
|
python3 tubesync/manage.py compilescss
|
||||||
|
python3 tubesync/manage.py collectstatic --no-input
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p "$out"
|
||||||
|
cp -r "tubesync" "$out/app"
|
||||||
|
|
||||||
|
FFMPEG_VERSION=$(${ffmpegFix}/bin/ffmpeg -version | head -n 1 | awk '{ print $3 }')
|
||||||
|
echo "ffmpeg_version = '$FFMPEG_VERSION'" >> "$out/app/common/third_party_versions.py"
|
||||||
|
|
||||||
|
mv "$out/app/static" "$out/static"
|
||||||
|
ln -s "/tmp/tubesync/static" "$out/app/static"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
ffmpegFix = ffmpeg.overrideAttrs (finalAttrs: previousAttrs: {
|
||||||
|
patches = previousAttrs.patches ++ [ (fetchpatch {
|
||||||
|
name = "avformat-webvttdec-skip-style-region.patch";
|
||||||
|
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/51d303e20cbb0874172f50b5172c515a973587d4";
|
||||||
|
hash = "sha256-dxCjKZUz2H2QyktsprkzyfNp5aDG6X8deF4ZGdvhvfk=";
|
||||||
|
}) ];
|
||||||
|
});
|
||||||
|
in stdenvNoCC.mkDerivation {
|
||||||
|
pname = "${app.pname}-wrapped";
|
||||||
|
inherit (app) version;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
unpackPhase = "true";
|
||||||
|
installPhase = let
|
||||||
|
prefix = ''--prefix PATH : "${lib.makeBinPath [
|
||||||
|
ffmpegFix rtmpdump atomicparsley
|
||||||
|
]}"'';
|
||||||
|
in ''
|
||||||
|
mkdir -p "$out/bin"
|
||||||
|
|
||||||
|
makeWrapper "${python}/bin/python3" "$out/bin/tubesync-worker" \
|
||||||
|
--chdir ${app}/app --add-flags \
|
||||||
|
"${app}/app/manage.py process_tasks" \
|
||||||
|
${prefix}
|
||||||
|
|
||||||
|
makeWrapper "${gunicorn}/bin/gunicorn" "$out/bin/tubesync-gunicorn" \
|
||||||
|
--chdir ${app}/app --add-flags \
|
||||||
|
"-c ${app}/app/tubesync/gunicorn.py --capture-output tubesync.wsgi:application" \
|
||||||
|
${prefix}
|
||||||
|
|
||||||
|
makeWrapper "${python}/bin/python3" "$out/bin/tubesync-migrate" \
|
||||||
|
--chdir "${app}/app" --add-flags \
|
||||||
|
"${app}/app/manage.py migrate"
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
inherit app;
|
||||||
|
pythonPath = makePythonPath app.propagatedBuildInputs;
|
||||||
|
};
|
||||||
|
}
|
15
package/tubesync/ensure-fragments.patch
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
diff --git a/tubesync/sync/youtube.py b/tubesync/sync/youtube.py
|
||||||
|
index 4ac6e83..192b031 100644
|
||||||
|
--- a/tubesync/sync/youtube.py
|
||||||
|
+++ b/tubesync/sync/youtube.py
|
||||||
|
@@ -119,6 +119,10 @@ def download_media(url, media_format, extension, output_file, info_json,
|
||||||
|
'writesubtitles': write_subtitles,
|
||||||
|
'writeautomaticsub': auto_subtitles,
|
||||||
|
'subtitleslangs': sub_langs.split(','),
|
||||||
|
+ 'progress_with_newline': True,
|
||||||
|
+ 'fragment_retries': 65536,
|
||||||
|
+ 'skip_unavailable_fragments': False,
|
||||||
|
+ 'continue_dl': False,
|
||||||
|
}
|
||||||
|
|
||||||
|
sbopt = {
|
19
package/tubesync/gunicorn-env.patch
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
diff --git a/tubesync/tubesync/gunicorn.py b/tubesync/tubesync/gunicorn.py
|
||||||
|
index d59c138..341af25 100644
|
||||||
|
--- a/tubesync/tubesync/gunicorn.py
|
||||||
|
+++ b/tubesync/tubesync/gunicorn.py
|
||||||
|
@@ -23,11 +23,10 @@ def get_bind():
|
||||||
|
|
||||||
|
workers = get_num_workers()
|
||||||
|
timeout = 30
|
||||||
|
-chdir = '/app'
|
||||||
|
daemon = False
|
||||||
|
-pidfile = '/run/app/gunicorn.pid'
|
||||||
|
-user = 'app'
|
||||||
|
-group = 'app'
|
||||||
|
+pidfile = os.getenv('GUNICORN_PID_FILE', '/var/run/tubesync/gunicorn.pid')
|
||||||
|
+user = os.getenv('GUNICORN_USER', 'tubesync')
|
||||||
|
+group = os.getenv('GUNICORN_GROUP', 'tubesync')
|
||||||
|
loglevel = 'info'
|
||||||
|
errorlog = '-'
|
||||||
|
accesslog = '/dev/null' # Access logs are printed to stdout from nginx
|
188
package/tubesync/nixos.nix
Normal file
|
@ -0,0 +1,188 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.services.tubesync;
|
||||||
|
in {
|
||||||
|
options.services.tubesync = {
|
||||||
|
enable = mkEnableOption "tubesync stack";
|
||||||
|
debug = mkEnableOption "debug logging";
|
||||||
|
package = mkOption {
|
||||||
|
type = with types; package;
|
||||||
|
default = pkgs.tubesync;
|
||||||
|
description = "tubesync launcher package";
|
||||||
|
};
|
||||||
|
|
||||||
|
workers = mkOption {
|
||||||
|
type = with types; int;
|
||||||
|
default = 1;
|
||||||
|
description = "maximum amount of concurrent workers";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "tubesync";
|
||||||
|
description = "user under which tubesync runs";
|
||||||
|
};
|
||||||
|
group = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "tubesync";
|
||||||
|
description = "group under which tubesync runs";
|
||||||
|
};
|
||||||
|
|
||||||
|
listen = {
|
||||||
|
host = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "127.0.0.1";
|
||||||
|
description = "host to listen on";
|
||||||
|
};
|
||||||
|
port = mkOption {
|
||||||
|
type = with types; port;
|
||||||
|
default = 8080;
|
||||||
|
description = "port to listen on";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
stateDir = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "/var/lib/tubesync";
|
||||||
|
description = "path to tubesync state storage directory";
|
||||||
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "${cfg.stateDir}/downloads";
|
||||||
|
description = "path to tubesync video downloads";
|
||||||
|
};
|
||||||
|
|
||||||
|
database = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
default = "postgresql://tubesync:@localhost:5432/tubesync";
|
||||||
|
description = "database connection string";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.services = let
|
||||||
|
env = {
|
||||||
|
GUNICORN_PID_FILE = "${cfg.stateDir}/run/gunicorn.pid";
|
||||||
|
GUNICORN_USER = cfg.user;
|
||||||
|
GUNICORN_GROUP = cfg.group;
|
||||||
|
DATABASE_CONNECTION = cfg.database;
|
||||||
|
CONFIG_BASE_DIR = cfg.stateDir;
|
||||||
|
DOWNLOADS_BASE_DIR = cfg.dataDir;
|
||||||
|
TUBESYNC_DEBUG = mkIf cfg.debug "True";
|
||||||
|
TUBESYNC_WORKERS = toString cfg.workers;
|
||||||
|
|
||||||
|
PYTHONPATH = cfg.package.pythonPath;
|
||||||
|
REDIS_CONNECTION = "redis+socket://"
|
||||||
|
+ "${cfg.stateDir}/run/redis.sock";
|
||||||
|
};
|
||||||
|
|
||||||
|
base = description: {
|
||||||
|
description = "tubesync: ${description}";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
environment = env;
|
||||||
|
path = [ cfg.package ];
|
||||||
|
serviceConfig = {
|
||||||
|
WorkingDirectory = cfg.stateDir;
|
||||||
|
User = cfg.user;
|
||||||
|
Group = cfg.group;
|
||||||
|
LockPersonality = true;
|
||||||
|
MemoryDenyWriteExecute = true;
|
||||||
|
NoNewPrivileges = true;
|
||||||
|
PrivateTmp = true;
|
||||||
|
PrivateDevices = true;
|
||||||
|
PrivateUsers = false;
|
||||||
|
ProtectClock = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
ProtectHostname = true;
|
||||||
|
ProtectKernelLogs = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
ProtectProc = "invisible";
|
||||||
|
ProcSubset = "all";
|
||||||
|
ProtectSystem = "strict";
|
||||||
|
RemoveIPC = true;
|
||||||
|
ReadWritePaths = with cfg; [ stateDir dataDir ];
|
||||||
|
RestrictAddressFamilies = [
|
||||||
|
"AF_INET"
|
||||||
|
"AF_INET6"
|
||||||
|
"AF_NETLINK"
|
||||||
|
"AF_UNIX"
|
||||||
|
];
|
||||||
|
SystemCallArchitectures = "native";
|
||||||
|
SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
"~@privileged"
|
||||||
|
"@chown"
|
||||||
|
];
|
||||||
|
#UMask = "0077";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
base' = description: (base description) // {
|
||||||
|
after = [ "tubesync.service" ];
|
||||||
|
partOf = [ "tubesync.service" ];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
tubesync = recursiveUpdate (base "gunicorn") ({
|
||||||
|
after = [ "network.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
PIDFile = env.GUNICORN_PID_FILE;
|
||||||
|
ExecStartPre = pkgs.writeShellScript "tubesync-setup" ''
|
||||||
|
set -xe
|
||||||
|
tubesync-migrate
|
||||||
|
mkdir -p "${cfg.stateDir}/run"
|
||||||
|
|
||||||
|
mkdir -p "/tmp/tubesync"
|
||||||
|
cp -r "${cfg.package.app}/static/." "/tmp/tubesync/static"
|
||||||
|
chmod +w -R "/tmp/tubesync/static"
|
||||||
|
'';
|
||||||
|
ExecStart = "${cfg.package}/bin/tubesync-gunicorn";
|
||||||
|
ExecReload = "/usr/bin/env kill -s HUP $MAINPID";
|
||||||
|
ExecStop = "/usr/bin/env kill -s TERM $MAINPID";
|
||||||
|
ExecStopPost = pkgs.writeShellScript "tubesync-cleanup" ''
|
||||||
|
rm -f "$GUNICORN_PID_FILE"
|
||||||
|
rm -rf "/tmp/tubesync"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
tubesync-worker = recursiveUpdate (base' "worker") ({
|
||||||
|
serviceConfig.ExecStart = "${cfg.package}/bin/tubesync-worker";
|
||||||
|
});
|
||||||
|
|
||||||
|
# allow binding to unix socket
|
||||||
|
redis-tubesync-celery.serviceConfig.ReadWritePaths = [ "${cfg.stateDir}/run" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.redis.servers.tubesync-celery = {
|
||||||
|
enable = true;
|
||||||
|
inherit (cfg) user;
|
||||||
|
unixSocket = "${cfg.stateDir}/run/redis.sock";
|
||||||
|
save = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users = mkIf (cfg.user == "tubesync") {
|
||||||
|
tubesync = {
|
||||||
|
description = "tubesync service account";
|
||||||
|
group = cfg.group;
|
||||||
|
uid = config.ids.uids.tubesync;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups = mkIf (cfg.group == "tubesync") {
|
||||||
|
tubesync.gid = config.ids.gids.tubesync;
|
||||||
|
};
|
||||||
|
|
||||||
|
ids.uids.tubesync = 101;
|
||||||
|
ids.gids.tubesync = 101;
|
||||||
|
|
||||||
|
# package is local-only, will allow this for now
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
|
"python3.12-django-3.2.25"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
16
package/tubesync/state-dir-env.patch
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
diff --git a/tubesync/tubesync/local_settings.py.container b/tubesync/tubesync/local_settings.py.container
|
||||||
|
index a7a07ab..9207c7f 100644
|
||||||
|
--- a/tubesync/tubesync/local_settings.py.container
|
||||||
|
+++ b/tubesync/tubesync/local_settings.py.container
|
||||||
|
@@ -6,9 +6,8 @@ from common.utils import parse_database_connection_string
|
||||||
|
|
||||||
|
|
||||||
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
-ROOT_DIR = Path('/')
|
||||||
|
-CONFIG_BASE_DIR = ROOT_DIR / 'config'
|
||||||
|
-DOWNLOADS_BASE_DIR = ROOT_DIR / 'downloads'
|
||||||
|
+CONFIG_BASE_DIR = Path(os.getenv('CONFIG_BASE_DIR', "/var/lib/tubesync"))
|
||||||
|
+DOWNLOADS_BASE_DIR = Path(os.getenv('DOWNLOADS_BASE_DIR', f"{CONFIG_BASE_DIR}/downloads"))
|
||||||
|
DJANGO_URL_PREFIX = os.getenv('DJANGO_URL_PREFIX', None)
|
||||||
|
STATIC_URL = str(os.getenv('DJANGO_STATIC_URL', '/static/'))
|
||||||
|
if DJANGO_URL_PREFIX and STATIC_URL:
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
@ -1,4 +1,4 @@
|
||||||
{
|
{ pkgs, ... }: {
|
||||||
global = {
|
global = {
|
||||||
id = "5d3c16fe58444e12ad621600039f10af";
|
id = "5d3c16fe58444e12ad621600039f10af";
|
||||||
fs.esp.uuid = "32A5-6257";
|
fs.esp.uuid = "32A5-6257";
|
||||||
|
@ -18,18 +18,27 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
|
gnome.enable = true;
|
||||||
|
vscode.enable = true;
|
||||||
|
libreoffice.enable = true;
|
||||||
minecraft.enable = true;
|
minecraft.enable = true;
|
||||||
steam.enable = true;
|
steam.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
powerManagement.cpuFreqGovernor = "powersave";
|
powerManagement.cpuFreqGovernor = "powersave";
|
||||||
|
powerManagement.resumeCommands = ''
|
||||||
|
# trackpad driver resume workaround
|
||||||
|
${pkgs.kmod}/bin/modprobe -r psmouse
|
||||||
|
${pkgs.kmod}/bin/modprobe psmouse
|
||||||
|
'';
|
||||||
|
|
||||||
hardware.nvidia.prime = {
|
hardware.nvidia.prime = {
|
||||||
intelBusId = "PCI:0:2:0";
|
intelBusId = "PCI:0:2:0";
|
||||||
nvidiaBusId = "PCI:5:0:0";
|
nvidiaBusId = "PCI:5:0:0";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.plymouth.catppuccin.enable = false;
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
./channel.nix
|
./channel.nix
|
||||||
impermanence.nixosModules.impermanence
|
impermanence.nixosModules.impermanence
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
|
catppuccin.nixosModules.catppuccin
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
|
|
@ -6,42 +6,29 @@
|
||||||
auth.openssh.enable = true;
|
auth.openssh.enable = true;
|
||||||
fs.esp.uuid = "C368-7571";
|
fs.esp.uuid = "C368-7571";
|
||||||
fs.type = "zfs";
|
fs.type = "zfs";
|
||||||
fs.zfs.externalStore = true;
|
fs.zfs.alert.secret = "/nix/persist/secret/telegram";
|
||||||
fs.external.device = "/dev/disk/by-uuid/d9202e56-a14f-4342-acdb-dbae33d680fc";
|
fs.zfs.split.enable = true;
|
||||||
fs.external.fsType = "xfs";
|
fs.zfs.split.store = "d9202e56-a14f-4342-acdb-dbae33d680fc";
|
||||||
fs.external.options = [ "noatime" ];
|
fs.zfs.split.secret = "1404c4f1-b890-4cf0-ab8a-26bd81bd2254";
|
||||||
|
fs.zfs.replication.enable = true;
|
||||||
|
fs.zfs.replication.remote = "eientei@archive:archive/backup/koishi/eientei";
|
||||||
fs.cryptsetup.enable = true;
|
fs.cryptsetup.enable = true;
|
||||||
fs.cryptsetup.allowDiscards = false;
|
fs.cryptsetup.allowDiscards = false;
|
||||||
fs.cryptsetup.uuids.secret = "c33c9b18-a280-42d7-8740-3f8d3f60dc43";
|
fs.cryptsetup.uuids.secret = "c33c9b18-a280-42d7-8740-3f8d3f60dc43";
|
||||||
|
gpu.enable = true;
|
||||||
|
gpu.type = "intel";
|
||||||
|
gpu.session = false;
|
||||||
boot.lanzaboote = true;
|
boot.lanzaboote = true;
|
||||||
boot.memtest = 4;
|
boot.memtest = 4;
|
||||||
acme.enable = true;
|
acme.enable = true;
|
||||||
oci.enable = true;
|
oci.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.fstrim.enable = true;
|
|
||||||
boot.swraid.enable = true;
|
|
||||||
boot.swraid.mdadmConf = ''
|
|
||||||
PROGRAM /usr/bin/true
|
|
||||||
'';
|
|
||||||
fileSystems."/nix/var/secret" =
|
|
||||||
{ device = "/dev/disk/by-uuid/1404c4f1-b890-4cf0-ab8a-26bd81bd2254";
|
|
||||||
fsType = "ext4";
|
|
||||||
options = [ "noatime" ];
|
|
||||||
neededForBoot = true;
|
|
||||||
depends = [ "/nix/var" ];
|
|
||||||
};
|
|
||||||
boot.initrd.systemd.services.zfs-import-eientei.after = [ "cryptsetup.target" ];
|
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="80:61:5f:07:9e:2f", NAME="ix0"
|
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="80:61:5f:07:9e:2f", NAME="ix0"
|
||||||
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:e0:4c:68:bb:30", NAME="ss0"
|
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:e0:4c:68:bb:30", NAME="ss0"
|
||||||
'';
|
'';
|
||||||
|
boot.kernelParams = [ "zfs.zfs_arc_max=17179869184" ];
|
||||||
networking.proxy = {
|
|
||||||
allProxy = "socks5://192.168.1.253:1080";
|
|
||||||
noProxy = "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1,localhost,.localdomain";
|
|
||||||
};
|
|
||||||
|
|
||||||
imports = lib.pipe ./. [
|
imports = lib.pipe ./. [
|
||||||
builtins.readDir
|
builtins.readDir
|
||||||
|
@ -55,6 +42,5 @@
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 25565 ];
|
|
||||||
environment.systemPackages = with pkgs; [ python3 ];
|
environment.systemPackages = with pkgs; [ python3 ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.interfaces.enp0s20f0u1.allowedTCPPorts = [ 5000 8554 8555 ];
|
networking.firewall.interfaces.ss0.allowedTCPPorts = [ 5000 8554 8555 ];
|
||||||
networking.firewall.interfaces.enp0s20f0u1.allowedUDPPorts = [ 8555 ];
|
networking.firewall.interfaces.ss0.allowedUDPPorts = [ 8555 ];
|
||||||
|
|
||||||
global.fs.zfs.mountpoints."/nix/persist/service/frigate" = "service/frigate";
|
global.fs.zfs.mountpoints."/nix/persist/service/frigate" = "service/frigate";
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,25 @@
|
||||||
"mqtt"
|
"mqtt"
|
||||||
"synology_dsm"
|
"synology_dsm"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
extraPackages = python3Packages: with python3Packages; [
|
||||||
|
aiogithubapi gtts radios
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
services.nginx.virtualHosts."home.514fpv.io" = {
|
||||||
|
useACMEHost = ".514fpv.io";
|
||||||
|
addSSL = true;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_buffering off;
|
||||||
|
'';
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:8123";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
global.fs.zfs.mountpoints."/nix/persist/service/hass" = "service/hass";
|
global.fs.zfs.mountpoints."/nix/persist/service/hass" = "service/hass";
|
||||||
|
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
||||||
}
|
}
|
||||||
|
|
35
spec/eientei/jellyfin.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ pkgs
|
||||||
|
, config
|
||||||
|
, ...}: {
|
||||||
|
services.jellyfin = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
dataDir = "/nix/persist/service/jellyfin";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [ jellyfin jellyfin-web jellyfin-ffmpeg ];
|
||||||
|
|
||||||
|
users.users.jellyfin.uid = 282;
|
||||||
|
users.groups.jellyfin.gid = 282;
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."jellyfin.514fpv.io" = {
|
||||||
|
useACMEHost = ".514fpv.io";
|
||||||
|
addSSL = true;
|
||||||
|
locations = {
|
||||||
|
"= /".return = "302 https://jellyfin.514fpv.io:2096/web/";
|
||||||
|
"/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:8096";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_buffering off;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"= /web/".proxyPass = "http://127.0.0.1:8096/web/index.html";
|
||||||
|
"/socket" = {
|
||||||
|
proxyPass = "http://127.0.0.1:8096";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
global.fs.zfs.mountpoints."/nix/persist/service/jellyfin" = "service/jellyfin";
|
||||||
|
}
|
|
@ -40,6 +40,7 @@ in {
|
||||||
locations."/".extraConfig = ''
|
locations."/".extraConfig = ''
|
||||||
return 404;
|
return 404;
|
||||||
'';
|
'';
|
||||||
|
locations."/health".proxyPass = "http://127.0.0.1:8008";
|
||||||
locations."/_matrix".proxyPass = "http://127.0.0.1:8008";
|
locations."/_matrix".proxyPass = "http://127.0.0.1:8008";
|
||||||
locations."/_synapse/client".proxyPass = "http://127.0.0.1:8008";
|
locations."/_synapse/client".proxyPass = "http://127.0.0.1:8008";
|
||||||
};
|
};
|
||||||
|
|
106
spec/eientei/minecraft.nix
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
{ pkgs, lib, config, ... }: let
|
||||||
|
inherit (lib) mapAttrs' nameValuePair;
|
||||||
|
|
||||||
|
servers = {
|
||||||
|
#bungeecord = {
|
||||||
|
# cmdline = "${pkgs.graalvmCEPackages.graalvm-ce}/bin/java -Xms2G -Xmx4G -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -jar waterfall-1.20-578.jar";
|
||||||
|
# stop = "end";
|
||||||
|
#};
|
||||||
|
|
||||||
|
#limbo = {
|
||||||
|
# cmdline = "${pkgs.graalvmCEPackages.graalvm-ce}/bin/java -Xms1G -Xmx1G -jar NanoLimbo-1.8-all.jar";
|
||||||
|
# stop = "stop";
|
||||||
|
#};
|
||||||
|
|
||||||
|
greedycraft = {
|
||||||
|
cmdline = "${pkgs.jdk8}/bin/java -Xmx10G -Xms10G -Xss4M -Dfile.encoding=GBK -Dsun.rmi.dgc.server.gcInterval=1800000 -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:-OmitStackTraceInFastThrow -XX:+OptimizeStringConcat -XX:+UseAdaptiveGCBoundary -XX:G1HeapRegionSize=32M -jar forge-1.12.2-14.23.5.2855.jar nogui";
|
||||||
|
stop = "stop";
|
||||||
|
};
|
||||||
|
|
||||||
|
nfwc = {
|
||||||
|
cmdline = "${pkgs.jdk}/bin/java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.19.2-43.3.8/unix_args.txt";
|
||||||
|
stop = "stop";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
prefix = "minecraft-server-";
|
||||||
|
data = "/nix/persist/service/minecraft";
|
||||||
|
in {
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/games/minecraft-server.nix
|
||||||
|
users.users.minecraft = {
|
||||||
|
description = "Minecraft server service user";
|
||||||
|
home = data;
|
||||||
|
createHome = true;
|
||||||
|
isSystemUser = true;
|
||||||
|
uid = 1021;
|
||||||
|
group = "minecraft";
|
||||||
|
};
|
||||||
|
users.groups.minecraft.gid = 1021;
|
||||||
|
|
||||||
|
systemd.sockets = mapAttrs' (name: value: with value; (nameValuePair "${prefix}${name}" {
|
||||||
|
bindsTo = [ "${prefix}${name}.service" ];
|
||||||
|
socketConfig = {
|
||||||
|
ListenFIFO = "/run/minecraft-server/${name}.stdin";
|
||||||
|
SocketMode = "0660";
|
||||||
|
SocketUser = "minecraft";
|
||||||
|
SocketGroup = "minecraft";
|
||||||
|
RemoveOnStop = true;
|
||||||
|
FlushPending = true;
|
||||||
|
};
|
||||||
|
})) servers;
|
||||||
|
|
||||||
|
systemd.services = let
|
||||||
|
stopScript = { name, stop }: pkgs.writeShellScript "minecraft-server-stop" ''
|
||||||
|
echo ${stop} > ${config.systemd.sockets."${prefix}${name}".socketConfig.ListenFIFO}
|
||||||
|
|
||||||
|
# Wait for the PID of the minecraft server to disappear before
|
||||||
|
# returning, so systemd doesn't attempt to SIGKILL it.
|
||||||
|
while kill -0 "$1" 2> /dev/null; do
|
||||||
|
sleep 1s
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
in mapAttrs' (name: value: with value; (nameValuePair "${prefix}${name}" {
|
||||||
|
description = "Minecraft Server Service for ${name}";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
requires = [ "${prefix}${name}.socket" ];
|
||||||
|
after = [ "network.target" "${prefix}${name}.socket" ];
|
||||||
|
path = [ pkgs.bash ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = cmdline;
|
||||||
|
ExecStop = "${stopScript { inherit name stop; }} $MAINPID";
|
||||||
|
Restart = "always";
|
||||||
|
User = "minecraft";
|
||||||
|
WorkingDirectory = "${data}/${name}";
|
||||||
|
|
||||||
|
StandardInput = "socket";
|
||||||
|
StandardOutput = "journal";
|
||||||
|
StandardError = "journal";
|
||||||
|
|
||||||
|
# Hardening
|
||||||
|
CapabilityBoundingSet = [ "" ];
|
||||||
|
DeviceAllow = [ "" ];
|
||||||
|
LockPersonality = true;
|
||||||
|
PrivateDevices = true;
|
||||||
|
PrivateTmp = true;
|
||||||
|
PrivateUsers = true;
|
||||||
|
ProtectClock = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
ProtectHostname = true;
|
||||||
|
ProtectKernelLogs = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
ProtectProc = "invisible";
|
||||||
|
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
|
||||||
|
RestrictNamespaces = true;
|
||||||
|
RestrictRealtime = true;
|
||||||
|
RestrictSUIDSGID = true;
|
||||||
|
SystemCallArchitectures = "native";
|
||||||
|
UMask = "0077";
|
||||||
|
};
|
||||||
|
})) servers;
|
||||||
|
|
||||||
|
global.fs.zfs.mountpoints.${data} = "service/minecraft";
|
||||||
|
networking.firewall.allowedTCPPorts = [ 25565 ];
|
||||||
|
}
|
|
@ -4,11 +4,12 @@
|
||||||
in {
|
in {
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.nextcloud28;
|
package = pkgs.nextcloud30;
|
||||||
extraApps = {
|
extraApps = {
|
||||||
inherit (pkgs.nextcloud28Packages.apps)
|
inherit (pkgs.nextcloud30Packages.apps)
|
||||||
notify_push impersonate spreed
|
notify_push impersonate spreed
|
||||||
contacts bookmarks deck polls notes forms;
|
contacts bookmarks deck polls notes forms
|
||||||
|
twofactor_webauthn;
|
||||||
};
|
};
|
||||||
home = "/nix/persist/service/nextcloud";
|
home = "/nix/persist/service/nextcloud";
|
||||||
configureRedis = true;
|
configureRedis = true;
|
||||||
|
@ -22,6 +23,7 @@ in {
|
||||||
config.adminpassFile = builtins.toString (pkgs.writeText "password" "initial_password");
|
config.adminpassFile = builtins.toString (pkgs.writeText "password" "initial_password");
|
||||||
settings.overwriteprotocol = "https";
|
settings.overwriteprotocol = "https";
|
||||||
settings.default_phone_region = "US";
|
settings.default_phone_region = "US";
|
||||||
|
settings.maintenance_window_start = 17;
|
||||||
caching.redis = true;
|
caching.redis = true;
|
||||||
phpOptions.upload_max_filesize = "128G";
|
phpOptions.upload_max_filesize = "128G";
|
||||||
phpOptions.post_max_size = "128G";
|
phpOptions.post_max_size = "128G";
|
||||||
|
|
|
@ -17,18 +17,6 @@
|
||||||
useACMEHost = ".514fpv.io";
|
useACMEHost = ".514fpv.io";
|
||||||
extraConfig = "return 444;";
|
extraConfig = "return 444;";
|
||||||
};
|
};
|
||||||
|
|
||||||
"home.514fpv.io" = {
|
|
||||||
useACMEHost = ".514fpv.io";
|
|
||||||
addSSL = true;
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_buffering off;
|
|
||||||
'';
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://127.0.0.1:8123";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
36
spec/eientei/photoprism.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{ lib
|
||||||
|
, ... }: with lib; {
|
||||||
|
services.photoprism = {
|
||||||
|
enable = true;
|
||||||
|
originalsPath = "/run/storage/aerial/raw";
|
||||||
|
settings = {
|
||||||
|
PHOTOPRISM_ADMIN_USER = "koishi";
|
||||||
|
PHOTOPRISM_FFMPEG_ENCODER = "vaapi";
|
||||||
|
PHOTOPRISM_ORIGINALS_LIMIT = "-1";
|
||||||
|
PHOTOPRISM_RESOLUTION_LIMIT = "-1";
|
||||||
|
};
|
||||||
|
passwordFile = "/var/lib/photoprism/password";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."raw.514fpv.io" = {
|
||||||
|
useACMEHost = ".514fpv.io";
|
||||||
|
addSSL = true;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_buffering off;
|
||||||
|
'';
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:2342";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.photoprism.serviceConfig = {
|
||||||
|
PrivateDevices = mkForce false;
|
||||||
|
DevicePolicy = "closed";
|
||||||
|
DeviceAllow = [ "/dev/dri/renderD128 rw" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/nix/persist/fhs".directories = [
|
||||||
|
"/var/lib/private/photoprism"
|
||||||
|
];
|
||||||
|
}
|
20
spec/eientei/photoview.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
services.photoview = {
|
||||||
|
enable = true;
|
||||||
|
database.driver = "postgres";
|
||||||
|
database.string = "postgresql:///photoview?host=/var/run/postgresql";
|
||||||
|
stateDir = "/nix/persist/service/photoview";
|
||||||
|
secrets = "/nix/persist/service/photoview/secrets.env" ;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."dvr.514fpv.io" = {
|
||||||
|
useACMEHost = ".514fpv.io";
|
||||||
|
addSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:8000";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
global.fs.zfs.mountpoints."/nix/persist/service/photoview" = "service/photoview";
|
||||||
|
}
|
8
spec/eientei/tubesync.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
services.tubesync = {
|
||||||
|
enable = false;
|
||||||
|
stateDir = "/nix/persist/service/tubesync";
|
||||||
|
};
|
||||||
|
|
||||||
|
global.fs.zfs.mountpoints."/nix/persist/service/tubesync" = "service/tubesync";
|
||||||
|
}
|
27
spec/eientei/vaultwarden.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
services.vaultwarden = {
|
||||||
|
enable = true;
|
||||||
|
environmentFile = "/nix/persist/service/vaultwarden/secret.env";
|
||||||
|
config = {
|
||||||
|
domain = "https://vault.514fpv.io:2096";
|
||||||
|
signupsAllowed = false;
|
||||||
|
rocketAddress = "127.0.0.1";
|
||||||
|
rocketPort = 8222;
|
||||||
|
rocketLog = "critical";
|
||||||
|
databaseUrl = "postgresql:///vaultwarden";
|
||||||
|
};
|
||||||
|
dbBackend = "postgresql";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."vault.514fpv.io" = {
|
||||||
|
useACMEHost = ".514fpv.io";
|
||||||
|
addSSL = true;
|
||||||
|
locations."/".proxyPass = "http://127.0.0.1:8222";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/nix/persist/fhs".directories = [
|
||||||
|
"/var/lib/bitwarden_rs"
|
||||||
|
];
|
||||||
|
|
||||||
|
global.fs.zfs.mountpoints."/nix/persist/service/vaultwarden" = "service/vaultwarden";
|
||||||
|
}
|
|
@ -5,38 +5,31 @@
|
||||||
auth.openssh.enable = true;
|
auth.openssh.enable = true;
|
||||||
fs.esp.uuid = "8C36-CBE2";
|
fs.esp.uuid = "8C36-CBE2";
|
||||||
fs.type = "zfs";
|
fs.type = "zfs";
|
||||||
fs.zfs.externalStore = true;
|
fs.zfs.alert.secret = "/nix/persist/secret/telegram";
|
||||||
fs.external.device = "/dev/disk/by-uuid/59b73292-8098-4774-b8b6-59c23130d405";
|
fs.zfs.split.enable = true;
|
||||||
fs.external.fsType = "xfs";
|
fs.zfs.split.store = "59b73292-8098-4774-b8b6-59c23130d405";
|
||||||
fs.external.options = [ "noatime" ];
|
fs.zfs.split.secret = "f8983719-f9e7-42b2-b8f3-0f32f6b328ae";
|
||||||
|
fs.zfs.replication.enable = true;
|
||||||
|
fs.zfs.replication.remote = "focus@edge.514fpv.io:archive/backup/koishi/focus";
|
||||||
|
fs.zfs.replication.port = 8087;
|
||||||
fs.cryptsetup.enable = true;
|
fs.cryptsetup.enable = true;
|
||||||
fs.cryptsetup.allowDiscards = false;
|
fs.cryptsetup.allowDiscards = false;
|
||||||
fs.cryptsetup.uuids.secret = "c2bc361e-6f9a-48fa-b698-ed3603a9664a";
|
fs.cryptsetup.uuids.secret = "c2bc361e-6f9a-48fa-b698-ed3603a9664a";
|
||||||
boot.lanzaboote = true;
|
boot.lanzaboote = true;
|
||||||
boot.memtest = 4;
|
boot.memtest = 4;
|
||||||
acme.enable = true;
|
acme.enable = true;
|
||||||
|
netdata.enable = true;
|
||||||
|
netdata.host = "sf.514fpv.io";
|
||||||
|
netdata.addSSL = true;
|
||||||
|
netdata.useACMEHost = "sf.514fpv.io";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.fstrim.enable = true;
|
|
||||||
boot.swraid.enable = true;
|
|
||||||
boot.swraid.mdadmConf = ''
|
|
||||||
PROGRAM /usr/bin/true
|
|
||||||
'';
|
|
||||||
fileSystems."/nix/var/secret" =
|
|
||||||
{ device = "/dev/disk/by-uuid/f8983719-f9e7-42b2-b8f3-0f32f6b328ae";
|
|
||||||
fsType = "ext4";
|
|
||||||
options = [ "noatime" ];
|
|
||||||
neededForBoot = true;
|
|
||||||
depends = [ "/nix/var" ];
|
|
||||||
};
|
|
||||||
boot.initrd.systemd.services.zfs-import-focus.after = [ "cryptsetup.target" ];
|
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="6c:b3:11:3d:80:13", NAME="2g5"
|
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="6c:b3:11:3d:80:13", NAME="2g5"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
networking.proxy = {
|
networking.proxy = {
|
||||||
allProxy = "socks5://192.168.1.1:1080";
|
allProxy = "http://compat:3128";
|
||||||
noProxy = "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1,localhost,.localdomain";
|
noProxy = "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1,localhost,.localdomain";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
{ config
|
|
||||||
, ... }: {
|
|
||||||
services.grafana = {
|
|
||||||
enable = true;
|
|
||||||
dataDir = "/nix/persist/service/grafana";
|
|
||||||
settings = {
|
|
||||||
server = {
|
|
||||||
http_addr = "127.0.0.1";
|
|
||||||
http_port = 3000;
|
|
||||||
domain = "sf.514fpv.io";
|
|
||||||
root_url = "https://sf.514fpv.io:8086/dash";
|
|
||||||
serve_from_sub_path = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.prometheus = {
|
|
||||||
enable = true;
|
|
||||||
port = 9001;
|
|
||||||
exporters = {
|
|
||||||
node = {
|
|
||||||
enable = true;
|
|
||||||
enabledCollectors = [ "systemd" ];
|
|
||||||
port = 9002;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."sf.514fpv.io".locations."/dash/" = {
|
|
||||||
proxyPass = "http://${toString config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
recommendedProxySettings = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
global.fs.zfs.mountpoints."/nix/persist/service/grafana" = "service/grafana";
|
|
||||||
}
|
|
|
@ -4,16 +4,18 @@
|
||||||
in {
|
in {
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.nextcloud28;
|
package = pkgs.nextcloud30;
|
||||||
extraApps = {
|
extraApps = {
|
||||||
inherit (pkgs.nextcloud28Packages.apps)
|
inherit (pkgs.nextcloud30Packages.apps)
|
||||||
notify_push impersonate spreed
|
notify_push impersonate spreed
|
||||||
contacts bookmarks deck polls notes forms;
|
contacts bookmarks deck polls notes forms
|
||||||
|
twofactor_webauthn;
|
||||||
};
|
};
|
||||||
home = "/nix/persist/service/nextcloud";
|
home = "/nix/persist/service/nextcloud";
|
||||||
configureRedis = true;
|
configureRedis = true;
|
||||||
webfinger = true;
|
webfinger = true;
|
||||||
maxUploadSize = "128G";
|
maxUploadSize = "128G";
|
||||||
|
fastcgiTimeout = 300;
|
||||||
hostName = host;
|
hostName = host;
|
||||||
phpExtraExtensions = all: with all; [ bz2 ];
|
phpExtraExtensions = all: with all; [ bz2 ];
|
||||||
database.createLocally = true;
|
database.createLocally = true;
|
||||||
|
@ -21,6 +23,7 @@ in {
|
||||||
config.adminuser = "koishi";
|
config.adminuser = "koishi";
|
||||||
config.adminpassFile = builtins.toString (pkgs.writeText "password" "initial_password");
|
config.adminpassFile = builtins.toString (pkgs.writeText "password" "initial_password");
|
||||||
settings.overwriteprotocol = "https";
|
settings.overwriteprotocol = "https";
|
||||||
|
settings.maintenance_window_start = 17;
|
||||||
settings.default_phone_region = "US";
|
settings.default_phone_region = "US";
|
||||||
settings.default_language = "zh";
|
settings.default_language = "zh";
|
||||||
settings.default_locale = "zh_Hans_CN";
|
settings.default_locale = "zh_Hans_CN";
|
||||||
|
|
|
@ -17,14 +17,6 @@
|
||||||
useACMEHost = ".sf.514fpv.io";
|
useACMEHost = ".sf.514fpv.io";
|
||||||
extraConfig = "return 444;";
|
extraConfig = "return 444;";
|
||||||
};
|
};
|
||||||
|
|
||||||
"sf.514fpv.io" = {
|
|
||||||
addSSL = true;
|
|
||||||
useACMEHost = "sf.514fpv.io";
|
|
||||||
locations."/" = {
|
|
||||||
return = "307 https://sf.514fpv.io:8086/dash/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
61
spec/hakugyokurou/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{ pkgs, lib, config, ... }: {
|
||||||
|
global = {
|
||||||
|
id = "09a2900f15b74f36b023a9ebcd539f6a";
|
||||||
|
fs.esp.uuid = "AE73-B83E";
|
||||||
|
fs.type = "xfs";
|
||||||
|
fs.store = "e4c673cb-03c5-44ac-b2f1-1085a7f7a553";
|
||||||
|
fs.cryptsetup.enable = true;
|
||||||
|
fs.cryptsetup.uuids.persist = "122001b1-7a43-4bab-ae7c-ba8eeb1cc864";
|
||||||
|
boot.lanzaboote = true;
|
||||||
|
gpu.enable = true;
|
||||||
|
gpu.type = "amdgpu";
|
||||||
|
android.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home = {
|
||||||
|
gnome.enable = true;
|
||||||
|
jetbrains.enable = true;
|
||||||
|
vscode.enable = true;
|
||||||
|
steam.enable = true;
|
||||||
|
minecraft.enable = true;
|
||||||
|
minecraft.user = "app";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.homeModules = [ {
|
||||||
|
wayland.windowManager.sway.config = {
|
||||||
|
input = {
|
||||||
|
"9610:30:HID_258a:001e_Mouse".natural_scroll = "disabled";
|
||||||
|
"1539:61441:NVTK0603:00_0603:F001_UNKNOWN".map_to_output = "eDP-1";
|
||||||
|
"1539:61441:NVTK0603:00_0603:F001".map_to_output = "eDP-1";
|
||||||
|
};
|
||||||
|
output = {
|
||||||
|
eDP-1.scale = "2";
|
||||||
|
eDP-1.transform = "270";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} ];
|
||||||
|
|
||||||
|
powerManagement.enable = true;
|
||||||
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
|
boot.kernelParams = [
|
||||||
|
"video=eDP-1:panel_orientation=left_side_up"
|
||||||
|
];
|
||||||
|
boot.plymouth.extraConfig = ''
|
||||||
|
DeviceScale=2
|
||||||
|
'';
|
||||||
|
|
||||||
|
services.greetd.settings.default_session.command = let
|
||||||
|
cfg = config.programs.regreet;
|
||||||
|
in lib.mkOverride 999 "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} ${lib.escapeShellArgs cfg.cageArgs} -- ${pkgs.writeShellScript "cageResolution" ''
|
||||||
|
${lib.getExe pkgs.wlr-randr} --output eDP-1 --scale 2 --transform 90
|
||||||
|
${lib.getExe cfg.package}
|
||||||
|
''}";
|
||||||
|
|
||||||
|
hardware.sensor.iio.enable = true;
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "rtsx_pci_sdmmc" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
|
}
|
|
@ -21,4 +21,5 @@
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
boot.kernelParams = [ "console=ttyS0,115200n8" ];
|
boot.kernelParams = [ "console=ttyS0,115200n8" ];
|
||||||
|
boot.initrd.systemd.emergencyAccess = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,50 +1,71 @@
|
||||||
{ pkgs
|
{ pkgs, lib, config, jovian, ... }: {
|
||||||
, lib
|
|
||||||
, ... }: {
|
|
||||||
global = {
|
global = {
|
||||||
id = "eeb44fb1150944aab7d146b7caad789f";
|
id = "0a920a834b5f480bab258040096d4c6e";
|
||||||
auth.openssh.enable = true;
|
fs.esp.uuid = "ACB3-4AFF";
|
||||||
fs.esp.uuid = "B20E-5994";
|
|
||||||
fs.type = "xfs";
|
fs.type = "xfs";
|
||||||
fs.store = "e8eea851-51b0-4c29-80c4-3d9358c4f3f8";
|
fs.store = "6b885fa6-5c13-4a46-94da-a287232606b9";
|
||||||
fs.external.enable = true;
|
|
||||||
fs.external.device = "/dev/disk/by-uuid/f0e13b58-1223-479c-b673-3a8e629c7f72";
|
|
||||||
fs.external.fsType = "ext4";
|
|
||||||
fs.cryptsetup.enable = true;
|
fs.cryptsetup.enable = true;
|
||||||
fs.cryptsetup.uuids.nix = "84baa53a-c76d-4716-813a-196f5a53e44d";
|
fs.cryptsetup.uuids.persist = "b4a5a66d-b491-4ac7-bc71-1ea8b1a503be";
|
||||||
fs.cryptsetup.uuids.persist = "e31f8b1c-6504-4b43-93dd-997ad17ebf5e";
|
|
||||||
boot.lanzaboote = true;
|
boot.lanzaboote = true;
|
||||||
gpu.enable = true;
|
gpu.enable = true;
|
||||||
gpu.type = "prime";
|
gpu.type = "amdgpu";
|
||||||
asusd.enable = true;
|
|
||||||
oci.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
gyroflow.enable = true;
|
jetbrains.enable = true;
|
||||||
|
vscode.enable = true;
|
||||||
minecraft.enable = true;
|
minecraft.enable = true;
|
||||||
minecraft.allUsers = true;
|
minecraft.user = "app";
|
||||||
steam.enable = true;
|
|
||||||
steam.allUsers = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.homeModules = [ {
|
||||||
|
wayland.windowManager.sway.config = {
|
||||||
|
input."1046:911:Goodix_Capacitive_TouchScreen".map_to_output = "eDP-1";
|
||||||
|
output = {
|
||||||
|
eDP-1.scale = "1.75";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} ];
|
||||||
|
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
powerManagement.cpuFreqGovernor = "performance";
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
|
powerManagement.resumeCommands = ''
|
||||||
|
# trackpad driver resume workaround
|
||||||
|
${pkgs.kmod}/bin/modprobe -r bmi260_i2c
|
||||||
|
${pkgs.kmod}/bin/modprobe -r bmi260_core
|
||||||
|
${pkgs.kmod}/bin/modprobe bmi260_i2c
|
||||||
|
${pkgs.kmod}/bin/modprobe bmi260_core
|
||||||
|
'';
|
||||||
|
console.packages = [ pkgs.terminus_font ];
|
||||||
|
console.font = "ter-v32n";
|
||||||
|
console.earlySetup = true;
|
||||||
|
|
||||||
hardware.nvidia.prime = {
|
specialisation.desktop.configuration = {
|
||||||
amdgpuBusId = "PCI:6:0:0";
|
global.jovian = false;
|
||||||
nvidiaBusId = "PCI:1:0:0";
|
jovian.steamos.useSteamOSConfig = false;
|
||||||
|
services.greetd.settings.default_session.command = let
|
||||||
|
cfg = config.programs.regreet;
|
||||||
|
in "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} ${lib.escapeShellArgs cfg.cageArgs} -- ${pkgs.writeShellScript "cageResolution" ''
|
||||||
|
${lib.getExe pkgs.wlr-randr} --output eDP-1 --scale 2
|
||||||
|
${lib.getExe cfg.package}
|
||||||
|
''}";
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
(writeShellScriptBin "sway-logout" ''
|
||||||
|
${systemd}/bin/systemctl --user unset-environment WAYLAND_DISPLAY SWAYSOCK
|
||||||
|
${sway}/bin/swaymsg exit
|
||||||
|
'')
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
imports = lib.pipe ./. [
|
|
||||||
builtins.readDir
|
|
||||||
(lib.filterAttrs (n: ty: ty == "regular" && n != "default.nix"))
|
|
||||||
(lib.mapAttrsToList (n: _: ./${n}))
|
|
||||||
];
|
|
||||||
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "ahci" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
jovian.nixosModules.jovian
|
||||||
|
./jovian.nix
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
80
spec/koumakyou/jovian.nix
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
{ pkgs, lib, config, ... }: with lib; {
|
||||||
|
options.global.jovian = mkEnableOption "set up Jovian NixOS" // { default = true; };
|
||||||
|
|
||||||
|
config = mkIf config.global.jovian {
|
||||||
|
jovian = {
|
||||||
|
hardware.has.amd.gpu = true;
|
||||||
|
steamos.useSteamOSConfig = true;
|
||||||
|
steamos.enableDefaultCmdlineConfig = false;
|
||||||
|
|
||||||
|
steam = {
|
||||||
|
enable = true;
|
||||||
|
autoStart = true;
|
||||||
|
desktopSession = "plasma";
|
||||||
|
user = "app";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.home.persistApp.directories = [
|
||||||
|
".steam" ".local/share/Steam"
|
||||||
|
".config/gamescope" ".config/hhd"
|
||||||
|
".kodi"
|
||||||
|
];
|
||||||
|
|
||||||
|
users.users.app.extraGroups = [ "networkmanager" "gamemode" ];
|
||||||
|
programs.gamemode.enable = true;
|
||||||
|
programs.regreet.enable = false;
|
||||||
|
home.plasma.enable = true;
|
||||||
|
home.plasma.extraConfig = {
|
||||||
|
configFile = {
|
||||||
|
kwinrc.Xwayland.Scale = 1.75;
|
||||||
|
kscreenlockerrc.Daemon.Autolock = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.users.app = {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
(pkgs.kodi-wayland.passthru.withPackages (kodiPkgs: with kodiPkgs; [
|
||||||
|
joystick # keymap steam-controller
|
||||||
|
#controller-topology-project
|
||||||
|
libretro libretro-2048
|
||||||
|
libretro-fuse libretro-genplus libretro-mgba
|
||||||
|
libretro-nestopia libretro-snes9x
|
||||||
|
jellycon
|
||||||
|
]))
|
||||||
|
];
|
||||||
|
|
||||||
|
home.pointerCursor = {
|
||||||
|
package = pkgs.steamdeck-hw-theme;
|
||||||
|
name = "steam";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.handheld-daemon = {
|
||||||
|
enable = true;
|
||||||
|
user = "app";
|
||||||
|
};
|
||||||
|
|
||||||
|
jovian.decky-loader = {
|
||||||
|
# ~/.steam/steam/.cef-enable-remote-debugging
|
||||||
|
enable = true;
|
||||||
|
user = "app";
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
curl unzip util-linux gnugrep procps pciutils kmod ryzenadj
|
||||||
|
];
|
||||||
|
extraPythonPackages = pythonPackages: with pythonPackages; [
|
||||||
|
hid pyyaml
|
||||||
|
];
|
||||||
|
stateDir = "/nix/persist/decky";
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.kernelParams = [
|
||||||
|
"iomem=relaxed"
|
||||||
|
"amd_pstate=passive"
|
||||||
|
];
|
||||||
|
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="${pkgs.ryzenadj}/bin/ryzenadj --max-performance"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
25
spec/reimaden/ac71/Makefile
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
PWD := $(shell pwd)
|
||||||
|
MODNAME = ac71
|
||||||
|
MODVER = 0.0
|
||||||
|
|
||||||
|
obj-m += $(MODNAME).o
|
||||||
|
|
||||||
|
# alphabetically sorted
|
||||||
|
$(MODNAME)-y += ec.o \
|
||||||
|
main.o \
|
||||||
|
misc.o \
|
||||||
|
pdev.o \
|
||||||
|
events.o \
|
||||||
|
|
||||||
|
$(MODNAME)-$(CONFIG_ACPI_BATTERY) += battery.o
|
||||||
|
$(MODNAME)-$(CONFIG_HWMON) += hwmon.o hwmon_fan.o hwmon_pwm.o fan.o
|
||||||
|
|
||||||
|
all:
|
||||||
|
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules
|
||||||
|
|
||||||
|
install:
|
||||||
|
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules_install
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean
|
123
spec/reimaden/ac71/battery.c
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
#include "pr.h"
|
||||||
|
|
||||||
|
#include <linux/device.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/moduleparam.h>
|
||||||
|
#include <linux/power_supply.h>
|
||||||
|
#include <acpi/battery.h>
|
||||||
|
#include <linux/sysfs.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
|
#include "ec.h"
|
||||||
|
|
||||||
|
/* ========================================================================== */
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_ACPI_BATTERY)
|
||||||
|
|
||||||
|
static bool battery_hook_registered;
|
||||||
|
|
||||||
|
static bool nobattery;
|
||||||
|
module_param(nobattery, bool, 0444);
|
||||||
|
MODULE_PARM_DESC(nobattery, "do not expose battery related controls (default=false)");
|
||||||
|
|
||||||
|
/* ========================================================================== */
|
||||||
|
|
||||||
|
static ssize_t charge_control_end_threshold_show(struct device *dev,
|
||||||
|
struct device_attribute *attr, char *buf)
|
||||||
|
{
|
||||||
|
int status = ec_read_byte(BATT_CHARGE_CTRL_ADDR);
|
||||||
|
|
||||||
|
if (status < 0)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
status &= BATT_CHARGE_CTRL_VALUE_MASK;
|
||||||
|
|
||||||
|
if (status == 0)
|
||||||
|
status = 100;
|
||||||
|
|
||||||
|
return sprintf(buf, "%d\n", status);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ssize_t charge_control_end_threshold_store(struct device *dev, struct device_attribute *attr,
|
||||||
|
const char *buf, size_t count)
|
||||||
|
{
|
||||||
|
int status, value;
|
||||||
|
|
||||||
|
if (kstrtoint(buf, 10, &value) || !(1 <= value && value <= 100))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
status = ec_read_byte(BATT_CHARGE_CTRL_ADDR);
|
||||||
|
if (status < 0)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
if (value == 100)
|
||||||
|
value = 0;
|
||||||
|
|
||||||
|
status = (status & ~BATT_CHARGE_CTRL_VALUE_MASK) | value;
|
||||||
|
|
||||||
|
status = ec_write_byte(BATT_CHARGE_CTRL_ADDR, status);
|
||||||
|
|
||||||
|
if (status < 0)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DEVICE_ATTR_RW(charge_control_end_threshold);
|
||||||
|
static struct attribute *ac71_batt_attrs[] = {
|
||||||
|
&dev_attr_charge_control_end_threshold.attr,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
ATTRIBUTE_GROUPS(ac71_batt);
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
|
||||||
|
static int ac71_batt_add(struct power_supply *battery, struct acpi_battery_hook *hook)
|
||||||
|
#else
|
||||||
|
static int ac71_batt_add(struct power_supply *battery)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (strcmp(battery->desc->name, "BAT0") != 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return device_add_groups(&battery->dev, ac71_batt_groups);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
|
||||||
|
static int ac71_batt_remove(struct power_supply *battery, struct acpi_battery_hook *hook)
|
||||||
|
#else
|
||||||
|
static int ac71_batt_remove(struct power_supply *battery)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (strcmp(battery->desc->name, "BAT0") != 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
device_remove_groups(&battery->dev, ac71_batt_groups);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct acpi_battery_hook ac71_batt_hook = {
|
||||||
|
.add_battery = ac71_batt_add,
|
||||||
|
.remove_battery = ac71_batt_remove,
|
||||||
|
.name = "AC71 laptop battery extension",
|
||||||
|
};
|
||||||
|
|
||||||
|
int __init ac71_battery_setup(void)
|
||||||
|
{
|
||||||
|
if (nobattery)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
battery_hook_register(&ac71_batt_hook);
|
||||||
|
battery_hook_registered = true;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ac71_battery_cleanup(void)
|
||||||
|
{
|
||||||
|
if (battery_hook_registered)
|
||||||
|
battery_hook_unregister(&ac71_batt_hook);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
26
spec/reimaden/ac71/battery.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
#ifndef AC71_BATTERY_H
|
||||||
|
#define AC71_BATTERY_H
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_ACPI_BATTERY)
|
||||||
|
|
||||||
|
#include <linux/init.h>
|
||||||
|
|
||||||
|
int __init ac71_battery_setup(void);
|
||||||
|
void ac71_battery_cleanup(void);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static inline int ac71_battery_setup(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void ac71_battery_cleanup(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* AC71_BATTERY_H */
|