Compare commits

...

274 commits

Author SHA1 Message Date
6a77f5dccc
chore(flake): bump inputs 2024-12-14 17:58:40 +08:00
68fcbdb801
spec(eientei): add minecraft greedycraft instance 2024-12-14 17:47:10 +08:00
681fda20b4
home(gnome): link monitors.xml 2024-11-26 22:42:49 +08:00
426ec123e7
spec(shatter): initial configuration 2024-11-22 04:52:45 +08:00
9068d571b6
flake: bump inputs 2024-11-22 04:48:24 +08:00
6fb6eb40ba
flake: bump inputs 2024-11-14 11:00:55 +08:00
4b866be8d0
flake: bump inputs 2024-11-08 14:54:30 +08:00
911791ed82
flake: bump inputs 2024-10-26 01:33:16 +08:00
8bc4b1b212
flake: bump inputs 2024-10-26 01:14:54 +08:00
b120cf124f
global(zfs): split setup depend on secret mountpoint 2024-10-26 01:02:09 +08:00
5501cb2013
spec(chireiden): enable gnome 2024-10-26 01:01:06 +08:00
a003b2c485
spec(focus): nextcloud 29 -> 30 2024-10-24 15:08:00 +08:00
fd8767339d
spec(eientei): nextcloud 29 -> 30 2024-10-21 22:11:31 +08:00
9cc49198d8
flake: bump inputs 2024-10-21 20:48:13 +08:00
723a2bfeaf
spec(yume): enable android 2024-10-21 20:48:04 +08:00
68c7c97fb7
flake: bump inputs 2024-09-28 16:52:28 +08:00
8d9c48d2b1
home(gnome): intellihide from focused windows 2024-09-19 09:25:48 +08:00
bc3aa28ff3
flake: bump inputs 2024-09-18 19:23:46 +08:00
858caf82b8
spec(hakugyokurou): remove jovian mode 2024-09-13 12:32:12 +08:00
37b218faf3
flake: bump inputs 2024-09-13 12:28:17 +08:00
67d18985f6
home(gnome): update package 2024-09-13 12:14:49 +08:00
66f6d92a40
flake: bump inputs 2024-09-10 22:53:05 +08:00
7b775f79dd
home(gnome): add monitors persist 2024-09-02 22:14:26 +08:00
8e60859b12
home(gnome): add some gnome-specific theming 2024-08-31 21:25:47 +08:00
726fd59717
flake: bump inputs 2024-08-28 22:15:58 +08:00
fd32ee5f98
spec(reimaden): disable unsandboxed minecraft 2024-08-18 13:33:29 +08:00
d62aa6471d
global(io): udisks ignore zvols 2024-08-17 20:08:25 +08:00
075a0c1c18
global(fs): add zfs option 2024-08-17 20:08:02 +08:00
9a1badafdf
spec(reimaden): enable gnome 2024-08-17 20:07:47 +08:00
3cfad7689b
home(gnome): add extensions 2024-08-15 20:50:14 +08:00
92496ee96c
home(gnome): disable d2p multi-monitor 2024-08-15 18:26:59 +08:00
f629a5f45e
flake: bump inputs 2024-08-13 10:10:58 +08:00
40f8cb5d03
home(util): remove persist unnecessary for flatpak 2024-08-07 23:01:06 +08:00
b3e13afbb9
global(flatpak): add var persist 2024-08-07 22:49:43 +08:00
ca2e1a47d9
home(gnome): set power profile toggle 2024-08-04 17:20:50 +08:00
4efcd64030
home(gnome): add more shortcuts 2024-08-04 13:05:00 +08:00
fff02fed26
flake: bump inputs 2024-08-04 12:28:13 +08:00
5b485226f2
spec(hakugyokurou): enable android 2024-08-04 12:27:11 +08:00
7ef869da34
home(gnome): add more shortcuts 2024-08-03 18:02:17 +08:00
956e5d605d
home(gnome): improve gtk3 theme consistency 2024-07-30 18:51:45 +08:00
e8317fa408
home(gnome): add some gnome-specific theming 2024-07-30 18:45:20 +08:00
c453fafc38
home(gnome): move applications to flatpak 2024-07-29 23:44:44 +08:00
803d5dfef7
spec(hakugyokurou): set plymouth scale 2024-07-29 20:01:06 +08:00
1f92eab5e2
home(gnome): disable theme 2024-07-29 19:56:16 +08:00
3dd4201a3e
home(gnome): enable flatpak by default 2024-07-29 15:40:59 +08:00
4e4238fbef
global(flatpak): add portals and persist 2024-07-29 15:40:41 +08:00
65f6c69ec3
spec(hakugyokurou): enable gnome 2024-07-29 14:43:01 +08:00
3b334b3fe7
home(gnome): update gtk theme names 2024-07-29 14:19:20 +08:00
0ecd208b50
flake: bump inputs 2024-07-28 16:06:12 +08:00
c1a216090b
spec(koumakyou): set cursor theme 2024-07-27 23:05:13 +08:00
728d390197
spec(hakugyokurou): correct Xwayland scale value 2024-07-27 23:03:53 +08:00
8270fb3dfe
spec(hakugyokurou): initial configuration 2024-07-27 18:18:35 +08:00
7e4528b539
flake: bump inputs 2024-07-26 15:46:49 +08:00
53ae20ad12
home(catppuccin): enable catppuccin module even without gui 2024-07-21 16:37:39 +08:00
42e61c859b
package(expresslrs-configurator): bump expresslrs-configurator 1.6.1 to 1.7.2 2024-07-21 10:59:09 +08:00
3c08169968
package(photoview): bump photoview 2.3.13 to 2.4.0 2024-07-21 10:54:14 +08:00
e8711b9ad6
spec(chireiden): disable catppuccin for plymouth 2024-07-18 17:36:44 +08:00
d62dbe2f81
home(catppuccin): add i3status colours 2024-07-18 17:36:24 +08:00
7a632f88bc
spec(shinkirou): specialise plasma 2024-07-18 17:06:03 +08:00
e2e2d2327c
flake: bump inputs 2024-07-18 11:01:19 +08:00
ac6e778fe7
global(gpu): enable 32-bit drivers 2024-07-13 21:34:25 +08:00
04dcc1b594
home(catppuccin): fix gtk theme name again 2024-07-13 21:05:28 +08:00
85d651de77
package(tubesync): temporarily allow obsolete dependency 2024-07-12 23:42:33 +08:00
b8085b2f00
home(catppuccin): set qt style 2024-07-12 19:41:43 +08:00
f6d15928f5
flake: bump inputs 2024-07-12 17:10:48 +08:00
ba5b6bb554
spec(yume): enable lanzaboote 2024-07-12 17:10:40 +08:00
ff0045605c
global(gui): add nvidia options 2024-06-24 20:28:49 +08:00
ff4c1c33bf
global(io): switch audio system to pipewire 2024-06-24 18:22:30 +08:00
d6096e7a88
flake: bump inputs 2024-06-24 16:32:20 +08:00
1c1ac1ae34
home(vscode): update vscode color theme 2024-06-24 10:04:43 +08:00
7f63055615
flake: bump inputs 2024-06-24 09:56:37 +08:00
b9dda18e09
home(gui): switch to catppuccin module 2024-06-24 09:56:31 +08:00
aa1a9244db
spec(koumakyou): set max-performance on power disconnect 2024-06-13 08:56:50 +08:00
8248693082
spec(koumakyou): clean up jovian config 2024-06-11 11:53:49 +08:00
69fd18508b
spec(koumakyou): enable jetbrains defaults 2024-06-11 08:24:40 +08:00
a94ffa8e08
spec(koumakyou): add gamemode and enable decky 2024-06-10 17:08:44 +08:00
28f65fde23
flake: bump inputs 2024-06-10 10:11:39 +08:00
d298d246c8
spec(eientei): remove minecraft reverse proxy 2024-06-03 16:03:15 +08:00
9e97ffb3ac
spec(eientei): add minecraft services 2024-06-03 11:05:58 +08:00
276635951a
flake: bump inputs 2024-06-02 23:01:58 +08:00
541cb406fc
global(fs): make syncoid delete target snapshots 2024-06-02 22:19:21 +08:00
4d276825dd
spec(koumakyou): minecraft retain app user 2024-05-31 14:01:32 +08:00
70a10ed565
home(minecraft): make username configurable 2024-05-31 14:00:52 +08:00
931a59b955
home(minecraft): check gui condition in home 2024-05-31 11:20:56 +08:00
9c7ac68ae4
home: crop koishi profile pictures 2024-05-31 11:12:26 +08:00
6ba8f3d21b
home(minecraft): run minecraft under dedicated user 2024-05-31 11:09:20 +08:00
228113a72c
home: improve profile pictures 2024-05-31 11:08:29 +08:00
bb17130b09
package(tubesync): temporarily allow obsolete dependency 2024-05-30 17:21:41 +08:00
242a87bedb
spec(shinkirou): add mouse natural scrolling 2024-05-30 17:19:18 +08:00
11fb5b4921
spec(shinkirou): use plasma by default 2024-05-30 17:18:26 +08:00
573ce0d8e6
flake: bump inputs 2024-05-29 16:10:21 +08:00
94ae33a7a0
flake: bump inputs 2024-05-25 16:03:26 +08:00
d6811693bd
flake: bump inputs 2024-05-22 22:10:13 +08:00
0420878a32
spec(koumakyou): add kodi 2024-05-22 22:10:06 +08:00
7a637dc987
spec(koumakyou): set console font 2024-05-22 21:11:06 +08:00
60084cfedf
home(jetbrains): add go compiler 2024-05-20 09:18:26 +08:00
2924558db7
spec(focus): nextcloud 28 -> 29 2024-05-20 09:01:46 +08:00
893340ae2b
spec(focus): add nextcloud maintenance window 2024-05-20 09:00:57 +08:00
da2fb2a9c9
spec(eientei): add nextcloud maintenance window 2024-05-20 08:59:26 +08:00
f2b4a662c7
spec(eientei): nextcloud 28 -> 29 2024-05-20 08:34:37 +08:00
0941d18dc6
flake: bump inputs 2024-05-18 21:57:57 +08:00
703454fdca
flake: bump inputs 2024-05-14 20:10:30 +08:00
9725a37086
spec(yume): disable autolock 2024-05-14 20:03:10 +08:00
111e14cd2b
spec(koumakyou): disable autolock 2024-05-14 20:02:58 +08:00
33b0f3301a
home: fix profile icon installation 2024-05-14 19:59:29 +08:00
58aa58a078
spec(yume): enable plasma 2024-05-14 17:31:05 +08:00
72fe2723e5
home(plasma): fix wallet persist 2024-05-14 17:29:54 +08:00
f69ede8bc4
spec(koumakyou): allow network management and xwayland scale 2024-05-14 12:14:35 +08:00
82ef5d1848
home(plasma): persist wallet 2024-05-14 12:14:12 +08:00
bdd4df968e
spec(shinkirou): add Xwayland scale 2024-05-14 11:40:47 +08:00
5528b19d44
home(plasma): do not back up gtkrc-2.0 2024-05-14 11:40:32 +08:00
543e37ca95
home(plasma): persist display output config 2024-05-14 11:26:39 +08:00
61a88dff79
spec(shinkirou): configure plasma inputs 2024-05-14 11:21:11 +08:00
b0f6e56835
home(plasma): disable home-manager cursor and unify image 2024-05-14 11:20:51 +08:00
8d01e58cd5
global(io): reduce firewall spam 2024-05-14 10:48:16 +08:00
b5616da21c
spec(shinkirou): enable plasma specialisation 2024-05-14 10:21:10 +08:00
0dfd3bb736
spec(reimaden): enable plasma specialisation 2024-05-14 10:20:58 +08:00
5cc668f93c
home(plasma): add specialise option 2024-05-14 10:20:46 +08:00
1574d0ec2e
home(plasma): set wallpaper 2024-05-13 11:39:48 +08:00
57db46b51f
spec(koumakyou): add plasma session 2024-05-13 09:43:33 +08:00
3bfa43f31b
spec(reimaden): add plasma specialisation 2024-05-13 09:23:43 +08:00
e2bc23bb79
home(plasma): enable home-manager auto replace 2024-05-13 09:16:06 +08:00
ab187ece00
home(gui): set catppuccin iconTheme name 2024-05-13 09:15:41 +08:00
5aa32dd872
flake: bump inputs 2024-05-13 08:56:11 +08:00
f07cbf3deb
home(plasma): add plasma-manager 2024-05-13 08:55:58 +08:00
c6e1dc19e2
home(gui): cleaner defaults 2024-05-13 08:38:38 +08:00
d0ed58da5e
flake: bump inputs 2024-05-11 10:30:26 +08:00
1cecf718b5
home(foot): disable terminal transparency 2024-05-11 10:30:20 +08:00
4c643fe244
spec(koumakyou): boot to gamescope 2024-05-11 00:03:05 +08:00
a60bb467ab
spec(koumakyou): disable decky 2024-05-08 15:22:12 +08:00
503f466b03
flake: bump inputs 2024-05-05 23:13:53 +08:00
9b5df7f4cf
spec(yume): enable jetbrains defaults 2024-05-05 20:52:07 +08:00
2352c82eda
spec(koumakyou): remove steamos cmdline 2024-05-01 01:48:58 +08:00
439365c8d4
flake: bump inputs 2024-04-30 19:50:42 +08:00
397c434015
spec(koumakyou): init 2024-04-29 22:36:32 +08:00
5038964733
spec(reimaden): enable jetbrains defaults 2024-04-28 11:00:10 +08:00
49837d8d32
home(jetbrains): add jetbrains products and directories 2024-04-28 10:58:54 +08:00
0ea405fa8f
flake: bump inputs 2024-04-28 09:36:26 +08:00
c5528719bf
home(util): add jellyfin-media-player 2024-04-22 15:59:18 +08:00
5cf310fbd2
flake: bump inputs 2024-04-22 12:54:50 +08:00
1571575191
spec(reimaden): disable headless due to scaling bugs 2024-04-19 09:27:33 +08:00
1a57ce180b
home(foot): enable terminal transparency 2024-04-19 09:24:37 +08:00
ac9daca0ea
flake: bump inputs 2024-04-19 08:15:03 +08:00
c027c6459f
flake: bump inputs 2024-04-15 10:33:03 +08:00
13c32dcf44
spec(focus): update proxy address 2024-04-11 15:15:55 +08:00
ec79999bec
global(io): add compat to hosts 2024-04-11 14:44:32 +08:00
501be0b107
spec(chireiden): move trackpad workaround to powerManagement 2024-04-11 14:26:48 +08:00
dd247bd85d
fix(eientei): disable vaultwarden registration 2024-04-09 12:17:05 +08:00
565103a656
chore(flake): bump inputs 2024-04-08 22:25:06 +08:00
2bd724cf19
feat(eientei): add webauthn nextcloud app 2024-04-08 11:26:41 +08:00
cd210a1516
feat(focus): add webauthn nextcloud app 2024-04-08 11:25:24 +08:00
d9ff56dadc
fix(auth): float Bitwarden windows 2024-04-08 11:24:37 +08:00
f23a0aa43d
chore(flake): bump inputs 2024-04-04 11:55:17 +08:00
9e58857991
fix(web): add home redirects 2024-04-01 11:00:44 +08:00
2a1b5eb42f
fix(auth): fix allowed_signers file generation 2024-04-01 08:30:50 +08:00
0fb1cd7e63
feat(reimaden): enable headless 2024-04-01 08:27:09 +08:00
33595ac317
feat(headless): add headless module 2024-04-01 08:26:47 +08:00
e541ce8951
fix(auth): add utility port to firewall allow 2024-04-01 08:07:29 +08:00
34f4b4b849
fix(auth): translate key list 2024-03-30 14:09:52 +08:00
9c7a918b1f
fix(io): update redir address 2024-03-30 14:01:48 +08:00
cfdc86aa20
fix(focus): update proxy address 2024-03-29 21:47:16 +08:00
653c87dcf4
fix(gpu): remove i915 from initrd when arc is set 2024-03-29 11:02:13 +08:00
2fe93a3199
feat(io): add netvm to hosts 2024-03-29 10:33:23 +08:00
61e84067f2
feat(io): add net-priv hosts 2024-03-29 10:29:57 +08:00
1cb0e12246
refactor(flake): compact input lines 2024-03-28 08:37:04 +08:00
4ae418e39d
chore: update gitignore 2024-03-28 08:13:19 +08:00
243379f73e
chore(flake): bump inputs 2024-03-28 08:01:16 +08:00
6b74c299bd
chore(tubesync): 0.13.3 -> 0.13.6 2024-03-26 08:57:36 +08:00
0f348a9fae
feat(fs): add ability to customise curl args 2024-03-25 13:15:25 +08:00
2d6e3f944a
feat(focus): enable zfs alerts 2024-03-25 12:46:45 +08:00
5380a6d2e3
feat(eientei): enable zfs alerts 2024-03-25 12:32:01 +08:00
09d9ab05fb
feat(fs): add zfs alerts 2024-03-25 12:31:50 +08:00
ebb41b6a1f
feat: add sedutil 2024-03-25 09:36:56 +08:00
54ddf63ea5
feat(virtualbox): add kvm virtualbox host 2024-03-24 11:10:09 +08:00
dfdddc46e1
fix(tubesync): patch ffmpeg 2024-03-21 17:11:58 +08:00
579f3276e0
fix(tubesync): patch yt-dlp options
These options print newlines as progress.
2024-03-21 09:06:23 +08:00
9d6a74e7fa
chore(flake): bump inputs 2024-03-21 08:30:13 +08:00
449ab039e1
fix(eientei): set zfs_arc_max 2024-03-21 08:14:58 +08:00
b1f0ed6112
feat(eientei): enable vaultwarden 2024-03-19 09:50:08 +08:00
ff3eba7c9d
fix(eientei): fix frigate firewall interface names 2024-03-19 09:05:57 +08:00
79c7daccfd
fix(auth): add ssh ports 2024-03-19 08:56:21 +08:00
d5aa5ac42f
fix(eientei): proxy matrix health endpoint 2024-03-18 11:46:47 +08:00
845873ced6
feat(web): enable uptime-kuma 2024-03-18 11:09:56 +08:00
b7634b24a9
refactor(gyroflow): move package to module 2024-03-18 09:38:16 +08:00
165cdc41ce
fix(tubesync): patch yt-dlp options
These options disable continue.
2024-03-14 18:51:59 +08:00
e9db5fd1ed
fix(eientei): fix photoprism persistence path 2024-03-14 17:41:14 +08:00
aba0f20134
fix(fs): ensure /var/lib/private mode 2024-03-14 17:40:56 +08:00
a12e3b1d94
feat(eientei): enable photoview 2024-03-14 10:47:46 +08:00
796be72e3c
chore(flake): bump inputs 2024-03-14 10:46:52 +08:00
dcf230a546
fix(tubesync): patch yt-dlp options
These new options ensure integrity.
2024-03-14 10:06:54 +08:00
7de7cf0ab1
fix(libvirt): add virtiofsd to environment 2024-03-11 21:39:46 +08:00
2db6789f5d
chore(flake): bump inputs 2024-03-11 15:08:00 +08:00
ab74a05de6
fix(eientei): photoprism update path 2024-03-10 15:04:33 +08:00
173aa0977e
fix(sway): redirect output to file 2024-03-08 19:33:02 +08:00
067db9bb0f
fix(eientei): photoprism switch to vaapi hwaccel 2024-03-07 21:54:15 +08:00
01e8b44ae9
fix(eientei): photoprism remove limits 2024-03-07 08:53:58 +08:00
3c1a31e281
fix(eientei): photoprism use intel hwaccel 2024-03-07 08:49:53 +08:00
d170d40ae4
feat(eientei): enable photoprism 2024-03-07 08:39:56 +08:00
3ffd84ff4c
fix(eientei): disable photoview 2024-03-07 07:58:42 +08:00
835badd15d
fix(gyroflow): add qtwayland 2024-03-06 14:03:08 +08:00
980c04b760
fix(chrome): add ozone wayland variable 2024-03-06 13:48:49 +08:00
cdfd2c0477
fix(shinkirou): scale login screen 2024-03-06 10:26:31 +08:00
83999a3b73
chore(flake): bump inputs 2024-03-06 09:09:06 +08:00
df749a0cdd
feat(eientei): enable photoview 2024-03-05 09:39:03 +08:00
1bd9057a67
feat(chireiden): enable libreoffice 2024-03-05 07:52:44 +08:00
30001135a9
feat(fs): switch default zfs kernel to lts 2024-03-04 21:31:34 +08:00
10f6dc66b3
feat(shinkirou): initial configuration 2024-03-04 21:28:16 +08:00
8dbc49b8e8
feat(photoview): add nixos module 2024-03-04 12:14:05 +08:00
18174df8fe
fix(photoview): install model data, ui build info 2024-03-04 12:07:20 +08:00
2b2a06e98b
feat(photoview): package photoview 2024-03-04 09:26:16 +08:00
0865074af4
chore(flake): bump inputs 2024-03-03 21:37:51 +08:00
81a9301000
feat(focus): enable zfs replication 2024-03-03 15:04:49 +08:00
11b24d43e7
feat(fs): add zfs replication custom ssh port 2024-03-03 15:04:33 +08:00
557b169ed0
chore(flake): bump inputs 2024-03-02 18:20:40 +08:00
bbf5a6a4f3
fix(focus): increase fastcgi read timeout 2024-02-28 08:57:47 +08:00
d4363a4be9
feat(web): about: update link to server spec 2024-02-24 22:09:39 +08:00
e138af419c
build(web): convert to bundlerEnv 2024-02-24 17:19:50 +08:00
e93b65fff5
fix: add test password for koishi in vmVariant 2024-02-24 15:35:03 +08:00
f85bc4780a
chore(flake): bump inputs 2024-02-24 15:08:45 +08:00
fb4903f4a0
fix(tubesync): add tools called by yt-dlp to PATH 2024-02-23 10:45:54 +08:00
7295e83668
fix(tubesync): add worker option 2024-02-22 11:24:59 +08:00
c4f8c093a2
fix(tubesync): remove umask 2024-02-22 00:45:35 +08:00
b8e9eb31b3
feat(eientei): enable tubesync 2024-02-22 00:45:24 +08:00
30c75a44a0
fix(tubesync): allow redis access to run directory 2024-02-22 00:01:25 +08:00
49ba083745
fix(tubesync): create run directory pre-startup 2024-02-21 23:36:27 +08:00
54d7573541
feat(tubesync): add tubesync application and module 2024-02-21 23:25:06 +08:00
a6fb91aa4c
fix: add nixos module imports 2024-02-21 21:53:08 +08:00
bef7d89542
fix(eientei): change replication user 2024-02-19 15:19:22 +08:00
4cd9b0c535
fix(fs): remove replication compress flag 2024-02-19 15:19:11 +08:00
474b8433ea
fix(gui): improve catppuccin terminal visibility 2024-02-19 13:58:55 +08:00
5262080b2b
feat(eientei): enable gpu drivers 2024-02-19 12:55:37 +08:00
93277c7c2b
fix(gpu): add checks for session-specific options 2024-02-19 12:55:23 +08:00
4d54568c62
feat(eientei): add jellyfin packages 2024-02-19 12:36:44 +08:00
15b0695e83
feat(btop): add btop and catppuccin colours 2024-02-18 21:48:47 +08:00
42193845a0
feat(eientei): add jellyfin 2024-02-18 19:08:27 +08:00
902af29943
refactor(eientei): move hass nginx configuration 2024-02-18 18:41:27 +08:00
54746d5b11
feat(focus): enable netdata dashboard 2024-02-18 17:59:23 +08:00
0e91cf41d5
perf(focus): remove grafana dashboard 2024-02-18 17:59:13 +08:00
0993c0a625
feat(netdata): add netdata module and nginx wrapper 2024-02-18 17:36:49 +08:00
7074bf8de9
chore(flake): bump inputs 2024-02-18 12:49:39 +08:00
46099c947e
fix(eientei): add hass deps 2024-02-17 23:52:50 +08:00
cc252a1ea8
fix(incinerator): unlock initrd emergency access 2024-02-15 17:20:28 +08:00
e79e43c513
feat(gui): add catppuccin icons 2024-02-15 12:30:07 +08:00
0cedbe7b87
fix(swayidle): fix idle commands 2024-02-14 16:47:30 +08:00
1bcec42adb
feat(swayidle): set up idle behaviour 2024-02-14 15:38:19 +08:00
54af9c23be
fix(gui): theme mako 2024-02-14 14:47:48 +08:00
839bec39db
fix(gui): fix catppuccin palette 2024-02-14 14:40:48 +08:00
13cae9ba89
fix(swaylock): isolate from sway 2024-02-14 13:04:17 +08:00
816422ebea
feat(sway): switch to swaylock-effects 2024-02-14 12:33:51 +08:00
ec24aaaf1f
feat(reimaden): add platform support kernel module 2024-02-14 03:23:48 +08:00
a6f2a81fc4
feat(gui): add flake background 2024-02-13 11:55:39 +08:00
cda19fc379
fix(sway): set default workspace 2024-02-13 11:26:48 +08:00
c7adeb3e82
chore(flake): bump inputs 2024-02-13 00:42:30 +08:00
8bf875ba64
feat(chireiden): enable vscode 2024-02-12 23:30:56 +08:00
3bbb1fbd83
feat(reimaden): enable vscode 2024-02-12 23:30:11 +08:00
686eae0cdb
feat(vscode): add vscodium and extensions 2024-02-12 23:29:13 +08:00
819e55bba0
feat(gui): theme sway with catppuccin 2024-02-12 19:25:55 +08:00
2367044b4a
feat(gui): add catppuccin gtk and cursor themes 2024-02-12 17:40:58 +08:00
ae25a54553
fix(gpu): greetd settings priority 2024-02-12 17:33:12 +08:00
8ef45fe1b7
feat(koumakyou): enable gnome 2024-02-12 15:18:12 +08:00
971b6f79ab
refactor(gnome): move desktop backgrounds 2024-02-12 15:17:57 +08:00
a67c5090c3
fix: add networkmanager as an adminGroup 2024-02-10 05:48:08 +08:00
31f16868ec
fix(eientei): remove proxy configuration 2024-02-10 05:47:40 +08:00
c454ec7527
feat(eientei): convert to global zfs replication 2024-02-10 01:03:54 +08:00
ce1313f222
fix(fs): fix permission fix 2024-02-10 01:03:36 +08:00
4b5cb04d72
feat(fs): add zfs replication options 2024-02-10 00:57:35 +08:00
abc5cf8910
feat(focus): convert to global split zfs 2024-02-10 00:32:16 +08:00
35ac5ad932
feat(eientei): convert to global split zfs 2024-02-10 00:23:47 +08:00
c0c5dd68ae
fix(fs): add missing fs options 2024-02-10 00:20:43 +08:00
c9b7059f3f
feat(fs): add zfs split store options 2024-02-10 00:16:09 +08:00
8ecb10c72c
chore(flake): bump inputs 2024-02-09 22:25:17 +08:00
fd767921a2
fix(chireiden): add trackpad driver workaround 2024-02-09 22:25:08 +08:00
8eedcbf3c2
feat(eientei): add replication service 2024-02-09 19:48:11 +08:00
054dda07a7
feat: add serial client and mbuffer 2024-02-09 12:40:02 +08:00
134 changed files with 5290 additions and 489 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
result-*
result
repl-result-*

