Compare commits

..

657 Commits

Author SHA1 Message Date
efc16a9e80 persist: harden the "ephemeral" store mount environment
there's only so much this can actually achieve. it's still quite possible for someone who knows what they're doing to do large amounts of damage
2024-08-01 22:40:55 +00:00
161f272f41 gpodder-adaptive: track youtube-dl upstreaming 2024-08-01 20:02:47 +00:00
6aa6c0020c lightning-cli: fix sandboxing 2024-08-01 19:59:23 +00:00
acd46940e4 clightning: lift the build fix into pkgs/default.nix
this lets me apply it outside the context of a nixos module
2024-08-01 19:53:05 +00:00
00a25f1533 feeds: fix complex systems URL 2024-08-01 19:52:22 +00:00
bc0a1eb1b3 feeds: sub to Complex Systems Podcast 2024-08-01 18:58:39 +00:00
cd3f483df0 sway: add "Super+B" shortcut to open the Web Browser 2024-08-01 18:55:25 +00:00
38a183cf3b sane-open: backfill missing configureKeyboardFor_uri method 2024-08-01 18:54:50 +00:00
5ed6e84cc7 sane-open: refactor 2024-08-01 18:54:04 +00:00
7c1a0fc323 sane-open: add --debug flag 2024-08-01 18:52:55 +00:00
f16066549f sane-open: fallback to URI instead of file when we cant do anything more specialized 2024-08-01 18:52:06 +00:00
659da66106 sane-open: add the ability to open URIs 2024-08-01 18:50:17 +00:00
c07eaba873 tor-browser: associate with .onion URLs 2024-08-01 18:34:38 +00:00
bb420bd45d firefox: add a desktop item for launching inside a VPN 2024-08-01 18:10:32 +00:00
3902432864 where-am-i: fix bin linking 2024-08-01 17:57:45 +00:00
33efbeda8a link manpages into all linkIntoOwnPackage users 2024-08-01 17:43:58 +00:00
8206fb0519 linkIntoOwnPackage: place man/doc into separate outputs 2024-08-01 17:11:24 +00:00
2687286489 servo: nginx: switch to mainline zlib to silence syslog warnings 2024-08-01 01:25:16 +00:00
d5e52e21f7 sane-stop-all-servo: stop ntfy and trust-dns-doof services 2024-07-31 23:40:51 +00:00
367fc24aa8 nixpkgs: full_index=1: actually apply to all PR urls -- not just nixpkgs commits 2024-07-31 20:59:07 +00:00
bf45206d1a nixpkgs: use full_index=1 when fetching patches, for stable hashes 2024-07-31 20:52:38 +00:00
397b2ae2ea nixpkgs: update hashes 2024-07-30 22:05:01 +00:00
f0ebb305ec nixpkgs: update hashes
though it's probably fetchpatch2 just being stupid again and i'll revert
2024-07-30 21:58:01 +00:00
e629d2d999 rsync-net: harden systemd service, and dodge the "pasta doesnt support root" bug 2024-07-30 21:54:25 +00:00
9b2601e450 cross: fix texinfo (used for info command) 2024-07-30 16:23:06 +00:00
a20c13fffe firefox-extensions.ublacklist: 8.9.1 -> 8.9.2 2024-07-30 15:50:04 +00:00
20a2d8dc1c uassets: 2024-07-28 -> 2024-07-29 2024-07-30 15:50:04 +00:00
297bf7e090 syshud: 2024-07-21 -> 2024-07-29 2024-07-30 15:50:04 +00:00
ed024d081e nixpkgs-wayland: 2024-07-27 -> 2024-07-28 2024-07-30 15:50:04 +00:00
4ddd4191bc nixpkgs: 2024-07-28 -> 2024-07-29 2024-07-30 15:50:04 +00:00
32ef63028b sane-reclaim-disk-space: fix quote typo 2024-07-30 15:32:35 +00:00
70bd001171 servo: bitcoind: harden systemd service 2024-07-30 13:12:27 +00:00
b53f376d70 servo: clightning: tighten sandboxing for bitcoin-cli interaction 2024-07-30 12:41:33 +00:00
621c147483 clightning: remove /var/lib/bitcond-mainnet from the service paths -- again 2024-07-30 11:17:10 +00:00
841076fd9e clightning: move /var/lib/bitcoind-mainnet from ReadWritePaths -> ReadOnlyPaths
i think i can go further, remote it altogether
2024-07-29 23:19:26 +00:00
80492e902b inotify watches: bump 1M -> 4M
i'm hoping this will reduce errors on servo seen in system services,
about exhausing "disk space" (file handle space)
2024-07-29 23:19:26 +00:00
f058fe0be6 servo: lemmy: sandbox 2024-07-29 23:19:26 +00:00
8fde3dea77 servo: pleroma: fix service hardening 2024-07-29 23:19:26 +00:00
ac9238a7f0 servo: assorted: plead with shitty AI companies to not bring my server to its knees by scraping all of the Linux source code
i thought AI was supposed to be smart
2024-07-29 19:19:32 +00:00
45412e5042 common/fs: ftp auto-remounting in a way which doesnt use .service files 2024-07-29 15:44:54 +00:00
d76d50f1c4 common/fs: /mnt/servo/* ftp auto/re-mounting in a way which does better rate limiting 2024-07-29 07:11:52 +00:00
f1c76ada43 WIP: common/fs: simpler /mnt/servo/* ftp auto/re-mounting 2024-07-29 03:44:10 +00:00
9dbd85ba08 servo: slskd: remove the hardening options until i can debug 2024-07-29 03:42:52 +00:00
2c707c3acd servo: lemmy/lemmy-ui: harden the service with a syscall filter 2024-07-29 03:42:52 +00:00
0fae963d90 servo: lemmy: harden the backend systemd service 2024-07-29 03:42:52 +00:00
90df178c35 servo: slskd: harden (partially) 2024-07-29 03:42:52 +00:00
dc053149d0 servo: lemmy/lemmy-ui: harden 2024-07-29 03:42:52 +00:00
bce81d0487 servo: pleroma: harden 2024-07-29 03:42:52 +00:00
a8eba4df4d servo: jackett: harden further 2024-07-29 03:42:52 +00:00
1bb36b74c2 scripts/check-uninsane: check that servo bitcoind is online 2024-07-29 03:42:52 +00:00
e21910a1f7 servo: disable unused i2p, monero services 2024-07-29 03:42:52 +00:00
4b30036973 servo: bitcoind: harden 2024-07-29 03:42:52 +00:00
ea5919ab6b servo: jackett: harden 2024-07-29 03:42:52 +00:00
43232ff569 kiwix-serve: harden 2024-07-29 03:42:52 +00:00
6a9fd04437 bitcoin-cli: split into own file, and fix broken path to config file when running as user 2024-07-29 03:42:52 +00:00
dc2d46b9c0 servo: cryptocurrencies: get clightning back into a state where i can see its working 2024-07-29 03:42:52 +00:00
666744bda3 bitcoin-cli,lightning-cli: ship as own package instead of shipping the whole daemon 2024-07-29 03:42:52 +00:00
ba09fbeec9 bitcoind: fix sandboxing 2024-07-29 03:42:52 +00:00
916ecc30d1 scripts/deploy: fix --reboot flag 2024-07-29 03:42:52 +00:00
1536a60a3d firefox-extensions.ether-metamask: attributions-v11.16.15 -> 11.16.16 2024-07-29 03:42:52 +00:00
b7418afede uassets: 2024-07-22 -> 2024-07-28 2024-07-29 03:42:52 +00:00
82a0bf3212 sops-nix: 2024-07-21 -> 2024-07-27 2024-07-29 03:42:52 +00:00
cb79224c7a nixpkgs-wayland: 2024-07-22 -> 2024-07-27 2024-07-29 03:42:52 +00:00
b850e25f5b nixpkgs: 2024-07-24 -> 2024-07-28 2024-07-29 03:42:52 +00:00
8f0f7ef333 cross: fix rsyslog compilation 2024-07-29 03:42:52 +00:00
0bfaead177 sane-deadlines: only show on physical login, not ssh 2024-07-29 03:42:52 +00:00
1b93dbe12c sane-sysload: show on remote login 2024-07-29 03:42:52 +00:00
72d286fbba sane-sysload: add an "{all}" formatter, and show that by default 2024-07-29 03:42:52 +00:00
033faf6f6b clightning-sane: fix --help formatting 2024-07-28 19:24:38 +00:00
eb3651ce59 refactor: assorted: python: logger.warn -> logger.warning
the former is deprecated
2024-07-28 03:41:30 +00:00
bf1f843306 doc: rsyslog: note that this isnt the traditional setup
also, may want to tune the burst settings in the future. i definitely got rate-limited
2024-07-28 03:40:53 +00:00
6cc5669772 servo: remove the root auto-login, so that my s6-rc entrypoint works
i'm sure there's a better way to do this... meh
2024-07-28 03:40:07 +00:00
cb1fbdcaf0 sane-ip-check: add a delay in the retry path 2024-07-28 03:24:02 +00:00
c83dc4d601 servo: assorted: decrease logging verbosity of matrix, lemmy, dovecot, ntfy-sh 2024-07-28 03:15:27 +00:00
36bbac539f nginx: port /var/www/sites data to private store 2024-07-28 02:38:36 +00:00
9a1cd9341f feeds: note some more podcast discovery places 2024-07-28 01:54:14 +00:00
3a6a5ffe01 rsyslog: persist logs 2024-07-28 01:54:14 +00:00
971de060d5 WIP: port /var/log persistence to private store 2024-07-28 01:54:14 +00:00
3ea57f1d6a users: disable pam mount
this was needed for the old way of mounting ~/private, but no longer
2024-07-28 01:54:14 +00:00
fa05e59863 servo: ipfs: port data to private store 2024-07-28 01:54:14 +00:00
de7ff360dc servo: postfix: port data to private store 2024-07-27 17:43:18 +00:00
7f1f9a082d flare-signal-nixified: simplify 2024-07-27 17:30:18 +00:00
6553cdc068 flare-signal-nixified: 0.10.1 -> 0.15.0 2024-07-27 16:54:12 +00:00
e44771f67d servo: postgresql: port data to private store 2024-07-27 16:51:23 +00:00
cbe17c03e4 scripts/deploy: fix usage message about --reboot flag 2024-07-27 14:48:44 +00:00
4c4d841038 servo: slskd: dont persist any data, actually (it still works) 2024-07-27 14:48:31 +00:00
060ae113a1 servo: transmission: port data to private store 2024-07-27 14:14:27 +00:00
540124d2f7 servo: slskd: port data to private store 2024-07-27 13:54:01 +00:00
9df947aa74 servo: ejabberd: port data to private store 2024-07-27 13:40:08 +00:00
66333cbbe7 servo: prosody: port data to private store 2024-07-27 13:38:34 +00:00
3353ed3b66 linux-postmarketos-allwinner: 6.9.0 -> 6.9.10 2024-07-27 13:26:18 +00:00
447923a231 servo: matrix: port data to private store 2024-07-27 12:44:49 +00:00
3179a6834b servo: gitea: port data to private store 2024-07-27 11:49:47 +00:00
70a470b81e servo: ntfy: port data to private store 2024-07-27 02:10:43 +00:00
fff7848cd6 servo: clightning: port data to private store 2024-07-27 02:07:39 +00:00
1fb6cb483b servo: tor: port to private share 2024-07-27 02:04:08 +00:00
33e72c8d34 pleroma: port to private share 2024-07-27 02:00:28 +00:00
8629e2600a jackett: port to private store 2024-07-27 01:49:12 +00:00
2e644dc020 persist/private: remove the "prefix", to allow the store to hold files not just in /home/colin
this will require a one-time manual migration on all devices
2024-07-27 00:26:57 +00:00
f4a6bc1991 pam_cap: fix ordering so that my sessions have correct capabilities again 2024-07-26 23:58:57 +00:00
19fd45211f sane-secrets-unlock: remove from ~/.profile and make it an s6 service
more reliable, in practice
2024-07-26 22:18:32 +00:00
ace03bb0e9 persist/private: actually do enable "auto", for servo where i dont auto-tty-login as colin
this doesn't seem to block the boot
2024-07-26 22:02:57 +00:00
8819142128 modules/users: use = instead of -eq for comparison to fix warning which XDG_VTNR is unset 2024-07-26 20:57:23 +00:00
d905af6cd1 ship sane-private-unlock-remote as a cron job to lappy/desko 2024-07-26 20:54:27 +00:00
0f084b19f1 sane-scripts.private-unlock-remote: init 2024-07-26 20:16:12 +00:00
91263b9dcf sane-secrets-dump: allow specifying the secret by name instead of full path 2024-07-26 20:05:51 +00:00
40e4d0f39c sane-secrets-dump: allow dumping specific fields, and in multiple formats 2024-07-26 19:56:18 +00:00
06a17e4425 moby: remove dead autologin code 2024-07-26 16:04:38 +00:00
cbca403158 hosts/common: downgrade the auto-login to lib.mkDefault
servo uses autologin as root, for the purpose of recovery. let it keep that for now
2024-07-26 16:04:13 +00:00
3b8d6c8587 refactor: s6/unl0kr/profile: put more shell init stuff directly in modules/users/default.nix when it doesnt benefit from being pluggable 2024-07-26 15:58:59 +00:00
d59380b4dd unl0kr: ensure it runs on the same tty the session was initialized on 2024-07-26 14:50:28 +00:00
f4df121e3d persist/private: s6: use systemd to explicitly start the mount, rather than assume it's already been initiated 2024-07-26 14:01:31 +00:00
3d91fa2475 systemd.networkd: disable the wait-online service
it blocks boot like a idiot
2024-07-26 14:01:31 +00:00
96f786de20 persist/private: fix so systemd actually knows when the mount has completed 2024-07-26 12:44:32 +00:00
fcbbfc4a65 fix s6 service ordering: unl0kr -> (wait for mount) -> sway
note that the systemd-aware mount never completes -- it's stuck in 'activating' forever. that's the next challenge
2024-07-26 12:18:14 +00:00
b93e9e75e6 unl0kr: use inotify in the retry logic 2024-07-26 11:31:53 +00:00
4daf5452e8 unl0kr: dont echo password to terminal 2024-07-26 09:36:06 +00:00
af905a2f58 unl0kr: split the gocryptfs unlocking into its own separate service
/mnt/persist/private can be depended on by both s6 user services and systemd system services (which will become useful for servo)

/mnt/persist/private can be unlocked by dropping the key in remotely, however that won't kill unl0kr

TODO: fix unl0kr to not also output text to the tty

TODO: ensure gocryptfs mount can handle being fed a wrong password
2024-07-26 08:08:21 +00:00
8ef5920d84 unl0kr: port to an s6 service
this has some drawbacks in its current form and will be tidied

it writes the password also to the consold. it requires 'sudo'.
2024-07-25 18:45:01 +00:00
b554d32133 fix permissions of /nix/persist/private, to be user-writable
this is important for my rsync-net backup scripts, which need to record timestamps in there
2024-07-25 18:42:45 +00:00
2203d6db59 cleanup: remove XDG_SESSION_TYPE, XDG_VTNR from global environment 2024-07-25 15:26:24 +00:00
07b55bb3ec unl0kr: dont run atop getty -- just a bare /dev/tty1
i'm not sure what agetty was ever doing here.
unl0kr itself runs fine, it launches ~/.profile, and if i interrupt ~/.profile to use a console, that works too.

the console does regularly get interrupted by systemd output,
but i've checked and the agetty method had that same program.
2024-07-25 14:48:15 +00:00
874b7aecfa persist: rename "cryptClearOnBoot" to "ephemeral" 2024-07-25 12:11:46 +00:00
cf8e9f798d persist/crypt: simplify the fileSystems definitions
turns out you can just declare your own fs type, that's cool
2024-07-25 12:11:46 +00:00
800945d951 sway: disable touchpad middle-click (i hope?) 2024-07-25 12:11:46 +00:00
4c3b0f820b feeds: unsubscribe from Vox, Post Reports (politics) 2024-07-25 08:41:13 +00:00
0756349c86 polyunfill: fix missing lvm2 2024-07-24 13:11:59 +00:00
490c587737 swaync-service-dispatcher: add up/down options 2024-07-24 11:49:15 +00:00
15df9edca1 swaync-service-dispatcher: add a usage command 2024-07-24 11:46:52 +00:00
2d73b85f92 gps-share: fix sandboxing
it's possible that the Avahi sandboxing isn't right. idk
2024-07-24 11:43:24 +00:00
70d4925483 gps-share: dont launch until after the modem is actually powered on 2024-07-24 11:15:44 +00:00
dda2ea6fcb nixpkgs: update patch hash 2024-07-24 10:00:30 +00:00
a165e568a8 mpv: tune controls for mobile (speculative) 2024-07-24 09:05:15 +00:00
a539e52abe mpv: disable visualizer; it breaks UI 2024-07-24 09:05:05 +00:00
e62df51258 todo.md: remove completed items 2024-07-24 08:29:16 +00:00
17e7c7d48b nixpkgs: update hashes 2024-07-24 08:29:08 +00:00
6f1173e45a sops-gpg-adapter: port to nix-shell 2024-07-24 08:28:13 +00:00
225c8de7a2 trust-dns: fix dyn-dns reactor (trust-dns-lan does not exist) 2024-07-24 07:18:29 +00:00
05f8dad425 nixpkgs-wayland: 2024-07-21 -> 2024-07-22 2024-07-24 06:46:27 +00:00
8b6971a164 nixpkgs: 2024-07-21 -> 2024-07-24 2024-07-24 06:38:40 +00:00
91359174f6 scripts/check-backups: be slightly more verbose -- at least until im more confident in this setup 2024-07-24 03:33:07 +00:00
b012b93d89 sane-vpn: port from bash -> python 2024-07-24 03:32:38 +00:00
34e770c5f5 sanebox: fix missing dependency on iptables/iproute2 2024-07-24 03:32:12 +00:00
0460a419c5 sane-vpn: use DHCP DNS servers when use specifies none -- instead of 1.1.1.1 2024-07-24 03:05:37 +00:00
79834aedf3 scripts/check-backups: init 2024-07-23 22:09:32 +00:00
2ca8bcda56 bonsai: 1.1.0 -> 1.2.0 2024-07-23 21:39:07 +00:00
8ced778def rsync.net backups: generate stamp files that let me verify that a backup has been attempted 2024-07-23 21:05:43 +00:00
d91ca22587 scripts/sync: add --verbose flag and support syncing multiple machines 2024-07-23 18:49:05 +00:00
a47b9d580a sane-tag-media: fix type-based filtering 2024-07-23 18:24:41 +00:00
fc8a54f39b sane-tag-media: leave a note to implement epub support in the future 2024-07-23 18:14:37 +00:00
3ae25fbe31 sane-tag-media: understand Adobe Acrobat publisher tag 2024-07-23 17:59:00 +00:00
36acc87f30 sane-tag-media: rename print-missing subcommand to show-missing, for consistency with show subcommand 2024-07-23 17:53:48 +00:00
5b7244d339 sane-tag-media: understand LibreOffice/OpenOffice publisher tag 2024-07-23 17:52:34 +00:00
9efa5bb209 sane-tag-music -> sane-tag-media, and formally support pdf 2024-07-23 17:42:25 +00:00
211486f60e pleroma: use sandboxed gawk instead of unsandboxed 2024-07-23 17:19:50 +00:00
b21002207a programs: ship exiftool 2024-07-23 17:19:50 +00:00
1fc0ae3066 nixpkgs: update contourpy patch hash 2024-07-23 17:19:50 +00:00
712cff2867 sane-tag-music: fix path-based tag derivation when path contains "." or ".." 2024-07-23 16:46:32 +00:00
a103cd819f sane-sync-music: fix flac -> opus conversion for surround sound media 2024-07-22 23:12:02 +00:00
553a2724a4 youtube-tui: docs: mention more invidious instances 2024-07-22 16:14:44 +00:00
bf0583cbda youtube-tui: update to a more reliable invidious instance 2024-07-22 16:00:51 +00:00
5a5842d26c nicotine-plus: fix so it can read its config file on first run 2024-07-22 15:51:40 +00:00
3f8f3f4e54 mpv: sponsorblock: also skip intros 2024-07-22 14:20:34 +00:00
4ad6c84d31 mpv: integrate with sponsorblock 2024-07-22 14:09:56 +00:00
8e215cba69 jackett: remove obsoleted patch
seems to work without? i guess i just didn't want to patch the service?
2024-07-22 12:10:21 +00:00
1e3b71def3 gpodder: enable yt-dlp 2024-07-22 11:36:32 +00:00
90b057af95 servo: jackett: remove unnecessary doCheck patch
i don't run jackett on arm anymore
2024-07-22 11:14:12 +00:00
4e35c09a85 jackett: apply patches only to the package as used by the service -- not all of nixpkgs 2024-07-22 11:10:30 +00:00
1e0034c66f sxmo-utils: remove 2024-07-22 11:02:58 +00:00
ae91b825e6 feeds: unsubscribe from The Daily
maybe check back in 2 years from now and see if it'll be more worthwhile news and less politics
2024-07-22 10:48:57 +00:00
3c8b3f2d04 programs: add "nix"
this allows me to get it to shup up about so-called 'non-free' packages
2024-07-22 10:46:31 +00:00
79fbdc4e15 scripts/sync: add a "sync all" option 2024-07-22 07:52:31 +00:00
284ea45648 mpv: tune the OSC menu controls 2024-07-22 07:34:56 +00:00
9c33cb44e2 nixpkgs: 2d155950622fbf78b85e7fa36e337f35316b6c39 -> b841e48094d6eaad953f36dc0831434966dc7719 2024-07-22 06:19:52 +00:00
77a9f47352 nixpkgs-wayland: 2024-07-20 -> 2024-07-21 2024-07-22 06:19:39 +00:00
04a5d38f79 syshud: 2024-07-16 -> 2024-07-21 2024-07-22 06:19:25 +00:00
452950d80b uassets: 2024-07-21 -> 2024-07-22 2024-07-22 06:19:06 +00:00
a79d9b1823 firefox-extensions.ublacklist: 8.9.0 -> 8.9.1 2024-07-22 06:18:49 +00:00
6e3a790a46 moby: enable rsync.net backups 2024-07-21 23:58:41 +00:00
7be997f597 moby: update password 2024-07-21 23:58:41 +00:00
ef1ee6c1c9 moby: document secrets 2024-07-21 23:58:41 +00:00
e196cea667 todo.md: not another trust-dns failure 2024-07-21 23:57:23 +00:00
105416990a 'sane-vpn do unmetered': route DNS to the host resolver 2024-07-21 23:56:56 +00:00
c0d1f7711a sanebox: pasta/bwrap: route DNS to the host's server if asked (via --sanebox-dns host) 2024-07-21 23:56:15 +00:00
f123be98b2 sane-vpn: specify missing sanebox dependency 2024-07-21 22:49:46 +00:00
15b0bba329 sanebox: implement --sanebox-pasta-arg, useful for debugging 2024-07-21 22:49:00 +00:00
734a4c7c31 todo.md: remove completed compass item 2024-07-21 21:51:41 +00:00
3ce2b44b7d sane-private-change-passwd: remove
use `gocrypt --passwd /nix/persist/private` instead
2024-07-21 21:48:31 +00:00
5f0eaa9771 sane-private-lock: fix mount point 2024-07-21 21:47:00 +00:00
cd7b36b761 sane-sync-music: target opus instead of mp3 when transcoding
opus supports surround sound
2024-07-21 21:46:18 +00:00
b72acef8ed pipewire: default to PIPEWIRE_DEBUG=3 2024-07-21 17:38:10 +00:00
74f2d4d174 pipewire: lift the surround sound functionality out of mpv 2024-07-21 16:54:26 +00:00
bedc9d4b2c signal-desktop-from-src: remove unnecessary --linux build flag 2024-07-21 15:02:03 +00:00
70b36fd79f signal-desktop-from-src: cleanup even more 2024-07-21 15:02:03 +00:00
7baed78b65 signal-desktop-from-src: remove extranous better-sqlite3 rebuild 2024-07-21 15:02:03 +00:00
7cca126efc signal-desktop-from-src: remove extraneous rebuild 2024-07-21 15:02:03 +00:00
433e8b8736 signal-desktop-from-src: simplify packaging -- just patch the dns fallback out 2024-07-21 15:02:03 +00:00
c026b8c40d signal-desktop-from-src: simplify build:release step 2024-07-21 15:02:03 +00:00
88df6b30ce signal-destop-from-src: 7.14.0 -> 7.16.0
upstream switched from yarn to npm, and for this kind of a package i'll seize the opportunity to use builNpmPackage instead of doing so much manually :-)
2024-07-21 15:02:03 +00:00
d324a57f06 uassets: 2024-07-19 -> 2024-07-21 2024-07-21 15:02:03 +00:00
55bed1926c sops-nix: 2024-07-14 -> 2024-07-21 2024-07-21 15:02:03 +00:00
8c9dcdb90f nipkgs-wayland: 2024-07-18 -> 2024-07-20 2024-07-21 15:02:03 +00:00
0ebcbe0ad5 nixpkgs: 2024-07-19 -> 2024-07-21 2024-07-21 15:02:03 +00:00
a9cbb2c092 servo: transmission/torrent-done: fix noisy file regexes 2024-07-21 11:25:54 +00:00
c5227c52c4 sane-sync-music: update file extensions list 2024-07-21 09:44:39 +00:00
0af5e43944 scripts/update: support gitUpdater-style updateScripts 2024-07-21 07:26:39 +00:00
cd16f8c3b6 sxmo-utils: disable auto-update via updateWithSuper attribute 2024-07-21 06:39:19 +00:00
0f7ec33dac scripts/update: cleanup 2024-07-21 06:36:21 +00:00
993c3df09e scripts/update: dont update sofacoustics package by default 2024-07-21 05:49:22 +00:00
fccb48cc2d mpv: ship the libmysofa HRTF file via $XDG_CONFIG_DIRS/share/libmysofa/default.sofa 2024-07-20 19:15:39 +00:00
64ddf15620 sofacoustics.ari: init 2024-07-20 19:13:55 +00:00
68ef56b572 mpv/ffmpeg: consolidate the different ffmpeg configs into overlays/preferences 2024-07-20 19:13:32 +00:00
99c19ceac0 nicotine-plus: use a different login than for slskd, to avoid having one kick the other off the net 2024-07-20 15:21:03 +00:00
f95f9a35fc nicotine: ship creds statically, as secrets 2024-07-20 15:16:31 +00:00
5f1ac2afac mpv: downmix surround sound to stereo using a HRTF-aware filter (sofa) 2024-07-20 13:44:33 +00:00
2ee53fd5be sofacoustics: prefix the .sofa file with the database from which it comes 2024-07-20 13:44:08 +00:00
9fb2cf4d42 sofacoustics.listen: init 2024-07-20 13:21:02 +00:00
612fa0cae8 sofacoustics.widespread: init 2024-07-20 12:39:22 +00:00
875e85c646 uassets: 2024-07-17 -> 2024-07-19 2024-07-20 03:28:38 +00:00
94ecca2967 nixpkgs-wayland: 2024-07-15 -> 2024-07-18 2024-07-20 03:28:29 +00:00
1fea424052 nixpkgs: 2024-07-17 -> 2024-07-19 2024-07-20 03:28:13 +00:00
4abd782b62 hosts/common: migrate most ~/ directories to the "private" persistence store 2024-07-19 20:16:04 +00:00
13b04d50b0 sane-backup-rsync-net: dont try to backup device files
the remote doesn't seem to support them (or maybe it's the protocol)
2024-07-19 20:14:33 +00:00
36b1178fc0 mpv: associate with imgur URLs 2024-07-19 20:13:55 +00:00
527e7029b9 hosts: migrate ~/Videos/local from plaintext -> private storage 2024-07-19 13:47:30 +00:00
18c07721d9 servo: enable rsync.net backups 2024-07-19 12:49:47 +00:00
6ac700811a lappy: enable rsync.net backups 2024-07-19 12:49:40 +00:00
cd62aa2f38 opencellid: update hashes 2024-07-19 12:44:09 +00:00
72a78c5f3e nicotine-plus: re-enable 2024-07-19 12:44:09 +00:00
db292850b0 modules/programs: fix sandbox.net = "vpn" option 2024-07-19 12:44:09 +00:00
8e6272bafd static-nix-shell: better enforce that all nix-shell deps are specified 2024-07-19 12:21:10 +00:00
90e1f4a447 desko: automated backups to rsync.net 2024-07-19 11:42:04 +00:00
31c32b9636 sane-vpn: add a way to route traffic specifically through unmetered connections 2024-07-19 07:31:54 +00:00
d6aef04a77 element-desktop: fix sandboxing of embedded audio files (esp flac files) 2024-07-19 07:27:33 +00:00
0f08f14dc0 todo.md: note another site that doesnt work for trust-dns recursive resolver 2024-07-19 04:17:29 +00:00
6d9806613c nixpkgs/patches: send contourpy fix upstream 2024-07-19 01:15:19 +00:00
c0c2aa00f3 lgtrombetta-compass: ship 2024-07-18 16:40:17 +00:00
6d5cd7b604 lgtrombetta-compass: fix cross compilation and enable strictDeps = true 2024-07-18 15:51:13 +00:00
98860ccf46 todo.md: make a note that newly-patched trust-dns still doesnt support abs.twimg.com 2024-07-18 13:54:43 +00:00
bc5805b341 lgtrombetta-compass: fix cross compilation 2024-07-18 13:54:14 +00:00
3a4d27c3bf templates: python: fix broken setup-hooks refs 2024-07-18 13:24:40 +00:00
c88ef43310 lgtrombetta-compass: init at 0.4.0
it doesn't cross compile yet, because of its dependencies (matplotlib -> contourpy)
2024-07-18 13:24:13 +00:00
326e71f7b1 sanebox: landlock: restrict net access where applicable 2024-07-18 11:54:10 +00:00
532d3c13f6 eza: sandbox with landlock instead of bwrap 2024-07-18 11:43:58 +00:00
9f26ad40f9 mimetype: sandbox (and remove unneeded mimeopen) 2024-07-18 11:43:45 +00:00
c8a99317bc syshud: 0-unstable-2024-07-15 -> 0-unstable-2024-07-16
this fixes the crash-on-start issue
2024-07-18 09:51:44 +00:00
2296e10f15 assorted: remove obsolete GSK_RENDERER=cairo patch 2024-07-18 08:45:44 +00:00
ca68434f18 komikku: fix sandboxing (missing ~/.cache.komikku) 2024-07-18 08:42:45 +00:00
a1de7a4afd users: configure XDG_SESSION_TYPE during shell setup 2024-07-18 00:15:29 +00:00
b692c0b6ce 2024-07-16 -> 2024-07-17 2024-07-17 23:57:29 +00:00
8ba1e35b9d nixpkgs: 2024-07-16 -> 2024-07-17 2024-07-17 23:57:16 +00:00
765ec610c9 schlock: update pin/hash 2024-07-17 16:24:29 +00:00
43c33fef21 schlock: patch for faster unlock (less intense password hashing) 2024-07-17 16:24:00 +00:00
9bcc7cd30b todo.md: sync 2024-07-17 16:16:23 +00:00
0b7d8310df trust-dns: patch resolver to handle more edge-case domains (api.mangadex.org., m.wikipedia.org., ...) 2024-07-17 15:28:41 +00:00
c6f07d4f55 sane-vpn: fix none option 2024-07-17 13:13:14 +00:00
94a0e77fcc sane-vpn: set the retry duration for sane-ip-check 2024-07-17 02:01:50 +00:00
91d5c20a56 sane-ip-check: make the retry loop configurable 2024-07-17 02:00:27 +00:00
9b898ce597 sane-ip-check: implement a retry loop 2024-07-17 02:00:27 +00:00
a49411c02d lftp: fix sandboxing 2024-07-17 02:00:05 +00:00
fcd13d4f6f sane-vpn: cleanup the CLI ergonomics 2024-07-17 02:00:05 +00:00
ef1be364e7 docs: sane-vpn: more usage 2024-07-17 02:00:05 +00:00
8472320629 sane-vpn: route DNS through the VPN's server 2024-07-17 02:00:05 +00:00
19acab1363 scripts/check-uninsane: remove outdated ovpns DNS test 2024-07-16 22:57:48 +00:00
98e1ae53e2 syshud: 2024-07-02 -> 2024-07-15 2024-07-16 22:55:39 +00:00
eb2321aa79 uassets: 2024-07-14 -> 2024-07-16 2024-07-16 22:55:26 +00:00
8febe70665 firefox-extensions.uassets: 8.8.3 -> 8.9.0 2024-07-16 22:55:08 +00:00
ee4ab3b40c nixpkgs-wayland: 2024-07-14 -> 2024-07-15 2024-07-16 22:54:49 +00:00
281643afb0 nixpkgs: 2024-07-15 -> 2024-07-16 2024-07-16 22:54:34 +00:00
86f1e36035 scripts/deploy: fix "exho" typo 2024-07-16 07:42:24 +00:00
929a8eadbc syshud: update config files/locations to match upstream 2024-07-16 07:38:49 +00:00
e355a4b2eb assorted: remove no-longer-needed sanebox PATH fixes 2024-07-16 07:24:56 +00:00
132798be23 sanebox: ensure sanebox is always on the PATH of sandboxed binaries 2024-07-16 07:24:42 +00:00
c72e66a901 curl: sandbox 2024-07-16 07:23:32 +00:00
40d32ec1d5 polyunfill: remove cpupower and kbd 2024-07-16 07:18:06 +00:00
1377f5c7bc servo: fix DNS; although it's getting DHCP routes via DHCP, it doesn't seem to be getting DNS?? 2024-07-16 05:16:07 +00:00
bee714311b servo: remove dead systemd networking code for the WAN IP 2024-07-16 04:13:08 +00:00
b368d4624e servo: configure so that LAN peers can reach me at my WAN IP
on the router side this requires either (a) telling the router to use the doof IP as a gateway and also declaring that route or (b) using DHCP option 121. really, one should do both -- the first for the router, and the second for peers connected via switches
2024-07-16 04:13:06 +00:00
583f7217fc docs: rofi: mention rofi-calc 2024-07-16 00:46:19 +00:00
e8b0979de6 sane-sync-from-iphone: fix perms
without fusermount3 wrapper, i have to use sudo
2024-07-15 23:40:48 +00:00
c4b4ac48fd nixpkgs: 2024-07-14 -> 2024-07-15 2024-07-15 10:53:00 +00:00
8436ba3e02 todo.md: item for fixing transmission torrent-done paths 2024-07-15 02:02:05 +00:00
8b1f91ca86 servo: transmission: fix service config so my torrent-done script doesnt crash 2024-07-15 01:35:45 +00:00
73f6907e9a nixpkgs: fix unl0kr patch
maybe i'll push the PR through just so i don't have to deal with unstable patch hashes, wtf
2024-07-15 00:30:02 +00:00
d6bfef7657 linux-megous: add missing patch to git 2024-07-15 00:22:48 +00:00
0fafd81b79 scripts/sync: sanity check that source directory exists before doing a sync (else we would delete everything in the target) 2024-07-15 00:22:29 +00:00
2ac9c2cb68 fix NUR integration (hopefully) 2024-07-15 00:17:59 +00:00
e8547cc849 nixpkgs: fix unl0kr hash ... AGAIN (i'm beginning to think it's unstable) 2024-07-15 00:17:43 +00:00
3495f04810 preferences: remove unnecessary miniupnpc patch 2024-07-14 22:35:32 +00:00
68a891f6de firefox-extensions.{metamask,i2p-in-private-browsing,ublacklist} -> latest 2024-07-14 22:10:58 +00:00
b8dbc0c1c0 uassets: 2024-07-06 -> 2024-07-14 2024-07-14 22:10:31 +00:00
6964cf8d46 nixpkgs-wayland: 2024-07-05 -> 2024-07-14 2024-07-14 22:10:18 +00:00
c959c0a74a sops-nix: 2024-07-05 -> 2024-07-14 2024-07-14 22:10:01 +00:00
7b0a4c11ec nixpkgs: 2024-07-10 -> 2024-07-14 2024-07-14 22:09:44 +00:00
a926cbee46 scripts/update: build required nix binary before updating packages 2024-07-14 22:09:19 +00:00
23d8990596 todo.md: todo: install a compass app 2024-07-14 22:08:43 +00:00
76ae404827 scripts/sync: fix moby Photos dir 2024-07-14 09:19:17 +00:00
e868e28ed9 sc-im: ship 2024-07-14 03:45:18 +00:00
2283a5b167 mpv: associate with youtube playlist URLs 2024-07-14 03:13:15 +00:00
8d0b7c5855 nixpkgs: fix unl0kr patch hash (... didnt i just do this?) 2024-07-14 03:09:53 +00:00
3fb7fe34c4 rofi: fix so apps with "Terminal=true" can launch via xdg portal 2024-07-14 02:59:26 +00:00
10687a80e4 FIXUP: add missing youtube-tui.nix file to git 2024-07-14 02:59:05 +00:00
a8bcfaed53 youtube-tui: ship 2024-07-14 02:39:38 +00:00
ab200f8988 mpv: associate with youtube embed URLs 2024-07-14 01:33:52 +00:00
b443fd46d8 sway: map caps -> esc 2024-07-13 23:53:50 +00:00
0473822172 nixpkgs: fix patch hashes 2024-07-13 23:53:43 +00:00
d0b5f586c4 nwg-panel: fix multiple instances on display change 2024-07-13 21:01:06 +00:00
f6895393d9 zsh: alias "quit" to "exit" 2024-07-13 20:37:02 +00:00
f78b49f075 scripts/sync: moby: dont compress music (i have enough space for that now) 2024-07-13 18:58:02 +00:00
aa3115d2ca sane-sync-music: limit jobs to just 1 by default 2024-07-13 08:40:19 +00:00
924a6c812c all/net: disable "predictable" interface names 2024-07-13 08:29:48 +00:00
fd50bf6422 desko: disable wifi again
specifically, ethernet DHCP renewals break because the wlan interface advertises the eth MAC (?)
2024-07-13 08:29:14 +00:00
7c0e7cbb71 wg-home: rewrite forwarding rules to avoid naming any interface 2024-07-13 08:28:02 +00:00
26004da704 wg-home: iptables: use extended switch names 2024-07-13 08:07:21 +00:00
7013b09715 scripts/sync: fix nix-shell shebang 2024-07-13 07:43:16 +00:00
3969fd484b networkmanager: 1.48.0 -> 1.48.2 (unpin) 2024-07-13 05:00:43 +00:00
eeab1d9fda sane-tag-music: strip non-breaking spaces from metadata 2024-07-13 05:00:03 +00:00
deb355d960 sane-tag-music: better romanization 2024-07-13 04:50:32 +00:00
1d4df82bde sane-tag-music: improve idempotency 2024-07-13 04:20:37 +00:00
f49e87cf99 sane-tag-music: allow clearing *any* tag manually 2024-07-13 03:43:45 +00:00
e38c2f20e8 sane-tag-music: include the artist in the filename for compilation albums 2024-07-13 02:47:09 +00:00
0e5f01f240 sane-tag-music: refactor: remove extraneous "Various Artists" check 2024-07-13 01:53:05 +00:00
e04dd6cb7d sane-tag-music: better log formatting when moving a file 2024-07-13 01:44:28 +00:00
f4b6bbfbd5 sane-tag-music: ignore "Xerox" when found in the producer field 2024-07-13 00:55:33 +00:00
2e8c58a53d sane-tag-music: allow "info.txt" as an artist-associated item 2024-07-12 20:12:27 +00:00
f6e326869f sane-tag-music: tag derivation logic is recursive/hierarchical
so Artist/Album/Track.flac will draw from Artist/Album/* and then Artist/*
2024-07-12 08:48:51 +00:00
c16f2473e5 sane-tag-music: handle multiple CLI paths by iterating a layer above 2024-07-12 08:48:51 +00:00
d85ffa8539 sane-tag-music: refactor: separate the file walking into its own abstraction
i hope this will allow more sophisticated tag derivation
2024-07-12 08:48:51 +00:00
987cd93ce3 sane-tag-music: allow deriving tags for all operations, not just fix-tags 2024-07-12 08:48:51 +00:00
e82faa5961 sane-tag-music: add a method which generalizes tags to one file from the rest of the album (e.g. the album name) 2024-07-12 08:48:51 +00:00
514cfe7b0b feeds: subscribe to "Better Offline" podcast 2024-07-12 01:20:00 +00:00
dd2eb66875 sane-tag-music: fix "producer" handling for aac files 2024-07-12 00:04:24 +00:00
6ccdbf50cd sane-tag-music: print results in real-time 2024-07-11 23:59:31 +00:00
e2cca54e08 sane-tag-music: support PDFs 2024-07-11 23:58:58 +00:00
721f45f7d4 sane-tag-music: dont abort if metadata fails to load 2024-07-11 23:33:02 +00:00
774ebd23f9 sane-tag-music: jpg/png: use XMP tags for album/producer instead of weird exif tags 2024-07-11 21:39:47 +00:00
bfdacb1941 sane-tag-music: gif: support album, albumartist, producer tags 2024-07-11 21:38:55 +00:00
beeb5d34b0 sane-tag-music: refactor: introduce a generic tag name mapping layer 2024-07-11 21:22:44 +00:00
3d3faba263 sane-tag-music: support mp4/m4a; support "producer" tag (grouping) for mp3/mp4 2024-07-11 20:05:53 +00:00
a56795ff79 sane-tag-music: fix sandboxing to support renaming 2024-07-11 19:12:55 +00:00
00d644ef07 sane-tag-music: support "artist.png" artist images 2024-07-11 03:30:42 +00:00
672de68e56 sane-tag-music: allow clearing any tag 2024-07-11 02:53:00 +00:00
e47bc4c04d sane-tag-music: dont set the VA producer tag if the VA album tag is also set 2024-07-10 17:56:10 +00:00
0b6a8eecce sane-tag-music: handle more "Various Artists" formats 2024-07-10 17:30:41 +00:00
eaaea26603 sane-tag-music: allow deleting producer by setting it empty 2024-07-10 08:31:03 +00:00
e1c80c9abc sane-tag-music: remove special-casing for Singles 2024-07-10 08:10:29 +00:00
50add19b14 sane-tag-music: use pykakasi for better romanization 2024-07-10 04:42:51 +00:00
56032bc040 python-repl: include pykakasi, unidecode 2024-07-10 04:42:11 +00:00
6ee33240d7 nixpkgs: 2024-07-07 -> 2024-07-10 2024-07-10 04:41:43 +00:00
4aaeb42cab servo: bitcoid: allow using sane.programs package 2024-07-10 04:40:38 +00:00
2697d068ce sane-tag-music: fix ImageFile to actually support tag deletion 2024-07-10 00:48:22 +00:00
3ae650bcae sane-tag-music: use "Producer" tag to group albums by artists who use multiple pseudonyms 2024-07-09 23:51:08 +00:00
ddce650bc5 sane-tag-music: handle titles with "/" 2024-07-09 21:35:09 +00:00
96bf9d594f sane-tag-music: fix duplicated tags and wrong mode for image files 2024-07-09 21:35:09 +00:00
c2185f44b1 sane-tag-music: fix so i can load titles from PNG files 2024-07-09 21:35:09 +00:00
549fa8e5cd sane-tag-music: allow filtering paths by type (image v.s. audio) 2024-07-09 21:35:09 +00:00
afc31dfc2f sane-tag-music: prefer existing artist/albumartist tags over path-based ones 2024-07-09 21:35:09 +00:00
2011065497 sane-tag-music: parse album artist - album - track notation 2024-07-09 21:35:09 +00:00
ca6bb7518a sane-tag-music: force tracknumber empty for Singles 2024-07-09 21:35:09 +00:00
612274d0b2 sane-tag-music: improve fix-tags behavior so that manual tags tag precedence over existing tags 2024-07-09 21:35:09 +00:00
b801ed07d6 sane-tag-music: docs: link to metadata tag conventions (pseudo-standards) 2024-07-09 21:35:09 +00:00
53fd4ee42f sane-tag-music: refactor to_path 2024-07-09 21:35:09 +00:00
0b610a6683 nixpkgs: python3 fix: update hash (its merged upstream) 2024-07-09 21:35:09 +00:00
3696953ba0 sane-tag-music: enforce two-digit trackno prefixes everywhere
probably better to make this conditional on the total number of tracks, but that's a bit more difficult
2024-07-09 21:35:09 +00:00
da8b3fc188 sane-tag-music: special-case some romanizations 2024-07-09 21:35:09 +00:00
91db9fef82 sane-tag-music: use unidecode for romanization/transliteration 2024-07-09 21:35:09 +00:00
682e9c0c68 sane-tag-music: fix missing dep 2024-07-09 21:35:09 +00:00
cd9f1cc95e signal-desktop: fix sandboxing to allow for URLOpen dbus calls 2024-07-09 19:09:44 +00:00
607845d495 sane-tag-music: support tagging album art 2024-07-09 02:14:54 +00:00
79c8521f38 sane-tag-music: handle edge-cases in tag -> path logic 2024-07-09 00:01:41 +00:00
fa284c3dec sane-tag-music: docs: mention all subcommands in docstring 2024-07-08 21:10:32 +00:00
3fe5e57c3c sane-vpn: allow sane-vpn dns-fix $CMD 2024-07-08 21:05:15 +00:00
05c212a227 nwg-panel: fix double-bar problem on crash 2024-07-08 21:05:00 +00:00
ea2da626d1 signal-desktop-from-src: add missing file to git 2024-07-08 18:43:37 +00:00
f8d0c9ce3b scripts/deploy: deploy crappy latter than all the others 2024-07-08 05:38:44 +00:00
46bf7c5ac9 nixpkgs: 2024-07-06 -> 2024-07-07 2024-07-08 05:38:44 +00:00
d12120d53c gnome-maps: fix .desktop file so it can actually launch 2024-07-07 12:12:54 +00:00
22e3f58ab3 todo.md: sync 2024-07-07 10:02:26 +00:00
9f483541a4 sane-wipe: fractal: provide instructions for what to do after wiping 2024-07-07 08:51:40 +00:00
8d8f19752f fix missing clightning-sane/default.nix file 2024-07-07 08:24:56 +00:00
49c3bf0f34 zfs: split into zfs-tools program
this lets me sandbox it without building an entire extra copy of zfs
2024-07-07 02:54:33 +00:00
065aba0996 zfs: fix sandboxed build 2024-07-07 02:39:49 +00:00
c7425e792b todo.md: done sandboxing all programs except for the fuse stuff 2024-07-07 02:33:24 +00:00
74b7e90a34 check-uninsane: check zfs pool for errors 2024-07-07 02:32:44 +00:00
9f642980fd zfs: sandbox 2024-07-07 02:31:33 +00:00
c638218c07 servo: matrix-synapse: dont ship unused admin package 2024-07-07 02:23:18 +00:00
1ad933ad9c bitcoind: sandbox 2024-07-07 02:21:14 +00:00
3dc007448c wally-cli: sandbox 2024-07-07 02:10:53 +00:00
3487303216 clightning: sandbox 2024-07-07 01:18:55 +00:00
b74e797b13 clightning-sane: sandbox 2024-07-07 01:15:04 +00:00
bb3f148c32 scripts/check-uninsane: add a liveness test for my Bitcoing Lightning node 2024-07-07 01:00:50 +00:00
e235e09cf1 servo: ship clightning-sane 2024-07-07 00:58:29 +00:00
64610a5806 clightning-sane: define as sane.programs 2024-07-07 00:57:51 +00:00
15ca5fbfa4 clightning-sane: make it an actual package 2024-07-07 00:56:58 +00:00
997b841777 servo: clightning: fix deprecated config 2024-07-07 00:53:29 +00:00
9ced7bd3b5 sane-secrets-unlock: fix sandboxing (create directory before entering the sandbox) 2024-07-07 00:53:08 +00:00
2710f2b2ca docs: gnome-maps: mention some quirks 2024-07-07 00:50:29 +00:00
572a340c8a todo.md: make a list of the programs i've procrastinated on sandboxing 2024-07-06 19:31:19 +00:00
b844a9ef5d servo: disable unused CLI tools for freshrss/signald 2024-07-06 19:29:55 +00:00
d41d067405 servo: clightning: decrease logging from debug -> info 2024-07-06 19:22:06 +00:00
f8349a646b servo: lemmy: decrease logging from default -> warn 2024-07-06 19:21:53 +00:00
706667f403 servo: matrix-appservice-irc: decrease logging debug -> warn 2024-07-06 19:20:18 +00:00
99e0d5f03b servo: matrix-synapse: simplify logging config 2024-07-06 19:19:51 +00:00
3d82bc8c87 gitea: migrate away from deprecated email options 2024-07-06 18:56:34 +00:00
a3212f6955 gitea: bump registration timeout 4 -> 7 days 2024-07-06 18:56:09 +00:00
0d3e89a431 gitea: fix broken UI theme 2024-07-06 18:55:47 +00:00
b7c86d5867 mmcli: sandbox 2024-07-06 18:49:18 +00:00
5db8372b24 nixpkgs-wayland: 0-unstable-2024-07-03 -> 0-unstable-2024-07-05 2024-07-06 18:29:01 +00:00
da09ab3617 sops-nix: assets-unstable-2024-07-01 -> assets-unstable-2024-07-05 2024-07-06 18:28:44 +00:00
133744fa4b nixpkgs: 24.05-unstable-2024-07-03 -> 24.05-unstable-2024-07-06 2024-07-06 18:28:27 +00:00
bfd272b2c9 uassets: 0-unstable-2024-07-03 -> 0-unstable-2024-07-06 2024-07-06 18:28:10 +00:00
3edc8d87f4 firefox-extensions.ublock-origin: 1.58.1b11 -> 1.58.1b12 2024-07-06 18:27:16 +00:00
6824080f6b avahi: fix broken sandboxing 2024-07-06 03:08:36 +00:00
0786475c63 doc: mmcli: show how to sandbox... almost 2024-07-06 03:08:23 +00:00
ae082b1654 nwg-panel: fix the sandbox to allow Shutdown action 2024-07-06 03:07:58 +00:00
a77816e9de refactor: sane-scripts: use whitelistDbus where available 2024-07-06 03:07:21 +00:00
f50b10682f eg25-control: sandbox 2024-07-06 03:06:58 +00:00
b062610866 gps-share: sandbox 2024-07-06 03:06:33 +00:00
bce8a0d91f geoclue: dont place unsandboxed files on PATH 2024-07-06 03:05:49 +00:00
3c53bca156 vpn: log a message whenever the endpoint is updated
only as i'm actively working in this area. hopefully this log message can be less noisy in the future
2024-07-06 03:03:38 +00:00
46806e36f0 stop shipping some unused programs 2024-07-06 03:02:17 +00:00
4a8a5b309e satellite: sandbox 2024-07-05 23:27:51 +00:00
8f46bd5497 hping: sandbox 2024-07-05 23:13:40 +00:00
2c3239da8b mesa-demos (glxgears): sandbox 2024-07-05 23:12:46 +00:00
a08394edf1 callaudiod: sandbox 2024-07-05 23:12:16 +00:00
5e5ecfe81e nwg-panel: add a button to toggle the flashlight on moby 2024-07-05 23:11:55 +00:00
5048bd8d70 sanebox: fix that pasta-sandboxed programs would fail compile-time sandboxing test 2024-07-05 20:41:28 +00:00
c7d8d9ee86 nwg-panel: add the backlight back into the sandbox 2024-07-05 20:32:34 +00:00
2e49946c65 gnome-calls: tunnel traffic through my home ISP 2024-07-05 20:18:47 +00:00
a12aa02655 sane.programs: provide sandbox.net = "vpn.wg-home" to tunnel through my home ISP 2024-07-05 20:18:34 +00:00
6d66a5dbf8 vpn: add a service to auto-refresh wireguard endpoints 2024-07-05 20:06:16 +00:00
a31f67b793 wg-home: remove dead code 2024-07-05 20:05:25 +00:00
5d80e298b5 wg-home: deploy so as to be compatible with sane-vpn (e.g., route *WAN* traffic through it) 2024-07-05 18:45:26 +00:00
56e488b130 sane-stop-all-servo: remove extraneous call to sudo 2024-07-05 14:12:48 +00:00
5ebaaf46a2 hping: ship
it's a handy net debugging tool
2024-07-05 00:51:06 +00:00
bee3ec1fa0 wireshark: fix sandboxing when reading pcaps 2024-07-04 22:28:02 +00:00
46eab8f4e2 gst-device-monitor: sandbox 2024-07-04 19:49:28 +00:00
828d4fcc9c iio-sensor-proxy: sandbox 2024-07-04 19:27:16 +00:00
ca2ac89cec avahi-browse: sandbox 2024-07-04 19:15:33 +00:00
1ae1d94d53 ols: sandbox 2024-07-04 19:11:16 +00:00
c68f333bc9 sanebox: document --sanebox-net-dev all 2024-07-04 19:11:06 +00:00
9a09faa9e4 objdump: sandbox 2024-07-04 19:00:14 +00:00
ae2eaa786c sanebox: pasta: fix to never forward ports INTO the namespace
i thought this was OK, but i think it changes the *return route* as well, allowing for VPN escape -- specifically within gnome-calls (UPnP stuff?)
2024-07-04 18:48:14 +00:00
9c523b3ddd geoclue-demo-agent: sandbox 2024-07-04 16:21:30 +00:00
44c4e88b90 gnome-calls: dont ship dbus files 2024-07-04 15:29:59 +00:00
5ca0ca4f47 servo: freshrss: disable (unused service) 2024-07-04 15:29:39 +00:00
00ea7e17c5 servo: remove unused calibre service 2024-07-04 14:00:40 +00:00
823f8f2be3 feeds: subscribe to FLOSS Weekly 2024-07-04 13:34:48 +00:00
13bec790cb feeds: link to Wikipedia podcasts lists 2024-07-04 13:29:39 +00:00
e72f9be1bf feeds: subscribe to Sharp Tech 2024-07-04 13:23:36 +00:00
0fd8dc2a01 sane-scripts.stop-all-servo: sandbox (correctly, i hope) 2024-07-04 12:44:28 +00:00
24ed242bac servo: fix warning for getExe and iptables 2024-07-04 12:43:02 +00:00
f290b16f12 sane-bt: transmission -> transmission_4 2024-07-04 12:40:09 +00:00
b4cb3decff s6-rc: fix wrapper to expand XDG_RUNTIME_DIR again 2024-07-04 12:38:06 +00:00
7084bf95fa where-am-i: sandbox 2024-07-04 12:35:09 +00:00
acd0926d1f nwg-panel: sandbox 2024-07-04 12:34:35 +00:00
2dba46da6b pactl: sandbox 2024-07-04 11:18:06 +00:00
110c440697 programs: soundconverter: fix sandboxing 2024-07-04 10:33:51 +00:00
f4047bfbea koreader: docs: increase default font size 28 -> 30
am i getting old?
2024-07-04 08:49:49 +00:00
c573ac4e7e overlays/preferences: fix evolution-data-server to build w/o webkit, again (missed this in a recent rename) 2024-07-04 08:12:29 +00:00
cc15be54d4 uassets: 2024-07-02 -> 2024-07-03 2024-07-04 06:59:46 +00:00
8b95a5fa37 nixpkgs: 2024-07-02 -> 2024-07-03 2024-07-04 06:59:46 +00:00
b596f88ccc nixpkgs-wayland: 2024-07-02 -> 2024-07-03 2024-07-04 06:59:36 +00:00
e82feb9f71 make-sandboxed: migrate to binary wrapper 2024-07-03 19:35:56 +00:00
4839a40205 make-sandboxed: use makeWrapper proper, rather than rolling my own
i can't use the _binary_ wrapper unless i use a fully-qualified path to 'sanebox' or hide it behind something like /usr/bin/env
2024-07-03 17:54:38 +00:00
631c47c9bc programs/assorted: prefer makeBinaryWrapper over makeWrapper 2024-07-03 16:35:45 +00:00
b2f36e4ef6 rofi: add a "Close Menu" item to the app/file launcher 2024-07-03 14:05:24 +00:00
9a210b4a63 rofi/sane-open: fix so "Apps" menu item reveals keyboard 2024-07-03 13:43:28 +00:00
181ebfc627 moby: launch Signal by default (it seems to be less crashy than before) 2024-07-03 12:43:12 +00:00
ddb904ae19 iio-sensor-proxy: implement partial magnetometer support 2024-07-03 12:34:34 +00:00
a234e57d89 nixpkgs: 2024-07-01 -> 2024-07-02 2024-07-03 09:08:53 +00:00
a75a8f8425 sops-nix: 2024-06-30 -> 2024-07-01 2024-07-03 09:06:44 +00:00
9cbe74b20b 2024-06-29 -> 2024-07-02 2024-07-03 09:05:46 +00:00
6b06062cc9 uassets: 2024-07-01 -> 2024-07-02 2024-07-03 09:05:08 +00:00
b009b2c836 nixpkgs-wayland: 2024-07-01 -> 2024-07-02 2024-07-03 09:04:43 +00:00
d46239f2ad docs: iio-sensor-proxy: document current state of compass in Pinephone 2024-07-02 22:25:41 +00:00
47f474fecd moby: fix the magnetometer (compass)
it's not immediately viewable by geoclue, but it's viewable (and
working) from the CLI:
```
SANEBOX_DISABLE=1 watch cat /sys/devices/platform/soc/1c2b000.i2c/i2c-1/1-001c/iio:device2/in_magn_x_raw
```

the longer-term fix requires u-boot integration, but this hack is
actually entirely contained to linux. u-boot gives linux a
mostly-unmodified dtb from the linux package, and i just modify the
linux dtb to use the specific magnetometer my hardware has.
2024-07-02 20:29:49 +00:00
828ef00b61 servo: transmission: torrent-done: print call args at start to aid debugging 2024-07-02 16:07:46 +00:00
5d14a39d52 qmk: ergodox: make braces easier to type and clean up layers 2024-07-02 14:09:42 +00:00
58f89aadf3 scripts: add a way to flash my ergodox-ez firmware 2024-07-02 12:18:58 +00:00
d9a03ee64a signal-desktop-from-src: 7.11.1 -> 7.14.0 2024-07-02 09:53:55 +00:00
697543a675 u-boot-pinephone: use "extraPatches" instead of "patches", to future-proof 2024-07-01 17:44:53 +00:00
ff235f5806 dino: run mainline again, as Dino has released 0.4.4 (which doesnt contain eeevery commit i was running before, but most 2024-07-01 17:25:40 +00:00
39fe0ce43a syshud: 2024-06-20 -> 2024-06-29 2024-07-01 16:57:03 +00:00
98fde86ff6 uassets: 2024-06-26 -> 2024-07-01 2024-07-01 16:57:03 +00:00
5c6a5b01c4 sops-nix: 2024-06-24 -> 2024-07-01 2024-07-01 16:57:03 +00:00
bb4f963c9c nixpkgs-wayland: 2024-06-26 -> 2024-07-01 2024-07-01 16:57:03 +00:00
9eb0b3fc86 nixpkgs: 2024-06-30 -> 2024-07-01 2024-07-01 16:57:03 +00:00
5b7f15b278 moby: upgrade Tow-Boot -> u-boot
i'm trying to get the compass to work, but looks as though it didnt try to probe the 1.2b AF8133J
2024-07-01 16:56:46 +00:00
5176d6a3bc moby: enable iio sensor access (rotation, light; compass is not yet working) 2024-07-01 11:57:06 +00:00
84ba7e3d68 mepo: fix sandboxed geoclue interactions 2024-07-01 08:19:21 +00:00
6d16d83aab geoclue-ols: fix that lru_cache was applied to an async function, even though futures can only be run once 2024-07-01 08:18:22 +00:00
e9c51eddb3 feeds: subscribe to Matt Stoller 2024-07-01 07:33:41 +00:00
75473c7123 nixpkgs: 2024-06-26 -> 2024-06-30 2024-07-01 06:15:42 +00:00
10f7714cfd firefox-extensions.ether-metamask: 11.16.14 -> 11.16.15 2024-07-01 06:13:25 +00:00
fe78f8bc45 geoclue-ols: 2024-06-21 -> 2024-06-30 (cache cellid lookup results) 2024-06-30 18:43:07 +00:00
6bbe3a8e23 qmk/ergodox/udev: cleanup 2024-06-30 16:52:36 +00:00
98c4a5ec87 qmkPackages.all: document how to flash 2024-06-30 16:18:43 +00:00
bf3a894d38 sane-scripts.wipe: fix missing procps dep 2024-06-30 16:13:56 +00:00
c973f2e03b qmkPackages.ergodox_ez_glow_sane: tune keymap 2024-06-30 16:13:05 +00:00
9f76469b5c qmkPackages: add my own layout (copied from base ergodox_ez keymap) 2024-06-30 14:06:45 +00:00
52231f2adc qmk-firmware: init at 0.25.9 2024-06-30 13:24:27 +00:00
8c5d9d79d7 todo.md: sync 2024-06-30 07:39:21 +00:00
961c38e79b scripts/check-uninsane: fix doofnet ftp test to actually route over doofnet 2024-06-30 06:35:04 +00:00
fc5068f4d4 pc: add tools to make using the ZSA Ergodox easier 2024-06-28 10:25:02 +00:00
e641f5c93a mpv: associate with m.youtube.com mobile URLs as well 2024-06-28 04:39:39 +00:00
870e766966 nixpkgs: remove listparser patch (PR closed; not upstreaming it) 2024-06-28 04:39:39 +00:00
a75a341b56 sane-wipe: fix so pkill is available 2024-06-28 04:39:39 +00:00
8b7ed2cdd4 avahi: fix NSS integrations
now moby can access its own gps-share instance at moby.local, from geoclue.service. lappy can access that too.
2024-06-27 23:57:36 +00:00
b3a685aa31 python3Packages -> python3.pkgs, to fix cross-compilation errors (especially around geoclue-ols) 2024-06-27 15:46:04 +00:00
9b8c461ce9 dont treat python packages specially: lift all python packages out of python-packages/ subdir; remove pyPkgs arg from static-nix-shell.mkPython3 2024-06-27 11:28:17 +00:00
27de05a751 python-packages: fix cross compilation errors introduced during the move away from buildPythonPackage 2024-06-27 09:02:30 +00:00
f54f1c57bc avahi: integrate with nss
now i can resolve .local hosts, via glibc, e.g. 'getent hosts <host>.local'
2024-06-27 06:18:48 +00:00
98d6439f2a modules/warnings: add a way to bypass module-level assertions as well 2024-06-27 06:17:53 +00:00
fbcf2aed41 python packages: port away from buildPythonPackage -> stdenv.mkDerivation
in a future refactoring, maybe i can remove them from the special 'pkgs/python-packages' directory altogether
2024-06-26 23:37:27 +00:00
fb7701027e nixpkgs: 2024-06-24 -> 2024-06-26 2024-06-26 21:02:07 +00:00
0bc228c07b nixpkgs-wayland: 2024-06-23 -> 2024-06-26 2024-06-26 21:01:49 +00:00
943ebba7fb sops-nix: 2024-06-23 -> 2024-06-24 2024-06-26 21:01:30 +00:00
e41bf78db6 uassets: 0-unstable-2024-06-23 -> 0-unstable-2024-06-26 2024-06-26 21:01:12 +00:00
8588230f80 firefox-extensions.ublock: 1.58.1b10 -> 1.58.1b11 2024-06-26 21:00:53 +00:00
8ef1af7e22 firefox-extensions.ether-metamask: 11.16.13 -> 11.16.14 2024-06-26 21:00:27 +00:00
989344f87e geoclue: integrate with gps-share, via avahi
N.B.: this doesn't actually work on moby -- yet. need to fix avahi DNS lookups
2024-06-26 11:22:04 +00:00
90f8d1e042 gps-share: specify /dev path to GPS device 2024-06-26 11:22:04 +00:00
d8ca5f91c3 sane-sysload: add an option to query battery *percent* charged 2024-06-26 10:56:08 +00:00
167bb4d8de servo: transmission: torrent-done: fix typo 2024-06-26 09:21:51 +00:00
6b117fa9bf servo: transmission: torrent-done: implement a TR_NO_HARDLINK option 2024-06-26 09:05:51 +00:00
4b9dcd50fb WIP: ship gps-share on moby 2024-06-26 09:05:27 +00:00
84e6d536d6 gps-share: init at 0.3.1 2024-06-26 08:43:37 +00:00
4c74e53052 servo: transmission: torrent-done: log destructive ops when TR_DEBUG=1 2024-06-26 08:27:16 +00:00
5def8f30ad servo: transmission: torrent-done: fix typos and add a TR_DEBUG option 2024-06-26 08:20:03 +00:00
45dd144b24 servo: transmission: torrent-done: fix dry-run; ensure all destructive ops are actually marked as destructive 2024-06-26 08:09:57 +00:00
66d4b380da servo: transmission: torrent-done: remove more noisy files 2024-06-26 08:01:58 +00:00
8e7da2c956 servo: transmission: split torrent-done script into own file 2024-06-26 07:59:20 +00:00
0f11b9a7b7 mpv: associate with YouTube Shorts videos 2024-06-25 21:17:27 +00:00
d9437bf4aa listparser: switch from buildPythonPackage -> stdenv.mkDerivation 2024-06-24 21:12:38 +00:00
5d1c52d0bc feeds: add buttondown.email 2024-06-24 17:05:10 +00:00
a0dfdb5125 init-feed: lift out of pkgs/ and into scripts/ where its easier to invoke 2024-06-24 17:04:23 +00:00
cbc2ba02a4 python3Packages.listparser: grab from nixpkgs patch instead 2024-06-24 15:07:19 +00:00
ef0adb5689 nixpkgs-wayland: 2024-06-21 -> 2024-06-23 2024-06-24 14:21:48 +00:00
b1bd4399f1 nixpkgs: 2024-06-21 -> 2024-06-24 2024-06-24 14:21:19 +00:00
2b252e3ede sops-nix: 2024-06-16 -> 2024-06-23 2024-06-24 14:20:58 +00:00
9aaf89408a uassets: 2024-06-21 -> 2024-06-23 2024-06-24 14:20:37 +00:00
283ca45c5d sponsorblock: 5.6.1 -> 5.6 ; ublacklist: 8.8.1 -> 8.8.2 2024-06-24 14:19:14 +00:00
7955d90f8d python3Packages.listparser: 0.18 -> 0.20 2024-06-24 12:48:43 +00:00
a06481fbef python3Packages.listparser: fetch from GitHub instead of PyPi" 2024-06-24 12:40:09 +00:00
5db4d73ad6 gpodder: lift listparser out of gnome-feeds
it's being removed in https://github.com/NixOS/nixpkgs/pull/320801 i.e. when i next update nixpkgs
2024-06-24 12:35:52 +00:00
304c8f8e3e docs: eg25-control: elaborate on Almanac v.s. Ephemeris 2024-06-24 00:25:54 +00:00
5a09a2665b secrets: net: add new home wifi creds 2024-06-23 18:16:10 +00:00
209545fc41 refactor: split satellite program into own file
mainly so i have a place to document its GUI :)
2024-06-23 12:44:50 +00:00
1e12566207 moby: disable gpsd
1. i wasn't actually relying on it for anything. 2. it's 100k LoC which runs as root (?), in a totally un-secured systemd service.

i may be enabling something similar like this in the future, to prevent geoclue from deciding to disable the GPS. i'll probably be going with the simpler gps-share or gnss-share for that
2024-06-23 03:53:24 +00:00
9a53cbc833 docs: geoclue: link to forums, git, API docs 2024-06-23 03:53:07 +00:00
439bb5263f switchboard: sandbox 2024-06-22 03:43:23 +00:00
845dba3ca5 modules/vpn: fix deprecation warnings 2024-06-22 03:35:41 +00:00
5e7fe850ec blast-ugjka: 0.6.2 -> 0.7.0 2024-06-22 01:25:26 +00:00
832338488d firefox-extensions.ether-metamask: 11.16.12 -> 11.16.13 2024-06-22 01:24:58 +00:00
86ee95f607 uassets: intra-day bump 2024-06-22 01:24:46 +00:00
5f5e55c98b nixpkgs-wayland: 2024-06-20 -> 2024-06-21 2024-06-22 01:24:26 +00:00
7d59782005 nixpkgs: intra-day bump 2024-06-22 01:24:09 +00:00
62b541012b blast-ugjka: add an updateScript 2024-06-21 19:14:47 +00:00
514197a17f docs: mmcli: include notes for how to enable the gps 2024-06-21 19:11:07 +00:00
143bdf672b ship satellite program
really this only belongs on devices which have a gps unit (i.e. moby).
maybe i'll tune that in the future.
2024-06-21 19:09:43 +00:00
a6c48eda71 geoclue2: remove extraneous appConfig where-am-i whitelisting
it's included by the default nixos service (which whitelists 'geoclue-demo-agent'
2024-06-21 17:49:15 +00:00
a603c3e6bc ols: synthesize cell tower data when no exact match is found 2024-06-21 16:24:13 +00:00
1f48f41927 ols: ship static cell tower position database from opencellid.org 2024-06-21 13:48:28 +00:00
c0d9f05575 python3Packages.ols: point to my own repo, 2023-06-15 -> 2024-06-21 2024-06-21 13:42:02 +00:00
7f46b034f9 opencellid: init at 0-unstable-2024-06-20 2024-06-21 12:55:38 +00:00
ba66378bc0 docs: ols: point to wigle docs and api limits 2024-06-21 11:54:38 +00:00
dcc8168aa0 nixpkgs: update sysvol patch 2024-06-07 -> 2024-06-20 2024-06-21 11:54:07 +00:00
f7d3c26d12 servo: irc: add wigle.net 2024-06-21 11:48:47 +00:00
3d871e8d7c scripts/check-nur: fix (linux-exynos5-mainline was invalid in default eval) 2024-06-21 07:43:33 +00:00
78f4cd9be2 sysvol: 2024-06-13 -> 2024-06-20 2024-06-21 07:25:15 +00:00
f83bac3c2b firefox-extensions -> latest 2024-06-21 07:25:15 +00:00
58de5d661f uassets: 2024-06-15 -> 2024-06-21 2024-06-21 07:25:15 +00:00
599832d59c 2024-06-11 -> 2024-06-16 2024-06-21 07:25:15 +00:00
625cb0992b nixpkgs-wayland: 2024-06-14 -> 2024-06-20 2024-06-21 07:25:15 +00:00
a02f221628 nixpkgs: 2024-06-19 -> 2024-06-21 2024-06-21 07:25:15 +00:00
ad8bcfc09e scripts/deploy: build all hosts before building all variants 2024-06-21 07:25:15 +00:00
815ce6287f scripts/update: fix that the script wasnt building the update scripts before trying to invoke them 2024-06-21 07:25:15 +00:00
0d1d56870f default.nix: copy everything to the nix store before evaluating any of my config 2024-06-21 07:25:15 +00:00
2445b882c2 scripts/update: more debug logging 2024-06-20 22:54:16 +00:00
12465e111e nixpkgs: update xsimd patch 2024-06-20 21:54:06 +00:00
65a0914828 fastcluster/ols: fix cross compilation to moby 2024-06-20 13:33:18 +00:00
dab60e79c1 moby: remove gps.nix 2024-06-20 12:01:10 +00:00
fe57f186cd gpsd: deploy via sane.programs interface 2024-06-20 11:57:09 +00:00
78d66a8b09 ols: pipe stderr > stdout 2024-06-20 11:52:35 +00:00
b2955c9c9d geoclue2: use nixpkgs' service 2024-06-20 11:52:13 +00:00
b0e184b0f0 geoclue: integrate ols/wigle as backend
the wigle API limits are *strict*. probably too strict to actually be useful
2024-06-20 11:35:26 +00:00
3cd97b522c ols: enable
still some more work to do to really integrate this with geoclue
2024-06-20 11:05:15 +00:00
c91681c77c python3Packages.ols: init at at 0.1.0-unstable-2023-06-15 2024-06-20 11:05:15 +00:00
d0d623da15 programs: ship geoclue2 as an actual program
moby probably needs its gps.nix file removed. also this is incomplete due to Mozilla terminating their location services API
2024-06-20 08:40:36 +00:00
0db86d8c86 moby: sway: use Alt as the modifier key 2024-06-20 05:55:12 +00:00
b74dfe7578 crappy: sway: use Alt as the mod key 2024-06-20 05:55:12 +00:00
d1843b6b3d refactor: sway-config -> config, to match its installed name 2024-06-20 05:55:12 +00:00
b482a1dfd6 swaync: disable debug, to un-break DND mode
i'm sick of G_MESSAGES_DEBUG breaking stuff. i must be parsing cli output that gets broken by that, somewhere
2024-06-20 05:24:53 +00:00
5ba74a4055 doc: swaync: fix typo in notify-send example 2024-06-20 05:17:51 +00:00
b3b77e3e62 nwg-panel: stylize with the goal that it uses a bit less space on moby 2024-06-20 02:39:45 +00:00
63bc58a56f playerctl: patch missing refcount tracking to avoid a crash in nwg-panel 2024-06-20 00:46:31 +00:00
efcf8639dc gdb: ship a python-capable gdbinit 2024-06-19 23:03:17 +00:00
90b86dc7fc servo: re-enable transmission and jackett 2024-06-19 21:29:32 +00:00
8bf8d31c5f nwg-panel: record the URL to the upstream PR 2024-06-19 21:28:18 +00:00
2e44abc55d scripts/deploy: fix off-by-one in runOnTarget 2024-06-19 21:05:37 +00:00
9e92069ba3 nwg-panel: migrate the mediaPrevNext patch to something suitable for upstream 2024-06-19 21:04:15 +00:00
2a592a4a15 nwg-panel: disable the music-note icon in playerctl 2024-06-19 20:35:50 +00:00
8ca357ea7f scripts/deploy: add a --reboot option 2024-06-19 20:31:43 +00:00
4f4c05a922 nwg-panel: fix playerctl patch for newest nwg-panel, and also hide the label
hopefully the label is the part which includes the music note icon
2024-06-19 19:40:23 +00:00
7c4be0f4e9 hosts: fix that -min and -light variants were actually identical to the full versions 2024-06-19 11:25:30 +00:00
afea7fe5e7 scripts/deploy: implement a dry-run mode 2024-06-19 11:24:33 +00:00
294f0061bd sxmo-utils: add a deprecation warning 2024-06-19 11:20:49 +00:00
4efe159933 nixpkgs: 2024-06-15 -> 2024-06-19 2024-06-19 10:35:58 +00:00
b7f99c022b nwg-panel: enable sysload by default 2024-06-19 02:04:33 +00:00
b3c5e53156 sane-sysload: implement CPU measurement 2024-06-19 01:58:21 +00:00
91c2b04ab4 sane-sysload: make the format CLI args friendlier 2024-06-19 01:20:36 +00:00
27efb10a27 refactor: rename sane-sysinfo -> sane-sysload 2024-06-19 01:04:06 +00:00
e4e32f46fe nwg-panel: integrate optional sysload executor (WIP; disabled by default) 2024-06-19 01:01:03 +00:00
64b169069a nwg-panel: fix issue that playerctl was being pushed off the bar 2024-06-19 00:47:43 +00:00
c2c15e1ac3 networkmanager_dmenu: sandbox 2024-06-19 00:44:35 +00:00
0b3156c4c7 nmcli: sandbox 2024-06-19 00:44:24 +00:00
1c8551c842 rofi: add a shortcut for configuring WiFi 2024-06-18 23:44:21 +00:00
2755d98b99 sane-open: make sure networkmanager_dmenu shows the keyboard when activated 2024-06-18 23:44:21 +00:00
543108a5dd networkmanager_dmenu: ship 2024-06-18 23:44:21 +00:00
b32d02dc3f programs: add pidof from procps
used by things like networkmanager-dmenu, which i plan to add soon
2024-06-18 23:44:20 +00:00
0bd92ef77e swaync: make the backlight/mpris items configurable 2024-06-18 21:41:15 +00:00
a7df4cc125 lint: swaync: sort config properties 2024-06-18 21:34:04 +00:00
09a615ee62 netns: factor the netns setup/teardown into distinct services, rather than trying to piggyback network-local-commands
idk what network-local-commands is about, nor network-pre.target.
network-pre.target doesn't seem to actually be wanted by anything (?)
2024-06-18 10:36:08 +00:00
8523b406ad todo.md: note that swaync brightness slider does not work 2024-06-18 09:48:35 +00:00
6021da072c replace builtins.toJSON with writers.writeJSON where possible
it gives pretty-printed JSON that's easier to work with
2024-06-18 09:33:17 +00:00
a49abbd123 hosts: add pubkeys for $host-hn 2024-06-18 09:33:17 +00:00
f9091c0b0c netns: ensure that network.target depends on network-pre.target (why doesnt it by default?)
this should fix that servo tries to start wg-ovpns before the netns is configured
2024-06-18 09:07:40 +00:00
bbf8fd5b20 servo: disable almost all WAN stuff (leave only wireguard, as a fallback) 2024-06-18 09:04:13 +00:00
be84747ffc check-uninsane: test FTP over doof (and simplify) 2024-06-18 08:09:06 +00:00
478b443430 doc: sftpgo: note that "/README.md" doesnt work 2024-06-18 07:56:26 +00:00
ded5f6560d check-uninsane: fix ftp test to work when invoked from the wan 2024-06-18 07:55:11 +00:00
c1b3629dcf swaync: fix segfault under load 2024-06-18 07:52:02 +00:00
5879499924 swaync-service-dispatcher: simplify quoting 2024-06-18 06:40:44 +00:00
5a63f294c0 servo: sftpgo: allow fully-anonymous www read access to /pub
this will help me write automated tests for its availability
2024-06-18 05:44:20 +00:00
891a29feeb nwg-panel: fix commands (like lock, shutdown) to not run through swaymsg 2024-06-18 02:51:58 +00:00
0863505877 wifi: add new network 2024-06-18 02:34:27 +00:00
0c922bd63a nwg-panel: fix reboot/shutdown commands to not assume systemd 2024-06-18 02:32:04 +00:00
e04ec4c706 nwg-panel: fix the "lock" button to use the correct screen locker 2024-06-18 02:31:46 +00:00
b0f9733ac8 sway: fix that Super+L didnt have sandbox access to start the screen locker 2024-06-18 02:26:57 +00:00
e2babfc076 nwg-panel: fix clock to always be centered, even if that means overlapped rendering 2024-06-18 01:08:02 +00:00
ef29b569e5 nwg-panel: fix clock size to actually be larger on lappy/desko 2024-06-18 01:07:43 +00:00
6f0a455d0b scripts/check-uninsane: implement --verbose flag 2024-06-17 23:36:52 +00:00
7d6a420c52 sane-vpn: allow sane-vpn do -- [COMMAND] 2024-06-17 23:26:28 +00:00
259143b87e scripts/check-uninsane: fix so ssh servo systemctl --failed actually works on servo, even when ssh key is locked 2024-06-17 23:24:34 +00:00
fce426c318 servo: trust-dns: expose the hn DNS server on port 53
nothing i had was *expecting* it to be on port 1053, and it was just never working (?)
2024-06-17 23:16:00 +00:00
9b794777b5 servo: trust-dns: have the ovpns DNS provider return doof-based addresses instead of WAN-based addresses 2024-06-17 23:14:21 +00:00
3ada668366 servo: expose all wan services also to the doof tunnel 2024-06-17 23:08:08 +00:00
39a39e763d trust-dns: hack to substitute ANATIVE before anything else 2024-06-17 22:44:43 +00:00
50353280d3 servo: port ANATIVE over the doof interface to return the doof IP address 2024-06-17 22:37:50 +00:00
72b8211029 servo: switch ns2.uninsane.org from ovpns -> doof 2024-06-17 22:19:36 +00:00
dbf719b59b scripts/check-uninsane: fix the git.uninsane.org check to work even w/o access to SSH keys 2024-06-17 22:16:23 +00:00
57d7d3821f scripts/check-uninsane: dont rely on ovpns.uninsane.org bootstrap DNS: directly test the known IPv4 address 2024-06-17 22:12:34 +00:00
e86e9fc079 scripts/check-uninsane: add a check for DNS via doofnet 2024-06-17 22:11:02 +00:00
d708b78ebe scripts/check-uninsane: fix ftp check, to not error if README.md exists in the current directory 2024-06-17 22:10:47 +00:00
075418eda1 git: add alias git com to commit 2024-06-17 22:01:58 +00:00
9fc5b83b61 refactor: servo: hardcode OVPN-related IP addresses in far fewer places 2024-06-17 22:00:39 +00:00
338 changed files with 12122 additions and 13149 deletions

43
TODO.md
View File

@@ -5,17 +5,15 @@
- when moby wlan is explicitly set down (via ip link set wlan0 down), /var/lib/trust-dns/dhcp-configs doesn't get reset
- `ip monitor` can detect those manual link state changes (NM-dispatcher it seems cannot)
- or try dnsmasq?
- trust-dns: can't recursively resolve api.mangadex.org
- and *sometimes* apple.com fails
- trust-dns can't resolve `abs.twimg.com`
- trust-dns can't resolve `social.kernel.org`
- sandbox: link cache means that if i update ~/.config/... files inline, sandboxed programs still see the old version
- mpv: continues to play past the end of some audio files
- mpv: audiocast has mpv sending its output to the builtin speakers unless manually changed
- mpv: no way to exit fullscreen video on moby
- uosc hides controls on FS, and touch doesn't support unhiding
- Signal restart loop drains battery
- decrease s6 restart time?
- `ssh` access doesn't grant same linux capabilities as login
- ringer (i.e. dino incoming call) doesn't prevent moby from sleeping
- sysvol (volume overlay): when casting with `blast`, sysvol doesn't react to volume changes
- syshud (volume overlay): when casting with `blast`, syshud doesn't react to volume changes
- moby: kaslr is effectively disabled
- `dmesg | grep "KASLR disabled due to lack of seed"`
- fix by adding `kaslrseed` to uboot script before `booti`
@@ -32,6 +30,7 @@
- consolidate ~/dev and ~/ref
- ~/dev becomes a link to ~/ref/cat/mine
- fold hosts/common/home/ssh.nix -> hosts/common/users/colin.nix
- don't hardcode IP addresses so much in servo
### sops/secrets
- rework secrets to leverage `sane.fs`
@@ -57,6 +56,10 @@
- then i can tune the kernels for hardening, without duplicating that work 4 times
- zfs: replace this with something which doesn't require a custom kernel build
- mpv: add media looping controls (e.g. loop song, loop playlist)
- curlftpfs: replace with something better
- safer (rust? actively maintained? sandboxable?)
- handles spaces/symbols in filenames
- has better multi-stream perf (e.g. `sane-sync-music` should be able to copy N items in parallel)
### security/resilience
- validate duplicity backups!
@@ -65,6 +68,9 @@
- /mnt/desko/home, etc, shouldn't include secrets (~/private)
- 95% of its use is for remote media access and stuff which isn't in VCS (~/records)
- port all sane.programs to be sandboxed
- sandbox `curlftpfs`
- sandbox `nix`
- sandbox `sshfs-fuse`
- enforce that all `environment.packages` has a sandbox profile (or explicitly opts out)
- revisit "non-sandboxable" apps and check that i'm not actually just missing mountpoints
- LL_FS_RW=/ isn't enough -- need all mount points like `=/:/proc:/sys:...`.
@@ -73,26 +79,17 @@
- lock down dbus calls within the sandbox
- otherwise anyone can `systemd-run --user ...` to potentially escape a sandbox
- <https://github.com/flatpak/xdg-dbus-proxy>
- remove `.ssh` access from Firefox!
- limit access to `~/knowledge/secrets` through an agent that requires GUI approval, so a firefox exploit can't steal all my logins
- port sanebox to a compiled language (hare?)
- it adds like 50-70ms launch time _on my laptop_. i'd hate to know how much that is on the pinephone.
- make dconf stuff less monolithic
- i.e. per-app dconf profiles for those which need it. possible static config.
- flatpak/spectrum has some stuff to proxy dconf per-app
- canaries for important services
- e.g. daily email checks; daily backup checks
- integrate `nix check` into Gitea actions?
### user experience
- rofi: sort items case-insensitively
- xdg-desktop-portal shouldn't kill children on exit
- *maybe* a job for `setsid -f`?
- replace starship prompt with something more efficient
- watch `forkstat`: it does way too much
- cleanup waybar/nwg-panel so that it's not invoking playerctl every 2 seconds
- nwg-panel: swaync icon is stuck as the refresh icon
- nwg-panel: doesn't appear on all desktops
- nwg-panel: doesn't know that virtual-desktop 10/TV exists
- install apps:
- display QR codes for WiFi endpoints: <https://linuxphoneapps.org/apps/noappid.wisperwind.wifi2qr/>
@@ -101,7 +98,7 @@
- offline docs viewer (gtk): <https://github.com/workbenchdev/Biblioteca>
- some type of games manager/launcher
- Gnome Highscore (retro games)?: <https://gitlab.gnome.org/World/highscore>
- better maps for mobile (Osmin (QtQuick)? Pure Maps (Qt/Kirigami)?
- better maps for mobile (Osmin (QtQuick)? Pure Maps (Qt/Kirigami)?)
- note-taking app: <https://linuxphoneapps.org/categories/note-taking/>
- Folio is nice, uses standard markdown, though it only supports flat repos
- OSK overlay specifically for mobile gaming
@@ -124,13 +121,11 @@
- don't show MPRIS if no players detected
- this is a problem of playerctld, i guess
- add option to change audio output
- fix colors (red alert) to match overall theme
- moby: tune GPS
- run only geoclue, and not gpsd, to save power?
- fix iio-sensor-proxy magnetometer scaling
- tune QGPS setting in eg25-control, for less jitter?
- direct mepo to prefer gpsd, with fallback to geoclue, for better accuracy?
- configure geoclue to do some smoothing?
- manually do smoothing, as some layer between mepo and geoclue/gpsd?
- manually do smoothing, as some layer between mepo and geoclue?
- moby: port `freshen-agps` timer service to s6 (maybe i want some `s6-cron` or something)
- moby: show battery state on ssh login
- moby: improve gPodder launch time
@@ -153,17 +148,15 @@
- have xdg-open parse `<repo:...> URIs (or adjust them so that it _can_ parse)
- sane-bt-search: show details like 5.1 vs stereo, h264 vs h265
- maybe just color these "keywords" in all search results?
- transmission: apply `sane-tag-media` path fix in `torrent-done` script
- many .mkv files do appear to be tagged: i'd just need to add support in my own tooling
- uninsane.org: make URLs relative to allow local use (and as offline homepage)
- email: fix so that local mail doesn't go to junk
- git sendmail flow adds the DKIM signatures, but gets delivered locally w/o having the sig checked, so goes into Junk
- could change junk filter from "no DKIM success" to explicit "DKIM failed"
- add an auto-reply address (e.g. `reply-test@uninsane.org`) which reflects all incoming mail; use this (or a friend running this) for liveness checks
### perf
- debug nixos-rebuild times
- use `systemctl list-jobs` to show what's being waited on
- i think it's `systemd-networkd-wait-online.service` that's blocking this?
- i wonder what interface it's waiting for. i should use `--ignore=...` to ignore interfaces i don't care about.
- also `wireguard-wg-home.target` when net is offline
- add `pkgs.impure-cached.<foo>` package set to build things with ccache enabled
- every package here can be auto-generated, and marked with some env var so that it doesn't pollute the pure package set
- would be super handy for package prototyping!

View File

@@ -1,67 +1,5 @@
# limited, non-flake interface to this repo.
# this file exposes the same view into `pkgs` which the flake would see when evaluated.
#
# the primary purpose of this file is so i can run `updateScript`s which expect
# the root to be `default.nix`
{ }:
{ ... }@args:
let
mkPkgs = args: (import ./pkgs/additional/nixpkgs args).extend
(import ./overlays/all.nix);
inherit (mkPkgs {}) lib;
evalHost = { name, system, branch ? "master", variant ? null }:
let
pkgs = mkPkgs { inherit system; variant = branch; };
in pkgs.nixos (
[
(lib.optionalAttrs (variant == "light") {
sane.maxBuildCost = 2;
})
(lib.optionalAttrs (variant == "min") {
sane.maxBuildCost = 0;
})
(import ./hosts/instantiate.nix { hostName = name; })
(import ./modules)
pkgs.sops-nix.nixosModules.sops
]
);
mkFlavoredHost = args: let
host = evalHost args;
# expose the toplevel nixos system as the toplevel attribute itself,
# with nested aliases for other common build targets
in host.config.system.build.toplevel.overrideAttrs (base: {
passthru = (base.passthru or {}) // {
config = host.config;
fs = host.config.sane.fs;
img = host.config.system.build.img;
pkgs = host.config.system.build.pkgs;
programs = lib.mapAttrs (_: p: p.package) host.config.sane.programs;
toplevel = host.config.system.build.toplevel; #< self
};
});
mkHost = args: {
# TODO: swap order: $host-{next,staging}-{min,light}:
# then lexicographically-adjacent targets would also have the minimal difference in closure,
# and the order in which each target should be built is more evident
"${args.name}" = mkFlavoredHost args;
"${args.name}-next" = mkFlavoredHost args // { branch = "staging-next"; };
"${args.name}-staging" = mkFlavoredHost args // { branch = "staging"; };
"${args.name}-light" = mkFlavoredHost args // { variant = "light"; };
"${args.name}-light-next" = mkFlavoredHost args // { variant = "light"; branch = "staging-next"; };
"${args.name}-light-staging" = mkFlavoredHost args // { variant = "light"; branch = "staging"; };
"${args.name}-min" = mkFlavoredHost args // { variant = "min"; };
"${args.name}-min-next" = mkFlavoredHost args // { variant = "min"; branch = "staging-next"; };
"${args.name}-min-staging" = mkFlavoredHost args // { variant = "min"; branch = "staging-staging"; };
};
hosts = lib.foldl' (acc: host: acc // (mkHost host)) {} [
{ name = "crappy"; system = "armv7l-linux"; }
{ name = "desko"; system = "x86_64-linux"; }
{ name = "lappy"; system = "x86_64-linux"; }
{ name = "moby"; system = "aarch64-linux"; }
{ name = "rescue"; system = "x86_64-linux"; }
{ name = "servo"; system = "x86_64-linux"; }
];
in {
inherit hosts;
} // (mkPkgs {})
sane-nix-files = import ./pkgs/additional/sane-nix-files { };
in
import "${sane-nix-files}/impure.nix" args

View File

@@ -16,7 +16,7 @@
sane.programs.calls.enableFor.user.colin = false;
sane.programs.consoleMediaUtils.enableFor.user.colin = true;
sane.programs.epiphany.enableFor.user.colin = true;
sane.programs."gnome.geary".enableFor.user.colin = false;
sane.programs.geary.enableFor.user.colin = false;
# sane.programs.firefox.enableFor.user.colin = true;
sane.programs.portfolio-filemanager.enableFor.user.colin = true;
sane.programs.signal-desktop.enableFor.user.colin = false;
@@ -25,6 +25,7 @@
sane.programs.dino.config.autostart = false;
sane.programs.dissent.config.autostart = false;
sane.programs.fractal.config.autostart = false;
sane.programs.sway.config.mod = "Mod1"; #< alt key instead of Super
# sane.programs.guiApps.enableFor.user.colin = false;

View File

@@ -10,9 +10,13 @@
# don't enable wifi by default: it messes with connectivity.
# systemd.services.iwd.enable = false;
# networking.wireless.enable = false;
# systemd.services.wpa_supplicant.enable = false;
sane.programs.wpa_supplicant.enableFor.user.colin = lib.mkForce false;
sane.programs.wpa_supplicant.enableFor.system = lib.mkForce false;
# sane.programs.wpa_supplicant.enableFor.user.colin = lib.mkForce false;
# sane.programs.wpa_supplicant.enableFor.system = lib.mkForce false;
# don't auto-connect to wifi networks
# see: <https://networkmanager.dev/docs/api/latest/NetworkManager.conf.html#device-spec>
networking.networkmanager.unmanaged = [ "type:wifi" ];
sops.secrets.colin-passwd.neededForUsers = true;
@@ -25,14 +29,18 @@
sane.ovpn.addrV4 = "172.26.55.21";
# sane.ovpn.addrV6 = "fd00:0000:1337:cafe:1111:1111:20c1:a73c";
sane.services.duplicity.enable = true;
sane.services.rsync-net.enable = true;
sane.nixcache.remote-builders.desko = false;
sane.programs.sane-private-unlock-remote.enableFor.user.colin = true;
sane.programs.sane-private-unlock-remote.config.hosts = [ "servo" ];
sane.programs.sway.enableFor.user.colin = true;
sane.programs.iphoneUtils.enableFor.user.colin = true;
sane.programs.steam.enableFor.user.colin = true;
sane.programs."gnome.geary".config.autostart = true;
sane.programs.geary.config.autostart = true;
sane.programs.signal-desktop.config.autostart = true;
sane.programs.nwg-panel.config = {

View File

@@ -15,14 +15,19 @@
# sane.guest.enable = true;
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
sane.programs.sane-private-unlock-remote.enableFor.user.colin = true;
sane.programs.sane-private-unlock-remote.config.hosts = [ "servo" ];
sane.programs.stepmania.enableFor.user.colin = true;
sane.programs.sway.enableFor.user.colin = true;
sane.programs."gnome.geary".config.autostart = true;
sane.programs.geary.config.autostart = true;
sane.programs.signal-desktop.config.autostart = true;
sops.secrets.colin-passwd.neededForUsers = true;
sane.services.rsync-net.enable = true;
# default config: https://man.archlinux.org/man/snapper-configs.5
# defaults to something like:
# - hourly snapshots

View File

@@ -10,7 +10,6 @@
{
imports = [
./fs.nix
./gps.nix
];
sane.hal.pine64.enable = true;
@@ -24,11 +23,13 @@
# XXX colin: phosh doesn't work well with passwordless login,
# so set this more reliable default password should anything go wrong
users.users.colin.initialPassword = "147147";
# services.getty.autologinUser = "root"; # allows for emergency maintenance?
sops.secrets.colin-passwd.neededForUsers = true;
sane.services.rsync-net.enable = true;
sane.programs.sway.enableFor.user.colin = true;
sane.programs.sway.config.mod = "Mod1"; #< alt key instead of Super
sane.programs.blueberry.enableFor.user.colin = false; # bluetooth manager: doesn't cross compile!
sane.programs.fcitx5.enableFor.user.colin = false; # does not cross compile
sane.programs.mercurial.enableFor.user.colin = false; # does not cross compile
@@ -36,12 +37,12 @@
# enabled for easier debugging
sane.programs.eg25-control.enableFor.user.colin = true;
sane.programs.rtl8723cs-wowlan.enableFor.user.colin = true;
# sane.programs.rtl8723cs-wowlan.enableFor.user.colin = true;
# sane.programs.ntfy-sh.config.autostart = true;
sane.programs.dino.config.autostart = true;
# sane.programs.signal-desktop.config.autostart = true; # TODO: enable once electron stops derping.
# sane.programs."gnome.geary".config.autostart = true;
sane.programs.signal-desktop.config.autostart = true;
# sane.programs.geary.config.autostart = true;
# sane.programs.calls.config.autostart = true;
sane.programs.pipewire.config = {

View File

@@ -1,68 +0,0 @@
# pinephone GPS happens in EG25 modem
# serial control interface to modem is /dev/ttyUSB2
# after enabling GPS, readout is /dev/ttyUSB1
#
# minimal process to enable modem and GPS:
# - `echo 1 > /sys/class/modem-power/modem-power/device/powered`
# - `screen /dev/ttyUSB2 115200`
# - `AT+QGPSCFG="nmeasrc",1`
# - `AT+QGPS=1`
# this process is automated by my `eg25-control` program and services (`eg25-control-powered`, `eg25-control-gps`)
# - see the `modules/` directory further up this repository.
#
# now, something like `gpsd` can directly read from /dev/ttyUSB1,
# or geoclue can query the GPS directly through modem-manager
#
# initial GPS fix can take 15+ minutes.
# meanwhile, services like eg25-manager or eg25-control-freshen-agps can speed this up by uploading assisted GPS data to the modem.
#
# support/help:
# - geoclue, gnome-maps
# - irc: #gnome-maps on irc.gimp.org
# - Matrix: #gnome-maps:gnome.org (unclear if bridged to IRC)
#
# programs to pair this with:
# - `satellite-gtk`: <https://codeberg.org/tpikonen/satellite>
# - shows/tracks which satellites the GPS is connected to; useful to understand fix characteristics
# - `gnome-maps`: uses geoclue, has route planning
# - `mepo`: uses gpsd, minimalist, flaky, and buttons are kinda hard to activate on mobile
# - puremaps?
# - osmin?
#
# known/outstanding bugs:
# - `systemctl start eg25-control-gps` can the hang the whole system (2023/10/06)
# - i think it's actually `eg25-control-powered` which does this (started by the gps)
# - best guess is modem draws so much power at launch that other parts of the system see undervoltage
# - workaround is to hard power-cycle the system. the modem may not bring up after reboot: leave unpowered for 60s and boot again.
#
# future work:
# - integrate with [wigle](https://www.wigle.net/) for offline equivalent to Mozilla Location Services
{ config, lib, ... }:
{
# test gpsd with `gpspipe -w -n 10 2> /dev/null | grep -m 1 TPV | jq '.lat, .lon' | tr '\n' ' '`
# ^ should return <lat> <long>
services.gpsd.enable = true;
services.gpsd.devices = [ "/dev/ttyUSB1" ];
# test geoclue2 by building `geoclue2-with-demo-agent`
# and running "${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/where-am-i"
# note that geoclue is dbus-activated, and auto-stops after 60s with no caller
services.geoclue2.enable = true;
services.geoclue2.appConfig.where-am-i = {
# this is the default "agent", shipped by geoclue package: allow it to use location
isAllowed = true;
isSystem = false;
# XXX: setting users != [] might be causing `where-am-i` to time out
users = [
# restrict to only one set of users. empty array (default) means "allow any user to access geolocation".
(builtins.toString config.users.users.colin.uid)
];
};
systemd.services.geoclue.after = lib.mkForce []; #< defaults to network-online, but not all my sources require network
users.users.geoclue.extraGroups = [
"dialout" # TODO: figure out if dialout is required. that's for /dev/ttyUSB1, but geoclue probably doesn't read that?
];
sane.programs.where-am-i.enableFor.user.colin = true;
}

View File

@@ -7,15 +7,14 @@
./services
];
sane.programs = {
# for administering services
freshrss.enableFor.user.colin = true;
matrix-synapse.enableFor.user.colin = true;
signaldctl.enableFor.user.colin = true;
};
sane.programs.clightning-sane.enableFor.user.colin = true;
# sane.programs.freshrss.enableFor.user.colin = true;
# sane.programs.signaldctl.enableFor.user.colin = true;
# sane.programs.matrix-synapse.enableFor.user.colin = true;
sane.roles.build-machine.enable = true;
sane.programs.zsh.config.showDeadlines = false; # ~/knowledge doesn't always exist
sane.programs.sane-deadlines.config.showOnLogin = false; # ~/knowledge doesn't always exist
sane.programs.consoleUtils.suggestedPrograms = [
"consoleMediaUtils" # notably, for go2tv / casting
"pcConsoleUtils"
@@ -33,10 +32,12 @@
sane.nixcache.remote-builders.desko = false;
sane.nixcache.remote-builders.servo = false;
# sane.services.duplicity.enable = true; # TODO: re-enable after HW upgrade
sane.services.rsync-net.enable = true;
# automatically log in at the virtual consoles.
# using root here makes sure we always have an escape hatch
services.getty.autologinUser = "root";
# using root here makes sure we always have an escape hatch.
# XXX(2024-07-27): this is incompatible with my s6-rc stuff, which needs to auto-login as `colin` to start its user services.
# services.getty.autologinUser = "root";
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];

View File

@@ -14,7 +14,7 @@
# show zfs datasets: `zfs list` (will be empty if haven't imported)
# show zfs properties (e.g. compression): `zfs get all pool`
# set zfs properties: `zfs set compression=on pool`
{ ... }:
{ lib, pkgs, ... }:
{
# hostId: not used for anything except zfs guardrail?
@@ -54,7 +54,7 @@
options = [ "acl" ]; #< not sure if this `acl` flag is actually necessary. it mounts without it.
};
# services.zfs.zed = ... # TODO: zfs can send me emails when disks fail
sane.programs.sysadminUtils.suggestedPrograms = [ "zfs" ];
sane.programs.sysadminUtils.suggestedPrograms = [ "zfs-tools" ];
sane.persist.stores."ext" = {
origin = "/mnt/pool/persist";
@@ -131,6 +131,20 @@
the contents should be a subset of what's in ../media/datasets.
'';
systemd.services.dedupe-media = {
description = "transparently de-duplicate /var/media entries by using block-level hardlinks";
script = ''
${lib.getExe' pkgs.util-linux "hardlink"} /var/media --reflink=always --ignore-time --verbose
'';
};
systemd.timers.dedupe-media = {
wantedBy = [ "multi-user.target" ];
timerConfig = {
OnStartupSec = "23min";
OnUnitActiveSec = "720min";
};
};
# btrfs doesn't easily support swapfiles
# swapDevices = [
# { device = "/nix/persist/swapfile"; size = 4096; }

View File

@@ -30,6 +30,14 @@ in
config = {
networking.domain = "uninsane.org";
systemd.network.networks."50-eth0" = {
matchConfig.Name = "eth0";
networkConfig.Address = [
"205.201.63.12/32"
"10.78.79.51/22"
];
networkConfig.DNS = [ "10.78.79.1" ];
};
sane.ports.openFirewall = true;
sane.ports.openUpnp = true;

View File

@@ -1,34 +0,0 @@
{ config, lib, ... }:
let
cweb-cfg = config.services.calibre-web;
inherit (cweb-cfg) user group;
inherit (cweb-cfg.listen) ip port;
svc-dir = "/var/lib/${cweb-cfg.dataDir}";
in
# XXX: disabled because of runtime errors like:
# > File "/nix/store/c7jqvx980nlg9xhxi065cba61r2ain9y-calibre-web-0.6.19/lib/python3.10/site-packages/calibreweb/cps/db.py", line 926, in speaking_language
# > languages = self.session.query(Languages) \
# > AttributeError: 'NoneType' object has no attribute 'query'
lib.mkIf false
{
sane.persist.sys.byStore.plaintext = [
{ inherit user group; mode = "0700"; path = svc-dir; method = "bind"; }
];
services.calibre-web.enable = true;
services.calibre-web.listen.ip = "127.0.0.1";
# XXX: externally populate `${svc-dir}/metadata.db` (once) from
# <https://github.com/janeczku/calibre-web/blob/master/library/metadata.db>
# i don't know why you have to do this??
# services.calibre-web.options.calibreLibrary = svc-dir;
services.nginx.virtualHosts."calibre.uninsane.org" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${ip}:${builtins.toString port}";
};
};
sane.dns.zones."uninsane.org".inet.CNAME."calibre" = "native";
}

View File

@@ -36,7 +36,8 @@
# - rb = received bytes
# - sp = sent packets
# - sb = sent bytes
{ lib, ... }:
{ config, lib, ... }:
let
# TURN port range (inclusive).
# default coturn behavior is to use the upper quarter of all ports. i.e. 49152 - 65535.
@@ -130,11 +131,11 @@ in
"verbose"
# "Verbose" #< even MORE verbosity than "verbose" (it's TOO MUCH verbosity really)
"no-multicast-peers" # disables sending to IPv4 broadcast addresses (e.g. 224.0.0.0/3)
# "listening-ip=10.0.1.5" "external-ip=185.157.162.178" #< 2024/04/25: works, if running in root namespace
"listening-ip=185.157.162.178" "external-ip=185.157.162.178"
# "listening-ip=${config.sane.netns.ovpns.hostVethIpv4}" "external-ip=${config.sane.netns.ovpns.netnsPubIpv4}" #< 2024/04/25: works, if running in root namespace
"listening-ip=${config.sane.netns.ovpns.netnsPubIpv4}" "external-ip=${config.sane.netns.ovpns.netnsPubIpv4}"
# old attempts:
# "external-ip=185.157.162.178/10.0.1.5"
# "external-ip=${config.sane.netns.ovpns.netnsPubIpv4}/${config.sane.netns.ovpns.hostVethIpv4}"
# "listening-ip=10.78.79.51" # can be specified multiple times; omit for *
# "external-ip=97.113.128.229/10.78.79.51"
# "external-ip=97.113.128.229"

View File

@@ -16,14 +16,17 @@
# - validate with `bitcoin-cli -netinfo`
{ config, lib, pkgs, sane-lib, ... }:
let
# bitcoind = config.sane.programs.bitcoind.packageUnwrapped;
bitcoind = pkgs.bitcoind;
# wrapper to run bitcoind with the tor onion address as externalip (computed at runtime)
_bitcoindWithExternalIp = with pkgs; writeShellScriptBin "bitcoind" ''
_bitcoindWithExternalIp = pkgs.writeShellScriptBin "bitcoind" ''
set -xeu
externalip="$(cat /var/lib/tor/onion/bitcoind/hostname)"
exec ${bitcoind}/bin/bitcoind "-externalip=$externalip" "$@"
'';
# the package i provide to services.bitcoind ends up on system PATH, and used by other tools like clightning.
# therefore, even though services.bitcoind only needs `bitcoind` binary, provide all the other bitcoin-related binaries (notably `bitcoin-cli`) as well:
bitcoindWithExternalIp = with pkgs; symlinkJoin {
bitcoindWithExternalIp = pkgs.symlinkJoin {
name = "bitcoind-with-external-ip";
paths = [ _bitcoindWithExternalIp bitcoind ];
};
@@ -61,23 +64,62 @@ in
passwordHMAC = "30002c05d82daa210550e17a182db3f3$6071444151281e1aa8a2729f75e3e2d224e9d7cac3974810dab60e7c28ffaae4";
};
extraConfig = ''
# checkblocks: default 6: how many blocks to verify on start
checkblocks=3
# don't load the wallet, and disable wallet RPC calls
disablewallet=1
# proxy all outbound traffic through Tor
proxy=127.0.0.1:9050
'';
extraCmdlineOptions = [
# "-debug"
# "-debug=estimatefee"
# "-debug=http"
# "-debug=net"
"-debug=proxy"
"-debug=rpc"
# "-debug=validation"
];
};
users.users.bitcoind-mainnet.extraGroups = [ "tor" ];
systemd.services.bitcoind-mainnet.serviceConfig.RestartSec = "30s"; #< default is 0
systemd.services.bitcoind-mainnet = {
after = [ "tor.service" ];
requires = [ "tor.service" ];
serviceConfig.RestartSec = "30s"; #< default is 0
# hardening (systemd-analyze security bitcoind-mainnet)
serviceConfig.StateDirectory = "bitcoind-mainnet";
serviceConfig.LockPersonality = true;
serviceConfig.MemoryDenyWriteExecute = "true";
serviceConfig.NoNewPrivileges = "true";
serviceConfig.PrivateDevices = "true";
serviceConfig.PrivateMounts = true;
serviceConfig.PrivateTmp = "true";
serviceConfig.PrivateUsers = true;
serviceConfig.ProcSubset = "pid";
serviceConfig.ProtectControlGroups = true;
serviceConfig.ProtectHome = true;
serviceConfig.ProtectHostname = true;
serviceConfig.ProtectKernelLogs = true;
serviceConfig.ProtectKernelModules = true;
serviceConfig.ProtectKernelTunables = true;
serviceConfig.ProtectProc = "invisible";
serviceConfig.ProtectSystem = lib.mkForce "strict";
serviceConfig.RemoveIPC = true;
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
serviceConfig.RestrictNamespaces = true;
serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native";
serviceConfig.SystemCallFilter = [ "@system-service" ];
};
sane.users.colin.fs.".bitcoin/bitcoin.conf" = sane-lib.fs.wantedSymlinkTo config.sops.secrets."bitcoin.conf".path;
sops.secrets."bitcoin.conf" = {
mode = "0600";
owner = "colin";
group = "users";
};
sane.programs.bitcoind.enableFor.user.colin = true; # for debugging/administration: `bitcoin-cli`
sane.programs.bitcoin-cli.enableFor.user.colin = true; # for debugging/administration: `bitcoin-cli`
}

View File

@@ -72,13 +72,11 @@
{ config, pkgs, ... }:
{
sane.persist.sys.byStore.ext = [
sane.persist.sys.byStore.private = [
# clightning takes up only a few MB. but then several hundred MB of crash logs that i should probably GC.
{ user = "clightning"; group = "clightning"; mode = "0710"; path = "/var/lib/clightning"; method = "bind"; }
];
# `lightning-cli` finds its RPC file via `~/.lightning/bitcoin/lightning-rpc`, to message the daemon
sane.user.fs.".lightning".symlink.target = "/var/lib/clightning";
# see bitcoin.nix for how to generate this
services.bitcoind.mainnet.rpc.users.clightning.passwordHMAC =
"befcb82d9821049164db5217beb85439$2c31ac7db3124612e43893ae13b9527dbe464ab2d992e814602e7cb07dc28985";
@@ -105,6 +103,7 @@
users.users.clightning.extraGroups = [ "tor" ];
systemd.services.clightning.after = [ "tor.service" ];
systemd.services.clightning.requires = [ "tor.service" ];
# lightning-config contains fields from here:
# - <https://docs.corelightning.org/docs/configuration>
@@ -116,11 +115,16 @@
# - fee-per-satoshi=<ppm>
# - feature configs (i.e. experimental-xyz options)
sane.services.clightning.extraConfig = ''
log-level=debug:lightningd
# log levels: "io", "debug", "info", "unusual", "broken"
log-level=info
# log-level=info:lightningd
# log-level=debug:lightningd
# log-level=debug
# peerswap:
# - config example: <https://github.com/fort-nix/nix-bitcoin/pull/462/files#diff-b357d832705b8ce8df1f41934d613f79adb77c4cd5cd9e9eb12a163fca3e16c6>
# XXX: peerswap crashes clightning on launch. stacktrace is useless.
# plugin=${pkgs.peerswap}/bin/peerswap
# plugin={pkgs.peerswap}/bin/peerswap
# peerswap-db-path=/var/lib/clightning/peerswap/swaps
# peerswap-policy-path=...
'';
@@ -131,5 +135,5 @@
group = "clightning";
};
sane.programs.clightning.enableFor.user.colin = true; # for debugging/admin: `lightning-cli`
sane.programs.lightning-cli.enableFor.user.colin = true; # for debugging/admin:
}

View File

@@ -1,4 +1,5 @@
{ ... }:
{ lib, ... }:
lib.mkIf false #< 2024/07/27: i don't use it, too much surface-area for me to run it pro-bono (`systemd-analyze security monero`)
{
services.i2p.enable = true;
}

View File

@@ -1,5 +1,6 @@
# as of 2023/11/26: complete downloaded blockchain should be 200GiB on disk, give or take.
{ ... }:
{ lib, ... }:
lib.mkIf false #< 2024/07/27: i don't use it, too much surface-area for me to run it pro-bono (`systemd-analyze security monero`)
{
sane.persist.sys.byStore.ext = [
# /var/lib/monero/lmdb is what consumes most of the space

View File

@@ -1,9 +1,9 @@
# tor settings: <https://2019.www.torproject.org/docs/tor-manual.html.en>
{ lib, ... }:
{
# tor hidden service hostnames aren't deterministic, so persist.
# might be able to get away with just persisting /var/lib/tor/onion, not sure.
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.ephemeral = [
# N.B.: tor hidden service hostnames aren't deterministic, so if you need them
# to be preserved across reboots then persist /var/lib/tor/onion in "private" store.
{ user = "tor"; group = "tor"; mode = "0710"; path = "/var/lib/tor"; method = "bind"; }
];

View File

@@ -1,7 +1,6 @@
{ ... }:
{
imports = [
./calibre.nix
./coturn.nix
./cryptocurrencies
./email
@@ -11,7 +10,7 @@
./gitea.nix
./goaccess.nix
./ipfs.nix
./jackett.nix
./jackett
./jellyfin.nix
./kiwix-serve.nix
./komga.nix
@@ -26,7 +25,7 @@
./postgres.nix
./prosody
./slskd.nix
./transmission.nix
./transmission
./trust-dns.nix
./wikipedia.nix
];

View File

@@ -44,61 +44,61 @@ in
# everything configured below was fine: used ejabberd for several months.
lib.mkIf false
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
{ user = "ejabberd"; group = "ejabberd"; path = "/var/lib/ejabberd"; method = "bind"; }
];
sane.ports.ports = lib.mkMerge ([
{
"3478" = {
protocol = [ "tcp" "udp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-stun-turn";
};
"5222" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-client-to-server";
};
"5223" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpps-client-to-server"; # XMPP over TLS
};
"5269" = {
protocol = [ "tcp" ];
visibleTo.wan = true;
visibleTo.doof = true;
description = "colin-xmpp-server-to-server";
};
"5270" = {
protocol = [ "tcp" ];
visibleTo.wan = true;
visibleTo.doof = true;
description = "colin-xmpps-server-to-server"; # XMPP over TLS
};
"5280" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-bosh";
};
"5281" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-bosh-https";
};
"5349" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-stun-turn-over-tls";
};
"5443" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-web-services"; # file uploads, websockets, admin
};
}
@@ -109,8 +109,8 @@ lib.mkIf false
numPorts = turnPortHigh - turnPortLow + 1;
in {
protocol = [ "tcp" "udp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-turn-${builtins.toString count}-of-${builtins.toString numPorts}";
};
})

View File

@@ -8,14 +8,14 @@
{
sane.ports.ports."143" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-imap-imap.uninsane.org";
};
sane.ports.ports."993" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-imaps-imap.uninsane.org";
};
@@ -83,8 +83,8 @@
# sieve_plugins = sieve_imapsieve
# }
mail_debug = yes
auth_debug = yes
# mail_debug = yes
# auth_debug = yes
# verbose_ssl = yes
'';

View File

@@ -1,6 +1,6 @@
# postfix config options: <https://www.postfix.org/postconf.5.html>
{ lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
submissionOptions = {
@@ -18,10 +18,10 @@ let
};
in
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
# TODO: mode? could be more granular
{ user = "opendkim"; group = "opendkim"; path = "/var/lib/opendkim"; method = "bind"; }
{ user = "root"; group = "root"; path = "/var/lib/postfix"; method = "bind"; }
{ user = "root"; group = "root"; path = "/var/lib/postfix"; method = "bind"; } #< probably not *all* of postfix needs to actually be persisted (e.g. not the conf dir)
{ user = "root"; group = "root"; path = "/var/spool/mail"; method = "bind"; }
# *probably* don't need these dirs:
# "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix
@@ -56,8 +56,7 @@ in
sane.dns.zones."uninsane.org".inet = {
MX."@" = "10 mx.uninsane.org.";
# XXX: RFC's specify that the MX record CANNOT BE A CNAME
A."mx" = "185.157.162.178";
A."mx" = "%AOVPNS%"; #< XXX: RFC's specify that the MX record CANNOT BE A CNAME. TODO: use "%AOVPNS%?
# Sender Policy Framework:
# +mx => mail passes if it originated from the MX

View File

@@ -37,7 +37,8 @@
wantedBy = [ "nfs.service" "sftpgo.service" ];
file.text = ''
- media/ read-only: Videos, Music, Books, etc
- playground/ read-write: use it to share files with other users of this server
- playground/ read-write: use it to share files with other users of this server, inaccessible from the www
- pub/ read-only: content made to be shared with the www
'';
};
@@ -50,4 +51,11 @@
- be a friendly troll
'';
};
sane.fs."/var/export/.public_for_test/test" = {
wantedBy = [ "nfs.service" "sftpgo.service" ];
file.text = ''
automated tests read this file to probe connectivity
'';
};
}

View File

@@ -9,10 +9,10 @@
{ config, lib, pkgs, sane-lib, ... }:
let
external_auth_hook = pkgs.static-nix-shell.mkPython3Bin {
external_auth_hook = pkgs.static-nix-shell.mkPython3 {
pname = "external_auth_hook";
srcRoot = ./.;
pyPkgs = [ "passlib" ];
pkgs = [ "python3.pkgs.passlib" ];
};
# Client initiates a FTP "control connection" on port 21.
# - this handles the client -> server commands, and the server -> client status, but not the actual data
@@ -27,13 +27,12 @@ in
"21" = {
protocol = [ "tcp" ];
visibleTo.lan = true;
# visibleTo.wan = true;
description = "colin-FTP server";
};
"990" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-FTPS server";
};
} // (sane-lib.mapToAttrs
@@ -41,8 +40,8 @@ in
name = builtins.toString port;
value = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-FTP server data port range";
};
})
@@ -81,12 +80,6 @@ in
port = 21;
debug = true;
}
{
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
address = "10.78.79.51";
port = 21;
debug = true;
}
{
# binding this means any wireguard client can connect
address = "10.0.10.5";
@@ -97,6 +90,26 @@ in
{
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
address = "10.78.79.51";
port = 21;
debug = true;
}
{
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
address = "10.78.79.51";
port = 990;
debug = true;
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
}
{
# binding this means any doof client can connect (TLS only)
address = config.sane.netns.doof.hostVethIpv4;
port = 990;
debug = true;
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
}
{
# binding this means any LAN client can connect via `ftp.uninsane.org` (TLS only)
address = config.sane.netns.doof.netnsPubIpv4;
port = 990;
debug = true;
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
@@ -117,7 +130,7 @@ in
banner = ''
Welcome, friends, to Colin's FTP server! Also available via NFS on the same host, but LAN-only.
Read-only access (LAN-restricted):
Read-only access (LAN clients see everything; WAN clients can only see /pub):
Username: "anonymous"
Password: "anonymous"

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.passlib ])"
#!nix-shell -i python3 -p python3 -p python3.pkgs.passlib
# vim: set filetype=python :
#
# available environment variables:
@@ -45,6 +45,8 @@ from hmac import compare_digest
authFail = dict(username="")
PERM_DENY = []
PERM_LIST = [ "list" ]
PERM_RO = [ "list", "download" ]
PERM_RW = [
# read-only:
@@ -127,12 +129,14 @@ def getAuthResponse(ip: str, username: str, password: str) -> dict:
return mkAuthOk(username, permissions = {
"/": PERM_RW,
"/playground": PERM_RW,
"/.public_for_test": PERM_RO,
})
if isWireguard(ip):
# allow any user from wireguard
return mkAuthOk(username, permissions = {
"/": PERM_RW,
"/playground": PERM_RW,
"/.public_for_test": PERM_RO,
})
if isLan(ip):
if username == "anonymous":
@@ -140,6 +144,18 @@ def getAuthResponse(ip: str, username: str, password: str) -> dict:
return mkAuthOk("anonymous", permissions = {
"/": PERM_RO,
"/playground": PERM_RW,
"/.public_for_test": PERM_RO,
})
if username == "anonymous":
# anonymous users from the www can have even more limited access.
# mostly because i need an easy way to test WAN connectivity :-)
return mkAuthOk("anonymous", permissions = {
# "/": PERM_DENY,
"/": PERM_LIST, #< REQUIRED, even for lftp to list a subdir
"/media": PERM_DENY,
"/playground": PERM_DENY,
"/.public_for_test": PERM_RO,
# "/README.md": PERM_RO, #< does not work
})
return authFail

View File

@@ -10,6 +10,7 @@
# ```
{ config, lib, pkgs, sane-lib, ... }:
lib.mkIf false #< 2024/07/04: i haven't actively used this for months
{
sops.secrets."freshrss_passwd" = {
owner = config.users.users.freshrss.name;

View File

@@ -2,9 +2,8 @@
{ config, pkgs, lib, ... }:
{
sane.persist.sys.byStore.plaintext = [
# TODO: mode? could be more granular
{ user = "git"; group = "gitea"; path = "/var/lib/gitea"; method = "bind"; }
sane.persist.sys.byStore.private = [
{ user = "git"; group = "gitea"; mode = "0750"; path = "/var/lib/gitea"; method = "bind"; }
];
services.gitea.enable = true;
services.gitea.user = "git"; # default is 'gitea'
@@ -38,12 +37,12 @@
ROOT_URL = "https://git.uninsane.org/";
};
service = {
# timeout for email approval. 5760 = 4 days
ACTIVE_CODE_LIVE_MINUTES = 5760;
# timeout for email approval. 5760 = 4 days. 10080 = 7 days
ACTIVE_CODE_LIVE_MINUTES = 10080;
# REGISTER_EMAIL_CONFIRM = false;
# REGISTER_MANUAL_CONFIRM = true;
REGISTER_EMAIL_CONFIRM = true;
# not sure what this notified on?
# not sure what this notifies *on*...
ENABLE_NOTIFY_MAIL = true;
# defaults to image-based captcha.
# also supports recaptcha (with custom URLs) or hCaptcha.
@@ -64,8 +63,8 @@
SHOW_FOOTER_TEMPLATE_LOAD_TIME = false;
};
ui = {
# options: "auto", "gitea", "arc-green"
DEFAULT_THEME = "arc-green";
# options: "gitea-auto" (adapt to system theme), "gitea-dark", "gitea-light"
# DEFAULT_THEME = "gitea-auto";
# cache frontend assets if true
# USE_SERVICE_WORKER = true;
};
@@ -74,9 +73,10 @@
# alternative is to use nixos-level config:
# services.gitea.mailerPasswordFile = ...
ENABLED = true;
MAILER_TYPE = "sendmail";
FROM = "notify.git@uninsane.org";
PROTOCOL = "sendmail";
SENDMAIL_PATH = "${pkgs.postfix}/bin/sendmail";
SENDMAIL_ARGS = "--"; # most "sendmail" programs take options, "--" will prevent an email address being interpreted as an option.
};
time = {
# options: ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro, StampNano
@@ -108,6 +108,10 @@
locations."/" = {
proxyPass = "http://127.0.0.1:3000";
};
# fuck you @anthropic
locations."= /robots.txt".extraConfig = ''
return 200 "User-agent: *\nDisallow: /\n";
'';
# gitea serves all `raw` files as content-type: plain, but i'd like to serve them as their actual content type.
# or at least, enough to make specific pages viewable (serving unoriginal content as arbitrary content type is dangerous).
locations."~ ^/colin/phone-case-cq/raw/.*.html" = {
@@ -133,7 +137,7 @@
sane.ports.ports."22" = {
protocol = [ "tcp" ];
visibleTo.lan = true;
visibleTo.wan = true;
visibleTo.doof = true;
description = "colin-git@git.uninsane.org";
};
}

View File

@@ -10,7 +10,7 @@
lib.mkIf false # i don't actively use ipfs anymore
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
# TODO: mode? could be more granular
{ user = "261"; group = "261"; path = "/var/lib/ipfs"; method = "bind"; }
];

View File

@@ -1,36 +0,0 @@
{ lib, pkgs, ... }:
lib.mkIf false #< TODO: re-enable once confident of sandboxing
{
sane.persist.sys.byStore.plaintext = [
# TODO: mode? we only need this to save Indexer creds ==> migrate to config?
{ user = "root"; group = "root"; path = "/var/lib/jackett"; method = "bind"; }
];
services.jackett.enable = true;
systemd.services.jackett.after = [ "wireguard-wg-ovpns.service" ];
systemd.services.jackett.partOf = [ "wireguard-wg-ovpns.service" ];
systemd.services.jackett.serviceConfig = {
# run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns";
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
# patch jackett to listen on the public interfaces
# ExecStart = lib.mkForce "${pkgs.jackett}/bin/Jackett --NoUpdates --DataFolder /var/lib/jackett/.config/Jackett --ListenPublic";
};
# jackett torrent search
services.nginx.virtualHosts."jackett.uninsane.org" = {
forceSSL = true;
enableACME = true;
# inherit kTLS;
locations."/" = {
# proxyPass = "http://ovpns.uninsane.org:9117";
proxyPass = "http://10.0.1.6:9117";
recommendedProxySettings = true;
};
};
sane.dns.zones."uninsane.org".inet.CNAME."jackett" = "native";
}

View File

@@ -0,0 +1,68 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.jackett;
in
{
sane.persist.sys.byStore.private = [
# TODO: mode? we only need this to save Indexer creds ==> migrate to config?
{ user = "jackett"; group = "jackett"; path = "/var/lib/jackett"; method = "bind"; }
];
services.jackett.enable = true;
systemd.services.jackett.after = [ "wireguard-wg-ovpns.service" ];
systemd.services.jackett.partOf = [ "wireguard-wg-ovpns.service" ];
systemd.services.jackett = {
# run this behind the OVPN static VPN
serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
serviceConfig.ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # abort if public IP is not as expected
# patch in `--ListenPublic` so that it's reachable from the netns veth.
# this also makes it reachable from the VPN pub address. oh well.
serviceConfig.ExecStart = lib.mkForce "${cfg.package}/bin/Jackett --ListenPublic --NoUpdates --DataFolder '${cfg.dataDir}'";
serviceConfig.RestartSec = "30s";
# hardening (systemd-analyze security jackett)
# TODO: upstream into nixpkgs
serviceConfig.StateDirectory = "jackett";
serviceConfig.LockPersonality = true;
serviceConfig.NoNewPrivileges = true;
# serviceConfig.MemoryDenyWriteExecute = true; #< Failed to create CoreCLR, HRESULT: 0x80004005
serviceConfig.PrivateDevices = true;
serviceConfig.PrivateMounts = true;
serviceConfig.PrivateTmp = true;
serviceConfig.PrivateUsers = true;
serviceConfig.ProcSubset = "pid";
serviceConfig.ProtectClock = true;
serviceConfig.ProtectControlGroups = true;
serviceConfig.ProtectHome = true;
serviceConfig.ProtectHostname = true;
serviceConfig.ProtectKernelLogs = true;
serviceConfig.ProtectKernelModules = true;
serviceConfig.ProtectKernelTunables = true;
serviceConfig.ProtectProc = "invisible";
serviceConfig.ProtectSystem = "strict";
serviceConfig.RemoveIPC = true;
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
serviceConfig.RestrictNamespaces = true;
serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native";
serviceConfig.SystemCallFilter = [ "@system-service" "~@privileged" ];
};
# jackett torrent search
services.nginx.virtualHosts."jackett.uninsane.org" = {
forceSSL = true;
enableACME = true;
# inherit kTLS;
locations."/" = {
proxyPass = "http://${config.sane.netns.ovpns.netnsVethIpv4}:9117";
recommendedProxySettings = true;
};
locations."= /robots.txt".extraConfig = ''
return 200 "User-agent: *\nDisallow: /\n";
'';
};
sane.dns.zones."uninsane.org".inet.CNAME."jackett" = "native";
}

View File

@@ -21,6 +21,9 @@
enableACME = true;
# inherit kTLS;
locations."/".proxyPass = "http://127.0.0.1:8013";
locations."= /robots.txt".extraConfig = ''
return 200 "User-agent: *\nDisallow: /\n";
'';
};
sane.dns.zones."uninsane.org".inet.CNAME."w" = "native";

View File

@@ -17,6 +17,9 @@ in
locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString port}";
};
locations."= /robots.txt".extraConfig = ''
return 200 "User-agent: *\nDisallow: /\n";
'';
};
sane.dns.zones."uninsane.org".inet.CNAME."komga" = "native";
}

View File

@@ -38,14 +38,10 @@ in {
nginx.enable = true;
};
systemd.services.lemmy.serviceConfig = {
# fix to use a normal user so we can configure perms correctly
DynamicUser = mkForce false;
User = "lemmy";
Group = "lemmy";
};
systemd.services.lemmy.environment = {
RUST_BACKTRACE = "full";
RUST_LOG = "error";
# RUST_LOG = "warn";
# RUST_LOG = "debug";
# RUST_LOG = "trace";
# upstream defaults LEMMY_DATABASE_URL = "postgres:///lemmy?host=/run/postgresql";
@@ -72,6 +68,73 @@ in {
sane.dns.zones."uninsane.org".inet.CNAME."lemmy" = "native";
systemd.services.lemmy = {
# fix to use a normal user so we can configure perms correctly
# XXX(2024-07-28): this hasn't been rigorously tested:
# possible that i've set something too strict and won't notice right away
serviceConfig.DynamicUser = mkForce false;
serviceConfig.User = "lemmy";
serviceConfig.Group = "lemmy";
# hardening (systemd-analyze security lemmy)
# a handful of these are specified in upstream nixpkgs, but mostly not
serviceConfig.LockPersonality = true;
serviceConfig.NoNewPrivileges = true;
serviceConfig.MemoryDenyWriteExecute = true;
serviceConfig.PrivateDevices = true;
serviceConfig.PrivateMounts = true;
serviceConfig.PrivateTmp = true;
serviceConfig.PrivateUsers = true;
serviceConfig.ProcSubset = "pid";
serviceConfig.ProtectClock = true;
serviceConfig.ProtectControlGroups = true;
serviceConfig.ProtectHome = true;
serviceConfig.ProtectHostname = true;
serviceConfig.ProtectKernelLogs = true;
serviceConfig.ProtectKernelModules = true;
serviceConfig.ProtectKernelTunables = true;
serviceConfig.ProtectProc = "invisible";
serviceConfig.ProtectSystem = "strict";
serviceConfig.RemoveIPC = true;
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
serviceConfig.RestrictNamespaces = true;
serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native";
serviceConfig.SystemCallFilter = [ "@system-service" ];
};
systemd.services.lemmy-ui = {
# hardening (systemd-analyze security lemmy-ui)
# TODO: upstream into nixpkgs
serviceConfig.LockPersonality = true;
serviceConfig.NoNewPrivileges = true;
# serviceConfig.MemoryDenyWriteExecute = true; #< it uses v8, JIT
serviceConfig.PrivateDevices = true;
serviceConfig.PrivateMounts = true;
serviceConfig.PrivateTmp = true;
serviceConfig.PrivateUsers = true;
serviceConfig.ProcSubset = "pid";
serviceConfig.ProtectClock = true;
serviceConfig.ProtectControlGroups = true;
serviceConfig.ProtectHome = true;
serviceConfig.ProtectHostname = true;
serviceConfig.ProtectKernelLogs = true;
serviceConfig.ProtectKernelModules = true;
serviceConfig.ProtectKernelTunables = true;
serviceConfig.ProtectProc = "invisible";
serviceConfig.ProtectSystem = "strict";
serviceConfig.RemoveIPC = true;
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
serviceConfig.RestrictNamespaces = true;
serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native";
serviceConfig.SystemCallFilter = [ "@system-service" "@pkey" "@sandbox" ];
};
#v DO NOT REMOVE: defaults to 0.3, instead of latest, so always need to explicitly set this.
services.pict-rs.package = pict-rs;
@@ -81,10 +144,38 @@ in {
# - via CLI flags (overrides everything above)
# some of the CLI flags have defaults, making it the only actual way to configure certain things even when docs claim otherwise.
# CLI args: <https://git.asonix.dog/asonix/pict-rs#user-content-running>
systemd.services.pict-rs.serviceConfig.ExecStart = lib.mkForce (lib.concatStringsSep " " [
systemd.services.pict-rs = {
serviceConfig.ExecStart = lib.mkForce (lib.concatStringsSep " " [
"${lib.getBin pict-rs}/bin/pict-rs run"
"--media-video-max-frame-count" (builtins.toString (30*60*60))
"--media-process-timeout 120"
"--media-video-allow-audio" # allow audio
]);
# hardening (systemd-analyze security pict-rs)
# TODO: upstream into nixpkgs
serviceConfig.LockPersonality = true;
serviceConfig.NoNewPrivileges = true;
serviceConfig.MemoryDenyWriteExecute = true;
serviceConfig.PrivateDevices = true;
serviceConfig.PrivateMounts = true;
serviceConfig.PrivateTmp = true;
serviceConfig.PrivateUsers = true;
serviceConfig.ProcSubset = "pid";
serviceConfig.ProtectClock = true;
serviceConfig.ProtectControlGroups = true;
serviceConfig.ProtectHome = true;
serviceConfig.ProtectHostname = true;
serviceConfig.ProtectKernelLogs = true;
serviceConfig.ProtectKernelModules = true;
serviceConfig.ProtectKernelTunables = true;
serviceConfig.ProtectProc = "invisible";
serviceConfig.ProtectSystem = "strict";
serviceConfig.RemoveIPC = true;
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
serviceConfig.RestrictNamespaces = true;
serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native";
serviceConfig.SystemCallFilter = [ "@system-service" ];
};
}

View File

@@ -1,6 +1,6 @@
# docs: <https://nixos.wiki/wiki/Matrix>
# docs: <https://nixos.org/manual/nixos/stable/index.html#module-services-matrix-synapse>
# example config: <https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml>
# example config: <https://github.com/element-hq/synapse/blob/develop/docs/sample_config.yaml>
#
# ENABLING PUSH NOTIFICATIONS (with UnifiedPush/ntfy):
# - Matrix "pushers" API spec: <https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3pushersset>
@@ -20,14 +20,12 @@
./signal.nix
];
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
{ user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/matrix-synapse"; method = "bind"; }
];
services.matrix-synapse.enable = true;
services.matrix-synapse.log.root.level = "ERROR"; # accepts "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" (?)
services.matrix-synapse.settings = {
# this changes the default log level from INFO to WARN.
# maybe there's an easier way?
log_config = ./synapse-log_level.yaml;
server_name = "uninsane.org";
# services.matrix-synapse.enable_registration_captcha = true;

View File

@@ -5,7 +5,7 @@
# - recommended to use mautrix-discord: <https://github.com/NixOS/nixpkgs/pull/200462>
lib.mkIf false
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
{ user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/mx-puppet-discord"; method = "bind"; }
];

View File

@@ -1,15 +1,13 @@
# config docs:
# - <https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml>
# probably want to remove that.
{ config, lib, ... }:
let
ircServer = { name, additionalAddresses ? [], sasl ? true, port ? 6697 }: let
ircServer = { name, additionalAddresses ? [], ssl ? true, sasl ? true, port ? if ssl then 6697 else 6667 }: let
lowerName = lib.toLower name;
in {
# XXX sasl: appservice doesn't support NickServ identification (only SASL, or PASS if sasl = false)
inherit name additionalAddresses sasl port;
ssl = true;
inherit additionalAddresses name port sasl ssl;
botConfig = {
# bot has no presence in IRC channel; only real Matrix users
enabled = false;
@@ -101,7 +99,7 @@ in
})
];
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
# TODO: mode?
{ user = "matrix-appservice-irc"; group = "matrix-appservice-irc"; path = "/var/lib/matrix-appservice-irc"; method = "bind"; }
];
@@ -129,6 +127,7 @@ in
};
ircService = {
logging.level = "warn"; # "error", "warn", "info", "debug"
servers = {
"irc.esper.net" = ircServer {
name = "esper";
@@ -156,6 +155,10 @@ in
# - #sxmo-offtopic
};
"irc.rizon.net" = ircServer { name = "Rizon"; };
"wigle.net" = ircServer {
name = "WiGLE";
ssl = false;
};
};
};
};

View File

@@ -4,7 +4,7 @@
lib.mkIf false # disabled 2024/01/11: i don't use it, and pkgs.mautrix-signal had some API changes
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
{ user = "mautrix-signal"; group = "mautrix-signal"; path = "/var/lib/mautrix-signal"; method = "bind"; }
{ user = "signald"; group = "signald"; path = "/var/lib/signald"; method = "bind"; }
];

View File

@@ -1,27 +0,0 @@
version: 1
# In systemd's journal, loglevel is implicitly stored, so let's omit it
# from the message text.
formatters:
journal_fmt:
format: '%(name)s: [%(request)s] %(message)s'
filters:
context:
(): synapse.util.logcontext.LoggingContextFilter
request: ""
handlers:
journal:
class: systemd.journal.JournalHandler
formatter: journal_fmt
filters: [context]
SYSLOG_IDENTIFIER: synapse
# default log level: INFO
root:
level: WARN
handlers: [journal]
disable_existing_loggers: False

View File

@@ -17,7 +17,6 @@ in
sane.ports.ports."80" = {
protocol = [ "tcp" ];
visibleTo.lan = true;
visibleTo.wan = true;
visibleTo.ovpns = true; # so that letsencrypt can procure a cert for the mx record
visibleTo.doof = true;
description = "colin-http-uninsane.org";
@@ -25,12 +24,17 @@ in
sane.ports.ports."443" = {
protocol = [ "tcp" ];
visibleTo.lan = true;
visibleTo.wan = true;
visibleTo.doof = true;
description = "colin-https-uninsane.org";
};
services.nginx.enable = true;
# nginxStable is one release behind nginxMainline.
# nginx itself recommends running mainline; nixos defaults to stable.
# services.nginx.package = pkgs.nginxMainline;
# XXX(2024-07-31): nixos defaults to zlib-ng -- supposedly more performant, but spams log with
# "gzip filter failed to use preallocated memory: ..."
services.nginx.package = pkgs.nginxMainline.override { zlib = pkgs.zlib; };
services.nginx.appendConfig = ''
# use 1 process per core.
# may want to increase worker_connections too, but `ulimit -n` must be increased first.
@@ -46,8 +50,10 @@ in
log_format vcombined '$host:$server_port $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referrer" "$http_user_agent"';
access_log /var/log/nginx/private.log vcombined;
'';
# sets gzip_comp_level = 5
# enables gzip and sets gzip_comp_level = 5
services.nginx.recommendedGzipSettings = true;
# enables zstd and sets zstd_comp_level = 9
services.nginx.recommendedZstdSettings = true;
# enables OCSP stapling (so clients don't need contact the OCSP server -- i do instead)
# - doesn't seem to, actually: <https://www.ssllabs.com/ssltest/analyze.html?d=uninsane.org>
# caches TLS sessions for 10m
@@ -101,6 +107,16 @@ in
disable_symlinks on;
'';
};
locations."/share/Ubunchu/" = {
alias = "/var/media/Books/Visual/HiroshiSeo/Ubunchu/";
extraConfig = ''
# autoindex => render directory listings
autoindex on;
# don't follow any symlinks when serving files
# otherwise it allows a directory escape
disable_symlinks on;
'';
};
# allow matrix users to discover that @user:uninsane.org is reachable via matrix.uninsane.org
locations."= /.well-known/matrix/server".extraConfig =
@@ -182,8 +198,15 @@ in
sane.persist.sys.byStore.plaintext = [
{ user = "acme"; group = "acme"; path = "/var/lib/acme"; method = "bind"; }
];
sane.persist.sys.byStore.private = [
{ user = "colin"; group = "users"; path = "/var/www/sites"; method = "bind"; }
];
sane.persist.sys.byStore.ephemeral = [
# logs *could* be persisted to private storage, but then there's the issue of
# "what if servo boots, isn't unlocked, and the whole / tmpfs is consumed by logs"
{ user = "nginx"; group = "nginx"; path = "/var/log/nginx"; method = "bind"; }
];
# let's encrypt default chain looks like:
# - End-entity certificate ← R3 ← ISRG Root X1 ← DST Root CA X3

View File

@@ -30,7 +30,7 @@ let
altPort = 2587;
in
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
# not 100% necessary to persist this, but ntfy does keep a 12hr (by default) cache
# for pushing notifications to users who become offline.
# ACLs also live here.
@@ -46,7 +46,7 @@ in
# defaults to 45s.
# note that the client may still do its own TCP-level keepalives, typically every 30s
keepalive-interval = "15m";
log-level = "trace"; # trace, debug, info (default), warn, error
log-level = "info"; # trace, debug, info (default), warn, error
auth-default-access = "deny-all";
};
systemd.services.ntfy-sh.serviceConfig.DynamicUser = lib.mkForce false;
@@ -86,7 +86,7 @@ in
sane.ports.ports."${builtins.toString altPort}" = {
protocol = [ "tcp" ];
visibleTo.lan = true;
visibleTo.wan = true;
visibleTo.doof = true;
description = "colin-ntfy.uninsane.org";
};
}

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p ntfy-sh
#!nix-shell -i python3 -p ntfy-sh -p python3
import argparse
import logging

View File

@@ -47,7 +47,7 @@ in
};
sane.ntfy-waiter.package = mkOption {
type = types.package;
default = pkgs.static-nix-shell.mkPython3Bin {
default = pkgs.static-nix-shell.mkPython3 {
pname = "ntfy-waiter";
srcRoot = ./.;
pkgs = [ "ntfy-sh" ];
@@ -62,8 +62,8 @@ in
sane.ports.ports = lib.mkMerge (lib.forEach portRange (port: {
"${builtins.toString port}" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-notification-waiter-${builtins.toString (port - portLow + 1)}-of-${builtins.toString numPorts}";
};
}));

View File

@@ -7,14 +7,15 @@
# to run it in a oci-container: <https://github.com/barrucadu/nixfiles/blob/master/services/pleroma.nix>
#
# admin frontend: <https://fed.uninsane.org/pleroma/admin>
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
logLevel = "warn";
# logLevel = "debug";
in
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
# contains media i've uploaded to the server
{ user = "pleroma"; group = "pleroma"; path = "/var/lib/pleroma"; method = "bind"; }
];
services.pleroma.enable = true;
@@ -135,25 +136,52 @@ in
# something inside pleroma invokes `sh` w/o specifying it by path, so this is needed to allow pleroma to start
pkgs.bash
# used by Pleroma to strip geo tags from uploads
pkgs.exiftool
config.sane.programs.exiftool.package
# i saw some errors when pleroma was shutting down about it not being able to find `awk`. probably not critical
pkgs.gawk
config.sane.programs.gawk.package
# needed for email operations like password reset
pkgs.postfix
];
systemd.services.pleroma.serviceConfig = {
systemd.services.pleroma = {
# postgres can be slow to service early requests, preventing pleroma from starting on the first try
Restart = "on-failure";
RestartSec = "10s";
};
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s";
# systemd.services.pleroma.serviceConfig = {
# # required for sendmail. see https://git.pleroma.social/pleroma/pleroma/-/issues/2259
# NoNewPrivileges = lib.mkForce false;
# PrivateTmp = lib.mkForce false;
# CapabilityBoundingSet = lib.mkForce "~";
# };
# hardening (systemd-analyze security pleroma)
# XXX(2024-07-28): this hasn't been rigorously tested:
# possible that i've set something too strict and won't notice right away
# make sure to test:
# - image/media uploading
serviceConfig.CapabilityBoundingSet = "~CAP_SYS_ADMIN"; #< TODO: reduce this. try: CAP_SYS_NICE CAP_DAC_READ_SEARCH CAP_SYS_CHROOT CAP_SETGID CAP_SETUID
serviceConfig.LockPersonality = true;
serviceConfig.NoNewPrivileges = true;
serviceConfig.MemoryDenyWriteExecute = true;
serviceConfig.PrivateDevices = lib.mkForce true; #< dunno why nixpkgs has this set false; it seems to work as true
serviceConfig.PrivateMounts = true;
serviceConfig.PrivateTmp = true;
serviceConfig.PrivateUsers = true;
serviceConfig.ProtectProc = "invisible";
serviceConfig.ProcSubset = "all"; #< needs /proc/sys/kernel/overflowuid for bwrap
serviceConfig.ProtectClock = true;
serviceConfig.ProtectControlGroups = true;
serviceConfig.ProtectHome = true;
serviceConfig.ProtectKernelModules = true;
serviceConfig.ProtectSystem = lib.mkForce "strict";
serviceConfig.RemoveIPC = true;
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_NETLINK";
serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native";
serviceConfig.SystemCallFilter = [ "@system-service" "@mount" "@sandbox" ]; #< "sandbox" might not actually be necessary
serviceConfig.ProtectHostname = false; #< else brap can't mount /proc
serviceConfig.ProtectKernelLogs = false; #< else breaks exiftool ("bwrap: Can't mount proc on /newroot/proc: Operation not permitted")
serviceConfig.ProtectKernelTunables = false; #< else breaks exiftool
serviceConfig.RestrictNamespaces = false; # media uploads require bwrap
};
# this is required to allow pleroma to send email.
# raw `sendmail` works, but i think pleroma's passing it some funny flags or something, idk.

View File

@@ -6,9 +6,9 @@ let
KiB = n: 1024*n;
in
{
sane.persist.sys.byStore.plaintext = [
# TODO: mode?
{ user = "postgres"; group = "postgres"; path = "/var/lib/postgresql"; method = "bind"; }
sane.persist.sys.byStore.private = [
{ user = "postgres"; group = "postgres"; mode = "0750"; path = "/var/lib/postgresql"; method = "bind"; }
{ user = "postgres"; group = "postgres"; mode = "0750"; path = "/var/backup/postgresql"; method = "bind"; }
];
services.postgresql.enable = true;

View File

@@ -56,47 +56,48 @@ let
enableDebug = false;
in
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
# TODO: mode?
{ user = "prosody"; group = "prosody"; path = "/var/lib/prosody"; method = "bind"; }
];
sane.ports.ports."5000" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-prosody-fileshare-proxy65";
};
sane.ports.ports."5222" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-client-to-server";
};
sane.ports.ports."5223" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpps-client-to-server"; # XMPP over TLS
};
sane.ports.ports."5269" = {
protocol = [ "tcp" ];
visibleTo.wan = true;
visibleTo.doof = true;
description = "colin-xmpp-server-to-server";
};
sane.ports.ports."5270" = {
protocol = [ "tcp" ];
visibleTo.wan = true;
visibleTo.doof = true;
description = "colin-xmpps-server-to-server"; # XMPP over TLS
};
sane.ports.ports."5280" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-bosh";
};
sane.ports.ports."5281" = {
protocol = [ "tcp" ];
visibleTo.doof = true;
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-xmpp-prosody-https"; # necessary?
};

View File

@@ -10,7 +10,9 @@
{ config, lib, pkgs, ... }:
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.ephemeral = [
# {data,downloads,incomplete,logs}: contains logs, search history, and downloads
# so, move the downloaded data to persistent storage regularly, or configure the downloads/incomplete dirs to point to persisted storage (in nixpkgs slskd config)
{ user = "slskd"; group = "media"; path = "/var/lib/slskd"; method = "bind"; }
];
sops.secrets."slskd_env" = {
@@ -32,7 +34,7 @@
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://10.0.1.6:5030";
proxyPass = "http://${config.sane.netns.ovpns.netnsVethIpv4}:5030";
proxyWebsockets = true;
};
};
@@ -68,12 +70,20 @@
# flags.volatile = true; # store searches and active transfers in RAM (completed transfers still go to disk). rec for btrfs/zfs
};
systemd.services.slskd.serviceConfig = {
systemd.services.slskd = {
# run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns";
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
serviceConfig.ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # abort if public IP is not as expected
Restart = lib.mkForce "always"; # exits "success" when it fails to connect to soulseek server
RestartSec = "60s";
serviceConfig.Restart = lib.mkForce "always"; # exits "success" when it fails to connect to soulseek server
serviceConfig.RestartSec = "60s";
# hardening (systemd-analyze security slskd)
# upstream nixpkgs specifies moderate defaults; these are supplementary
# serviceConfig.MemoryDenyWriteExecute = true;
# serviceConfig.ProcSubset = "pid";
# serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
# serviceConfig.SystemCallArchitectures = "native";
# serviceConfig.SystemCallFilter = [ "@system-service" ];
};
}

View File

@@ -22,71 +22,23 @@ let
--replace-fail 'set(TR_USER_AGENT_PREFIX "''${TR_SEMVER}")' 'set(TR_USER_AGENT_PREFIX "3.00")'
'';
});
download-dir = "/var/media/torrents";
torrent-done = pkgs.writeShellApplication {
name = "torrent-done";
runtimeInputs = with pkgs; [
acl
coreutils
findutils
rsync
util-linux
download-dir = "/var/media/torrents"; #< keep in sync with consts embedded in `torrent-done`
torrent-done = pkgs.static-nix-shell.mkBash {
pname = "torrent-done";
srcRoot = ./.;
pkgs = [
"acl"
"coreutils"
"findutils"
"rsync"
];
text = ''
destructive() {
if [ -n "''${TR_DRY_RUN-}" ]; then
echo "$*"
else
"$@"
fi
}
if [[ "$TR_TORRENT_DIR" =~ ^.*freeleech.*$ ]]; then
# freeleech torrents have no place in my permanent library
echo "freeleech: nothing to do"
exit 0
fi
if ! [[ "$TR_TORRENT_DIR" =~ ^${download-dir}/.*$ ]]; then
echo "unexpected torrent dir, aborting: $TR_TORRENT_DIR"
exit 0
fi
REL_DIR="''${TR_TORRENT_DIR#${download-dir}/}"
MEDIA_DIR="/var/media/$REL_DIR"
destructive mkdir -p "$(dirname "$MEDIA_DIR")"
destructive rsync -arv "$TR_TORRENT_DIR/" "$MEDIA_DIR/"
# make the media rwx by anyone in the group
destructive find "$MEDIA_DIR" -type d -exec setfacl --recursive --modify d:g::rwx,o::rx {} \;
destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \;
# if there's a single directory inside the media dir, then inline that
subdirs=("$MEDIA_DIR"/*)
if [ ''${#subdirs} -eq 1 ]; then
dirname="''${subdirs[0]}"
if [ -d "$dirname" ]; then
mv "$dirname"/* "$MEDIA_DIR/" && rmdir "$dirname"
fi
fi
# remove noisy files:
find "$MEDIA_DIR/" -type f \(\
-iname 'www.YTS.*.jpg' \
-o -iname 'WWW.YIFY*.COM.jpg' \
-o -iname 'YIFY*.com.txt' \
-o -iname 'YTS*.com.txt' \
\) -exec rm {} \;
# dedupe the whole media library.
# yeah, a bit excessive: move this to a cron job if that's problematic.
destructive hardlink /var/media --reflink=always --ignore-time --verbose
'';
};
in
lib.mkIf false #< TODO: re-enable once confident of sandboxing
{
sane.persist.sys.byStore.plaintext = [
sane.persist.sys.byStore.private = [
# TODO: mode? we need this specifically for the stats tracking in .config/
{ user = "transmission"; group = config.users.users.transmission.group; path = "/var/lib/transmission"; method = "bind"; }
{ user = "transmission"; group = config.users.users.transmission.group; path = "/var/backup/torrents"; method = "bind"; }
];
users.users.transmission.extraGroups = [ "media" ];
@@ -106,8 +58,8 @@ lib.mkIf false #< TODO: re-enable once confident of sandboxing
# DOCUMENTATION/options list: <https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options>
# message-level = 3; #< enable for debug logging. 0-3, default is 2.
# 10.0.1.6 => allow rpc only from the root servo ns. it'll tunnel things to the net, if need be.
rpc-bind-address = "10.0.1.6";
# ovpns.netnsVethIpv4 => allow rpc only from the root servo ns. it'll tunnel things to the net, if need be.
rpc-bind-address = config.sane.netns.ovpns.netnsVethIpv4;
#rpc-host-whitelist = "bt.uninsane.org";
#rpc-whitelist = "*.*.*.*";
rpc-authentication-required = true;
@@ -118,7 +70,7 @@ lib.mkIf false #< TODO: re-enable once confident of sandboxing
rpc-whitelist-enabled = false;
# force behind ovpns in case the NetworkNamespace fails somehow
bind-address-ipv4 = "185.157.162.178";
bind-address-ipv4 = config.sane.netns.ovpns.netnsPubIpv4;
port-forwarding-enabled = false;
# hopefully, make the downloads world-readable
@@ -155,16 +107,31 @@ lib.mkIf false #< TODO: re-enable once confident of sandboxing
script-torrent-done-filename = "${torrent-done}/bin/torrent-done";
};
systemd.services.transmission.after = [ "wireguard-wg-ovpns.service" ];
systemd.services.transmission.partOf = [ "wireguard-wg-ovpns.service" ];
systemd.services.transmission.serviceConfig = {
systemd.services.transmission = {
after = [ "wireguard-wg-ovpns.service" ];
partOf = [ "wireguard-wg-ovpns.service" ];
environment.TR_DEBUG = "1";
# run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns";
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
serviceConfig.ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # abort if public IP is not as expected
Restart = "on-failure";
RestartSec = "30s";
BindPaths = [ "/var/media" ]; #< so it can move completed torrents into the media library
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "30s";
serviceConfig.BindPaths = [ "/var/media" ]; #< so it can move completed torrents into the media library
serviceConfig.SystemCallFilter = lib.mkForce [
# the torrent-done script does stuff which fails the nixos default syscall filter.
# allow a bunch of stuff, speculatively, to hopefully fix that:
"@aio"
"@basic-io"
"@chown"
"@file-system"
"@io-event"
"@process"
"@sandbox"
"@sync"
"@system-service"
"quotactl"
];
};
# service to automatically backup torrents i add to transmission
@@ -190,7 +157,7 @@ lib.mkIf false #< TODO: re-enable once confident of sandboxing
# inherit kTLS;
locations."/" = {
# proxyPass = "http://ovpns.uninsane.org:9091";
proxyPass = "http://10.0.1.6:9091";
proxyPass = "http://${config.sane.netns.ovpns.netnsVethIpv4}:9091";
};
};

View File

@@ -0,0 +1,69 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p acl -p bash -p coreutils -p findutils -p rsync
# transmission invokes this with no args, and the following env vars:
# - TR_TORRENT_DIR: full path to the folder i told transmission to download it to.
# e.g. /var/media/torrents/Videos/Film/Jason.Bourne-2016
# optionally:
# - TR_DRY_RUN=1
# - TR_DEBUG=1
DOWNLOAD_DIR=/var/media/torrents
destructive() {
if [ -n "${TR_DRY_RUN-}" ]; then
echo "[dry-run] $*"
else
debug "$@"
"$@"
fi
}
debug() {
if [ -n "${TR_DEBUG-}" ]; then
echo "$@"
fi
}
echo "TR_TORRENT_DIR=$TR_TORRENT_DIR torrent-done $*"
if [[ "$TR_TORRENT_DIR" =~ ^.*freeleech.*$ ]]; then
# freeleech torrents have no place in my permanent library
echo "freeleech: nothing to do"
exit 0
fi
if ! [[ "$TR_TORRENT_DIR" =~ ^$DOWNLOAD_DIR/.*$ ]]; then
echo "unexpected torrent dir, aborting: $TR_TORRENT_DIR"
exit 0
fi
REL_DIR="${TR_TORRENT_DIR#$DOWNLOAD_DIR/}"
MEDIA_DIR="/var/media/$REL_DIR"
destructive mkdir -p "$(dirname "$MEDIA_DIR")"
destructive rsync -arv "$TR_TORRENT_DIR/" "$MEDIA_DIR/"
# make the media rwx by anyone in the group
destructive find "$MEDIA_DIR" -type d -exec setfacl --recursive --modify d:g::rwx,o::rx {} \;
destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \;
# if there's a single directory inside the media dir, then inline that
subdirs=("$MEDIA_DIR"/*)
debug "top-level items in torrent dir:" "${subdirs[@]}"
if [ ${#subdirs[@]} -eq 1 ]; then
dirname="${subdirs[0]}"
debug "exactly one top-level item, checking if directory: $dirname"
if [ -d "$dirname" ]; then
destructive mv "$dirname"/* "$MEDIA_DIR/" && destructive rmdir "$dirname"
fi
fi
# remove noisy files:
# -iname means "insensitive", but the syntax is NOT regex -- more similar to shell matching
destructive find "$MEDIA_DIR/" -type f \(\
-iname '*downloaded?from*' \
-o -iname 'source.txt' \
-o -iname '*upcoming?releases*' \
-o -iname 'www.YTS*.jpg' \
-o -iname 'WWW.YIFY*.COM.jpg' \
-o -iname 'YIFY*.com.txt' \
-o -iname 'YTS*.com.txt' \
\) -exec rm {} \;

View File

@@ -4,14 +4,12 @@
let
dyn-dns = config.sane.services.dyn-dns;
nativeAddrs = lib.mapAttrs (_name: builtins.head) config.sane.dns.zones."uninsane.org".inet.A;
bindOvpn = "10.0.1.5";
bindDoof = "10.0.2.5";
in
{
sane.ports.ports."53" = {
protocol = [ "udp" "tcp" ];
visibleTo.lan = true;
visibleTo.wan = true;
# visibleTo.wan = true;
visibleTo.ovpns = true;
visibleTo.doof = true;
description = "colin-dns-hosting";
@@ -41,6 +39,7 @@ in
CNAME."native" = "%CNAMENATIVE%";
A."@" = "%ANATIVE%";
A."servo.wan" = "%AWAN%";
A."servo.doof" = "%ADOOF%";
A."servo.lan" = config.sane.hosts.by-name."servo".lan-ip;
A."servo.hn" = config.sane.hosts.by-name."servo".wg-home.ip;
@@ -48,93 +47,71 @@ in
# it's best that we keep this identical, or a superset of, what org. lists as our NS.
# so, org. can specify ns2/ns3 as being to the VPN, with no mention of ns1. we provide ns1 here.
A."ns1" = "%ANATIVE%";
A."ns2" = "185.157.162.178";
A."ns3" = "185.157.162.178";
A."ovpns" = "185.157.162.178";
A."ns2" = "%ADOOF%";
A."ovpns" = "%AOVPNS%";
NS."@" = [
"ns1.uninsane.org."
"ns2.uninsane.org."
"ns3.uninsane.org."
];
};
services.trust-dns.settings.zones = [ "uninsane.org" ];
networking.nat.enable = true;
networking.nat.extraCommands = ''
# redirect incoming DNS requests from LAN addresses
# to the LAN-specialized DNS service
# N.B.: use the `nixos-*` chains instead of e.g. PREROUTING
# because they get cleanly reset across activations or `systemctl restart firewall`
# instead of accumulating cruft
iptables -t nat -A nixos-nat-pre -p udp --dport 53 \
-m iprange --src-range 10.78.76.0-10.78.79.255 \
-j DNAT --to-destination :1053
iptables -t nat -A nixos-nat-pre -p tcp --dport 53 \
-m iprange --src-range 10.78.76.0-10.78.79.255 \
-j DNAT --to-destination :1053
'';
sane.ports.ports."1053" = {
# because the NAT above redirects in nixos-nat-pre, LAN requests behave as though they arrived on the external interface at the redirected port.
# TODO: try nixos-nat-post instead?
# TODO: or, don't NAT from port 53 -> port 1053, but rather nat from LAN addr to a loopback addr.
# - this is complicated in that loopback is a different interface than eth0, so rewriting the destination address would cause the packets to just be dropped by the interface
protocol = [ "udp" "tcp" ];
visibleTo.lan = true;
description = "colin-redirected-dns-for-lan-namespace";
};
networking.nat.enable = true; #< TODO: try removing this?
# networking.nat.extraCommands = ''
# # redirect incoming DNS requests from LAN addresses
# # to the LAN-specialized DNS service
# # N.B.: use the `nixos-*` chains instead of e.g. PREROUTING
# # because they get cleanly reset across activations or `systemctl restart firewall`
# # instead of accumulating cruft
# iptables -t nat -A nixos-nat-pre -p udp --dport 53 \
# -m iprange --src-range 10.78.76.0-10.78.79.255 \
# -j DNAT --to-destination :1053
# iptables -t nat -A nixos-nat-pre -p tcp --dport 53 \
# -m iprange --src-range 10.78.76.0-10.78.79.255 \
# -j DNAT --to-destination :1053
# '';
# sane.ports.ports."1053" = {
# # because the NAT above redirects in nixos-nat-pre, LAN requests behave as though they arrived on the external interface at the redirected port.
# # TODO: try nixos-nat-post instead?
# # TODO: or, don't NAT from port 53 -> port 1053, but rather nat from LAN addr to a loopback addr.
# # - this is complicated in that loopback is a different interface than eth0, so rewriting the destination address would cause the packets to just be dropped by the interface
# protocol = [ "udp" "tcp" ];
# visibleTo.lan = true;
# description = "colin-redirected-dns-for-lan-namespace";
# };
sane.services.trust-dns.enable = true;
sane.services.trust-dns.instances = let
mkSubstitutions = flavor: {
"%ADOOF%" = config.sane.netns.doof.netnsPubIpv4;
"%ANATIVE%" = nativeAddrs."servo.${flavor}";
"%AOVPNS%" = config.sane.netns.ovpns.netnsPubIpv4;
"%AWAN%" = "$(cat '${dyn-dns.ipPath}')";
"%CNAMENATIVE%" = "servo.${flavor}";
"%ANATIVE%" = nativeAddrs."servo.${flavor}";
"%AOVPNS%" = "185.157.162.178";
};
in
{
wan = {
substitutions = mkSubstitutions "wan";
doof = {
substitutions = mkSubstitutions "doof";
listenAddrsIpv4 = [
config.sane.netns.doof.hostVethIpv4
config.sane.netns.doof.netnsPubIpv4
nativeAddrs."servo.lan"
bindOvpn
bindDoof
# config.sane.netns.ovpns.hostVethIpv4
];
};
lan = {
substitutions = mkSubstitutions "lan";
listenAddrsIpv4 = [ nativeAddrs."servo.lan" ];
port = 1053;
};
hn = {
substitutions = mkSubstitutions "hn";
listenAddrsIpv4 = [ nativeAddrs."servo.hn" ];
port = 1053;
};
# hn-resolver = {
# # don't need %AWAN% here because we forward to the hn instance.
# listenAddrsIpv4 = [ nativeAddrs."servo.hn" ];
enableRecursiveResolver = true; #< allow wireguard clients to use this as their DNS resolver
# extraConfig = {
# zones = [
# {
# zone = "uninsane.org";
# zone_type = "Forward";
# stores = {
# type = "forward";
# name_servers = [
# {
# socket_addr = "${nativeAddrs."servo.hn"}:1053";
# protocol = "udp";
# trust_nx_responses = true;
# }
# ];
# };
# }
# {
# # forward the root zone to the local DNS resolver
# # to allow wireguard clients to use this as their DNS resolver
# zone = ".";
# zone_type = "Forward";
# stores = {
@@ -150,13 +127,19 @@ in
# }
# ];
# };
};
# lan = {
# substitutions = mkSubstitutions "lan";
# listenAddrsIpv4 = [ nativeAddrs."servo.lan" ];
# # port = 1053;
# };
# wan = {
# substitutions = mkSubstitutions "wan";
# listenAddrsIpv4 = [
# nativeAddrs."servo.lan"
# ];
# };
};
sane.services.dyn-dns.restartOnChange = [
"trust-dns-wan.service"
"trust-dns-lan.service"
"trust-dns-hn.service"
# "trust-dns-hn-resolver.service" # doesn't need restart because it doesn't know about WAN IP
];
sane.services.dyn-dns.restartOnChange = lib.map (c: "${c.service}.service") (builtins.attrValues config.sane.services.trust-dns.instances);
}

View File

@@ -46,5 +46,6 @@
# manifests as spurious "No space left on device" when trying to install watches,
# e.g. in dyn-dns by `systemctl start dyn-dns-watcher.path`.
# see: <https://askubuntu.com/questions/828779/failed-to-add-run-systemd-ask-password-to-directory-watch-no-space-left-on-dev>
boot.kernel.sysctl."fs.inotify.max_user_watches" = 1048576;
boot.kernel.sysctl."fs.inotify.max_user_watches" = 4194304;
boot.kernel.sysctl."fs.inotify.max_user_instances" = 4194304;
}

View File

@@ -10,7 +10,6 @@
./machine-id.nix
./net
./nix.nix
./persist.nix
./polyunfill.nix
./programs
./quirks.nix

View File

@@ -1,14 +1,11 @@
# where to find good stuff?
# - universal search/directory: <https://podcastindex.org>
# - list of lists: <https://en.wikipedia.org/wiki/Category:Lists_of_podcasts>
# - podcasts w/ a community: <https://lemmyverse.net/communities?query=podcast>
# - podcast rec thread: <https://lemmy.ml/post/1565858>
# - podcast recs:
# - active lemmy: <https://slrpnk.net/c/podcasts>
# - old thread: <https://lemmy.ml/post/1565858>
#
# candidates:
# - The Nonlinear Library (podcast): <https://forum.effectivealtruism.org/posts/JTZTBienqWEAjGDRv/listen-to-more-ea-content-with-the-nonlinear-library>
# - has ~10 posts per day, text-to-speech; i would need better tagging before adding this
# - <https://www.metaculus.com/questions/11102/introducing-the-metaculus-journal-podcast/>
# - dead since 2022/10 - 2023/03
{ lib, sane-data, ... }:
let
hourly = { freq = "hourly"; };
@@ -75,15 +72,17 @@ let
(fromDb "feeds.feedburner.com/radiolab" // pol) # Radiolab -- also available here, but ONLY OVER HTTP: <http://feeds.wnyc.org/radiolab>
(fromDb "feeds.megaphone.fm/behindthebastards" // pol) # also Maggie Killjoy
(fromDb "feeds.megaphone.fm/recodedecode" // tech) # The Verge - Decoder
(fromDb "feeds.simplecast.com/54nAGcIl" // pol) # The Daily
(fromDb "feeds.simplecast.com/82FI35Px" // pol) # Ezra Klein Show
(fromDb "feeds.simplecast.com/wgl4xEgL" // rat) # Econ Talk
(fromDb "feeds.simplecast.com/xKJ93w_w" // uncat) # Atlas Obscura
(fromDb "feeds.transistor.fm/acquired" // tech)
(fromDb "feeds.transistor.fm/complex-systems-with-patrick-mckenzie-patio11" // tech) # Patrick Mackenzie (from Bits About Money)
(fromDb "feeds.twit.tv/floss.xml" // tech)
(fromDb "fulltimenix.com" // tech)
(fromDb "futureofcoding.org/episodes" // tech)
(fromDb "hackerpublicradio.org" // tech)
(fromDb "lexfridman.com/podcast" // rat)
(fromDb "linktr.ee/betteroffline" // pol)
(fromDb "mapspodcast.libsyn.com" // uncat) # Multidisciplinary Association for Psychedelic Studies
(fromDb "microarch.club" // tech)
(fromDb "mintcast.org" // tech)
@@ -92,7 +91,6 @@ let
(fromDb "omny.fm/shows/money-stuff-the-podcast") # Matt Levine
(fromDb "omny.fm/shows/the-dollop-with-dave-anthony-and-gareth-reynolds") # The Dollop history/comedy
(fromDb "originstories.libsyn.com" // uncat)
(fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol)
(fromDb "politicalorphanage.libsyn.com" // pol)
(fromDb "reverseengineering.libsyn.com/rss" // tech) # UnNamed Reverse Engineering Podcast
(fromDb "rss.acast.com/deconstructed") # The Intercept - Deconstructed
@@ -103,6 +101,7 @@ let
(fromDb "seattlenice.buzzsprout.com" // pol)
(fromDb "srslywrong.com" // pol)
(fromDb "sharkbytes.transistor.fm" // tech) # Wireshark Podcast o_0
(fromDb "sharptech.fm/feed/podcast" // tech)
(fromDb "sscpodcast.libsyn.com" // rat) # Astral Codex Ten
(fromDb "talesfromthebridge.buzzsprout.com" // tech) # Sci-Fi? has Peter Watts; author of No Moods, Ads or Cutesy Fucking Icons (rifters.com)
(fromDb "theamphour.com" // tech)
@@ -114,7 +113,9 @@ let
# (fromDb "feeds.libsyn.com/421877" // rat) # Less Wrong Curated
# (fromDb "feeds.megaphone.fm/hubermanlab" // uncat) # Daniel Huberman on sleep
# (fromDb "feeds.simplecast.com/54nAGcIl" // pol) # The Daily
# (fromDb "feeds.simplecast.com/l2i9YnTd" // tech // pol) # Hard Fork (NYtimes tech)
# (fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol)
# (fromDb "podcast.thelinuxexp.com" // tech) # low-brow linux/foss PR announcements
# (fromDb "rss.art19.com/your-welcome" // pol) # Michael Malice - Your Welcome -- also available here: <https://origin.podcastone.com/podcast?categoryID2=2232>
# (fromDb "rss.prod.firstlook.media/deconstructed/podcast.rss" // pol) #< possible URL rot
@@ -135,6 +136,7 @@ let
(fromDb "artemis.sh" // tech)
(fromDb "ascii.textfiles.com" // tech) # Jason Scott
(fromDb "austinvernon.site" // tech)
(fromDb "buttondown.email" // tech)
(fromDb "ben-evans.com/benedictevans" // pol)
(fromDb "bitbashing.io" // tech)
(fromDb "bitsaboutmoney.com" // uncat)
@@ -196,6 +198,7 @@ let
(fromDb "willow.phantoma.online") # wizard@xyzzy.link
(fromDb "xn--gckvb8fzb.com" // tech)
(fromDb "xorvoid.com" // tech)
(fromDb "www.thebignewsletter.com" // pol)
(mkSubstack "astralcodexten" // rat // daily) # Scott Alexander
(mkSubstack "eliqian" // rat // weekly)
(mkSubstack "oversharing" // pol // daily)
@@ -238,9 +241,9 @@ let
(fromDb "youtube.com/@TheB1M")
(fromDb "youtube.com/@TomScottGo")
(fromDb "youtube.com/@Vihart")
(fromDb "youtube.com/@Vox")
# (fromDb "youtube.com/@Vsauce") # they're all like 1-minute long videos now? what happened @Vsauce?
# (fromDb "youtube.com/@Vox")
# (fromDb "youtube.com/@Vsauce") # they're all like 1-minute long videos now? what happened @Vsauce?
# (fromDb "youtube.com/@rossmanngroup" // pol // tech) # Louis Rossmann
];

View File

@@ -26,10 +26,6 @@ let
# lazyMount: defer mounting until first access from userspace.
# see: `man systemd.automount`, `man automount`, `man autofs`
lazyMount = noauto ++ automount;
wg = [
"x-systemd.requires=wireguard-wg-home.service"
"x-systemd.after=wireguard-wg-home.service"
];
fuse = [
"allow_other" # allow users other than the one who mounts it to access it. needed, if systemd is the one mounting this fs (as root)
@@ -125,52 +121,61 @@ let
dir.acl.mode = "0700";
};
};
remoteServo = subdir: {
remoteServo = subdir: let
localPath = "/mnt/servo/${subdir}";
systemdName = utils.escapeSystemdPath localPath;
in {
sane.programs.curlftpfs.enableFor.system = true;
sane.fs."/mnt/servo/${subdir}" = sane-lib.fs.wanted {
sane.fs."${localPath}" = sane-lib.fs.wanted {
dir.acl.user = "colin";
dir.acl.group = "users";
dir.acl.mode = "0750";
};
fileSystems."/mnt/servo/${subdir}" = {
fileSystems."${localPath}" = {
device = "ftp://servo-hn:/${subdir}";
noCheck = true;
fsType = "fuse.curlftpfs";
options = fsOpts.ftp ++ fsOpts.noauto ++ fsOpts.wg;
options = fsOpts.ftp ++ fsOpts.noauto;
# fsType = "nfs";
# options = fsOpts.nfs ++ fsOpts.lazyMount ++ fsOpts.wg;
# options = fsOpts.nfs ++ fsOpts.lazyMount;
};
systemd.services."automount-servo-${utils.escapeSystemdPath subdir}" = let
fs = config.fileSystems."/mnt/servo/${subdir}";
in {
# this is a *flaky* network mount, especially on moby.
# if done as a normal autofs mount, access will eternally block when network is dropped.
# notably, this would block *any* sandboxed app which allows media access, whether they actually try to use that media or not.
# a practical solution is this: mount as a service -- instead of autofs -- and unmount on timeout error, in a restart loop.
# until the ftp handshake succeeds, nothing is actually mounted to the vfs, so this doesn't slow down any I/O when network is down.
description = "automount /mnt/servo/${subdir} in a fault-tolerant and non-blocking manner";
systemd.mounts = let
fsEntry = config.fileSystems."${localPath}";
in [{
#VVV repeat what systemd would ordinarily scrape from /etc/fstab
where = localPath;
what = fsEntry.device;
type = fsEntry.fsType;
options = lib.concatStringsSep "," fsEntry.options;
after = [ "network-online.target" ];
requires = [ "network-online.target" ];
wantedBy = [ "default.target" ];
serviceConfig.Type = "simple";
serviceConfig.ExecStart = lib.escapeShellArgs [
"/usr/bin/env"
"PATH=/run/current-system/sw/bin"
"mount.${fs.fsType}"
"-f" # foreground (i.e. don't daemonize)
"-s" # single-threaded (TODO: it's probably ok to disable this?)
"-o"
(lib.concatStringsSep "," (lib.filter (o: !lib.hasPrefix "x-systemd." o) fs.options))
fs.device
"/mnt/servo/${subdir}"
wantedBy = [ "default.target" ]; #< TODO: move this into nixos fileSystems
#VVV patch so that when the mount fails, we start a timer to remount it.
# and for a disconnection after a good mount (onSuccess), restart the timer to be more aggressive
onFailure = [ "${systemdName}.timer" ];
onSuccess = [ "${systemdName}-restart-timer.target" ];
}];
systemd.targets."${systemdName}-restart-timer" = {
# hack unit which, when started, stops the timer (if running), and then starts it again.
after = [ "${systemdName}.timer" ];
conflicts = [ "${systemdName}.timer" ];
upholds = [ "${systemdName}.timer" ];
unitConfig.StopWhenUnneeded = true;
};
systemd.timers."${systemdName}" = {
timerConfig.Unit = "${systemdName}.mount";
timerConfig.AccuracySec = "2s";
timerConfig.OnActiveSec = [
# try to remount at these timestamps, backing off gradually
# there seems to be an implicit mount attempt at t=0.
"10s"
"30s"
"60s"
"120s"
];
# not sure if this configures a linear, or exponential backoff.
# but the first restart will be after `RestartSec`, and the n'th restart (n = RestartSteps) will be RestartMaxDelaySec after the n-1'th exit.
serviceConfig.Restart = "always";
serviceConfig.RestartSec = "10s";
serviceConfig.RestartMaxDelaySec = "120s";
serviceConfig.RestartSteps = "5";
# cap the backoff to a fixed interval.
timerConfig.OnUnitActiveSec = [ "120s" ];
};
};
in

View File

@@ -1,21 +1,13 @@
{ config, lib, ... }:
{
sane.user.persist.byStore.plaintext = [
"archive"
# TODO: some of ~/dev should be private too, but maybe not all 800+ GB of it
# perhaps i ought to rethink how it's organized
"dev"
# TODO: records should be private
"records"
"ref"
"tmp"
"use"
"Books/local"
"Music"
"Pictures/albums"
"Pictures/cat"
"Pictures/from"
"Pictures/Screenshots" #< XXX: something is case-sensitive about this?
"Pictures/Photos"
"Videos/local"
# these are persisted simply to save on RAM.
# ~/.cache/nix can become several GB.
@@ -25,7 +17,17 @@
".cache/nix"
];
sane.user.persist.byStore.private = [
"archive"
"Pictures/albums"
"Pictures/cat"
"Pictures/from"
"Pictures/Screenshots" #< XXX: something is case-sensitive about this?
"Pictures/Photos"
"records"
"tmp"
"knowledge"
"Videos/local"
];
# convenience
@@ -34,7 +36,7 @@
in {
".persist/private" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.private.origin; };
".persist/plaintext" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.plaintext.origin; };
".persist/ephemeral" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.cryptClearOnBoot.origin; };
".persist/ephemeral" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.ephemeral.origin; };
"nixos".symlink.target = "dev/nixos";

View File

@@ -62,6 +62,7 @@
sane.ids.clightning.gid = 2419;
sane.ids.nix-serve.uid = 2420;
sane.ids.nix-serve.gid = 2420;
sane.ids.plugdev.gid = 2421;
sane.ids.colin.uid = 1000;
sane.ids.guest.uid = 1100;

View File

@@ -12,6 +12,7 @@
systemd.network.enable = true;
networking.useNetworkd = true;
networking.usePredictableInterfaceNames = false; #< set false to get `eth0`, `wlan0`, etc instead of `enp3s0`/etc
# view refused/dropped packets with: `sudo journalctl -k`
# networking.firewall.logRefusedPackets = true;

View File

@@ -20,7 +20,7 @@
# - each namespace may use a different /etc/resolv.conf to specify different DNS servers
# - nscd breaks namespacing: the host nscd is unaware of the guest's /etc/resolv.conf, and so directs the guest's DNS requests to the host's servers.
# - this is fixed by either removing `/var/run/nscd/socket` from the namespace, or disabling nscd altogether.
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
lib.mkMerge [
{
sane.services.trust-dns.enable = lib.mkDefault config.sane.services.trust-dns.asSystemResolver;
@@ -59,15 +59,35 @@ lib.mkMerge [
# in the netns and we query upstream DNS more often than needed. hm.
# services.nscd.enableNsncd = true;
# disabling nscd LOSES US SOME FUNCTIONALITY. in particular, only the glibc-builtin modules are accessible via /etc/resolv.conf.
# disabling nscd LOSES US SOME FUNCTIONALITY. in particular, only the glibc-builtin modules are accessible via /etc/resolv.conf (er, did i mean /etc/nsswitch.conf?).
# - dns: glibc-bultin
# - files: glibc-builtin
# - myhostname: systemd
# - mymachines: systemd
# - resolve: systemd
# in practice, i see no difference with nscd disabled.
# - the exception is when the system dns resolver doesn't do everything.
# for example, systemd-resolved does mDNS. hickory-dns does not. a hickory-dns system won't be mDNS-capable.
# disabling nscd VASTLY simplifies netns and process isolation. see explainer at top of file.
services.nscd.enable = false;
system.nssModules = lib.mkForce [];
# system.nssModules = lib.mkForce [];
sane.silencedAssertions = [''.*Loading NSS modules from system.nssModules.*requires services.nscd.enable being set to true.*''];
# add NSS modules into their own subdirectory.
# then i can add just the NSS modules library path to the global LD_LIBRARY_PATH, rather than ALL of /run/current-system/sw/lib.
# TODO: i'm doing this so as to achieve mdns DNS resolution (avahi). it would be better to just have trust-dns delegate .local to avahi
# (except avahi doesn't act as a local resolver over DNS protocol -- only dbus).
environment.systemPackages = [(pkgs.symlinkJoin {
name = "nss-modules";
paths = config.system.nssModules.list;
postBuild = ''
mkdir nss
mv $out/lib/libnss_* nss
rm -rf $out
mkdir -p $out/lib
mv nss $out/lib
'';
})];
environment.variables.LD_LIBRARY_PATH = [ "/run/current-system/sw/lib/nss" ];
systemd.globalEnvironment.LD_LIBRARY_PATH = "/run/current-system/sw/lib/nss"; #< specifically for `geoclue.service`
}
]

View File

@@ -14,7 +14,6 @@
# after = [ "polkit.service" ];
# requires = [ "polkit.service" ];
wantedBy = [ "network.target" ]; #< default is `multi-user.target`, somehow it doesn't auto-start with that...
# path = [ "/run/current-system/sw" ]; #< so it can find `sanebox`
# serviceConfig.Type = "dbus";
# serviceConfig.BusName = "org.freedesktop.ModemManager1";

View File

@@ -2,21 +2,28 @@
let
# networkmanager = pkgs.networkmanager;
networkmanager = pkgs.networkmanager.overrideAttrs (upstream: {
src = pkgs.fetchFromGitea {
domain = "git.uninsane.org";
owner = "colin";
repo = "NetworkManager";
# patched to fix polkit permissions (with `nmcli`) when NetworkManager runs as user networkmanager
rev = "dev-sane-1.48.0";
hash = "sha256-vGmOKtwVItxjYioZJlb1og3K6u9s4rcmDnjAPLBC3ao=";
};
# patches = [];
# src = pkgs.fetchFromGitea {
# domain = "git.uninsane.org";
# owner = "colin";
# repo = "NetworkManager";
# # patched to fix polkit permissions (with `nmcli`) when NetworkManager runs as user networkmanager
# rev = "dev-sane-1.48.0";
# hash = "sha256-vGmOKtwVItxjYioZJlb1og3K6u9s4rcmDnjAPLBC3ao=";
# };
patches = (upstream.patches or []) ++ [
(pkgs.fetchpatch {
name = "polkit: add owner annotations to all actions";
url = "https://git.uninsane.org/colin/NetworkManager/commit/a01293861fa24201ffaeb84c07f1c71136c49759.patch";
hash = "sha256-th1/M2slo7rjkVBwETZII53Lmhyw8OMS0aT9QYI5Uvk=";
})
];
});
# split the package into `daemon` and `nmcli` outputs, because the networkmanager *service*
# doesn't need `nmcli`/`nmtui` tooling
networkmanager-split = pkgs.networkmanager-split.override { inherit networkmanager; };
in {
networking.networkmanager.enable = true;
systemd.network.wait-online.enable = false; # systemd-networkd-wait-online.service reliably fails on lappy. docs don't match behavior. shit software.
# plugins mostly add support for establishing different VPN connections.
# the default plugin set includes mostly proprietary VPNs:
# - fortisslvpn (Fortinet)
@@ -199,6 +206,12 @@ in {
logging.level = "INFO";
# main.dhcp = "internal"; #< default
# main.dns controls what to do when NM gets a DNS server via DHCP
# - "none" (populate /run/NetworkManager/resolv.conf with DHCP settings)
# - "internal" (?)
# - "systemd-resolved" (tell systemd-resolved about it, and point /run/NetworkManager/resolv.conf -> systemd)
# without this, systemd-resolved won't be able to resolve anything (because it has no upstream servers)
# note that NM's resolv.conf isn't (necessarily) /etc/resolv.conf -- that is managed by nixos (via symlinking)
main.dns = if config.services.resolved.enable then
"systemd-resolved"
else if config.sane.services.trust-dns.enable && config.sane.services.trust-dns.asSystemResolver then

View File

@@ -1,17 +0,0 @@
{ ... }:
{
# store /home/colin/a/b in /mnt/persist/private/a/b instead of /mnt/persist/private/home/colin/a/b
sane.persist.stores.private.prefix = "/home/colin";
sane.persist.sys.byStore.initrd = [
"/var/log"
];
sane.persist.sys.byStore.plaintext = [
# TODO: these should be private.. somehow
"/var/backup" # for e.g. postgres dumps
];
sane.persist.sys.byStore.cryptClearOnBoot = [
"/var/lib/systemd/coredump"
];
}

View File

@@ -1,6 +1,6 @@
# strictly *decrease* the scope of the default nixos installation/config
{ lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
suidlessPam = pkgs.pam.overrideAttrs (upstream: {
# nixpkgs' pam hardcodes unix_chkpwd path to the /run/wrappers one,
@@ -111,7 +111,11 @@ in
# pkgs.which
# pkgs.zstd
];
in lib.filter (p: ! builtins.elem p requiredPackages);
conveniencePackages = [
config.boot.kernelPackages.cpupower # <repo:nixos/nixpkgs:nixos/modules/tasks/cpu-freq.nix> places it on PATH for convenience if powerManagement.cpuFreqGovernor is set
pkgs.kbd # <repo:nixos/nixpkgs:nixos/modules/config/console.nix> places it on PATH as part of console/virtual TTYs, but probably not needed unless you want to set console fonts
];
in lib.filter (p: ! builtins.elem p (requiredPackages ++ conveniencePackages));
};
options.system.fsPackages = lib.mkOption {
@@ -212,5 +216,14 @@ in
# see: <repo:nixos/nixpkgs:nixos/modules/virtualisation/nixos-containers.nix>
boot.enableContainers = lib.mkDefault false;
# see: <repo:nixos/nixpkgs:nixos/modules/tasks/lvm.nix>
# lvm places `pkgs.lvm2` onto PATH, which has like 100 binaries.
# it is, actually, needed for some userspace tools (cryptsetup). probably just the udev rules. try to reduce this set?
services.lvm.enable = lib.mkDefault false;
services.udev.packages = [ pkgs.lvm2.out ]; #< N.B. `lvm2.out` != `lvm2`
# systemd.packages = [ pkgs.lvm2 ];
# systemd.tmpfiles.packages = [ pkgs.lvm2.out ];
# environment.systemPackages = [ pkgs.lvm2 ];
};
}

View File

@@ -39,6 +39,7 @@ in
"btrfs-progs"
"cacert.unbundled" # some services require unbundled /etc/ssl/certs
"cryptsetup"
"curl"
"ddrescue"
"dig"
"dtc" # device tree [de]compiler
@@ -57,6 +58,7 @@ in
"git"
"gptfdisk" # gdisk
"hdparm"
"hping"
"htop"
"iftop"
"inetutils" # for telnet
@@ -78,6 +80,7 @@ in
"neovim"
"netcat"
"nethogs"
"nix"
"nmap"
"nmcli"
"nvme-cli" # nvme
@@ -124,6 +127,7 @@ in
# "dmidecode"
"dtrx" # `unar` alternative, "Do The Right eXtraction"
# "efivar"
"exiftool"
"eza" # a better 'ls'
# "flashrom"
"git" # needed as a user package, for config.
@@ -151,11 +155,16 @@ in
# "ponymix"
"pulsemixer"
"python3-repl"
# "python3Packages.eyeD3" # music tagging
# "python3.pkgs.eyeD3" # music tagging
"ripgrep" # needed as a user package so that its user-level config file can be installed
"rsync"
"rsyslog" # KEEP THIS HERE if you want persistent logging
"sane-deadlines"
"sane-scripts.bittorrent"
"sane-scripts.cli"
"sane-secrets-unlock"
"sane-sysload"
"sc-im"
# "snapper"
"sops" # for manually viewing secrets; outside `sane-secrets` (TODO: improve sane-secrets!)
"speedtest-cli"
@@ -175,8 +184,12 @@ in
# "gh" # MS GitHub cli
"nix-index"
"nixpkgs-review"
"qmk-udev-rules"
"sane-scripts.dev"
"sequoia"
# "via"
"wally-cli"
# "zsa-udev-rules"
];
consoleMediaUtils = declPackageSet [
@@ -276,28 +289,28 @@ in
# "gnome.cheese"
# "gnome-feeds" # RSS reader (with claimed mobile support)
# "gnome.file-roller"
"gnome.geary" # adaptive e-mail client; uses webkitgtk 4.1
"gnome.gnome-calculator"
"gnome.gnome-calendar"
"geary" # adaptive e-mail client; uses webkitgtk 4.1
"gnome-calculator"
"gnome-calendar"
"gnome.gnome-clocks"
"gnome.gnome-maps"
# "gnome-podcasts"
# "gnome.gnome-system-monitor"
# "gnome.gnome-terminal" # works on phosh
"gnome.gnome-weather"
# "gnome.seahorse" # keyring/secret manager
# "seahorse" # keyring/secret manager
"gnome-frog" # OCR/QR decoder
"gpodder"
"gst-device-monitor" # for debugging audio/video
# "gst-device-monitor" # for debugging audio/video
# "gthumb"
# "lemoa" # lemmy app
"libcamera" # for `cam` binary (useful for debugging cameras)
# "libcamera" # for `cam` binary (useful for debugging cameras)
"libnotify" # for notify-send; debugging
# "lollypop"
"loupe" # image viewer
"mate.engrampa" # archive manager
"mepo" # maps viewer
"mesa-demos" # for eglinfo, glxinfo & other testing tools
# "mesa-demos" # for eglinfo, glxinfo & other testing tools
"mpv"
"networkmanagerapplet" # for nm-connection-editor: it's better than not having any gui!
"ntfy-sh" # notification service
@@ -307,7 +320,7 @@ in
# "picard" # music tagging
# "libsForQt5.plasmatube" # Youtube player
"signal-desktop"
"snapshot" # camera app
# "snapshot" # camera app
"spot" # Gnome Spotify client
# "sublime-music"
# "tdesktop" # broken on phosh
@@ -316,17 +329,19 @@ in
"vulkan-tools" # vulkaninfo
# "whalebird" # pleroma client (Electron). input is broken on phosh.
"xdg-terminal-exec"
"youtube-tui"
"zathura" # PDF/CBZ/ePUB viewer
];
handheldGuiApps = declPackageSet [
# "celluloid" # mpv frontend
# "chatty" # matrix/xmpp/irc client (2023/12/29: disabled because broken cross build)
"cozy" # audiobook player
# "cozy" # audiobook player
"epiphany" # gnome's web browser
# "iotas" # note taking app
"komikku"
"koreader"
"lgtrombetta-compass"
"megapixels" # camera app
"notejot" # note taking, e.g. shopping list
"planify" # todo-tracker/planner
@@ -348,7 +363,7 @@ in
# "chromium" # chromium takes hours to build. brave is chromium-based, distributed in binary form, so prefer it.
# "cups"
"discord" # x86-only
"electrum"
# "electrum"
"element-desktop"
"firefox"
"font-manager"
@@ -356,13 +371,14 @@ in
"gimp" # broken on phosh
# "gnome.dconf-editor"
# "gnome.file-roller"
"gnome.gnome-disk-utility"
"gnome.nautilus" # file browser
"gnome-disk-utility"
"nautilus" # file browser
# "gnome.totem" # video player, supposedly supports UPnP
# "handbrake" #< TODO: fix build
"inkscape"
# "jellyfin-media-player"
"kdenlive"
# "keymapp"
# "kid3" # audio tagging
"krita"
"libreoffice" # TODO: replace with an office suite that uses saner packaging?
@@ -371,7 +387,7 @@ in
# "monero-gui" # x86-only
# "mumble"
# "nheko" # Matrix chat client
# "nicotine-plus" # soulseek client. before re-enabling this make sure it's properly sandboxed!
"nicotine-plus" # soulseek client
# "obsidian"
# "openscad" # 3d modeling
# "rhythmbox" # local music player
@@ -422,6 +438,11 @@ in
clang = {};
clightning-sane.sandbox.method = "bwrap";
clightning-sane.sandbox.extraPaths = [
"/var/lib/clightning/bitcoin/lightning-rpc"
];
# cryptsetup: typical use is `cryptsetup open /dev/loopxyz mappedName`, and creates `/dev/mapper/mappedName`
cryptsetup.sandbox.method = "landlock";
cryptsetup.sandbox.extraPaths = [
@@ -491,7 +512,7 @@ in
electrum.sandbox.method = "bwrap"; # TODO:sandbox: untested
electrum.sandbox.net = "all"; # TODO: probably want to make this run behind a VPN, always
electrum.sandbox.whitelistWayland = true;
electrum.persist.byStore.cryptClearOnBoot = [ ".electrum" ]; #< TODO: use XDG dirs!
electrum.persist.byStore.ephemeral = [ ".electrum" ]; #< TODO: use XDG dirs!
endless-sky.buildCost = 1;
endless-sky.persist.byStore.plaintext = [ ".local/share/endless-sky" ];
@@ -509,8 +530,10 @@ in
ethtool.sandbox.capabilities = [ "net_admin" ];
# eza `ls` replacement
# eza.sandbox.method = "landlock";
eza.sandbox.method = "bwrap"; #< note that bwrap causes `/proc` files to be listed differently (e.g. `eza /proc/sys/net/ipv6/conf/`)
# bwrap causes `/proc` files to be listed differently (e.g. `eza /proc/sys/net/ipv6/conf/`)
# bwrap loses group info (so files owned by other users appear as owner "nobody")
eza.sandbox.method = "landlock";
# eza.sandbox.method = "bwrap";
eza.sandbox.autodetectCliPaths = "existing";
eza.sandbox.whitelistPwd = true;
eza.sandbox.extraHomePaths = [
@@ -574,10 +597,6 @@ in
gawk.sandbox.wrapperType = "inplace"; # /share/gawk libraries refer to /libexec
gawk.sandbox.autodetectCliPaths = "existingFile";
gdb.sandbox.enable = false; # gdb doesn't sandbox well. i don't know how you could.
# gdb.sandbox.method = "landlock"; # permission denied when trying to attach, even as root
gdb.sandbox.autodetectCliPaths = true;
geoclue2-with-demo-agent = {};
# MS GitHub stores auth token in .config
@@ -604,32 +623,37 @@ in
"/tmp" # "Cannot open display:" if it can't mount /tmp 👀
];
"gnome.gnome-calculator".buildCost = 1;
"gnome.gnome-calculator".sandbox.method = "bwrap";
"gnome.gnome-calculator".sandbox.whitelistWayland = true;
gnome-calculator.buildCost = 1;
gnome-calculator.sandbox.method = "bwrap";
gnome-calculator.sandbox.whitelistWayland = true;
"gnome.gnome-calendar".buildCost = 1;
gnome-calendar.buildCost = 1;
# gnome-calendar surely has data to persist, but i use it strictly to do date math, not track events.
"gnome.gnome-calendar".sandbox.method = "bwrap";
"gnome.gnome-calendar".sandbox.whitelistWayland = true;
gnome-calendar.sandbox.method = "bwrap";
gnome-calendar.sandbox.whitelistWayland = true;
# gnome-disks
"gnome.gnome-disk-utility".buildCost = 1;
"gnome.gnome-disk-utility".sandbox.method = "bwrap";
"gnome.gnome-disk-utility".sandbox.whitelistDbus = [ "system" ];
"gnome.gnome-disk-utility".sandbox.whitelistWayland = true;
"gnome.gnome-disk-utility".sandbox.extraHomePaths = [
gnome-disk-utility.buildCost = 1;
gnome-disk-utility.sandbox.method = "bwrap";
gnome-disk-utility.sandbox.whitelistDbus = [ "system" ];
gnome-disk-utility.sandbox.whitelistWayland = true;
gnome-disk-utility.sandbox.extraHomePaths = [
"tmp"
"use/iso"
# TODO: probably need /dev and such
];
hping.sandbox.method = "landlock";
hping.sandbox.net = "all";
hping.sandbox.capabilities = [ "net_raw" ];
hping.sandbox.autodetectCliPaths = "existingFile"; # for sending packet data from file
# seahorse: dump gnome-keyring secrets.
"gnome.seahorse".buildCost = 1;
# N.B.: it can also manage ~/.ssh keys, but i explicitly don't add those to the sandbox for now.
"gnome.seahorse".sandbox.method = "bwrap";
"gnome.seahorse".sandbox.whitelistDbus = [ "user" ];
"gnome.seahorse".sandbox.whitelistWayland = true;
seahorse.buildCost = 1;
# N.B. it can lso manage ~/.ssh keys, but i explicitly don't add those to the sandbox for now.
seahorse.sandbox.method = "bwrap";
seahorse.sandbox.whitelistDbus = [ "user" ];
seahorse.sandbox.whitelistWayland = true;
gnome-2048.buildCost = 1;
gnome-2048.sandbox.method = "bwrap";
@@ -654,7 +678,7 @@ in
"Pictures/Screenshots"
"Pictures/servo-macros"
];
gnome-frog.persist.byStore.cryptClearOnBoot = [
gnome-frog.persist.byStore.ephemeral = [
".local/share/tessdata" # 15M; dunno what all it is.
];
@@ -792,6 +816,14 @@ in
libnotify.sandbox.method = "bwrap";
libnotify.sandbox.whitelistDbus = [ "user" ]; # notify-send
lightning-cli.packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.clightning "lightning-cli";
lightning-cli.sandbox.method = "bwrap";
lightning-cli.sandbox.extraHomePaths = [
".lightning/bitcoin/lightning-rpc"
];
# `lightning-cli` finds its RPC file via `~/.lightning/bitcoin/lightning-rpc`, to message the daemon
lightning-cli.fs.".lightning".symlink.target = "/var/lib/clightning";
losslesscut-bin.buildCost = 1;
losslesscut-bin.sandbox.method = "bwrap";
losslesscut-bin.sandbox.extraHomePaths = [
@@ -819,7 +851,10 @@ in
mercurial.sandbox.net = "clearnet";
mercurial.sandbox.whitelistPwd = true;
mesa-demos = {};
mesa-demos.sandbox.method = "bwrap";
mesa-demos.sandbox.whitelistDri = true;
mesa-demos.sandbox.whitelistWayland = true;
mesa-demos.sandbox.whitelistX = true;
# actual monero blockchain (not wallet/etc; safe to delete, just slow to regenerate)
monero-gui.buildCost = 1;
@@ -865,7 +900,7 @@ in
nixpkgs-review.sandbox.extraPaths = [
"/nix"
];
nixpkgs-review.persist.byStore.cryptClearOnBoot = [
nixpkgs-review.persist.byStore.ephemeral = [
".cache/nixpkgs-review" #< help it not exhaust / tmpfs
];
@@ -916,7 +951,7 @@ in
"/sys/devices"
];
"perlPackages.FileMimeInfo".sandbox.enable = false; #< TODO: sandbox `mimetype` but not `mimeopen`.
"perlPackages.FileMimeInfo" = {};
powertop.sandbox.method = "landlock";
powertop.sandbox.capabilities = [ "ipc_lock" "sys_admin" ];
@@ -949,7 +984,9 @@ in
python3-repl.packageUnwrapped = pkgs.python3.withPackages (ps: with ps; [
psutil
pykakasi
requests
unidecode
]);
python3-repl.sandbox.method = "bwrap";
python3-repl.sandbox.net = "clearnet";
@@ -977,9 +1014,17 @@ in
sane-weather.sandbox.method = "bwrap";
sane-weather.sandbox.net = "clearnet";
sc-im.sandbox.method = "bwrap";
sc-im.sandbox.autodetectCliPaths = "existingFile";
screen.sandbox.enable = false; #< tty; needs to run anything
sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested
sequoia.packageUnwrapped = pkgs.sequoia.overrideAttrs (_: {
# XXX(2024-07-30): sq_autocrypt_import test failure: "Warning: 9B7DD433F254904A is expired."
doCheck = false;
});
sequoia.buildCost = 1;
sequoia.sandbox.method = "bwrap";
sequoia.sandbox.whitelistPwd = true;
sequoia.sandbox.autodetectCliPaths = "existingFileOrParent"; # supports `-o <file-to-create>`
@@ -1023,7 +1068,9 @@ in
"Music"
"tmp"
"use"
".config/dconf"
];
soundconverter.sandbox.whitelistDbus = [ "user" ]; # for dconf
soundconverter.sandbox.extraPaths = [
"/mnt/servo/media/Music"
"/mnt/servo/media/games"
@@ -1103,9 +1150,6 @@ in
valgrind.buildCost = 1;
valgrind.sandbox.enable = false; #< it's a launcher: can't sandbox
visidata.sandbox.method = "bwrap"; # TODO:sandbox: untested
visidata.sandbox.autodetectCliPaths = true;
# `vulkaninfo`, `vkcube`
vulkan-tools.sandbox.method = "landlock";
@@ -1137,10 +1181,12 @@ in
# `wg`, `wg-quick`
wireguard-tools.sandbox.method = "landlock";
wireguard-tools.sandbox.net = "all";
wireguard-tools.sandbox.capabilities = [ "net_admin" ];
# provides `iwconfig`, `iwlist`, `iwpriv`, ...
wirelesstools.sandbox.method = "landlock";
wirelesstools.sandbox.net = "all";
wirelesstools.sandbox.capabilities = [ "net_admin" ];
wl-clipboard.sandbox.method = "bwrap";
@@ -1163,8 +1209,6 @@ in
yt-dlp.sandbox.method = "bwrap"; # TODO:sandbox: untested
yt-dlp.sandbox.net = "all";
yt-dlp.sandbox.whitelistPwd = true; # saves to pwd by default
zfs = {};
};
sane.persist.sys.byStore.plaintext = lib.mkIf config.sane.programs.guiApps.enabled [
@@ -1181,13 +1225,12 @@ in
];
};
hardware.opengl = lib.mkIf config.sane.programs.guiApps.enabled ({
hardware.graphics = lib.mkIf config.sane.programs.guiApps.enabled ({
enable = true;
driSupport = lib.mkDefault true;
} // (lib.optionalAttrs pkgs.stdenv.isx86_64 {
# for 32 bit applications
# upstream nixpkgs forbids setting driSupport32Bit unless specifically x86_64 (so aarch64 isn't allowed)
driSupport32Bit = lib.mkDefault true;
# upstream nixpkgs forbids setting enable32Bit unless specifically x86_64 (so aarch64 isn't allowed)
enable32Bit = lib.mkDefault true;
}));
system.activationScripts.notifyActive = lib.mkIf config.sane.programs.guiApps.enabled {

View File

@@ -2,7 +2,7 @@
{ pkgs, ... }:
{
sane.programs.ausyscall = {
packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.audit "bin/ausyscall";
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.audit "ausyscall";
sandbox.method = "landlock";
};

View File

@@ -0,0 +1,43 @@
# Avahi zeroconf (mDNS) implementation.
# runs as systemd `avahi-daemon.service`
#
# - <https://avahi.org/>
# - code: <https://github.com/avahi/avahi>
# - IRC: #avahi on irc.libera.chat
#
# - `avahi-browse --help` for usage
# - `man avahi-daemon.conf`
# - `LD_LIBRARY_PATH=/nix/store/ngwj3jqmxh8k4qji2z0lj7y1f8vzqrn2-nss-mdns-0.15.1/lib getent hosts desko.local`
# nss-mdns goes through avahi-daemon, so there IS caching here
#
{ config, lib, ... }:
{
sane.programs.avahi = {
sandbox.method = "bwrap";
sandbox.whitelistDbus = [ "system" ];
sandbox.net = "all"; #< otherwise it will show 'null' in place of each interface name.
sandbox.extraPaths = [
"/" #< else the daemon exits immediately. TODO: decrease this scope.
];
};
services.avahi = lib.mkIf config.sane.programs.avahi.enabled {
enable = true;
package = config.sane.programs.avahi.package;
publish.enable = true;
publish.userServices = true;
nssmdns4 = true;
nssmdns6 = true;
# reflector = true;
allowInterfaces = [
# particularly, the default config disallows loopback, which is kinda fucking retarded, right?
"ens1" #< servo
"enp5s0" #< desko
"eth0"
"lo"
"wg-home"
"wlan0" #< moby
"wlp3s0" #< lappy
"wlp4s0" #< desko
];
};
}

View File

@@ -95,7 +95,7 @@ in
packageUnwrapped = pkgs.bemenu.overrideAttrs (upstream: {
nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [
pkgs.makeWrapper
pkgs.makeBinaryWrapper
];
# can alternatively be specified as CLI flags
postInstall = (upstream.postInstall or "") + ''

View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
sane.programs.bitcoin-cli = {
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.bitcoind "bitcoin-cli";
sandbox.method = "bwrap";
sandbox.autodetectCliPaths = "existing"; #< for `bitcoin-cli -datadir=/var/lib/...`
sandbox.extraHomePaths = [
".bitcoin/bitcoin.conf"
];
sandbox.net = "all"; # actually needs only localhost
secrets.".bitcoin/bitcoin.conf" = ../../../secrets/servo/bitcoin.conf.bin;
};
}

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p blast-ugjka
#!nix-shell -i python3 -p blast-ugjka -p python3
# vim: set filetype=python :
import logging

View File

@@ -31,7 +31,7 @@ in
sane.programs.blast-to-default = {
# helper to deal with blast's interactive CLI
packageUnwrapped = pkgs.static-nix-shell.mkPython3Bin {
packageUnwrapped = pkgs.static-nix-shell.mkPython3 {
pname = "blast-to-default";
pkgs = [ "blast-ugjka" ];
srcRoot = ./.;

View File

@@ -111,7 +111,7 @@ in
'';
});
fs.".config/bonsai/bonsai_tree.json".symlink.text = builtins.toJSON cfg.config.transitions;
fs.".config/bonsai/bonsai_tree.json".symlink.target = pkgs.writers.writeJSON "bonsai_tree.json" cfg.config.transitions;
sandbox.method = "bwrap";
sandbox.extraRuntimePaths = [

View File

@@ -21,7 +21,7 @@
sandbox.whitelistDri = true;
sandbox.whitelistWayland = true;
persist.byStore.cryptClearOnBoot = [
persist.byStore.ephemeral = [
".cache/BraveSoftware"
".config/BraveSoftware"
];

View File

@@ -13,7 +13,7 @@
sane.programs.callaudiod = {
packageUnwrapped = pkgs.rmDbusServices pkgs.callaudiod;
# probably more needed once i enable proper sandboxing, but for now this ensures the service isn't started too early!
sandbox.method = "bwrap";
sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ];

View File

@@ -24,7 +24,7 @@ in
};
};
packageUnwrapped = pkgs.calls.overrideAttrs (upstream: {
packageUnwrapped = pkgs.rmDbusServicesInPlace (pkgs.calls.overrideAttrs (upstream: {
patches = (upstream.patches or []) ++ [
(pkgs.fetchpatch {
# usability improvement... if the UI is visible, then i can receive calls. otherwise, i can't!
@@ -33,10 +33,10 @@ in
hash = "sha256-NoVQV2TlkCcsBt0uwSyK82hBKySUW4pADrJVfLFvWgU=";
})
];
});
}));
sandbox.method = "bwrap";
sandbox.net = "clearnet";
sandbox.net = "vpn.wg-home"; #< XXX(2024/07/05): my cell carrier seems to block RTP, so tunnel it.
sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # necessary for secrets, at the minimum
sandbox.whitelistWayland = true;

View File

@@ -66,6 +66,7 @@ end
if vars.percent ~= nil then
bat_args = bat_args .. " --percent-suffix '" .. vars.percent .. "'"
end
bat_args = bat_args .. " {bat}"
-- N.B.: `[[ <text> ]]` is Lua's multiline string literal
conky.text = [[
@@ -73,8 +74,8 @@ ${color1}${shadecolor 707070}${font sans-serif:size=50:style=Bold}${alignc}${exe
${color2}${shadecolor a4d7d0}${font sans-serif:size=20}${alignc}${exec date +"%a %d %b"}${font}
${color1}${shadecolor}${font sans-serif:size=22:style=Bold}${alignc}${execp @bat@ ]] .. bat_args .. [[ }${font}
${color1}${shadecolor}${font sans-serif:size=20:style=Bold}${alignc}${texeci 600 @weather@ }${font}
${color1}${shadecolor}${font sans-serif:size=22:style=Bold}${alignc}${execp sane-sysload ]] .. bat_args .. [[ }${font}
${color1}${shadecolor}${font sans-serif:size=20:style=Bold}${alignc}${texeci 600 timeout 20 sane-weather }${font}
${color2}${shadecolor a4d7d0}${font sans-serif:size=16}${alignc}⇅ ${downspeedf wlan0}]] .. vars.kBps .. [[${font}

View File

@@ -5,22 +5,18 @@
sandbox.net = "clearnet"; #< for the scripts it calls (weather)
sandbox.extraPaths = [
"/sys/class/power_supply"
"/sys/devices" # needed by sane-sysinfo
"/sys/devices" # needed by sane-sysload
# "/sys/devices/cpu"
# "/sys/devices/system"
];
sandbox.whitelistWayland = true;
suggestedPrograms = [
"sane-sysinfo"
"sane-sysload"
"sane-weather"
];
fs.".config/conky/conky.conf".symlink.target = pkgs.substituteAll {
src = ./conky.conf;
bat = "sane-sysinfo";
weather = "timeout 20 sane-weather";
};
fs.".config/conky/conky.conf".symlink.target = ./conky.conf;
services.conky = {
description = "conky dynamic desktop background";

View File

@@ -0,0 +1,8 @@
{ ... }:
{
sane.programs.curl = {
sandbox.method = "bwrap";
sandbox.net = "all";
sandbox.autodetectCliPaths = "parent"; #< for `-o` option
};
}

View File

@@ -10,7 +10,9 @@
./assorted.nix
./audacity.nix
./ausyscall.nix
./avahi.nix
./bemenu.nix
./bitcoin-cli.nix
./blast-ugjka
./bonsai.nix
./brave.nix
@@ -25,6 +27,7 @@
./conky
./cozy.nix
./cups.nix
./curl.nix
./curlftpfs.nix
./dbus.nix
./dconf.nix
@@ -39,6 +42,7 @@
./epiphany.nix
./errno.nix
./evince.nix
./exiftool.nix
./fcitx5.nix
./feedbackd.nix
./firefox.nix
@@ -50,8 +54,11 @@
./fwupd.nix
./g4music.nix
./gajim.nix
./gdb.nix
./gdbus.nix
./geary.nix
./geoclue-demo-agent.nix
./geoclue2.nix
./git.nix
./gnome-clocks.nix
./gnome-feeds.nix
@@ -60,6 +67,8 @@
./gnome-weather.nix
./go2tv.nix
./gpodder.nix
./gpsd.nix
./gps-share.nix
./grimshot.nix
./gst-device-monitor.nix
./gthumb.nix
@@ -67,13 +76,16 @@
./handbrake.nix
./helix.nix
./htop
./iio-sensor-proxy.nix
./imagemagick.nix
./jellyfin-media-player.nix
./kdenlive.nix
./keymapp.nix
./komikku.nix
./koreader
./less.nix
./lftp.nix
./lgtrombetta-compass.nix
./libreoffice.nix
./lemoa.nix
./loupe.nix
@@ -81,16 +93,19 @@
./megapixels.nix
./mepo.nix
./mimeo
./mimetype.nix
./mmcli.nix
./mopidy.nix
./mpv
./msmtp.nix
./nautilus.nix
./neovim.nix
./networkmanager_dmenu
./newsflash.nix
./nheko.nix
./nicotine-plus.nix
./nix-index.nix
./nix.nix
./nmcli.nix
./notejot.nix
./ntfy-sh.nix
@@ -98,25 +113,34 @@
./objdump.nix
./obsidian.nix
./offlineimap.nix
./ols.nix
./open-in-mpv.nix
./pactl.nix
./pipewire.nix
./pidof.nix
./pipewire
./pkill.nix
./planify.nix
./portfolio-filemanager.nix
./playerctl.nix
./ps.nix
./qmk-udev-rules.nix
./rhythmbox.nix
./ripgrep.nix
./rofi
./rsyslog
./rtkit.nix
./s6-rc.nix
./sane-deadlines.nix
./sane-input-handler
./sane-open.nix
./sane-private-unlock-remote.nix
./sane-screenshot.nix
./sane-scripts.nix
./sane-sysinfo.nix
./sane-secrets-unlock.nix
./sane-sysload.nix
./sane-theme.nix
./sanebox.nix
./satellite.nix
./schlock.nix
./seatd.nix
./sfeed.nix
@@ -136,14 +160,18 @@
./swaylock.nix
./swaynotificationcenter
./switchboard.nix
./sysvol.nix
./syshud.nix
./tangram.nix
./tor-browser.nix
./tuba.nix
./unl0kr
./via.nix
./visidata.nix
./vlc.nix
./wally-cli.nix
./waybar
./waylock.nix
./where-am-i.nix
./wike.nix
./wine.nix
./wireplumber.nix
@@ -155,10 +183,13 @@
./xdg-desktop-portal-wlr.nix
./xdg-terminal-exec.nix
./xdg-utils.nix
./youtube-tui.nix
./zathura.nix
./zeal.nix
./zecwallet-lite.nix
./zulip.nix
./zsa-udev-rules.nix
./zfs-tools.nix
./zsh
];

View File

@@ -50,32 +50,13 @@ in
};
};
packageUnwrapped = (pkgs.dino.override {
packageUnwrapped = pkgs.dino.override {
# XXX(2024/04/24): build without echo cancelation (i.e. force WITH_VOICE_PROCESSOR to be undefined).
# this means that if the other end of the call is on speaker phone, i'm liable to hear my own voice
# leave their speaker, enter their mic, and then return to me.
# the benefit is a >50% reduction in CPU use. insignificant on any modern PC; make-or-break on a low-power Pinephone.
webrtc-audio-processing = null;
}).overrideAttrs (upstream: {
# i'm updating experimentally to see if it improves call performance.
# i don't *think* this is actually necessary; i don't notice any difference.
version = "0.4.3-unstable-2024-04-28";
src = lib.warnIf (lib.versionOlder "0.4.3" upstream.version) "dino update: safe to remove sane patches" pkgs.fetchFromGitHub {
owner = "dino";
repo = "dino";
rev = "657502955567dd538e56f300e075c7db52e25d74";
hash = "sha256-SApJy9FgxxLOB5A/zGtpdFZtSqSiS03vggRrCte1tFE=";
};
# avoid double-application of upstreamed patches
# https://github.com/NixOS/nixpkgs/pull/309265
patches = [];
checkPhase = ''
runHook preCheck
./xmpp-vala-test
# ./signal-protocol-vala-test # doesn't exist anymore
runHook postCheck
'';
});
sandbox.method = "bwrap";
sandbox.net = "clearnet";

View File

@@ -6,6 +6,17 @@ in
sane.programs.eg25-control = {
suggestedPrograms = [ "mmcli" ];
sandbox.method = "bwrap";
sandbox.extraPaths = [
"/sys/class/modem-power"
"/sys/devices"
# "/var/lib/eg25-control"
];
sandbox.net = "all"; #< for downloading the almanac
sandbox.whitelistDbus = [
"system" #< used by `mmcli`
];
services.eg25-control-powered = {
description = "eg25-control-powered: power to the Qualcomm eg25 modem used by PinePhone";
startCommand = "eg25-control --power-on --verbose";
@@ -21,6 +32,7 @@ in
startCommand = "eg25-control --enable-gps --dump-debug-info --verbose";
cleanupCommand = "eg25-control --disable-gps --dump-debug-info --verbose";
depends = [ "eg25-control-powered" ];
partOf = [ "gps" ];
};
persist.byStore.plaintext = [ ".cache/eg25-control" ]; #< for cached agps data

View File

@@ -45,6 +45,9 @@
"Videos/servo"
"tmp"
];
sandbox.extraPaths = [
"/dev/snd" #< needed only when playing embedded audio (not embedded video!)
];
# creds/session keys, etc
persist.byStore.private = [ ".config/Element" ];

View File

@@ -1,19 +1,15 @@
{ pkgs, ... }:
{
sane.programs.errno = {
# packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.moreutils "bin/errno";
# packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.moreutils "errno";
# actually, don't build all of moreutils because not all of it builds for cross targets.
# some of this can be simplified after <https://github.com/NixOS/nixpkgs/pull/316446>
packageUnwrapped = pkgs.moreutils.overrideAttrs (base: {
makeFlags = (base.makeFlags or []) ++ [
"BINS=errno"
"MANS=errno.1"
"PERLSCRIPTS=errno" #< Makefile errors if empty, but this works :)
"INSTALL_BIN=install"
];
#v disable the perl-specific stuff
propagatedBuildInputs = [];
postInstall = "";
buildInputs = []; #< errno has no runtime perl deps, and they don't cross compile, so disable them.
});
sandbox.method = "landlock";

View File

@@ -0,0 +1,7 @@
{ ... }:
{
sane.programs.exiftool = {
sandbox.method = "bwrap";
sandbox.autodetectCliPaths = "existingFile";
};
}

View File

@@ -55,7 +55,7 @@ in
# - theme-demo
# - timeout-completed
# - window-close
fs.".config/feedbackd/themes/proxied.json".symlink.text = builtins.toJSON {
fs.".config/feedbackd/themes/proxied.json".symlink.target = pkgs.writers.writeJSON "proxied.json" {
name = "proxied";
parent-theme = "default";
profiles = [

View File

@@ -105,6 +105,22 @@ let
};
# extraPrefs = ...
}).overrideAttrs (base: {
nativeBuildInputs = (base.nativeBuildInputs or []) ++ [
pkgs.copyDesktopItems
];
desktopItems = (base.desktopItems or []) ++ [
(pkgs.makeDesktopItem {
name = "${cfg.browser.libName}-in-vpn";
desktopName = "${cfg.browser.libName} (VPN)";
genericName = "Web Browser";
# N.B.: --new-instance ensures we don't reuse an existing non-vpn instance.
# OTOH, it may error about "only one instance can run at a time": close the non-VPN instance if you see that.
exec = "${lib.getExe pkgs.sane-scripts.vpn} do - -- ${cfg.browser.libName} --new-instance";
icon = cfg.browser.libName;
categories = [ "Network" "WebBrowser" ];
type = "Application";
})
];
# de-associate `ctrl+shift+c` from activating the devtools.
# based on <https://stackoverflow.com/a/54260938>
# TODO: could use `zip -f` to only update the one changed file, instead of rezipping everything.
@@ -130,7 +146,8 @@ let
echo "omni.ja AFTER:"
ls -l $out/lib/${cfg.browser.libName}/browser/omni.ja
# runHook postFixup to allow sane.programs sandbox wrappers to wrap the binaries
runHook postBuild
runHook postInstall
runHook postFixup
'';
});
@@ -160,7 +177,7 @@ let
persistCache = mkOption {
description = "optional store name to which persist browser cache";
type = types.nullOr types.str;
default = "cryptClearOnBoot";
default = "ephemeral";
};
addons = mkOption {
type = types.attrsOf addonOpts;
@@ -263,7 +280,7 @@ in
# TODO: find a way to not expose ~/.ssh to firefox
# - unlock sops at login (or before firefox launch)?
# - see if ssh has a more formal type of subkey system?
".ssh/id_ed25519"
# ".ssh/id_ed25519"
# ".config/sops"
"knowledge/secrets/accounts"
];
@@ -372,14 +389,14 @@ in
if (cfg.persistData != null) then
cfg.persistData
else
"cryptClearOnBoot"
"ephemeral"
;
persist.byPath."${cfg.browser.dotDir}/default".store =
if (cfg.persistData != null) then
cfg.persistData
else
"cryptClearOnBoot"
"ephemeral"
;
};

View File

@@ -1,7 +1,7 @@
{ pkgs, ... }:
{
sane.programs.free = {
packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.procps "bin/free";
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.procps "free";
sandbox.method = "bwrap";
sandbox.isolatePids = false;
};

View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
sane.programs.gdb = {
sandbox.enable = false; # gdb doesn't sandbox well. i don't know how you could.
# sandbox.method = "landlock"; # permission denied when trying to attach, even as root
sandbox.autodetectCliPaths = true;
fs.".config/gdb/gdbinit".symlink.text = ''
# enable commands like `py-bt`, `py-list`, etc.
# for usage, see: <https://wiki.python.org/moin/DebuggingWithGdb>
source ${pkgs.python3}/share/gdb/libpython.py
'';
};
}

View File

@@ -1,7 +1,7 @@
{ pkgs, ... }:
{
sane.programs.gdbus = {
packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.glib "bin/gdbus";
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.glib "gdbus";
sandbox.method = "bwrap";
sandbox.whitelistDbus = [ "user" ]; #< XXX: maybe future users will also want system access

View File

@@ -5,10 +5,10 @@
# <https://gitlab.gnome.org/GNOME/geary/-/issues/1212>
{ config, lib, ... }:
let
cfg = config.sane.programs."gnome.geary";
cfg = config.sane.programs."geary";
in
{
sane.programs."gnome.geary" = {
sane.programs."geary" = {
configOption = with lib; mkOption {
default = {};
type = types.submodule {

View File

@@ -0,0 +1,23 @@
{ config, pkgs, ... }:
{
sane.programs.geoclue-demo-agent = {
packageUnwrapped = pkgs.linkFarm "geoclue-demo-agent" [{
# bring the demo agent into a `bin/` directory so it can be invokable via PATH
name = "bin/geoclue-demo-agent";
path = "${config.sane.programs.geoclue2.packageUnwrapped}/libexec/geoclue-2.0/demos/agent";
}];
sandbox.method = "bwrap";
sandbox.whitelistDbus = [
"system"
];
services.geoclue-agent = {
description = "geoclue 'demo' agent";
# XXX: i don't actually understand how this works: upstream dbus rules would appear to restrict
# the dbus owner to just root/geoclue, but we're neither and this still works (and breaks if i remove the agent service!)
command = "geoclue-demo-agent";
partOf = [ "graphical-session" ];
};
};
}

View File

@@ -0,0 +1,76 @@
# geoclue location services daemon.
#
# SUPPORT:
# - irc: #gnome-maps on irc.gimp.org
# - Matrix: #gnome-maps:gnome.org (unclear if bridged to IRC)
# - forums: <https://discourse.gnome.org/c/platform>
# - git: <https://gitlab.freedesktop.org/geoclue/geoclue/>
# - D-Bus API docs: <https://www.freedesktop.org/software/geoclue/docs/>
#
# HOW TO TEST:
# - just invoke `where-am-i`: it should output the current latitude/longitude.
## more manual testing:
# - build `geoclue2-with-demo-agent`
# - run the service: `systemctl start geoclue` or "${geoclue2-with-demo-agent}/libexec/geoclue"
# - run "${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/agent"
# - keep this running in the background
# - run "${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/where-am-i"
#
# DATA FLOW:
# - geoclue2 does http calls into local `ols`, which either hits the local disk or queries https://wigle.net.
# - geoclue users like gnome-maps somehow depend on an "agent",
# a user service which launches the geoclue system service on-demand (via dbus activation).
#
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.geoclue2;
in
{
sane.programs.geoclue2 = {
# packageUnwrapped = pkgs.rmDbusServices pkgs.geoclue2;
# packageUnwrapped = pkgs.geoclue2.override { withDemoAgent = true; };
packageUnwrapped = pkgs.geoclue2-with-demo-agent;
suggestedPrograms = [
"avahi" #< to discover LAN gps devices
"geoclue-demo-agent"
# "gps-share"
"iio-sensor-proxy"
"ols" #< WiFi SSID -> lat/long lookups
"satellite" #< graphical view into GPS fix data
"where-am-i" #< handy debugging/testing tool
];
# XXX(2024/07/05): no way to plumb my sandboxed geoclue into `services.geoclue2`.
# then, the package doesn't get used directly anywhere. but other programs reference `packageUnwrapped`,
# so keep that part still.
sandbox.enable = false;
package = lib.mkForce null;
# experimental sandboxing (2024/07/05)
# sandbox.method = "bwrap";
# sandbox.whitelistDbus = [
# "system"
# ];
# sandbox.net = "all";
};
# sane.programs.geoclue2.enableFor.system = lib.mkIf (builtins.any (en: en) (builtins.attrValues cfg.enableFor.user)) true;
services.geoclue2 = lib.mkIf cfg.enabled {
enable = true;
geoProviderUrl = "http://127.0.0.1:8088/v1/geolocate"; #< ols
# XXX(2024/06/25): when Geoclue uses ModemManager's GPS API, it wants to enable GPS
# tracking at the start, and disable it at the end. that causes tracking to be lost, regularly.
# this is not optional behavior: if Geoclue fails to control modem manager (because of a polkit policy, say),
# then it won't even try to read the data from modem manager.
# SOLUTION: tell Geoclue to get GPS from gps-share ("enableNmea", i.e. `network-nmea.enable`)
# and NOT from modem manager.
enableModemGPS = false;
enableNmea = true;
};
systemd.user.services = lib.mkIf cfg.enabled {
# nixos services.geoclue2 runs the agent as a user service by default, but i don't use systemd so that doesn't work.
# i manage the agent myself, in sane.programs.geoclue-demo-agent.
geoclue-agent.enable = false;
};
}

View File

@@ -40,6 +40,7 @@ in
alias.amend = "commit --amend --no-edit";
alias.br = "branch";
alias.co = "checkout";
alias.com = "commit";
alias.cp = "cherry-pick";
alias.d = "difftool";
alias.dif = "diff"; # common typo

View File

@@ -1,12 +1,12 @@
# gnome feeds RSS viewer
{ config, lib, sane-lib, ... }:
{ config, lib, pkgs, sane-lib, ... }:
let
feeds = sane-lib.feeds;
all-feeds = config.sane.feeds;
wanted-feeds = feeds.filterByFormat ["text" "image"] all-feeds;
in {
sane.programs.gnome-feeds.fs.".config/org.gabmus.gfeeds.json".symlink.text = builtins.toJSON {
sane.programs.gnome-feeds.fs.".config/org.gabmus.gfeeds.json".symlink.target = pkgs.writers.writeJSON "org.gabmus.gfeeds.json" {
# feed format is a map from URL to a dict,
# with dict["tags"] a list of string tags.
feeds = sane-lib.mapToAttrs (feed: {

View File

@@ -1,7 +1,7 @@
{ lib, pkgs, ... }:
{
sane.programs.gnome-keyring = {
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome.gnome-keyring;
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome-keyring;
sandbox.method = "bwrap";
sandbox.whitelistDbus = [ "user" ];
sandbox.extraRuntimePaths = [

View File

@@ -1,7 +1,30 @@
# SUPPORT:
# - irc: #gnome-maps on irc.gimp.org
# - Matrix: #gnome-maps:gnome.org (unclear if bridged to IRC)
#
# INTEGRATIONS:
# - uses https://graphhopper.com for routing
# - <https://github.com/graphhopper/graphhopper> (not packaged for Nix)
# - uses https://tile.openstreetmap.org for tiles
# - uses https://overpass-api.de for ... ?
# TIPS:
# - use "Northwest" instead of "NW", and "Street" instead of "St", etc.
# otherwise, it might not find your destination!
{ pkgs, ... }:
{
sane.programs."gnome.gnome-maps" = {
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome.gnome-maps;
packageUnwrapped = pkgs.rmDbusServicesInPlace (pkgs.gnome.gnome-maps.overrideAttrs (base: {
# default .desktop file is trying to do some dbus launch (?) which fails even *if* i install `gapplication` (glib.bin)
postPatch = (base.postPatch or "") + ''
substituteInPlace data/org.gnome.Maps.desktop.in.in \
--replace-fail 'Exec=gapplication launch @app-id@ %U' 'Exec=gnome-maps %U'
'';
}));
suggestedPrograms = [
"geoclue2"
];
sandbox.wrapperType = "inplace"; #< /share directory contains Gir info which references libgnome-maps.so by path
sandbox.method = "bwrap";
sandbox.whitelistDri = true; # for perf
sandbox.whitelistDbus = [

View File

@@ -0,0 +1,57 @@
# gps-share: <https://github.com/zeenix/gps-share>
# takes a local GPS device (e.g. /dev/ttyUSB1) and makes it available over TCP/Avahi (multicast DNS).
#
# common usecases:
# 1. make positioning available to any device on a network, even if that device has no local GPS
# - e.g. my desktop can use my phone's GPS device, if on the same network.
# 2. allow multiple clients to share a GPS device.
# GPS devices are serial devices, and so only one process can consume the data at a time.
# gps-share can camp the serial device, and then allow *multiple* subscribers
# 3. provide a *read-only* API to clients like Geoclue.
# that is, expose the GPS device *output* to a client, but don't let the client write to the device (e.g. enable/disable the GPS).
# this is the primary function i derive from gps-share
#
# HOW TO TEST:
# - `nc localhost 10110`
# should stream GPS NMEA output to the console
# - `avahi-browse --resolve _nmea-0183._tcp`: should show hosts on the local network which provide GPS info
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.gps-share;
in
{
sane.programs.gps-share = {
suggestedPrograms = [
"jq"
# and systemd, for udevadm
];
services.gps-share = {
description = "gps-share: make local GPS serial readings available over Avahi";
# usage:
# gps-share --no-announce # to disable Avahi
# gps-share --no-tcp # only makes sense if using --socket-path
# gps-share --network-interface lo # defaults to all interfaces, but firewalling means actually more restrictive
# gps-share --socket-path $XDG_RUNTIME_DIR/gps-share/gps-share.sock # share over a unix socket
command = pkgs.writeShellScript "gps-share" ''
dev=$(udevadm info --property-match=ID_MM_PORT_TYPE_GPS=1 --json=pretty --export-db | jq -r .DEVNAME)
if [ -z "$dev" ]; then
echo "no GPS device found"
exit 1
fi
echo "using $dev for GPS NMEA"
gps-share "$dev"
'';
# N.B.: it fails to launch if the NMEA device doesn't yet exist, so don't launch by default; only launch as part of GPS
# dependencyOf = [ "geoclue-agent" ];
partOf = [ "gps" ];
depends = [ "eg25-control-powered" ];
};
sandbox.method = "bwrap";
sandbox.net = "all";
sandbox.autodetectCliPaths = "existing"; #< N.B.: `test -f /dev/ttyUSB1` fails, we can't use `existingFile`
};
# TODO: restrict this to just LAN devices!!
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enabled [ 10110 ];
}

View File

@@ -0,0 +1,33 @@
# test gpsd with `gpspipe -w -n 10 2> /dev/null | grep -m 1 TPV | jq '.lat, .lon' | tr '\n' ' '`
# ^ should return <lat> <long>
#
# TODO(2024/06/19): nixpkgs' gpsd service isn't sandboxed at ALL. i should sandbox that, or remove this integration.
#
# pinephone GPS happens in EG25 modem
# serial control interface to modem is /dev/ttyUSB2
# after enabling GPS, readout is /dev/ttyUSB1
#
# minimal process to enable modem and GPS:
# - `echo 1 > /sys/class/modem-power/modem-power/device/powered`
# - `screen /dev/ttyUSB2 115200`
# - `AT+QGPSCFG="nmeasrc",1`
# - `AT+QGPS=1`
# this process is automated by my `eg25-control` program and services (`eg25-control-powered`, `eg25-control-gps`)
# - see the `modules/` directory further up this repository.
#
# now, something like `gpsd` can directly read from /dev/ttyUSB1,
# or geoclue can query the GPS directly through modem-manager
#
# initial GPS fix can take 15+ minutes.
# meanwhile, services like eg25-manager or eg25-control-freshen-agps can speed this up by uploading assisted GPS data to the modem.
{ config, lib, ... }:
let
cfg = config.sane.programs.gpsd;
in
{
sane.programs.gpsd = {};
services.gpsd = lib.mkIf cfg.enabled {
enable = true;
devices = [ "/dev/ttyUSB1" ];
};
}

View File

@@ -5,10 +5,9 @@
{ pkgs, ... }:
{
sane.programs.gst-device-monitor = {
packageUnwrapped = (pkgs.linkIntoOwnPackage pkgs.gst_all_1.gst-plugins-base [
"bin/gst-device-monitor-1.0"
"share/man/man1/gst-device-monitor-1.0.1.gz"
]).overrideAttrs (base: {
packageUnwrapped = (
pkgs.linkBinIntoOwnPackage pkgs.gst_all_1.gst-plugins-base "gst-device-monitor-1.0"
).overrideAttrs (base: {
# XXX the binaries need `GST_PLUGIN_SYSTEM_PATH_1_0` set to function,
# but nixpkgs doesn't set those (TODO: upstream this!)
nativeBuildInputs = (base.nativeBuildInputs or []) ++ [
@@ -20,5 +19,14 @@
pkgs.pipewire #< required for Video/Source (video4linux)
];
});
sandbox.method = "bwrap";
sandbox.whitelistAudio = true;
sandbox.extraPaths = [
"/dev" # tried, but failed to narrow this down (moby)
"/run/udev/data"
"/sys/class/video4linux"
"/sys/devices"
];
};
}

View File

@@ -0,0 +1,55 @@
# chat (Matrix): #iio-sensor-proxy:dylanvanassche.be
# src: <https://gitlab.freedesktop.org/hadess/iio-sensor-proxy>
# IIO = "Industrial I/O": <https://www.kernel.org/doc/html/v4.12/driver-api/iio/index.html>
# iio-sensor-proxy reads IIO data reported by the kernel at /sys/bus/iio/* and makes it available to dbus applications.
# this includes:
# - ambient light sensor
# - compass/magnetometer (LIMITED)
# - accelerometer (rotation)
#
# use:
# - show available sensors: `gdbus introspect --system --dest net.hadess.SensorProxy --object-path /net/hadess/SensorProxy`
# - read sensors: `sudo -u geoclue monitor-sensor --compass`
# - default dbus policy only allows geoclue to use the compass
# - `sudo monitor-sensor` for light/rotation
#
# HARDWARE SUPPORT: PINEPHONE (2024/07/01)
# - accelerometer and light sensor seem to work
# - magnetometer (af8133j, different but similar to lis3mdl) IS NOT SUPPORTED
# - <https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/310>
# - exists in sysfs and can be viewed with
# `cat /sys/devices/platform/soc/1c2b000.i2c/i2c-1/1-001c/iio:device2/in_magn_x_raw`
# - nothing in iio-sensor-proxy reads anything related to "magn".
# - WIP PR to support magnetometers: <https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/merge_requests/316>
# - after rebase, it *functions*, but does not scale the readings correctly
# heading changes only over the range of 50 - 70 deg.
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.iio-sensor-proxy;
in
{
sane.programs.iio-sensor-proxy = {
packageUnwrapped = pkgs.iio-sensor-proxy.overrideAttrs (upstream: {
patches = (upstream.patches or []) ++ [
(pkgs.fetchpatch {
name = "WIP:compass: Add support for polling uncalibrated devices";
# url = "https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/merge_requests/316.diff";
url = "https://git.uninsane.org/colin/iio-sensor-proxy/commit/fd21f1f4bf1eadd603b1f24f628b979691d9cf3b.diff";
hash = "sha256-+GoEPby6q+uSkQlZWFWr5ghx3BKBMGk7uv/DDhGnxDk=";
})
];
});
enableFor.system = lib.mkIf (builtins.any (en: en) (builtins.attrValues cfg.enableFor.user)) true; #< for dbus/polkit policies
sandbox.method = "bwrap";
sandbox.whitelistDbus = [ "system" ];
sandbox.extraPaths = [
"/run/udev/data"
"/sys/bus"
"/sys/devices"
];
};
services.udev.packages = lib.mkIf cfg.enabled [ cfg.package ];
# services.dbus.packages = lib.mkIf cfg.enabled [ cfg.package ]; #< for bus ownership policy
systemd.packages = lib.mkIf cfg.enabled [ cfg.package ]; #< for iio-sensor-proxy.service
}

View File

@@ -1,13 +1,6 @@
{ pkgs, ... }:
{
sane.programs.kdenlive = {
packageUnwrapped = pkgs.kdenlive.override {
ffmpeg-full = pkgs.ffmpeg-full.override {
# avoid expensive samba build for a feature i don't use
withSamba = false;
};
};
buildCost = 1;
sandbox.method = "bwrap";

View File

@@ -0,0 +1,8 @@
# ZSA keyboard (Ergodox, Moonlander, ...) firmware flasher and keymap viewer.
# video: <https://www.zsa.io/flash>
# displays on launch:
# - "Error connecting to the keyboard, make sure the layout flashed on your keyboard was recently compiled with Oryx and that the [Live training] option is toggled on in the advanced settings."
{ ... }:
{
sane.programs.keymapp = {};
}

View File

@@ -3,10 +3,10 @@
sane.programs.komikku = {
packageUnwrapped = pkgs.komikku.overrideAttrs (upstream: {
preFixup = ''
# 2024/02/21: render bug which affects only moby:
# large images render blank in several gtk applications.
# may resolve itself as gtk or mesa are updated.
gappsWrapperArgs+=(--set GSK_RENDERER cairo)
# 2024/07/25: Komikku uses XDG_SESSION_TYPE in the webkitgtk useragent, and errors if it's empty.
# XDG_SESSION_DESKTOP is used similarly in debug_info.py.
# TODO: patch/upstream Komikku
gappsWrapperArgs+=(--set-default XDG_SESSION_TYPE "unknown" --set-default XDG_SESSION_DESKTOP "unknown")
'' + (upstream.preFixup or "");
});
@@ -24,5 +24,8 @@
# also writes to ~/.cache/komikku
".local/share/komikku"
];
persist.byStore.ephemeral = [
".cache/komikku"
];
};
}

View File

@@ -17,7 +17,7 @@
# - these are stored in `~/.config/koreader/data/dict`
# - configure defaults:
# - edit keys in ~/.config/koreader/settings.reader.lua
# - default font size: `["copt_font_size"] = 28,`
# - default font size: `["copt_font_size"] = 30,`
# - home dir: `["home_dir"] = "/home/colin/Books",`
{ config, lib, pkgs, sane-lib, ... }:

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