Compare commits
468
Commits
73f957e81d
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d2e52675e | ||
|
|
6c5c69945a | ||
|
|
9883f3d461 | ||
|
|
6d86bb8368 | ||
|
|
0dbc4792d4 | ||
|
|
753b763b6f | ||
|
|
2a690681cb | ||
|
|
82f4a2e1d4 | ||
|
|
eb18897355 | ||
|
|
00679a2c04 | ||
|
|
8e819e01ea | ||
|
|
cf4c179fc4 | ||
|
|
c991768cc2 | ||
|
|
268879ee01 | ||
|
|
7e9f617965 | ||
|
|
7d6482587a | ||
|
|
cf10e1e963 | ||
|
|
02b2b9cf32 | ||
|
|
dfe6ec5518 | ||
|
|
517d793c88 | ||
|
|
657a65522f | ||
|
|
7bc3ab64dd | ||
|
|
2b5cfe0934 | ||
|
|
cf345521e8 | ||
|
|
f43945d0d2 | ||
|
|
7874412a48 | ||
|
|
e33a6e181e | ||
|
|
928dc4a240 | ||
|
|
63d34640f7 | ||
|
|
921565fe12 | ||
|
|
88792d86db | ||
|
|
49b4ade156 | ||
|
|
34f179465d | ||
|
|
588bea133c | ||
|
|
61ec61e22e | ||
|
|
10a3de42ac | ||
|
|
6f98d674b1 | ||
|
|
4278ceebc1 | ||
|
|
3358dd324e | ||
|
|
c3014ec109 | ||
|
|
08ca6a2846 | ||
|
|
2fbe36d497 | ||
|
|
9929cd297a | ||
|
|
869a219ab7 | ||
|
|
af1a275dd8 | ||
|
|
9d302345ac | ||
|
|
e0b3fe191c | ||
|
|
d3681fcd4f | ||
|
|
5458f74c83 | ||
|
|
13302deaef | ||
|
|
828face9d5 | ||
|
|
e4402eaf19 | ||
|
|
081084648f | ||
|
|
9d629c4656 | ||
|
|
4a65f64a20 | ||
|
|
d3b3e9be1c | ||
|
|
5224a6e4b6 | ||
|
|
dd0778e5f0 | ||
|
|
7247fc94ab | ||
|
|
655803bd1f | ||
|
|
9992039edb | ||
|
|
f31c0f92da | ||
|
|
307aac4ae0 | ||
|
|
160185ef20 | ||
|
|
42619807bc | ||
|
|
86c853de20 | ||
|
|
f52e880b4c | ||
|
|
e157071962 | ||
|
|
d324c957be | ||
|
|
1fa6092498 | ||
|
|
e43a91fe31 | ||
|
|
f06880d6d7 | ||
|
|
fa17ce5b03 | ||
|
|
cf42666c1f | ||
|
|
df49791fb7 | ||
|
|
cf4a324617 | ||
|
|
66b2662030 | ||
|
|
21045c3dd1 | ||
|
|
5f68b9b1e6 | ||
|
|
bb6edfdefd | ||
|
|
afebac0d46 | ||
|
|
06eaf13ec0 | ||
|
|
0b5beaf63d | ||
|
|
03604f9352 | ||
|
|
5047f1ab24 | ||
|
|
22271d33d1 | ||
|
|
c8bf78999a | ||
|
|
0d25c1deff | ||
|
|
3603fe28a7 | ||
|
|
ce7c940f65 | ||
|
|
d8327c3edf | ||
|
|
af9f7e0ee0 | ||
|
|
3285b483e2 | ||
|
|
affa333969 | ||
|
|
3c20190709 | ||
|
|
0305b8d33a | ||
|
|
5ade637e57 | ||
|
|
029ff0c9a3 | ||
|
|
db4bd8cfd9 | ||
|
|
41d25d9695 | ||
|
|
7e2e012f3a | ||
|
|
071e904990 | ||
|
|
b68ca558d8 | ||
|
|
cf760b8b85 | ||
|
|
7d4ee43283 | ||
|
|
4e08366901 | ||
|
|
a0ca155f7c | ||
|
|
110aa4215f | ||
|
|
08a161ff0d | ||
|
|
f4472de631 | ||
|
|
3c154de819 | ||
|
|
709040c072 | ||
|
|
28193823c8 | ||
|
|
dd25c9323d | ||
|
|
5796bee499 | ||
|
|
986afe4b32 | ||
|
|
537e30a347 | ||
|
|
2fec5ead38 | ||
|
|
d4e6283c2f | ||
|
|
32e7d99292 | ||
|
|
d9dab5b9d3 | ||
|
|
cdd94eefb3 | ||
|
|
209dbea02a | ||
|
|
c683809a78 | ||
|
|
739e335c28 | ||
|
|
3c6758b343 | ||
|
|
799b91a509 | ||
|
|
50ff958d35 | ||
|
|
ecc2779ce9 | ||
|
|
10dab81fb5 | ||
|
|
03e96662cc | ||
|
|
d6d54e213e | ||
|
|
f491be0ace | ||
|
|
fef1eff181 | ||
|
|
e869e5d790 | ||
|
|
48caacd9e5 | ||
|
|
ce4401033a | ||
|
|
8b331ad3ae | ||
|
|
417383f89b | ||
|
|
cc75c95ad4 | ||
|
|
a321251b93 | ||
|
|
54677248af | ||
|
|
d8f18016cd | ||
|
|
6522ebc15e | ||
|
|
10216784e8 | ||
|
|
f3abb6d2f3 | ||
|
|
936d654877 | ||
|
|
61d207db04 | ||
|
|
e7b66cb40c | ||
|
|
c9b18219af | ||
|
|
d5c4a78fba | ||
|
|
369d655a38 | ||
|
|
eab130b99d | ||
|
|
5ce6b9bdf2 | ||
|
|
5db52a4f84 | ||
|
|
3524f6b038 | ||
|
|
0cf53a97cf | ||
|
|
46fe5b8056 | ||
|
|
ec3d9e6049 | ||
|
|
fc0476ca5a | ||
|
|
4b7c62d00b | ||
|
|
cfc276184f | ||
|
|
87b50bfb4d | ||
|
|
1bc34518e1 | ||
|
|
f1dcb8c72b | ||
|
|
ec002467fa | ||
|
|
5a228cb375 | ||
|
|
d53e395d42 | ||
|
|
cb39f82a48 | ||
|
|
0efee5bceb | ||
|
|
844118055c | ||
|
|
0ba9de0030 | ||
|
|
a745b35c84 | ||
|
|
6c74dcbc22 | ||
|
|
76e609372f | ||
|
|
cd91944b1e | ||
|
|
bebd2748d1 | ||
|
|
12a4ba0482 | ||
|
|
68c241f31a | ||
|
|
81c37abadd | ||
|
|
85c962fd6d | ||
|
|
b0a8874a93 | ||
|
|
01021d179d | ||
|
|
b8a607c3d0 | ||
|
|
793015646d | ||
|
|
43f472fe88 | ||
|
|
51ab89cd98 | ||
|
|
f0d56df191 | ||
|
|
9a97168950 | ||
|
|
cdffa07675 | ||
|
|
13fbcea361 | ||
|
|
36c2c907d5 | ||
|
|
11bc7221e3 | ||
|
|
3a6122784b | ||
|
|
d4338f1861 | ||
|
|
ea290d9158 | ||
|
|
9cc07cdfaf | ||
|
|
33b9cee6a0 | ||
|
|
47479f40d1 | ||
|
|
e1cc2342b2 | ||
|
|
092b3551c1 | ||
|
|
9d50a66388 | ||
|
|
4a644607c6 | ||
|
|
e134b3db6e | ||
|
|
4cd01f17a3 | ||
|
|
e872cf3788 | ||
|
|
f4d938073c | ||
|
|
01374fe5b0 | ||
|
|
a75b839bc1 | ||
|
|
8c8b6b0206 | ||
|
|
1829531f25 | ||
|
|
daab746b40 | ||
|
|
6c452c6649 | ||
|
|
63386512a8 | ||
|
|
ad8d7c8c09 | ||
|
|
c37238700d | ||
|
|
330f5e2a50 | ||
|
|
fbbe869550 | ||
|
|
5e23488cae | ||
|
|
760815da50 | ||
|
|
c3c61ce654 | ||
|
|
626d78f088 | ||
|
|
bcd5606107 | ||
|
|
f8fbb52607 | ||
|
|
2b0bdb0248 | ||
|
|
f0403330e2 | ||
|
|
e10079e578 | ||
|
|
2a8fcf627b | ||
|
|
3d54536168 | ||
|
|
2c0ae15417 | ||
|
|
4ed934350d | ||
|
|
989ee1f6e5 | ||
|
|
1c9f01034e | ||
|
|
f62780826b | ||
|
|
83829303b5 | ||
|
|
d46d321142 | ||
|
|
f6442c65dd | ||
|
|
e7aac4bef4 | ||
|
|
8799c3c943 | ||
|
|
3631918db2 | ||
|
|
180d0b3b00 | ||
|
|
b191a3ff94 | ||
|
|
54d8f51fb5 | ||
|
|
9089f9d936 | ||
|
|
cdee5ca0e8 | ||
|
|
ca9757fecb | ||
|
|
d516be8e29 | ||
|
|
bfe15b2409 | ||
|
|
466fff5753 | ||
|
|
b965351818 | ||
|
|
7d806c7548 | ||
|
|
c28b56fc63 | ||
|
|
e6374ca39b | ||
|
|
cd9653561c | ||
|
|
6664cce060 | ||
|
|
22853f0190 | ||
|
|
bc5148e601 | ||
|
|
6b99c0f771 | ||
|
|
41867fb653 | ||
|
|
c063cf2dac | ||
|
|
755ce711fe | ||
|
|
a6190e3bb2 | ||
|
|
5c575254a1 | ||
|
|
f06855c2a2 | ||
|
|
435787f440 | ||
|
|
b7c1710046 | ||
|
|
aac0926608 | ||
|
|
8393f03b2a | ||
|
|
26a4cba43c | ||
|
|
102433be68 | ||
|
|
ba3d327a1b | ||
|
|
a518fab421 | ||
|
|
268276ceb3 | ||
|
|
31f47d22d7 | ||
|
|
e6a8899c1f | ||
|
|
55dc78ed46 | ||
|
|
11245c49ce | ||
|
|
6034a44d61 | ||
|
|
27dde8e40a | ||
|
|
af3984498c | ||
|
|
65605dbf57 | ||
|
|
d3798b201a | ||
|
|
74f62b34cf | ||
|
|
78077638fc | ||
|
|
baca029fcc | ||
|
|
ce620d3eb2 | ||
|
|
0786e3b13c | ||
|
|
281dbd7779 | ||
|
|
05c2c9dc30 | ||
|
|
11496e21e2 | ||
|
|
af7181e705 | ||
|
|
7311a0f94f | ||
|
|
9b0bcc56d6 | ||
|
|
2321832fbf | ||
|
|
dd23e88fc1 | ||
|
|
b77bc17058 | ||
|
|
14a8061913 | ||
|
|
4168ac91d9 | ||
|
|
31360d7963 | ||
|
|
512c7206b4 | ||
|
|
cab19bedb7 | ||
|
|
a580b69c40 | ||
|
|
d1ed464438 | ||
|
|
e16c0072a7 | ||
|
|
712c81af12 | ||
|
|
51e102bb39 | ||
|
|
13b66648fd | ||
|
|
a43d2bf6b5 | ||
|
|
31188f0438 | ||
|
|
0fff6a7d7d | ||
|
|
5a97cd69e2 | ||
|
|
18db7c616d | ||
|
|
7c37e5d216 | ||
|
|
a7a4294195 | ||
|
|
a3a2616cf8 | ||
|
|
ea95dfa0d3 | ||
|
|
5e8d66d34e | ||
|
|
65b480a007 | ||
|
|
d72ecc6b27 | ||
|
|
db2d29131c | ||
|
|
ce9f10504a | ||
|
|
f1bb1df177 | ||
|
|
780cd0dfab | ||
|
|
1ddc3eae29 | ||
|
|
44878527f5 | ||
|
|
21c7272015 | ||
|
|
26c5ce5cf3 | ||
|
|
12c56eaac5 | ||
|
|
137b380b73 | ||
|
|
8629061724 | ||
|
|
16b781f11d | ||
|
|
2e36274256 | ||
|
|
ccdbfd81ac | ||
|
|
59a16df0a3 | ||
|
|
fa2413f272 | ||
|
|
6364d8afa0 | ||
|
|
c894f00eb0 | ||
|
|
1300acd7ce | ||
|
|
5b1022a52b | ||
|
|
b9c7a4c4c7 | ||
|
|
cdedce8d5b | ||
|
|
3f6fcdc283 | ||
|
|
8738fa3066 | ||
|
|
9c9fe6b18a | ||
|
|
885940fd69 | ||
|
|
f41cd9c922 | ||
|
|
2f069029e9 | ||
|
|
bebe6eaeeb | ||
|
|
7b92e0d364 | ||
|
|
24519ceea7 | ||
|
|
a0cb0d1f44 | ||
|
|
4fed3712b0 | ||
|
|
2aa2a5ecba | ||
|
|
c4326f1aba | ||
|
|
8b70bcb229 | ||
|
|
d2fa73f887 | ||
|
|
3619713bf2 | ||
|
|
a61d63ff2c | ||
|
|
8ca41a3a46 | ||
|
|
00ce18733e | ||
|
|
b5b5063065 | ||
|
|
1d5233512b | ||
|
|
8858b2967c | ||
|
|
8f2708d137 | ||
|
|
f224a5efa7 | ||
|
|
63093d8a87 | ||
|
|
86b8a5571b | ||
|
|
4775dac377 | ||
|
|
839df21c46 | ||
|
|
539b63cc1c | ||
|
|
b62640e1df | ||
|
|
ef385b01e8 | ||
|
|
f7ea0d0c11 | ||
|
|
77fc328c84 | ||
|
|
a68f032fee | ||
|
|
c6cd3018db | ||
|
|
3b6a8104bf | ||
|
|
ae96717720 | ||
|
|
036f619673 | ||
|
|
42040403b1 | ||
|
|
07c056b0cd | ||
|
|
d35276baeb | ||
|
|
07bad003ba | ||
|
|
9a5bd2177c | ||
|
|
627c29ba9f | ||
|
|
a7c8793fdd | ||
|
|
5193284380 | ||
|
|
187b23fd64 | ||
|
|
7080ae11af | ||
|
|
0981168012 | ||
|
|
135a4b76a7 | ||
|
|
596494e41b | ||
|
|
f98b995b80 | ||
|
|
c44bffaeb0 | ||
|
|
4f4e2087b0 | ||
|
|
a04f791e06 | ||
|
|
fa95171f28 | ||
|
|
4c04d14d8f | ||
|
|
86f4a23831 | ||
|
|
e3877111b5 | ||
|
|
2374c19a0f | ||
|
|
5995d1ea37 | ||
|
|
fc5429a981 | ||
|
|
b453a32d70 | ||
|
|
f94242e4b5 | ||
|
|
7a1dca2a96 | ||
|
|
f9bf846c72 | ||
|
|
4400dc070f | ||
|
|
555c48dc3b | ||
|
|
2c533f6f57 | ||
|
|
7bd321e3f6 | ||
|
|
1e8b56f03b | ||
|
|
fc5a748fa5 | ||
|
|
1b35d92f6b | ||
|
|
750ca2f3a8 | ||
|
|
3ae7a5e8d4 | ||
|
|
e1d061ffbf | ||
|
|
299813134e | ||
|
|
9287815cd2 | ||
|
|
b850b164f5 | ||
|
|
fcbbb03060 | ||
|
|
f32764b652 | ||
|
|
ba6aec06a3 | ||
|
|
97f69bb208 | ||
|
|
e2abde8b28 | ||
|
|
f1f4255d7d | ||
|
|
944d74060e | ||
|
|
ffc4e6a90b | ||
|
|
47c7b69afa | ||
|
|
74ddbc24bb | ||
|
|
512c6066fa | ||
|
|
798d468706 | ||
|
|
dec735c9d6 | ||
|
|
7776f845cc | ||
|
|
6072b9fdd2 | ||
|
|
c832f5ff72 | ||
|
|
030c41f7a0 | ||
|
|
02e5532cb3 | ||
|
|
a760c0251e | ||
|
|
dad0cdb169 | ||
|
|
ceff5dac07 | ||
|
|
9d73b0d728 | ||
|
|
115a27d1c6 | ||
|
|
66c619883b | ||
|
|
3bb401859d | ||
|
|
cb35b1afd9 | ||
|
|
b3298359b4 | ||
|
|
99928ddb16 | ||
|
|
1a2d9b6490 | ||
|
|
8e0e511335 | ||
|
|
592f5dc0ef | ||
|
|
0c670125c3 | ||
|
|
76bc756b3e | ||
|
|
1e7db857a6 | ||
|
|
aae291b1d5 | ||
|
|
a65c4914b7 | ||
|
|
f341226d0b | ||
|
|
3f11f64135 | ||
|
|
73c4756de6 | ||
|
|
0932432e11 | ||
|
|
9352fa2649 | ||
|
|
b4ad26555f | ||
|
|
eab7a2b5ad | ||
|
|
03be992cb8 | ||
|
|
727c0802a7 | ||
|
|
b9af43bec2 | ||
|
|
22089bd396 | ||
|
|
f80ae292ba |
No files matched your search
@@ -1,3 +1,42 @@
|
||||
# Dotfiles
|
||||
|
||||
My NixOS configuration.
|
||||
|
||||
## Installation
|
||||
|
||||
For disk configuration we use disko, but for secrets management we use sops-nix and the particular setup makes the installation process a bit more involved. It is required that the computer from which the installation is being run has access to the `nixos-secrets` repository, otherwise you will need to manually add the required ssh keys to the installation image.
|
||||
```bash
|
||||
# Load into the installer
|
||||
sudo passwd # Set a root password
|
||||
|
||||
# From a machine with network access to the installer
|
||||
# and access to the nixos-secrets repo
|
||||
ssh -A root@(installer-ip)
|
||||
|
||||
# Set up disks
|
||||
nix-shell -p disko
|
||||
disko --mode disko --flake git+https://git.bulthuis.dev/Jan/nixos-config#(system)
|
||||
exit
|
||||
|
||||
# Install NixOS
|
||||
nixos-install --no-channel-copy --no-root-password --flake git+https://git.bulthuis.dev/Jan/nixos-config#(system)
|
||||
|
||||
# Set up host credentials for access to the secrets
|
||||
cd /mnt/persist/system/etc/sops
|
||||
touch sops_ed25519_key
|
||||
chmod 600 sops_ed25519_key
|
||||
nano sops_ed25519_key
|
||||
```
|
||||
If `nixos-install` is being stopped by the OOM-killer, you can try adding `-j 1` to limit the amount of jobs that will be executed at the same time to 1. It might require running nixos-install multiple times untill it has managed to download all requirements and slowly start building the rest of the system.
|
||||
|
||||
## Updating
|
||||
|
||||
To update the system configuration, it is a single command:
|
||||
```bash
|
||||
sudo system-update
|
||||
```
|
||||
Or if this shell script has not been installed for some reason:
|
||||
```bash
|
||||
sudo nixos-rebuild switch --flake git+https://git.bulthuis.dev/Jan/nixos-config
|
||||
```
|
||||
Sometimes it may be necessary to reboot of course.
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Import modules
|
||||
./modules/default.nix
|
||||
|
||||
# Import custom packages
|
||||
./pkgs/default.nix
|
||||
];
|
||||
}
|
||||
Generated
+180
@@ -0,0 +1,180 @@
|
||||
{
|
||||
"nodes": {
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1779135526,
|
||||
"narHash": "sha256-glCununz6lmaK5fs2X946HA3EkNxB2JagdAAvInuRYU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "d405a179887d52b24c0ddd31e09a150bd1f66779",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1779157263,
|
||||
"narHash": "sha256-VbiyZkRf8/qr7ObmlyfOHJsNAW5tyZ4MB1+cUwAwdrw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "866412a19866b4a8e32d2306a118040afa2b840c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"impermanence",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1768598210,
|
||||
"narHash": "sha256-kkgA32s/f4jaa4UG+2f8C225Qvclxnqs76mf8zvTVPg=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "c47b2cc64a629f8e075de52e4742de688f930dc6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"impermanence": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager_2",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1769548169,
|
||||
"narHash": "sha256-03+JxvzmfwRu+5JafM0DLbxgHttOQZkUtDWBmeUkN8Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "7b1d382faf603b6d264f58627330f9faa5cba149",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1768564909,
|
||||
"narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1767313136,
|
||||
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-25.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1778869304,
|
||||
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"disko": "disko",
|
||||
"home-manager": "home-manager",
|
||||
"impermanence": "impermanence",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs-stable": "nixpkgs-stable",
|
||||
"secrets": "secrets",
|
||||
"sops-nix": "sops-nix"
|
||||
}
|
||||
},
|
||||
"secrets": {
|
||||
"locked": {
|
||||
"lastModified": 1766822527,
|
||||
"narHash": "sha256-0qNxAxr7LQ8C6MjSxV2FkMSfdVmOVRq7Yz/wCea8plo=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "695e36891b5de248993845e1435df5e4116a26f2",
|
||||
"revCount": 21,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.bulthuis.dev/Jan/nixos-secrets"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.bulthuis.dev/Jan/nixos-secrets"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777944972,
|
||||
"narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "c591bf665727040c6cc5cb409079acb22dcce33c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
description = "System configuration for NixOS";
|
||||
|
||||
inputs = {
|
||||
# General inputs
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# Secrets
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
secrets.url = "git+ssh://gitea@git.bulthuis.dev/Jan/nixos-secrets";
|
||||
|
||||
# Disk setup
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
|
||||
# MADD
|
||||
# madd.url = "git+https://git.bulthuis.dev/Jan/madd";
|
||||
# madd.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# For Minecraft VM
|
||||
# nix-minecraft.url = "github:Jan-Bulthuis/nix-minecraft";
|
||||
# nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
|
||||
# nix-modpack.url = "github:Jan-Bulthuis/nix-modpack";
|
||||
# nix-modpack.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs:
|
||||
import ./glue {
|
||||
inherit inputs;
|
||||
excludeHomeManagerModules = [ "impermanence" ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
{
|
||||
inputs,
|
||||
excludeHomeManagerModules ? [ ],
|
||||
}:
|
||||
let
|
||||
flake = inputs.self;
|
||||
nixpkgs = inputs.nixpkgs;
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
nixpkgs-config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
|
||||
importDir =
|
||||
path: fn:
|
||||
let
|
||||
entries = builtins.readDir path;
|
||||
|
||||
# Get paths to directories
|
||||
dirs = lib.filterAttrs (_: type: type == "directory") entries;
|
||||
dirPaths = lib.mapAttrs (name: type: {
|
||||
path = "${path}/${name}";
|
||||
type = type;
|
||||
}) dirs;
|
||||
|
||||
# Get paths to nix files
|
||||
nixName = name: builtins.match "(.*)\\.nix" name;
|
||||
files = lib.filterAttrs (name: type: (type != "directory") && ((nixName name) != null)) entries;
|
||||
filePaths = lib.mapAttrs' (name: type: {
|
||||
name = builtins.head (nixName name);
|
||||
value = {
|
||||
path = "${path}/${name}";
|
||||
type = type;
|
||||
};
|
||||
}) files;
|
||||
|
||||
combined = dirPaths // filePaths;
|
||||
in
|
||||
fn (lib.optionalAttrs (builtins.pathExists path) combined);
|
||||
|
||||
# Split out into getNixFiles, getNixFilesRecursive, getDirs
|
||||
importDirRecursive =
|
||||
path: fn:
|
||||
let
|
||||
entries = importDir path lib.id;
|
||||
|
||||
# Dig down recursively
|
||||
dirs = lib.filterAttrs (_: entry: entry.type == "directory") entries;
|
||||
recursedEntries = lib.mapAttrs (name: entry: (importDirRecursive entry.path lib.id)) dirs;
|
||||
in
|
||||
fn (entries // recursedEntries);
|
||||
|
||||
eachSystem = fn: lib.genAttrs lib.systems.flakeExposed fn;
|
||||
|
||||
systemArgs = eachSystem (system: {
|
||||
pkgs = (
|
||||
import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgs-config;
|
||||
}
|
||||
);
|
||||
stable-pkgs = (
|
||||
import inputs.nixpkgs-stable {
|
||||
inherit system;
|
||||
config = nixpkgs-config;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
allPackages = importDir "${flake}/packages" (
|
||||
attrs:
|
||||
lib.mapAttrs (
|
||||
name: entry: (if entry.type == "directory" then "${entry.path}/default.nix" else entry.path)
|
||||
) attrs
|
||||
);
|
||||
|
||||
packages =
|
||||
let
|
||||
# TODO: Filter out packages that are not supported on the platform?
|
||||
mkPackages =
|
||||
system:
|
||||
let
|
||||
args = systemArgs."${system}";
|
||||
pkgs = args.pkgs;
|
||||
in
|
||||
lib.mapAttrs (name: package: pkgs.callPackage package { }) allPackages;
|
||||
in
|
||||
eachSystem mkPackages;
|
||||
|
||||
overlay = final: prev: (lib.mapAttrs (name: package: prev.callPackage package { }) allPackages);
|
||||
|
||||
collectEntries =
|
||||
attrs:
|
||||
lib.attrsets.collect (
|
||||
entry: (lib.isAttrs entry) && (lib.hasAttr "path" entry) && (lib.hasAttr "type" entry)
|
||||
) attrs;
|
||||
|
||||
collectModules =
|
||||
path:
|
||||
importDirRecursive path (
|
||||
attrs:
|
||||
map (entry: if entry.type == "directory" then entry.path + "/default.nix" else entry.path) (
|
||||
collectEntries attrs
|
||||
)
|
||||
);
|
||||
|
||||
nixosModules = collectModules "${flake}/modules/nixos";
|
||||
nixosProfiles = collectModules "${flake}/profiles/nixos";
|
||||
inputNixosModules = lib.map (flake: flake.outputs.nixosModules.default) (
|
||||
lib.filter (flake: lib.hasAttrByPath [ "outputs" "nixosModules" "default" ] flake) (
|
||||
lib.attrValues inputs
|
||||
)
|
||||
);
|
||||
|
||||
homeModules = collectModules "${flake}/modules/home";
|
||||
homeProfiles = collectModules "${flake}/profiles/home";
|
||||
inputHomeModules = lib.map (flake: flake.outputs.homeManagerModules.default) (
|
||||
lib.filter (flake: lib.hasAttrByPath [ "outputs" "homeManagerModules" "default" ] flake) (
|
||||
lib.attrValues (
|
||||
lib.attrsets.filterAttrs (name: entry: !(lib.elem name excludeHomeManagerModules)) inputs
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
inputOverlays = lib.map (flake: flake.outputs.overlays.default) (
|
||||
lib.filter (flake: lib.hasAttrByPath [ "outputs" "overlays" "default" ] flake) (
|
||||
lib.attrValues inputs
|
||||
)
|
||||
);
|
||||
|
||||
overlayModule =
|
||||
{ ... }:
|
||||
{
|
||||
nixpkgs.overlays = [ overlay ] ++ inputOverlays;
|
||||
};
|
||||
|
||||
nixpkgsModule =
|
||||
{ ... }:
|
||||
{
|
||||
nixpkgs.config = nixpkgs-config;
|
||||
};
|
||||
|
||||
nixosConfigurations = importDir "${flake}/hosts" (
|
||||
attrs:
|
||||
lib.mapAttrs (
|
||||
name: entry:
|
||||
let
|
||||
pkgs-stable = systemArgs."x86_64-linux".stable-pkgs;
|
||||
in
|
||||
lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs pkgs-stable;
|
||||
};
|
||||
modules =
|
||||
let
|
||||
systemPath = "${entry.path}/configuration.nix";
|
||||
|
||||
userEntries = importDir "${entry.path}/users" lib.id;
|
||||
|
||||
usersConfiguration = lib.mapAttrs (name: entry: {
|
||||
isNormalUser = true;
|
||||
group = name;
|
||||
}) userEntries;
|
||||
groupsConfiguration = lib.mapAttrs (name: entry: {
|
||||
}) userEntries;
|
||||
homesConfiguration = lib.mapAttrs (name: entry: entry.path) userEntries;
|
||||
|
||||
usersModule =
|
||||
{ ... }:
|
||||
{
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs pkgs-stable;
|
||||
};
|
||||
home-manager.sharedModules = homeModules ++ homeProfiles ++ inputHomeModules;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.users = homesConfiguration;
|
||||
users.users = usersConfiguration;
|
||||
users.groups = groupsConfiguration;
|
||||
};
|
||||
in
|
||||
[
|
||||
systemPath
|
||||
overlayModule
|
||||
usersModule
|
||||
nixpkgsModule
|
||||
]
|
||||
++ nixosModules
|
||||
++ nixosProfiles
|
||||
++ inputNixosModules;
|
||||
}
|
||||
) (lib.attrsets.filterAttrs (name: entry: entry.type == "directory") attrs)
|
||||
);
|
||||
|
||||
in
|
||||
{
|
||||
inherit packages nixosConfigurations overlay;
|
||||
overlays.default = overlay;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,241 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "vm-audio";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.vm.enable = true;
|
||||
sound.enable = true;
|
||||
# spotifyd.enable = true; # TODO: Add this as a local module
|
||||
};
|
||||
|
||||
# Install system packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
carla
|
||||
xpra
|
||||
alsa-utils
|
||||
pulsemixer
|
||||
adwaita-icon-theme
|
||||
open-stage-control
|
||||
carla_osc_bridge
|
||||
|
||||
# Add LV2 plugins
|
||||
lsp-plugins
|
||||
airwindows-lv2
|
||||
distrho-ports
|
||||
cardinal
|
||||
calf
|
||||
];
|
||||
|
||||
# Setup firewall
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
8080
|
||||
10402
|
||||
15151
|
||||
22752
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
8080
|
||||
10402
|
||||
15151
|
||||
22752
|
||||
];
|
||||
};
|
||||
|
||||
# Setup dependencies
|
||||
environment.variables.LD_LIBRARY_PATH = lib.mkForce "${lib.makeLibraryPath (
|
||||
with pkgs;
|
||||
[
|
||||
cairo
|
||||
pipewire.jack
|
||||
]
|
||||
)}";
|
||||
qt = {
|
||||
enable = true;
|
||||
style = "adwaita";
|
||||
};
|
||||
xdg.icons = {
|
||||
enable = true;
|
||||
fallbackCursorThemes = [ "Adwaita" ];
|
||||
};
|
||||
hardware.graphics.enable = true;
|
||||
|
||||
# User for audio mixing
|
||||
users.users.mixer = {
|
||||
isNormalUser = true;
|
||||
group = "mixer";
|
||||
extraGroups = [ "systemd-journal" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKKxoQSxfYqf9ITN8Fhckk8WbY4dwtBAXOhC9jxihJvq Personal"
|
||||
];
|
||||
};
|
||||
users.groups.mixer = { };
|
||||
users.groups.audio = {
|
||||
members = [
|
||||
"mixer"
|
||||
];
|
||||
};
|
||||
users.groups.bluetooth = {
|
||||
members = [
|
||||
"mixer"
|
||||
];
|
||||
};
|
||||
|
||||
# Xpra service
|
||||
systemd.user.services.xpra = {
|
||||
description = "Xpra Service";
|
||||
wantedBy = [ "default.target" ];
|
||||
after = [
|
||||
"network.target"
|
||||
];
|
||||
unitConfig = {
|
||||
ConditionUser = "mixer";
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.xpra}/bin/xpra start :7 --bind-tcp=0.0.0.0:15151 --daemon=no";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
# Carla service
|
||||
systemd.user.services.carla = {
|
||||
description = "Carla Service";
|
||||
wantedBy = [ "default.target" ];
|
||||
after = [
|
||||
"network.target"
|
||||
"sound.target"
|
||||
];
|
||||
requires = [
|
||||
"xpra.service"
|
||||
];
|
||||
unitConfig = {
|
||||
ConditionUser = "mixer";
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.carla}/bin/carla /home/mixer/Default.carxp -platform xcb";
|
||||
Environment = "\"DISPLAY=:7\"";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
# Carla service
|
||||
systemd.user.services.carla-bridge = {
|
||||
description = "Carla OSC Bridge";
|
||||
wantedBy = [ "default.target" ];
|
||||
after = [
|
||||
"network.target"
|
||||
"sound.target"
|
||||
];
|
||||
requires = [
|
||||
"carla.service"
|
||||
];
|
||||
unitConfig = {
|
||||
ConditionUser = "mixer";
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.carla_osc_bridge}/bin/carla_osc_bridge --clients \"127.0.0.1:8080\"";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
# Open stage control service
|
||||
systemd.user.services.osc = {
|
||||
description = "OSC Service";
|
||||
wantedBy = [ "default.target" ];
|
||||
after = [
|
||||
"network.target"
|
||||
];
|
||||
requires = [
|
||||
"carla.service"
|
||||
];
|
||||
unitConfig = {
|
||||
ConditionUser = "mixer";
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.open-stage-control}/bin/open-stage-control --no-gui --send 127.0.0.1:10402 --load /home/mixer/open-stage-control/session.json --theme /home/mixer/open-stage-control/theme.css";
|
||||
Environment = "\"ELECTRON_RUN_AS_NODE=1\"";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
# Create bluetooth A2DP source
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
disabledPlugins = [ "hostname" ];
|
||||
settings.General = {
|
||||
Name = "Linox";
|
||||
Class = "0x240414";
|
||||
DiscoverableTimeout = 0;
|
||||
AlwaysPairable = true;
|
||||
PairableTimeout = 0;
|
||||
FastConnectable = true;
|
||||
JustWorksRepairing = "always";
|
||||
};
|
||||
};
|
||||
services.pipewire.wireplumber.extraConfig."50-bluetooth-a2dp" = {
|
||||
"monitor.bluez.properties" = {
|
||||
"bluez5.roles" = [ "a2dp_source" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Create null sinks
|
||||
services.pipewire.extraConfig.pipewire."91-null-sinks" = {
|
||||
"context.objects" = [
|
||||
{
|
||||
factory = "adapter";
|
||||
args = {
|
||||
"factory.name" = "support.null-audio-sink";
|
||||
"node.name" = "Speaker-Proxy";
|
||||
"node.description" = "Proxy for Speaker Output";
|
||||
"media.class" = "Audio/Sink";
|
||||
"audio.position" = "L,R";
|
||||
};
|
||||
}
|
||||
{
|
||||
factory = "adapter";
|
||||
args = {
|
||||
"factory.name" = "support.null-audio-sink";
|
||||
"node.name" = "Headphone-Proxy";
|
||||
"node.description" = "Proxy for Headphone Output";
|
||||
"media.class" = "Audio/Sink";
|
||||
"audio.position" = "L,R";
|
||||
};
|
||||
}
|
||||
{
|
||||
factory = "adapter";
|
||||
args = {
|
||||
"factory.name" = "support.null-audio-sink";
|
||||
"node.name" = "SpotifyD-Proxy";
|
||||
"node.description" = "Proxy for SpotifyD";
|
||||
"media.class" = "Audio/Sink";
|
||||
"audio.position" = "L,R";
|
||||
};
|
||||
}
|
||||
{
|
||||
factory = "adapter";
|
||||
args = {
|
||||
"factory.name" = "support.null-audio-sink";
|
||||
"node.name" = "AnalogIn-Proxy";
|
||||
"node.description" = "Proxy for the analog input";
|
||||
"media.class" = "Audio/Source/Virtual";
|
||||
"audio.position" = "L,R";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "vm-infra";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.vm.enable = true;
|
||||
};
|
||||
|
||||
# Setup JOOL NAT64
|
||||
networking.jool = {
|
||||
enable = true;
|
||||
nat64.default = {
|
||||
global.pool6 = "64:ff9b::/96";
|
||||
pool4 = [
|
||||
{
|
||||
protocol = "TCP";
|
||||
prefix = "10.64.0.1/32";
|
||||
}
|
||||
{
|
||||
protocol = "UDP";
|
||||
prefix = "10.64.0.1/32";
|
||||
}
|
||||
{
|
||||
protocol = "ICMP";
|
||||
prefix = "10.64.0.1/32";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "vm-k1s";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.vm.enable = true;
|
||||
};
|
||||
|
||||
# Read in secrets
|
||||
sops.secrets."flux/git-ssh-key" = {
|
||||
sopsFile = "${inputs.secrets}/secrets/k3s-cluster.enc.yaml";
|
||||
};
|
||||
sops.secrets."flux/sops-decrypt-key" = {
|
||||
sopsFile = "${inputs.secrets}/secrets/k3s-cluster.enc.yaml";
|
||||
};
|
||||
|
||||
# Include NFS client module
|
||||
boot.supportedFilesystems = [ "nfs" ];
|
||||
|
||||
# Set up K3S cluster with CoreDNS, FluxCD and Cilium
|
||||
services.k3s = {
|
||||
enable = true;
|
||||
extraFlags = [
|
||||
"--cluster-domain ${inputs.secrets.lab.k3s.clusterDomain}"
|
||||
"--flannel-backend=none"
|
||||
"--disable-network-policy"
|
||||
"--disable-kube-proxy"
|
||||
];
|
||||
disable = [
|
||||
# "coredns" # CoreDNS is required for Flux to be able to bootstrap the cluster (Flux needs to resolve the git repo)
|
||||
"servicelb"
|
||||
"traefik"
|
||||
"local-storage"
|
||||
"metrics-server"
|
||||
"runtimes"
|
||||
];
|
||||
manifests = {
|
||||
git-ssh-key = {
|
||||
source = config.sops.secrets."flux/git-ssh-key".path;
|
||||
};
|
||||
sops-decrypt-key = {
|
||||
source = config.sops.secrets."flux/sops-decrypt-key".path;
|
||||
};
|
||||
# TODO: Move to flux config, once it is possible to easily install flux without CNI
|
||||
gateway-api =
|
||||
let
|
||||
manifest = pkgs.fetchurl {
|
||||
url = "https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.1/experimental-install.yaml";
|
||||
hash = "sha256-VTMn4P8yoaK+RGv5OCPIQTz5JTrGptVAfuvR6NJp9p4=";
|
||||
};
|
||||
in
|
||||
{
|
||||
source = manifest;
|
||||
};
|
||||
# TODO: Move to flux config, once it is possible to easily install flux without CNI
|
||||
netpol-system-allow-egress.content = {
|
||||
apiVersion = "cilium.io/v2";
|
||||
kind = "CiliumClusterwideNetworkPolicy";
|
||||
metadata.name = "allow-system-egress";
|
||||
spec = {
|
||||
description = "Allow all egress to system services.";
|
||||
endpointSelector = {
|
||||
matchExpressions = [
|
||||
{
|
||||
key = "io.kubernetes.pod.namespace";
|
||||
operator = "NotIn";
|
||||
values = [
|
||||
"bogus-namespace"
|
||||
# "kube-system"
|
||||
# "cilium-system"
|
||||
# "flux-system"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
egress = [
|
||||
{
|
||||
toEntities = [
|
||||
"all"
|
||||
];
|
||||
}
|
||||
];
|
||||
ingress = [
|
||||
{
|
||||
fromEntities = [
|
||||
"all"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
netpol-cluster-allow-dns.content = {
|
||||
apiVersion = "cilium.io/v2";
|
||||
kind = "CiliumClusterwideNetworkPolicy";
|
||||
metadata.name = "allow-dns";
|
||||
spec = {
|
||||
description = "Allow DNS";
|
||||
endpointSelector = { };
|
||||
egress = [
|
||||
{
|
||||
toEndpoints = [
|
||||
{
|
||||
matchLabels = {
|
||||
"io.kubernetes.pod.namespace" = "kube-system";
|
||||
"k8s-app" = "kube-dns";
|
||||
};
|
||||
}
|
||||
];
|
||||
toPorts = [
|
||||
{
|
||||
ports = [
|
||||
{
|
||||
port = 53;
|
||||
protocol = "ANY";
|
||||
}
|
||||
];
|
||||
rules.dns = [
|
||||
{
|
||||
matchPattern = "*";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
netpol-flux-allow-egress.content = { };
|
||||
};
|
||||
autoDeployCharts = {
|
||||
# TODO: Move to flux config, once it is possible to easily install flux without CNI
|
||||
cilium = {
|
||||
name = "cilium";
|
||||
repo = "oci://quay.io/cilium/charts/cilium";
|
||||
version = "1.18.8";
|
||||
hash = "sha256-z1aDpWttEfQ+Af/l0Lxdafasm75QysRc8h7sPhWXr94=";
|
||||
createNamespace = true;
|
||||
targetNamespace = "cilium-system";
|
||||
values = {
|
||||
operator.replicas = 1;
|
||||
kubeProxyReplacement = true;
|
||||
ipam.operator.clusterPoolIPv4PodCIDRList = [ "10.42.0.0/16" ];
|
||||
cluster = {
|
||||
id = 1;
|
||||
name = "vm-k1s";
|
||||
};
|
||||
k8sServiceHost = "10.10.50.60";
|
||||
k8sServicePort = 6443;
|
||||
policyEnforcementMode = "always";
|
||||
gatewayAPI = {
|
||||
enabled = true;
|
||||
gatewayClass.create = "true";
|
||||
enableAlpn = true;
|
||||
};
|
||||
bgpControlPlane.enabled = true;
|
||||
tls.secretsNamespace.create = false;
|
||||
hubble = {
|
||||
relay.enabled = true;
|
||||
ui.enabled = true;
|
||||
peerService.clusterDomain = inputs.secrets.lab.k3s.clusterDomain;
|
||||
};
|
||||
};
|
||||
extraFieldDefinitions = {
|
||||
spec.bootstrap = true;
|
||||
};
|
||||
};
|
||||
flux-operator = {
|
||||
name = "flux-operator";
|
||||
repo = "oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator";
|
||||
version = "0.38.1";
|
||||
hash = "sha256-nb0mzEWC3IwjPenQ4LSWBN0NNJc2cc68RB+G60xBOEM=";
|
||||
createNamespace = true;
|
||||
targetNamespace = "flux-system";
|
||||
extraDeploy = [
|
||||
{
|
||||
apiVersion = "fluxcd.controlplane.io/v1";
|
||||
kind = "FluxInstance";
|
||||
metadata = {
|
||||
name = "flux";
|
||||
namespace = "flux-system";
|
||||
annotations = {
|
||||
"fluxcd.controlplane.io/reconcile" = "enabled";
|
||||
"fluxcd.controlplane.io/reconcileEvery" = "1h";
|
||||
"fluxcd.controlplane.io/reconcileTimeout" = "5m";
|
||||
};
|
||||
};
|
||||
spec = {
|
||||
distribution = {
|
||||
version = "2.x";
|
||||
registry = "ghcr.io/fluxcd";
|
||||
};
|
||||
components = [
|
||||
"source-controller"
|
||||
"kustomize-controller"
|
||||
"helm-controller"
|
||||
"notification-controller"
|
||||
];
|
||||
cluster = {
|
||||
type = "kubernetes";
|
||||
size = "small";
|
||||
multitenant = false;
|
||||
networkPolicy = true;
|
||||
domain = inputs.secrets.lab.k3s.clusterDomain;
|
||||
};
|
||||
commonMetadata.labels = {
|
||||
"app.kubernetes.io/name" = "flux";
|
||||
};
|
||||
sync = (
|
||||
{
|
||||
pullSecret = "git-ssh-key";
|
||||
}
|
||||
// inputs.secrets.lab.k3s.fluxRepo
|
||||
);
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
modules.impermanence.directories = [
|
||||
"/var/lib/rancher/k3s"
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
KUBECONFIG = "/etc/rancher/k3s/k3s.yaml";
|
||||
CILIUM_NAMESPACE = "cilium-system";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
fluxcd
|
||||
k9s
|
||||
cilium-cli
|
||||
hubble
|
||||
];
|
||||
|
||||
# Use correct disko profile
|
||||
modules.disko.profile = "k3s";
|
||||
|
||||
# TEMP: Disable firewall for now
|
||||
networking.firewall.enable = false;
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
# Import the nix-minecraft modules
|
||||
imports = [
|
||||
inputs.nix-minecraft.nixosModules.minecraft-servers
|
||||
];
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "vm-minecraft";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.vm.enable = true;
|
||||
};
|
||||
|
||||
# Set up minecraft servers
|
||||
users.users.local.extraGroups = [ "minecraft" ];
|
||||
modules.impermanence.directories = [
|
||||
"/srv/minecraft"
|
||||
];
|
||||
services.minecraft-servers = {
|
||||
enable = true;
|
||||
eula = true;
|
||||
openFirewall = true;
|
||||
servers = {
|
||||
vanilla = {
|
||||
enable = true;
|
||||
autoStart = true;
|
||||
serverProperties = {
|
||||
white-list = true;
|
||||
difficulty = "normal";
|
||||
max-players = 5;
|
||||
};
|
||||
package = inputs.nix-minecraft.legacyPackages.${pkgs.system}.fabricServers.fabric-1_21_7;
|
||||
};
|
||||
modpack = {
|
||||
enable = false;
|
||||
autoStart = true;
|
||||
serverProperties = { };
|
||||
package = inputs.nix-modpack.packages.${pkgs.system}.mkModpackServer {
|
||||
packUrl = "https://raw.githubusercontent.com/Jan-Bulthuis/Modpack/refs/heads/master/pack.toml";
|
||||
server = inputs.nix-minecraft.legacyPackages.${pkgs.system}.neoForgeServers.neoforge-20_1_106;
|
||||
};
|
||||
jvmOpts = "-Xms6144M -Xmx8192M";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "vm-oddjob";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.vm.enable = true;
|
||||
};
|
||||
|
||||
# Omada Software Controller
|
||||
users.users.omada = {
|
||||
isSystemUser = true;
|
||||
group = "omada";
|
||||
};
|
||||
users.groups.omada = { };
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
virtualisation.oci-containers = {
|
||||
backend = "podman";
|
||||
containers = {
|
||||
omada-controller = {
|
||||
volumes = [
|
||||
"/var/lib/omada:/opt/tplink/EAPController/data"
|
||||
];
|
||||
environment = {
|
||||
TZ = "Europe/Amsterdam";
|
||||
};
|
||||
extraOptions = [
|
||||
"--network=host"
|
||||
"--ulimit"
|
||||
"nofile=4096:8192"
|
||||
];
|
||||
image = "mbentley/omada-controller:5.15";
|
||||
};
|
||||
};
|
||||
};
|
||||
modules.impermanence.directories = [
|
||||
"/var/lib/omada"
|
||||
];
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
8088
|
||||
8043
|
||||
8843
|
||||
];
|
||||
allowedTCPPortRanges = [
|
||||
{
|
||||
from = 29811;
|
||||
to = 29816;
|
||||
}
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
19810
|
||||
27001
|
||||
29810
|
||||
];
|
||||
};
|
||||
|
||||
# Setup NAS backups
|
||||
environment.systemPackages = with pkgs; [
|
||||
keyutils
|
||||
];
|
||||
environment.etc."request-key.d/cifs.spnego.conf".text = ''
|
||||
create cifs.spnego * * ${pkgs.cifs-utils}/bin/cifs.upcall -t %k
|
||||
'';
|
||||
environment.etc."request-key.d/cifs.idmap.conf".text = ''
|
||||
create cifs.idmap * * ${pkgs.cifs-utils}/bin/cifs.idmap %k
|
||||
'';
|
||||
sops.secrets."smb-credentials" = {
|
||||
sopsFile = "${inputs.secrets}/secrets/vm-oddjob.enc.yaml";
|
||||
};
|
||||
sops.secrets."backup-script-env" = {
|
||||
sopsFile = "${inputs.secrets}/secrets/vm-oddjob.enc.yaml";
|
||||
};
|
||||
services.cron = {
|
||||
enable = true;
|
||||
systemCronJobs =
|
||||
let
|
||||
script = pkgs.writeShellScript "backup-script" (
|
||||
lib.concatStrings (
|
||||
[
|
||||
''
|
||||
. ${config.sops.secrets."backup-script-env".path}
|
||||
export PBS_REPOSITORY=$PBS_REPOSITORY
|
||||
export PBS_NAMESPACE=$PBS_NAMESPACE
|
||||
export PBS_PASSWORD=$PBS_PASSWORD
|
||||
export PBS_FINGERPRINT=$PBS_FINGERPRINT
|
||||
''
|
||||
]
|
||||
++ lib.map (share: ''
|
||||
systemctl start mnt-${share}.mount
|
||||
${pkgs.util-linux}/bin/prlimit --nofile=1024:1024 ${pkgs.proxmox-backup-client}/bin/proxmox-backup-client backup nfs.pxar:/mnt/${share} --ns $PBS_NAMESPACE --backup-id share-${share} --change-detection-mode=metadata --exclude "#recycle"
|
||||
systemctl stop mnt-${share}.mount
|
||||
'') inputs.secrets.lab.nas.backupShares
|
||||
)
|
||||
);
|
||||
in
|
||||
[
|
||||
"0 0 * * * root ${script}"
|
||||
];
|
||||
};
|
||||
|
||||
# Mount filesystems
|
||||
systemd.services.krb5-mnt-credentials = {
|
||||
description = "Set up Kerberos credentials for mounting shares";
|
||||
before = map (share: "mnt-${share}.mount") inputs.secrets.lab.nas.backupShares;
|
||||
requiredBy = map (share: "mnt-${share}.mount") inputs.secrets.lab.nas.backupShares;
|
||||
after = [ "network-online.target" ];
|
||||
requires = [ "network-online.target" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
. ${config.sops.secrets."smb-credentials".path}
|
||||
echo $password | ${pkgs.krb5}/bin/kinit $username
|
||||
'';
|
||||
};
|
||||
fileSystems = lib.listToAttrs (
|
||||
lib.map (share: {
|
||||
name = "/mnt/${share}";
|
||||
value = {
|
||||
device = "//${inputs.secrets.lab.nas.host}/${share}";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
"noauto"
|
||||
"sec=krb5,credentials=${config.sops.secrets."smb-credentials".path}"
|
||||
];
|
||||
};
|
||||
}) inputs.secrets.lab.nas.backupShares
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "vm-test";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.vm.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "vm-vpn";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.vm.enable = true;
|
||||
};
|
||||
|
||||
# Setup wstunnel server
|
||||
services.wstunnel = {
|
||||
enable = true;
|
||||
servers.wg-tunnel = {
|
||||
enableHTTPS = false;
|
||||
listen = {
|
||||
host = "0.0.0.0";
|
||||
port = 8080;
|
||||
};
|
||||
restrictTo = [
|
||||
{
|
||||
host = "10.10.40.100";
|
||||
port = 51820;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 8080 ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "ws-think";
|
||||
|
||||
# Set up users
|
||||
sops.secrets."passwords/jan-hashed" = {
|
||||
sopsFile = "${inputs.secrets}/secrets/ws-think.enc.yaml";
|
||||
neededForUsers = true;
|
||||
};
|
||||
users.mutableUsers = false;
|
||||
users.users.Jan = {
|
||||
hashedPasswordFile = config.sops.secrets."passwords/jan-hashed".path;
|
||||
# Extra admin groups
|
||||
# TODO: Streamline setup of this
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"wireshark"
|
||||
"podman"
|
||||
"libvirtd"
|
||||
];
|
||||
};
|
||||
|
||||
# Set up impermanence
|
||||
modules.impermanence = {
|
||||
enable = true;
|
||||
resetScript = ''
|
||||
# Revert to the blank state for the root directory
|
||||
zfs rollback -r tank/root@blank
|
||||
'';
|
||||
};
|
||||
|
||||
# Set up kerberos
|
||||
security.krb5 = {
|
||||
enable = true;
|
||||
settings = {
|
||||
libdefaults = {
|
||||
rdns = false;
|
||||
};
|
||||
realms = (inputs.secrets.gewis.krb5Realm);
|
||||
};
|
||||
};
|
||||
|
||||
services.netbird = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# SSH X11 forwarding
|
||||
programs.ssh.forwardX11 = true;
|
||||
|
||||
# Enable older samba versions
|
||||
services.samba = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
"invalid users" = [ "root" ];
|
||||
"passwd program" = "/run/wrappers/bin/passwd %u";
|
||||
"security" = "user";
|
||||
"client min protocol" = "NT1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: Remove once laptop is properly integrated into domain
|
||||
programs.ssh = {
|
||||
package = pkgs.openssh_gssapi;
|
||||
extraConfig = ''
|
||||
GSSAPIAuthentication yes
|
||||
'';
|
||||
};
|
||||
|
||||
# Enable virtualisation for VMs
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
# Enable wireshark
|
||||
programs.wireshark = {
|
||||
enable = true;
|
||||
dumpcap.enable = true;
|
||||
usbmon.enable = true;
|
||||
};
|
||||
|
||||
# Enable Nix-LD
|
||||
programs.nix-ld = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Set up wstunnel client
|
||||
services.wstunnel = {
|
||||
enable = true;
|
||||
clients.wg-tunnel = {
|
||||
connectTo = "wss://tunnel.bulthuis.dev:443";
|
||||
settings.local-to-remote = [
|
||||
"udp://51819:10.10.40.100:51820"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Enable flatpak
|
||||
services.flatpak.enable = true;
|
||||
|
||||
# Module setup
|
||||
modules = {
|
||||
profiles.laptop.enable = true;
|
||||
};
|
||||
|
||||
# Set up podman
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
dockerSocket.enable = true;
|
||||
autoPrune.enable = true;
|
||||
};
|
||||
|
||||
# Enable Gnome Remote Desktop
|
||||
services.gnome.gnome-remote-desktop.enable = true;
|
||||
systemd.services."gnome-remote-desktop".wantedBy = [ "graphical.target" ];
|
||||
systemd.services."gnome-remote-desktop".preStart =
|
||||
let
|
||||
credDir = "/var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop";
|
||||
credPath = "${credDir}/credentials.ini";
|
||||
credFile = pkgs.writeText "gnome-remote-desktop-credentials" ''
|
||||
[RDP]
|
||||
credentials={'username': <'remote'>, 'password': <'remote'>}
|
||||
'';
|
||||
script = pkgs.writeScript "gnome-remote-desktop-setup" ''
|
||||
mkdir -p ${credDir}
|
||||
touch ${credPath}
|
||||
chown gnome-remote-desktop:gnome-remote-desktop ${credPath}
|
||||
chmod 600 ${credPath}
|
||||
cat ${credFile} > ${credPath}
|
||||
'';
|
||||
in
|
||||
"${script}";
|
||||
environment.etc."gnome-remote-desktop/grd.conf" = {
|
||||
text = ''
|
||||
[RDP]
|
||||
port=3389
|
||||
tls-key=/run/secrets/gnome-remote-desktop/tls-key
|
||||
tls-cert=/run/secrets/gnome-remote-desktop/tls-crt
|
||||
enabled=true
|
||||
'';
|
||||
};
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
3389
|
||||
3390
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
3389
|
||||
3390
|
||||
];
|
||||
};
|
||||
sops.secrets."gnome-remote-desktop/tls-key" = {
|
||||
sopsFile = "${inputs.secrets}/secrets/ws-think.enc.yaml";
|
||||
owner = config.users.users.gnome-remote-desktop.name;
|
||||
group = config.users.users.gnome-remote-desktop.group;
|
||||
};
|
||||
sops.secrets."gnome-remote-desktop/tls-crt" = {
|
||||
sopsFile = "${inputs.secrets}/secrets/ws-think.enc.yaml";
|
||||
owner = config.users.users.gnome-remote-desktop.name;
|
||||
group = config.users.users.gnome-remote-desktop.group;
|
||||
};
|
||||
|
||||
# Set up hardware
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
# Machine platform
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
# Set hostid (required for ZFS)
|
||||
networking.hostId = "deadbeef";
|
||||
|
||||
# Use thermald
|
||||
services.thermald.ignoreCpuidCheck = true;
|
||||
|
||||
# Hardware configuration
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"rtsx_pci_sdmmc"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.zfs.forceImportRoot = false;
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
# Filesystems
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "tank/root";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
device = "tank/nix";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
"/persist" = {
|
||||
device = "tank/persist";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/46BF-DE2C";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Swap setup
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/dev/disk/by-uuid/9f6f2a47-e53a-45a0-8cb2-8c1082f54ccb";
|
||||
discardPolicy = "both";
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home.stateVersion = "25.11";
|
||||
|
||||
modules.profiles.jan.enable = true;
|
||||
|
||||
# home.packages = with pkgs; [
|
||||
# opencloud-desktop
|
||||
# code-nautilus
|
||||
# nautilus-open-in-blackbox
|
||||
# ];
|
||||
|
||||
xdg.desktopEntries = {
|
||||
canvas = {
|
||||
name = "Canvas";
|
||||
type = "Application";
|
||||
exec = "${pkgs.chromium}/bin/chromium --app=\"https://canvas.tue.nl\" --user-data-dir=/home/jan/.local/state/Canvas";
|
||||
settings.StartupWMClass = "chrome-canvas.tue.nl__-Default";
|
||||
};
|
||||
overleaf = {
|
||||
name = "Overleaf";
|
||||
type = "Application";
|
||||
exec = "${pkgs.chromium}/bin/chromium --app=\"https://www.overleaf.com\" --user-data-dir=/home/jan/.local/state/Overleaf";
|
||||
settings.StartupWMClass = "chrome-www.overleaf.com__-Default";
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: Slowly remove
|
||||
modules.impermanence = {
|
||||
directories = [
|
||||
".cache"
|
||||
".config"
|
||||
".cargo"
|
||||
".dbus"
|
||||
".gnupg"
|
||||
".local"
|
||||
".MathWorks"
|
||||
".mozilla"
|
||||
".ssh"
|
||||
".steam"
|
||||
".SteamCloud"
|
||||
".thunderbird"
|
||||
".vscode"
|
||||
".wine"
|
||||
".Wolfram"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Import environment
|
||||
../default.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
# State version
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "20212060";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
base.enable = true;
|
||||
bluetooth.enable = true;
|
||||
power-saving.enable = false;
|
||||
pipewire.enable = true;
|
||||
wpa_supplicant.enable = true;
|
||||
};
|
||||
|
||||
# User accounts
|
||||
machine.users.jan = {
|
||||
sudo = true;
|
||||
configuration = ../users/jan.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.base;
|
||||
in
|
||||
{
|
||||
options.modules.base = {
|
||||
enable = mkEnableOption "base";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Add base linux utilities
|
||||
git
|
||||
wget
|
||||
curl
|
||||
dig
|
||||
procps
|
||||
wireguard-tools
|
||||
usbutils
|
||||
pciutils
|
||||
zip
|
||||
unzip
|
||||
|
||||
# TODO: MOVE
|
||||
quickemu
|
||||
pdftk
|
||||
];
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
modules = {
|
||||
# Enable base modules
|
||||
clean-tmp.enable = true;
|
||||
fontconfig.enable = true;
|
||||
neovim.enable = true;
|
||||
systemd-boot.enable = true;
|
||||
tuigreet.enable = true;
|
||||
tailscale.enable = true;
|
||||
};
|
||||
|
||||
# TODO: Remove everything below, it is here out of convenience and should be elsewhere
|
||||
# networking.nameservers = [
|
||||
# "9.9.9.9"
|
||||
# "149.112.112.112"
|
||||
# ];
|
||||
networking.firewall.enable = true;
|
||||
programs.dconf.enable = true;
|
||||
services.libinput.enable = true;
|
||||
modules.unfree.enable = true;
|
||||
modules.unfree.allowedPackages = [
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bluetooth;
|
||||
in
|
||||
{
|
||||
options.modules.bluetooth = {
|
||||
enable = mkEnableOption "bluetooth";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ bluez ];
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = true;
|
||||
};
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.clean-tmp;
|
||||
in
|
||||
{
|
||||
options.modules.clean-tmp = {
|
||||
enable = mkEnableOption "clean-tmp";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { boot.tmp.cleanOnBoot = true; };
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.silent-boot;
|
||||
in
|
||||
{
|
||||
options.modules.silent-boot = {
|
||||
enable = mkEnableOption "silent-boot";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot = {
|
||||
loader.timeout = 0;
|
||||
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
initrd.checkJournalingFS = false;
|
||||
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"boot.shell_on_fail"
|
||||
"loglevel=3"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
"video=efifb:nobgrt"
|
||||
"bgrt_disable"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.systemd-boot;
|
||||
in
|
||||
{
|
||||
options.modules.systemd-boot = {
|
||||
enable = mkEnableOption "systemd-boot";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.editor = false;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.brightnessctl;
|
||||
in
|
||||
{
|
||||
options.modules.brightnessctl = {
|
||||
enable = mkEnableOption "brightnessctl";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { environment.systemPackages = [ pkgs.brightnessctl ]; };
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
{
|
||||
imports = [
|
||||
# Import modules
|
||||
./base/default.nix
|
||||
./bluetooth/default.nix
|
||||
./boot/clean-tmp.nix
|
||||
./boot/silent-boot.nix
|
||||
./boot/systemd-boot.nix
|
||||
./brightnessctl/default.nix
|
||||
./fontconfig/default.nix
|
||||
./graphics/default.nix
|
||||
./greeter/greetd/default.nix
|
||||
./greeter/greetd/tuigreet.nix
|
||||
./locale/default.nix
|
||||
./neovim/default.nix
|
||||
./power-saving/default.nix
|
||||
./sound/pipewire.nix
|
||||
./users/default.nix
|
||||
./unfree/default.nix
|
||||
./vpn/tailscale.nix
|
||||
./wifi/wpa_supplicant.nix
|
||||
];
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.fontconfig;
|
||||
in
|
||||
{
|
||||
options.modules.fontconfig = {
|
||||
enable = mkEnableOption "fontconfig";
|
||||
};
|
||||
|
||||
config = {
|
||||
fonts.fontconfig.enable = cfg.enable;
|
||||
fonts.enableDefaultPackages = false;
|
||||
fonts.fontconfig.defaultFonts = {
|
||||
serif = mkDefault [ ];
|
||||
sansSerif = mkDefault [ ];
|
||||
monospace = mkDefault [ ];
|
||||
emoji = mkDefault [ ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = {
|
||||
# TODO: Modularize further, especially modesetting should be its own module.
|
||||
# Set up graphics
|
||||
hardware.graphics.enable32Bit = true;
|
||||
hardware.graphics.enable = true;
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
prime = {
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
offload = {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.greetd;
|
||||
in
|
||||
{
|
||||
options.modules.greetd = {
|
||||
enable = mkEnableOption "greetd";
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "Command to run to show greeter.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings.default_session = {
|
||||
command = cfg.command;
|
||||
user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.tuigreet;
|
||||
in
|
||||
{
|
||||
options.modules.tuigreet = {
|
||||
enable = mkEnableOption "tuigreet";
|
||||
greeting = mkOption {
|
||||
type = types.str;
|
||||
default = "Hewwo! >_< :3";
|
||||
description = "Greeting message to show.";
|
||||
};
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
default = "~/.initrc";
|
||||
description = "Command to run after logging in.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Enable greetd
|
||||
modules.greetd = {
|
||||
enable = true;
|
||||
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --greeting \"${cfg.greeting}\" --time --cmd \"${cfg.command}\" --asterisks";
|
||||
};
|
||||
|
||||
# Enable silent boot to prevent late log messages from messing up tuigreet
|
||||
modules.silent-boot.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.gnome;
|
||||
in
|
||||
{
|
||||
options.modules.desktop.gnome = {
|
||||
enable = mkEnableOption "gnome";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# TODO: Enable extensions (declaratively) with dconf
|
||||
|
||||
home.pointerCursor = {
|
||||
enable = true;
|
||||
name = "capitaine-cursors";
|
||||
size = 24;
|
||||
package = pkgs.capitaine-cursors;
|
||||
gtk.enable = true;
|
||||
};
|
||||
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
gnome-session
|
||||
gnome-shell
|
||||
gnome-tweaks
|
||||
gnome-calculator
|
||||
snapshot
|
||||
gnome-characters
|
||||
gnome-connections
|
||||
blackbox-terminal
|
||||
baobab
|
||||
gnome-disk-utility
|
||||
papers
|
||||
nautilus
|
||||
gnome-font-viewer
|
||||
loupe
|
||||
gnome-maps
|
||||
gnome-music
|
||||
gnome-control-center
|
||||
gnome-text-editor
|
||||
showtime
|
||||
file-roller
|
||||
mission-center
|
||||
dconf-editor
|
||||
gnome-calendar
|
||||
gnome-backgrounds
|
||||
gnome-bluetooth
|
||||
gnome-color-manager
|
||||
epiphany
|
||||
|
||||
# For theming gtk3
|
||||
# adw-gtk3 # TODO: Do this better, same for morewaita, not sure if it even works
|
||||
|
||||
# More icons
|
||||
# morewaita-icon-theme
|
||||
]
|
||||
++ (with pkgs.gnomeExtensions; [
|
||||
gsconnect
|
||||
disable-workspace-animation
|
||||
wallpaper-slideshow
|
||||
media-progress
|
||||
mpris-label
|
||||
pip-on-top
|
||||
rounded-window-corners-reborn
|
||||
caffeine
|
||||
]);
|
||||
|
||||
# Set up gnome terminal as changing the default terminal is a pain
|
||||
programs.gnome-terminal = {
|
||||
enable = true;
|
||||
profile."12d2da79-b36c-43d5-8e1f-cf70907b84b3" = {
|
||||
visibleName = "Default";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Enable and set the gtk themes
|
||||
# gtk = {
|
||||
# enable = true;
|
||||
# gtk3.extraConfig = {
|
||||
# gtk-theme-name = "adw-gtk3";
|
||||
# };
|
||||
# gtk4.extraConfig = {
|
||||
# gtk-theme-name = "Adwaita";
|
||||
# };
|
||||
# };
|
||||
|
||||
# Set the theme with dconf
|
||||
# dconf.settings."org/gnome/desktop/interface" = {
|
||||
# gtk-theme = "adw-gtk3";
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -39,15 +39,15 @@ in
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = {
|
||||
settings = {
|
||||
pull = {
|
||||
rebase = false;
|
||||
};
|
||||
};
|
||||
|
||||
userName = cfg.user;
|
||||
userEmail = cfg.email;
|
||||
ignores = cfg.ignores;
|
||||
settings.user.name = cfg.user;
|
||||
settings.user.email = cfg.email;
|
||||
# ignores = cfg.ignores;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.cpp;
|
||||
in
|
||||
{
|
||||
options.modules.cpp = {
|
||||
enable = mkEnableOption "cpp";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Gitignore additions
|
||||
modules.git.ignores = [
|
||||
".ccls-cache"
|
||||
];
|
||||
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
gnumake
|
||||
gcc
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-vscode.cpptools
|
||||
ms-vscode.cmake-tools
|
||||
ms-vscode.cpptools-extension-pack
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
# TODO: Add setting to set the compiler, it currently needs to be set for each workspace individually
|
||||
# "C_Cpp.clang_format_fallbackStyle" = "{ BasedOnStyle: Google, IndentWidth: 4 }";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = {
|
||||
# plugins.lsp.servers.ccls.enable = true;
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.go;
|
||||
in
|
||||
{
|
||||
options.modules.go = {
|
||||
enable = mkEnableOption "go";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
golang.go
|
||||
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = {
|
||||
# plugins.rustaceanvim = {
|
||||
# enable = true;
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
+10
-8
@@ -23,18 +23,20 @@ in
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
haskell.haskell
|
||||
justusadam.language-haskell
|
||||
];
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
haskell.haskell
|
||||
justusadam.language-haskell
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"[haskell]" = { };
|
||||
# "haskell.formattingProvider" = "fourmolu";
|
||||
userSettings = {
|
||||
"[haskell]" = { };
|
||||
# "haskell.formattingProvider" = "fourmolu";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
programs.nixvim = { };
|
||||
# programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
@@ -23,14 +23,16 @@ in
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
bradlc.vscode-tailwindcss
|
||||
];
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
bradlc.vscode-tailwindcss
|
||||
];
|
||||
|
||||
userSettings = { };
|
||||
userSettings = { };
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
programs.nixvim = { };
|
||||
# programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
# TODO: Move to a module for notebooks in general
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.jupyter;
|
||||
in
|
||||
{
|
||||
options.modules.jupyter = {
|
||||
enable = mkEnableOption "jupyter";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
# home.packages = with pkgs; [
|
||||
# evcxr
|
||||
# ];
|
||||
|
||||
# modules.python.extraPythonPackages = p: [
|
||||
# p.jupyter
|
||||
# p.notebook
|
||||
# ];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-toolsai.jupyter
|
||||
ms-toolsai.jupyter-renderers
|
||||
];
|
||||
|
||||
userSettings = { };
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
+16
-14
@@ -18,7 +18,7 @@ in
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
nix-tree
|
||||
nixfmt-rfc-style
|
||||
nixfmt
|
||||
nixd
|
||||
];
|
||||
|
||||
@@ -32,18 +32,20 @@ in
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
|
||||
|
||||
userSettings = {
|
||||
"[nix]" = {
|
||||
"editor.tabSize" = 2;
|
||||
};
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = "nixd";
|
||||
"nix.serverSettings" = {
|
||||
nixd = {
|
||||
formatting = {
|
||||
command = [ "nixfmt" ];
|
||||
userSettings = {
|
||||
"[nix]" = {
|
||||
"editor.tabSize" = 2;
|
||||
};
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = "nixd";
|
||||
"nix.serverSettings" = {
|
||||
nixd = {
|
||||
formatting = {
|
||||
command = [ "nixfmt" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -51,8 +53,8 @@ in
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
programs.nixvim = {
|
||||
# programs.nixvim = {
|
||||
|
||||
};
|
||||
# };
|
||||
};
|
||||
}
|
||||
+14
-18
@@ -8,7 +8,6 @@
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.python;
|
||||
package = pkgs.python3.withPackages cfg.extraPythonPackages;
|
||||
in
|
||||
{
|
||||
options.modules.python = {
|
||||
@@ -26,31 +25,28 @@ in
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = [
|
||||
package
|
||||
];
|
||||
|
||||
# Allow unfree
|
||||
modules.unfree.allowedPackages = [
|
||||
"vscode-extension-MS-python-vscode-pylance"
|
||||
];
|
||||
home.packages = [ ];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-python.python
|
||||
ms-python.debugpy
|
||||
ms-python.vscode-pylance
|
||||
];
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-python.python
|
||||
ms-python.debugpy
|
||||
ms-python.vscode-pylance
|
||||
ms-python.black-formatter
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"[python]" = {
|
||||
"editor.defaultFormatter" = "ms-python.vscode-pylance";
|
||||
userSettings = {
|
||||
"python.defaultInterpreterPath" = "\${env:PYTHONINTERPRETER}";
|
||||
"[python]" = {
|
||||
"editor.defaultFormatter" = "ms-python.black-formatter";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
programs.nixvim = { };
|
||||
# programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.rust;
|
||||
in
|
||||
{
|
||||
options.modules.rust = {
|
||||
enable = mkEnableOption "rust";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
# rustup
|
||||
# rustc
|
||||
# cargo
|
||||
# gcc
|
||||
# lldb
|
||||
# bacon
|
||||
# rust-analyzer
|
||||
# rustfmt
|
||||
# clippy
|
||||
# evcxr
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
rust-lang.rust-analyzer
|
||||
vadimcn.vscode-lldb
|
||||
tamasfe.even-better-toml
|
||||
serayuzgur.crates
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"[rust]" = {
|
||||
"editor.inlayHints.enabled" = "off";
|
||||
};
|
||||
"rust-analyzer.check.command" = "clippy";
|
||||
"rust-analyzer.showUnlinkedFileNotification" = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = {
|
||||
# plugins.rustaceanvim = {
|
||||
# enable = true;
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.tex;
|
||||
in
|
||||
{
|
||||
options.modules.tex = {
|
||||
enable = mkEnableOption "tex";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
(texlive.combine {
|
||||
inherit (texlive) scheme-full;
|
||||
})
|
||||
];
|
||||
|
||||
# Pygments for minted
|
||||
modules.python.extraPythonPackages = p: [
|
||||
p.pygments
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
|
||||
|
||||
userSettings = {
|
||||
"[tex]" = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = {
|
||||
# extraConfigVim = ''
|
||||
# " Enforce latexmk
|
||||
# let g:vimtex_compiler_method = 'latexmk'
|
||||
|
||||
# " Set latexmk compilation settings
|
||||
# let g:vimtex_compiler_latexmk = {
|
||||
# \ 'options': [
|
||||
# \ '-shell-escape',
|
||||
# \ '-verbose',
|
||||
# \ '-file-line-error',
|
||||
# \ '-synctex=1',
|
||||
# \ '-interaction=nonstopmode',
|
||||
# \ ],
|
||||
# \}
|
||||
# '';
|
||||
|
||||
# # Vimtex plugin
|
||||
# plugins.vimtex = {
|
||||
# enable = true;
|
||||
# texlivePackage = null;
|
||||
# settings = {
|
||||
# view_method = "zathura";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.mathematica;
|
||||
|
||||
my-mathematica = pkgs.mathematica.overrideAttrs (old: {
|
||||
force-rebuild = "1";
|
||||
# TODO: Just use a generic name for the installer?
|
||||
# source = ./Wolfram_14.2.1_LIN_Bndl.sh;
|
||||
});
|
||||
in
|
||||
{
|
||||
options.modules.mathematica = {
|
||||
enable = mkEnableOption "mathematica";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
# pkgs.mathematica-cuda
|
||||
my-mathematica
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.neovim;
|
||||
# theme = config.desktop.theming;
|
||||
# colors = theme.colors;
|
||||
in
|
||||
{
|
||||
options.modules.neovim = {
|
||||
enable = mkEnableOption "neovim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# programs.nixvim = {
|
||||
# enable = true;
|
||||
# defaultEditor = true;
|
||||
# viAlias = true;
|
||||
# vimAlias = true;
|
||||
|
||||
# # extraPackages = with pkgs; [ ];
|
||||
|
||||
# opts = {
|
||||
# number = true;
|
||||
# relativenumber = true;
|
||||
|
||||
# signcolumn = "yes";
|
||||
|
||||
# ignorecase = true;
|
||||
# smartcase = true;
|
||||
|
||||
# tabstop = 4;
|
||||
# shiftwidth = 4;
|
||||
# softtabstop = 0;
|
||||
# expandtab = true;
|
||||
# smarttab = true;
|
||||
|
||||
# list = true;
|
||||
# listchars = "tab:»┈«,trail:·,extends:→,precedes:←,nbsp:␣";
|
||||
# };
|
||||
|
||||
# diagnostic.settings = {
|
||||
# enable = true;
|
||||
# signs = true;
|
||||
# underline = true;
|
||||
# update_in_insert = true;
|
||||
# };
|
||||
|
||||
# extraConfigLua = ''
|
||||
# vim.fn.sign_define("DiagnosticSignError",
|
||||
# {text = "", texthl = "DiagnosticSignError"})
|
||||
# vim.fn.sign_define("DiagnosticSignWarn",
|
||||
# {text = "", texthl = "DiagnosticSignWarn"})
|
||||
# vim.fn.sign_define("DiagnosticSignInfo",
|
||||
# {text = "", texthl = "DiagnosticSignInfo"})
|
||||
# vim.fn.sign_define("DiagnosticSignHint",
|
||||
# {text = "💡", texthl = "DiagnosticSignHint"})
|
||||
# '';
|
||||
|
||||
# keymaps = [
|
||||
# # Save shortcut
|
||||
# {
|
||||
# action = ":update<CR>";
|
||||
# key = "<C-s>";
|
||||
# mode = "n";
|
||||
# }
|
||||
# {
|
||||
# action = "<C-o>:update<CR>";
|
||||
# key = "<C-s>";
|
||||
# mode = "i";
|
||||
# }
|
||||
|
||||
# # Neo tree
|
||||
# {
|
||||
# action = ":Neotree action=focus reveal toggle<CR>";
|
||||
# key = "<leader>n";
|
||||
# mode = "n";
|
||||
# options.silent = true;
|
||||
# }
|
||||
# ];
|
||||
|
||||
# autoCmd = [
|
||||
# {
|
||||
# desc = "Automatic formatting";
|
||||
# event = "BufWritePre";
|
||||
# callback = {
|
||||
# __raw = ''
|
||||
# function()
|
||||
# vim.lsp.buf.format {
|
||||
# async = false,
|
||||
# }
|
||||
# end
|
||||
# '';
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
|
||||
# # highlight = {
|
||||
# # Comment = {
|
||||
# # italic = true;
|
||||
# # fg = theme.schemeColors.withHashtag.base03; # TODO: Come up with a good name colors.muted maybe?
|
||||
# # };
|
||||
# # };
|
||||
|
||||
# plugins.lsp = {
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
# #plugins.treesitter = {
|
||||
# # enable = true;
|
||||
# #};
|
||||
|
||||
# plugins.cmp = {
|
||||
# enable = true;
|
||||
|
||||
# settings = {
|
||||
# mapping = {
|
||||
# "<C-Space>" = "cmp.mapping.complete()";
|
||||
# "<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||
# "<C-e>" = "cmp.mapping.close()";
|
||||
# "<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
# "<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
# "<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||||
# "<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
# };
|
||||
# sources = [
|
||||
# { name = "path"; }
|
||||
# { name = "nvim_lsp"; }
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
|
||||
# plugins.web-devicons = {
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
# plugins.neo-tree = {
|
||||
# enable = true;
|
||||
|
||||
# closeIfLastWindow = true;
|
||||
# window = {
|
||||
# width = 30;
|
||||
# autoExpandWidth = true;
|
||||
# };
|
||||
|
||||
# extraOptions = {
|
||||
# default_component_configs.git_status.symbols = {
|
||||
# # Change type
|
||||
# added = "+";
|
||||
# deleted = "✕";
|
||||
# modified = "✦";
|
||||
# renamed = "→";
|
||||
|
||||
# # Status type
|
||||
# untracked = "?";
|
||||
# ignored = "▫";
|
||||
# unstaged = "□";
|
||||
# staged = "■";
|
||||
# conflict = "‼";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
|
||||
# #plugins.cmp-nvim-lsp.enable = true;
|
||||
|
||||
# plugins.gitsigns = {
|
||||
# enable = true;
|
||||
# settings.current_line_blame = true;
|
||||
# };
|
||||
|
||||
# #plugins.copilot-vim = {
|
||||
# # enable = true;
|
||||
# #};
|
||||
|
||||
# # plugins.vimtex = {
|
||||
# # enable = true;
|
||||
# # texlivePackage = null;
|
||||
# # settings = {
|
||||
# # view_method = "zathura";
|
||||
# # };
|
||||
# # };
|
||||
# };
|
||||
# programs.neovim.defaultEditor = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.vscode;
|
||||
# theme = config.desktop.theming;
|
||||
in
|
||||
{
|
||||
options.modules.vscode = {
|
||||
enable = mkEnableOption "vscode";
|
||||
# codeFont = mkOption {
|
||||
# type = types.anything;
|
||||
# default = theme.fonts.pkgs."Fira Code";
|
||||
# };
|
||||
# fallbackFont = mkOption {
|
||||
# type = types.anything;
|
||||
# default = theme.fonts.pkgs."Symbols Nerd Font Mono";
|
||||
# };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# TODO: Fix theming
|
||||
# desktop.theming.fonts.extraFonts = [ cfg.codeFont ];
|
||||
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
|
||||
mutableExtensionsDir = false;
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
eamodio.gitlens
|
||||
ms-vscode.hexeditor
|
||||
mkhl.direnv
|
||||
usernamehw.errorlens
|
||||
gruntfuggly.todo-tree
|
||||
github.copilot
|
||||
github.copilot-chat
|
||||
tomoki1207.pdf
|
||||
ms-vsliveshare.vsliveshare
|
||||
ms-vscode-remote.remote-ssh
|
||||
myriad-dreamin.tinymist
|
||||
];
|
||||
|
||||
userSettings =
|
||||
let
|
||||
# font-family = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
|
||||
# TODO: Move the conversion factor to theme settings
|
||||
# font-size = mkForce cfg.codeFont.recommendedSize; # Convert pt to px
|
||||
in
|
||||
{
|
||||
# Font setup
|
||||
# "editor.fontFamily" = font-family;
|
||||
# "editor.inlayHints.fontFamily" = font-family;
|
||||
# "editor.inlineSuggest.fontFamily" = font-family;
|
||||
# "editor.fontSize" = font-size;
|
||||
# "editor.fontLigatures" = true;
|
||||
# "terminal.integrated.fontFamily" = font-family;
|
||||
# "terminal.integrated.fontSize" = font-size;
|
||||
# "chat.editor.fontFamily" = font-family; # TODO: Change this font to the standard UI font
|
||||
# "chat.editor.fontSize" = font-size;
|
||||
# "debug.console.fontFamily" = font-family;
|
||||
# "debug.console.fontSize" = font-size;
|
||||
# "scm.inputFontFamily" = font-family; # TODO: Change this font to the standard UI font
|
||||
# "scm.inputFontSize" = font-size;
|
||||
# "markdown.preview.fontFamily" = mkForce theme.fonts.sansSerif.name; # TODO: Change this font to the standard UI font
|
||||
# "markdown.preview.fontSize" = mkForce theme.fonts.sansSerif.recommendedSize;
|
||||
|
||||
# Formatting
|
||||
"editor.formatOnSave" = true;
|
||||
"editor.tabSize" = 4;
|
||||
|
||||
# Layout
|
||||
"window.menuBarVisibility" = "hidden";
|
||||
|
||||
# Git settings
|
||||
"git.autofetch" = true;
|
||||
"git.enableSmartCommit" = false;
|
||||
"git.suggestSmartCommit" = false;
|
||||
|
||||
# Disable update notifications
|
||||
"update.mode" = "none";
|
||||
|
||||
# Set themes
|
||||
"window.autoDetectColorScheme" = true;
|
||||
|
||||
# TODO: Move to direnv module
|
||||
# Ignore direnv folder
|
||||
"files.exclude" = {
|
||||
".direnv" = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bash;
|
||||
in
|
||||
{
|
||||
options.modules.shell = {
|
||||
options.modules.bash = {
|
||||
enable = mkEnableOption "bash";
|
||||
aliases = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {
|
||||
@@ -16,4 +19,9 @@ with lib;
|
||||
description = "Shell aliases";
|
||||
};
|
||||
};
|
||||
|
||||
config.programs.bash = {
|
||||
enable = cfg.enable;
|
||||
shellAliases = cfg.aliases;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bitwarden;
|
||||
in
|
||||
{
|
||||
options.modules.bitwarden = {
|
||||
enable = mkEnableOption "Bitwarden";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
bitwarden-desktop
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.direnv;
|
||||
in
|
||||
{
|
||||
options.modules.direnv = {
|
||||
enable = mkEnableOption "direnv";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
modules.git.ignores = [
|
||||
".direnv"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -12,12 +12,6 @@ in
|
||||
{
|
||||
options.modules.fish = {
|
||||
enable = mkEnableOption "fish";
|
||||
|
||||
plugins = {
|
||||
done = mkEnableOption "done";
|
||||
fzf = mkEnableOption "fzf";
|
||||
grc = mkEnableOption "grc";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
@@ -36,28 +30,31 @@ in
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
shellAliases = config.modules.shell.aliases;
|
||||
shellAliases = config.modules.bash.aliases;
|
||||
|
||||
plugins = [
|
||||
(mkIf cfg.plugins.done {
|
||||
{
|
||||
name = "done";
|
||||
src = pkgs.fishPlugins.done.src;
|
||||
})
|
||||
(mkIf cfg.plugins.fzf {
|
||||
}
|
||||
{
|
||||
name = "fzf";
|
||||
src = pkgs.fishPlugins.fzf-fish.src;
|
||||
})
|
||||
(mkIf cfg.plugins.grc {
|
||||
}
|
||||
{
|
||||
name = "grc";
|
||||
src = pkgs.fishPlugins.grc.src;
|
||||
})
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Fish plugin dependencies
|
||||
home.packages = with pkgs; [
|
||||
(mkIf cfg.plugins.fzf fzf)
|
||||
(mkIf cfg.plugins.grc grc)
|
||||
fzf
|
||||
grc
|
||||
];
|
||||
|
||||
# Impermanence
|
||||
modules.impermanence.files = [ ".local/share/fish/fish_history" ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.impermanence;
|
||||
in
|
||||
{
|
||||
options.modules.impermanence = {
|
||||
enable = mkEnableOption "Impermanence";
|
||||
directories = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Directories that should be stored in persistent storage.
|
||||
'';
|
||||
};
|
||||
files = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Files that should be stored in persistent storage.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.persistence."/persist/home" = {
|
||||
enable = true;
|
||||
hideMounts = true;
|
||||
directories = cfg.directories;
|
||||
files = cfg.files;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.secrets;
|
||||
secrets = inputs.secrets;
|
||||
in
|
||||
{
|
||||
options.modules.secrets = {
|
||||
enable = mkEnableOption "secrets";
|
||||
defaultFile = mkOption {
|
||||
type = types.str;
|
||||
default = "${secrets}/secrets/common.enc.yaml";
|
||||
description = ''
|
||||
The default file to use for SOPS.
|
||||
'';
|
||||
};
|
||||
secrets = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
description = ''
|
||||
All secrets that should be made available.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Set up SOPS
|
||||
# TODO: Fix the key not being present in .config/sops before sops-nix runs
|
||||
sops.defaultSopsFile = cfg.defaultFile;
|
||||
sops.age.sshKeyPaths = [
|
||||
"${config.home.homeDirectory}/.config/sops/sops_ed25519_key"
|
||||
# "/persist/home/${config.home.username}/.config/sops/sops_ed25519_key"
|
||||
];
|
||||
sops.secrets = cfg.secrets;
|
||||
modules.impermanence.directories = [ ".config/sops" ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.xpra;
|
||||
in
|
||||
{
|
||||
options.modules.xpra = {
|
||||
enable = mkEnableOption "Enable xpra";
|
||||
hosts = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = { };
|
||||
description = "xpra hosts";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
xpra
|
||||
];
|
||||
|
||||
xdg.desktopEntries = (
|
||||
listToAttrs (
|
||||
map
|
||||
(entry: {
|
||||
name = "xpra${
|
||||
builtins.substring 0 12 (builtins.hashString "sha256" "${entry.name} (${entry.comment})")
|
||||
}";
|
||||
value = entry // {
|
||||
type = "Application";
|
||||
terminal = false;
|
||||
genericName = entry.comment;
|
||||
};
|
||||
})
|
||||
(
|
||||
concatMap (
|
||||
host:
|
||||
let
|
||||
uri = "tcp://${host}:15151/7";
|
||||
in
|
||||
[
|
||||
{
|
||||
name = "Xpra - Attach";
|
||||
comment = host;
|
||||
exec = "xpra attach --min-quality=100 --min-speed=100 --encoding=png --speaker=off ${uri}";
|
||||
}
|
||||
{
|
||||
name = "Xpra - Detach";
|
||||
comment = host;
|
||||
exec = "xpra detach ${uri}";
|
||||
}
|
||||
]
|
||||
) cfg.hosts
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = {
|
||||
time.timeZone = "Europe/Amsterdam";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console.keyMap = "us";
|
||||
};
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.neovim;
|
||||
in
|
||||
{
|
||||
options.modules.neovim = {
|
||||
enable = mkEnableOption "neovim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bluetooth;
|
||||
in
|
||||
{
|
||||
options.modules.bluetooth = {
|
||||
enable = mkEnableOption "bluetooth";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Enable bluetooth
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bootloader;
|
||||
in
|
||||
{
|
||||
options.modules.bootloader = {
|
||||
enable = mkEnableOption "bootloader";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Bootloader
|
||||
boot.loader = {
|
||||
timeout = 0;
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.editor = false;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
# Initrd
|
||||
boot.initrd.systemd.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.disko;
|
||||
profile = import "${inputs.self}/profiles/disko/${cfg.profile}.nix";
|
||||
in
|
||||
{
|
||||
options.modules.disko = {
|
||||
enable = mkEnableOption "Disko module";
|
||||
profile = mkOption {
|
||||
type = types.str;
|
||||
default = null;
|
||||
description = "The profile to use for the disko module.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
disko.devices = profile.disko.devices;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.domain;
|
||||
domain = inputs.secrets.lab.domain;
|
||||
domainUpper = lib.strings.toUpper domain;
|
||||
in
|
||||
{
|
||||
options.modules.domain = {
|
||||
enable = mkEnableOption "Domain Integration";
|
||||
join = {
|
||||
userFile = mkOption {
|
||||
type = types.str;
|
||||
description = "File containing the user used to join the computer.";
|
||||
};
|
||||
passwordFile = mkOption {
|
||||
type = types.str;
|
||||
description = "File containing the password for the join user.";
|
||||
};
|
||||
domainOUFile = mkOption {
|
||||
type = types.str;
|
||||
description = "The OU to join the computer to.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Set network domain
|
||||
networking.domain = domain;
|
||||
networking.search = [ domain ];
|
||||
|
||||
# Automatically join the domain
|
||||
systemd.services.adcli-join = {
|
||||
description = "Automatically join the domain";
|
||||
wantedBy = [ "default.target" ];
|
||||
before = [ "sssd.service" ];
|
||||
requiredBy = [ "sssd.service" ];
|
||||
after = [
|
||||
"network-online.target"
|
||||
];
|
||||
requires = [
|
||||
"network-online.target"
|
||||
];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
};
|
||||
script = ''
|
||||
ADCLI_JOIN_USER=$(cat ${cfg.join.userFile})
|
||||
ADCLI_JOIN_OU=$(cat ${cfg.join.domainOUFile})
|
||||
${pkgs.adcli}/bin/adcli join -D ${domain} \
|
||||
-U $ADCLI_JOIN_USER \
|
||||
-O $ADCLI_JOIN_OU \
|
||||
--dont-expire-password=true \
|
||||
--stdin-password < ${cfg.join.passwordFile}
|
||||
'';
|
||||
};
|
||||
|
||||
# Set up Kerberos
|
||||
security.krb5 = {
|
||||
enable = true;
|
||||
settings = {
|
||||
libdefaults = {
|
||||
default_realm = domainUpper;
|
||||
};
|
||||
realms.${domainUpper} = {
|
||||
};
|
||||
domain_realm = {
|
||||
"${domain}" = domainUpper;
|
||||
".${domain}" = domainUpper;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Set up SSSD
|
||||
services.sssd = {
|
||||
enable = true;
|
||||
config = ''
|
||||
[sssd]
|
||||
domains = ${domain}
|
||||
config_file_version = 2
|
||||
services = nss, pam
|
||||
|
||||
[nss]
|
||||
filter_users = ${concatStringsSep "," (lib.attrNames config.users.users)}
|
||||
filter_groups = ${concatStringsSep "," (lib.attrNames config.users.groups)}
|
||||
|
||||
[domain/${domain}]
|
||||
enumerate = False
|
||||
ad_domain = ${domain}
|
||||
krb5_realm = ${domainUpper}H
|
||||
id_provider = ad
|
||||
auth_provider = ad
|
||||
access_provider = ad
|
||||
chpass_provider = ad
|
||||
use_fully_qualified_names = False
|
||||
ldap_schema = ad
|
||||
ldap_id_mapping = True
|
||||
ad_gpo_access_control = enforcing
|
||||
ad_gpo_implicit_deny = True
|
||||
dyndns_update = True
|
||||
dyndns_update_ptr = False
|
||||
dyndns_refresh_interval = 86400
|
||||
dyndns_ttl = 3600
|
||||
'';
|
||||
};
|
||||
security.pam.services.login.sssdStrictAccess = true;
|
||||
security.pam.services.sshd.sssdStrictAccess = true;
|
||||
security.pam.services.su.sssdStrictAccess = true;
|
||||
|
||||
# Set up Sudo
|
||||
security.sudo =
|
||||
let
|
||||
admin_group = "host_${lib.replaceStrings [ "-" ] [ "_" ] config.networking.hostName}_admin";
|
||||
in
|
||||
{
|
||||
extraConfig = ''
|
||||
%${admin_group} ALL=(ALL) SETENV: ALL
|
||||
'';
|
||||
};
|
||||
|
||||
# Set up SSH
|
||||
programs.ssh = {
|
||||
package = pkgs.openssh_gssapi;
|
||||
extraConfig = ''
|
||||
GSSAPIAuthentication yes
|
||||
'';
|
||||
};
|
||||
services.openssh = {
|
||||
package = pkgs.openssh_gssapi;
|
||||
settings = {
|
||||
GSSAPIAuthentication = true;
|
||||
GSSAPICleanupCredentials = true;
|
||||
GSSAPIStrictAcceptorCheck = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Set up home directory
|
||||
security.pam.services.login.makeHomeDir = true;
|
||||
security.pam.services.sshd.makeHomeDir = true;
|
||||
security.pam.services.su.makeHomeDir = true;
|
||||
environment.etc.profile.text =
|
||||
let
|
||||
# TODO: Activate configuration based on AD group
|
||||
homeConfiguration = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [
|
||||
(
|
||||
{ lib, ... }:
|
||||
{
|
||||
home.stateVersion = "24.11";
|
||||
home.username = "$USER";
|
||||
home.homeDirectory = "/.$HOME";
|
||||
modules.profiles.base.enable = true;
|
||||
|
||||
# Mount the directories from the network share
|
||||
# home.activation.dirMount =
|
||||
# let
|
||||
# bindScript = dir: ''
|
||||
# mkdir -p /network/$USER/${dir}
|
||||
# mkdir -p $HOME/${dir}
|
||||
# ${pkgs.bindfs}/bin/bindfs /network/$USER/${dir} $HOME/${dir}
|
||||
# '';
|
||||
# in
|
||||
# lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
# if ! ${pkgs.krb5}/bin/klist -s; then
|
||||
# echo "No kerberos ticket found"
|
||||
# ${pkgs.krb5}/bin/kinit
|
||||
# fi
|
||||
|
||||
# if ${pkgs.krb5}/bin/klist -s; then
|
||||
# echo "Kerberos ticket found, mounting home directory"
|
||||
# ${bindScript "Documents"}
|
||||
# ${bindScript "Music"}
|
||||
# ${bindScript "Pictures"}
|
||||
# ${bindScript "Video"}
|
||||
# else
|
||||
# echo "Still no kerberos ticket found, skipping home directory mount"
|
||||
# fi
|
||||
# '';
|
||||
}
|
||||
)
|
||||
] ++ config.home-manager.sharedModules;
|
||||
};
|
||||
in
|
||||
mkAfter ''
|
||||
# Activate Home Manager configuration for domain users
|
||||
if id | egrep -o 'groups=.*' | sed 's/,/\n/g' | cut -d'(' -f2 | sed 's/)//' | egrep -o "^domain users$"; then
|
||||
echo "Setting up environment for domain user"
|
||||
SKIP_SANITY_CHECKS=1 ${homeConfiguration.activationPackage}/activate
|
||||
if test -f "$HOME/.bashrc"; then
|
||||
. $HOME/.bashrc
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
|
||||
# Automatically mount home share
|
||||
# Can be accessed at /network/$USER
|
||||
# services.autofs = {
|
||||
# enable = true;
|
||||
# autoMaster =
|
||||
# let
|
||||
# networkMap = pkgs.writeText "auto" ''
|
||||
# * -fstype=cifs,sec=krb5,user=&,uid=$UID,gid=$GID,cruid=$UID ://${inputs.secrets.lab.nas.host}/home
|
||||
# '';
|
||||
# in
|
||||
# ''
|
||||
# /network ${networkMap} --timeout=30
|
||||
# '';
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.fonts;
|
||||
in
|
||||
{
|
||||
options.modules.fonts = {
|
||||
enable = mkEnableOption "fonts";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
console.packages = [
|
||||
pkgs.dina-psfu
|
||||
];
|
||||
console.font = "dina";
|
||||
console.earlySetup = true;
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
fira
|
||||
jetbrains-mono
|
||||
];
|
||||
|
||||
# TODO: Disable default fonts, fonts should be managed per user
|
||||
# fonts.enableDefaultPackages = false;
|
||||
# fonts.fontconfig = {
|
||||
# enable = true;
|
||||
# defaultFonts = {
|
||||
# serif = mkDefault [ ];
|
||||
# sansSerif = mkDefault [ ];
|
||||
# monospace = mkDefault [ ];
|
||||
# emoji = mkDefault [ ];
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.gnome;
|
||||
in
|
||||
{
|
||||
options.modules.gnome = {
|
||||
enable = mkEnableOption "gnome";
|
||||
# TODO: Add RDP toggle
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Enable GDM and Gnome
|
||||
services.displayManager.gdm.enable = true;
|
||||
services.desktopManager.gnome.enable = true;
|
||||
services.gnome.core-apps.enable = false;
|
||||
services.gnome.games.enable = false;
|
||||
services.gnome.core-developer-tools.enable = false;
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
adwaita-icon-theme
|
||||
(derivation { name = "nixos-background-info"; })
|
||||
gnome-backgrounds
|
||||
gnome-bluetooth
|
||||
gnome-color-manager
|
||||
gnome-shell-extensions
|
||||
gnome-tour
|
||||
gnome-user-docs
|
||||
glib
|
||||
gnome-menus
|
||||
gtk3.out
|
||||
];
|
||||
|
||||
# For GSConnect/KDE Connect
|
||||
# TODO: Move to host config?
|
||||
networking.firewall = {
|
||||
allowedTCPPortRanges = [
|
||||
{
|
||||
from = 1714;
|
||||
to = 1764;
|
||||
}
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{
|
||||
from = 1714;
|
||||
to = 1764;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Enable dependencies
|
||||
modules.networkmanager.enable = true;
|
||||
|
||||
# Impermanence
|
||||
modules.impermanence.directories = [
|
||||
"/etc/NetworkManager/system-connections"
|
||||
"/var/lib/bluetooth"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.graphics;
|
||||
in
|
||||
{
|
||||
options.modules.graphics = {
|
||||
enable = mkEnableOption "graphics";
|
||||
# TODO: Add toggle for hybrid graphics
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
hardware.graphics.enable = true;
|
||||
hardware.graphics.enable32Bit = true;
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
# TODO: Add nvidia settings back in
|
||||
# TODO: Move to nvidia module
|
||||
hardware.nvidia = {
|
||||
open = false;
|
||||
prime = {
|
||||
intelBusId = "PCI:0@0:2:0";
|
||||
nvidiaBusId = "PCI:1@0:0:0";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.impermanence;
|
||||
in
|
||||
{
|
||||
options.modules.impermanence = {
|
||||
enable = mkEnableOption "Impermanence";
|
||||
directories = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Directories that should be stored in persistent storage.
|
||||
'';
|
||||
};
|
||||
files = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Files that should be stored in persistent storage.
|
||||
'';
|
||||
};
|
||||
resetScript = mkOption {
|
||||
type = types.lines;
|
||||
description = ''
|
||||
Script to run in order to reset the system to a clean state.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Filesystem setup
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
# boot.initrd.postResumeCommands = mkAfter cfg.resetScript;
|
||||
# TODO: Reduce dependency on the root filesystem being ZFS?
|
||||
boot.initrd.systemd.services.impermanence-rollback = {
|
||||
description = "Rollback filesystem to clean state.";
|
||||
wantedBy = [ "initrd.target" ];
|
||||
after = [ "zfs-import.target" ];
|
||||
before = [ "sysroot.mount" ];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = cfg.resetScript;
|
||||
};
|
||||
|
||||
# For home-manager persistence
|
||||
programs.fuse.userAllowOther = true;
|
||||
|
||||
# For testing purposes with VM
|
||||
virtualisation.vmVariantWithDisko.virtualisation.fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.persistence = {
|
||||
"/persist/system" = {
|
||||
enable = true;
|
||||
hideMounts = true;
|
||||
directories = cfg.directories;
|
||||
files = cfg.files;
|
||||
};
|
||||
# "/persist/home" = {
|
||||
# enable = true;
|
||||
# hideMounts = true;
|
||||
# users = (
|
||||
# lib.mapAttrs' (
|
||||
# name: value:
|
||||
# let
|
||||
# user = name;
|
||||
# homeDir = "/home/${user}";
|
||||
# impConfig = value.modules.impermanence;
|
||||
# in
|
||||
# lib.nameValuePair user {
|
||||
# home = homeDir;
|
||||
# directories = impConfig.directories;
|
||||
# files = impConfig.files;
|
||||
# }
|
||||
# ) config.home-manager.users
|
||||
# );
|
||||
# };
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.networkmanager;
|
||||
in
|
||||
{
|
||||
options.modules.networkmanager = {
|
||||
enable = mkEnableOption "networkmanager";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# TODO: Add sudo users to the networkmanager group?
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
networking.firewall.checkReversePath = false;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.power-saving;
|
||||
in
|
||||
{
|
||||
options.modules.power-saving = {
|
||||
enable = mkEnableOption "power saving";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Setup power management
|
||||
powerManagement.enable = true;
|
||||
services.thermald.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
|
||||
# Enable wifi power saving
|
||||
networking.networkmanager.wifi.powersave = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.printing;
|
||||
in
|
||||
{
|
||||
options.modules.printing = {
|
||||
enable = mkEnableOption "printing";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Enable CUPS
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable Avahi to auto-detect network printers
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
# For SMB network printers
|
||||
services.samba.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.secrets;
|
||||
secrets = inputs.secrets;
|
||||
in
|
||||
{
|
||||
options.modules.secrets = {
|
||||
enable = mkEnableOption "secrets";
|
||||
defaultFile = mkOption {
|
||||
type = types.str;
|
||||
default = "${secrets}/secrets/common.enc.yaml";
|
||||
description = ''
|
||||
The default file to use for SOPS.
|
||||
'';
|
||||
};
|
||||
secrets = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
description = ''
|
||||
All secrets that should be made available.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Set up SOPS
|
||||
# TODO: Fix the key not being present in /etc/sops before sops-nix runs
|
||||
sops.defaultSopsFile = cfg.defaultFile;
|
||||
sops.age.sshKeyPaths = [
|
||||
"/etc/sops/sops_ed25519_key"
|
||||
"/persist/system/etc/sops/sops_ed25519_key"
|
||||
];
|
||||
sops.secrets = cfg.secrets;
|
||||
modules.impermanence.directories = [ "/etc/sops" ];
|
||||
virtualisation.vmVariantWithDisko.sops.age.sshKeyPaths = [ "/tmp/shared/sops_ed25519_key" ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.sound;
|
||||
in
|
||||
{
|
||||
options.modules.sound = {
|
||||
enable = mkEnableOption "sound";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Enable pipewire
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
# Recommended by wiki, allows user processes to use realtime kernel
|
||||
security.rtkit.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.ssh;
|
||||
in
|
||||
{
|
||||
options.modules.ssh = {
|
||||
enable = mkEnableOption "ssh";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
hostKeys = mkIf (config.modules.impermanence.enable) [
|
||||
{
|
||||
type = "ed25519";
|
||||
path = "/persist/system/etc/ssh/ssh_host_ed25519_key";
|
||||
}
|
||||
{
|
||||
type = "rsa";
|
||||
bits = 4096;
|
||||
path = "/persist/system/etc/ssh/ssh_host_rsa_key";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.power-saving;
|
||||
in
|
||||
{
|
||||
options.modules.power-saving = {
|
||||
enable = mkEnableOption "power-saving";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
powerManagement.enable = true;
|
||||
services.thermald.enable = true;
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 20;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.pipewire;
|
||||
in
|
||||
{
|
||||
options.modules.pipewire = {
|
||||
enable = mkEnableOption "pipewire";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.unfree;
|
||||
in
|
||||
{
|
||||
options.modules.unfree = {
|
||||
enable = mkEnableOption "unfree";
|
||||
allowedPackages = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (getName pkg) cfg.allowedPackages;
|
||||
};
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
# Nixvim
|
||||
nixvim = import (
|
||||
# builtins.fetchGit {
|
||||
# url = "https://github.com/nix-community/nixvim";
|
||||
# # ref = "nixos-24.05";
|
||||
# }
|
||||
pkgs.fetchFromGitHub {
|
||||
owner = "nix-community";
|
||||
repo = "nixvim";
|
||||
rev = "master";
|
||||
sha256 = "sha256-xPf3jjDBDA9oMVnWU5DJ8gINCq2EPiupvF/4rD/0eEI=";
|
||||
}
|
||||
);
|
||||
|
||||
# Stylix
|
||||
stylix = import (
|
||||
pkgs.fetchFromGitHub {
|
||||
owner = "danth";
|
||||
repo = "stylix";
|
||||
rev = "master";
|
||||
sha256 = "sha256-8uTKUHkaU980J5kRnLYrdwmjZYB88eBGUk1oVgIUHFE=";
|
||||
}
|
||||
);
|
||||
|
||||
# User configuration
|
||||
userModule = types.submodule {
|
||||
options = {
|
||||
sudo = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether the user is allowed sudo access.";
|
||||
};
|
||||
configuration = mkOption {
|
||||
type = types.path;
|
||||
default = ./users/base.nix;
|
||||
description = "What home manager configuration to use for this user.";
|
||||
};
|
||||
desktopInit = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = "Bash script to execute after initial log in.";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Import home manager
|
||||
<home-manager/nixos>
|
||||
|
||||
# Import system wide configuration required for user modules
|
||||
./modules/systemwide/default.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
machine.users = mkOption {
|
||||
type = types.attrsOf userModule;
|
||||
default = { };
|
||||
description = "Users configured on this system.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# Add required home manager modules
|
||||
home-manager.sharedModules = [
|
||||
# Stylix for theming
|
||||
stylix.homeManagerModules.stylix
|
||||
|
||||
# Nixvim for neovim
|
||||
nixvim.homeManagerModules.nixvim
|
||||
|
||||
# Modules
|
||||
./modules/default.nix
|
||||
|
||||
# Custom packages
|
||||
../../pkgs/default.nix
|
||||
];
|
||||
|
||||
# Create users
|
||||
users.users = attrsets.concatMapAttrs (name: value: {
|
||||
${name} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = mkIf value.sudo [
|
||||
"wheel"
|
||||
"docker"
|
||||
];
|
||||
};
|
||||
}) config.machine.users;
|
||||
|
||||
# Create home manager configuration for users
|
||||
home-manager.users = attrsets.concatMapAttrs (name: value: {
|
||||
${name} = value.configuration;
|
||||
}) config.machine.users;
|
||||
};
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bluetuith;
|
||||
in
|
||||
{
|
||||
options.modules.bluetuith = {
|
||||
enable = mkEnableOption "bluetuith";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [ bluetuith ];
|
||||
|
||||
# Add nix tree
|
||||
xdg.desktopEntries.bluetuith = {
|
||||
exec = "${pkgs.bluetuith}/bin/bluetuith";
|
||||
name = "Bluetuith";
|
||||
terminal = true;
|
||||
type = "Application";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
{
|
||||
imports = [
|
||||
./firefox/default.nix
|
||||
./qutebrowser/default.nix
|
||||
];
|
||||
|
||||
options.default.browser = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "Default browser";
|
||||
};
|
||||
|
||||
config = {
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
|
||||
defaultApplications = {
|
||||
"text/html" = "${config.default.browser}";
|
||||
"x-scheme-handler/http" = "${config.default.browser}";
|
||||
"x-scheme-handler/https" = "${config.default.browser}";
|
||||
"x-scheme-handler/about" = "${config.default.browser}";
|
||||
"x-scheme-handler/unknown" = "${config.default.browser}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.firefox;
|
||||
in
|
||||
{
|
||||
options.modules.firefox = {
|
||||
enable = lib.mkEnableOption "firefox";
|
||||
default = lib.mkEnableOption "default";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
default.browser = mkIf cfg.default "firefox.desktop";
|
||||
|
||||
# Enable NUR
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
# TODO: Pin the version
|
||||
nur = import (builtins.fetchTarball {
|
||||
url = "https://github.com/nix-community/NUR/archive/master.tar.gz";
|
||||
sha256 = "0jjfvr325imrwg9ic8xha5y38jcp1s0z4pzwhvi0570aigzibbz4";
|
||||
}) { inherit pkgs; };
|
||||
};
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
|
||||
policies = {
|
||||
AppAutoUpdate = false;
|
||||
# BlockAboutAddons = true;
|
||||
# BlockAboutConfig = true;
|
||||
# BlockAboutProfiles = true;
|
||||
DisableAppUpdate = true;
|
||||
DisableFeedbackCommands = true;
|
||||
DisableMasterPasswordCreation = true;
|
||||
DisablePocket = true;
|
||||
DisableProfileImport = true;
|
||||
DisableProfileRefresh = true;
|
||||
DisableSetDesktopBackground = true;
|
||||
DisableTelemetry = true;
|
||||
DisplayBookmarksToolbar = "never";
|
||||
DisplayMenuBar = "never";
|
||||
DNSOverHTTPS = {
|
||||
Enabled = false;
|
||||
};
|
||||
DontCheckDefaultBrowser = true;
|
||||
PasswordManagerEnabled = false;
|
||||
TranslateEnabled = true;
|
||||
UseSystemPrintDialog = true;
|
||||
};
|
||||
|
||||
profiles.nixos = {
|
||||
search.default = "DuckDuckGo";
|
||||
|
||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
# firefox-color
|
||||
ublock-origin
|
||||
];
|
||||
|
||||
# Theming
|
||||
userChrome = readFile (
|
||||
pkgs.substituteAll {
|
||||
src = ./userChrome.css;
|
||||
colors = config.theming.colorsCSS;
|
||||
}
|
||||
);
|
||||
|
||||
settings = {
|
||||
"browser.tabs.inTitlebar" = 0;
|
||||
"extensions.autoDisableScopes" = 0;
|
||||
"devtools.chrome.enabled" = true;
|
||||
"devtools.debugger.remote-enabled" = true;
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
|
||||
# Force overwriting configuration file
|
||||
search.force = true;
|
||||
containersForce = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
/* Import theme colors */
|
||||
@colors@
|
||||
|
||||
/* Configure titlebar */
|
||||
#titlebar {
|
||||
/* Add consistent margins to tab bar */
|
||||
padding: 0 2px !important;
|
||||
|
||||
/* Add emphasized color to background of tab bar */
|
||||
background-color: var(--nix-color-bg-status) !important;
|
||||
|
||||
/* Set correct text color */
|
||||
color: var(--nix-color-fg) !important;
|
||||
}
|
||||
|
||||
.tab-background:is([selected], [multiselected]) {
|
||||
/* Set correct background color */
|
||||
background-color: var(--nix-color-bg) !important;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
/* Set correct text color */
|
||||
color: var(--nix-color-fg) !important;
|
||||
}
|
||||
|
||||
/* Configure navigation bar */
|
||||
#nav-bar {
|
||||
/* Set correct background color */
|
||||
background-color: var(--nix-color-bg) !important;
|
||||
|
||||
/* Set correct text color */
|
||||
color: var(--nix-color-fg) !important;
|
||||
}
|
||||
|
||||
#urlbar {
|
||||
/* Set correct text color */
|
||||
color: var(--nix-color-fg) !important;
|
||||
}
|
||||
|
||||
#urlbar[open]>#urlbar-background {
|
||||
/* Set correct background color when opened */
|
||||
background-color: var(--nix-color-bg) !important;
|
||||
|
||||
/* Use same box-shadow as tabs when opened */
|
||||
border: none !important;
|
||||
box-shadow: 0 0 4px rgba(0, 0, 0, .4) !important;
|
||||
}
|
||||
|
||||
#urlbar[focused]:not([suppress-focus-border])>#urlbar-background {
|
||||
/* Set better outline for focused urlbar */
|
||||
outline-color: var(--nix-color-border-focused) !important;
|
||||
outline-width: 1px !important;
|
||||
outline-offset: 0 !important;
|
||||
}
|
||||
|
||||
#urlbar-background {
|
||||
/* Set the correct background color */
|
||||
background-color: var(--nix-color-bg-status) !important;
|
||||
}
|
||||
|
||||
/* Configure popups */
|
||||
panelview {
|
||||
/* Set correct background color for popups */
|
||||
background-color: var(--nix-color-bg) !important;
|
||||
|
||||
/* Set correct text color */
|
||||
color: var(--nix-color-fg) !important;
|
||||
}
|
||||
|
||||
menupopup {
|
||||
/* Set correct background color for context menus */
|
||||
--panel-background: var(--nix-color-bg) !important;
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,51 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.qutebrowser;
|
||||
theme = config.theming;
|
||||
in
|
||||
{
|
||||
options.modules.qutebrowser = {
|
||||
enable = mkEnableOption "qutebrowser";
|
||||
default = mkEnableOption "default";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
default.browser = mkIf cfg.default "org.qutebrowser.qutebrowser.desktop";
|
||||
|
||||
# TODO: Remove once nixpkgs updates
|
||||
# nixpkgs.config.packageOverrides = pkgs: {
|
||||
# python3 = pkgs.python3.override {
|
||||
# packageOverrides = self: super: {
|
||||
# pykeepass = super.pykeepass.overrideAttrs (attrs: {
|
||||
# version = "4.1.0.post1";
|
||||
# src = pkgs.fetchFromGitHub {
|
||||
# owner = "libkeepass";
|
||||
# repo = "pykeepass";
|
||||
# rev = "refs/tags/v4.1.0.post1";
|
||||
# hash = "sha256-64is/XoRF/kojqd4jQIAQi1od8TRhiv9uR+WNIGvP2A=";
|
||||
# };
|
||||
# });
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
|
||||
programs.qutebrowser = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
config.set("completion.web_history.max_items", 100)
|
||||
config.set("colors.webpage.darkmode.enabled", False)
|
||||
config.set("colors.webpage.preferred_color_scheme", "${if theme.darkMode then "dark" else "light"}")
|
||||
config.set("fonts.default_family", "${theme.fonts.monospace.name}")
|
||||
config.set("fonts.default_size", "${toString theme.fonts.monospace.recommendedSize}pt")
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,368 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.btop;
|
||||
colors = config.theming.schemeColors;
|
||||
in
|
||||
{
|
||||
options.modules.btop = {
|
||||
enable = mkEnableOption "btop";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [ btop ];
|
||||
|
||||
xdg.configFile."btop/btop.conf" = {
|
||||
enable = true;
|
||||
text = ''
|
||||
#? Config file for btop v. 1.4.0
|
||||
|
||||
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
|
||||
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
|
||||
color_theme = "nixos"
|
||||
|
||||
#* If the theme set background should be shown, set to False if you want terminal background transparency.
|
||||
theme_background = True
|
||||
|
||||
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
|
||||
truecolor = True
|
||||
|
||||
#* Set to true to force tty mode regardless if a real tty has been detected or not.
|
||||
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
|
||||
force_tty = False
|
||||
|
||||
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
|
||||
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
|
||||
#* Use whitespace " " as separator between different presets.
|
||||
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
|
||||
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"
|
||||
|
||||
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
|
||||
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
|
||||
vim_keys = False
|
||||
|
||||
#* Rounded corners on boxes, is ignored if TTY mode is ON.
|
||||
rounded_corners = False
|
||||
|
||||
#* Default symbols to use for graph creation, "braille", "block" or "tty".
|
||||
#* "braille" offers the highest resolution but might not be included in all fonts.
|
||||
#* "block" has half the resolution of braille but uses more common characters.
|
||||
#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY.
|
||||
#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view.
|
||||
graph_symbol = "braille"
|
||||
|
||||
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
||||
graph_symbol_cpu = "default"
|
||||
|
||||
# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty".
|
||||
graph_symbol_gpu = "default"
|
||||
|
||||
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
||||
graph_symbol_mem = "default"
|
||||
|
||||
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
||||
graph_symbol_net = "default"
|
||||
|
||||
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
||||
graph_symbol_proc = "default"
|
||||
|
||||
#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace.
|
||||
shown_boxes = "cpu net proc mem"
|
||||
|
||||
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
|
||||
update_ms = 500
|
||||
|
||||
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
|
||||
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
|
||||
proc_sorting = "cpu lazy"
|
||||
|
||||
#* Reverse sorting order, True or False.
|
||||
proc_reversed = False
|
||||
|
||||
#* Show processes as a tree.
|
||||
proc_tree = False
|
||||
|
||||
#* Use the cpu graph colors in the process list.
|
||||
proc_colors = True
|
||||
|
||||
#* Use a darkening gradient in the process list.
|
||||
proc_gradient = True
|
||||
|
||||
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
|
||||
proc_per_core = False
|
||||
|
||||
#* Show process memory as bytes instead of percent.
|
||||
proc_mem_bytes = True
|
||||
|
||||
#* Show cpu graph for each process.
|
||||
proc_cpu_graphs = True
|
||||
|
||||
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
|
||||
proc_info_smaps = False
|
||||
|
||||
#* Show proc box on left side of screen instead of right.
|
||||
proc_left = False
|
||||
|
||||
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
|
||||
proc_filter_kernel = False
|
||||
|
||||
#* In tree-view, always accumulate child process resources in the parent process.
|
||||
proc_aggregate = False
|
||||
|
||||
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
|
||||
#* Select from a list of detected attributes from the options menu.
|
||||
cpu_graph_upper = "Auto"
|
||||
|
||||
#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available.
|
||||
#* Select from a list of detected attributes from the options menu.
|
||||
cpu_graph_lower = "Auto"
|
||||
|
||||
#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off".
|
||||
show_gpu_info = "Auto"
|
||||
|
||||
#* Toggles if the lower CPU graph should be inverted.
|
||||
cpu_invert_lower = True
|
||||
|
||||
#* Set to True to completely disable the lower CPU graph.
|
||||
cpu_single_graph = False
|
||||
|
||||
#* Show cpu box at bottom of screen instead of top.
|
||||
cpu_bottom = False
|
||||
|
||||
#* Shows the system uptime in the CPU box.
|
||||
show_uptime = True
|
||||
|
||||
#* Show cpu temperature.
|
||||
check_temp = True
|
||||
|
||||
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
|
||||
cpu_sensor = "Auto"
|
||||
|
||||
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
|
||||
show_coretemp = True
|
||||
|
||||
#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
|
||||
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
|
||||
#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries.
|
||||
#* Example: "4:0 5:1 6:3"
|
||||
cpu_core_map = ""
|
||||
|
||||
#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine".
|
||||
temp_scale = "celsius"
|
||||
|
||||
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
|
||||
base_10_sizes = False
|
||||
|
||||
#* Show CPU frequency.
|
||||
show_cpu_freq = True
|
||||
|
||||
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
|
||||
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
|
||||
clock_format = "%X"
|
||||
|
||||
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
|
||||
background_update = True
|
||||
|
||||
#* Custom cpu model name, empty string to disable.
|
||||
custom_cpu_name = ""
|
||||
|
||||
#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
|
||||
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
|
||||
disks_filter = ""
|
||||
|
||||
#* Show graphs instead of meters for memory values.
|
||||
mem_graphs = True
|
||||
|
||||
#* Show mem box below net box instead of above.
|
||||
mem_below_net = False
|
||||
|
||||
#* Count ZFS ARC in cached and available memory.
|
||||
zfs_arc_cached = True
|
||||
|
||||
#* If swap memory should be shown in memory box.
|
||||
show_swap = True
|
||||
|
||||
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
|
||||
swap_disk = True
|
||||
|
||||
#* If mem box should be split to also show disks info.
|
||||
show_disks = True
|
||||
|
||||
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
|
||||
only_physical = True
|
||||
|
||||
#* Read disks list from /etc/fstab. This also disables only_physical.
|
||||
use_fstab = True
|
||||
|
||||
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
|
||||
zfs_hide_datasets = False
|
||||
|
||||
#* Set to true to show available disk space for privileged users.
|
||||
disk_free_priv = False
|
||||
|
||||
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
|
||||
show_io_stat = True
|
||||
|
||||
#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
|
||||
io_mode = True
|
||||
|
||||
#* Set to True to show combined read/write io graphs in io mode.
|
||||
io_graph_combined = False
|
||||
|
||||
#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
|
||||
#* Example: "/mnt/media:100 /:20 /boot:1".
|
||||
io_graph_speeds = ""
|
||||
|
||||
#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False.
|
||||
net_download = 100
|
||||
|
||||
net_upload = 100
|
||||
|
||||
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
|
||||
net_auto = True
|
||||
|
||||
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
|
||||
net_sync = True
|
||||
|
||||
#* Starts with the Network Interface specified here.
|
||||
net_iface = ""
|
||||
|
||||
#* Show battery stats in top right if battery is present.
|
||||
show_battery = False
|
||||
|
||||
#* Which battery to use if multiple are present. "Auto" for auto detection.
|
||||
selected_battery = "Auto"
|
||||
|
||||
#* Show power stats of battery next to charge indicator.
|
||||
show_battery_watts = True
|
||||
|
||||
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
|
||||
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
|
||||
log_level = "WARNING"
|
||||
|
||||
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
|
||||
nvml_measure_pcie_speeds = True
|
||||
|
||||
#* Horizontally mirror the GPU graph.
|
||||
gpu_mirror_graph = True
|
||||
|
||||
#* Custom gpu0 model name, empty string to disable.
|
||||
custom_gpu_name0 = ""
|
||||
|
||||
#* Custom gpu1 model name, empty string to disable.
|
||||
custom_gpu_name1 = ""
|
||||
|
||||
#* Custom gpu2 model name, empty string to disable.
|
||||
custom_gpu_name2 = ""
|
||||
|
||||
#* Custom gpu3 model name, empty string to disable.
|
||||
custom_gpu_name3 = ""
|
||||
|
||||
#* Custom gpu4 model name, empty string to disable.
|
||||
custom_gpu_name4 = ""
|
||||
|
||||
#* Custom gpu5 model name, empty string to disable.
|
||||
custom_gpu_name5 = ""
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile."btop/themes/nixos.theme" = {
|
||||
enable = true;
|
||||
text = with colors; ''
|
||||
# Main background, empty for terminal default, need to be empty if you want transparent background
|
||||
theme[main_bg]="#${base00}"
|
||||
|
||||
# Main text color
|
||||
theme[main_fg]="#${base05}"
|
||||
|
||||
# Title color for boxes
|
||||
theme[title]="#${base05}"
|
||||
|
||||
# Highlight color for keyboard shortcuts
|
||||
theme[hi_fg]="#${base0D}"
|
||||
|
||||
# Background color of selected item in processes box
|
||||
theme[selected_bg]="#${base03}"
|
||||
|
||||
# Foreground color of selected item in processes box
|
||||
theme[selected_fg]="#${base0D}"
|
||||
|
||||
# Color of inactive/disabled text
|
||||
theme[inactive_fg]="#8c8fa1"
|
||||
|
||||
# Color of text appearing on top of graphs, i.e uptime and current network graph scaling
|
||||
theme[graph_text]="#${base06}"
|
||||
|
||||
# Background color of the percentage meters
|
||||
theme[meter_bg]="#${base03}"
|
||||
|
||||
# Misc colors for processes box including mini cpu graphs, details memory graph and details status text
|
||||
theme[proc_misc]="#${base06}"
|
||||
|
||||
# CPU, Memory, Network, Proc box outline colors
|
||||
theme[cpu_box]="#${base0E}" #Mauve
|
||||
theme[mem_box]="#${base0B}" #Green
|
||||
theme[net_box]="#e64553" #Maroon
|
||||
theme[proc_box]="#${colors.base0D}" #Blue
|
||||
|
||||
# Box divider line and small boxes line color
|
||||
theme[div_line]="#9ca0b0"
|
||||
|
||||
# Temperature graph color (Green -> Yellow -> Red)
|
||||
theme[temp_start]="#${base0B}"
|
||||
theme[temp_mid]="#${base0A}"
|
||||
theme[temp_end]="#${base08}"
|
||||
|
||||
# CPU graph colors (Teal -> Lavender)
|
||||
theme[cpu_start]="#${base0C}"
|
||||
theme[cpu_mid]="#209fb5"
|
||||
theme[cpu_end]="#${base07}"
|
||||
|
||||
# Mem/Disk free meter (Mauve -> Lavender -> Blue)
|
||||
theme[free_start]="#${base0E}"
|
||||
theme[free_mid]="#${base07}"
|
||||
theme[free_end]="#${base0D}"
|
||||
|
||||
# Mem/Disk cached meter (Sapphire -> Lavender)
|
||||
theme[cached_start]="#209fb5"
|
||||
theme[cached_mid]="#${base0D}"
|
||||
theme[cached_end]="#${base07}"
|
||||
|
||||
# Mem/Disk available meter (Peach -> Red)
|
||||
theme[available_start]="#${base09}"
|
||||
theme[available_mid]="#e64553"
|
||||
theme[available_end]="#${base08}"
|
||||
|
||||
# Mem/Disk used meter (Green -> Sky)
|
||||
theme[used_start]="#${base0B}"
|
||||
theme[used_mid]="#${base0C}"
|
||||
theme[used_end]="#04a5e5"
|
||||
|
||||
# Download graph colors (Peach -> Red)
|
||||
theme[download_start]="#${base09}"
|
||||
theme[download_mid]="#e64553"
|
||||
theme[download_end]="#${base08}"
|
||||
|
||||
# Upload graph colors (Green -> Sky)
|
||||
theme[upload_start]="#${base0B}"
|
||||
theme[upload_mid]="#${base0C}"
|
||||
theme[upload_end]="#04a5e5"
|
||||
|
||||
# Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve)
|
||||
theme[process_start]="#209fb5"
|
||||
theme[process_mid]="#${base07}"
|
||||
theme[process_end]="#${base0E}"
|
||||
'';
|
||||
};
|
||||
|
||||
modules.shell.aliases = {
|
||||
top = "btop";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Import all modules
|
||||
./bluetuith/default.nix
|
||||
./browser/default.nix
|
||||
./btop/default.nix
|
||||
./desktop/default.nix
|
||||
./discord/default.nix
|
||||
./feishin/default.nix
|
||||
./fontconfig/default.nix
|
||||
./git/default.nix
|
||||
./language/cpp.nix
|
||||
./language/haskell.nix
|
||||
./language/js.nix
|
||||
./language/jupyter.nix
|
||||
./language/nix.nix
|
||||
./language/python.nix
|
||||
./language/rust.nix
|
||||
./language/tex.nix
|
||||
./mako/default.nix
|
||||
./neovim/default.nix
|
||||
./obsidian/default.nix
|
||||
./rofi/default.nix
|
||||
./rofi/rofi-rbw.nix
|
||||
./shell/default.nix
|
||||
./shell/bash.nix
|
||||
./shell/fish.nix
|
||||
./spotify/default.nix
|
||||
./steam/default.nix
|
||||
./terminal/default.nix
|
||||
./terminal/foot/default.nix
|
||||
./theming/default.nix
|
||||
./vscode/default.nix
|
||||
./whatsapp/default.nix
|
||||
./winbox/default.nix
|
||||
./zathura/default.nix
|
||||
|
||||
# Import unfree helper
|
||||
../../unfree/default.nix
|
||||
];
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.glpaper;
|
||||
in
|
||||
{
|
||||
options.modules.glpaper = {
|
||||
enable = mkEnableOption "glpaper";
|
||||
shader = mkOption {
|
||||
type = types.path;
|
||||
default = ./shaders/waves.glsl;
|
||||
description = "Shader to use for the background";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { home.packages = [ pkgs.glpaper ]; };
|
||||
}
|
||||
@@ -1,169 +0,0 @@
|
||||
#define zoom 0.900
|
||||
#define tile 0.850
|
||||
#define speed2 0.0
|
||||
|
||||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
|
||||
uniform float time;
|
||||
uniform vec2 resolution;
|
||||
|
||||
#define time3 (time * 0.01)
|
||||
|
||||
#define mouse vec2(sin(time3)/48., cos(time3)/48.)
|
||||
#define iterations 14
|
||||
#define formuparam2 0.79
|
||||
|
||||
#define volsteps 5
|
||||
#define stepsize 0.390
|
||||
|
||||
#define brightness 0.003
|
||||
#define darkmatter 0.400
|
||||
#define distfading 0.560
|
||||
#define saturation 0.800
|
||||
|
||||
#define transverseSpeed zoom*2.0
|
||||
#define cloud 0.11
|
||||
|
||||
float triangle(float x, float a) {
|
||||
float output2 = 2.0 * abs(2.0 * ((x/a) - floor((x/a) + 0.5))) - 1.0;
|
||||
return output2;
|
||||
}
|
||||
|
||||
float field(in vec3 p) {
|
||||
float strength = 7. + .03 * log(1.e-6 + fract(sin(time3) * 4373.11));
|
||||
float accum = 0.;
|
||||
float prev = 0.;
|
||||
float tw = 0.;
|
||||
|
||||
// Replace or uncomment the for-loop as intended in your logic
|
||||
float mag = dot(p, p);
|
||||
p = abs(p) / mag + vec3(-.5, -.8 + 0.1*sin(time3*0.7 + 2.0), -1.1+0.3*cos(time3*0.3));
|
||||
float w = exp(-float(0) / 7.);
|
||||
accum += w * exp(-strength * pow(abs(mag - prev), 2.3));
|
||||
tw += w;
|
||||
prev = mag;
|
||||
|
||||
return max(0., 5. * accum / tw - .7);
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
vec2 uv2 = 2. * gl_FragCoord.xy / vec2(512) - 1.;
|
||||
vec2 uvs = uv2 * vec2(512) / 512.;
|
||||
|
||||
float time2 = time3;
|
||||
float speed = speed2;
|
||||
speed = .01 * cos(time2*0.02 + 3.1415926/4.0);
|
||||
|
||||
float formuparam = formuparam2;
|
||||
|
||||
|
||||
vec2 uv = uvs;
|
||||
|
||||
float a_xz = 0.9;
|
||||
float a_yz = -.6;
|
||||
float a_xy = 0.9 + time3*0.08;
|
||||
|
||||
mat2 rot_xz = mat2(cos(a_xz),sin(a_xz),-sin(a_xz),cos(a_xz));
|
||||
mat2 rot_yz = mat2(cos(a_yz),sin(a_yz),-sin(a_yz),cos(a_yz));
|
||||
mat2 rot_xy = mat2(cos(a_xy),sin(a_xy),-sin(a_xy),cos(a_xy));
|
||||
|
||||
|
||||
float v2 =1.0;
|
||||
vec3 dir=vec3(uv*zoom,1.);
|
||||
vec3 from=vec3(0.0, 0.0,0.0);
|
||||
from.x -= 5.0*(mouse.x-0.5);
|
||||
from.y -= 5.0*(mouse.y-0.5);
|
||||
|
||||
|
||||
vec3 forward = vec3(0.,0.,1.);
|
||||
from.x += transverseSpeed*(1.0)*cos(0.01*time3) + 0.001*time3;
|
||||
from.y += transverseSpeed*(1.0)*sin(0.01*time3) +0.001*time3;
|
||||
from.z += 0.003*time3;
|
||||
|
||||
dir.xy*=rot_xy;
|
||||
forward.xy *= rot_xy;
|
||||
dir.xz*=rot_xz;
|
||||
forward.xz *= rot_xz;
|
||||
dir.yz*= rot_yz;
|
||||
forward.yz *= rot_yz;
|
||||
|
||||
from.xy*=-rot_xy;
|
||||
from.xz*=rot_xz;
|
||||
from.yz*= rot_yz;
|
||||
|
||||
float zooom = (time2-3311.)*speed;
|
||||
from += forward* zooom;
|
||||
float sampleShift = mod( zooom, stepsize );
|
||||
|
||||
float zoffset = -sampleShift;
|
||||
sampleShift /= stepsize;
|
||||
|
||||
|
||||
float s=0.24;
|
||||
float s3 = s + stepsize/2.0;
|
||||
vec3 v=vec3(0.);
|
||||
float t3 = 0.0;
|
||||
|
||||
vec3 backCol2 = vec3(0.);
|
||||
for (int r=0; r<volsteps; r++) {
|
||||
vec3 p2=from+(s+zoffset)*dir;
|
||||
vec3 p3=from+(s3+zoffset)*dir;
|
||||
|
||||
p2 = abs(vec3(tile)-mod(p2,vec3(tile*2.)));
|
||||
p3 = abs(vec3(tile)-mod(p3,vec3(tile*2.)));
|
||||
#ifdef cloud
|
||||
t3 = field(p3);
|
||||
#endif
|
||||
|
||||
float pa,a=pa=0.;
|
||||
for (int i=0; i<iterations; i++) {
|
||||
p2=abs(p2)/dot(p2,p2)-formuparam;
|
||||
|
||||
float D = abs(length(p2)-pa);
|
||||
a += i > 7 ? min( 12., D) : D;
|
||||
pa=length(p2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
a*=a*a;
|
||||
|
||||
float s1 = s+zoffset;
|
||||
|
||||
float fade = pow(distfading,max(0.,float(r)-sampleShift));
|
||||
|
||||
v+=fade;
|
||||
|
||||
|
||||
|
||||
if( r == 0 )
|
||||
fade *= (1. - (sampleShift));
|
||||
|
||||
if( r == volsteps-1 )
|
||||
fade *= sampleShift;
|
||||
v+=vec3(s1,s1*s1,s1*s1*s1*s1)*a*brightness*fade;
|
||||
|
||||
backCol2 += mix(.11, 1., v2) * vec3(1.8 * t3 * t3 * t3, 1.4 * t3 * t3, t3) * fade;
|
||||
|
||||
|
||||
s+=stepsize;
|
||||
s3 += stepsize;
|
||||
}
|
||||
|
||||
v=mix(vec3(length(v)),v,saturation);
|
||||
|
||||
vec4 forCol2 = vec4(v*.01,1.);
|
||||
#ifdef cloud
|
||||
backCol2 *= cloud;
|
||||
#endif
|
||||
backCol2.b *= 1.8;
|
||||
backCol2.r *= 0.05;
|
||||
|
||||
backCol2.b = 0.5*mix(backCol2.g, backCol2.b, 0.8);
|
||||
backCol2.g = 0.0;
|
||||
backCol2.bg = mix(backCol2.gb, backCol2.bg, 0.5*(cos(time3*0.01) + 1.0));
|
||||
gl_FragColor = forCol2 + vec4(backCol2, 1.0);
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
// glslsandbox uniforms
|
||||
uniform float time;
|
||||
uniform vec2 resolution;
|
||||
|
||||
// shadertoy emulation
|
||||
#define iTime time * 0.01 + 10.0
|
||||
#define iResolution resolution
|
||||
#define fragCoord gl_FragCoord
|
||||
#define fragColor gl_FragColor
|
||||
|
||||
float colormap_red(float x) {
|
||||
if (x < 0.0) {
|
||||
return 54.0 / 255.0;
|
||||
} else if (x < 20049.0 / 82979.0) {
|
||||
return (829.79 * x + 54.51) / 255.0;
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
float colormap_green(float x) {
|
||||
if (x < 20049.0 / 82979.0) {
|
||||
return 0.0;
|
||||
} else if (x < 327013.0 / 810990.0) {
|
||||
return (8546482679670.0 / 10875673217.0 * x - 2064961390770.0 / 10875673217.0) / 255.0;
|
||||
} else if (x <= 1.0) {
|
||||
return (103806720.0 / 483977.0 * x + 19607415.0 / 483977.0) / 255.0;
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
float colormap_blue(float x) {
|
||||
if (x < 0.0) {
|
||||
return 54.0 / 255.0;
|
||||
} else if (x < 7249.0 / 82979.0) {
|
||||
return (829.79 * x + 54.51) / 255.0;
|
||||
} else if (x < 20049.0 / 82979.0) {
|
||||
return 127.0 / 255.0;
|
||||
} else if (x < 327013.0 / 810990.0) {
|
||||
return (792.02249341361393720147485376583 * x - 64.364790735602331034989206222672) / 255.0;
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
vec4 colormap(float x) {
|
||||
return vec4(colormap_red(x), colormap_green(x), colormap_blue(x), 1.0);
|
||||
}
|
||||
|
||||
// https://iquilezles.org/articles/warp
|
||||
/*float noise( in vec2 x )
|
||||
{
|
||||
vec2 p = floor(x);
|
||||
vec2 f = fract(x);
|
||||
f = f*f*(3.0-2.0*f);
|
||||
float a = textureLod(iChannel0,(p+vec2(0.5,0.5))/256.0,0.0).x;
|
||||
float b = textureLod(iChannel0,(p+vec2(1.5,0.5))/256.0,0.0).x;
|
||||
float c = textureLod(iChannel0,(p+vec2(0.5,1.5))/256.0,0.0).x;
|
||||
float d = textureLod(iChannel0,(p+vec2(1.5,1.5))/256.0,0.0).x;
|
||||
return mix(mix( a, b,f.x), mix( c, d,f.x),f.y);
|
||||
}*/
|
||||
|
||||
|
||||
float rand(vec2 n) {
|
||||
return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
|
||||
}
|
||||
|
||||
float noise(vec2 p){
|
||||
vec2 ip = floor(p);
|
||||
vec2 u = fract(p);
|
||||
u = u*u*(3.0-2.0*u);
|
||||
|
||||
float res = mix(
|
||||
mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x),
|
||||
mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y);
|
||||
return res*res;
|
||||
}
|
||||
|
||||
const mat2 mtx = mat2( 0.80, 0.60, -0.60, 0.80 );
|
||||
|
||||
float fbm( vec2 p )
|
||||
{
|
||||
float f = 0.0;
|
||||
|
||||
f += 0.500000*noise( p + iTime ); p = mtx*p*2.02;
|
||||
f += 0.031250*noise( p ); p = mtx*p*2.01;
|
||||
f += 0.250000*noise( p ); p = mtx*p*2.03;
|
||||
f += 0.125000*noise( p ); p = mtx*p*2.01;
|
||||
f += 0.062500*noise( p ); p = mtx*p*2.04;
|
||||
f += 0.015625*noise( p + sin(iTime) );
|
||||
|
||||
return f/0.96875;
|
||||
}
|
||||
|
||||
float pattern( in vec2 p )
|
||||
{
|
||||
return fbm( p + fbm( p + fbm( p ) ) );
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 uv = fragCoord.xy/iResolution.x;
|
||||
float shade = pattern(uv);
|
||||
fragColor = vec4(colormap(shade).rgb, shade);
|
||||
}
|
||||
|
||||
/** SHADERDATA
|
||||
{
|
||||
"title": "Base warp fBM",
|
||||
"description": "Noise but Pink",
|
||||
"model": "person"
|
||||
}
|
||||
*/
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
// glslsandbox uniforms
|
||||
uniform float time;
|
||||
uniform vec2 resolution;
|
||||
|
||||
// shadertoy emulation
|
||||
#define iTime time
|
||||
#define iResolution resolution
|
||||
#define fragCoord gl_FragCoord
|
||||
#define fragColor gl_FragColor
|
||||
@@ -1,208 +0,0 @@
|
||||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
|
||||
uniform float time;
|
||||
uniform vec2 resolution;
|
||||
|
||||
#define CHAR_SIZE vec2(6, 7)
|
||||
#define CHAR_SPACING vec2(6, 9)
|
||||
|
||||
vec2 start_pos = vec2(0);
|
||||
vec2 print_pos = vec2(0);
|
||||
vec2 print_pos_pre_move = vec2(0);
|
||||
vec3 text_color = vec3(1);
|
||||
|
||||
/*
|
||||
Top left pixel is the most significant bit.
|
||||
Bottom right pixel is the least significant bit.
|
||||
|
||||
███ |
|
||||
█ █ |
|
||||
█ █ |
|
||||
█ █ |
|
||||
█████ |
|
||||
█ █ |
|
||||
█ █ |
|
||||
|
||||
000000
|
||||
100010
|
||||
100010
|
||||
100010
|
||||
111110
|
||||
100010
|
||||
100010
|
||||
|
||||
011100 (upper 21 bits)
|
||||
100010 -> 011100 100010 100010 100 -> 935188
|
||||
100010
|
||||
100
|
||||
010 (lower 21 bits)
|
||||
111110 -> 010 111110 100010 100010 -> 780450
|
||||
100010
|
||||
100010
|
||||
|
||||
vec2(935188.0,780450.0)
|
||||
*/
|
||||
|
||||
//Text coloring
|
||||
#define HEX(i) text_color = mod(vec3(i / 65536,i / 256,i),vec3(256.0))/255.0;
|
||||
#define RGB(r,g,b) text_color = vec3(r,g,b);
|
||||
|
||||
#define STRWIDTH(c) (c * CHAR_SPACING.x)
|
||||
#define STRHEIGHT(c) (c * CHAR_SPACING.y)
|
||||
#define BEGIN_TEXT(x,y) print_pos = floor(vec2(x,y)); start_pos = floor(vec2(x,y));
|
||||
|
||||
//Automatically generated from the sprite sheet here: http://uzebox.org/wiki/index.php?title=File:Font6x8.png
|
||||
#define _ col+=char(vec2(0.0,0.0),uv);
|
||||
#define _spc col+=char(vec2(0.0,0.0),uv)*text_color;
|
||||
#define _exc col+=char(vec2(276705.0,32776.0),uv)*text_color;
|
||||
#define _quo col+=char(vec2(1797408.0,0.0),uv)*text_color;
|
||||
#define _hsh col+=char(vec2(10738.0,1134484.0),uv)*text_color;
|
||||
#define _dol col+=char(vec2(538883.0,19976.0),uv)*text_color;
|
||||
#define _pct col+=char(vec2(1664033.0,68006.0),uv)*text_color;
|
||||
#define _amp col+=char(vec2(545090.0,174362.0),uv)*text_color;
|
||||
#define _apo col+=char(vec2(798848.0,0.0),uv)*text_color;
|
||||
#define _lbr col+=char(vec2(270466.0,66568.0),uv)*text_color;
|
||||
#define _rbr col+=char(vec2(528449.0,33296.0),uv)*text_color;
|
||||
#define _ast col+=char(vec2(10471.0,1688832.0),uv)*text_color;
|
||||
#define _crs col+=char(vec2(4167.0,1606144.0),uv)*text_color;
|
||||
#define _per col+=char(vec2(0.0,1560.0),uv)*text_color;
|
||||
#define _dsh col+=char(vec2(7.0,1572864.0),uv)*text_color;
|
||||
#define _com col+=char(vec2(0.0,1544.0),uv)*text_color;
|
||||
#define _lsl col+=char(vec2(1057.0,67584.0),uv)*text_color;
|
||||
#define _0 col+=char(vec2(935221.0,731292.0),uv)*text_color;
|
||||
#define _1 col+=char(vec2(274497.0,33308.0),uv)*text_color;
|
||||
#define _2 col+=char(vec2(934929.0,1116222.0),uv)*text_color;
|
||||
#define _3 col+=char(vec2(934931.0,1058972.0),uv)*text_color;
|
||||
#define _4 col+=char(vec2(137380.0,1302788.0),uv)*text_color;
|
||||
#define _5 col+=char(vec2(2048263.0,1058972.0),uv)*text_color;
|
||||
#define _6 col+=char(vec2(401671.0,1190044.0),uv)*text_color;
|
||||
#define _7 col+=char(vec2(2032673.0,66576.0),uv)*text_color;
|
||||
#define _8 col+=char(vec2(935187.0,1190044.0),uv)*text_color;
|
||||
#define _9 col+=char(vec2(935187.0,1581336.0),uv)*text_color;
|
||||
#define _col col+=char(vec2(195.0,1560.0),uv)*text_color;
|
||||
#define _scl col+=char(vec2(195.0,1544.0),uv)*text_color;
|
||||
#define _les col+=char(vec2(135300.0,66052.0),uv)*text_color;
|
||||
#define _equ col+=char(vec2(496.0,3968.0),uv)*text_color;
|
||||
#define _grt col+=char(vec2(528416.0,541200.0),uv)*text_color;
|
||||
#define _que col+=char(vec2(934929.0,1081352.0),uv)*text_color;
|
||||
#define _ats col+=char(vec2(935285.0,714780.0),uv)*text_color;
|
||||
#define _A col+=char(vec2(935188.0,780450.0),uv)*text_color;
|
||||
#define _B col+=char(vec2(1983767.0,1190076.0),uv)*text_color;
|
||||
#define _C col+=char(vec2(935172.0,133276.0),uv)*text_color;
|
||||
#define _D col+=char(vec2(1983764.0,665788.0),uv)*text_color;
|
||||
#define _E col+=char(vec2(2048263.0,1181758.0),uv)*text_color;
|
||||
#define _F col+=char(vec2(2048263.0,1181728.0),uv)*text_color;
|
||||
#define _G col+=char(vec2(935173.0,1714334.0),uv)*text_color;
|
||||
#define _H col+=char(vec2(1131799.0,1714338.0),uv)*text_color;
|
||||
#define _I col+=char(vec2(921665.0,33308.0),uv)*text_color;
|
||||
#define _J col+=char(vec2(66576.0,665756.0),uv)*text_color;
|
||||
#define _K col+=char(vec2(1132870.0,166178.0),uv)*text_color;
|
||||
#define _L col+=char(vec2(1065220.0,133182.0),uv)*text_color;
|
||||
#define _M col+=char(vec2(1142100.0,665762.0),uv)*text_color;
|
||||
#define _N col+=char(vec2(1140052.0,1714338.0),uv)*text_color;
|
||||
#define _O col+=char(vec2(935188.0,665756.0),uv)*text_color;
|
||||
#define _P col+=char(vec2(1983767.0,1181728.0),uv)*text_color;
|
||||
#define _Q col+=char(vec2(935188.0,698650.0),uv)*text_color;
|
||||
#define _R col+=char(vec2(1983767.0,1198242.0),uv)*text_color;
|
||||
#define _S col+=char(vec2(935171.0,1058972.0),uv)*text_color;
|
||||
#define _T col+=char(vec2(2035777.0,33288.0),uv)*text_color;
|
||||
#define _U col+=char(vec2(1131796.0,665756.0),uv)*text_color;
|
||||
#define _V col+=char(vec2(1131796.0,664840.0),uv)*text_color;
|
||||
#define _W col+=char(vec2(1131861.0,699028.0),uv)*text_color;
|
||||
#define _X col+=char(vec2(1131681.0,84130.0),uv)*text_color;
|
||||
#define _Y col+=char(vec2(1131794.0,1081864.0),uv)*text_color;
|
||||
#define _Z col+=char(vec2(1968194.0,133180.0),uv)*text_color;
|
||||
#define _lsb col+=char(vec2(925826.0,66588.0),uv)*text_color;
|
||||
#define _rsl col+=char(vec2(16513.0,16512.0),uv)*text_color;
|
||||
#define _rsb col+=char(vec2(919584.0,1065244.0),uv)*text_color;
|
||||
#define _pow col+=char(vec2(272656.0,0.0),uv)*text_color;
|
||||
#define _usc col+=char(vec2(0.0,62.0),uv)*text_color;
|
||||
#define _a col+=char(vec2(224.0,649374.0),uv)*text_color;
|
||||
#define _b col+=char(vec2(1065444.0,665788.0),uv)*text_color;
|
||||
#define _c col+=char(vec2(228.0,657564.0),uv)*text_color;
|
||||
#define _d col+=char(vec2(66804.0,665758.0),uv)*text_color;
|
||||
#define _e col+=char(vec2(228.0,772124.0),uv)*text_color;
|
||||
#define _f col+=char(vec2(401543.0,1115152.0),uv)*text_color;
|
||||
#define _g col+=char(vec2(244.0,665474.0),uv)*text_color;
|
||||
#define _h col+=char(vec2(1065444.0,665762.0),uv)*text_color;
|
||||
#define _i col+=char(vec2(262209.0,33292.0),uv)*text_color;
|
||||
#define _j col+=char(vec2(131168.0,1066252.0),uv)*text_color;
|
||||
#define _k col+=char(vec2(1065253.0,199204.0),uv)*text_color;
|
||||
#define _l col+=char(vec2(266305.0,33292.0),uv)*text_color;
|
||||
#define _m col+=char(vec2(421.0,698530.0),uv)*text_color;
|
||||
#define _n col+=char(vec2(452.0,1198372.0),uv)*text_color;
|
||||
#define _o col+=char(vec2(228.0,665756.0),uv)*text_color;
|
||||
#define _p col+=char(vec2(484.0,667424.0),uv)*text_color;
|
||||
#define _q col+=char(vec2(244.0,665474.0),uv)*text_color;
|
||||
#define _r col+=char(vec2(354.0,590904.0),uv)*text_color;
|
||||
#define _s col+=char(vec2(228.0,114844.0),uv)*text_color;
|
||||
#define _t col+=char(vec2(8674.0,66824.0),uv)*text_color;
|
||||
#define _u col+=char(vec2(292.0,1198868.0),uv)*text_color;
|
||||
#define _v col+=char(vec2(276.0,664840.0),uv)*text_color;
|
||||
#define _w col+=char(vec2(276.0,700308.0),uv)*text_color;
|
||||
#define _x col+=char(vec2(292.0,1149220.0),uv)*text_color;
|
||||
#define _y col+=char(vec2(292.0,1163824.0),uv)*text_color;
|
||||
#define _z col+=char(vec2(480.0,1148988.0),uv)*text_color;
|
||||
#define _lpa col+=char(vec2(401542.0,66572.0),uv)*text_color;
|
||||
#define _bar col+=char(vec2(266304.0,33288.0),uv)*text_color;
|
||||
#define _rpa col+=char(vec2(788512.0,1589528.0),uv)*text_color;
|
||||
#define _tid col+=char(vec2(675840.0,0.0),uv)*text_color;
|
||||
#define _lar col+=char(vec2(8387.0,1147904.0),uv)*text_color;
|
||||
#define _nl print_pos = start_pos - vec2(0,CHAR_SPACING.y);
|
||||
|
||||
//Extracts bit b from the given number.
|
||||
float extract_bit(float n, float b)
|
||||
{
|
||||
b = clamp(b,-1.0,22.0);
|
||||
return floor(mod(floor(n / pow(2.0,floor(b))),2.0));
|
||||
}
|
||||
|
||||
//Returns the pixel at uv in the given bit-packed sprite.
|
||||
float sprite(vec2 spr, vec2 size, vec2 uv)
|
||||
{
|
||||
uv = floor(uv);
|
||||
float bit = (size.x-uv.x-1.0) + uv.y * size.x;
|
||||
bool bounds = all(greaterThanEqual(uv,vec2(0)))&& all(lessThan(uv,size));
|
||||
return bounds ? extract_bit(spr.x, bit - 21.0) + extract_bit(spr.y, bit) : 0.0;
|
||||
}
|
||||
|
||||
//Prints a character and moves the print position forward by 1 character width.
|
||||
vec3 char(vec2 ch, vec2 uv)
|
||||
{
|
||||
float px = sprite(ch, CHAR_SIZE, uv - print_pos);
|
||||
print_pos.x += CHAR_SPACING.x;
|
||||
print_pos.y += sin(4.*print_pos.x-time*10.);
|
||||
return vec3(px);
|
||||
}
|
||||
|
||||
|
||||
vec3 Text(vec2 uv)
|
||||
{
|
||||
vec3 col = vec3(0.0);
|
||||
|
||||
vec2 center_pos = vec2(resolution.x/2.0 - STRWIDTH(20.0)/2.0,resolution.y/2.0 - STRHEIGHT(1.0)/2.0);
|
||||
|
||||
BEGIN_TEXT(center_pos.x,center_pos.y)
|
||||
HEX(0x00ffFF) _ _ _w _a _t _e _r _ _;
|
||||
BEGIN_TEXT(resolution.x/2.0-STRWIDTH(11.0)/2.0,resolution.y/2.0)
|
||||
print_pos += vec2(cos(time)*96.,sin(time)*96.);
|
||||
|
||||
// RGB(1,0,0) _M RGB(1,.5,0)_o RGB(1,1,0)_v RGB(0,1,0)_i RGB(0,.5,1)_n RGB(0.5,0,1)_g _ RGB(1,0,0)_T RGB(1,.5,0)_e RGB(1,1,0)_x RGB(0,1,0)_t
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
void main( void )
|
||||
{
|
||||
vec2 uv = gl_FragCoord.xy;
|
||||
vec2 duv = floor(gl_FragCoord.xy);
|
||||
|
||||
vec3 pixel = Text(duv);
|
||||
|
||||
vec3 col = pixel*0.9+0.1;
|
||||
col *= (1.-distance(mod(uv,vec2(1.0)),vec2(0.65)))*1.2;
|
||||
|
||||
gl_FragColor = vec4(vec3(col), 1.0);
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
uniform float time;
|
||||
uniform vec2 resolution;
|
||||
|
||||
#define iTime time * 0.05 + 50.0
|
||||
#define iResolution resolution
|
||||
#define fragCoord gl_FragCoord
|
||||
#define fragColor gl_FragColor
|
||||
|
||||
float colormap_red(float x) {
|
||||
if (x < 0.0) {
|
||||
return 54.0 / 255.0;
|
||||
} else if (x < 20049.0 / 82979.0) {
|
||||
return (829.79 * x + 54.51) / 255.0;
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
float colormap_green(float x) {
|
||||
if (x < 20049.0 / 82979.0) {
|
||||
return 0.0;
|
||||
} else if (x < 327013.0 / 810990.0) {
|
||||
return (8546482679670.0 / 10875673217.0 * x - 2064961390770.0 / 10875673217.0) / 255.0;
|
||||
} else if (x <= 1.0) {
|
||||
return (103806720.0 / 483977.0 * x + 19607415.0 / 483977.0) / 255.0;
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
float colormap_blue(float x) {
|
||||
if (x < 0.0) {
|
||||
return 54.0 / 255.0;
|
||||
} else if (x < 7249.0 / 82979.0) {
|
||||
return (829.79 * x + 54.51) / 255.0;
|
||||
} else if (x < 20049.0 / 82979.0) {
|
||||
return 127.0 / 255.0;
|
||||
} else if (x < 327013.0 / 810990.0) {
|
||||
return (792.02249341361393720147485376583 * x - 64.364790735602331034989206222672) / 255.0;
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
vec4 colormap(float x) {
|
||||
return vec4(colormap_red(x), colormap_green(x), colormap_blue(x), 1.0);
|
||||
}
|
||||
|
||||
// https://iquilezles.org/articles/warp
|
||||
/*float noise( in vec2 x )
|
||||
{
|
||||
vec2 p = floor(x);
|
||||
vec2 f = fract(x);
|
||||
f = f*f*(3.0-2.0*f);
|
||||
float a = textureLod(iChannel0,(p+vec2(0.5,0.5))/256.0,0.0).x;
|
||||
float b = textureLod(iChannel0,(p+vec2(1.5,0.5))/256.0,0.0).x;
|
||||
float c = textureLod(iChannel0,(p+vec2(0.5,1.5))/256.0,0.0).x;
|
||||
float d = textureLod(iChannel0,(p+vec2(1.5,1.5))/256.0,0.0).x;
|
||||
return mix(mix( a, b,f.x), mix( c, d,f.x),f.y);
|
||||
}*/
|
||||
|
||||
|
||||
float rand(vec2 n) {
|
||||
return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
|
||||
}
|
||||
|
||||
float noise(vec2 p){
|
||||
vec2 ip = floor(p);
|
||||
vec2 u = fract(p);
|
||||
u = u*u*(3.0-2.0*u);
|
||||
|
||||
float res = mix(
|
||||
mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x),
|
||||
mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y);
|
||||
return res*res;
|
||||
}
|
||||
|
||||
const mat2 mtx = mat2( 0.80, 0.60, -0.60, 0.80 );
|
||||
|
||||
float fbm( vec2 p )
|
||||
{
|
||||
float f = 0.0;
|
||||
|
||||
f += 0.500000*noise( p + iTime ); p = mtx*p*2.02;
|
||||
f += 0.031250*noise( p ); p = mtx*p*2.01;
|
||||
f += 0.250000*noise( p ); p = mtx*p*2.03;
|
||||
f += 0.125000*noise( p ); p = mtx*p*2.01;
|
||||
f += 0.062500*noise( p ); p = mtx*p*2.04;
|
||||
f += 0.015625*noise( p + sin(iTime) );
|
||||
|
||||
return f/0.96875;
|
||||
}
|
||||
|
||||
float pattern( in vec2 p )
|
||||
{
|
||||
return fbm( p + fbm( p + fbm( p ) ) );
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 uv = fragCoord.xy/iResolution.x;
|
||||
float shade = pattern(uv);
|
||||
fragColor = vec4(colormap(shade).rgb, shade);
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.waybar;
|
||||
theme = config.theming;
|
||||
colors = theme.colors;
|
||||
in
|
||||
{
|
||||
options.modules.waybar = {
|
||||
enable = mkEnableOption "waybar";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
pulsemixer
|
||||
playerctl
|
||||
wpa_supplicant_gui # TODO: Move
|
||||
];
|
||||
|
||||
modules.desktop.reloadScript = ''
|
||||
if ${pkgs.procps}/bin/pgrep waybar; then
|
||||
${pkgs.procps}/bin/pkill waybar
|
||||
fi
|
||||
${pkgs.waybar}/bin/waybar &
|
||||
'';
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
spacing = 16;
|
||||
modules-left = [ "river/tags" ];
|
||||
modules-center = [
|
||||
#"river/window"
|
||||
"mpris"
|
||||
];
|
||||
modules-right = [
|
||||
"bluetooth"
|
||||
"network"
|
||||
"pulseaudio"
|
||||
"battery"
|
||||
"clock"
|
||||
];
|
||||
"river/window" = {
|
||||
max-length = 50;
|
||||
};
|
||||
"river/tags" = {
|
||||
tag-labels = [
|
||||
"一"
|
||||
"二"
|
||||
"三"
|
||||
"四"
|
||||
"五"
|
||||
"六"
|
||||
"七"
|
||||
"八"
|
||||
"九"
|
||||
];
|
||||
disable-click = false;
|
||||
};
|
||||
network = {
|
||||
tooltip = false;
|
||||
on-click = "wpa_gui";
|
||||
format-wifi = "直 {essid}"; # Spacing achieved using "Thin Space"
|
||||
format-ethernet = "TODO";
|
||||
format-disconnected = "睊";
|
||||
};
|
||||
pulseaudio = {
|
||||
tooltip = false;
|
||||
format = "{icon} {volume}%"; # Spacing achieved using "Thin Space"
|
||||
#format-muted = "";
|
||||
format-muted = "{icon} --%"; # Spacing achieved using "Thin Space"
|
||||
format-icons = {
|
||||
#headphone = "";
|
||||
#default = [ "" "" ];
|
||||
headphone = "";
|
||||
headphone-muted = "";
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
};
|
||||
battery = {
|
||||
format = "{icon} {capacity}%"; # Spacing achieved using "Thin Space"
|
||||
format-charging = " {capacity}%"; # Spacing achieved using "Thin Space"
|
||||
#format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ];
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
interval = 1;
|
||||
};
|
||||
clock = {
|
||||
#format = " {:%H:%M}";
|
||||
#format = " {:%H:%M}"; # Spacing achieved using "Thin Space"
|
||||
format = "{:%H:%M}";
|
||||
};
|
||||
mpris = {
|
||||
format = "{dynamic}";
|
||||
tooltip-format = "";
|
||||
interval = 1;
|
||||
};
|
||||
bluetooth = {
|
||||
tooltip = false;
|
||||
format = " {status}"; # Spacing achieved using "Thin Space"
|
||||
format-connected = " {device_alias}"; # Spacing achieved using "Thin Space"
|
||||
};
|
||||
};
|
||||
};
|
||||
# TODO: Replace base03 color with named color
|
||||
style = ''
|
||||
window#waybar {
|
||||
color: #${colors.fg};
|
||||
background-color: #${colors.bg};
|
||||
border-style: none none solid none;
|
||||
border-width: ${toString theme.layout.borderSize}px;
|
||||
border-color: #${colors.border-unfocused};
|
||||
font-size: 12px;
|
||||
font-family: "${theme.fonts.monospace.name}";
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin: 0 8px 0 0;
|
||||
}
|
||||
|
||||
#tags button {
|
||||
color: #${theme.schemeColors.base03};
|
||||
padding: 0 5px 1px 5px;
|
||||
border-radius: 0;
|
||||
font-size: 16px;
|
||||
font-family: "wenquanyi bitmap song";
|
||||
}
|
||||
|
||||
#tags button.occupied {
|
||||
color: #${colors.fg};
|
||||
}
|
||||
|
||||
#tags button.focused {
|
||||
color: #${colors.accent};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Import desktop environment modules
|
||||
./background/glpaper/default.nix
|
||||
./bar/waybar.nix
|
||||
./lock-screen/waylock.nix
|
||||
./window-manager/river.nix
|
||||
];
|
||||
|
||||
options.modules.desktop = {
|
||||
wayland = mkEnableOption "wayland";
|
||||
initScript = mkOption {
|
||||
type = types.lines;
|
||||
default = "${pkgs.bash}/bin/bash";
|
||||
description = "Bash script to execute after logging in.";
|
||||
};
|
||||
reloadScript = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = "Shell script to execute after reload/rebuild.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# Ensure desktop related systemd services (xdg) have access to session variables.
|
||||
systemd.user.sessionVariables = config.home.sessionVariables;
|
||||
|
||||
home.packages = optionals cfg.wayland (
|
||||
with pkgs;
|
||||
[
|
||||
wl-clipboard
|
||||
wtype
|
||||
grim
|
||||
slurp
|
||||
]
|
||||
);
|
||||
|
||||
home.activation = {
|
||||
customReloadScript = lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||
''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
''
|
||||
+ cfg.reloadScript
|
||||
);
|
||||
};
|
||||
|
||||
home.file.".initrc" = {
|
||||
enable = true;
|
||||
executable = true;
|
||||
text =
|
||||
''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
|
||||
''
|
||||
+ cfg.initScript;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.waylock;
|
||||
in
|
||||
{
|
||||
options.modules.waylock = {
|
||||
enable = mkEnableOption "waylock";
|
||||
};
|
||||
|
||||
config = {
|
||||
home.packages = mkIf cfg.enable (with pkgs; [ waylock ]);
|
||||
};
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.modules.river;
|
||||
in
|
||||
{
|
||||
options.modules.river.enable = lib.mkEnableOption "river";
|
||||
|
||||
# osConfig = lib.mkIf cfg.enable {
|
||||
# programs.river.enable = true;
|
||||
# };
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Set desktop type to wayland
|
||||
modules.desktop.wayland = true;
|
||||
|
||||
# TODO: Move elsewhere and make keybindings more configurable
|
||||
modules.rofi.enable = true;
|
||||
|
||||
# TODO: Move elsewhere
|
||||
home.packages = with pkgs; [
|
||||
brightnessctl
|
||||
river-filtile
|
||||
# owm
|
||||
];
|
||||
|
||||
# Change desktop to execute river
|
||||
modules.desktop.initScript = ''
|
||||
river
|
||||
'';
|
||||
|
||||
modules.desktop.reloadScript = ''
|
||||
${pkgs.river}/bin/riverctl background-color 0x${config.theming.colors.bg}
|
||||
'';
|
||||
|
||||
# Update background after rebuild
|
||||
# home.activation = {
|
||||
# river = lib.hm.dag.entryBetween [ "reloadSystemd" ] [ "installPackages" ] ''
|
||||
# # Close waybar
|
||||
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill waybar
|
||||
|
||||
# # Kill rivertile
|
||||
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill rivertile
|
||||
|
||||
# # Kill glpaper
|
||||
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill glpaper
|
||||
|
||||
# # Restart river
|
||||
# PATH="${pkgs.river}/bin:${pkgs.systemd}/bin:${pkgs.waybar}/bin:$PATH" $DRY_RUN_CMD ~/.config/river/init
|
||||
# '';
|
||||
# };
|
||||
|
||||
# River setup
|
||||
wayland.windowManager.river = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
settings =
|
||||
let
|
||||
layout = "filtile";
|
||||
layoutOptions = "-outer-padding ${toString config.theming.layout.windowPadding} -view-padding ${toString config.theming.layout.windowPadding}";
|
||||
modes = [
|
||||
"normal"
|
||||
"locked"
|
||||
];
|
||||
tags = [
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
];
|
||||
waylockOptions = "-init-color 0x${colors.bg} -input-color 0x${colors.border-focused} -fail-color 0x${colors.bg}";
|
||||
|
||||
colors = config.theming.colors;
|
||||
|
||||
# Quick pow function
|
||||
pow2 = power: if power != 0 then 2 * (pow2 (power - 1)) else 1;
|
||||
|
||||
# Modifiers
|
||||
main = "Super";
|
||||
ssm = "Super+Shift";
|
||||
sas = "Super+Alt+Shift";
|
||||
sam = "Super+Alt";
|
||||
scm = "Super+Control";
|
||||
scam = "Super+Control+Alt";
|
||||
ssc = "Super+Shift+Control";
|
||||
in
|
||||
{
|
||||
default-layout = "${layout}";
|
||||
set-repeat = "50 300";
|
||||
xcursor-theme = "BreezeX-RosePine-Linux 24";
|
||||
keyboard-layout = "-options \"caps:escape\" us";
|
||||
|
||||
border-width = toString config.theming.layout.borderSize;
|
||||
background-color = "0x${colors.bg}";
|
||||
border-color-focused = "0x${colors.fg}";
|
||||
border-color-unfocused = "0x${colors.border-unfocused}"; # TODO: Change to use named color;
|
||||
border-color-urgent = "0x${colors.fg}";
|
||||
|
||||
spawn = [
|
||||
"\"${layout} ${layoutOptions}\""
|
||||
"waybar" # TODO: Decouple
|
||||
"\"glpaper eDP-1 ${toString config.modules.glpaper.shader}\""
|
||||
];
|
||||
map = (
|
||||
lib.attrsets.recursiveUpdate
|
||||
{
|
||||
normal =
|
||||
{
|
||||
"${main} Q" = "close";
|
||||
"${ssm} E" = "exit";
|
||||
|
||||
# Basic utilities
|
||||
"${main} X " = "spawn \"waylock -fork-on-lock ${waylockOptions}\"";
|
||||
"${ssm} Return" = "spawn foot";
|
||||
"${main} P" = "spawn \"rofi -show drun\"";
|
||||
"${ssm} P" = "spawn rofi-rbw";
|
||||
"${main} S" = "spawn \"grim -g \\\"\\\$(slurp)\\\" ~/Images/Screenshots/\\\$(date +'%s_grim.png')\"";
|
||||
|
||||
# Window focus
|
||||
"${main} J" = "focus-view next";
|
||||
"${main} K" = "focus-view previous";
|
||||
|
||||
# Swap windows
|
||||
"${ssm} J" = "swap next";
|
||||
"${ssm} K" = "swap previous";
|
||||
"${main} Return" = "zoom";
|
||||
|
||||
# Main ratio
|
||||
"${main} H" = "send-layout-cmd ${layout} 'main-ratio -0.05'";
|
||||
"${main} L" = "send-layout-cmd ${layout} 'main-ratio +0.05'";
|
||||
|
||||
# Main count
|
||||
"${ssm} H" = "send-layout-cmd ${layout} 'main-count +1'";
|
||||
"${ssm} L" = "send-layout-cmd ${layout} 'main-count -1'";
|
||||
|
||||
# Tags
|
||||
"${main} 0" = "set-focused-tags ${toString (pow2 32 - 1)}";
|
||||
"${ssm} 0" = "set-view-tags ${toString (pow2 32 - 1)}";
|
||||
|
||||
# Orientation
|
||||
"${main} Up" = "send-layout-cmd ${layout} \"main-location top\"";
|
||||
"${main} Right" = "send-layout-cmd ${layout} \"main-location right\"";
|
||||
"${main} Down" = "send-layout-cmd ${layout} \"main-location bottom\"";
|
||||
"${main} Left" = "send-layout-cmd ${layout} \"main-location left\"";
|
||||
|
||||
# Move floating windows
|
||||
"${sam} H" = "move left 100";
|
||||
"${sam} J" = "move down 100";
|
||||
"${sam} K" = "move up 100";
|
||||
"${sam} L" = "move right 100";
|
||||
|
||||
# Snap floating windows
|
||||
"${scam} H" = "snap left";
|
||||
"${scam} J" = "snap down";
|
||||
"${scam} K" = "snap up";
|
||||
"${scam} L" = "snap right";
|
||||
|
||||
# Resize floating windows
|
||||
"${sas} H" = "resize horizontal -100";
|
||||
"${sas} J" = "resize vertical 100";
|
||||
"${sas} K" = "resize vertical -100";
|
||||
"${sas} L" = "resize horizontal 100";
|
||||
|
||||
# Toggle modes
|
||||
"${main} Space" = "toggle-float";
|
||||
"${main} F" = "toggle-fullscreen";
|
||||
}
|
||||
// builtins.listToAttrs (
|
||||
builtins.concatLists (
|
||||
map (tag: [
|
||||
{
|
||||
name = "${main} ${toString tag}";
|
||||
value = "set-focused-tags ${toString (pow2 (tag - 1))}";
|
||||
}
|
||||
{
|
||||
name = "${ssm} ${toString tag}";
|
||||
value = "set-view-tags ${toString (pow2 (tag - 1))}";
|
||||
}
|
||||
{
|
||||
name = "${scm} ${toString tag}";
|
||||
value = "toggle-focused-tags ${toString (pow2 (tag - 1))}";
|
||||
}
|
||||
{
|
||||
name = "${ssc} ${toString tag}";
|
||||
value = "toggle-view-tags ${toString (pow2 (tag - 1))}";
|
||||
}
|
||||
]) tags
|
||||
)
|
||||
);
|
||||
}
|
||||
(
|
||||
builtins.listToAttrs (
|
||||
map (mode: {
|
||||
name = "${mode}";
|
||||
value = {
|
||||
# Control volume
|
||||
"None XF86AudioRaiseVolume" = "spawn \"pulsemixer --change-volume +5\"";
|
||||
"None XF86AudioLowerVolume" = "spawn \"pulsemixer --change-volume -5\"";
|
||||
"None XF86AudioMute" = "spawn \"pulsemixer --toggle-mute\"";
|
||||
|
||||
# Control brightness
|
||||
"None XF86MonBrightnessUp" = "spawn \"brightnessctl set +5%\"";
|
||||
"None XF86MonBrightnessDown" = "spawn \"brightnessctl set 5%-\"";
|
||||
|
||||
# Control music playback
|
||||
"None XF86Messenger" = "spawn \"playerctl previous\"";
|
||||
"None XF86Go" = "spawn \"playerctl play-pause\"";
|
||||
"None Cancel" = "spawn \"playerctl next\"";
|
||||
};
|
||||
}) modes
|
||||
)
|
||||
)
|
||||
);
|
||||
map-pointer = {
|
||||
normal = {
|
||||
"${main} BTN_LEFT" = "move-view";
|
||||
"${main} BTN_RIGHT" = "resize-view";
|
||||
"${main} BTN_MIDDLE" = "toggle-float";
|
||||
};
|
||||
};
|
||||
input = {
|
||||
"'*'" = {
|
||||
accel-profile = "adaptive";
|
||||
pointer-accel = "0.5";
|
||||
scroll-factor = "0.8";
|
||||
};
|
||||
"'*Synaptics*'" = {
|
||||
natural-scroll = "enabled";
|
||||
};
|
||||
};
|
||||
rule-add = {
|
||||
"-app-id" = {
|
||||
"'bar'" = "csd";
|
||||
"'*'" = "ssd";
|
||||
"'wpa_gui'" = "float";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.discord;
|
||||
in
|
||||
{
|
||||
options.modules.discord = {
|
||||
enable = mkEnableOption "discord";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
modules.unfree.allowedPackages = [ "discord" ];
|
||||
|
||||
home.packages = with pkgs; [ discord ];
|
||||
};
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.feishin;
|
||||
in
|
||||
{
|
||||
options.modules.feishin.enable = mkEnableOption "feishin";
|
||||
|
||||
config = mkIf cfg.enable { home.packages = with pkgs; [ feishin ]; };
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.fontconfig;
|
||||
|
||||
aliasConfig = font: ''
|
||||
<alias>
|
||||
<family>${font.name}</family>
|
||||
|
||||
<prefer>
|
||||
<family>${font.name}</family>
|
||||
${concatStrings (map (font: " <family>${font}</family>\n") font.fallbackFonts)}
|
||||
</prefer>
|
||||
</alias>
|
||||
'';
|
||||
|
||||
configContent = concatStrings (
|
||||
map (font: aliasConfig config.theming.fonts.pkgs.${font}) config.theming.fonts.installed
|
||||
);
|
||||
in
|
||||
{
|
||||
options.modules.fontconfig = {
|
||||
enable = mkEnableOption "fontconfig";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
fonts.fontconfig = {
|
||||
enable = true;
|
||||
|
||||
defaultFonts = {
|
||||
serif = [ config.theming.fonts.serif.name ];
|
||||
sansSerif = [ config.theming.fonts.sansSerif.name ];
|
||||
monospace = [ config.theming.fonts.monospace.name ];
|
||||
emoji = [ config.theming.fonts.emoji.name ];
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".config/fontconfig/conf.d/20-family-fallbacks.conf" = {
|
||||
enable = true;
|
||||
|
||||
# text = ''
|
||||
# <?xml version="1.0"?>
|
||||
# <fontconfig>
|
||||
|
||||
# ${configContent}
|
||||
# </fontconfig>
|
||||
# '';
|
||||
text = ''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
|
||||
<fontconfig>
|
||||
|
||||
${configContent}
|
||||
</fontconfig>
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.rust;
|
||||
in
|
||||
{
|
||||
options.modules.cpp = {
|
||||
enable = mkEnableOption "cpp";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Allow unfree
|
||||
modules.unfree.allowedPackages = [
|
||||
"vscode-extension-ms-vscode-cpptools"
|
||||
# TODO: Remove, it should not be here
|
||||
"android-studio-stable"
|
||||
"android-sdk-cmdline-tools"
|
||||
"android-sdk-tools"
|
||||
];
|
||||
|
||||
# Gitignore additions
|
||||
modules.git.ignores = [
|
||||
".ccls-cache"
|
||||
];
|
||||
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
gnumake
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-vscode.cpptools
|
||||
ms-vscode.cmake-tools
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
# "C_Cpp.clang_format_fallbackStyle" = "{ BasedOnStyle: Google, IndentWidth: 4 }";
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
programs.nixvim = {
|
||||
plugins.lsp.servers.ccls.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.jupyter;
|
||||
in
|
||||
{
|
||||
options.modules.jupyter = {
|
||||
enable = mkEnableOption "jupyter";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [ ];
|
||||
|
||||
modules.python.extraPythonPackages = p: [
|
||||
p.jupyter
|
||||
p.notebook
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-toolsai.jupyter
|
||||
ms-toolsai.jupyter-renderers
|
||||
];
|
||||
|
||||
userSettings = { };
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.rust;
|
||||
in
|
||||
{
|
||||
options.modules.rust = {
|
||||
enable = mkEnableOption "rust";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
rustup
|
||||
# rustc
|
||||
# cargo
|
||||
gcc
|
||||
lldb
|
||||
bacon
|
||||
# rust-analyzer
|
||||
# rustfmt
|
||||
# clippy
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
rust-lang.rust-analyzer
|
||||
vadimcn.vscode-lldb
|
||||
tamasfe.even-better-toml
|
||||
serayuzgur.crates
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"[rust]" = {
|
||||
"editor.inlayHints.enabled" = "off";
|
||||
};
|
||||
"rust-analyzer.check.command" = "clippy";
|
||||
"rust-analyzer.showUnlinkedFileNotification" = false;
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
programs.nixvim = {
|
||||
plugins.rustaceanvim = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.tex;
|
||||
in
|
||||
{
|
||||
options.modules.tex = {
|
||||
enable = mkEnableOption "tex";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
(texlive.combine {
|
||||
inherit (texlive) scheme-full;
|
||||
})
|
||||
];
|
||||
|
||||
# Pygments for minted
|
||||
modules.python.extraPythonPackages = p: [
|
||||
p.pygments
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
|
||||
|
||||
userSettings = {
|
||||
"[tex]" = { };
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
programs.nixvim = {
|
||||
extraConfigVim = ''
|
||||
" Enforce latexmk
|
||||
let g:vimtex_compiler_method = 'latexmk'
|
||||
|
||||
" Set latexmk compilation settings
|
||||
let g:vimtex_compiler_latexmk = {
|
||||
\ 'options': [
|
||||
\ '-shell-escape',
|
||||
\ '-verbose',
|
||||
\ '-file-line-error',
|
||||
\ '-synctex=1',
|
||||
\ '-interaction=nonstopmode',
|
||||
\ ],
|
||||
\}
|
||||
'';
|
||||
|
||||
# Vimtex plugin
|
||||
plugins.vimtex = {
|
||||
enable = true;
|
||||
texlivePackage = null;
|
||||
settings = {
|
||||
view_method = "zathura";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.mako;
|
||||
theme = config.theming;
|
||||
colors = theme.colors;
|
||||
in
|
||||
{
|
||||
options.modules.mako.enable = mkEnableOption "mako";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.mako = {
|
||||
enable = true;
|
||||
anchor = "top-right";
|
||||
defaultTimeout = 5000;
|
||||
backgroundColor = "#${colors.bg}ff";
|
||||
textColor = "#${colors.fg}ff";
|
||||
borderColor = "#${colors.fg}ff";
|
||||
progressColor = "#${colors.accent}ff";
|
||||
borderRadius = 0;
|
||||
borderSize = theme.layout.borderSize;
|
||||
font = "${theme.fonts.monospace.name} ${toString theme.fonts.monospace.recommendedSize}";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.neovim;
|
||||
theme = config.theming;
|
||||
colors = theme.colors;
|
||||
in
|
||||
{
|
||||
options.modules.neovim = {
|
||||
enable = mkEnableOption "neovim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
extraPackages = with pkgs; [ ];
|
||||
|
||||
opts = {
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
|
||||
signcolumn = "yes";
|
||||
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
|
||||
tabstop = 4;
|
||||
shiftwidth = 4;
|
||||
softtabstop = 0;
|
||||
expandtab = true;
|
||||
smarttab = true;
|
||||
|
||||
list = true;
|
||||
listchars = "tab:»┈«,trail:·,extends:→,precedes:←,nbsp:␣";
|
||||
};
|
||||
|
||||
diagnostics = {
|
||||
enable = true;
|
||||
signs = true;
|
||||
underline = true;
|
||||
update_in_insert = true;
|
||||
};
|
||||
|
||||
extraConfigLua = ''
|
||||
vim.fn.sign_define("DiagnosticSignError",
|
||||
{text = "", texthl = "DiagnosticSignError"})
|
||||
vim.fn.sign_define("DiagnosticSignWarn",
|
||||
{text = "", texthl = "DiagnosticSignWarn"})
|
||||
vim.fn.sign_define("DiagnosticSignInfo",
|
||||
{text = "", texthl = "DiagnosticSignInfo"})
|
||||
vim.fn.sign_define("DiagnosticSignHint",
|
||||
{text = "💡", texthl = "DiagnosticSignHint"})
|
||||
'';
|
||||
|
||||
keymaps = [
|
||||
# Save shortcut
|
||||
{
|
||||
action = ":update<CR>";
|
||||
key = "<C-s>";
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = "<C-o>:update<CR>";
|
||||
key = "<C-s>";
|
||||
mode = "i";
|
||||
}
|
||||
|
||||
# Neo tree
|
||||
{
|
||||
action = ":Neotree action=focus reveal toggle<CR>";
|
||||
key = "<leader>n";
|
||||
mode = "n";
|
||||
options.silent = true;
|
||||
}
|
||||
];
|
||||
|
||||
autoCmd = [
|
||||
{
|
||||
desc = "Automatic formatting";
|
||||
event = "BufWritePre";
|
||||
callback = {
|
||||
__raw = ''
|
||||
function()
|
||||
vim.lsp.buf.format {
|
||||
async = false,
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
highlight = {
|
||||
Comment = {
|
||||
italic = true;
|
||||
fg = theme.schemeColors.withHashtag.base03; # TODO: Come up with a good name colors.muted maybe?
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
plugins.lsp = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
#plugins.treesitter = {
|
||||
# enable = true;
|
||||
#};
|
||||
|
||||
plugins.cmp = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
mapping = {
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-e>" = "cmp.mapping.close()";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||||
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
};
|
||||
sources = [
|
||||
{ name = "path"; }
|
||||
{ name = "nvim_lsp"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
plugins.web-devicons = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
plugins.neo-tree = {
|
||||
enable = true;
|
||||
|
||||
closeIfLastWindow = true;
|
||||
window = {
|
||||
width = 30;
|
||||
autoExpandWidth = true;
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
default_component_configs.git_status.symbols = {
|
||||
# Change type
|
||||
added = "+";
|
||||
deleted = "✕";
|
||||
modified = "✦";
|
||||
renamed = "→";
|
||||
|
||||
# Status type
|
||||
untracked = "?";
|
||||
ignored = "▫";
|
||||
unstaged = "□";
|
||||
staged = "■";
|
||||
conflict = "‼";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#plugins.cmp-nvim-lsp.enable = true;
|
||||
|
||||
plugins.gitsigns = {
|
||||
enable = true;
|
||||
settings.current_line_blame = true;
|
||||
};
|
||||
|
||||
#plugins.copilot-vim = {
|
||||
# enable = true;
|
||||
#};
|
||||
|
||||
# plugins.vimtex = {
|
||||
# enable = true;
|
||||
# texlivePackage = null;
|
||||
# settings = {
|
||||
# view_method = "zathura";
|
||||
# };
|
||||
# };
|
||||
};
|
||||
programs.neovim.defaultEditor = true;
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.obsidian;
|
||||
in
|
||||
{
|
||||
options.modules.obsidian = {
|
||||
enable = mkEnableOption "obsidian";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
modules.unfree.allowedPackages = [ "obsidian" ];
|
||||
|
||||
home.packages = with pkgs; [ obsidian ];
|
||||
};
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.rofi;
|
||||
theme = config.theming;
|
||||
colors = theme.colors;
|
||||
in
|
||||
{
|
||||
options.modules.rofi.enable = mkEnableOption "rofi";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
terminal = config.default.terminal;
|
||||
package = pkgs.rofi-wayland;
|
||||
font = "${theme.fonts.monospace.name} ${toString theme.fonts.monospace.recommendedSize}";
|
||||
theme =
|
||||
let
|
||||
inherit (config.lib.formats.rasi) mkLiteral;
|
||||
in
|
||||
{
|
||||
"*" = {
|
||||
background-color = mkLiteral "rgba(0, 0, 0, 0%)";
|
||||
border-color = mkLiteral "#${colors.fg}";
|
||||
text-color = mkLiteral "#${colors.fg}";
|
||||
};
|
||||
mainbox = {
|
||||
background-color = mkLiteral "#${colors.bg}";
|
||||
border = mkLiteral "${toString theme.layout.borderSize}px";
|
||||
};
|
||||
element-text = {
|
||||
highlight = mkLiteral "#${colors.fg-search}";
|
||||
};
|
||||
inputbar = {
|
||||
children = mkLiteral "[textbox-search, entry]";
|
||||
};
|
||||
listview = {
|
||||
padding = mkLiteral "2px 0px";
|
||||
};
|
||||
textbox-search = {
|
||||
expand = false;
|
||||
content = "> ";
|
||||
};
|
||||
"inputbar, message" = {
|
||||
padding = mkLiteral "2px";
|
||||
};
|
||||
element = {
|
||||
padding = mkLiteral "0px 2px";
|
||||
};
|
||||
"element selected" = {
|
||||
background-color = mkLiteral "#${colors.border-unfocused}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.rofi-rbw;
|
||||
in
|
||||
{
|
||||
options.modules.rofi-rbw.enable = mkEnableOption "rofi-rbw";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
modules.rofi.enable = true;
|
||||
|
||||
home.packages = [ pkgs.rofi-rbw ];
|
||||
|
||||
# TODO: Move to separate module and make configurable
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
settings = {
|
||||
base_url = "https://keys.bulthuis.dev";
|
||||
email = "jan@bulthuis.dev";
|
||||
pinentry = pkgs.pinentry;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bash;
|
||||
in
|
||||
{
|
||||
options.modules.bash = {
|
||||
enable = mkEnableOption "bash";
|
||||
};
|
||||
|
||||
config.programs.bash = {
|
||||
enable = cfg.enable;
|
||||
|
||||
shellAliases = config.modules.shell.aliases;
|
||||
};
|
||||
}
|
||||
Loaded 100 of 161 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user