204
flake.lock generated
View file

@ -1,30 +1,33 @@
{
"nodes": {
"catppuccin": {
"locked": {
"lastModified": 1734057772,
"narHash": "sha256-waF/2Y39JXJ4kG3zawmw1J1GxPHopyoOkJKJhfJ7RBs=",
"owner": "catppuccin",
"repo": "nix",
"rev": "20b6328df20ae45752c81311d225fd47cba32483",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nix",
"type": "github"
}
},
"crane": {
"inputs": {
"flake-compat": [
"lanzaboote",
"flake-compat"
],
"flake-utils": [
"lanzaboote",
"flake-utils"
],
"nixpkgs": [
"lanzaboote",
"nixpkgs"
],
"rust-overlay": [
"lanzaboote",
"rust-overlay"
]
},
"locked": {
"lastModified": 1681177078,
"narHash": "sha256-ZNIjBDou2GOabcpctiQykEQVkI8BDwk7TyvlWlI4myE=",
"lastModified": 1717535930,
"narHash": "sha256-1hZ/txnbd/RmiBPNUs7i8UQw2N89uAK3UzrGAWdnFfU=",
"owner": "ipetkov",
"repo": "crane",
"rev": "0c9f468ff00576577d83f5019a66c557ede5acf6",
"rev": "55e7754ec31dac78980c8be45f8a28e80e370946",
"type": "github"
},
"original": {
@ -36,11 +39,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
@ -56,11 +59,11 @@
]
},
"locked": {
"lastModified": 1706830856,
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
@ -77,11 +80,11 @@
]
},
"locked": {
"lastModified": 1680392223,
"narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=",
"lastModified": 1717285511,
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5",
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github"
},
"original": {
@ -95,11 +98,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@ -113,11 +116,11 @@
"systems": "systems_2"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
@ -135,11 +138,11 @@
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
@ -155,11 +158,11 @@
]
},
"locked": {
"lastModified": 1707175763,
"narHash": "sha256-0MKHC6tQ4KEuM5rui6DjKZ/VNiSANB4E+DJ/+wPS1PU=",
"lastModified": 1734093295,
"narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f99eace7c167b8a6a0871849493b1c613d0f1b80",
"rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8",
"type": "github"
},
"original": {
@ -170,11 +173,11 @@
},
"impermanence": {
"locked": {
"lastModified": 1706639736,
"narHash": "sha256-CaG4j9+UwBDfinxxvJMo6yOonSmSo0ZgnbD7aj2Put0=",
"lastModified": 1731242966,
"narHash": "sha256-B3C3JLbGw0FtLSWCjBxU961gLNv+BOOBC6WvstKLYMw=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "cd13c2917eaa68e4c49fea0ff9cada45440d7045",
"rev": "3ed3f0eaae9fcc0a8331e77e9319c8a4abd8a71a",
"type": "github"
},
"original": {
@ -184,6 +187,25 @@
"type": "github"
}
},
"jovian": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1734162608,
"narHash": "sha256-m2AX+3eiVqIK6uO7GbGY7SFnkkYOlR5fQiNI0eRvWOQ=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "31bdf4c7c91204d65afbde01146deee0259a8fb7",
"type": "github"
},
"original": {
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"type": "github"
}
},
"lanzaboote": {
"inputs": {
"crane": "crane",
@ -197,27 +219,49 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1682802423,
"narHash": "sha256-Fb5TeRTdvUlo/5Yi2d+FC8a6KoRLk2h1VE0/peMhWPs=",
"lastModified": 1718178907,
"narHash": "sha256-eSZyrQ9uoPB9iPQ8Y5H7gAmAgAvCw3InStmU3oEjqsE=",
"owner": "nix-community",
"repo": "lanzaboote",
"rev": "64b903ca87d18cef2752c19c098af275c6e51d63",
"rev": "b627ccd97d0159214cee5c7db1412b75e4be6086",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "v0.3.0",
"ref": "v0.4.1",
"repo": "lanzaboote",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"jovian",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729697500,
"narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=",
"owner": "zhaofengli",
"repo": "nix-github-actions",
"rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"ref": "matrix-name",
"repo": "nix-github-actions",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1706913249,
"narHash": "sha256-x3M7iV++CsvRXI1fpyFPduGELUckZEhSv0XWnUopAG8=",
"lastModified": 1733392399,
"narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e92b6015881907e698782c77641aa49298330223",
"rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661",
"type": "github"
},
"original": {
@ -229,30 +273,65 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1678872516,
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
"lastModified": 1710695816,
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1733940404,
"narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"plasma-manager": {
"inputs": {
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733858086,
"narHash": "sha256-h2BDIDKiqgMpA6E+mu0RgMGy3FeM6k+EuJ9xgOQ1+zw=",
"owner": "pjones",
"repo": "plasma-manager",
"rev": "7e2010249529931a3848054d5ff0dbf24675ab68",
"type": "github"
},
"original": {
"owner": "pjones",
"repo": "plasma-manager",
"type": "github"
}
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": [
"lanzaboote",
"flake-compat"
],
"flake-utils": [
"lanzaboote",
"flake-utils"
],
"gitignore": "gitignore",
"nixpkgs": [
"lanzaboote",
@ -261,11 +340,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1681413034,
"narHash": "sha256-/t7OjNQcNkeWeSq/CFLYVBfm+IEnkjoSm9iKvArnUUI=",
"lastModified": 1717664902,
"narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "d3de8f69ca88fb6f8b09e5b598be5ac98d28ede5",
"rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1",
"type": "github"
},
"original": {
@ -276,12 +355,15 @@
},
"root": {
"inputs": {
"catppuccin": "catppuccin",
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"impermanence": "impermanence",
"jovian": "jovian",
"lanzaboote": "lanzaboote",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2",
"plasma-manager": "plasma-manager"
}
},
"rust-overlay": {
@ -296,11 +378,11 @@
]
},
"locked": {
"lastModified": 1682129965,
"narHash": "sha256-1KRPIorEL6pLpJR04FwAqqnt4Tzcm4MqD84yhlD+XSk=",
"lastModified": 1717813066,
"narHash": "sha256-wqbRwq3i7g5EHIui0bIi84mdqZ/It1AXBSLJ5tafD28=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "2c417c0460b788328220120c698630947547ee83",
"rev": "6dc3e45fe4aee36efeed24d64fc68b1f989d5465",
"type": "github"
},
"original": {

View file

@ -3,24 +3,21 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
impermanence.url = "github:nix-community/impermanence/master";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
plasma-manager.url = "github:pjones/plasma-manager";
plasma-manager.inputs.nixpkgs.follows = "nixpkgs";
plasma-manager.inputs.home-manager.follows = "home-manager";
catppuccin.url = "github:catppuccin/nix";
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1";
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.3.0";
inputs.nixpkgs.follows = "nixpkgs";
};
# steamdeck
jovian.url = "github:Jovian-Experiments/Jovian-NixOS";
};
outputs = inputs:

View file

@ -7,6 +7,8 @@
builtins.readDir
(lib.filterAttrs (n: ty: ty == "regular"))
(lib.mapAttrsToList (n: _: builtins.readFile ./pub/${n}))
(foldr (payload: keys: (splitString "\n" payload) ++ keys) [ ])
(foldr (candidate: keys: keys ++ (if candidate == "" then [ ] else [ candidate ])) [ ])
];
in {
options.global.auth = {
@ -15,7 +17,7 @@ in {
enable = mkEnableOption "openssh server";
password = mkEnableOption "password authentication";
publicKeys = mkOption {
type = with types; listOf str;
type = with types; listOf singleLineStr;
default = pub;
description = "list of trusted openssh keys";
};
@ -40,7 +42,7 @@ in {
settings.PasswordAuthentication = cfg.openssh.password;
};
networking.firewall.allowedTCPPorts = [ ] ++
networking.firewall.allowedTCPPorts = [ 1300 ] ++ # utility port
optional (cfg.openssh.enable && (cfg.openssh.port != null)) cfg.openssh.port;
environment.persistence."/nix/persist/fhs".directories = [ ] ++

View file

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHKCA0/6dsdVyLEgzWt8+u5lWVc0o6A3MY4M2Hf2BT8h koishi@hakugyokurou

View file

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINJOoXrfB4D8Vi6HH4E7RqHHIWhPPqEiiOeLRfggW1XZ koishi@koumakyou

View file

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDwV7Z+PDC8ARRj1LxUJlv59gJ3A84LCMMyMSqLtRtuQ koishi@shinkirou

View file

@ -0,0 +1,17 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.flatpak;
in {
options.global.flatpak = {
enable = mkEnableOption "flatpak sandbox";
};
config = mkIf cfg.enable {
services.flatpak.enable = true;
xdg.portal.enable = true;
users.home.persist.directories = [ ".local/share/flatpak" ".var" ];
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/flatpak" ];
};
}

View file

@ -8,8 +8,8 @@ in {
./ext4.nix
./f2fs.nix
./xfs.nix
./zfs.nix
./bcachefs.nix
./zfs
];
options.global.fs = {
@ -90,5 +90,10 @@ in {
inherit (cfg.cryptsetup) allowDiscards bypassWorkqueues;
device = "/dev/disk/by-uuid/${uuid}";
}) cfg.cryptsetup.uuids);
environment.persistence."/nix/persist/fhs".files = [ {
file = "/var/lib/private/mode";
parentDirectory.mode = "0700";
} ];
};
}

View file

@ -1,47 +0,0 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.fs;
in {
# -o ashift=12
# -O encryption=on -O keyformat=passphrase -O keylocation=prompt
# -O compression=on -O mountpoint=none -O xattr=sa -O acltype=posixacl
options.global.fs.zfs = {
persist = mkOption {
type = with types; str;
default = cfg.store;
description = ''
pool for persist dataset
defaults to nix store dataset
'';
};
mountpoints = mkOption {
type = with types; attrsOf str;
description = "zfs dataset mountpoints";
};
externalStore = mkEnableOption "external nix store filesystem";
};
config = mkIf (cfg.type == "zfs") {
fileSystems = (mapAttrs (path: dataset: {
device = "${cfg.zfs.persist}/${dataset}";
fsType = "zfs";
# required by impermanence
neededForBoot = true;
}) cfg.zfs.mountpoints) // {
"/nix" = (if !cfg.zfs.externalStore then
{ device = "${cfg.store}/nix";
fsType = "zfs";
} else
{ inherit (cfg.external) device fsType options; });
};
global.fs.zfs.mountpoints."/nix/persist" = "persist";
services.zfs.trim.enable = true;
services.zfs.autoSnapshot.enable = true;
services.zfs.autoScrub.enable = true;
boot.zfs.devNodes = mkDefault "/dev/disk/by-partuuid";
boot.kernelPackages = mkDefault config.boot.zfs.package.latestCompatibleLinuxPackages;
};
}

122
global/fs/zfs/alert.nix Normal file
View file

@ -0,0 +1,122 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.fs.zfs.alert;
backend = {
text = pkgs.writeShellScript "telegram-text" ''
set -e
source ${cfg.secret}
${pkgs.curl}/bin/curl -sG \
--data-urlencode "chat_id=$CHATID" \
--data-urlencode "text=$ALERT" \
$CURL_EXTRA_ARGS \
"https://api.telegram.org/bot$APIKEY/sendMessage"
'';
image = pkgs.writeShellScript "telegram-image" ''
set -e
source ${cfg.secret}
${pkgs.curl}/bin/curl -sG \
-F "chat_id=$CHATID" \
-F "caption=$ALERT" \
-F "photo=@-" \
$CURL_EXTRA_ARGS \
"https://api.telegram.org/bot$APIKEY/sendPhoto"
'';
};
zedAlert = pkgs.writeShellScript "zed-alert" ''
set -e
export BODY="$(cat)"
# add tag
ALERT="$1 #zfs"
export ALERT
echo -e "$BODY" | \
${pkgs.imagemagick}/bin/convert \
-size 1500x2000 xc:black \
-font "${pkgs.freefont_ttf}/share/fonts/truetype/FreeMono.ttf" \
-pointsize 16 \
-fill white -annotate +15+80 "@-" \
-trim -bordercolor "#000" \
-border 32 +repage \
png:- | \
${backend.image}
'';
mdadmAlert = pkgs.writeShellScript "mdadm-alert" ''
set -e
EVENT="$1"
ARRAY="$2"
DEVICE="$3"
# fallback alert
ALERT="$EVENT | $ARRAY | $DEVICE"
case $EVENT in
DegradedArray)
ALERT="Array $ARRAY is in a degraded state"
;;
DeviceDisappeared)
ALERT="Array $ARRAY disappeared"
;;
Fail)
ALERT="Array $ARRAY encountered failure of component $DEVICE"
;;
FailSpare)
ALERT="Array $ARRAY encountered failure of spare component $DEVICE during rebuild"
;;
MoveSpare)
ALERT="Spare $DEVICE moved to array $ARRAY"
;;
NewArray)
ALERT="Array $ARRAY appeared"
;;
Rebuild??)
ALERT="Array $ARRAY rebuild is now $(echo $EVENT | ${pkgs.sedutil}/bin/sed 's/Rebuild//')% complete"
;;
RebuildFinished)
ALERT="Rebuild of array $ARRAY has concluded"
;;
RebuildStarted)
ALERT="Rebuild of array $ARRAY has started"
;;
SpareActive)
ALERT="Spare $DEVICE activated in array $ARRAY"
;;
SparesMissing)
ALERT="Array $ARRAY missing one or more spares"
;;
TestMessage)
ALERT="Test message generated for array $ARRAY"
;;
esac
# add tag
ALERT="$ALERT #swraid"
export ALERT
exec ${backend.text}
'';
in mkIf (cfg.secret != null) {
services.zfs.zed = mkIf cfg.zed {
settings = {
ZED_EMAIL_ADDR = [ "root" ];
ZED_EMAIL_PROG = toString zedAlert;
ZED_EMAIL_OPTS = "'@SUBJECT@'";
ZED_NOTIFY_INTERVAL_SECS = 3600;
ZED_NOTIFY_VERBOSE = false;
ZED_USE_ENCLOSURE_LEDS = true;
ZED_SCRUB_AFTER_RESILVER = false;
};
};
global.fs.zfs.split.mdProg = mkIf cfg.swraid (toString mdadmAlert);
}

105
global/fs/zfs/default.nix Normal file
View file

@ -0,0 +1,105 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.fs;
in {
imports = [
./alert.nix
./split.nix
./replication.nix
];
# -o ashift=12
# -O encryption=on -O keyformat=passphrase -O keylocation=prompt
# -O compression=on -O mountpoint=none -O xattr=sa -O acltype=posixacl
options.global.fs.zfs = {
alert = {
zed = mkEnableOption "zfs event alerts" // { default = true; };
swraid = mkEnableOption "software raid alerts" // { default = true; };
secret = mkOption {
type = with types; nullOr str;
default = null;
description = "path to alert secrets";
};
};
persist = mkOption {
type = with types; str;
default = cfg.store;
description = ''
pool for persist dataset
defaults to nix store dataset
'';
};
mountpoints = mkOption {
type = with types; attrsOf str;
description = "zfs dataset mountpoints";
};
externalStore = mkEnableOption "external nix store filesystem";
split = {
enable = mkEnableOption "zfs state with split nix store";
mdProg = mkOption {
type = with types; str;
default = "/usr/bin/true";
description = "mdadm PROGRAM config value";
};
secret = mkOption {
type = with types; str;
description = "UUID of secret filesystem";
};
store = mkOption {
type = with types; str;
description = "UUID of store filesystem";
};
};
replication = {
enable = mkEnableOption "zfs replication to remote";
remote = mkOption {
type = with types; str;
description = "remote host as replication destination";
};
port = mkOption {
type = with types; port;
description = "ssh port of replication target";
default = 22;
};
datasets = mkOption {
type = with types; listOf str;
default = [ "persist" "service" "storage" ];
description = "list of filesystems to perform replication for";
};
sendOptions = mkOption {
type = with types; str;
default = "w";
description = "send options for all datasets";
};
};
};
config = mkIf (cfg.type == "zfs") {
fileSystems = (mapAttrs (path: dataset: {
device = "${cfg.zfs.persist}/${dataset}";
fsType = "zfs";
options = [ "zfsutil" ];
# required by impermanence
neededForBoot = true;
}) cfg.zfs.mountpoints) // {
"/nix" = (if !cfg.zfs.externalStore then
{ device = "${cfg.store}/nix";
fsType = "zfs";
} else
{ inherit (cfg.external) device fsType options; });
};
global.fs.zfs.mountpoints."/nix/persist" = "persist";
services.zfs.trim.enable = true;
services.zfs.autoSnapshot.enable = true;
services.zfs.autoScrub.enable = true;
boot.zfs.devNodes = mkDefault "/dev/disk/by-partuuid";
#boot.kernelPackages = mkDefault config.boot.zfs.package.latestCompatibleLinuxPackages;
global.kernel.lts = mkDefault true;
};
}

View file

@ -0,0 +1,30 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.fs.zfs.replication;
in mkIf cfg.enable {
services.syncoid = {
enable = mkDefault true;
interval = mkDefault "daily";
sshKey = mkDefault "/var/lib/syncoid/.ssh/id_ed25519";
commonArgs = [
"--recursive"
"--mbuffer-size=128M"
"--delete-target-snapshots"
"--sshport=${toString cfg.port}"
];
localSourceAllow = mkOptionDefault [ "mount" ];
commands = (lists.foldr (name: commands: commands // {
"${config.global.fs.store}/${name}" = {
inherit (cfg) sendOptions;
target = "${cfg.remote}/${name}";
};
}) { }) cfg.datasets;
};
users.users.syncoid.uid = 82;
users.groups.syncoid.gid = 82;
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/syncoid" ];
}

35
global/fs/zfs/split.nix Normal file
View file

@ -0,0 +1,35 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.fs.zfs.split;
in mkIf cfg.enable {
# unconditionally enable fstrim for xfs and ext4
services.fstrim.enable = mkDefault true;
# enable swraid for split raid1 system array
boot.swraid.enable = mkDefault true;
boot.swraid.mdadmConf = mkDefault ''
PROGRAM ${cfg.mdProg}
'';
# secret filesystem backed by swraid
fileSystems."/nix/var/secret" =
{ device = "/dev/disk/by-uuid/${cfg.secret}";
fsType = "ext4";
options = [ "noatime" ];
neededForBoot = true;
depends = [ "/nix/var" ];
};
# external store backed by swraid
global.fs = {
zfs.externalStore = mkDefault true;
external.device = "/dev/disk/by-uuid/${cfg.store}";
external.fsType = "xfs";
external.options = [ "noatime" ];
};
# import system state pool after encrypted filesystems become available for key loading
boot.initrd.systemd.services."zfs-import-${config.global.fs.store}".after = [ "sysroot-nix-var-secret.mount" "cryptsetup.target" ];
}

View file

@ -29,10 +29,9 @@ in {
};
config = mkIf cfg.enable {
hardware.opengl = {
hardware.graphics = {
enable = true;
driSupport = true;
driSupport32Bit = true;
enable32Bit = true;
# https://nixos.wiki/wiki/Accelerated_Video_Playback
extraPackages = with pkgs; optionals intel [
@ -46,11 +45,14 @@ in {
optional (cfg.type == "nvidia") vulkan-validation-layers;
};
services.xserver.videoDrivers =
services.xserver = mkIf cfg.session {
videoDrivers =
optional nvidia "nvidia" ++
optional (cfg.type == "amdgpu") "amdgpu";
# inhibits default display manager
services.xserver.displayManager.startx.enable = mkDefault true;
displayManager.startx.enable = mkDefault true;
};
hardware.nvidia = mkIf nvidia {
modesetting.enable = true;
@ -72,7 +74,7 @@ in {
# work around broken nvidia hw cursor on wayland
WLR_NO_HARDWARE_CURSORS = mkIf (cfg.type == "nvidia") "1";
# work around wlroots flickering on pure nvidia
WLR_RENDERER = mkIf (cfg.type == "nvidia") "vulkan";
#WLR_RENDERER = mkIf (cfg.type == "nvidia") "vulkan";
};
specialisation.integratedGraphics = mkIf (cfg.type == "prime") {
@ -91,7 +93,7 @@ in {
boot.initrd.kernelModules =
optional amdgpu "amdgpu" ++
optional intel "i915" ++
optional (intel && cfg.arc == null) "i915" ++
optionals nvidia [ "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" ] ++
optional (cfg.arc != null) "vfio-pci";
@ -102,6 +104,8 @@ in {
options vfio-pci ids=${cfg.arc}
'';
boot.kernelParams = optional intel "i915.fastboot=1";
boot.kernelParams =
optional intel "i915.fastboot=1" ++
optionals nvidia [ "nvidia_drm.modeset=1" "nvidia_drm.fbdev=1" ];
};
}

View file

@ -3,18 +3,19 @@
, config
, ... }: with lib; let
cfg = config.global.gpu;
in mkIf (cfg.enable && cfg.session) {
gui = with cfg; enable && session;
in mkIf gui {
programs.regreet = {
enable = mkDefault true;
cageArgs = [ "-s" "-d" "-m" "last" ];
settings = {
background.path = ../../share/54345906_p0.jpg;
background.path = mkDefault ../../share/54345906_p0.jpg;
background.fit = "Fill";
GTK = {
application_prefer_dark_theme = true;
cursor_theme_name = "Bibata-Modern-Classic";
icon_theme_name = "Papirus-Dark";
theme_name = "WhiteSur-Dark";
application_prefer_dark_theme = mkDefault true;
cursor_theme_name = mkDefault "Bibata-Modern-Classic";
icon_theme_name = mkDefault "Papirus-Dark";
theme_name = mkDefault "WhiteSur-Dark";
};
};
};

View file

@ -3,7 +3,8 @@
, config
, ... }: with lib; let
cfg = config.global.gpu;
in mkIf cfg.enable {
gui = with cfg; enable && session;
in mkIf gui {
boot = {
loader.timeout = mkDefault 0;
consoleLogLevel = 0;

View file

@ -13,31 +13,50 @@ in {
};
config = {
services.udev.extraRules = "" + (if cfg.betaflight then ''
services.udev.extraRules = ''
# ignore zvols
KERNEL=="zd*", ENV{UDISKS_IGNORE}="1"
'' + (if cfg.betaflight then ''
# DFU (Internal bootloader for STM32 and AT32 MCUs)
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
'' else "");
networking.networkmanager.enable = mkDefault true;
networking.hosts = {
"10.5.14.0" = [ "codec" ];
"10.5.14.1" = [ "redir" ];
"10.5.14.2" = [ "compat" ];
"192.168.123.1" = [ "netvm" ];
};
networking.firewall.logRefusedConnections = true;
hardware.bluetooth.enable = mkDefault cfg.bluetooth;
hardware.pulseaudio = mkIf cfg.audio {
# rtkit is optional but recommended
security.rtkit.enable = cfg.audio;
services.pipewire = mkIf cfg.audio {
enable = true;
support32Bit = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
#nixpkgs.config.pulseaudio = mkIf cfg.audio;
security.pam.loginLimits = mkIf (!cfg.coredump) (singleton { domain = "*"; item = "core"; type = "hard"; value = "0"; });
systemd.coredump.extraConfig = mkIf (!cfg.coredump) "Storage=none";
environment.persistence."/nix/persist/fhs".directories = [
"/var/log"
"/var/lib/nixos"
"/var/lib/systemd/backlight"
] ++
optional config.networking.networkmanager.enable "/etc/NetworkManager/system-connections" ++
optional cfg.bluetooth "/var/lib/bluetooth" ++
optional cfg.coredump "/var/lib/systemd/coredump";
environment.persistence."/nix/persist/fhs".hideMounts = true;
users.home.persist.directories = [ ] ++
optional cfg.audio ".local/state/wireplumber";
};
}

View file

@ -20,6 +20,8 @@ in {
parallelShutdown = 5;
};
environment.systemPackages = with pkgs; [ virtiofsd ];
# USB redirection requires a setuid wrapper
virtualisation.spiceUSBRedirection.enable = true;

View file

@ -0,0 +1,52 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.netdata;
in {
options.global.netdata = {
enable = mkEnableOption "netdata";
host = mkOption {
type = with types; str;
default = "localhost";
description = "hostname of netdata web interface";
};
addSSL = mkEnableOption "add SSL to netdata proxy";
useACMEHost = mkOption {
type = with types; nullOr str;
default = null;
description = "existing acme host";
};
basicAuthFile = mkOption {
type = with types; nullOr path;
default = "/nix/persist/secret/netdata";
description = "path to passwd file";
};
};
config = mkIf cfg.enable {
services.netdata = {
enable = true;
config = {
global = {
"error log" = "syslog";
"access log" = "none";
"debug log" = "syslog";
};
web."bind to" = "unix:/var/run/netdata/netdata.sock";
};
};
users.users.netdata.uid = 287;
users.groups.netdata.gid = 287;
services.nginx.enable = mkDefault true;
services.nginx.virtualHosts.${cfg.host} = {
inherit (cfg) addSSL useACMEHost basicAuthFile;
locations."/".proxyPass = "http://unix:/var/run/netdata/netdata.sock";
};
users.users.nginx.extraGroups = [ "netdata" ];
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/netdata" ];
};
}

View file

@ -0,0 +1,34 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.virtualbox;
in {
options.global.virtualbox = {
enable = mkEnableOption "virtualbox host (kvm)";
};
config = mkIf cfg.enable {
virtualisation.virtualbox.host = {
enable = true;
enableKvm = true;
enableExtensionPack = true;
enableHardening = false;
addNetworkInterface = false;
};
# allow virtualbox USB passthrough
users.adminGroups = [ "vboxusers" ];
users.home.persist.directories = [
".config/VirtualBox"
];
users.homeModules = [ {
wayland.windowManager.sway.config.window.commands = [
{ criteria.class = "VirtualBox Manager"; command = "floating enable"; }
];
} ];
};
}

View file

@ -17,9 +17,21 @@
# compiled from trusted keys in auth module
ssh.allowedSignersFile = toString (pkgs.writeText
"allowed_signers" (foldr (key: folded:
folded + "koishi@514fpv.one ${key}") ""
folded + "koishi@514fpv.one ${key}\n") ""
config.passthrough.publicKeys));
};
};
};
programs.ssh = {
enable = true;
matchBlocks = {
"edge.514fpv.io".port = 8086;
"sf.514fpv.io".port = 8087;
};
};
wayland.windowManager.sway.config.window.commands = mkIf config.passthrough.gui [
{ criteria.title = "Bitwarden"; command = "floating enable"; }
];
}

13
home/btop/home.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.passthrough.btop;
in mkIf cfg.enable {
programs.btop = {
enable = true;
settings = {
theme_background = false;
};
};
}

17
home/btop/nixos.nix Normal file
View file

@ -0,0 +1,17 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.home.btop;
in {
options.home.btop = {
enable = mkEnableOption "btop" // { default = !config.home.util.minimal; };
};
config = {
users.homeModules = [
# this module passes gyroflow configuration to home-manager
{ passthrough.btop = cfg; }
];
};
}

BIN
home/catppuccin/flake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

62
home/catppuccin/gui.nix Normal file
View file

@ -0,0 +1,62 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.passthrough.catppuccin;
palette = (lib.importJSON "${config.catppuccin.sources.palette}/palette.json").${config.catppuccin.flavor}.colors;
in mkIf cfg.enable {
gtk.theme = { inherit (cfg.gtk) package name; };
qt.style.name = "kvantum";
qt.platformTheme.name = "kvantum";
home.pointerCursor = { inherit (cfg.cursor) package name; };
# sway colour palette override
wayland.windowManager.sway.config = {
colors = {
focused = { border = "$lavender"; background = "$base"; text = "$text"; indicator = "$rosewater"; childBorder = "$lavender"; };
focusedInactive = { border = "$overlay0"; background = "$base"; text = "$text"; indicator = "$rosewater"; childBorder = "$overlay0"; };
unfocused = { border = "$overlay0"; background = "$base"; text = "$text"; indicator = "$rosewater"; childBorder = "$overlay0"; };
urgent = { border = "$peach"; background = "$base"; text = "$peach"; indicator = "$overlay0"; childBorder = "$peach"; };
placeholder = { border = "$overlay0"; background = "$base"; text = "$text"; indicator = "$overlay0"; childBorder = "$overlay0"; };
background = "$base";
};
bars = mkForce [ {
colors = {
background = "$base";
statusline = "$text";
focusedStatusline = "$text";
focusedSeparator = "$base";
focusedWorkspace = { border = "$base"; background = "$base"; text = "$green"; };
activeWorkspace = { border = "$base"; background = "$base"; text = "$blue"; };
inactiveWorkspace = { border = "$base"; background = "$base"; text = "$surface1"; };
urgentWorkspace = { border = "$base"; background = "$base"; text = "$surface1"; };
bindingMode = { border = "$base"; background = "$base"; text = "$surface1"; };
};
mode = "dock";
position = "bottom";
workspaceButtons = true;
workspaceNumbers = true;
statusCommand = "${pkgs.i3status}/bin/i3status";
fonts = {
names = [ "monospace" ];
size = 8.0;
};
trayOutput = "primary";
} ];
output."*".bg = mkForce "${./flake.png} fill";
gaps.inner = 12;
gaps.outer = 5;
# dodge the status bar
gaps.bottom = 0;
};
# i3status colour palette override
programs.i3status.general = with palette; {
color_good = lavender.hex;
color_degraded = yellow.hex;
color_bad = red.hex;
};
}

9
home/catppuccin/home.nix Normal file
View file

@ -0,0 +1,9 @@
{
catppuccin = {
enable = true;
accent = "pink";
flavor = "mocha";
};
imports = [ ./gui.nix ];
}

79
home/catppuccin/nixos.nix Normal file
View file

@ -0,0 +1,79 @@
{ pkgs
, lib
, config
, ... }: with lib; let
gui = with config.global.gpu; enable && session;
cfg = config.home.catppuccin;
in {
options.home.catppuccin = {
enable = mkEnableOption "catppuccin colour scheme" // { default = gui; };
gtk = {
package = mkOption {
type = with types; package;
default = (pkgs.catppuccin-gtk.overrideAttrs {
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "gtk";
rev = "v1.0.3";
fetchSubmodules = true;
hash = "sha256-q5/VcFsm3vNEw55zq/vcM11eo456SYE5TQA3g2VQjGc=";
};
postUnpack = "";
}).override {
accents = [ "pink" ];
size = "compact";
#tweaks = [ "rimless" "black" ];
variant = "mocha";
};
description = "catppuccin gtk theme package";
};
name = mkOption {
type = with types; str;
default = "catppuccin-mocha-pink-compact";
description = "name of catppuccin gtk theme";
};
};
cursor = {
package = mkOption {
type = with types; package;
default = pkgs.catppuccin-cursors.mochaDark;
description = "catppuccin cursor theme package";
};
name = mkOption {
type = with types; str;
default = "catppuccin-mocha-dark-cursors";
description = "name of catppuccin cursor theme";
};
};
};
config = {
users.homeModules = [
# this module passes catppuccin configuration to home-manager
{ passthrough.catppuccin = cfg; }
];
catppuccin.enable = cfg.enable;
# gtk and cursor themes
environment.systemPackages = with cfg; mkIf enable [
gtk.package cursor.package
];
# override greetd theme
programs.regreet = mkIf cfg.enable {
theme = {
inherit (cfg.gtk) name package;
};
cursorTheme = {
inherit (cfg.cursor) name package;
};
settings = {
background.path = ./solid.png;
};
};
};
}

BIN
home/catppuccin/solid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View file

@ -6,4 +6,5 @@
in {
users.home.persist.directories = mkIf gui [ ".config/google-chrome" ];
security.chromiumSuidSandbox.enable = mkIf gui true;
environment.sessionVariables.NIXOS_OZONE_WL = "1";
}

View file

@ -6,5 +6,6 @@
enable = true;
settings.main.term = "xterm-256color";
settings.main.font = "DejaVu Sans Mono:size=11";
#settings.colors.alpha = 0.8;
};
}

View file

@ -3,6 +3,7 @@
, config
, ... }: with lib; let
cfg = config.passthrough.gnome;
bg = ../../../share/54345906_p0.jpg;
in mkIf cfg.enable {
dconf.settings = let
p = "org/gnome";
@ -26,18 +27,18 @@ in mkIf cfg.enable {
"${pd}/background" = {
color-shading-type = "solid";
picture-options = "zoom";
picture-uri = "file://${./catppuccin-nix.png}";
picture-uri-dark = "file://${./catppuccin-nix.png}";
picture-uri = "file://${bg}";
picture-uri-dark = "file://${bg}";
primary-color = "#000000000000";
secondary-color = "#000000000000";
};
"${pd}/interface" = {
color-scheme = "prefer-dark";
cursor-theme = "Catppuccin-Frappe-Dark-Cursors";
cursor-theme = "Bibata-Modern-Classic";
font-antialiasing = "grayscale";
font-hinting = "slight";
gtk-theme = "Catppuccin-Frappe-Compact-Pink-Dark";
gtk-theme = "adw-gtk3-dark";
icon-theme = "Papirus-Dark";
};
@ -45,7 +46,7 @@ in mkIf cfg.enable {
color-shading-type = "solid";
lock-enabled = false;
picture-options = "zoom";
picture-uri = "file://${./catppuccin-nix.png}";
picture-uri = "file://${bg}";
primary-color = "#000000000000";
secondary-color = "#000000000000";
};
@ -53,11 +54,64 @@ in mkIf cfg.enable {
"${pd}/wm/preferences" = {
action-double-click-titlebar = "toggle-maximize";
action-middle-click-titlebar = "minimize";
button-layout = "close,minimize,maximize:appmenu";
button-layout = "close:appmenu";
resize-with-right-button = true;
};
"${pd}/wm/keybindings" = {
panel-run-dialog = [ ];
begin-resize = [ "<Super>r" ];
close = [ "<Shift><Super>q" ];
minimize = [ "<Super>BackSpace" ];
move-to-workspace-1 = [ "<Shift><Super>1" ];
move-to-workspace-2 = [ "<Shift><Super>2" ];
move-to-workspace-3 = [ "<Shift><Super>3" ];
move-to-workspace-4 = [ "<Shift><Super>4" ];
move-to-workspace-left = [ "<Shift><Super>h" ];
move-to-workspace-right = [ "<Shift><Super>l" ];
switch-to-workspace-1 = [ "<Super>1" ];
switch-to-workspace-2 = [ "<Super>2" ];
switch-to-workspace-3 = [ "<Super>3" ];
switch-to-workspace-4 = [ "<Super>4" ];
toggle-maximized = [ "<Super>f" ];
};
"${ps}/keybindings" = {
switch-to-application-1 = [ ];
switch-to-application-2 = [ ];
switch-to-application-3 = [ ];
switch-to-application-4 = [ ];
switch-to-application-5 = [ ];
switch-to-application-6 = [ ];
switch-to-application-7 = [ ];
switch-to-application-8 = [ ];
switch-to-application-9 = [ ];
toggle-application-view = [ "<Super>d" ];
};
"${p}/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/"
];
logout = [ ];
screensaver = [ "<Control><Alt>l" ];
};
"${p}/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Super>Return";
command = "kgx";
name = "Launch console";
};
"${p}/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
binding = "<Super>q";
command = "google-chrome-stable";
name = "Launch Google Chrome";
};
"${ptlp}" = {
default = "71a9971e-e829-43a9-9b2f-4565c855d664";
#default = "95894cfd-82f7-430d-af6e-84d168bc34f5";
list = [
"de8a9081-8352-4ce4-9519-5de655ad9361"
"71a9971e-e829-43a9-9b2f-4565c855d664"
@ -151,41 +205,80 @@ in mkIf cfg.enable {
"windowsNavigator@gnome-shell-extensions.gcampax.github.com"
"window-list@gnome-shell-extensions.gcampax.github.com"
"workspace-indicator@gnome-shell-extensions.gcampax.github.com"
"dash-to-panel@jderose9.github.com"
"dash-to-dock@micxgx.gmail.com"
];
enabled-extensions = [
"user-theme@gnome-shell-extensions.gcampax.github.com"
"apps-menu@gnome-shell-extensions.gcampax.github.com"
"drive-menu@gnome-shell-extensions.gcampax.github.com"
"dash-to-dock@micxgx.gmail.com"
"appindicatorsupport@rgcjonas.gmail.com"
"dash-to-panel@jderose9.github.com"
"caffeine@patapon.info"
"PrivacyMenu@stuarthayhurst"
];
last-selected-power-profile = "performance";
welcome-dialog-last-shown-version = "45.3";
};
"${pse}/user-theme".name = "Catppuccin-Frappe-Compact-Pink-Dark";
#"${pse}/user-theme".name = "catppuccin-mocha-pink-compact";
"${pse}/caffeine" = {
screen-blank = "never";
};
"${pse}/dash-to-dock" = {
background-opacity = 0.80000000000000004;
dash-max-icon-size = 48;
dock-position = "BOTTOM";
height-fraction = 0.90000000000000002;
multi-monitor = true;
multi-monitor = false;
running-indicator-style = "DOTS";
custom-theme-shrink = true;
};
"${pse}/dash-to-panel" = {
animate-appicon-hover-animation-extent = ''{'RIPPLE': 4, 'PLANK': 4, 'SIMPLE': 1}'';
animate-appicon-hover = false;
animate-appicon-hover-animation-type = "SIMPLE";
appicon-margin = 0;
appicon-padding = 4;
appicon-style= "NORMAL";
available-monitors = [ 0 ];
dot-position = "BOTTOM";
dot-style-focused = "METRO";
dot-style-unfocused = "DOTS";
group-apps = true;
hide-overview-on-startup = true;
hotkeys-overlay-combo = "TEMPORARILY";
intellihide = true;
intellihide-behaviour = "FOCUSED_WINDOWS";
intellihide-hide-from-windows = true;
isolate-workspaces = false;
leftbox-padding = -1;
overview-click-to-exit = true;
panel-anchors = ''{"0":"MIDDLE"}'';
panel-lengths=''{"0":100}'';
panel-sizes=''{"0":42}'';
panel-element-positions = ''{"0":[{"element":"showAppsButton","visible":true,"position":"stackedTL"},{"element":"activitiesButton","visible":true,"position":"stackedTL"},{"element":"leftBox","visible":false,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"centerMonitor"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":false,"position":"stackedBR"}]}'';
panel-lengths = ''{"0":100}'';
panel-positions = ''{"0":"BOTTOM"}'';
panel-sizes = ''{"0":42}'';
primary-monitor = 0;
secondarymenu-contains-showdetails = true;
show-showdesktop-hover = true;
status-icon-padding = -1;
trans-use-custom-bg = false;
stockgs-force-hotcorner = false;
stockgs-keep-dash = false;
stockgs-keep-top-panel = false;
stockgs-panelbtn-click-only = false;
trans-bg-color = "#2a2a2a";
trans-dynamic-anim-target = 1.0;
trans-dynamic-behavior = "MAXIMIZED_WINDOWS";
trans-gradient-bottom-color = "#000000";
trans-gradient-bottom-opacity = 0.5;
trans-gradient-top-opacity = 0.0;
trans-panel-opacity = 0.0;
trans-use-custom-bg = true;
trans-use-custom-gradient = true;
trans-use-custom-opacity = true;
trans-use-dynamic-opacity = true;
tray-padding = -1;
window-preview-title-position = "TOP";
};

View file

@ -4,33 +4,29 @@
, ... }: with lib; let
cfg = config.passthrough.gnome;
in mkIf cfg.enable {
# cursor theme
home.pointerCursor = {
package = pkgs.catppuccin-cursors.frappeDark;
name = "Catppuccin-Frappe-Dark-Cursors";
};
# gtk theme
gtk.theme = {
package = pkgs.catppuccin-gtk.override {
accents = [ "pink" ];
size = "compact";
#tweaks = [ "rimless" "black" ];
variant = "frappe";
};
name = "Catppuccin-Frappe-Compact-Pink-Dark";
};
home.packages =
with pkgs;
with gnome;
with gnomeExtensions; [
# gnome
gnome-terminal
# gtk3 theme
adw-gtk3
# gnomeExtensions
caffeine
dash-to-panel
dash-to-dock
appindicator
privacy-settings-menu
];
catppuccin.enable = mkForce false;
home.pointerCursor = mkForce null;
gtk.enable = false;
home.persistence."/nix/persist/home/${config.home.username}" = {
removePrefixDirectory = true;
files = [
(if config.specialisation != {} then "gnome/.config/monitors.xml" else "extern/.config/monitors.xml")
];
};
}

View file

@ -4,13 +4,46 @@
, ... }: with lib; let
cfg = config.home.gnome;
in mkIf cfg.enable {
global.flatpak.enable = mkDefault true;
home.catppuccin.enable = mkDefault false;
catppuccin.enable = false;
programs.regreet.enable = false;
services.xserver.enable = true;
services.xserver.displayManager.startx.enable = false;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
services.udev.packages = with pkgs; [ gnome-settings-daemon ];
services.hardware.bolt.enable = true;
xdg.portal.configPackages = with pkgs; [ gnome-session ];
hardware.pulseaudio.enable = false;
users.home.persist.directories = [ ];
environment.persistence."/nix/persist/fhs".directories = [ ];
environment.gnome.excludePackages = (with pkgs; [
snapshot
gnome-tour
] ++ optionals config.global.flatpak.enable [
baobab
simple-scan
evince
file-roller
geary
loupe
seahorse
totem
epiphany
gnome-calculator
gnome-calendar
gnome-connections
gnome-font-viewer
gnome-text-editor
gnome-characters
gnome-clocks
gnome-contacts
gnome-logs
gnome-maps
gnome-music
gnome-weather
]) ++ (with pkgs.gnome; [ ] ++ optionals config.global.flatpak.enable [
]);
users.home.persist.directories = [ ".config/dconf" ];
}

View file

@ -13,7 +13,7 @@ in {
config = {
users.homeModules = [
# this module passes gnome configuration to home-manager
{ passthrough.gnome= cfg; }
{ passthrough.gnome = cfg; }
];
specialisation.nognome = with cfg; mkIf enable {

View file

@ -1,29 +1,35 @@
{ pkgs
, lib
, config
, ... }: with lib; mkIf config.passthrough.gui {
, ... }: with lib; let
catppuccin = config.passthrough.catppuccin.enable;
in {
config = mkIf config.passthrough.gui {
# cursor theme
home.pointerCursor = {
package = mkDefault pkgs.bibata-cursors;
name = mkDefault "Bibata-Modern-Classic";
size = 24;
x11.enable = true;
gtk.enable = true;
};
# gtk theme
gtk.theme = {
package = mkDefault pkgs.whitesur-gtk-theme;
name = mkDefault "WhiteSur-Dark";
gtk.theme = mkDefault {
package = pkgs.whitesur-gtk-theme;
name = "WhiteSur-Dark";
};
# gtk icons
gtk.iconTheme = {
package = mkDefault pkgs.papirus-icon-theme;
name = mkDefault "Papirus-Dark";
gtk.iconTheme = mkDefault {
package = pkgs.papirus-icon-theme;
name = "Papirus-Dark";
};
# unify qt theme
qt.platformTheme = mkDefault "gtk";
qt.platformTheme.name = mkDefault "gtk";
gtk.enable = mkDefault true;
qt.enable = mkDefault true;
};
}

View file

@ -3,6 +3,7 @@
, config
, ... }: with lib; let
gui = with config.global.gpu; enable && session;
catppuccin = config.home.catppuccin;
in {
config = {
users.homeModules = [
@ -12,10 +13,13 @@ in {
users.adminGroups = mkIf gui [ "video" ];
# themes and icons
environment.systemPackages = with pkgs; mkIf gui [
whitesur-gtk-theme whitesur-icon-theme
papirus-icon-theme bibata-cursors
];
environment.systemPackages = with pkgs; mkIf gui ([
papirus-icon-theme
] ++ optionals (!catppuccin.enable) [
whitesur-gtk-theme
whitesur-icon-theme
bibata-cursors
]);
fonts.enableDefaultPackages = mkIf gui true;
@ -26,7 +30,7 @@ in {
dconf.enable = true;
};
services = mkIf gui {
blueman.enable = true;
blueman.enable = !config.global.flatpak.enable;
};
};
}

View file

@ -4,5 +4,10 @@
, ... }: with lib; let
cfg = config.passthrough.gyroflow;
in mkIf cfg.enable {
home.packages = with pkgs; [ gyroflow ];
# temporarily gone until regression is fixed
#home.packages = [ cfg.package ];
wayland.windowManager.sway.config.window.commands = [
{ criteria.app_id = "xyz.gyroflow.gyroflow"; command = "floating enable"; }
];
}

View file

@ -6,6 +6,13 @@
in {
options.home.gyroflow = {
enable = mkEnableOption "gyroflow stabilisation software";
package = mkOption {
type = with types; package;
default = pkgs.gyroflow.overrideAttrs (finalAttrs: previousAttrs: {
buildInputs = previousAttrs.buildInputs ++ [ pkgs.qt6Packages.qtwayland ];
});
description = "gyroflow package";
};
};
config = {

24
home/headless/home.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.passthrough.headless;
in mkIf (cfg.enable != null) {
wayland.windowManager.sway.config = {
output = {
${cfg.enable}.pos = "0 0";
HEADLESS-1 = cfg.output;
};
startup = [ { command = "swaymsg create_output && swaymsg output HEADLESS-1 disable"; } ];
};
home.packages = [ (pkgs.writeShellScriptBin "headless" ''
swaymsg output HEADLESS-1 enable
${pkgs.wayvnc}/bin/wayvnc \
--output=HEADLESS-1 \
${cfg.extraArgs} \
${cfg.host} ${toString cfg.port}
swaymsg output HEADLESS-1 disable
'') ];
}

51
home/headless/nixos.nix Normal file
View file

@ -0,0 +1,51 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.home.headless;
in {
options.home.headless = {
enable = mkOption {
type = with types; nullOr str;
default = null;
description = "a headless, remotely viewed sway display";
};
output = mkOption {
type = with types; attrsOf str;
default = {
# pixel tablet
mode = "2560x1600";
scale = "2";
pos = "1920 0";
};
description = "headless display configuration";
};
host = mkOption {
type = with types; str;
default = "0.0.0.0";
description = "wayvnc listen host";
};
port = mkOption {
type = with types; port;
# utility port
default = 1300;
description = "wayvnc listen port";
};
extraArgs = mkOption {
type = with types; str;
default = "--max-fps=60";
description = "extra wayvnc args";
};
};
config = {
users.homeModules = [
# this module passes headless configuration to home-manager
{ passthrough.headless = cfg; }
];
};
}

11
home/jetbrains/home.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.passthrough.jetbrains;
in mkIf cfg.enable {
home.packages = with pkgs.jetbrains; [ pkgs.go ] ++
optional cfg.idea idea-community ++
optional cfg.clion clion ++
optional cfg.goland goland;
}

27
home/jetbrains/nixos.nix Normal file
View file

@ -0,0 +1,27 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.home.jetbrains;
in {
options.home.jetbrains = {
enable = mkEnableOption "jetbrains text editor";
idea = mkEnableOption "intellij idea";
clion = mkEnableOption "clion ide";
goland = mkEnableOption "goland ide" // { default = true; };
};
config = {
users.homeModules = [
# this module passes jetbrains configuration to home-manager
{ passthrough.jetbrains = cfg; }
];
users.home.persist.directories = mkIf cfg.enable [
"go"
".java/.userPrefs"
".config/JetBrains"
".local/share/JetBrains"
];
};
}

View file

@ -2,15 +2,15 @@
, lib
, config
, ... }: with lib; let
inherit (config.passthrough) gui;
cfg = config.passthrough.minecraft;
enable = cfg.enable && (cfg.allUsers || (config.home.username == "app"));
enable = cfg.enable && config.home.username == cfg.user;
in mkIf enable {
home.packages = with pkgs; [
prismlauncher
jdk8
];
] ++ optional gui prismlauncher;
wayland.windowManager.sway.config.window.commands = [
wayland.windowManager.sway.config.window.commands = mkIf gui [
{ criteria.app_id = "org.prismlauncher.PrismLauncher"; command = "floating enable"; }
];
}

View file

@ -3,11 +3,15 @@
, config
, ... }: with lib; let
cfg = config.home.minecraft;
persist = [ ".local/share/PrismLauncher" ];
gui = with config.global.gpu; enable && session;
in {
options.home.minecraft = {
enable = mkEnableOption "minecraft game launcher and jvm";
allUsers = mkEnableOption "set up for all users";
user = mkOption {
type = with types; str;
default = "minecraft";
description = "username which minecraft game client runs under";
};
};
config = {
@ -16,7 +20,14 @@ in {
{ passthrough.minecraft = cfg; }
];
users.home.persist.directories = with cfg; mkIf (enable && allUsers) persist;
users.home.persistApp.directories = with cfg; mkIf (enable && !allUsers) persist;
users.profiles.minecraft = mkIf (cfg.enable && cfg.user == "minecraft") {
uid = 5801;
description = "Minecraft";
picture = ../picture/aux.png;
};
environment.persistence."/nix/persist".users.${cfg.user} = mkIf (cfg.enable && gui) {
directories = [ ".local/share/PrismLauncher" ];
};
};
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Before After
Before After

BIN
home/picture/aux.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Before After
Before After

13
home/plasma/config.nix Normal file
View file

@ -0,0 +1,13 @@
{
programs.plasma = {
workspace = {
lookAndFeel = "org.kde.breezedark.desktop";
#clickItemTo = "select";
};
configFile = {
baloofilerc."Basic Settings"."Indexing-Enabled" = false;
kcminputrc.Libinput."2362"."597"."UNIW0001:00 093A:0255 Touchpad".NaturalScroll = true;
};
};
}

51
home/plasma/home.nix Normal file
View file

@ -0,0 +1,51 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.passthrough.plasma;
image = ../../share/54345906_p0.jpg;
in mkIf cfg.enable {
programs.plasma = {
# https://github.com/pjones/plasma-manager
enable = true;
#overrideConfig = true;
workspace = {
lookAndFeel = "org.kde.breezedark.desktop";
wallpaper = image;
};
hotkeys.commands = {
launch-konsole = {
name = "Launch Konsole";
key = "Meta+Enter";
command = "konsole";
};
};
configFile = {
baloofilerc."Basic Settings"."Indexing-Enabled" = false;
kscreenlockerrc.Greeter.Wallpaper."org.kde.image".General.Image = image;
kscreenlockerrc.Greeter.Wallpaper."org.kde.image".General.PreviewImage = image;
};
} // cfg.extraConfig;
home.activation.gtkCleanup = hm.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD rm -f $HOME/.gtkrc-2.0.old
'';
qt.enable = false;
qt.platformTheme.name = null;
# gtk theme
gtk.theme = {
package = pkgs.kdePackages.breeze-gtk;
name = "Breeze-Dark";
};
# gtk icons
gtk.iconTheme = {
package = pkgs.kdePackages.breeze-icons;
name = "breeze-dark";
};
}

52
home/plasma/nixos.nix Normal file
View file

@ -0,0 +1,52 @@
{ pkgs
, lib
, config
, plasma-manager
, ... }: with lib; let
cfg = config.home.plasma;
in {
options.home.plasma = {
enable = mkEnableOption "plasma desktop and configuration";
specialise = mkEnableOption "enable plasma in a specialisation";
extraConfig = mkOption {
type = with types; anything;
default = { };
description = "extra plasma-manager configuration";
};
};
config = {
users.homeModules = [
# this module passes plasma configuration to home-manager
{ passthrough.plasma = cfg; }
];
users.home.persist.files = mkIf cfg.enable [
".config/kwinoutputconfig.json"
];
users.home.persist.directories = mkIf cfg.enable [
".local/share/kwalletd"
];
services.desktopManager.plasma6 = mkIf cfg.enable {
enable = true;
};
home-manager.backupFileExtension = mkIf cfg.enable "old";
home-manager.sharedModules = [
plasma-manager.homeManagerModules.plasma-manager
];
services.blueman = mkIf cfg.enable {
enable = mkForce false;
};
home = mkIf cfg.enable {
catppuccin.enable = mkForce false;
};
specialisation.plasma = mkIf cfg.specialise {
configuration.home.plasma.enable = true;
};
};
}

View file

@ -1,6 +1,7 @@
{ pkgs
, lib
, config
, inputs
, ... }: with lib; let
cfg = config.users;
in {
@ -86,6 +87,7 @@ in {
adminGroups = [
"wheel" "kvm"
"systemd-journal"
"networkmanager"
];
# base home modules in current directory
@ -136,13 +138,36 @@ in {
(filterAttrs (n: _: n != "root") config.users.profiles);
home-manager.users = mapAttrs (name: opts: {
imports = cfg.homeModules;
imports = with inputs; cfg.homeModules ++ [
impermanence.homeManagerModules.impermanence
catppuccin.homeManagerModules.catppuccin
];
home.file.".face" = mkIf (opts.picture != null) {
source = opts.picture;
};
home.stateVersion = "23.11";
}) cfg.profiles;
system.activationScripts = mapAttrs'
(name: opts: nameValuePair
"${name}-profile-icon"
{
deps = [ "users" ];
text = let
iconDest = "/var/lib/AccountsService/icons/${name}";
userConf = pkgs.writeText "${name}-config" ''
[User]
Session=
Icon=${iconDest}
SystemAccount=false
'';
in ''
install -Dm 0444 ${opts.picture} ${iconDest}
install -Dm 0400 ${userConf} /var/lib/AccountsService/users/${name}
'';
})
(filterAttrs (n: _: n != "root") config.users.profiles);
# set up standard persistence for users
# this is registered internally for each software's configuration
environment.persistence."/nix/persist" = {
@ -158,6 +183,12 @@ in {
# enable passwordless sudo
security.sudo.wheelNeedsPassword = false;
# enable access in build-vm
virtualisation.vmVariant = {
users.users.koishi.password = "passwd";
users.users.koishi.hashedPasswordFile = mkForce null;
};
};
# this is for home components that need to extend nixos

View file

@ -10,6 +10,7 @@
swaynag.enable = true;
config = {
defaultWorkspace = "workspace number 1";
modifier = "Mod4";
keybindings = let
modifier = config.wayland.windowManager.sway.config.modifier;
@ -17,7 +18,7 @@
XF86MonBrightnessUp = "light -A 5";
XF86MonBrightnessDown = "light -U 5";
"Control+Alt+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 000000";
"Control+Alt+l" = "exec swaylock -f --grace 0";
"Print" = "exec ${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy";
"${modifier}+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy";
"${modifier}+q" = "exec google-chrome-stable";

View file

@ -5,7 +5,7 @@
gui = with config.global.gpu; enable && session;
nvidia = with config.global.gpu; type == "nvidia" || type == "prime";
in mkIf gui {
services.xserver.displayManager.sessionPackages = [
services.displayManager.sessionPackages = [
(pkgs.writeTextFile {
name = "sway-session";
destination = "/share/wayland-sessions/sway.desktop";
@ -22,7 +22,7 @@ in mkIf gui {
for profile in ''${(z)NIX_PROFILES}; do
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
done
exec sway ${if nvidia then "--unsupported-gpu" else ""}
exec sway${if nvidia then " --unsupported-gpu" else ""} 2>&1 >> $XDG_CACHE_HOME/sway
'';
checkPhase = ''
${pkgs.stdenv.shellDryRun} "$target"
@ -33,6 +33,5 @@ in mkIf gui {
} // { providedSessions = [ pkgs.sway.meta.mainProgram ]; })
];
security.pam.services.swaylock = { };
programs.light.enable = true;
}

24
home/swayidle/home.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs
, lib
, config
, ... }: with lib; mkIf config.passthrough.gui {
services.swayidle = let
sway = config.wayland.windowManager.sway.package;
swaymsg = "${sway}/bin/swaymsg";
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
in {
enable = true;
systemdTarget = "sway-session.target";
timeouts = [
{ timeout = 600; command = "${swaymsg} 'output * dpms off'"; resumeCommand = "${swaymsg} 'output * dpms on'"; }
];
events = [
{ event = "before-sleep"; command = "${swaylock} -f --grace 0"; }
];
};
# fullscreen as simple idle inhibitor shortcut
wayland.windowManager.sway.config.window.commands = [
{ criteria.shell = ".*"; command = "inhibit_idle fullscreen"; }
];
}

24
home/swaylock/home.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs
, lib
, config
, ... }: with lib; mkIf config.passthrough.gui {
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
indicator-caps-lock = true;
font-size = 20;
ignore-empty-password = true;
show-failed-attempts = true;
color = mkDefault "#00000000";
# Ring
indicator-radius = 115;
# Swaylock-effects specific settings
clock = true;
timestr = "%r";
grace = 2;
};
};
}

8
home/swaylock/nixos.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs
, lib
, config
, ... }: with lib; let
gui = with config.global.gpu; enable && session;
in mkIf gui {
security.pam.services.swaylock = { };
}

View file

@ -7,19 +7,22 @@ in {
home.packages = with pkgs; [
pv file wget e2fsprogs
] ++ optionals (!cfg.minimal) [
tio mbuffer sedutil
lsscsi zip unzip
nix-index dnsutils whois
pciutils usbutils nvme-cli
] ++ optionals config.passthrough.gui [
gtk-engine-murrine
gnome-themes-extra
xfce.thunar gimp
mission-planner
betaflight-configurator
inav-configurator
inav-blackbox-tools
(blhelisuite32.override { workdir = "${config.home.homeDirectory}/.blhelisuite32"; })
] ++ optionals (config.passthrough.gui && !config.passthrough.flatpak.enable) [
xfce.thunar gimp
jellyfin-media-player
betaflight-configurator
expresslrs-configurator
];

View file

@ -13,6 +13,8 @@ in {
users.homeModules = [
# this module passes util configuration to home-manager
{ passthrough.util = cfg; }
# this module passes flatpak configuration to home-manager
{ passthrough.flatpak = config.global.flatpak; }
];
programs.zsh.enable = true;
@ -23,10 +25,20 @@ in {
".cache/nix-index"
] ++
optionals gui [
# mission-planner
".local/share/Mission Planner"
".config/ExpressLRS Configurator"
".config/betaflight-configurator"
# inav-configurator
".config/inav-configurator"
] ++
optionals (gui && !config.global.flatpak.enable) [
# jellyfin-media-player
".config/jellyfin.org"
".local/share/jellyfinmediaplayer"
".local/share/Jellyfin Media Player"
# expresslrs-configurator
".config/ExpressLRS Configurator"
# betaflight-configurator
".config/betaflight-configurator"
];
};
}

24
home/vscode/home.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.passthrough.vscode;
theme = config.passthrough.catppuccin.enable;
in mkIf cfg.enable {
programs.vscode = {
enable = true;
mutableExtensionsDir = false;
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
package = pkgs.vscodium;
extensions = with pkgs.vscode-extensions; [
catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons
bbenoist.nix golang.go rust-lang.rust-analyzer
];
userSettings = {
"workbench.colorTheme" = mkIf theme "Catppuccin Mocha";
"workbench.iconTheme" = mkIf theme "catppuccin-mocha";
"[nix]"."editor.tabSize" = 2;
};
};
}

19
home/vscode/nixos.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.home.vscode;
in {
options.home.vscode = {
enable = mkEnableOption "vscode text editor";
};
config = {
users.homeModules = [
# this module passes vscode configuration to home-manager
{ passthrough.vscode = cfg; }
];
users.home.persist.directories = mkIf cfg.enable [ ".config/VSCodium" ];
};
}

View file

@ -65,7 +65,7 @@
'';
};
in buildFHSUserEnv {
inherit pname;
inherit pname version;
targetPkgs = pkgs: (with pkgs; [
glib libGL curl
libgcc gtk3

View file

@ -10,4 +10,10 @@
else { });
}) (builtins.attrNames (builtins.readDir ./.)))
) ];
imports = lib.pipe ./. [
builtins.readDir
(lib.filterAttrs (n: ty: ty == "directory" && builtins.pathExists ./${n}/nixos.nix))
(lib.mapAttrsToList (n: _: ./${n}/nixos.nix))
];
}

View file

@ -5,13 +5,13 @@
, buildFHSUserEnv }: let
name = "ExpressLRS-Configurator";
pname = "expresslrs-configurator";
version = "1.6.1";
version = "1.7.2";
dist = fetchzip {
name = "${pname}-dist";
url = "https://github.com/ExpressLRS/ExpressLRS-Configurator/releases/download/v${version}/${pname}-${version}.zip";
stripRoot = false;
hash = "sha256-m/e8dsOadjk63cwfnnCBbjXzI/ooWZUGRM5n267JmhQ=";
hash = "sha256-pXmJ420HeJaMjAZCzlIriuFrTK5xabxTrSy3PDVisgU=";
};
desktopItem = makeDesktopItem {
@ -23,7 +23,7 @@
genericName = "radio link configuration & build tool";
};
in buildFHSUserEnv {
inherit pname;
inherit pname version;
# copied from chromium deps
targetPkgs = pkgs: (with pkgs; [
glib fontconfig freetype pango cairo xorg.libX11 xorg.libXi atk nss nspr

View file

@ -0,0 +1,74 @@
{ lib
, pkg-config
, libjpeg_turbo
, libheif
, lapack
, dlib
, blas
, ffmpeg
, exiftool
, darktable
, fetchFromGitHub
, buildGoModule
, buildNpmPackage
, runCommandLocal
, makeWrapper }: buildGoModule rec {
pname = "photoview";
version = "2.4.0";
source = fetchFromGitHub {
name = "${pname}-src";
owner = pname;
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-ZfvBdQlyqONsrviZGL22Kt+AiPaVWwdoREDUrHDYyIs=";
};
src = source + "/api";
vendorHash = "sha256-Tn4OxSV41s/4n2Q3teJRJNc39s6eKW4xE9wW/CIR5Fg=";
nativeBuildInputs = [
pkg-config
makeWrapper
];
buildInputs = [
libjpeg_turbo
libheif
lapack
dlib
blas
];
ui = buildNpmPackage {
pname = "${pname}-ui";
inherit version;
src = source + "/ui";
#REACT_APP_API_ENDPOINT = "";
REACT_APP_BUILD_VERSION = version;
REACT_APP_BUILD_DATE = builtins.readFile (runCommandLocal "date" { } "date -uI > $out" );
REACT_APP_BUILD_COMMIT_SHA = "nix";
npmDepsHash = "sha256-wUbfq+7SuJUBxfy9TxHVda8A0g4mmYCbzJT64XBN2mI=";
};
postInstall = ''
mkdir -p "$out/lib/${pname}"
mv "$out/bin/api" "$out/bin/${pname}"
wrapProgram $out/bin/${pname} \
--prefix PATH ":" "${lib.makeBinPath [
ffmpeg
exiftool
darktable
]}" \
--set PHOTOVIEW_SERVE_UI 1 \
--set PHOTOVIEW_UI_PATH "$out/lib/${pname}/ui"
cp -r \
"${src}/data/" \
"$out/lib/${pname}/data/"
cp -r \
"${ui}/lib/node_modules/photoview-ui/dist" \
"$out/lib/${pname}/ui"
'';
}

148
package/photoview/nixos.nix Normal file
View file

@ -0,0 +1,148 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.services.photoview;
in {
options.services.photoview = {
enable = mkEnableOption "photoview server";
package = mkOption {
type = with types; package;
default = pkgs.photoview;
description = "photoview package";
};
user = mkOption {
type = with types; str;
default = "photoview";
description = "user under which photoview runs";
};
group = mkOption {
type = with types; str;
default = "photoview";
description = "group under which photoview runs";
};
listen = {
host = mkOption {
type = with types; str;
default = "127.0.0.1";
description = "host to listen on";
};
port = mkOption {
type = with types; port;
default = 8000;
description = "port to listen on";
};
};
database = {
driver = mkOption {
type = with types; enum [ "sqlite" "mysql" "postgres" ];
default = "sqlite";
description = "database driver";
};
string = mkOption {
type = with types; str;
description = "database connection string";
};
};
stateDir = mkOption {
type = with types; str;
default = "/var/lib/photoview";
description = "path to photoview state directory";
};
cacheDir = mkOption {
type = with types; str;
default = "${cfg.stateDir}/media_cache";
description = "path to photoview media cache";
};
secrets = mkOption {
type = with types; nullOr str;
default = null;
description = "path to secrets environment file";
example = ''
MAPBOX_TOKEN=
'';
};
};
config = mkIf cfg.enable {
systemd.services.photoview = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
description = "Photoview - Photo gallery for self-hosted personal servers";
environment = with cfg; {
PHOTOVIEW_LISTEN_IP = listen.host;
PHOTOVIEW_LISTEN_PORT = toString listen.port;
PHOTOVIEW_MEDIA_CACHE = cacheDir;
PHOTOVIEW_DATABASE_DRIVER = database.driver;
"PHOTOVIEW_${toUpper database.driver}_URL" = database.string;
};
serviceConfig = {
ExecStartPre = pkgs.writeShellScript "photoview-pre" ''
rm -f "${cfg.stateDir}/data"
ln -s "${cfg.package}/lib/photoview/data" "${cfg.stateDir}/data"
'';
ExecStart = "${cfg.package}/bin/photoview";
WorkingDirectory = cfg.stateDir;
User = cfg.user;
Group = cfg.group;
EnvironmentFile = mkIf (cfg.secrets != null) cfg.secrets;
DevicePolicy = "closed";
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
PrivateTmp = true;
PrivateUsers = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
ProcSubset = "all";
ProtectSystem = "strict";
RemoveIPC = true;
ReadWritePaths = [ cfg.stateDir ];
RestrictAddressFamilies = [
"AF_INET"
"AF_INET6"
"AF_NETLINK"
"AF_UNIX"
];
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallFilter = [
"@system-service"
"~@privileged"
];
UMask = "0077";
};
};
users.users = mkIf (cfg.user == "photoview") {
photoview = {
description = "photoview service account";
group = cfg.group;
uid = config.ids.uids.photoview;
};
};
users.groups = mkIf (cfg.group == "photoview") {
photoview.gid = config.ids.gids.photoview;
};
ids.uids.photoview = 287;
ids.gids.photoview = 287;
};
}

View file

@ -0,0 +1,27 @@
diff --git a/tubesync/tubesync/local_settings.py.container b/tubesync/tubesync/local_settings.py.container
index a7a07ab..7564138 100644
--- a/tubesync/tubesync/local_settings.py.container
+++ b/tubesync/tubesync/local_settings.py.container
@@ -34,14 +34,20 @@ if database_connection_env:
database_dict = parse_database_connection_string(database_connection_env)
+database_host = database_dict.get("HOST")
+if database_host == "localhost":
+ database_dict["HOST"] = None
+ database_dict["PASSWORD"] = None
+
+
if database_dict:
log.info(f'Using database connection: {database_dict["ENGINE"]}://'
- f'{database_dict["USER"]}:[hidden]@{database_dict["HOST"]}:'
+ f'{database_dict["USER"]}:[hidden]@{database_host}:'
f'{database_dict["PORT"]}/{database_dict["NAME"]}')
DATABASES = {
'default': database_dict,
}
- DATABASE_CONNECTION_STR = (f'{database_dict["DRIVER"]} at "{database_dict["HOST"]}:'
+ DATABASE_CONNECTION_STR = (f'{database_dict["DRIVER"]} at "{database_host}:'
f'{database_dict["PORT"]}" database '
f'"{database_dict["NAME"]}"')
else:

View file

@ -0,0 +1,139 @@
{ lib
, stdenvNoCC
, ffmpeg
, rtmpdump
, atomicparsley
, callPackage
, fetchFromGitHub
, fetchPypi
, fetchpatch
, makeWrapper
, python3Packages }: with python3Packages; let
mkPypi = pname: version: src: format: buildPythonPackage {
inherit pname version src format;
doCheck = false;
nativeBuildInputs = [ setuptools ];
};
mkPypi' = pname: version: hash: format: mkPypi pname version
(fetchPypi {
inherit pname version hash;
}) format;
mkPypi'' = pname: version: hash: mkPypi' pname version hash
"setuptools";
django-compat = mkPypi'' "django-compat" "1.0.15" "sha256-OsmjvtxWuTZdnrJBvFFX0MGTdpv5lfmnjcG8JOfCMxs=";
django-appconf = mkPypi'' "django-appconf" "1.0.6" "sha256-z+h+qCfE7gS5pw+rkLhtcEywLymB+J2oQjyw+r+I778=";
django-basicauth = mkPypi'' "django-basicauth" "0.5.3" "sha256-FenjZvaY9TxxseeU2v6gYPmQoqxVa65rczDdJTJKCRw=";
django-sass-processor = mkPypi'' "django-sass-processor" "1.4" "sha256-sX850H06dRCuxCXBkZN+IwUC3ut8pr9pUKGt+LS3wcM=";
django-background-tasks = mkPypi'' "django-background-tasks" "1.2.5" "sha256-4bGejUlaJ2ydZMWh/4tBEy910vWORb5xt4ZQ2tWa+d4=";
django-compressor = let
pname = "django-compressor";
version = "4.4";
in mkPypi pname version (fetchFromGitHub {
owner = pname;
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-c9uS5Z077b23Aj8jV30XNsshbEfrLRX3ozXasitQ6UQ=";
}) "setuptools";
app = buildPythonApplication rec {
pname = "tubesync";
version = "0.13.6";
format = "other";
src = fetchFromGitHub {
name = "${pname}-src";
owner = "meeb";
repo = pname;
rev = "v${version}";
hash = "sha256-5l1HkMoTn99rNeeK5u+KoFejTFi2LfLyt8upq7xwrj0=";
};
patches = [
./gunicorn-env.patch
./state-dir-env.patch
./database-local-socket.patch
./ensure-fragments.patch
];
propagatedBuildInputs = [
yt-dlp requests
httptools pillow
gunicorn whitenoise
psycopg2 mysqlclient
redis hiredis
libsass six
] ++ [
django_3
django-compat
django-appconf
django-compressor
django-basicauth
django-sass-processor
django-background-tasks
];
buildPhase = ''
mv "tubesync/tubesync/local_settings.py.container" "tubesync/tubesync/local_settings.py"
rm "tubesync/tubesync/local_settings.py.example"
rm "tubesync/tubesync/local_settings.py.container.orig"
python3 tubesync/manage.py compilescss
python3 tubesync/manage.py collectstatic --no-input
'';
installPhase = ''
mkdir -p "$out"
cp -r "tubesync" "$out/app"
FFMPEG_VERSION=$(${ffmpegFix}/bin/ffmpeg -version | head -n 1 | awk '{ print $3 }')
echo "ffmpeg_version = '$FFMPEG_VERSION'" >> "$out/app/common/third_party_versions.py"
mv "$out/app/static" "$out/static"
ln -s "/tmp/tubesync/static" "$out/app/static"
'';
};
ffmpegFix = ffmpeg.overrideAttrs (finalAttrs: previousAttrs: {
patches = previousAttrs.patches ++ [ (fetchpatch {
name = "avformat-webvttdec-skip-style-region.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/51d303e20cbb0874172f50b5172c515a973587d4";
hash = "sha256-dxCjKZUz2H2QyktsprkzyfNp5aDG6X8deF4ZGdvhvfk=";
}) ];
});
in stdenvNoCC.mkDerivation {
pname = "${app.pname}-wrapped";
inherit (app) version;
nativeBuildInputs = [ makeWrapper ];
unpackPhase = "true";
installPhase = let
prefix = ''--prefix PATH : "${lib.makeBinPath [
ffmpegFix rtmpdump atomicparsley
]}"'';
in ''
mkdir -p "$out/bin"
makeWrapper "${python}/bin/python3" "$out/bin/tubesync-worker" \
--chdir ${app}/app --add-flags \
"${app}/app/manage.py process_tasks" \
${prefix}
makeWrapper "${gunicorn}/bin/gunicorn" "$out/bin/tubesync-gunicorn" \
--chdir ${app}/app --add-flags \
"-c ${app}/app/tubesync/gunicorn.py --capture-output tubesync.wsgi:application" \
${prefix}
makeWrapper "${python}/bin/python3" "$out/bin/tubesync-migrate" \
--chdir "${app}/app" --add-flags \
"${app}/app/manage.py migrate"
'';
passthru = {
inherit app;
pythonPath = makePythonPath app.propagatedBuildInputs;
};
}

View file

@ -0,0 +1,15 @@
diff --git a/tubesync/sync/youtube.py b/tubesync/sync/youtube.py
index 4ac6e83..192b031 100644
--- a/tubesync/sync/youtube.py
+++ b/tubesync/sync/youtube.py
@@ -119,6 +119,10 @@ def download_media(url, media_format, extension, output_file, info_json,
'writesubtitles': write_subtitles,
'writeautomaticsub': auto_subtitles,
'subtitleslangs': sub_langs.split(','),
+ 'progress_with_newline': True,
+ 'fragment_retries': 65536,
+ 'skip_unavailable_fragments': False,
+ 'continue_dl': False,
}
sbopt = {

View file

@ -0,0 +1,19 @@
diff --git a/tubesync/tubesync/gunicorn.py b/tubesync/tubesync/gunicorn.py
index d59c138..341af25 100644
--- a/tubesync/tubesync/gunicorn.py
+++ b/tubesync/tubesync/gunicorn.py
@@ -23,11 +23,10 @@ def get_bind():
workers = get_num_workers()
timeout = 30
-chdir = '/app'
daemon = False
-pidfile = '/run/app/gunicorn.pid'
-user = 'app'
-group = 'app'
+pidfile = os.getenv('GUNICORN_PID_FILE', '/var/run/tubesync/gunicorn.pid')
+user = os.getenv('GUNICORN_USER', 'tubesync')
+group = os.getenv('GUNICORN_GROUP', 'tubesync')
loglevel = 'info'
errorlog = '-'
accesslog = '/dev/null' # Access logs are printed to stdout from nginx

188
package/tubesync/nixos.nix Normal file
View file

@ -0,0 +1,188 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.services.tubesync;
in {
options.services.tubesync = {
enable = mkEnableOption "tubesync stack";
debug = mkEnableOption "debug logging";
package = mkOption {
type = with types; package;
default = pkgs.tubesync;
description = "tubesync launcher package";
};
workers = mkOption {
type = with types; int;
default = 1;
description = "maximum amount of concurrent workers";
};
user = mkOption {
type = with types; str;
default = "tubesync";
description = "user under which tubesync runs";
};
group = mkOption {
type = with types; str;
default = "tubesync";
description = "group under which tubesync runs";
};
listen = {
host = mkOption {
type = with types; str;
default = "127.0.0.1";
description = "host to listen on";
};
port = mkOption {
type = with types; port;
default = 8080;
description = "port to listen on";
};
};
stateDir = mkOption {
type = with types; str;
default = "/var/lib/tubesync";
description = "path to tubesync state storage directory";
};
dataDir = mkOption {
type = with types; str;
default = "${cfg.stateDir}/downloads";
description = "path to tubesync video downloads";
};
database = mkOption {
type = with types; str;
default = "postgresql://tubesync:@localhost:5432/tubesync";
description = "database connection string";
};
};
config = mkIf cfg.enable {
systemd.services = let
env = {
GUNICORN_PID_FILE = "${cfg.stateDir}/run/gunicorn.pid";
GUNICORN_USER = cfg.user;
GUNICORN_GROUP = cfg.group;
DATABASE_CONNECTION = cfg.database;
CONFIG_BASE_DIR = cfg.stateDir;
DOWNLOADS_BASE_DIR = cfg.dataDir;
TUBESYNC_DEBUG = mkIf cfg.debug "True";
TUBESYNC_WORKERS = toString cfg.workers;
PYTHONPATH = cfg.package.pythonPath;
REDIS_CONNECTION = "redis+socket://"
+ "${cfg.stateDir}/run/redis.sock";
};
base = description: {
description = "tubesync: ${description}";
wantedBy = [ "multi-user.target" ];
environment = env;
path = [ cfg.package ];
serviceConfig = {
WorkingDirectory = cfg.stateDir;
User = cfg.user;
Group = cfg.group;
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
PrivateTmp = true;
PrivateDevices = true;
PrivateUsers = false;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
ProcSubset = "all";
ProtectSystem = "strict";
RemoveIPC = true;
ReadWritePaths = with cfg; [ stateDir dataDir ];
RestrictAddressFamilies = [
"AF_INET"
"AF_INET6"
"AF_NETLINK"
"AF_UNIX"
];
SystemCallArchitectures = "native";
SystemCallFilter = [
"@system-service"
"~@privileged"
"@chown"
];
#UMask = "0077";
};
};
base' = description: (base description) // {
after = [ "tubesync.service" ];
partOf = [ "tubesync.service" ];
};
in {
tubesync = recursiveUpdate (base "gunicorn") ({
after = [ "network.target" ];
serviceConfig = {
PIDFile = env.GUNICORN_PID_FILE;
ExecStartPre = pkgs.writeShellScript "tubesync-setup" ''
set -xe
tubesync-migrate
mkdir -p "${cfg.stateDir}/run"
mkdir -p "/tmp/tubesync"
cp -r "${cfg.package.app}/static/." "/tmp/tubesync/static"
chmod +w -R "/tmp/tubesync/static"
'';
ExecStart = "${cfg.package}/bin/tubesync-gunicorn";
ExecReload = "/usr/bin/env kill -s HUP $MAINPID";
ExecStop = "/usr/bin/env kill -s TERM $MAINPID";
ExecStopPost = pkgs.writeShellScript "tubesync-cleanup" ''
rm -f "$GUNICORN_PID_FILE"
rm -rf "/tmp/tubesync"
'';
};
});
tubesync-worker = recursiveUpdate (base' "worker") ({
serviceConfig.ExecStart = "${cfg.package}/bin/tubesync-worker";
});
# allow binding to unix socket
redis-tubesync-celery.serviceConfig.ReadWritePaths = [ "${cfg.stateDir}/run" ];
};
services.redis.servers.tubesync-celery = {
enable = true;
inherit (cfg) user;
unixSocket = "${cfg.stateDir}/run/redis.sock";
save = [ ];
};
users.users = mkIf (cfg.user == "tubesync") {
tubesync = {
description = "tubesync service account";
group = cfg.group;
uid = config.ids.uids.tubesync;
};
};
users.groups = mkIf (cfg.group == "tubesync") {
tubesync.gid = config.ids.gids.tubesync;
};
ids.uids.tubesync = 101;
ids.gids.tubesync = 101;
# package is local-only, will allow this for now
nixpkgs.config.permittedInsecurePackages = [
"python3.12-django-3.2.25"
];
};
}

View file

@ -0,0 +1,16 @@
diff --git a/tubesync/tubesync/local_settings.py.container b/tubesync/tubesync/local_settings.py.container
index a7a07ab..9207c7f 100644
--- a/tubesync/tubesync/local_settings.py.container
+++ b/tubesync/tubesync/local_settings.py.container
@@ -6,9 +6,8 @@ from common.utils import parse_database_connection_string
BASE_DIR = Path(__file__).resolve().parent.parent
-ROOT_DIR = Path('/')
-CONFIG_BASE_DIR = ROOT_DIR / 'config'
-DOWNLOADS_BASE_DIR = ROOT_DIR / 'downloads'
+CONFIG_BASE_DIR = Path(os.getenv('CONFIG_BASE_DIR', "/var/lib/tubesync"))
+DOWNLOADS_BASE_DIR = Path(os.getenv('DOWNLOADS_BASE_DIR', f"{CONFIG_BASE_DIR}/downloads"))
DJANGO_URL_PREFIX = os.getenv('DJANGO_URL_PREFIX', None)
STATIC_URL = str(os.getenv('DJANGO_STATIC_URL', '/static/'))
if DJANGO_URL_PREFIX and STATIC_URL:

View file

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before After
Before After

View file

@ -1,4 +1,4 @@
{
{ pkgs, ... }: {
global = {
id = "5d3c16fe58444e12ad621600039f10af";
fs.esp.uuid = "32A5-6257";
@ -18,18 +18,27 @@
};
home = {
gnome.enable = true;
vscode.enable = true;
libreoffice.enable = true;
minecraft.enable = true;
steam.enable = true;
};
powerManagement.enable = true;
powerManagement.cpuFreqGovernor = "powersave";
powerManagement.resumeCommands = ''
# trackpad driver resume workaround
${pkgs.kmod}/bin/modprobe -r psmouse
${pkgs.kmod}/bin/modprobe psmouse
'';
hardware.nvidia.prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:5:0:0";
};
boot.plymouth.catppuccin.enable = false;
hardware.enableRedistributableFirmware = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];

View file

@ -12,6 +12,7 @@
./channel.nix
impermanence.nixosModules.impermanence
home-manager.nixosModules.home-manager
catppuccin.nixosModules.catppuccin
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;

View file

@ -6,42 +6,29 @@
auth.openssh.enable = true;
fs.esp.uuid = "C368-7571";
fs.type = "zfs";
fs.zfs.externalStore = true;
fs.external.device = "/dev/disk/by-uuid/d9202e56-a14f-4342-acdb-dbae33d680fc";
fs.external.fsType = "xfs";
fs.external.options = [ "noatime" ];
fs.zfs.alert.secret = "/nix/persist/secret/telegram";
fs.zfs.split.enable = true;
fs.zfs.split.store = "d9202e56-a14f-4342-acdb-dbae33d680fc";
fs.zfs.split.secret = "1404c4f1-b890-4cf0-ab8a-26bd81bd2254";
fs.zfs.replication.enable = true;
fs.zfs.replication.remote = "eientei@archive:archive/backup/koishi/eientei";
fs.cryptsetup.enable = true;
fs.cryptsetup.allowDiscards = false;
fs.cryptsetup.uuids.secret = "c33c9b18-a280-42d7-8740-3f8d3f60dc43";
gpu.enable = true;
gpu.type = "intel";
gpu.session = false;
boot.lanzaboote = true;
boot.memtest = 4;
acme.enable = true;
oci.enable = true;
};
services.fstrim.enable = true;
boot.swraid.enable = true;
boot.swraid.mdadmConf = ''
PROGRAM /usr/bin/true
'';
fileSystems."/nix/var/secret" =
{ device = "/dev/disk/by-uuid/1404c4f1-b890-4cf0-ab8a-26bd81bd2254";
fsType = "ext4";
options = [ "noatime" ];
neededForBoot = true;
depends = [ "/nix/var" ];
};
boot.initrd.systemd.services.zfs-import-eientei.after = [ "cryptsetup.target" ];
services.udev.extraRules = ''
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="80:61:5f:07:9e:2f", NAME="ix0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:e0:4c:68:bb:30", NAME="ss0"
'';
networking.proxy = {
allProxy = "socks5://192.168.1.253:1080";
noProxy = "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1,localhost,.localdomain";
};
boot.kernelParams = [ "zfs.zfs_arc_max=17179869184" ];
imports = lib.pipe ./. [
builtins.readDir
@ -55,6 +42,5 @@
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
networking.firewall.allowedTCPPorts = [ 25565 ];
environment.systemPackages = with pkgs; [ python3 ];
}

View file

@ -23,8 +23,8 @@
];
};
networking.firewall.interfaces.enp0s20f0u1.allowedTCPPorts = [ 5000 8554 8555 ];
networking.firewall.interfaces.enp0s20f0u1.allowedUDPPorts = [ 8555 ];
networking.firewall.interfaces.ss0.allowedTCPPorts = [ 5000 8554 8555 ];
networking.firewall.interfaces.ss0.allowedUDPPorts = [ 8555 ];
global.fs.zfs.mountpoints."/nix/persist/service/frigate" = "service/frigate";
}

View file

@ -13,9 +13,25 @@
"mqtt"
"synology_dsm"
];
extraPackages = python3Packages: with python3Packages; [
aiogithubapi gtts radios
];
};
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
services.nginx.virtualHosts."home.514fpv.io" = {
useACMEHost = ".514fpv.io";
addSSL = true;
extraConfig = ''
proxy_buffering off;
'';
locations."/" = {
proxyPass = "http://127.0.0.1:8123";
proxyWebsockets = true;
};
};
global.fs.zfs.mountpoints."/nix/persist/service/hass" = "service/hass";
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
}

35
spec/eientei/jellyfin.nix Normal file
View file

@ -0,0 +1,35 @@
{ pkgs
, config
, ...}: {
services.jellyfin = {
enable = true;
openFirewall = true;
dataDir = "/nix/persist/service/jellyfin";
};
environment.systemPackages = with pkgs; [ jellyfin jellyfin-web jellyfin-ffmpeg ];
users.users.jellyfin.uid = 282;
users.groups.jellyfin.gid = 282;
services.nginx.virtualHosts."jellyfin.514fpv.io" = {
useACMEHost = ".514fpv.io";
addSSL = true;
locations = {
"= /".return = "302 https://jellyfin.514fpv.io:2096/web/";
"/" = {
proxyPass = "http://127.0.0.1:8096";
extraConfig = ''
proxy_buffering off;
'';
};
"= /web/".proxyPass = "http://127.0.0.1:8096/web/index.html";
"/socket" = {
proxyPass = "http://127.0.0.1:8096";
proxyWebsockets = true;
};
};
};
global.fs.zfs.mountpoints."/nix/persist/service/jellyfin" = "service/jellyfin";
}

View file

@ -40,6 +40,7 @@ in {
locations."/".extraConfig = ''
return 404;
'';
locations."/health".proxyPass = "http://127.0.0.1:8008";
locations."/_matrix".proxyPass = "http://127.0.0.1:8008";
locations."/_synapse/client".proxyPass = "http://127.0.0.1:8008";
};

106
spec/eientei/minecraft.nix Normal file
View file

@ -0,0 +1,106 @@
{ pkgs, lib, config, ... }: let
inherit (lib) mapAttrs' nameValuePair;
servers = {
#bungeecord = {
# cmdline = "${pkgs.graalvmCEPackages.graalvm-ce}/bin/java -Xms2G -Xmx4G -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -jar waterfall-1.20-578.jar";
# stop = "end";
#};
#limbo = {
# cmdline = "${pkgs.graalvmCEPackages.graalvm-ce}/bin/java -Xms1G -Xmx1G -jar NanoLimbo-1.8-all.jar";
# stop = "stop";
#};
greedycraft = {
cmdline = "${pkgs.jdk8}/bin/java -Xmx10G -Xms10G -Xss4M -Dfile.encoding=GBK -Dsun.rmi.dgc.server.gcInterval=1800000 -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:-OmitStackTraceInFastThrow -XX:+OptimizeStringConcat -XX:+UseAdaptiveGCBoundary -XX:G1HeapRegionSize=32M -jar forge-1.12.2-14.23.5.2855.jar nogui";
stop = "stop";
};
nfwc = {
cmdline = "${pkgs.jdk}/bin/java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.19.2-43.3.8/unix_args.txt";
stop = "stop";
};
};
prefix = "minecraft-server-";
data = "/nix/persist/service/minecraft";
in {
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/games/minecraft-server.nix
users.users.minecraft = {
description = "Minecraft server service user";
home = data;
createHome = true;
isSystemUser = true;
uid = 1021;
group = "minecraft";
};
users.groups.minecraft.gid = 1021;
systemd.sockets = mapAttrs' (name: value: with value; (nameValuePair "${prefix}${name}" {
bindsTo = [ "${prefix}${name}.service" ];
socketConfig = {
ListenFIFO = "/run/minecraft-server/${name}.stdin";
SocketMode = "0660";
SocketUser = "minecraft";
SocketGroup = "minecraft";
RemoveOnStop = true;
FlushPending = true;
};
})) servers;
systemd.services = let
stopScript = { name, stop }: pkgs.writeShellScript "minecraft-server-stop" ''
echo ${stop} > ${config.systemd.sockets."${prefix}${name}".socketConfig.ListenFIFO}
# Wait for the PID of the minecraft server to disappear before
# returning, so systemd doesn't attempt to SIGKILL it.
while kill -0 "$1" 2> /dev/null; do
sleep 1s
done
'';
in mapAttrs' (name: value: with value; (nameValuePair "${prefix}${name}" {
description = "Minecraft Server Service for ${name}";
wantedBy = [ "multi-user.target" ];
requires = [ "${prefix}${name}.socket" ];
after = [ "network.target" "${prefix}${name}.socket" ];
path = [ pkgs.bash ];
serviceConfig = {
ExecStart = cmdline;
ExecStop = "${stopScript { inherit name stop; }} $MAINPID";
Restart = "always";
User = "minecraft";
WorkingDirectory = "${data}/${name}";
StandardInput = "socket";
StandardOutput = "journal";
StandardError = "journal";
# Hardening
CapabilityBoundingSet = [ "" ];
DeviceAllow = [ "" ];
LockPersonality = true;
PrivateDevices = true;
PrivateTmp = true;
PrivateUsers = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
UMask = "0077";
};
})) servers;
global.fs.zfs.mountpoints.${data} = "service/minecraft";
networking.firewall.allowedTCPPorts = [ 25565 ];
}

View file

@ -4,11 +4,12 @@
in {
services.nextcloud = {
enable = true;
package = pkgs.nextcloud28;
package = pkgs.nextcloud30;
extraApps = {
inherit (pkgs.nextcloud28Packages.apps)
inherit (pkgs.nextcloud30Packages.apps)
notify_push impersonate spreed
contacts bookmarks deck polls notes forms;
contacts bookmarks deck polls notes forms
twofactor_webauthn;
};
home = "/nix/persist/service/nextcloud";
configureRedis = true;
@ -22,6 +23,7 @@ in {
config.adminpassFile = builtins.toString (pkgs.writeText "password" "initial_password");
settings.overwriteprotocol = "https";
settings.default_phone_region = "US";
settings.maintenance_window_start = 17;
caching.redis = true;
phpOptions.upload_max_filesize = "128G";
phpOptions.post_max_size = "128G";

View file

@ -17,18 +17,6 @@
useACMEHost = ".514fpv.io";
extraConfig = "return 444;";
};
"home.514fpv.io" = {
useACMEHost = ".514fpv.io";
addSSL = true;
extraConfig = ''
proxy_buffering off;
'';
locations."/" = {
proxyPass = "http://127.0.0.1:8123";
proxyWebsockets = true;
};
};
};
};

View file

@ -0,0 +1,36 @@
{ lib
, ... }: with lib; {
services.photoprism = {
enable = true;
originalsPath = "/run/storage/aerial/raw";
settings = {
PHOTOPRISM_ADMIN_USER = "koishi";
PHOTOPRISM_FFMPEG_ENCODER = "vaapi";
PHOTOPRISM_ORIGINALS_LIMIT = "-1";
PHOTOPRISM_RESOLUTION_LIMIT = "-1";
};
passwordFile = "/var/lib/photoprism/password";
};
services.nginx.virtualHosts."raw.514fpv.io" = {
useACMEHost = ".514fpv.io";
addSSL = true;
extraConfig = ''
proxy_buffering off;
'';
locations."/" = {
proxyPass = "http://127.0.0.1:2342";
proxyWebsockets = true;
};
};
systemd.services.photoprism.serviceConfig = {
PrivateDevices = mkForce false;
DevicePolicy = "closed";
DeviceAllow = [ "/dev/dri/renderD128 rw" ];
};
environment.persistence."/nix/persist/fhs".directories = [
"/var/lib/private/photoprism"
];
}

View file

@ -0,0 +1,20 @@
{
services.photoview = {
enable = true;
database.driver = "postgres";
database.string = "postgresql:///photoview?host=/var/run/postgresql";
stateDir = "/nix/persist/service/photoview";
secrets = "/nix/persist/service/photoview/secrets.env" ;
};
services.nginx.virtualHosts."dvr.514fpv.io" = {
useACMEHost = ".514fpv.io";
addSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8000";
proxyWebsockets = true;
};
};
global.fs.zfs.mountpoints."/nix/persist/service/photoview" = "service/photoview";
}

View file

@ -0,0 +1,8 @@
{
services.tubesync = {
enable = false;
stateDir = "/nix/persist/service/tubesync";
};
global.fs.zfs.mountpoints."/nix/persist/service/tubesync" = "service/tubesync";
}

View file

@ -0,0 +1,27 @@
{
services.vaultwarden = {
enable = true;
environmentFile = "/nix/persist/service/vaultwarden/secret.env";
config = {
domain = "https://vault.514fpv.io:2096";
signupsAllowed = false;
rocketAddress = "127.0.0.1";
rocketPort = 8222;
rocketLog = "critical";
databaseUrl = "postgresql:///vaultwarden";
};
dbBackend = "postgresql";
};
services.nginx.virtualHosts."vault.514fpv.io" = {
useACMEHost = ".514fpv.io";
addSSL = true;
locations."/".proxyPass = "http://127.0.0.1:8222";
};
environment.persistence."/nix/persist/fhs".directories = [
"/var/lib/bitwarden_rs"
];
global.fs.zfs.mountpoints."/nix/persist/service/vaultwarden" = "service/vaultwarden";
}

View file

@ -5,38 +5,31 @@
auth.openssh.enable = true;
fs.esp.uuid = "8C36-CBE2";
fs.type = "zfs";
fs.zfs.externalStore = true;
fs.external.device = "/dev/disk/by-uuid/59b73292-8098-4774-b8b6-59c23130d405";
fs.external.fsType = "xfs";
fs.external.options = [ "noatime" ];
fs.zfs.alert.secret = "/nix/persist/secret/telegram";
fs.zfs.split.enable = true;
fs.zfs.split.store = "59b73292-8098-4774-b8b6-59c23130d405";
fs.zfs.split.secret = "f8983719-f9e7-42b2-b8f3-0f32f6b328ae";
fs.zfs.replication.enable = true;
fs.zfs.replication.remote = "focus@edge.514fpv.io:archive/backup/koishi/focus";
fs.zfs.replication.port = 8087;
fs.cryptsetup.enable = true;
fs.cryptsetup.allowDiscards = false;
fs.cryptsetup.uuids.secret = "c2bc361e-6f9a-48fa-b698-ed3603a9664a";
boot.lanzaboote = true;
boot.memtest = 4;
acme.enable = true;
netdata.enable = true;
netdata.host = "sf.514fpv.io";
netdata.addSSL = true;
netdata.useACMEHost = "sf.514fpv.io";
};
services.fstrim.enable = true;
boot.swraid.enable = true;
boot.swraid.mdadmConf = ''
PROGRAM /usr/bin/true
'';
fileSystems."/nix/var/secret" =
{ device = "/dev/disk/by-uuid/f8983719-f9e7-42b2-b8f3-0f32f6b328ae";
fsType = "ext4";
options = [ "noatime" ];
neededForBoot = true;
depends = [ "/nix/var" ];
};
boot.initrd.systemd.services.zfs-import-focus.after = [ "cryptsetup.target" ];
services.udev.extraRules = ''
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="6c:b3:11:3d:80:13", NAME="2g5"
'';
networking.proxy = {
allProxy = "socks5://192.168.1.1:1080";
allProxy = "http://compat:3128";
noProxy = "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1,localhost,.localdomain";
};

View file

@ -1,36 +0,0 @@
{ config
, ... }: {
services.grafana = {
enable = true;
dataDir = "/nix/persist/service/grafana";
settings = {
server = {
http_addr = "127.0.0.1";
http_port = 3000;
domain = "sf.514fpv.io";
root_url = "https://sf.514fpv.io:8086/dash";
serve_from_sub_path = true;
};
};
};
services.prometheus = {
enable = true;
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9002;
};
};
};
services.nginx.virtualHosts."sf.514fpv.io".locations."/dash/" = {
proxyPass = "http://${toString config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}";
proxyWebsockets = true;
recommendedProxySettings = true;
};
global.fs.zfs.mountpoints."/nix/persist/service/grafana" = "service/grafana";
}

View file

@ -4,16 +4,18 @@
in {
services.nextcloud = {
enable = true;
package = pkgs.nextcloud28;
package = pkgs.nextcloud30;
extraApps = {
inherit (pkgs.nextcloud28Packages.apps)
inherit (pkgs.nextcloud30Packages.apps)
notify_push impersonate spreed
contacts bookmarks deck polls notes forms;
contacts bookmarks deck polls notes forms
twofactor_webauthn;
};
home = "/nix/persist/service/nextcloud";
configureRedis = true;
webfinger = true;
maxUploadSize = "128G";
fastcgiTimeout = 300;
hostName = host;
phpExtraExtensions = all: with all; [ bz2 ];
database.createLocally = true;
@ -21,6 +23,7 @@ in {
config.adminuser = "koishi";
config.adminpassFile = builtins.toString (pkgs.writeText "password" "initial_password");
settings.overwriteprotocol = "https";
settings.maintenance_window_start = 17;
settings.default_phone_region = "US";
settings.default_language = "zh";
settings.default_locale = "zh_Hans_CN";

View file

@ -17,14 +17,6 @@
useACMEHost = ".sf.514fpv.io";
extraConfig = "return 444;";
};
"sf.514fpv.io" = {
addSSL = true;
useACMEHost = "sf.514fpv.io";
locations."/" = {
return = "307 https://sf.514fpv.io:8086/dash/";
};
};
};
};

View file

@ -0,0 +1,61 @@
{ pkgs, lib, config, ... }: {
global = {
id = "09a2900f15b74f36b023a9ebcd539f6a";
fs.esp.uuid = "AE73-B83E";
fs.type = "xfs";
fs.store = "e4c673cb-03c5-44ac-b2f1-1085a7f7a553";
fs.cryptsetup.enable = true;
fs.cryptsetup.uuids.persist = "122001b1-7a43-4bab-ae7c-ba8eeb1cc864";
boot.lanzaboote = true;
gpu.enable = true;
gpu.type = "amdgpu";
android.enable = true;
};
home = {
gnome.enable = true;
jetbrains.enable = true;
vscode.enable = true;
steam.enable = true;
minecraft.enable = true;
minecraft.user = "app";
};
users.homeModules = [ {
wayland.windowManager.sway.config = {
input = {
"9610:30:HID_258a:001e_Mouse".natural_scroll = "disabled";
"1539:61441:NVTK0603:00_0603:F001_UNKNOWN".map_to_output = "eDP-1";
"1539:61441:NVTK0603:00_0603:F001".map_to_output = "eDP-1";
};
output = {
eDP-1.scale = "2";
eDP-1.transform = "270";
};
};
} ];
powerManagement.enable = true;
powerManagement.cpuFreqGovernor = "performance";
boot.kernelParams = [
"video=eDP-1:panel_orientation=left_side_up"
];
boot.plymouth.extraConfig = ''
DeviceScale=2
'';
services.greetd.settings.default_session.command = let
cfg = config.programs.regreet;
in lib.mkOverride 999 "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} ${lib.escapeShellArgs cfg.cageArgs} -- ${pkgs.writeShellScript "cageResolution" ''
${lib.getExe pkgs.wlr-randr} --output eDP-1 --scale 2 --transform 90
${lib.getExe cfg.package}
''}";
hardware.sensor.iio.enable = true;
hardware.enableRedistributableFirmware = true;
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
hardware.cpu.intel.updateMicrocode = true;
}

View file

@ -21,4 +21,5 @@
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "console=ttyS0,115200n8" ];
boot.initrd.systemd.emergencyAccess = true;
}

View file

@ -1,50 +1,71 @@
{ pkgs
, lib
, ... }: {
{ pkgs, lib, config, jovian, ... }: {
global = {
id = "eeb44fb1150944aab7d146b7caad789f";
auth.openssh.enable = true;
fs.esp.uuid = "B20E-5994";
id = "0a920a834b5f480bab258040096d4c6e";
fs.esp.uuid = "ACB3-4AFF";
fs.type = "xfs";
fs.store = "e8eea851-51b0-4c29-80c4-3d9358c4f3f8";
fs.external.enable = true;
fs.external.device = "/dev/disk/by-uuid/f0e13b58-1223-479c-b673-3a8e629c7f72";
fs.external.fsType = "ext4";
fs.store = "6b885fa6-5c13-4a46-94da-a287232606b9";
fs.cryptsetup.enable = true;
fs.cryptsetup.uuids.nix = "84baa53a-c76d-4716-813a-196f5a53e44d";
fs.cryptsetup.uuids.persist = "e31f8b1c-6504-4b43-93dd-997ad17ebf5e";
fs.cryptsetup.uuids.persist = "b4a5a66d-b491-4ac7-bc71-1ea8b1a503be";
boot.lanzaboote = true;
gpu.enable = true;
gpu.type = "prime";
asusd.enable = true;
oci.enable = true;
gpu.type = "amdgpu";
};
home = {
gyroflow.enable = true;
jetbrains.enable = true;
vscode.enable = true;
minecraft.enable = true;
minecraft.allUsers = true;
steam.enable = true;
steam.allUsers = true;
minecraft.user = "app";
};
users.homeModules = [ {
wayland.windowManager.sway.config = {
input."1046:911:Goodix_Capacitive_TouchScreen".map_to_output = "eDP-1";
output = {
eDP-1.scale = "1.75";
};
};
} ];
powerManagement.enable = true;
powerManagement.cpuFreqGovernor = "performance";
powerManagement.resumeCommands = ''
# trackpad driver resume workaround
${pkgs.kmod}/bin/modprobe -r bmi260_i2c
${pkgs.kmod}/bin/modprobe -r bmi260_core
${pkgs.kmod}/bin/modprobe bmi260_i2c
${pkgs.kmod}/bin/modprobe bmi260_core
'';
console.packages = [ pkgs.terminus_font ];
console.font = "ter-v32n";
console.earlySetup = true;
hardware.nvidia.prime = {
amdgpuBusId = "PCI:6:0:0";
nvidiaBusId = "PCI:1:0:0";
specialisation.desktop.configuration = {
global.jovian = false;
jovian.steamos.useSteamOSConfig = false;
services.greetd.settings.default_session.command = let
cfg = config.programs.regreet;
in "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} ${lib.escapeShellArgs cfg.cageArgs} -- ${pkgs.writeShellScript "cageResolution" ''
${lib.getExe pkgs.wlr-randr} --output eDP-1 --scale 2
${lib.getExe cfg.package}
''}";
environment.systemPackages = with pkgs; [
(writeShellScriptBin "sway-logout" ''
${systemd}/bin/systemctl --user unset-environment WAYLAND_DISPLAY SWAYSOCK
${sway}/bin/swaymsg exit
'')
];
};
imports = lib.pipe ./. [
builtins.readDir
(lib.filterAttrs (n: ty: ty == "regular" && n != "default.nix"))
(lib.mapAttrsToList (n: _: ./${n}))
];
hardware.enableRedistributableFirmware = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "ahci" "sd_mod" ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
hardware.cpu.intel.updateMicrocode = true;
imports = [
jovian.nixosModules.jovian
./jovian.nix
];
}

80
spec/koumakyou/jovian.nix Normal file
View file

@ -0,0 +1,80 @@
{ pkgs, lib, config, ... }: with lib; {
options.global.jovian = mkEnableOption "set up Jovian NixOS" // { default = true; };
config = mkIf config.global.jovian {
jovian = {
hardware.has.amd.gpu = true;
steamos.useSteamOSConfig = true;
steamos.enableDefaultCmdlineConfig = false;
steam = {
enable = true;
autoStart = true;
desktopSession = "plasma";
user = "app";
};
};
users.home.persistApp.directories = [
".steam" ".local/share/Steam"
".config/gamescope" ".config/hhd"
".kodi"
];
users.users.app.extraGroups = [ "networkmanager" "gamemode" ];
programs.gamemode.enable = true;
programs.regreet.enable = false;
home.plasma.enable = true;
home.plasma.extraConfig = {
configFile = {
kwinrc.Xwayland.Scale = 1.75;
kscreenlockerrc.Daemon.Autolock = false;
};
};
home-manager.users.app = {
home.packages = with pkgs; [
(pkgs.kodi-wayland.passthru.withPackages (kodiPkgs: with kodiPkgs; [
joystick # keymap steam-controller
#controller-topology-project
libretro libretro-2048
libretro-fuse libretro-genplus libretro-mgba
libretro-nestopia libretro-snes9x
jellycon
]))
];
home.pointerCursor = {
package = pkgs.steamdeck-hw-theme;
name = "steam";
};
};
services.handheld-daemon = {
enable = true;
user = "app";
};
jovian.decky-loader = {
# ~/.steam/steam/.cef-enable-remote-debugging
enable = true;
user = "app";
extraPackages = with pkgs; [
curl unzip util-linux gnugrep procps pciutils kmod ryzenadj
];
extraPythonPackages = pythonPackages: with pythonPackages; [
hid pyyaml
];
stateDir = "/nix/persist/decky";
};
boot.kernelParams = [
"iomem=relaxed"
"amd_pstate=passive"
];
services.udev.extraRules = ''
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="${pkgs.ryzenadj}/bin/ryzenadj --max-performance"
'';
};
}

View file

@ -0,0 +1,25 @@
# SPDX-License-Identifier: GPL-2.0
PWD := $(shell pwd)
MODNAME = ac71
MODVER = 0.0
obj-m += $(MODNAME).o
# alphabetically sorted
$(MODNAME)-y += ec.o \
main.o \
misc.o \
pdev.o \
events.o \
$(MODNAME)-$(CONFIG_ACPI_BATTERY) += battery.o
$(MODNAME)-$(CONFIG_HWMON) += hwmon.o hwmon_fan.o hwmon_pwm.o fan.o
all:
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules
install:
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules_install
clean:
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean

View file

@ -0,0 +1,123 @@
// SPDX-License-Identifier: GPL-2.0
#include "pr.h"
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/moduleparam.h>
#include <linux/power_supply.h>
#include <acpi/battery.h>
#include <linux/sysfs.h>
#include <linux/types.h>
#include <linux/version.h>
#include "ec.h"
/* ========================================================================== */
#if IS_ENABLED(CONFIG_ACPI_BATTERY)
static bool battery_hook_registered;
static bool nobattery;
module_param(nobattery, bool, 0444);
MODULE_PARM_DESC(nobattery, "do not expose battery related controls (default=false)");
/* ========================================================================== */
static ssize_t charge_control_end_threshold_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int status = ec_read_byte(BATT_CHARGE_CTRL_ADDR);
if (status < 0)
return status;
status &= BATT_CHARGE_CTRL_VALUE_MASK;
if (status == 0)
status = 100;
return sprintf(buf, "%d\n", status);
}
static ssize_t charge_control_end_threshold_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int status, value;
if (kstrtoint(buf, 10, &value) || !(1 <= value && value <= 100))
return -EINVAL;
status = ec_read_byte(BATT_CHARGE_CTRL_ADDR);
if (status < 0)
return status;
if (value == 100)
value = 0;
status = (status & ~BATT_CHARGE_CTRL_VALUE_MASK) | value;
status = ec_write_byte(BATT_CHARGE_CTRL_ADDR, status);
if (status < 0)
return status;
return count;
}
static DEVICE_ATTR_RW(charge_control_end_threshold);
static struct attribute *ac71_batt_attrs[] = {
&dev_attr_charge_control_end_threshold.attr,
NULL
};
ATTRIBUTE_GROUPS(ac71_batt);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
static int ac71_batt_add(struct power_supply *battery, struct acpi_battery_hook *hook)
#else
static int ac71_batt_add(struct power_supply *battery)
#endif
{
if (strcmp(battery->desc->name, "BAT0") != 0)
return 0;
return device_add_groups(&battery->dev, ac71_batt_groups);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
static int ac71_batt_remove(struct power_supply *battery, struct acpi_battery_hook *hook)
#else
static int ac71_batt_remove(struct power_supply *battery)
#endif
{
if (strcmp(battery->desc->name, "BAT0") != 0)
return 0;
device_remove_groups(&battery->dev, ac71_batt_groups);
return 0;
}
static struct acpi_battery_hook ac71_batt_hook = {
.add_battery = ac71_batt_add,
.remove_battery = ac71_batt_remove,
.name = "AC71 laptop battery extension",
};
int __init ac71_battery_setup(void)
{
if (nobattery)
return -ENODEV;
battery_hook_register(&ac71_batt_hook);
battery_hook_registered = true;
return 0;
}
void ac71_battery_cleanup(void)
{
if (battery_hook_registered)
battery_hook_unregister(&ac71_batt_hook);
}
#endif

View file

@ -0,0 +1,26 @@
// SPDX-License-Identifier: GPL-2.0
#ifndef AC71_BATTERY_H
#define AC71_BATTERY_H
#if IS_ENABLED(CONFIG_ACPI_BATTERY)
#include <linux/init.h>
int __init ac71_battery_setup(void);
void ac71_battery_cleanup(void);
#else
static inline int ac71_battery_setup(void)
{
return 0;
}
static inline void ac71_battery_cleanup(void)
{
}
#endif
#endif /* AC71_BATTERY_H */

Some files were not shown because too many files have changed in this diff Show more