Compare commits

...

1253 Commits

Author SHA1 Message Date
29b757638c megapixels-next: make it the default camera 2024-09-21 12:24:25 +00:00
821855651d gnome-calls: sandbox with bunpen 2024-09-21 12:23:33 +00:00
606be197db nicotine-plus: sandbox with bunpen 2024-09-21 12:23:21 +00:00
208b634040 programs/sandboxing: add required args to use pasta 2024-09-21 12:21:11 +00:00
224b298cda bunpen: tighter sequencing around pasta net proxying 2024-09-21 11:52:13 +00:00
29975ce787 remove custom eg25-manager and use nixpkgs upstream instead 2024-09-21 08:33:15 +00:00
90d48849cc mpv: replace "blast-to-default" with "sane-cast"
i could kill 'blast-to-default' altogether now, but i may hold off until i'm more certain this works
2024-09-21 08:30:01 +00:00
9a4635c93b sane-cast: support casting audio 2024-09-21 08:29:23 +00:00
f7b4e5ba98 pipewire: create a "effect_input.virtual" node which can become the "blast" audio source in the future 2024-09-21 07:38:05 +00:00
84c4dcb9d1 blast-ugjka: format with nixfmt 2024-09-21 06:37:31 +00:00
3dff60397e bunpen: get pasta working
full of race conditions and weird edge cases (some of which may have existed before)
2024-09-21 03:40:26 +00:00
b105e774b3 btrfs-progs: fix sandboxing 2024-09-21 01:56:56 +00:00
e9d3623a97 firefox: add search shortcut for ArchLinux wiki 2024-09-21 00:14:34 +00:00
a9472a14f2 bunpen: restore /proc access in PID-namespaced applications 2024-09-20 23:15:05 +00:00
a2abe159a4 bunpen: tests: ensure that --bunpen-keep-net actually does something 2024-09-20 22:50:24 +00:00
0546bf6ea5 bunpen: barebones pasta integration
totally untested, except that it builds
2024-09-20 12:41:39 +00:00
d22bbcf44a bunpen: refactor: be more organized with how we shed resources 2024-09-20 11:51:53 +00:00
e6803d6068 bunpen: refactor: split mount_ns into own file 2024-09-20 11:22:10 +00:00
3993f26cc6 bunpen: move restrict::namespace_restrict -> restrict::ns::namespace_restrict 2024-09-20 11:18:02 +00:00
f6a93e120a yt-dlp: fix that downloaded files have ordinary mtimes 2024-09-20 11:02:11 +00:00
b3a6656c81 moby: linux-armbian: remove an unnecessary HDMI-sound patch 2024-09-20 10:12:21 +00:00
a4a43d24dc eg25-control: fix missing sandbox path 2024-09-20 10:11:46 +00:00
ec144ae63b eg25-control: fix build 2024-09-20 10:11:46 +00:00
145c65b66b linux-armbian: enable patches necessary to boot the modem (with eg25-manager, or soon, eg25-control) 2024-09-20 10:11:46 +00:00
dfad5d596d eg25-control: fix power-down sequence 2024-09-20 10:11:09 +00:00
ee083b1b8f eg25-control: slightly more robust power-down codepath (i suspect it's still broken though) 2024-09-20 09:40:04 +00:00
f1d05af377 eg25-control: support power-on/off via GPIO control instead of modem-power 2024-09-20 08:07:15 +00:00
c81a6f51e2 eg25-control: split out a Phy abstraction behind which to hide megi's modem-power API 2024-09-20 08:07:15 +00:00
8559de949e python3-repl: ship libgpiod 2024-09-20 04:19:54 +00:00
8979ff0eec bunpen: plumb pasta related arguments into make-sandboxed
for testing only: these options don't yet have the intended effect
2024-09-19 23:54:43 +00:00
2a4043523d bunpen: plumb pasta CLI options up through main 2024-09-19 23:52:07 +00:00
bf53ab1cb1 bunpen: parse net CLI switches 2024-09-19 23:35:05 +00:00
381641b2db eg25-manager: actually ship udev rules (?) 2024-09-19 23:25:59 +00:00
1cc809b347 avahi: sandbox with bunpen 2024-09-19 23:10:28 +00:00
9e74297acd eg25-manager: ship udev rules 2024-09-19 22:39:00 +00:00
51556eeefd readme: remove outdated mention of sxmo-utils 2024-09-19 19:46:32 +00:00
32d565fe77 uassets: 0-unstable-2024-09-17 -> 0-unstable-2024-09-19 2024-09-19 19:02:24 +00:00
0e4b38a163 Revert "mpv: uosc: remove package pin"
This reverts commit 03ebb3de28.

newer uosc is completely unresponsive to touch controls.
sliders (speed, position, and *possibly* volume) respond to touch,
but buttons like play/forward/previous/close/menu don't activate.
2024-09-19 11:01:49 +00:00
03ebb3de28 mpv: uosc: remove package pin
this is not thoroughly tested; may well be partly broken on moby
2024-09-19 10:40:02 +00:00
b034196ce4 eg25-manager: ship (but not yet integrated) 2024-09-19 10:06:39 +00:00
b0edd56ba2 activationScripts: cleanup the "nixos activated" graphical notification 2024-09-19 10:05:56 +00:00
717af4e5ff moby: clean up kernel config 2024-09-19 08:26:45 +00:00
3c660df817 moby: ship axp20x_adc as a kernel module, in initrd, instead of as a builtin
works: display
works: rear camera (megapixels-next)
works: torch / LED
works: speaker
works: headphones
untested: battery/charging
2024-09-19 08:26:45 +00:00
dc1999e7b2 moby: default the ARM64_LPA2 kernel option
works: display
works: rear camera (megapixels-next)
works: torch / LED
works: speaker
works: headphones
untested: battery/charging
2024-09-19 08:26:45 +00:00
e2698f02c6 moby: default AXP20X_POWER kernel config
works: display
works: rear camera (megapixels-next)
works: torch / LED
works: speaker
works: headphones
untested: battery/charging
2024-09-19 08:26:45 +00:00
3c863bc004 moby: default some more AXP20x kernel options
works: display
works: rear camera (megapixels-next)
works: torch / LED
works: speaker
works: headphones
untested: battery/charging
2024-09-19 08:26:45 +00:00
fec90421df moby: remove INPUT_AXP20X_PEK kernel config override
works: display
works: rear camera (megapixels-next)
works: speakers
works: headphones
works: microphone
works: torche / LED
2024-09-19 08:26:45 +00:00
1c5b9f1ede moby: re-disable LCD_CLASS_DEVICE, now that boot has been verified 2024-09-19 08:26:45 +00:00
4ea9698959 moby: remove REGULATOR_VCTRL kernel config override
works: display
works: rear camera (via megapixels-next)
works: torch / LED
works: speakers
works: headphones
untested: battery/charging
2024-09-19 08:26:45 +00:00
c6705be538 moby: disable another LCD-related kernel override (and temporarily re-enable SUN50I_IOMMU until tested)
working: display
UNTESTED: camera
UNTESTED: torch / LED
UNTESTED: speakers
UNTESTED: headphones
2024-09-19 08:26:45 +00:00
d8b9f58788 moby: disable CMA/DMABUF config options
works: display
works: torch / LED
works: rear camera (via megapixels-next)
works: speakers
works: headphones
2024-09-19 08:26:45 +00:00
378168776a moby: remove the device-tree related kernel options
works: display
works: rear camera (via megapixels-next)
works: torch
works: speakers
works: headphones
untested: battery/charging
2024-09-19 08:26:45 +00:00
f5a86956a9 moby: remove the DRM-related kernel config overrides 2024-09-19 08:26:45 +00:00
965ef91736 moby: remove a couple more custom kernel configs
also revert the previous commit, but that's a development artifact; not actually required.

works: display
works: rear camera (via megapixels-next)
works: torch / LED
works: speakers
works: headphones
2024-09-19 08:26:45 +00:00
791b96fa8f moby: switch DRM kernel options from builtin back to module
works: display
works: rear camera (via megapixels-next)
works: torch / LED
works: speakers
works: headphones
2024-09-19 08:26:45 +00:00
92626cd87d moby: disable a few more custom kernel config options
works: display
works: rear camera (megapixels-next)
works: speaker
works: headphones
works: torch / LED
2024-09-19 08:26:45 +00:00
09bbd9fd91 NOT FOR MERGE: moby: switch a few more kernel options back to their default
display: non-functional
2024-09-19 08:26:45 +00:00
9b07eebf6d moby: switch a few more kernel configs back to their default
works: display
works: rear camera (via megapixels-next)
works: speakers
works: headphones
works: torch / LED
untested: battery/charging
2024-09-19 08:26:45 +00:00
439ee43a5e moby: decrease custom kernel config
works: display
works: rear camera / megapixels-next
works: speaker
works: headphones
works: torch / LED
untested: battery / charging
2024-09-19 08:26:45 +00:00
e2a96a391f moby: reduce custom kernel configs
works: rear camera (megapixels-next)
works: speaker
works: headphones
works: camera flash
untested: battery/charging
2024-09-19 08:26:45 +00:00
6be3a8a245 moby: remove a few unnecessary kernel configs
camera: works (rear, in megapixels-next)
speakers: work
headphones: work
charging: untested (assume the USB-C port only powers the board, doesn't charge the battery)
2024-09-19 08:26:45 +00:00
7a3c550817 moby: remove pmos kernel config (and replace some m options with y to keep functionality)
graphics: works
rear camera: works (in megapixels-next)
speakers: work
headphones: work
battery: incapable of charging; battery current capped to below 0.
- i *think* this happened when i switched to "all" config, earlier.
2024-09-19 08:26:45 +00:00
7b72046bee moby: don't blacklist mainline gc2145
this doesn't enable the front camera in any app, but it doesn't break anything either
2024-09-19 08:26:45 +00:00
5500a7ffcc linux-armbian: enable withFullConfig
hope to disable pmos later, but for now that would kill graphics.

battery charging _may_ be capped such that the battery cannot charge
unless powered off. difficult to tell for certain.
2024-09-19 08:26:45 +00:00
e2cd92a356 cross: push xdg-desktop-portal build fix upstream 2024-09-19 08:26:45 +00:00
b1036896fe cross: push switchboard-plug-network patch upstream 2024-09-19 08:26:45 +00:00
e4ab6e2022 cross: remove a few upstreamed patches 2024-09-19 08:26:44 +00:00
631bd9998d nixpkgs: 24.05-unstable-2024-09-16 -> 24.05-unstable-2024-09-17 2024-09-19 08:26:44 +00:00
28d329855f nixpkgs-wayland: 0-unstable-2024-09-13 -> 0-unstable-2024-09-17 2024-09-19 08:26:44 +00:00
4d03d7a845 sops-nix: assets-unstable-2024-09-13 -> assets-unstable-2024-09-16 2024-09-19 08:26:44 +00:00
2f367c1247 syshud: 0-unstable-2024-09-10 -> 0-unstable-2024-09-15 2024-09-19 08:26:44 +00:00
ee62acab02 uassets: 0-unstable-2024-09-14 -> 0-unstable-2024-09-17 2024-09-19 08:26:44 +00:00
9efa3f8f86 moby: disable some inconsequential audio-related kernel patches
speaker: works.
headphones: works.
internal mic: works.
headphone mic: works.
2024-09-19 08:26:44 +00:00
7b57d62da6 moby: disable more kernel audio patches
speakers: works.
headphones: works.
headset mic: works.
builtin mic: works.
2024-09-19 08:26:44 +00:00
aa0ca7ed0e moby: remove more AC100 audio patches
speakers: work. headphones: work.
mic: untested.
2024-09-19 08:26:44 +00:00
c0347eb68a moby: disable the "analog" component of AC100 codec as well
speaker and headphones work; builtin and headphone mic work.
2024-09-19 08:26:44 +00:00
e5a1aeedac moby: disable digital part of AC100
speaker and headphone audio work. safe to deploy.
2024-09-19 08:26:44 +00:00
9108ecdf59 moby: enable speaker audio
tested: speaker, headphone, rear cam (via megapixels-next)

this is hopefully more patches than actually required.
2024-09-19 08:26:44 +00:00
1859cfc714 moby: kernel: disable unnecessary N_VBUSEN patch
still working: rear cam with megapixels-next, charging, headphone out
2024-09-19 08:26:44 +00:00
c8fca594ef linux-armbian: fixup patching logic for modem power (still doesnt apply against 6.11.0 though) 2024-09-19 08:26:44 +00:00
395ff01276 moby: linux-armbian: switch back to armbian's megous patches, since they're better tracked
functionality is identical to mobian's
2024-09-19 08:26:44 +00:00
13b38f523c linux-armbian: fix formatting 2024-09-19 08:26:44 +00:00
1dc18bca5f firefox: add a search shortcut for repology.org 2024-09-17 07:42:21 +00:00
e763673e75 moby: ship stock kernel 6.11 with a subset of mobian patches
this is enough for the rear camera to work in megapixels-next (NOT normal megapixels, and not snapshot or gnome-screenshot)

audio over 3.5mm works; but not over speakers. charging: unknown
2024-09-17 03:27:55 +00:00
034c3f987e programs/make-sandboxed: fix for apps which ship thumbnailers (i.e. gnome papers) 2024-09-17 02:33:51 +00:00
c15d068f39 linux-mobian: init 2024-09-17 02:33:08 +00:00
6ad53751a1 nixpkgs: 24.05-unstable-2024-09-14 -> 24.05-unstable-2024-09-16
i'll lose access to the pinephone camera for a while, since this bumps to linux 6.11. but i think i can take from mobian linux to restore that, using just devicetree changes
2024-09-17 02:04:12 +00:00
bcc6c773cb deploy gnome-screenshot, for camera testing 2024-09-17 02:02:24 +00:00
dfe3f39225 linux-armbian: show that i can build against the armbian patches
they don't achieve much; nothing noticable at all, actually
2024-09-17 02:02:02 +00:00
2bb4a3fec2 linux-armbian: -> 2024-09-16 2024-09-17 02:01:22 +00:00
a03a0fcefd moby: kernel: remove another extraneous patch (still the display isnt coming on though, nor does libcamera see any cams) 2024-09-16 22:59:20 +00:00
b41db547ec moby: kernel: re-enable build-time improvements and display config (the latter doesnt always work though) 2024-09-16 22:58:47 +00:00
6edc81d437 moby: kernel: build without full config again 2024-09-16 22:57:48 +00:00
6d8008ea5e UNTESTED: linux-armbian: patch so it builds against linux 6.11 2024-09-16 21:25:37 +00:00
2c932ed926 moby: stop overriding the armbian kernel
that'll be useful as a form of documentation in the future, but for now it's just hassle
2024-09-16 21:23:39 +00:00
4560bb9dda WIP: moby: also blacklist gc2145, for flexibility in running mainline kernel
i think mainline camera *still* doesn't work though, even with this
2024-09-16 21:22:37 +00:00
051625fd47 moby: kernel: add a withMegousPatches option, disabled to get the minimal usable build (lacking cameras, and possibly with charging limitations) 2024-09-16 18:51:33 +00:00
bb0a90ec1e scripts/deploy: add a --deriv flag to deploy a pre-built path
useful for systems like moby where re-evaluating an unchanged system is expensive
2024-09-16 18:40:42 +00:00
acca87c187 moby: reduce the kernel patching
tested: camera (Megapixels), audio (mpv: speakers, headphones)

i think i *might* have had one failed (i.e. no graphics) boot? not sure.
2024-09-16 09:02:02 +00:00
e23429eebe moby: build w/o full config -- just pmos + nixpkgs
this *should* make iteration (of reducing kernel patches) a little quicker

this is the eventual goal, though in the meantime it may be quicker iteration to build with *only* pmos config and no full config
2024-09-16 08:21:17 +00:00
9fcbd6e7e2 moby: remove a few more unnecessary kernel patches 2024-09-16 04:57:00 +00:00
d943946f9d doc: moby: note why certain kernel patches must be kept 2024-09-16 04:36:22 +00:00
c8543e9326 moby: blacklist fewer camera-adjacent kernel modules 2024-09-16 02:42:08 +00:00
e9decbbf40 sandboxing: add a global toggle to disable sandboxing 2024-09-16 00:38:02 +00:00
fe353f3417 nixpkgs: 24.05-unstable-2024-09-10 -> 24.05-unstable-2024-09-14 2024-09-15 11:14:50 +00:00
adf554c177 moby: kernel: remove the rockchip-specific patches
Pinephone uses Allwinner A64, Pinephone Pro uses rockchip, patches are therefore not necessary for ordinary PP
2024-09-15 11:14:50 +00:00
373356d097 moby: reduce the set of kernel patches i apply
this makes them easier to maintain; upgrades are less fragile
2024-09-15 11:14:50 +00:00
b5f9ba62d0 camera: fix sandboxing for pipewire (so snapshot can open the camera), and share that with megapixels (which opens it directly)
N.B. snapshot (pipewire) doesn't work with the current kernel deployment; it requires linux-postmarketos-allwinner and even then only the front camera works (at about 1 fps)

this wasn't always the case: i believe that once, the rear camera worked as well. although now i think about it, i'm not positive of that
2024-09-15 11:14:23 +00:00
6e0c83b4f3 modules/programs: don't install bunpen/sanebox unless some program actually requires it 2024-09-14 23:10:19 +00:00
4fda2e67a2 crappy: bypass efibootmgr cross compilation error 2024-09-14 22:36:37 +00:00
c576885c84 neovim: fix treesitter cross compilation 2024-09-14 22:36:33 +00:00
565684d1e9 neovim: fix ts_ls typeserver LSP deprecation 2024-09-14 22:36:27 +00:00
7a75459249 curlftpfs-sane: fix cross compilation to 32bit platforms (i.e. armv7l-hf-multiplatform) 2024-09-14 21:18:11 +00:00
d0555548b7 linux-armbian.patches: -> 2024-09-14 2024-09-14 21:18:11 +00:00
52b71b5ef3 nixpkgs-wayland: 2024-09-08 -> 2024-09-13 2024-09-14 21:18:11 +00:00
0ffb67b77e sops-nix: 2024-09-08 -> 2024-09-13 2024-09-14 21:18:11 +00:00
146a184e43 uassets: 2024-09-08 -> 2024-09-14 2024-09-14 21:18:11 +00:00
9c4f87bbad syshud: 2024-09-07 -> 2024-09-10 2024-09-14 21:18:11 +00:00
54dfb04b81 moby: kernel: enable full config
camera works so long as i blacklist some new modules
2024-09-14 21:18:11 +00:00
a773513189 pkgsCCache: init (if only to prevent me from wasting time with ccache again: its really not that great) 2024-09-14 21:18:11 +00:00
4f77b2313b firefox: add a search shortcut for MyAnimeList.net 2024-09-14 02:54:16 +00:00
c7305f3c90 firefox: cleanup search URLs 2024-09-14 02:53:28 +00:00
f3edeca237 moby: linux-armbian kernel: use enableCommonConfig instead of copying the nixpkgs config into kernelPatches 2024-09-13 16:18:27 +00:00
8b3e413cae moby: dont patch CMA at all; just accept the defaults
it seems like things don't actually need this
2024-09-13 07:19:17 +00:00
1971ef5fd4 todo.md: sync 2024-09-13 07:19:17 +00:00
6a1f48420f google-chrome: ship 2024-09-13 00:05:03 +00:00
441269fb2f moby: enable modem-power 2024-09-13 00:04:15 +00:00
b43ee23459 firefox: allow webcam access 2024-09-13 00:02:48 +00:00
b9db78a154 moby: get WiFi + camera working on linux 6.10.9
note that modem_power is disabled... i can probably enable that here shortly
2024-09-12 23:27:21 +00:00
e2f7cd154d gst-device-monitor: improve docs 2024-09-12 07:14:20 +00:00
fa180ff50a moby: get the camera working on linux 6.10.9 (but at the expense of WiFi, heh); enable but un-commenting in pine64/kernel.nix
something in 'enableCommonConfig' breaks the camera. i bet it's related to the DRM stuff?
2024-09-12 07:13:18 +00:00
3febbcaef7 programs/via: make the udev config conditional upon via actually being installed 2024-09-12 06:38:04 +00:00
2c68bead1d linux-megous: orange-pi-6.9-20240514-1047 (6.9.0) -> orange-pi-6.9-20240721-2345 (6.9.10)
no immediately noticable differences, but not thoroughly tested
2024-09-12 06:37:38 +00:00
129a7aec68 linux-megous: fix build 2024-09-12 05:29:19 +00:00
fbed348e68 linux-postmarketos-allwinner: update; add option to build w/o pmos patches (just the megi kernel + pmos defconfig) 2024-09-12 05:28:27 +00:00
4694dacd2f millipixels: ship it (it doesnt work though) 2024-09-12 05:27:31 +00:00
7fa689c82d libcamera: split to separate file & add udev rules
i think the udev rules arent actually needed though?
2024-09-12 05:26:46 +00:00
add5910b4f linux-megous: lint 2024-09-11 22:11:46 +00:00
590d4d819e moby: try shipping the armbian kernel with (close to) the pmOS defconfig
it builds, but the camera is just as broken as w/o pmOS config
2024-09-11 21:16:02 +00:00
f6493122bb nix-index: sandbox with bunpen 2024-09-11 19:20:13 +00:00
954fedd41b hal/pine64: split kernel into new armbian-kernel package 2024-09-11 19:19:54 +00:00
858ca4245a megapixels-next: document the state of things against mainline linux 2024-09-11 04:31:36 +00:00
d1044023d3 fcitx5: sandbox with bunpen 2024-09-11 04:26:12 +00:00
53e73659b4 v4l-utils: more docs 2024-09-11 04:13:54 +00:00
8a5e1cb6b6 megapixels-next: unstable-2024-05-11 -> unstable-2024-09-03 2024-09-11 04:13:12 +00:00
2a29e22d6d libmegapixels,libdng,megapixels-next: format with nixfmt 2024-09-11 03:46:48 +00:00
f5a64bc913 megapixels-next: ship
i can't get any camera working on actually-mainline linux. i'm hoping megapixels-next will work with fewer patches, though
2024-09-11 03:44:08 +00:00
2407e51b67 endless-sky: sandbox with bunpen (only minimally tested) 2024-09-11 03:12:24 +00:00
e626044037 lightning-cli: sandbox with bunpen (only minimally tested) 2024-09-11 03:11:19 +00:00
f6abee5670 losslesscut-bin: sandbox with bunpen (only minimally tested) 2024-09-11 02:18:28 +00:00
8b8bbcd59b clightning-sane: sandbox with bunpen 2024-09-11 02:17:46 +00:00
f14dbf13b1 sane-find-dotfiles: sandbox with bunpen 2024-09-11 02:07:57 +00:00
a0a34cc62e sane-bt-add: sandbox with bunpen (only minimally tested) 2024-09-11 02:07:33 +00:00
89b9f693e5 sane-bt-rm: sandbox with bunpen 2024-09-11 02:07:19 +00:00
2c76497d34 wirelesstools: sandbox with bunpen (only minimally tested) 2024-09-11 02:04:59 +00:00
0128826a42 speedtest-cli: sandbox with bunpen 2024-09-11 02:01:46 +00:00
4de34f662b sox: sandbox with bunpen (minimally tested) 2024-09-11 02:01:29 +00:00
07626c55f5 slurp: sandbox with bunpen 2024-09-11 02:00:34 +00:00
d53b4df4a8 hdparm: sandbox with bunpen 2024-09-11 01:59:43 +00:00
f6b6d6488d gparted: sandbox with bunpen 2024-09-11 01:59:19 +00:00
c6d93598ed nixfmt-rfc-style: sandbox with bunpen 2024-09-11 01:57:31 +00:00
fad05b929a bunpen: support --bunpen-autodetect-cli existingDirOrParent 2024-09-11 01:57:11 +00:00
e69bacf54e sc-im: sandbox with bunpen 2024-09-11 01:55:40 +00:00
7d4d4d6c65 libreoffice: sandbox with bunpen 2024-09-11 01:55:20 +00:00
7d6c5cf20c handbrake: sandbox with bunpen (UNTESTED because unused) 2024-09-11 01:31:49 +00:00
b483254bb3 wireshark: sandbox with bunpen 2024-09-11 01:27:26 +00:00
884435fe21 refactor: remove uses of deprecated "rust.toRustTarget" 2024-09-11 01:25:15 +00:00
33aaf8c458 nixpkgs: 24.05-unstable-2024-09-08 -> 24.05-unstable-2024-09-10 2024-09-10 23:24:05 +00:00
1c3c7f599f feeds/update.py: fix sources which have null description 2024-09-10 20:30:29 +00:00
e7f54cda6b feeds: subscribe to Marijn Braam's blog 2024-09-10 19:54:46 +00:00
909beec420 sane-reclaim-disk-space: fix sandboxing 2024-09-10 19:35:42 +00:00
ae5bad1514 feeds: subscribe to mii beta / Baby Wogue 2024-09-10 18:16:45 +00:00
77683e090c lsof: sandbox with bunpen 2024-09-10 08:52:32 +00:00
f7c5b16c1c gst-launch: ship gst-libav, for H.264 decoding 2024-09-10 08:52:22 +00:00
ad98e96823 gst-launch: ship default plugins 2024-09-10 08:06:04 +00:00
e167cbbbb4 gst-launch: ship 2024-09-10 07:40:48 +00:00
eb6c0acf11 v4l-utils: expand docs 2024-09-10 07:36:03 +00:00
f7a650b0e0 nethogs: sandbox with bunpen 2024-09-10 06:59:18 +00:00
a37554ada3 moby: ship all of megi's patches again: this fixes charging. once i get the camera working i can then start wittling down the patch stack 2024-09-10 06:57:01 +00:00
d3fa4e6e7c programs: ship v4l-utils, for debugging the Pinephone camera pipeline 2024-09-10 05:00:15 +00:00
90df023be0 firefox: add search keyword for ebay 2024-09-10 03:56:54 +00:00
f8141c5270 zfs-tools: sandbox with bunpen 2024-09-10 02:18:44 +00:00
1599df26e7 /mnt/persist/private: remove unneeded "sandbox.keepPids" 2024-09-10 01:09:21 +00:00
0b39f18faa /mnt/persist/ephemeral: dont even try to delete the backing directory -- just everything contained in it 2024-09-10 00:45:07 +00:00
8ae7e255e5 gocryptfs: sandbox with bunpen 2024-09-10 00:02:03 +00:00
6f72453f5d nvme-cli: sandbox with bunpen 2024-09-09 19:51:36 +00:00
ca09c93bf8 bunpen: handle unexpected whitepsace in BUNPEN_APPEND env var 2024-09-09 07:29:30 +00:00
ba229aaf69 bunpen: implement BUNPEN_APPEND env var 2024-09-09 04:16:38 +00:00
95994de1ad provision-private-key (/run/gocryptfs/private.key): sandbox with bunpen 2024-09-09 03:56:55 +00:00
f04d0c07af programs: split yt-dlp config out of mpv config 2024-09-08 22:16:32 +00:00
6dc4aeafc1 programs/yt-dlp: migrate to own file 2024-09-08 21:51:23 +00:00
1067bc9215 scripts/deploy: separate eval and build phases to decrease maximum ram requirements 2024-09-08 20:36:54 +00:00
bb18f65ed2 nixpkgs: 2024-09-06 -> 2024-09-08 2024-09-08 20:35:58 +00:00
0d6a823382 syshud: 0-unstable-2024-09-04 -> 0-unstable-2024-09-07 2024-09-08 20:35:26 +00:00
13aad0256d nixpkgs-wayland: 0-unstable-2024-09-06 -> 0-unstable-2024-09-08 2024-09-08 20:35:07 +00:00
ca4061ab94 sops-nix: assets-unstable-2024-09-05 -> assets-unstable-2024-09-08 2024-09-08 20:34:45 +00:00
df65454950 uassets: 0-unstable-2024-09-06 -> 0-unstable-2024-09-08 2024-09-08 20:34:28 +00:00
64311094ad zsh: add more eza aliases (la, lla, lal) 2024-09-07 22:52:13 +00:00
ac53d5512b cryptsetup: sandbox with bunpen 2024-09-07 22:40:29 +00:00
9d594f696a bunpen: support BUNPEN_DEBUG=n env var 2024-09-07 22:32:32 +00:00
4ade6b1418 cryptsetup: sandbox with bwrap 2024-09-07 22:24:13 +00:00
3ef98a5ab3 modules/programs: support "sandbox.keepIpc = true" 2024-09-07 22:10:11 +00:00
130ce0e69f bunpen: support --bunpen-keep-ipc 2024-09-07 22:08:25 +00:00
3fb566a3fd ethtool: sandbox with bwrap
it doesn't *quite* sandbox with bunpen: i lose Wake-on-lan info... not sure why
2024-09-07 21:19:24 +00:00
135af51f37 eza: sandbox with bunpen 2024-09-07 21:12:18 +00:00
98ed5f10ee e2fsprogs: sandbox with bunpen 2024-09-07 21:08:21 +00:00
71241f83e2 nettools: sandbox with bunpen 2024-09-07 21:02:31 +00:00
2b7143fb84 portfolio-filemanager: sandbox with bunpen
note that portfolio seems not to use portal integration anymore? so using it to launch e.g. Music files totally fails (because i don't grant pipewire access)

well, i don't really use this that much, so i'll deal with that only if/when it's an issue
2024-09-07 20:58:57 +00:00
0605034a53 eg25-control: sandbox with bunpen 2024-09-07 20:57:11 +00:00
140f2b515e parted: sandbox with bunpen (only minimally tested) 2024-09-07 20:43:03 +00:00
ca5eab656d tcpdump: sandbox with bunpen 2024-09-07 20:42:11 +00:00
028f56f70b hping: sandbox with bunpen 2024-09-07 20:41:37 +00:00
9f4c40fe01 gptfdisk: sandbox with bunpen (minimally tested) 2024-09-07 20:36:50 +00:00
8eadede76d wireguard-tools: sandbox with bunpen 2024-09-07 20:33:54 +00:00
823ec0e6f4 pcituils: sandbox with bunpen 2024-09-07 20:28:39 +00:00
fc865574bf iputils: sandbox with bunpen 2024-09-07 20:26:36 +00:00
58b3411c8c iotop: sandbox with bunpen 2024-09-07 20:23:23 +00:00
e517c5cecf inetutils: sandbox with bunpen 2024-09-07 20:22:29 +00:00
c735c0e11e iftop: sandbox with bunpen 2024-09-07 20:18:26 +00:00
41d7268094 forkstat: sandbox with bunpen 2024-09-07 20:16:59 +00:00
e66c389695 efibootmgr: sandbox with bunpen 2024-09-07 20:04:58 +00:00
d43a5a4687 btrfs-progs: sandbox with bunpen 2024-09-07 20:01:46 +00:00
83efe3f552 smartmontools: sandbox with bunpen 2024-09-07 20:00:22 +00:00
5742101191 powertop: sandbox with bunpen 2024-09-07 19:59:59 +00:00
7b5508c91d g4music: sandbox with bunpen 2024-09-07 19:23:05 +00:00
0b11c0e790 sane-backup-rsync-net: remove dead SANEBOX_PREPEND flags
i'm not actually sure how this is still working, with bunpen? but it *seems* to be
2024-09-07 19:12:13 +00:00
aeea904e5b seatd/bunpen: remove the need for CAP_SETPCAP 2024-09-07 18:58:47 +00:00
64e302eb20 go2tv: sandbox with bunpen 2024-09-07 18:37:18 +00:00
91a9d6e0d6 fcitx5: re-enable 2024-09-07 18:35:55 +00:00
f593b8ca4a nwg-panel/torch-toggle: sandbox with bunpen 2024-09-07 18:33:08 +00:00
30060e4bb1 bunpen/seatd: remove CAP_NET_ADMIN: creating a net namespace does NOT require that, rather it was a quirk in bwrap 2024-09-07 18:32:29 +00:00
9b8bdfaf5e seatd: ACTUALLY sandbox with bunpen 2024-09-07 18:24:33 +00:00
fc72884c2e hosts/common: persist ~/.cache/mesa_shader_cache_db 2024-09-07 17:27:15 +00:00
8f47636ee0 ols: sandbox with bunpen 2024-09-07 17:26:30 +00:00
f68fbb0e0b bunpen/seatd namespacing: clarify that CAP_NET_ADMIN requirement is surprising 2024-09-07 17:14:50 +00:00
7ce82ca735 seatd: remove no-longer-necessary ambient caps 2024-09-07 17:01:05 +00:00
7ce098f2bb bunpen: --bunpen-try-user will now raise the capabilities it needs, as part of that 2024-09-07 17:00:34 +00:00
454c109ef8 seatd: sandbox with bunpen 2024-09-07 15:39:50 +00:00
4dfc0bf323 sane-open: fix keyboard toggling to be compatible with bunpen 2024-09-07 08:36:32 +00:00
2d1e7777e8 sm64ex-coop-deluxe: ship (and configure so that you dont have to drag the rom) 2024-09-07 06:21:11 +00:00
1d5f71f935 satellite: sandbox with bunpen 2024-09-07 05:44:40 +00:00
41a132dd9a geoclue-demo-agent: sandbox with bunpen 2024-09-07 04:31:53 +00:00
51350d228d where-am-i: sandbox with bunpen 2024-09-07 04:29:45 +00:00
e9a289cc87 gps-share: sandbox with bunpen 2024-09-07 04:27:20 +00:00
de47a0521d wvkbd: sandbox with bunpen 2024-09-07 02:14:20 +00:00
412e698786 bunpen: forward signals through the PID namespace
this should enable things like wvkbd -- which depend on signals -- to function while sandboxed
2024-09-07 01:43:34 +00:00
ed7c5ef89a bunpen: forward signals to the child
note that pid namespaces will silently not deliver signals to PID 1 for which no handler is installed... i'll have to either install an intermediary PID 1 which forwards to the real process, or peek into /proc/PID/status to check if the signal is deliverable before/after sending it (but that's racy, and eww parsing)
2024-09-06 23:16:10 +00:00
9814cb5ad7 bunpen: errors::ext::check: supoort errors::error 2024-09-06 23:13:21 +00:00
b6d8aa614c bunpen: fix so the integration tests are actually run during the nix build
heh
2024-09-06 18:29:20 +00:00
24440b059c bunpen: write tests for signal deliverability (which shows that the current behavior is incorrect) 2024-09-06 18:12:05 +00:00
53ec44b3de nixpkgs: 0-unstable-2024-09-05 -> 24.05-unstable-2024-09-06
N.B.: the different "revs" got merged again while i wasnt looking...
2024-09-06 17:00:05 +00:00
e9cd3069fa nixpkgs-wayland: 0-unstable-2024-09-02 -> 0-unstable-2024-09-06 2024-09-06 16:59:23 +00:00
7b4fc029b2 sops-nix: assets-unstable-2024-09-01 -> assets-unstable-2024-09-05 2024-09-06 16:59:03 +00:00
cc6e99361d uassets: 0-unstable-2024-09-05 -> 0-unstable-2024-09-06 2024-09-06 16:58:46 +00:00
ca3dc42586 rsync: sandbox with tryKeepUsers. this lets us rsync things owned by any user, not just the non-superuser invoker 2024-09-06 06:33:45 +00:00
8255e419be modules/programs: rename "keepUsers" -> "tryKeepUsers" 2024-09-06 06:32:49 +00:00
9bd5a7e4e4 bunpen: implement --bunpen-try-keep-users to try to keep the user namespace, but create a new one if keeping the existing one would require less sandboxing elsewhere 2024-09-06 06:25:27 +00:00
baf5aab4b9 sshfs-fuse: sandbox with bunpen 2024-09-06 06:04:23 +00:00
ce7474603f sway: fix config to not use Xwayland-specific settings 2024-09-06 05:41:34 +00:00
bf6053985f xwayland: sandbox with bunpen 2024-09-06 05:34:08 +00:00
c0106c9196 scripts/deploy: deploy to moby over wireguard by default, but allow this to be customized broadly 2024-09-06 05:30:59 +00:00
038e21a447 schlock: sandbox with bunpen 2024-09-06 05:27:19 +00:00
6596bad162 foliate: sandbox with bunpen 2024-09-06 05:25:20 +00:00
c46c5bb3ca komikku: sandbox with bunpen 2024-09-06 05:24:48 +00:00
8079cc47bf nwg-panel: simplify sandbox definition 2024-09-06 05:23:33 +00:00
8c802ddc1a epiphany: sandbox with bunpen 2024-09-06 05:23:00 +00:00
1ed27c166e wike: sandbox with bunpen 2024-09-06 05:21:55 +00:00
82dcd40829 sane-input-handler: sandbox with bunpen 2024-09-06 05:21:38 +00:00
c6af2c8e02 bonsai: sandbox with bunpen 2024-09-06 05:20:51 +00:00
8bdb711968 grimshot: fix sandboxing so that wl-clipboard can actually copy stuff to the clipboard 2024-09-06 04:57:53 +00:00
4b96d10980 swappy: sandbox with bunpen 2024-09-06 04:35:50 +00:00
346b887779 sane-screenshot: simplify by using grimshot savecopy command instead of separate copy + wl-paste tio file 2024-09-06 04:34:51 +00:00
6e30527688 modules/programs: simplfiy the common combination of keeping pids AND /proc by introducing "keepPidsAndProc" 2024-09-06 04:18:46 +00:00
9340f52df1 modules/programs: rename isolatePids -> keepPids, isolateUsers -> keepUsers
this follows my explicit whitelisting elsewhere
2024-09-06 04:06:42 +00:00
cc90183ca2 blast-ugjka: sandbox with bunpen 2024-09-06 03:52:36 +00:00
31d475bf88 sane-cast: sandbox with bunpen 2024-09-06 03:42:03 +00:00
329a02f475 gnome-keyring-daemon: sandbox with bunpen 2024-09-06 03:12:00 +00:00
e3dda5b140 grimshot: sandbox with bunpen 2024-09-06 02:31:20 +00:00
876ec637c2 stepmania: shift the data dir patch upstream 2024-09-06 02:21:08 +00:00
d338826855 stepmania: sandbox with bunpen 2024-09-06 01:44:11 +00:00
b770a77257 stepmania: simplify the wrapping 2024-09-06 01:41:20 +00:00
b289f13779 stepmania: wrap in a way which doesnt require manually cding to the data dir 2024-09-06 01:19:13 +00:00
d8664cd88b stepmania: fix fs paths to point to valid data 2024-09-06 01:17:21 +00:00
5270c41347 avahi: fix ip6tables firewall rule 2024-09-06 01:17:21 +00:00
850c975321 modules/programs: when sandboxing, use makeBinaryWrapper if supported 2024-09-06 01:17:21 +00:00
b1b12c353d sm64ex-coop-deluxe: init 2024-09-05 23:43:42 +00:00
3934d9c5a5 sway: fix sm64ex syntax error 2024-09-05 23:39:21 +00:00
84a36d9ef8 bunpen: fix last failing integration test 2024-09-05 23:21:56 +00:00
05b8352b4d bunpen: bind execvpe 2024-09-05 23:21:31 +00:00
4123d2d92e sway: bind mod+P to screenshot
one of my keyboards here doesn't have PrintScreen :o
2024-09-05 22:55:02 +00:00
768998f78d bunpen: rearrange integration tests to make it obvious that invoking by PATH is what's failing 2024-09-05 22:51:21 +00:00
a128f624b2 bunpen: fix to correctly forward the exit status 2024-09-05 22:41:12 +00:00
f12123416b bunpen: integration_test: add logging tests 2024-09-05 22:21:06 +00:00
392330f9ca bunpen: make the integration tests easier to understand 2024-09-05 22:04:00 +00:00
60bdc7c5d3 nixpkgs: 0-unstable-2024-08-30 -> 0-unstable-2024-09-05 2024-09-05 21:50:19 +00:00
aa93ac608b nixpkgs-wayland: 0-unstable-2024-08-30 -> 0-unstable-2024-09-02 2024-09-05 21:50:19 +00:00
3ad7271439 syshud: 0-unstable-2024-08-27 -> 0-unstable-2024-09-04 2024-09-05 21:50:19 +00:00
fe087720ed uassets: 0-unstable-2024-08-30 -> 0-unstable-2024-09-05 2024-09-05 21:50:19 +00:00
15ff2589d3 sops: 2024-08-12 -> 2024-09-01 2024-09-05 21:50:19 +00:00
b74372dd2b fs: mount moby via wireguard 2024-09-05 21:50:19 +00:00
196cf2dc9e bunpen: cleanup the integration test infrastructure 2024-09-05 10:01:47 +00:00
3f6713c12c s64ex-coop: sandbox 2024-09-05 08:56:43 +00:00
d8058f0591 sm64ex-coop: persist save data 2024-09-05 08:48:33 +00:00
a1450b4eff sm64ex-coop: ship 2024-09-05 06:38:58 +00:00
3b009b8435 baseRom: init 2024-09-05 06:25:20 +00:00
c0bf2df718 firefox: add a "pr" search shortcut to search nixpkgs PRs 2024-09-05 05:30:10 +00:00
24eefbeded bunpen: add some integration tests (they fail heh) 2024-09-05 02:37:41 +00:00
e97302a453 bunpen: dont forward argv[0] if the caller didnt forward it 2024-09-05 02:34:56 +00:00
2b2173be56 bunpen: enable logging earlier 2024-09-05 02:32:12 +00:00
ac5b9061a2 scripts/deploy: implement --wireguard flag, to deploy the host over wireguard 2024-09-05 02:06:59 +00:00
a54b051bbe crappy: split cross-specific programs config into hal 2024-09-05 01:11:16 +00:00
968e9654cf moby: move cross-specific programs config to hal 2024-09-05 01:11:16 +00:00
a557c79f4e hosts/modules/hal/pine64: split kernel into own file 2024-09-05 00:59:51 +00:00
f2dc84a1c8 refactor: hosts/modules/hal/pine64: give it its own directory 2024-09-05 00:57:29 +00:00
8a7a20fe2b sane-open: fix isLandscape to query actual geometry instead of the less informative "rotation" property 2024-09-05 00:23:57 +00:00
7e674b205f rsync-net: add a script to help with restoring backups 2024-09-04 23:09:04 +00:00
8d87a15e60 modules/image: be verbose when we flash the bootloader 2024-09-04 13:50:22 +00:00
f39a08e379 aerc: sandbox with bunpen 2024-09-04 13:49:40 +00:00
b567aeadd7 bunpen: namespace: populat /dev/pts 2024-09-04 13:49:40 +00:00
04ac2ada05 bunpen: simplify the /proc/self/{u,g}id_map logic 2024-09-04 13:49:40 +00:00
6193f347e7 bunpen: allow mount to take str mount params 2024-09-04 13:49:40 +00:00
39733b4862 bunpen: log more clearly when an error message is fatal v.s. non-fatal 2024-09-04 13:49:40 +00:00
9a7fca267e modules/image: bump /boot space from 1 GiB to 2 GiB 2024-09-04 13:49:40 +00:00
364a4f1182 sane-secrets-unlock: work around race condition during system boot 2024-09-04 13:48:10 +00:00
3e182b2a06 modules/persist: lint 2024-09-04 13:13:14 +00:00
6ff35b4366 dbus: place the bus in a subdirectory for better sandboxing 2024-09-04 13:04:20 +00:00
9f49084ccb firefox: normalize bookmark ADD_DATE / LAST_MODIFIED to "1"
i *think* these fields don't matter, so this makes editing them by hand easier
2024-09-04 12:15:06 +00:00
b2f351dba2 firefox: add Amazon.com search 2024-09-04 12:13:29 +00:00
35a41be824 modules/*: lint (esp: modules/vpn.nix -- removed unused priorityWgTable) 2024-09-03 20:24:36 +00:00
f384515c51 exiftool: sandbox with bunpen 2024-09-03 19:19:24 +00:00
c7eb0c7c71 youtube-tui: sandbox with bunpen
youtube-tui's kinda always breaking... i can't verify that this isn't breaking it more
2024-09-03 19:19:24 +00:00
2debd88019 objdump: sandbox with bunpen 2024-09-03 19:19:24 +00:00
783a0ae29f supertuxkart: sandbox with bunpen 2024-09-03 19:19:24 +00:00
ad57f1537a sane-ip-check: sandbox with bunpen 2024-09-03 19:19:24 +00:00
e82de6180c lftp: sandbox with bunpen 2024-09-03 19:19:24 +00:00
09cb743865 gst-device-monitor: sandbox with bunpen 2024-09-03 19:19:24 +00:00
0d737216ea kdenlive: sandbox with bunpen 2024-09-03 19:19:24 +00:00
3478224bf9 inkscape: split to own file and sandbox with bunpen 2024-09-03 19:19:24 +00:00
94863db03a frozen-bubble: sandbox with bunpen 2024-09-03 18:35:07 +00:00
3260659fc1 networkmanagerapplet: disable (broken) 2024-09-03 18:34:33 +00:00
1ce07e08f6 sane-wipe: dont wipe the static config files in ~/.mozilla/firefox 2024-09-03 18:33:20 +00:00
2e8904fa52 swaynotificationcenter: sandbox with bunpen 2024-09-03 18:32:51 +00:00
0535d97191 sane-wipe: sandbox with bunpen 2024-09-03 18:30:30 +00:00
71539036fc swayidle: sandbox with bunpen 2024-09-03 18:27:37 +00:00
e295da5d67 gpodder: sandbox with bunpen 2024-09-03 18:24:04 +00:00
986dc8c37a fontconfig: sandbox with bunpen 2024-09-03 18:22:27 +00:00
57637167b1 dconf: sandbox with bunpen 2024-09-03 18:21:58 +00:00
9b6ec64ed4 xdg-desktop-portal-gnome: sandbox with bunpen 2024-09-03 17:56:17 +00:00
c7638be79b visidata: sandbox with bunpen 2024-09-03 17:53:37 +00:00
f537049387 imagemagick: sandbox with bunpen 2024-09-03 17:52:23 +00:00
2cee6ea954 celeste64: sandbox with bunpen 2024-09-03 17:51:13 +00:00
36bcda6416 element-desktop: sandbox with bunpen 2024-09-03 17:48:58 +00:00
45907f23b9 oath-toolkit,sops: sandbox with bunpen 2024-09-03 17:48:30 +00:00
e57e0b9509 dbus: sandbox with bunpen 2024-09-03 17:46:08 +00:00
2f00580ddd vvvvvv: sandbox with bunpen 2024-09-03 17:44:07 +00:00
c7a786bef3 superTux: sandbox with bunpen 2024-09-03 17:43:35 +00:00
646ffa891c wdisplays: sandbox with bunpen 2024-09-03 17:31:33 +00:00
a887d2d780 soundconverter: split into own file and sandbox with bunpen 2024-09-03 17:30:41 +00:00
291e6fe1e3 w3m: sandbox with bunpen 2024-09-03 17:30:41 +00:00
acad3dc60a unzip: sandbox with bunpen 2024-09-03 17:30:41 +00:00
de78119e46 tumiki-fighters: sandbox with bunpen 2024-09-03 17:30:41 +00:00
628a701fa0 space-cadet-pinball: sandbox with bunpen 2024-09-03 17:30:41 +00:00
851e6e9176 slic3r: sandbox with bunpen 2024-09-03 17:30:41 +00:00
69bba0f6a9 shattered-pixel-dungeon: sandbox with bunpen 2024-09-03 17:30:41 +00:00
3a8f31a490 sequoia: sandbox with bunpen 2024-09-03 17:30:41 +00:00
4b0518408e sane-weather: sandbox with bunpen 2024-09-03 17:30:41 +00:00
2e38f49773 rsync: sandbox with bunpen 2024-09-03 17:30:41 +00:00
4704c9ca9e pstree: fix formatting 2024-09-03 17:30:41 +00:00
6d37c531f2 procps: sandbox with bunpen (note that i only use sub items of it though, like free and pidof) 2024-09-03 17:30:41 +00:00
1d8f825bc6 hase: sandbox with bunpen 2024-09-03 17:30:41 +00:00
775c1522ee grim: sandbox with bunpen 2024-09-03 17:30:41 +00:00
4856a46388 hitori: sandbox with bunpen 2024-09-03 17:30:41 +00:00
2702e2afd5 gnome-frog: sandbox with bunpen 2024-09-03 17:30:41 +00:00
2d1ebe7219 gnome-2048: sandbox with bunpen 2024-09-03 17:30:41 +00:00
cef2a1e129 gnome-calendar: sandbox with bunpen 2024-09-03 17:30:41 +00:00
f48b8fb6b9 discord: sandbox with bunpen 2024-09-03 17:30:41 +00:00
a75fb267f1 font-manager: sandbox with bunpen 2024-09-03 17:30:41 +00:00
981cd4c65c findutils: sandbox with bunpen 2024-09-03 17:30:41 +00:00
d25701e280 evtest: sandbox with bunpen 2024-09-03 17:30:41 +00:00
562315bf4d libnotify: sandbox with bunpen 2024-09-03 17:30:41 +00:00
5b9fbb97cb krita: split into own file and sandbox with bunpen 2024-09-03 17:30:41 +00:00
2965fe29d1 gnome-calculator: sandbox with bunpen 2024-09-03 16:48:35 +00:00
6692c67e74 wireplumber: sandbox with bunpen 2024-09-03 16:47:54 +00:00
cc7f53a828 nautilus: sandbox with bunpen 2024-09-03 16:06:42 +00:00
5e38ebef4b swaylock: sandbox with bunpen 2024-09-03 16:05:34 +00:00
181bc57a8a bunpen: fix edge-case where we wouldnt deref (and bind the underlying path of) a symlink under an already-mounted directory 2024-09-03 16:05:34 +00:00
8a61ad704a unl0kr: sandbox with bunpen 2024-09-03 15:42:39 +00:00
c93f71e285 pipewire: sandbox with bunpen 2024-09-03 15:42:24 +00:00
09507a04bd sway: sandbox with bunpen 2024-09-03 15:19:10 +00:00
ccdf633e4f gimp: sandbox with bunpen 2024-09-03 15:09:14 +00:00
e62c1fe63f sane-secrets-dump: sandbox with bunpen 2024-09-03 15:00:04 +00:00
66f00088f1 sane-tag-media: sandbox with bunpen 2024-09-03 14:58:48 +00:00
a2366ba9d4 sane-screenshot: sandbox with bunpen 2024-09-03 14:57:29 +00:00
a2bfb23253 nwg-panel: sandbox with bunpen 2024-09-03 14:56:09 +00:00
d474d159ac sane-shutdown,sane-reboot: sandbox with bunpen 2024-09-03 14:55:55 +00:00
60d5dbda77 sane-secrets-unlock: sandbox with bunpen 2024-09-03 14:49:02 +00:00
ff763b44bc playerctl: sandbox with bunpen 2024-09-03 14:47:39 +00:00
ba28240a04 audacity: sandbox with bunpen 2024-09-03 14:46:47 +00:00
2a755492bd conky: sandbox with bunpen 2024-09-03 14:45:59 +00:00
c682cb5fd7 bunpen: add regex functionality to BUNPEN_DISABLE 2024-09-03 14:42:01 +00:00
68dfd64ee3 sane-which: sandbox with bunpen 2024-09-03 14:16:40 +00:00
179c6697e6 sane-reclaim-{boot,disk}-space: sandbox with bunpen 2024-09-03 14:16:14 +00:00
9301a84e1c sane-bt-{search,show}: sandbox with bunpen 2024-09-03 14:13:40 +00:00
fc5a1c7d5e pkill: sandbox with bunpen 2024-09-03 14:12:36 +00:00
94a261280b pactl: sandbox with bunpen 2024-09-03 14:11:27 +00:00
8214b27569 dialect: sandbox with bunpen 2024-09-03 14:11:05 +00:00
12c39fec03 animatch: sandbox with bunpen 2024-09-03 14:10:14 +00:00
50d443ad46 make-sandboxed: fix quoting error 2024-09-03 14:10:06 +00:00
a4eb7c0fd6 gnome-weather: sandbox with bunpen 2024-09-03 14:08:26 +00:00
a633690ab9 gnome-clocks: sandbox with bunpen 2024-09-03 14:07:57 +00:00
8badb38b76 firefox-xdg-open: sandbox with bunpen 2024-09-03 14:07:28 +00:00
3bc8c34b85 engrampa: sandbox with bunpen 2024-09-03 14:05:34 +00:00
88263695d3 dtrx: sandbox with bunpen 2024-09-03 14:04:41 +00:00
7d9b2cb224 nmcli: sandbox with bunpen
note that i can't 'nmcli connect' -- but i think that's a NetworkManager service error, not nmcli
2024-09-03 14:04:07 +00:00
1588ebe696 wl-clipboard: sandbox with bunpen 2024-09-03 13:54:45 +00:00
8cbe8fc9e2 wtype: sandbox with bunpen 2024-09-03 13:54:27 +00:00
0ee564b329 tor-browser: sandbox with bunpen 2024-09-03 13:11:15 +00:00
a9f0f99482 sane-private-unlock-remote: sandbox with bunpen 2024-09-03 13:10:16 +00:00
fd2eabf07e mepo: sandbox with bunpen 2024-09-03 13:06:25 +00:00
7b8303f070 git: sandbox with bunpen 2024-09-03 13:05:42 +00:00
eaf03520e7 curl: sandbox with bunpen 2024-09-03 13:04:45 +00:00
b05ebc6c62 papers: sandbox with bunpen 2024-09-03 13:03:58 +00:00
8c94bc79d5 newsflash: sandbox with bunpen 2024-09-03 13:02:10 +00:00
d2f86e7b0d gdbus: sandbox with bunpen 2024-09-03 12:54:06 +00:00
f959a0dd00 sane-open: sandbox with bunpen 2024-09-03 12:41:12 +00:00
a0240dca36 mimetype: sandbox with bunpen 2024-09-03 12:40:39 +00:00
471f453321 pidof: sandbox with bunpen 2024-09-03 12:40:22 +00:00
3712eaf869 brave: sandbox with bunpen 2024-09-03 12:39:57 +00:00
ecc4e90b4a gnome-maps: sandbox with bunpen 2024-09-03 12:38:19 +00:00
c7823ab3f4 assorted: remove outdated comments about landlock > bwrap 2024-09-03 04:49:36 +00:00
2cc23525ec curlftp: sandbox with bunpen 2024-09-03 04:48:23 +00:00
07bbf34f59 nmon: sandbox with bunpen 2024-09-03 04:38:44 +00:00
941fff725a vulkan-tools: sandbox with bunpen 2024-09-03 04:34:19 +00:00
d478b945c4 killall: sandbox with bunpen 2024-09-03 04:26:56 +00:00
769fdcee89 tree: sandbox with bunpen 2024-09-03 04:26:06 +00:00
b0aedb6714 pstree: sandbox with bunpen 2024-09-03 04:25:20 +00:00
20e71ad800 fd: sandbox with bunpen 2024-09-03 04:23:41 +00:00
0566e237aa alsaUtils: sandbox with bunpen 2024-09-03 04:23:13 +00:00
0df02b5ba3 bunpen: sandbox with bunpen 2024-09-03 03:56:11 +00:00
22a5bcc259 firefox: sandbox with bunpen 2024-09-03 03:55:52 +00:00
40d14460ab rofi: sandbox with bunpen
i had a lot of trouble with this... i *think* it's working now
2024-09-03 03:51:10 +00:00
ef0f6c2053 htop: sandbox with bunpen 2024-09-03 03:48:52 +00:00
71be891c85 string: sandbox with bunpen 2024-09-03 03:37:31 +00:00
a163a260fa errno: sandbox with bunpen 2024-09-03 03:37:05 +00:00
fe910ea153 brightnessctl: sandbox with bunpen 2024-09-03 03:32:34 +00:00
1e81c033aa pwvucontrol: sandbox with bunpen 2024-09-03 03:32:12 +00:00
f490a49921 pulsemixer: sandbox with bunpen 2024-09-03 03:31:14 +00:00
7b9874b90d ausyscall: sandbox with bunpen 2024-09-03 03:30:57 +00:00
4b52fe260c yt-dlp: sandbox with bunpen 2024-09-03 03:10:29 +00:00
8a2951a405 firefox: add YouTube search shortcut (yt) 2024-09-03 03:09:59 +00:00
c81e2fd6fa wget: sandbox with bunpen 2024-09-03 03:07:54 +00:00
1ac244d1de usbutils: sandbox with bunpen 2024-09-03 03:06:50 +00:00
f70d4b75b2 typescript-language-server: sandbox with bunpen 2024-09-03 03:06:36 +00:00
34aad6f74c python3-repl: sandbox with bunpen 2024-09-03 03:04:38 +00:00
d20359fc1d pyright: sandbox with bunpen 2024-09-03 03:01:06 +00:00
714f727f1a pavucontrol: sandbox with bunpen 2024-09-03 03:00:36 +00:00
eff8f2597c openscad-lsp: sandbox with bunpen 2024-09-03 02:59:59 +00:00
1d7a8c688a nmap: sandbox with bunpen 2024-09-03 02:59:22 +00:00
56bac1ac19 nixd: sandbox with bunpen 2024-09-03 02:58:48 +00:00
fbe00915bb nano: sandbox with bunpen 2024-09-03 02:58:23 +00:00
bf1d401b48 mercurial: document that sandboxing DOES work at present 2024-09-03 02:58:11 +00:00
424f6ef35a marksman: sandbox with bunpen 2024-09-03 02:57:24 +00:00
4637a3eee3 lua-language-server: sandbox with bunpen 2024-09-03 02:57:13 +00:00
d2e600dcf8 jq: sandbox with bunpen 2024-09-03 02:56:10 +00:00
a17369cebe sed: sandbox with bunpen 2024-09-03 02:55:34 +00:00
2d5cb84eef forkstat: document sandbox limitations 2024-09-03 02:54:27 +00:00
9050d8979e grep: sandbox with bunpen 2024-09-03 02:53:37 +00:00
15d668f1ca file: sandbox with bunpen 2024-09-03 02:48:13 +00:00
147efe0a9e dig: sandbox with bunpen 2024-09-03 02:47:32 +00:00
d11f3152d0 cargo,rust-analyzer: sandbox with bunpen 2024-09-03 02:46:54 +00:00
8a2a41ecc9 bash-language-server: sandbox with bunpen 2024-09-03 02:44:10 +00:00
f1000c9fba syshud: sandbox with bunpen 2024-09-03 02:40:03 +00:00
5266a8b8f2 ps: sandbox with bunpen 2024-09-03 02:28:52 +00:00
af99673043 ripgrep (rg): sandbox with bunpen
yay! im finally free of the sanebox ~/dev/cat symlink glitch!
2024-09-03 02:28:33 +00:00
eb562037b1 free: sandbox with bunpen 2024-09-03 02:26:17 +00:00
08ed8cd052 haredoc: sandbox with bunpen 2024-09-03 02:25:52 +00:00
ce7a082447 modules/programs: plum sandbox.keepPids and whitelistPwd into bunpen 2024-09-03 02:25:28 +00:00
53c4054bb7 less: sandbox with bunpen 2024-09-03 02:24:51 +00:00
070bc867da sane-deadlines: sandbox with bunpen 2024-09-03 02:24:25 +00:00
9bfc527aa7 dissent: sandbox with bunpen 2024-09-03 02:23:42 +00:00
c23cf48001 sane-sysload: sandbox with bunpen 2024-09-03 02:21:36 +00:00
dfffa564e2 signal-desktop: sandbox with bunpen 2024-09-03 02:13:52 +00:00
8a89e62063 bunpen: enable /dev/shm in the sandbox 2024-09-03 02:13:32 +00:00
71d32e442f dino: sandbox with bunpen 2024-09-03 02:13:00 +00:00
68ffdc113e neovim: sandbox with bunpen 2024-09-03 01:50:01 +00:00
8b0ca4d393 geary: sandbox with bunpen 2024-09-03 01:48:07 +00:00
743ede00c4 bunpen: avoid binding /proc entries; these especially confuse bwrap apps like geary 2024-09-03 01:47:49 +00:00
41d9eccfe8 bunpen: preserve argv0 in the wrapper 2024-09-03 01:45:48 +00:00
04eb5ed012 bunpen: more verbose logging when we exec 2024-09-03 01:45:28 +00:00
0279c030de loupe: sandbox with bunpen 2024-09-03 00:33:16 +00:00
f0ea3f8bf6 fractal: sandbox with bunpen 2024-09-03 00:32:03 +00:00
f3b9369783 bunpen: implement BUNPEN_DISABLE=1 env var to bypass sandboxing 2024-09-03 00:27:14 +00:00
5ae12272bd bunpen: restrict/namespace: fix so that nested mounts mount both paths
so e.g. '--bunpen-path /' at the end of the CLI will actually do something
2024-09-02 23:50:19 +00:00
6a1b4fdba1 bunpen: logging: make the exec log line easier to understand 2024-09-02 23:24:46 +00:00
0264ed68f4 bunpen: check syscall return codes more strictly
many syscalls say *specifically* in their documentation that they return 0 on success (implying no other value is success)
2024-09-02 22:39:52 +00:00
384472c1c4 nix: fix typo in NIXPATH introduced in a39d705ff5 2024-09-02 21:54:14 +00:00
1719943a6e bunpen: log the args it was invoked with 2024-09-02 21:53:41 +00:00
0ee51d1812 bunpen: peek through *all* symlinks, not just intermediary ones
`mount` doesnt seem to mount over symlinks, hence why we have to follow even terminal symlinks
2024-09-02 21:47:51 +00:00
5e84056715 bunpen: make --bunpen-caps all behave as shorthand for literally specifying every capability 2024-09-02 20:39:18 +00:00
da72fc9d52 bunpen: fix typo that prevented assigning caps >= 32 2024-09-02 20:36:37 +00:00
36e2f57b06 bunpen: proper capability boxing
the Amb/Bound sets are written as specified, and I/P set so as to be activated when we exec the wrapped program
2024-09-02 20:21:09 +00:00
bc2823d622 bunpen: better (still incomplete) capability boxing 2024-09-02 18:55:53 +00:00
8b53f97c1c bunpen: bind the different PR_CAP* prctl syscalls
see 'man prctl' for additional calls, some of which were omitted because i don't expect to need them
2024-09-02 17:02:02 +00:00
712b2c38f0 firefox: disable Ctrl+W shortcut
finally, i can stop accidentally killing tabs when i mean to backspace
2024-09-02 15:43:12 +00:00
3212664f37 firefox: migrate extraPolicies to overrides.cfg
this fixes that the bookmarks policy in extraPolicies was breaking my bookmarks import
2024-09-02 15:15:00 +00:00
98c62f66dd firefox: add duckduckgo search bookmark 2024-09-02 14:11:13 +00:00
1677f77fd6 firefox: statically define a few bookmarks 2024-09-02 14:04:47 +00:00
c5e21546ff firefox: refactor: split addons into separate file 2024-09-02 13:57:53 +00:00
5eb597b133 programs: firefox: move to subdir
then i'll split it into separate files fore easier management
2024-09-02 13:41:11 +00:00
90f7953615 firefox: remove dead code 2024-09-02 13:29:11 +00:00
ab15d2a991 programs: replace gnome-disk-utility with gparted
the latter *appears* to work better when sandboxed
2024-09-02 12:02:32 +00:00
eba9bb3099 feeds: subscribe to Charles Stross blog 2024-09-02 11:38:47 +00:00
3deb17125d make-sandboxed: handl polkit files when patching bin paths 2024-09-02 11:31:24 +00:00
49a38001bc update-feed: support sites which are accessible only by www.FOO and not toplevel FOO 2024-09-02 11:30:53 +00:00
a39d705ff5 nix: fix NIXPATH to be free of symlinks 2024-09-02 11:29:58 +00:00
4328a7ddf3 modules/programs: remove unused arguments 2024-09-02 10:26:42 +00:00
1b959272a1 moby: fetch the ANX7688 patch from lkml instead of armbian
didn't actually deploy this, but it builds
2024-09-02 10:07:37 +00:00
9d83f4cbf7 NetworkManager: reduce hardening options which broke IPv6 link-local addressing
'ip -6 addr' should show an address even on networks which aren't
routable. /proc or /sys sandboxing was preventing this (with error messages logged to syslog).
2024-09-01 23:13:30 +00:00
48fccebd1e iptables: temporarily disable sandbox
it was overrestrictive
2024-09-01 21:24:19 +00:00
8f4d4c97bc avahi: ensure that mDNS responses arent blocked by rpfilter
this PROBABLY isnt necessary, but keep it here as i debug stuff at least
2024-09-01 21:23:52 +00:00
0419e50cc3 upnp: fix rpfilter to support IPv6, too 2024-09-01 21:21:57 +00:00
80d3ad3d0e moby: wifi low power patch: clarify that it just mitigates, doesnt solve, the reconnections 2024-09-01 21:21:30 +00:00
3d3853d596 moby: rtw88 wifi: disable deep sleep to prevent disconnections 2024-09-01 17:37:53 +00:00
cfa60ce41c common/fs: remove dead nfs code 2024-09-01 15:50:28 +00:00
942ca82445 assorted: hosts/common: remove unused module parameters 2024-09-01 15:49:15 +00:00
336696bb06 scripts/deploy: show the nix copy command, to aid in manual runs 2024-09-01 15:41:33 +00:00
7d75b3c736 neovim: docs: suggest alternate mappings for nvim-cmp 2024-09-01 15:38:13 +00:00
3ca2c7ec53 sane-tag-media: fix escapes in docstring 2024-09-01 14:30:53 +00:00
9d605030c3 cross: wike: push build fix to upstream nixpkgs 2024-09-01 13:44:31 +00:00
e1d678093e ayatana, switchboard: push cross patches upstream 2024-09-01 13:16:39 +00:00
5586a3a87b moby: document status of linux 6.11 2024-09-01 11:35:20 +00:00
38c6ecefa6 programs: ship camera debugging tools 2024-09-01 11:31:10 +00:00
c80aa813d9 neovim: ship GitMessenger plugin for git-blame-like functionality 2024-09-01 01:12:27 +00:00
4f6ea0938c neovim: Ctrl+Space to autocomplete 2024-09-01 01:00:37 +00:00
7ed78686c2 hal/pine64: remove more commented out patches which are irrelevant to pinephone 2024-08-31 22:42:04 +00:00
96b90b84d3 linux-firmware-megous: lint 2024-08-31 21:57:33 +00:00
c32be5d170 hal/pine64: remove some commented out patches which are *definitely* irrelevant to pinephone
probably there are way more; i just have to make sense of the weird name scheme and be sure which sensors are/aren't on the pinephone
2024-08-31 21:50:50 +00:00
7830603ff3 cleanup: impure.nix: remove extraneous parentheses 2024-08-31 21:20:18 +00:00
98f028108e moby: remove old way of getting the armbian patches 2024-08-31 21:09:57 +00:00
1649e9e22f moby: remove outdated documentation 2024-08-31 21:08:08 +00:00
874ba132a8 crust-firmware-pinephone: remove unused pkgsCross input 2024-08-31 20:57:48 +00:00
1f0fa1cf2b WIP: moby: add the modem-power dev node back
my eg25-control script requires it; maybe someday i'll manage modem power from userspace as well -- that should be less error prone
2024-08-31 20:54:55 +00:00
98e32fbcab moby: add anxNNNN back to the device tree
i *suspect* this fixes/improves battery charging.
at least, i see the nwg-panel icon intermittently switch between
charging/not-charging, whereas before it ONLY ever showed not-charging.
2024-08-31 20:51:55 +00:00
947f2b821d moby: reduce the set of kernel patches
in fact i forgot to include the patch which adds anxNNNN to the device
tree, but it still boots to graphics. battery charging i *think* DOESN'T
work (needs the dts change probably)

waiting for this to deploy; i think i removed too many, and should have kept the anxNNNN device-tree patch, but unsure
2024-08-31 19:43:42 +00:00
68478b37fe moby: fix display for pseudo-mainline kernel
i'll work to reduce the patch stack... but it takes time to recompile/deploy
2024-08-31 18:20:41 +00:00
097f172e71 nixpkgs: remove no-longer-needed permittedInsecurePackages config 2024-08-31 18:19:14 +00:00
28be40a2c8 WIP: moby: enable the HDMI sound card
waiting on deploy; unsure if this achieves anything. but it applies and builds so why not, for now.
2024-08-31 17:10:32 +00:00
9daa12049f WIP: moby: ship mainline linux, with a few megi patches
100% mainline linux boots, with WiFi and battery charging, but no display

i'm trying to select megi patches that will enable the display; haven't found that yet. may be that the config requires tweaking (e.g. SIMPLEDRM stuff)
2024-08-31 17:09:39 +00:00
b9cd911c0d armbian-build: init
this repo contains (among other things) megi's kernel tree, exported as individual patches, where they can be easily cherry-picked and tracked
2024-08-31 17:03:17 +00:00
de2991a515 cleanup: nixpkgs/list: remove dead inputs 2024-08-31 17:01:11 +00:00
dd3dfc1988 todo.md: sync 2024-08-31 16:56:04 +00:00
a4dbca48fe all: remove the UV_USE_IO_URING=0 patch (seemingly fixed by linux 6.9/6.10?) 2024-08-31 07:22:05 +00:00
2cfccd948f nixpkgs: 0-unstable-2024-08-25 -> 0-unstable-2024-08-30 2024-08-31 07:15:00 +00:00
d911f92c28 nixpkgs-wayland: 0-unstable-2024-08-13 -> 0-unstable-2024-08-30 2024-08-31 07:14:51 +00:00
5a782551f7 syshud: 0-unstable-2024-08-24 -> 0-unstable-2024-08-27 2024-08-31 07:14:32 +00:00
c4f97fc31b uassets: 0-unstable-2024-08-21 -> 0-unstable-2024-08-30 2024-08-31 07:13:56 +00:00
b4f921ab04 programs: tangram: disable (i dont use it) 2024-08-31 07:13:39 +00:00
458a87045d uninsane-dot-org: 0-unstable-2024-08-14 -> 0-unstable-2024-08-29 2024-08-31 07:13:24 +00:00
ee4c699850 moby: fix cross: replace papers with zathura 2024-08-31 07:13:07 +00:00
341b150254 feeds: unsubscribe Sam Harris
he just kinda says the same thing over and over.
2024-08-30 20:38:18 +00:00
737df8c10e modules/programs: plumb capabilities into bunpen sandboxer 2024-08-30 20:36:11 +00:00
2053ba079c bunpen: plumb capabilities sandboxing into main
it produces visible effects (in the cap_i set), but it's useless until i also set ambient caps
2024-08-30 20:35:27 +00:00
04c937f04b bunpen: bind capset syscall, and plumb the caps into restrict::resources
but don't actually restrict them yet
2024-08-30 18:40:44 +00:00
475d1615fa bunpen: implement capability struct with parse method 2024-08-30 17:02:44 +00:00
25b3ccaa48 bunpen: split autodetect type into own file 2024-08-30 16:28:03 +00:00
735079e615 bunpen: config: make the help type not an error
asking for help isn't an error
2024-08-30 15:41:17 +00:00
1a1edc0d19 refactor: bunpen: config/translate_opts: guard file type more idiomatically
i hope. it's still really weird code here.
2024-08-30 15:34:54 +00:00
9148b49ba2 refactor: bunpen: config/translate_opts: make the autodetect logic not pollute the hardcoded path ingestion quite so much 2024-08-30 15:20:56 +00:00
67f6026c67 refactor: bunpen: config/translate_opts: rework the path detection code 2024-08-30 14:38:52 +00:00
cfb5a7651b refactor: bunpen: implement and use check_u64 to cover most remaining uses of ! 2024-08-30 13:41:11 +00:00
6f71d2f8db refactor: bunpen: switch a few more ! error unwraps to errors::ext::check 2024-08-30 13:25:41 +00:00
5f5cda9706 refactor: bunpen: namespace: swallow /proc/self/*_map errors instead of aborting 2024-08-30 13:17:24 +00:00
7ac4a6f060 refactor: bunpen: namespace: simplify the error paths 2024-08-30 13:10:00 +00:00
1d79f3eacc papers: ship in place of Zathura as the default pdf viewer 2024-08-30 12:53:05 +00:00
e5263915b9 refactor: namespace: leverage errors::ext::swallow where easily applicable 2024-08-30 12:42:28 +00:00
29cabd2ac4 bunpen: refactor: cleanup error checking impl 2024-08-30 12:23:48 +00:00
475037f9c9 bunpen: move rtext:: -> rt::ext:: 2024-08-30 12:03:23 +00:00
dab05a0f9c {check,swallow}_error: lift out of rtext into errors::ext
the ::ext namespace is required to prevent a circular dep within the std lib
2024-08-30 12:00:43 +00:00
d2bf8dbdbb bunpen: clone: place the clone flags behind an enum 2024-08-30 11:37:45 +00:00
3e5cb29a7d bunpen: namespace/umount: place the umount flags behind an enum 2024-08-30 11:31:12 +00:00
edeb153eb8 bunpen: namespace/mount: place the various mount flags behind an enum 2024-08-30 11:28:34 +00:00
61e8b99f72 bunpen: landlock: namespace the landlock_create_ruleset flags as well 2024-08-30 11:04:52 +00:00
566a61ca9f bunpen: landlock: namespace the different flags into enums 2024-08-30 10:57:48 +00:00
590cd36e53 bunpen: landlock: split out a helper to simplify the error handling 2024-08-30 10:33:33 +00:00
9803be75e1 bunpen: no_new_privs -> capabilities, in expectation of this file expanding in role 2024-08-30 09:43:46 +00:00
73583d19d4 programs: nix: ship nixVersions.latest
it gives better error messages, and i'm not seeing any regressions so far
2024-08-30 09:37:56 +00:00
19e2e37105 mpv: sandbox with bunpen instead of bwrap
it's far enough along to be actually working; though i likely give it a few more in-namespace capabilities than it really needs
2024-08-29 20:14:30 +00:00
f26f13ddf3 bunpen: bind "safe"-ish /de items 2024-08-29 20:13:37 +00:00
9c69666646 bunpen: expose a new /tmp to the sandbox 2024-08-29 20:13:20 +00:00
4f6b1b0a69 bunpen: bind a sandboxed /proc 2024-08-29 20:12:42 +00:00
bc1453f675 bunpen: mount /proc in the namespace, if pids are sandboxed 2024-08-29 16:47:02 +00:00
353057af23 bunpen: namespace: perform the first fork required for pid namespacing 2024-08-29 14:54:08 +00:00
7f5b55bc2a bunpen: simplify: share resources with the CLI parsing to avoid duplication 2024-08-29 14:17:42 +00:00
452ee68926 bunpen: lay the plumbing for future pid isolation 2024-08-29 14:13:38 +00:00
a2fa3727cc sane_sysvol: fix use of uninitialized volstr
hey, that lua language server is pretty neat ^_^
2024-08-29 11:43:19 +00:00
1676ef77ad bunpen: configure logging ASAP
this avoids dumping undesired spam to the console during the autodetect phase
2024-08-29 11:41:08 +00:00
39a7c1a6d9 bunpen: namespace: improve docs around path edgecases 2024-08-29 11:27:01 +00:00
d91e1d51c1 bunpen: handle intermediary symlinks when binding 2024-08-29 11:17:35 +00:00
f6d4dcaabb bunpen: fix outdated docs for namespace path binding 2024-08-29 11:10:37 +00:00
963a0ee56c mpv: setup profiles by which to tune youtube quality preferences and debanding 2024-08-29 10:17:53 +00:00
3e9e1168b4 bunpen: landlock: fix landlock access mode for unix sockets
the inode type for a socket is a superset of the inode type for a directory, so the bitmasking logic was wrong
2024-08-28 13:27:36 +00:00
14929c1102 programs: plum --bunpen-autodetect into modules/programs API 2024-08-28 11:37:18 +00:00
35848ece02 bunpen: implement --bunpen-autodetect 2024-08-28 11:35:58 +00:00
38ee8be785 bunpen: refactor: dont exit directly when parsing args, but return an error and let main do that 2024-08-27 22:28:06 +00:00
b3ea0ff2b3 bunpen: remove dead options i wont ever implement 2024-08-27 22:12:54 +00:00
e5cdd53537 bunpen: implement --bunpen-debug=n for more controlled logging 2024-08-27 20:48:26 +00:00
fb894bb7a5 bunpen: treelogger: implement log depth filtering 2024-08-27 20:36:31 +00:00
2ffacf0e44 bunpen: lay groundwork for a better logger 2024-08-27 20:36:31 +00:00
7dbe64e52f bunpen: preserve environment across exec boundary 2024-08-27 20:36:31 +00:00
b9fc61e627 modules/programs: plumb bunpen's home/run path binds 2024-08-27 20:36:31 +00:00
99de056048 bunpen: namespace: restore the working directory (if possible) after entering the mount namespace 2024-08-27 20:36:31 +00:00
469b9b9223 bunpen: prefer os::getpwd instead of relying on the PWD env var 2024-08-27 20:36:31 +00:00
2f6e54f331 bunpen: support --bunpen-home-path, --bunpen-run-path
still needs to be integrated into modules/programs
2024-08-27 20:36:31 +00:00
29886d7f10 servo: sftpgo: allow read-only media access via password auth 2024-08-27 13:52:40 +00:00
861014bca3 nixpkgs: fix patch hashes 2024-08-27 13:44:42 +00:00
3417a9fd3f sanebox: remove the portal logic, and delegate it to manual handling by those few apps which truly need special casing
it's a questionable responsibility to give to the sandbox itself (unless i also have the sandbox do things like dbus proxying, someday). and it will make the bunpen implementation simpler
2024-08-27 11:00:15 +00:00
83ef250a34 neovim: fix lints 2024-08-26 20:47:18 +00:00
59ba9e4853 neovim: disable ltex-ls plugin 2024-08-26 20:46:32 +00:00
3994beaa01 hosts/moby: disable the very heavy-weight LSPs (rust, typescript) 2024-08-26 17:17:10 +00:00
93159485fa neovim: integrate LSP for lua, LaTeX, html, markdown, nix, OpenSCAD, Rust, js/TypeScript :) 2024-08-26 16:49:00 +00:00
e1f5a55bca neovim: enable bash and python language servers 2024-08-26 14:06:49 +00:00
ea2739f86c neovim: enable "which-key" plugin 2024-08-26 14:06:49 +00:00
3c9ff16108 neovim: simplify plugin config schema 2024-08-26 14:06:49 +00:00
0787a3a50e neovim: split plugin configs into their own file 2024-08-26 14:06:49 +00:00
446e614e9a neovim: split vimrc into own file 2024-08-26 14:06:49 +00:00
afd0ec09a1 nixfmt-rfc-style: ship 2024-08-26 14:06:49 +00:00
422e8aeb3f sanebox: support existingDir{,OrParent} autodetect option 2024-08-26 14:06:49 +00:00
ae8e9267c4 nixpkgs: 0-unstable-2024-08-21 -> 0-unstable-2024-08-25 2024-08-26 08:15:49 +00:00
60c4b2e4c0 syshud: 2024-08-17 -> 2024-08-24, and apply nixfmt 2024-08-26 08:06:43 +00:00
289e9182fd bunpen: --bunpen-drop-shell: specify argv0 more correctly 2024-08-25 19:24:32 +00:00
ec7b87b985 bunpen: PARTIAL support for symlinks 2024-08-25 19:22:25 +00:00
9f5d7f2bb2 bunpen: fix mixup between argv0 and the rest of argv 2024-08-25 19:10:26 +00:00
64697a2cb8 bunpen: namespace: bind all requested user paths, and create requisite directories 2024-08-25 19:06:28 +00:00
1c50ff8fe4 bunpen: factor the pivot_root logic into some abstraction
is this really helpful? hard to tell for sure
2024-08-25 13:36:11 +00:00
3010ff89d0 bunpen: clean up mount namespacing so that i could bind any directory -- including /tmp 2024-08-25 13:27:31 +00:00
7a902cabfe bunpen: proof-of-concept mount namespace, exposing only *some* paths 2024-08-25 11:38:08 +00:00
64948a497d bunpen: write real uid/gid to /proc/self/uid_map 2024-08-24 20:38:33 +00:00
ccddc6f8e1 bunpen: TODO: calculate uid/gid at runtime 2024-08-24 20:12:51 +00:00
7d7abc9619 bunpen: namespace: simplify 2024-08-24 20:05:09 +00:00
f0efa0c255 bunpen: proof-of-concept mount namespacing 2024-08-24 20:01:27 +00:00
9ab6d101f6 bunpen: no_new_privs: propagate the error & handle it in main 2024-08-24 17:18:47 +00:00
164275fa59 bunpen: bind pivot_root to Hare 2024-08-24 12:35:55 +00:00
dbdd356691 bunpen: mv rtext/namespace -> rtext/unshare, to reflect that it is more limited in scope 2024-08-24 06:36:04 +00:00
c9157291b9 bunpen: namespace: unshare cgroup/ipc/uts, and net where possible 2024-08-24 05:20:54 +00:00
e315919b54 bunpen: run process inside a new user namespace 2024-08-24 05:12:27 +00:00
5f35eaccd9 programs/host: sandbox with bunpen instead of landlock
this just acts as a good proof-of-concept / testing it in the wild
2024-08-23 16:00:31 +00:00
c86d893a2c modules/programs: sandbox: allow method = "bunpen" 2024-08-23 16:00:31 +00:00
abb19b1fc9 bunpen: fix to allow binding files into the environment -- not just directories 2024-08-23 16:00:31 +00:00
ab4ebb012a bunpen: implement --bunpen-drop-shell flag 2024-08-23 16:00:31 +00:00
effec38a99 modules/programs: sandbox: introduce an interface which will allow for sandboxers other than sanebox 2024-08-23 16:00:31 +00:00
c5ed1263dc feeds: subscribe to justine.lol 2024-08-23 16:00:31 +00:00
e0d33862f0 bunpen: implement --bunpen-keep-net CLI arg 2024-08-23 16:00:31 +00:00
7d097474a3 bunpen: implement --bunpen-path cli arg 2024-08-23 16:00:31 +00:00
7a4a7d613b bunpen: implement basic arg parsing 2024-08-23 16:00:31 +00:00
e457cf96ae bunpen: break out a resources abstraction 2024-08-23 16:00:31 +00:00
f323c0f90d bunpen: rename "methods" -> "restrict" 2024-08-23 16:00:31 +00:00
5525ea4b59 bunpen: lift main up to the toplevel
it seems modules *do* support freestanding hare files at the toplevel -- but only if theres just one of them (?)
2024-08-23 16:00:31 +00:00
daa1783e21 bunpen: refactor kernel bindings into a rtext module
additionally, this requires moving all other files into their own directories, else hare doesn't seem to recognize 'rtext' as a module
2024-08-23 16:00:31 +00:00
27d5928155 bunpen: landlock: allow access to all of / 2024-08-23 16:00:31 +00:00
2f9dd4cd60 bunpen: landlock: fully restrict
of course, this means it's unable to 'exec' from disk -- for now
2024-08-23 16:00:31 +00:00
ba406e912f bunpen: landlock: cleaner bindings 2024-08-23 16:00:31 +00:00
45ff21822a feeds: sub JRE (we'll see how long this lasts...) 2024-08-23 06:09:33 +00:00
7ef9f0b455 bunpen: implement landlock_add_rule binding 2024-08-23 06:09:14 +00:00
ec90f5c066 bunpen: landlock: negotiate access modes with the running kernel 2024-08-22 17:30:07 +00:00
57e113137f bunpen: add minimal landlock API 2024-08-22 16:08:53 +00:00
2c390a8b6d bunpen: set no_new_privs before executing the command 2024-08-22 15:42:59 +00:00
634f13ba6b bunpen: use stdlib log isntead of raw fmt::printfln 2024-08-22 14:40:46 +00:00
dab7803cbb bunpen: execute the given argv 2024-08-22 14:34:08 +00:00
64f53020ee bunpen: explicitly configure 2-space indentation 2024-08-22 13:19:39 +00:00
e737d2e24b bunpen: run hare test during build 2024-08-22 13:19:21 +00:00
9b11b64349 haredoc: ship 2024-08-22 09:00:14 +00:00
212f6c0f48 bunpen: init at 0.1.0 2024-08-22 08:31:21 +00:00
a9cc0f28e2 feeds: subscribe to linuxdevtime podcast 2024-08-22 07:19:37 +00:00
3599f051b1 nixpkgs: 0-unstable-2024-08-19 -> 0-unstable-2024-08-21 2024-08-22 04:12:57 +00:00
d72a1c799e uassets: 0-unstable-2024-08-18 -> 0-unstable-2024-08-21 2024-08-22 04:12:39 +00:00
e78907b88b curlftpfs: remove -o interface... option and patch curl instead 2024-08-21 10:20:09 +00:00
04c41f6045 alsa-ucm-conf: make clear which data i last updated everything 2024-08-21 08:26:50 +00:00
32a52c3366 gnome-calls: document limitations/compatibility 2024-08-21 08:26:00 +00:00
55175e5957 geary: fix that it was failing to connect 2024-08-21 06:06:10 +00:00
b4b95be588 make-sandboxed: fix to preserve the specified output, for packages like dig 2024-08-21 04:00:45 +00:00
2758b0eae2 signal-desktop: DO start by default: until/unless i get signal-flare working, hosts which are capable should launch signal-desktop at boot 2024-08-21 03:30:16 +00:00
ae0d6cb8e8 make-sandboxed: preserve outputs of multiple-output packages
especially, this fixes the dconf service, since we keep '/libexec'
2024-08-21 03:28:02 +00:00
9c9b237e69 /mnt/servo/*: fix for curl 8.9.0
see: <https://github.com/curl/curl/discussions/14299>
2024-08-20 09:53:37 +00:00
17dcf566f7 loupe: add /dev/dri to the sandbox for faster rendering 2024-08-20 08:52:24 +00:00
bf94946759 nixpkgs: 0-unstable-2024-08-18 -> 0-unstable-2024-08-19 2024-08-20 08:52:07 +00:00
6e1ccc3e19 all: pin kernel to a later version (6.10, whereas it would be reduced to 6.6 by next nixpkgs update) 2024-08-20 08:51:38 +00:00
4055c6d3e9 podcasts: subscribe to C-Span's _The Weekly_ 2024-08-20 02:23:41 +00:00
ba8d9f2882 ayatana-ido: fix cross 2024-08-20 00:46:46 +00:00
82aa0eb1d6 flatpak: fix cross for 1.14.10 2024-08-19 23:39:31 +00:00
6341531122 syshud: 0-unstable-2024-08-10 -> 0-unstable-2024-08-17 2024-08-19 13:57:46 +00:00
c71d89e6af signal-desktop-from-src: disable automatic updates 2024-08-19 13:49:41 +00:00
995183a4fd koreader-from-src: disable automatic updates 2024-08-19 13:49:41 +00:00
ddffda1594 nixpkgs: 0-unstable-2024-08-13 -> 0-unstable-2024-08-18 2024-08-19 13:49:32 +00:00
c15cea08f6 nixpkgs-wayland: versionless update 2024-08-19 13:47:44 +00:00
7e73199b68 uassets: 0-unstable-2024-08-13 -> 0-unstable-2024-08-18 2024-08-19 13:46:50 +00:00
705a8a19c9 uninsane-dot-org: 0-unstable-2024-08-06 -> 0-unstable-2024-08-14 2024-08-19 13:46:30 +00:00
c8b28580a9 todo.md: sync 2024-08-19 13:30:46 +00:00
1b4266f8a7 hickory-dns: fix compilation error with newer rustc 2024-08-19 13:29:09 +00:00
aecbfb45c9 gnome-calls: dont fail offline indefinitely when DNS errors 2024-08-18 14:24:11 +00:00
e16a26fad2 sane-tag-media: implement --style video to aid in structuring an album-less library (e.g. an archive of Youtube videos, organized by channel) 2024-08-18 01:51:12 +00:00
7d23f9453e sane-tag-media: update docs 2024-08-17 22:42:51 +00:00
391c4f5aac geary: change the default autostart to true 2024-08-17 12:13:15 +00:00
48b0960966 moby: dont auto-start signal-desktop (its too battery draining) 2024-08-17 12:11:40 +00:00
9069a97c26 sane-tag-media: ignore QuarkXPress publisher 2024-08-17 10:53:45 +00:00
ca793af819 make-sandboxed: fix double-wrapping when two symlinks point to the same binary by non-canonical paths (e.g. mount.sshfs -> ../bin/sshfs) 2024-08-16 10:50:20 +00:00
05e2f6f2a0 todo.md: note that hickory-dns cant resolve shows.acast.com 2024-08-16 02:48:24 +00:00
08d6f9c761 dconf: sandbox out-of-place 2024-08-16 02:48:24 +00:00
05bc5923cf sway: sandbox out-of-place 2024-08-16 02:48:24 +00:00
114b37928a tor-browser: sandbox out-of-place 2024-08-16 02:44:27 +00:00
e846a5046a feeds: subscribe to 404 media 2024-08-16 02:41:17 +00:00
5dcb7b5cf6 scripts/init-feed: sanitize titles/descriptions 2024-08-16 02:39:56 +00:00
f603bad779 scripts/init-feed: support --podcast argument to select podcasts over text 2024-08-16 02:34:19 +00:00
729d2a9809 firefox: dont use inplace wrapper
avoiding inplace wrapping gives me more leverage over what gets linked into the final runtime environment
2024-08-16 02:16:37 +00:00
a552ed625b make-sandboxed: fix several edge-cases for e.g. brave, firefox, especially around handling of wrapped binaries 2024-08-16 02:15:46 +00:00
f3df321713 sanebox: fix pasta argv passing 2024-08-16 02:14:29 +00:00
62ebdf5de4 brave: fix sandboxing 2024-08-16 00:15:58 +00:00
f834f551ed assorted: clarify why i use wrapperType = inplace when sandboxing 2024-08-15 21:01:42 +00:00
140b61a944 slic3r: ship 2024-08-15 10:32:22 +00:00
db7767c679 assorted: remove some no-longer-needed sandbox.wrapperType = "inplace" declarations 2024-08-15 10:32:22 +00:00
fd6959230f make-sandboxed: handle /opt-style packaging, with toplevels linked into /bin, a bit better 2024-08-15 10:32:18 +00:00
87e9856497 sanebox: forward argv0 2024-08-15 10:31:21 +00:00
50b1d82b38 nixpkgs: fix hashes 2024-08-14 23:20:31 +00:00
60a4eb0bde gnome-calls: associate with tel:, sip:, sips: URIs 2024-08-14 08:27:27 +00:00
a96e83f4e1 doc: gnome-calls: document some UI elements 2024-08-14 07:53:47 +00:00
0d685f406e uassets: 2024-08-09 -> 2024-08-13 2024-08-13 22:02:37 +00:00
a16e33d7a6 sops-nix: 2024-08-05 -> 2024-08-12 2024-08-13 22:02:27 +00:00
f38d351869 syshud: 2024-08-03 -> 2024-08-10 2024-08-13 22:01:57 +00:00
e245164da3 nixpkgs-wayland: 2024-08-12 -> 2024-08-13 2024-08-13 22:01:31 +00:00
7df8f45e97 nixpkgs: 2024-08-12 -> 2024-08-13 2024-08-13 22:00:49 +00:00
e1ba371838 cross: flatpak: fix via nixpkgs patch instead of overlay 2024-08-13 07:20:24 +00:00
467283989f todo.md: fix Epiphany to persist cookies 2024-08-13 03:41:08 +00:00
db39dc209f xdg-desktop-portal-gnome: sandbox 2024-08-13 03:34:09 +00:00
7cf860a071 nixpkgs: update passt hash 2024-08-13 03:33:48 +00:00
77a753b0d6 gnome-maps: todo: better portal integration 2024-08-13 02:50:59 +00:00
e2a4f4d63e todo.md: newsflash and gnome-maps bugs to tackle 2024-08-13 02:48:08 +00:00
31fc072bce nixpkgs-overlays: try to be a little more pure 2024-08-12 21:56:30 +00:00
144afd8171 sway: fix wlroots drmSync bug via upstream patch 2024-08-12 21:52:44 +00:00
7d97355d2a overlays/cross: remove no-longer-necessary overrides 2024-08-12 21:20:16 +00:00
7827f6c584 sway: note that the activation patch is still necessary 2024-08-12 18:28:16 +00:00
e1899495a0 nixpkgs-wayland: 0-unstable-2024-08-06 -> 0-unstable-2024-08-12 2024-08-12 18:05:32 +00:00
a56ad56a4f refactor: move ~/.cache/nix persistence to hosts/common/programs/nix.nix 2024-08-12 16:06:26 +00:00
da551b8b97 geary: grant access to more files 2024-08-12 16:04:20 +00:00
ca412d08bd nautilus: grant access to more files 2024-08-12 16:04:11 +00:00
e7a1bb6ec0 nixpkgs: 2024-08-11 -> 2024-08-12 2024-08-12 10:30:04 +00:00
74acfeadd5 programs/assorted: clarify sandbox.enable = false situation 2024-08-12 10:27:41 +00:00
e7d5a61014 libcap: split into separate capsh and captree programs, and sandbox the latter 2024-08-12 10:13:50 +00:00
6f47708624 nixpkgs patches: send a few upstream; dont apply ffado patch here because my system doesnt use it 2024-08-12 10:10:06 +00:00
fc826a3503 libcap: patch in captree locally rather than via a nixpkgs patch that would force mass rebuilds 2024-08-12 09:39:43 +00:00
ccb2b7b8b6 nixpkgs: update libcap patch to grab from the PR 2024-08-12 09:18:50 +00:00
78169d50f2 overlays/cross: remove upstreamed patches; simplify rust things 2024-08-12 09:14:42 +00:00
33a7d3536d nixpkgs: update patches 2024-08-12 09:14:00 +00:00
7899c8d033 syshud: 0-unstable-2024-07-29 -> 0-unstable-2024-08-10 2024-08-12 02:37:03 +00:00
82b662a733 nixpkgs: remove dead (upstreamed) patches 2024-08-12 02:13:07 +00:00
d4290588bf rename: trust-dns -> hickory-dns 2024-08-12 01:23:39 +00:00
bd97fb9ec9 nixpkgs: 24.05-unstable-2024-08-09 -> 24.05-unstable-2024-08-11 2024-08-12 01:08:03 +00:00
4dbff9c18f scripts/deploy: shorten "--action copy" to just "--copy" 2024-08-12 01:07:50 +00:00
bfe278c17a feeds: subscribe to Weird Little Guys 2024-08-12 00:35:34 +00:00
295e07d535 sane-tag-media: fix lingering crashes around --derive behavior 2024-08-12 00:13:42 +00:00
d39459d8b5 NetworkManager: tighten the systemd sandboxing 2024-08-11 22:54:47 +00:00
4d5e60756b modemmanager: make its capabilities more obvious 2024-08-11 22:54:41 +00:00
119afcf393 firefox: remove open-in-mpv (obsoleted by firefox-xdg-open) 2024-08-11 22:37:12 +00:00
d3d970eb3e firefox: dont require approval to open xdg-open: URIs 2024-08-11 22:32:26 +00:00
c0d5004926 firefox: add a right-click context menu to open any URI with the system handler
it still prompts the user to allow it, but i'll fix that later i guess
2024-08-11 22:26:23 +00:00
d9a876e49a fractal: association with https://matrix.to links 2024-08-11 21:45:51 +00:00
5a9dd89475 sane-vpn: fix global up/down action 2024-08-11 21:01:11 +00:00
5e71e5a067 moby: enable bluetooth 2024-08-11 06:27:07 +00:00
f0b0d15ad7 evtest: ship 2024-08-11 06:26:58 +00:00
8aebc1fe87 feeds: subscribe to Oyez supreme court oral arguments 2024-08-10 11:16:54 +00:00
764c2a3276 Revert "nixpkgs-wayland: 0-unstable-2024-08-06 -> 0-unstable-2024-08-09"
This reverts commit ce1c3ec804.

while the nixpkgs-wayland bump works fine on lappy/desko,
it causes moby to be stuck on the white screen after unlocking.
2024-08-10 04:16:31 +00:00
a2f34be9d6 avahi: fix so the dbus policy files get installed system wide, again 2024-08-10 02:59:20 +00:00
bda172bc2d avahi: harden systemd service
N.B.: i haven't tested this on moby yet (which advertizes the gps-share service) nor on servo (which maybe uses it for jellyfin, idk)
2024-08-10 02:04:57 +00:00
a91a2d8a7f gps-share: fix sandboxing 2024-08-10 01:10:31 +00:00
875d919fa8 systemd-rfkill: harden 2024-08-10 00:34:13 +00:00
a323f321b5 snapper: disable
it wasn't working to begin with
2024-08-10 00:09:58 +00:00
f986936bbd wg-home-refresh: use the sandboxed wireguard-tools 2024-08-09 23:52:31 +00:00
3d773fe375 sanebox: improve the capsh stuff a bit more 2024-08-09 23:52:16 +00:00
055ad222e3 wg-home-refresh: harden systemd service 2024-08-09 23:05:58 +00:00
3aafcb0aa8 sanebox: capshonly: be more precise about preserving e/i/p capabilities
with this, gocryptfs works AND wg works
2024-08-09 22:55:02 +00:00
c85f02ca68 scripts/sync: dont rely on /mnt/$self existing 2024-08-09 21:41:56 +00:00
eeafc34ccf hare-ev: 2024-07-11 -> 2024-08-06 2024-08-09 21:41:56 +00:00
039ffcdcd4 newsflash: sandbox 2024-08-09 21:35:33 +00:00
2a35cb5379 mime.urlAssociations: clarify regexes by using $ terminator 2024-08-09 20:57:13 +00:00
3db009bc98 mpv: associate with all web audio/video resources 2024-08-09 20:55:00 +00:00
1e840e72b3 nixpkgs: 24.05-unstable-2024-08-06 -> 24.05-unstable-2024-08-09 2024-08-09 10:34:20 +00:00
ce1c3ec804 nixpkgs-wayland: 0-unstable-2024-08-06 -> 0-unstable-2024-08-09 2024-08-09 10:34:02 +00:00
09dd69a855 uassets: 0-unstable-2024-08-06 -> 0-unstable-2024-08-09 2024-08-09 10:33:29 +00:00
cbe71868ef newsflash: deploy 2024-08-09 10:25:53 +00:00
7b043d0c87 newsflash: simplify cross compilation 2024-08-09 10:14:59 +00:00
fd0188025d newsflash: fix cross compilation 2024-08-09 09:46:40 +00:00
1c57ffa798 newsflash-nixified: init at 3.3.4 (doesn't build!)
it's doing complicated things with glib macros that i can't get to work.
2024-08-09 03:50:36 +00:00
1d205a89bc sway: fix gnome-calls to always be on workspace 1 2024-08-08 23:59:19 +00:00
5ff643aa2f foliate: fix sandboxing 2024-08-08 23:58:02 +00:00
bfdf63e641 calls: 46.3 -> 47.0-beta 2024-08-08 23:57:47 +00:00
c695f7a979 foliate: ship 2024-08-08 21:08:51 +00:00
b3b38451b5 koreader-from-src: add an update script (only updates the toplevel, at the moment) 2024-08-08 18:47:03 +00:00
1ee81db537 switch xdg-desktop-portal-gtk -> xdg-desktop-portal-gnome
the gnome file chooser is far more responsive, on moby

though thumbnailing doesnt work, which may degrade the desktop experience :-(
2024-08-08 09:43:47 +00:00
b9947c05ca xdg-desktop-portal-gnome: fix cross compilation 2024-08-08 09:05:26 +00:00
2de6491583 xdg-desktop-portal-gnome: get working as a xdp backend, on lappy
probably needs some porting to moby before it works there
2024-08-08 08:52:24 +00:00
4525df58e0 rsyslog: disable 2024-08-08 07:40:59 +00:00
9d1ffc7c43 todo.md: document some connectivity issues 2024-08-08 03:41:52 +00:00
a69af91b7b add /mnt/servo/home to my hosts 2024-08-08 00:45:33 +00:00
7b5d655c91 scripts/check-backups: show how to view the host's last-completed 2024-08-07 23:00:44 +00:00
de6ffe6b75 flare-signal: update compatibility notes 2024-08-07 22:07:56 +00:00
f8aea34e96 sanebox: bwrap: make user namespace unsharing more obvious 2024-08-07 21:23:21 +00:00
49efb94a0a seatd: restrict capabilities 2024-08-07 20:30:29 +00:00
9b1e053ead seatd: place the socket in a place that lends itself to better sandboxing 2024-08-07 19:37:20 +00:00
235dc86155 todo.md: delete completed sandboxing items 2024-08-07 01:33:31 +00:00
6dad290cd5 duplicity: purge 2024-08-07 01:33:31 +00:00
cc6ed6c0ec flare-signal: annotate my notes on it with datestamps 2024-08-07 01:23:43 +00:00
cc3aba3cc2 servo: fix postfix: dont start until after the mail dir has been mounted 2024-08-07 00:17:17 +00:00
41f08125bb scripts/check-backups: convert timestamps to hours 2024-08-06 21:50:49 +00:00
27487fe870 scripts/check-admin: script to show which (if any) services require tending to registration attempts 2024-08-06 21:40:48 +00:00
d45ea622d1 servo: disable email-based registration gating 2024-08-06 21:39:32 +00:00
247fd3f807 less: tune flags, especially for systemd/journalctl 2024-08-06 19:25:10 +00:00
816e2a7065 nixpkgs: 24.05-unstable-2024-08-04 -> 24.05-unstable-2024-08-06 2024-08-06 19:08:39 +00:00
be842d5c5e nixpkgs-wayland: 0-unstable-2024-08-03 -> 0-unstable-2024-08-06 2024-08-06 19:08:30 +00:00
fa6ec981e0 sops-nix: assets-unstable-2024-07-27 -> assets-unstable-2024-08-05 2024-08-06 19:08:16 +00:00
52b4c1542a uassets: 0-unstable-2024-08-03 -> 0-unstable-2024-08-06 2024-08-06 19:08:00 +00:00
3ff59247da uninsane-dot-org: ? -> 2024-08-06 2024-08-06 19:07:44 +00:00
d9c0855c4e fractal-nixified: 7 -> 8 2024-08-06 08:26:50 +00:00
1a67a05238 transmission/torrent-done: make files readable (speculative) 2024-08-06 08:26:16 +00:00
1cdeedd9ec servo: partially ship ollama 2024-08-06 08:24:29 +00:00
6830bb7097 servo: transmission: simplify the rsync call
i'm having perms issues _somewhere_
2024-08-06 08:14:45 +00:00
316b0bee3a landlock-sandboxer: disable the ABI mismatch warnings 2024-08-06 07:20:00 +00:00
638655ff83 mnt-servo-*-reachable.service: harden systemd service 2024-08-06 06:43:10 +00:00
5e57e78411 /mnt/servo/*: fix to not hang the mount when fs is offline
this is an unfortunate effect of the drop_privileges part of fuse3,
that the mount is active as soon as the fs implementation is launched,
instead of when it enters `fuse_main`.
2024-08-06 05:54:31 +00:00
3859619ae0 curlftpfs-sane: implement "-o exit_after_connect" 2024-08-06 05:53:45 +00:00
646c2dd85a common/fs: mount curlftpfs using fuse3 2024-08-06 04:48:47 +00:00
0655b6906c curlftpfs: implement readdir
i think now all the stuff you'd expect of a basic fs now actually works
2024-08-06 04:11:32 +00:00
3019f90f5d curlftpfs-sane: upgrade to fuse3 2024-08-06 03:00:11 +00:00
020e5f8c6e /mnt/persist/private: split waiting on the keyfile out of the mount process 2024-08-06 02:03:55 +00:00
809c3af7fa /mnt/persist/private: minor improvements to file permissions 2024-08-06 01:26:53 +00:00
93cb1bc546 /mnt/persist/private: sandbox in a way that the actual gocryptfs instance doesn't get CAP_SYS_ADMIN 2024-08-06 00:52:48 +00:00
53acab834c refactor: persist/stores/ephemeral: move to its own source directory 2024-08-05 23:05:02 +00:00
3a0610b029 /mnt/persist/ephemeral: sandbox in a way that the actual gocryptfs instance doesn't get CAP_SYS_ADMIN
instead, only fuse does, and the capability is lost during the handoff between fuse and gocryptfs
2024-08-05 23:04:14 +00:00
9cee460d7e gocryptfs: sandbox with landlock
now /mnt/persist/ephemeral implementation can't access /mnt/persist/private; /mnt/persist/private can't access /mnt/desko/home, and so on
2024-08-05 23:01:38 +00:00
e657507a76 libfuse-sane: search for mount helpers on /run/current-system/sw/bin 2024-08-05 23:00:05 +00:00
c706a19836 landlock-sandboxer: rename the binary, so that it can be included on PATH without collisions 2024-08-05 22:59:14 +00:00
566e15286b sanebox: don't assume 'readlink' is available in the environment 2024-08-05 22:56:18 +00:00
d1b4e9c923 sanebox: allow /dev/fd in the sandbox by default 2024-08-05 22:55:12 +00:00
5eca45891b sanebox: fix landlock sandboxing IAB edgecases
i don't fully understand it. but adjusting the Inh capability set breaks things like gocryptfs. i think it isn't necessary: if we set E alone, and no-new-privs, then that gets us the same guarantees.
2024-08-05 22:54:20 +00:00
722fe8f368 libcap: ship the optional 'captree' component 2024-08-05 05:30:14 +00:00
e25dd98f6c spot/spotify: disable
i don't use spotify atm
2024-08-05 00:47:59 +00:00
54e9d4a0ae sane-vpn: switch back to bwrap instead of pasta 2024-08-04 18:56:17 +00:00
9f3a13eeb8 nixpkgs: 24.05-unstable-2024-08-02 -> 24.05-unstable-2024-08-04 2024-08-04 02:19:14 +00:00
5605ffda4b nixpkgs-wayland: 0-unstable-2024-08-02 -> 0-unstable-2024-08-03 2024-08-04 02:18:57 +00:00
9165925469 syshud: 0-unstable-2024-07-29 -> 0-unstable-2024-08-03 2024-08-04 02:18:37 +00:00
f65bf2b433 uassets: 0-unstable-2024-08-02 -> 0-unstable-2024-08-03 2024-08-04 02:18:14 +00:00
0f60a86ed4 hare-ev: 0-unstable-2024-07-07 -> 0-unstable-2024-07-11 2024-08-04 01:08:37 +00:00
b488b6748d nixos/pam: replace apparmor warnings with assertions 2024-08-04 00:50:41 +00:00
ef6b7cf175 syshud: 0-unstable-2024-07-16 -> 0-unstable-2024-07-29 2024-08-04 00:39:04 +00:00
0906d76f83 libcap_ng: ship 2024-08-03 23:27:53 +00:00
90c495e74c libfuse-sane: ship 2024-08-03 22:59:34 +00:00
74662df720 persist/{private,ephemeral}: mount via fuse
gocryptfs is compatible with --drop-permissions style of mount.fuse3. only, i can't actually use that today because i need to keep permissions :o

but maybe i'll enable that in the future
2024-08-03 18:51:58 +00:00
2b3278eb7f /mnt/$host/home: layer bwrap sandboxing after the drop-privileges passoff 2024-08-03 17:11:11 +00:00
9b4e91fbd9 /mnt/$host/home: harden systemd settings 2024-08-03 16:27:42 +00:00
734627232a /mnt/$host/home: mount with drop_privileges 2024-08-03 15:13:04 +00:00
3adbbe5fa7 /mnt/$host/home: run as user instead of as root 2024-08-03 15:13:04 +00:00
b4a244df7a rsync-net: fix /nix/persist/private path 2024-08-03 14:32:44 +00:00
97268e9b26 curlftpfs-sane: rename from curlftpfs
i already patched it significantly; i plan to port to fuse3 shortly
2024-08-03 14:32:01 +00:00
bebf6bdaeb rsync-net: hardcode fewer paths 2024-08-03 11:38:43 +00:00
04fc601c9c rsync-net: fix sandboxing (dont set PrivateUsers: we lose perms in the root ns doing that) 2024-08-03 11:25:50 +00:00
ee062d61d0 sane-tag-media: rework the tag extrapolation to be less intrusive 2024-08-03 07:58:43 +00:00
0dba9987c5 sane-tag-media: remove unused "confirm" function 2024-08-03 07:19:53 +00:00
4761690b6d sane-tag-media: have --derive + --override-existing NOT override the existing tags when the derived ones apear to be simply lower-quality versions of the same on-disk data 2024-08-03 07:19:08 +00:00
604782c3a6 sane-tag-media: refactor (simplify) 2024-08-03 03:57:09 +00:00
365d33c357 sane-tag-media: empty manual tags always overwrite tags, regardless of --override-existing flag 2024-08-03 03:38:22 +00:00
a39ad8a508 sane-tag-media: rename --force flag to --override-existing 2024-08-03 03:31:16 +00:00
c49e9a4c2b sane-tag-media: implement the --ignore-existing flag 2024-08-03 03:18:07 +00:00
36491842cc sanebox: bwrap: micro-optimize to not require env 2024-08-02 22:44:27 +00:00
81ea2210c9 sanebox: allow keeping the net namespace 2024-08-02 22:44:27 +00:00
f678508b33 sanebox: add --sanebox-capsh-arg flag 2024-08-02 22:44:27 +00:00
6135be5f72 sanebox: refactor: bwrapFlags -> bwrapArgs 2024-08-02 22:44:27 +00:00
c8989ca1a8 pasta: allow running as root 2024-08-02 22:44:26 +00:00
1d665f8ecc sanebox: support "--sanebox-cap all" special case 2024-08-02 22:43:52 +00:00
7c284ad8da sane-vpn: use pasta instead of full bwrap for net namespacing 2024-08-02 22:42:56 +00:00
1c26674da7 rsync-net: temporarily use only RestrictNetworkInterfaces option and disable the internal sane-vpn logic
this is temporary, until i can fix sane-vpn to preserve linux capabilities
2024-08-02 22:10:44 +00:00
dae8481176 firefox: ship a "stub DNS" desktop file variant
though note that my stub-dns seems to be broken recently...
2024-08-02 21:41:07 +00:00
42b27f0433 sane-vpn: fix broken doc on --verbose flag 2024-08-02 21:39:29 +00:00
84be0cae5a todo.md: note another website which doesnt resolve with trust-dns 2024-08-02 21:20:31 +00:00
fbfd0afca4 common/fs: only desclare /mnt/$host mounts for hosts this machine is authorized to access 2024-08-02 20:29:22 +00:00
e586b7b449 signal-desktop-from-src: 7.16.0 -> 7.18.0 2024-08-02 10:52:44 +00:00
222c37b056 uassets: 2024-07-29 -> 2024-08-02 2024-08-02 10:52:25 +00:00
53b17ec230 nixpkgs-wayland: 2024-07-28 -> 2024-08-02 2024-08-02 10:52:07 +00:00
7697704aff nixpkgs: 2024-07-31 -> 2024-08-02 2024-08-02 10:51:44 +00:00
c490b6e6ad common/polyunfill: simplify my config by using the new security.pam.package option 2024-08-02 10:04:20 +00:00
89d678c729 nixpkgs: 2024-07-29 -> 2024-07-31 2024-08-02 10:03:48 +00:00
c64163290c gocryptfs: return to running mainline
i don't need the bug fix anymore, since i don't use pam_mount anymore
2024-08-02 09:52:20 +00:00
eaeb8380dc fs: enable @basic-api everywhere, since its required by systemd restart logic 2024-08-02 09:13:55 +00:00
05a9e8e819 common: /mnt/servo: fix systemd mount files to be aware of the timeout, again 2024-08-02 08:16:13 +00:00
cf20230d96 sane.fs: cleanup
plumb systemd.{mounts,services} instead of the less detailed 'systemd'
2024-08-02 08:01:38 +00:00
9dbb2a6266 sane.fs: take in the role of generating systemd.mounts files 2024-08-02 07:33:21 +00:00
113b107d73 persist: fix ordering so stores arent required by local-fs.target
maybe they should be, but then there's weird stuff about getty depending on sysinit.target, and that being blocked by the private store...
2024-08-02 06:20:39 +00:00
96dfe79a8c fs: persist/private: harden systemd mount file 2024-08-02 05:17:44 +00:00
6e5bde17aa cleanup: persist/private: simplify 2024-08-02 05:00:55 +00:00
3eb66c098b trust-dns: make it a dependency of "network-online.target" 2024-08-02 04:54:58 +00:00
515aab5370 cleanup: persist/private: encode the dependencies more precisely, rather than just having it all depend on default.target 2024-08-02 04:50:33 +00:00
f925dd9a20 fs: isolate /mnt/servo/* and /mnt/persist/ephemeral a bit more 2024-08-02 04:45:14 +00:00
cbe6bdf158 hosts: fs: sandbox /mnt/servo/* mounts 2024-08-02 03:17:53 +00:00
949a52dee1 activationScripts.notifyActive: be quiet about sane-deadlines/sane-sysload 2024-08-02 01:11:19 +00:00
2ee1fb17c4 sane-deadlines, sane-sysload: fix ordering to not run before the environment is configured 2024-08-02 01:04:07 +00:00
48cc718700 login: remove systemd-user-sessions integration so that we dont block on remote-fs
tested on lappy. will it work on servo, with gitea?
2024-08-02 00:52:51 +00:00
6a7dd31755 vpn: fix warning about missing /32 syntax 2024-08-02 00:37:58 +00:00
2197951e12 NetworkManager-dispatcher: cleanup an ordering cycle between it and trust-dns-localhost 2024-08-02 00:36:54 +00:00
883db3e9ba todo.md: sync 2024-08-02 00:33:35 +00:00
312b0a5554 todo.md: sandbox the remaining filesystems 2024-08-01 22:50:03 +00:00
07de46c616 todo.md: remove completed items 2024-08-01 22:48:49 +00:00
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
437 changed files with 39130 additions and 19622 deletions

View File

@@ -17,8 +17,6 @@ the only hard dependency for my exported pkgs/modules should be [nixpkgs][nixpkg
building [hosts/](./hosts/) will require [sops][sops]. building [hosts/](./hosts/) will require [sops][sops].
you might specifically be interested in these files (elaborated further in #key-points-of-interest): you might specifically be interested in these files (elaborated further in #key-points-of-interest):
- ~~[`sxmo-utils`](./pkgs/additional/sxmo-utils/default.nix)~~
- these files will remain until my config settles down, but i no longer use or maintain SXMO.
- [my implementation of impermanence](./modules/persist/default.nix) - [my implementation of impermanence](./modules/persist/default.nix)
- my way of deploying dotfiles/configuring programs per-user: - my way of deploying dotfiles/configuring programs per-user:
- [modules/fs/](./modules/fs/default.nix) - [modules/fs/](./modules/fs/default.nix)

80
TODO.md
View File

@@ -2,18 +2,21 @@
- `rmDbusServices` may break sandboxing - `rmDbusServices` may break sandboxing
- e.g. if the package ships a systemd unit which references $out, then make-sandboxed won't properly update that unit. - e.g. if the package ships a systemd unit which references $out, then make-sandboxed won't properly update that unit.
- `rmDbusServicesInPlace` is not affected - `rmDbusServicesInPlace` is not affected
- when moby wlan is explicitly set down (via ip link set wlan0 down), /var/lib/trust-dns/dhcp-configs doesn't get reset - when moby wlan is explicitly set down (via ip link set wlan0 down), /var/lib/hickory-dns/dhcp-configs doesn't get reset
- `ip monitor` can detect those manual link state changes (NM-dispatcher it seems cannot) - `ip monitor` can detect those manual link state changes (NM-dispatcher it seems cannot)
- or try dnsmasq? - or try dnsmasq?
- trust-dns: can't recursively resolve api.mangadex.org - hickory-dns can't resolve `abs.twimg.com`
- nor `m.wikipedia.org` (`dyna.wikipedia.org`) - hickory-dns can't resolve `social.kernel.org`
- and *sometimes* apple.com fails - hickory-dns can't resolve `pe.usps.com`
- sandbox: link cache means that if i update ~/.config/... files inline, sandboxed programs still see the old version - hickory-dns can't resolve `social.seattle.wa.us`
- hickory-dns can't resolve `support.mozilla.org`
- hickory-dns can't resolve `shows.acast.com`
- 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: 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
- `ssh` access doesn't grant same linux capabilities as login - `ssh` access doesn't grant same linux capabilities as login
- syshud (volume overlay): when casting with `blast`, syshud doesn't react to volume changes - syshud (volume overlay): when casting with `blast`, syshud doesn't react to volume changes
- moby: after bringing the modem up, powering it down loses *complete* net connectivity (i.e. wlan is gone as well)
- dissent: if i launch it without net connectivity, it gets stuck at the login, and never tries again
- moby: kaslr is effectively disabled - moby: kaslr is effectively disabled
- `dmesg | grep "KASLR disabled due to lack of seed"` - `dmesg | grep "KASLR disabled due to lack of seed"`
- fix by adding `kaslrseed` to uboot script before `booti` - fix by adding `kaslrseed` to uboot script before `booti`
@@ -24,16 +27,24 @@
- `dmesg | grep 'hid_bpf: error while preloading HID BPF dispatcher: -22'` - `dmesg | grep 'hid_bpf: error while preloading HID BPF dispatcher: -22'`
- `s6` is not re-entrant - `s6` is not re-entrant
- so if the desktop crashes, the login process from `unl0kr` fails to re-launch the GUI - so if the desktop crashes, the login process from `unl0kr` fails to re-launch the GUI
- nwg-panel will sometimes create nested bars (happens maybe when i turn an external display off, then on?) - newflash on moby can't play videos
- wg-home is unreachable for a couple minutes when switching between LAN/WAN/3G - "open in browser" works though -- in mpv
- because the endpoint DNS changes. - gnome-maps can't use geoclue *and* openstreetmap at the same time
- causes calls to not transfer from WiFi -> cellular. - get gnome-maps to speak xdg-desktop-portal, and this will be fixed
- epiphany can't save cookies
- see under "preferences", cookies are disabled
- prevents logging into websites (OpenStreetMap)
- works when sandbox is disabled
## REFACTORING: ## REFACTORING:
- get moby's kernel closer to mainline
- i.e. reduce the number of megi patches i apply
- don't use pmOS's defconfig, but nixpkgs default config + whatever extras i need
- add import checks to my Python nix-shell scripts - add import checks to my Python nix-shell scripts
- consolidate ~/dev and ~/ref - consolidate ~/dev and ~/ref
- ~/dev becomes a link to ~/ref/cat/mine - ~/dev becomes a link to ~/ref/cat/mine
- fold hosts/common/home/ssh.nix -> hosts/common/users/colin.nix - fold hosts/common/home/ssh.nix -> hosts/common/users/colin.nix
- don't hardcode IP addresses so much in servo
### sops/secrets ### sops/secrets
- rework secrets to leverage `sane.fs` - rework secrets to leverage `sane.fs`
@@ -50,37 +61,32 @@
#### upstreaming to non-nixpkgs repos #### upstreaming to non-nixpkgs repos
- gtk: build schemas even on cross compilation: <https://github.com/NixOS/nixpkgs/pull/247844> - gtk: build schemas even on cross compilation: <https://github.com/NixOS/nixpkgs/pull/247844>
- gnome-calls retry net connection when DNS is down
## IMPROVEMENTS: ## IMPROVEMENTS:
- systemd/journalctl: use a less shit pager
- there's an env var for it: SYSTEMD_PAGER? and a flag for journalctl
- kernels: ship the same kernel on every machine
- 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 - zfs: replace this with something which doesn't require a custom kernel build
- mpv: add media looping controls (e.g. loop song, loop playlist) - 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)
- firefox: open *all* links (http, https, ...) with system handler
- removes the need for open-in-mpv, firefox-xdg-open, etc.
- matrix room links *just work*.
- `network.protocol-handler.external.https = true` in about:config *seems* to do this,
but breaks some webpages (e.g. Pleroma)
### security/resilience ### security/resilience
- validate duplicity backups! - enable `snapper` btrfs snapshots (`services.snapper`)
- encrypt more ~ dirs (~/archives, ~/records, ..?)
- best to do this after i know for sure i have good backups
- /mnt/desko/home, etc, shouldn't include secrets (~/private) - /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) - 95% of its use is for remote media access and stuff which isn't in VCS (~/records)
- port all sane.programs to be sandboxed - 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) - 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:...`.
- ensure non-bin package outputs are linked for sandboxed apps
- i.e. `outputs.man`, `outputs.debug`, `outputs.doc`, ...
- lock down dbus calls within the sandbox - lock down dbus calls within the sandbox
- otherwise anyone can `systemd-run --user ...` to potentially escape a sandbox - otherwise anyone can `systemd-run --user ...` to potentially escape a sandbox
- <https://github.com/flatpak/xdg-dbus-proxy> - <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 - make dconf stuff less monolithic
- i.e. per-app dconf profiles for those which need it. possible static config. - i.e. per-app dconf profiles for those which need it. possible static config.
- flatpak/spectrum has some stuff to proxy dconf per-app - flatpak/spectrum has some stuff to proxy dconf per-app
@@ -92,14 +98,13 @@
- cleanup waybar/nwg-panel so that it's not invoking playerctl every 2 seconds - cleanup waybar/nwg-panel so that it's not invoking playerctl every 2 seconds
- nwg-panel: doesn't know that virtual-desktop 10/TV exists - nwg-panel: doesn't know that virtual-desktop 10/TV exists
- install apps: - install apps:
- compass viewer (moby)
- display QR codes for WiFi endpoints: <https://linuxphoneapps.org/apps/noappid.wisperwind.wifi2qr/> - display QR codes for WiFi endpoints: <https://linuxphoneapps.org/apps/noappid.wisperwind.wifi2qr/>
- shopping list (not in nixpkgs): <https://linuxphoneapps.org/apps/ro.hume.cosmin.shoppinglist/> - shopping list (not in nixpkgs): <https://linuxphoneapps.org/apps/ro.hume.cosmin.shoppinglist/>
- offline Wikipedia (or, add to `wike`) - offline Wikipedia (or, add to `wike`)
- offline docs viewer (gtk): <https://github.com/workbenchdev/Biblioteca> - offline docs viewer (gtk): <https://github.com/workbenchdev/Biblioteca>
- some type of games manager/launcher - some type of games manager/launcher
- Gnome Highscore (retro games)?: <https://gitlab.gnome.org/World/highscore> - 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/> - note-taking app: <https://linuxphoneapps.org/categories/note-taking/>
- Folio is nice, uses standard markdown, though it only supports flat repos - Folio is nice, uses standard markdown, though it only supports flat repos
- OSK overlay specifically for mobile gaming - OSK overlay specifically for mobile gaming
@@ -117,27 +122,28 @@
#### moby #### moby
- fix cpuidle (gets better power consumption): <https://xnux.eu/log/077.html> - fix cpuidle (gets better power consumption): <https://xnux.eu/log/077.html>
- fix cpupower for better power/perf
- `journalctl -u cpupower --boot` (problem is present on lappy, at least)
- moby: tune keyboard layout - moby: tune keyboard layout
- SwayNC: - SwayNC: add option to change audio output
- don't show MPRIS if no players detected
- this is a problem of playerctld, i guess
- add option to change audio output
- moby: tune GPS - moby: tune GPS
- fix iio-sensor-proxy magnetometer scaling - fix iio-sensor-proxy magnetometer scaling
- tune QGPS setting in eg25-control, for less jitter? - tune QGPS setting in eg25-control, for less jitter?
- configure geoclue to do some smoothing? - configure geoclue to do some smoothing?
- manually do smoothing, as some layer between mepo and geoclue? - manually do smoothing, as some layer between mepo and geoclue?
- email wigle.net people to unlock API access
- moby: port `freshen-agps` timer service to s6 (maybe i want some `s6-cron` or something) - 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 - moby: improve gPodder launch time
- moby: theme GTK apps (i.e. non-adwaita styles) - moby: theme GTK apps (i.e. non-adwaita styles)
- especially, make the menubar collapsible - especially, make the menubar collapsible
- try Gradience tool specifically for theming adwaita? <https://linuxphoneapps.org/apps/com.github.gradienceteam.gradience/> - try Gradience tool specifically for theming adwaita? <https://linuxphoneapps.org/apps/com.github.gradienceteam.gradience/>
- moby: remove my use of modem-power, since it won't be mainlined (maybe eg25-manager does what i need?)
#### non-moby #### non-moby
- RSS: integrate a paywall bypass - RSS: integrate a paywall bypass
- e.g. self-hosted [ladder](https://github.com/everywall/ladder) (like 12ft.io) - e.g. self-hosted [ladder](https://github.com/everywall/ladder) (like 12ft.io)
- neovim: set up language server (lsp; rnix-lsp; nvim-lspconfig) - RSS: have podcasts get downloaded straight into ~/Videos/...
- and strip the ads out using Whisper transcription + asking a LLM where the ad breaks are
- neovim: integrate LLMs - neovim: integrate LLMs
- Helix: make copy-to-system clipboard be the default - Helix: make copy-to-system clipboard be the default
- firefox/librewolf: persist history - firefox/librewolf: persist history
@@ -149,6 +155,8 @@
- have xdg-open parse `<repo:...> URIs (or adjust them so that it _can_ parse) - 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 - sane-bt-search: show details like 5.1 vs stereo, h264 vs h265
- maybe just color these "keywords" in all search results? - 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) - uninsane.org: make URLs relative to allow local use (and as offline homepage)
- email: fix so that local mail doesn't go to junk - 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 - git sendmail flow adds the DKIM signatures, but gets delivered locally w/o having the sig checked, so goes into Junk

View File

@@ -30,16 +30,4 @@
# sane.programs.guiApps.enableFor.user.colin = false; # sane.programs.guiApps.enableFor.user.colin = false;
# sane.programs.pcGuiApps.enableFor.user.colin = false; #< errors! # sane.programs.pcGuiApps.enableFor.user.colin = false; #< errors!
sane.programs.blueberry.enableFor.user.colin = false; # bluetooth manager: doesn't cross compile!
# sane.programs.brave.enableFor.user.colin = false; # 2024/06/03: fails eval if enabled on cross
# sane.programs.firefox.enableFor.user.colin = false; # 2024/06/03: this triggers an eval error in yarn stuff -- i'm doing IFD somewhere!!?
sane.programs.mepo.enableFor.user.colin = false; # 2024/06/04: doesn't cross compile (nodejs)
sane.programs.mercurial.enableFor.user.colin = false; # 2024/06/03: does not cross compile
sane.programs.nixpkgs-review.enableFor.user.colin = false; # 2024/06/03: OOMs when cross compiling
sane.programs.ntfy-sh.enableFor.user.colin = false; # 2024/06/04: doesn't cross compile (nodejs)
sane.programs.pwvucontrol.enableFor.user.colin = false; # 2024/06/03: doesn't cross compile (libspa-sys)
sane.programs."sane-scripts.bt-search".enableFor.user.colin = false; # 2024/06/03: does not cross compile
sane.programs.sequoia.enableFor.user.colin = false; # 2024/06/03: does not cross compile
sane.programs.zathura.enableFor.user.colin = false; # 2024/06/03: does not cross compile
} }

View File

@@ -1,18 +1,22 @@
{ config, lib, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ imports = [
./fs.nix ./fs.nix
]; ];
sane.services.trust-dns.asSystemResolver = false; # TEMPORARY: TODO: re-enable trust-dns sane.services.hickory-dns.asSystemResolver = false; # TEMPORARY: TODO: re-enable hickory-dns
# sane.programs.devPkgs.enableFor.user.colin = true; # sane.programs.devPkgs.enableFor.user.colin = true;
# sane.guest.enable = true; # sane.guest.enable = true;
# don't enable wifi by default: it messes with connectivity. # don't enable wifi by default: it messes with connectivity.
# systemd.services.iwd.enable = false; # systemd.services.iwd.enable = false;
# networking.wireless.enable = false;
# systemd.services.wpa_supplicant.enable = false; # systemd.services.wpa_supplicant.enable = false;
sane.programs.wpa_supplicant.enableFor.user.colin = lib.mkForce 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.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; sops.secrets.colin-passwd.neededForUsers = true;
@@ -24,36 +28,41 @@
sane.services.wg-home.ip = config.sane.hosts.by-name."desko".wg-home.ip; sane.services.wg-home.ip = config.sane.hosts.by-name."desko".wg-home.ip;
sane.ovpn.addrV4 = "172.26.55.21"; sane.ovpn.addrV4 = "172.26.55.21";
# sane.ovpn.addrV6 = "fd00:0000:1337:cafe:1111:1111:20c1:a73c"; # 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.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.sway.enableFor.user.colin = true;
sane.programs.iphoneUtils.enableFor.user.colin = true; sane.programs.iphoneUtils.enableFor.user.colin = true;
sane.programs.steam.enableFor.user.colin = true; sane.programs.steam.enableFor.user.colin = true;
sane.programs.geary.config.autostart = true;
sane.programs.signal-desktop.config.autostart = true;
sane.programs.nwg-panel.config = { sane.programs.nwg-panel.config = {
battery = false; battery = false;
brightness = false; brightness = false;
}; };
sane.programs.mpv.config.defaultProfile = "high-quality";
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ]; sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
# needed to use libimobiledevice/ifuse, for iphone sync # needed to use libimobiledevice/ifuse, for iphone sync
services.usbmuxd.enable = true; services.usbmuxd.enable = true;
# TODO: enable snapper (need to make `/nix` or `/nix/persist` a subvolume, somehow).
# default config: https://man.archlinux.org/man/snapper-configs.5 # default config: https://man.archlinux.org/man/snapper-configs.5
# defaults to something like: # defaults to something like:
# - hourly snapshots # - hourly snapshots
# - auto cleanup; keep the last 10 hourlies, last 10 daylies, last 10 monthlys. # - auto cleanup; keep the last 10 hourlies, last 10 daylies, last 10 monthlys.
services.snapper.configs.nix = { # to list snapshots: `sudo snapper --config nix list`
# TODO: for the impermanent setup, we'd prefer to just do /nix/persist, # to take a snapshot: `sudo snapper --config nix create`
# but that also requires setting up the persist dir as a subvol # services.snapper.configs.nix = {
SUBVOLUME = "/nix"; # # TODO: for the impermanent setup, we'd prefer to just do /nix/persist,
# TODO: ALLOW_USERS doesn't seem to work. still need `sudo snapper -c nix list` # # but that also requires setting up the persist dir as a subvol
ALLOW_USERS = [ "colin" ]; # SUBVOLUME = "/nix";
}; # # TODO: ALLOW_USERS doesn't seem to work. still need `sudo snapper -c nix list`
# ALLOW_USERS = [ "colin" ];
# };
} }

View File

@@ -15,22 +15,28 @@
# sane.guest.enable = true; # sane.guest.enable = true;
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ]; 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.stepmania.enableFor.user.colin = true;
sane.programs.sway.enableFor.user.colin = true; sane.programs.sway.enableFor.user.colin = true;
sane.programs.geary.config.autostart = true;
sane.programs.signal-desktop.config.autostart = true;
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;
sane.services.rsync-net.enable = true;
# TODO: enable snapper (need to make `/nix` or `/nix/persist` a subvolume, somehow).
# default config: https://man.archlinux.org/man/snapper-configs.5 # default config: https://man.archlinux.org/man/snapper-configs.5
# defaults to something like: # defaults to something like:
# - hourly snapshots # - hourly snapshots
# - auto cleanup; keep the last 10 hourlies, last 10 daylies, last 10 monthlys. # - auto cleanup; keep the last 10 hourlies, last 10 daylies, last 10 monthlys.
services.snapper.configs.nix = { # to list snapshots: `sudo snapper --config nix list`
# TODO: for the impermanent setup, we'd prefer to just do /nix/persist, # to take a snapshot: `sudo snapper --config nix create`
# but that also requires setting up the persist dir as a subvol # services.snapper.configs.nix = {
SUBVOLUME = "/nix"; # # TODO: for the impermanent setup, we'd prefer to just do /nix/persist,
ALLOW_USERS = [ "colin" ]; # # but that also requires setting up the persist dir as a subvol
}; # SUBVOLUME = "/nix";
# # TODO: ALLOW_USERS doesn't seem to work. still need `sudo snapper -c nix list`
# ALLOW_USERS = [ "colin" ];
# };
} }

View File

@@ -6,7 +6,7 @@
# - Mobian wiki: <https://wiki.mobian-project.org/doku.php?id=start> # - Mobian wiki: <https://wiki.mobian-project.org/doku.php?id=start>
# - recommended apps, chatrooms # - recommended apps, chatrooms
{ config, pkgs, lib, ... }: { config, ... }:
{ {
imports = [ imports = [
./fs.nix ./fs.nix
@@ -23,26 +23,24 @@
# XXX colin: phosh doesn't work well with passwordless login, # XXX colin: phosh doesn't work well with passwordless login,
# so set this more reliable default password should anything go wrong # so set this more reliable default password should anything go wrong
users.users.colin.initialPassword = "147147"; users.users.colin.initialPassword = "147147";
# services.getty.autologinUser = "root"; # allows for emergency maintenance?
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;
sane.services.rsync-net.enable = true;
sane.programs.sway.enableFor.user.colin = true; sane.programs.sway.enableFor.user.colin = true;
sane.programs.sway.config.mod = "Mod1"; #< alt key instead of Super 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
sane.programs.nvme-cli.enableFor.system = false; # does not cross compile (libhugetlbfs)
# enabled for easier debugging # enabled for easier debugging
sane.programs.eg25-control.enableFor.user.colin = true; 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.eg25-manager.enableFor.user.colin = true;
# sane.programs.ntfy-sh.config.autostart = true; # sane.programs.ntfy-sh.config.autostart = true;
sane.programs.dino.config.autostart = true; sane.programs.dino.config.autostart = true;
sane.programs.signal-desktop.config.autostart = true; sane.programs.signal-desktop.config.autostart = false;
# sane.programs.geary.config.autostart = true; sane.programs.geary.config.autostart = false;
# sane.programs.calls.config.autostart = true;
sane.programs.pipewire.config = { sane.programs.pipewire.config = {
# tune so Dino doesn't drop audio # tune so Dino doesn't drop audio
@@ -60,6 +58,8 @@
max-quantum = 8192; max-quantum = 8192;
}; };
sane.programs.mpv.config.defaultProfile = "fast";
# /boot space is at a premium. default was 20. # /boot space is at a premium. default was 20.
# even 10 can be too much # even 10 can be too much
boot.loader.generic-extlinux-compatible.configurationLimit = 8; boot.loader.generic-extlinux-compatible.configurationLimit = 8;

View File

@@ -14,14 +14,14 @@
# sane.programs.matrix-synapse.enableFor.user.colin = true; # sane.programs.matrix-synapse.enableFor.user.colin = true;
sane.roles.build-machine.enable = 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 = [ sane.programs.consoleUtils.suggestedPrograms = [
"consoleMediaUtils" # notably, for go2tv / casting "consoleMediaUtils" # notably, for go2tv / casting
"pcConsoleUtils" "pcConsoleUtils"
"sane-scripts.stop-all-servo" "sane-scripts.stop-all-servo"
]; ];
sane.services.dyn-dns.enable = true; sane.services.dyn-dns.enable = true;
sane.services.trust-dns.asSystemResolver = false; # TODO: enable once it's all working well sane.services.hickory-dns.asSystemResolver = false; # TODO: enable once it's all working well
sane.services.wg-home.enable = true; sane.services.wg-home.enable = true;
sane.services.wg-home.visibleToWan = true; sane.services.wg-home.visibleToWan = true;
sane.services.wg-home.forwardToWan = true; sane.services.wg-home.forwardToWan = true;
@@ -31,11 +31,12 @@
# sane.ovpn.addrV6 = "fd00:0000:1337:cafe:1111:1111:8df3:14b0"; # sane.ovpn.addrV6 = "fd00:0000:1337:cafe:1111:1111:8df3:14b0";
sane.nixcache.remote-builders.desko = false; sane.nixcache.remote-builders.desko = false;
sane.nixcache.remote-builders.servo = 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. # automatically log in at the virtual consoles.
# using root here makes sure we always have an escape hatch # using root here makes sure we always have an escape hatch.
services.getty.autologinUser = "root"; # 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 ]; 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 datasets: `zfs list` (will be empty if haven't imported)
# show zfs properties (e.g. compression): `zfs get all pool` # show zfs properties (e.g. compression): `zfs get all pool`
# set zfs properties: `zfs set compression=on pool` # set zfs properties: `zfs set compression=on pool`
{ ... }: { lib, pkgs, ... }:
{ {
# hostId: not used for anything except zfs guardrail? # hostId: not used for anything except zfs guardrail?
@@ -131,6 +131,20 @@
the contents should be a subset of what's in ../media/datasets. 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 # btrfs doesn't easily support swapfiles
# swapDevices = [ # swapDevices = [
# { device = "/nix/persist/swapfile"; size = 4096; } # { device = "/nix/persist/swapfile"; size = 4096; }

View File

@@ -30,6 +30,14 @@ in
config = { config = {
networking.domain = "uninsane.org"; 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.openFirewall = true;
sane.ports.openUpnp = true; sane.ports.openUpnp = true;

View File

@@ -20,6 +20,7 @@ let
bitcoind = pkgs.bitcoind; bitcoind = pkgs.bitcoind;
# wrapper to run bitcoind with the tor onion address as externalip (computed at runtime) # wrapper to run bitcoind with the tor onion address as externalip (computed at runtime)
_bitcoindWithExternalIp = pkgs.writeShellScriptBin "bitcoind" '' _bitcoindWithExternalIp = pkgs.writeShellScriptBin "bitcoind" ''
set -xeu
externalip="$(cat /var/lib/tor/onion/bitcoind/hostname)" externalip="$(cat /var/lib/tor/onion/bitcoind/hostname)"
exec ${bitcoind}/bin/bitcoind "-externalip=$externalip" "$@" exec ${bitcoind}/bin/bitcoind "-externalip=$externalip" "$@"
''; '';
@@ -63,23 +64,62 @@ in
passwordHMAC = "30002c05d82daa210550e17a182db3f3$6071444151281e1aa8a2729f75e3e2d224e9d7cac3974810dab60e7c28ffaae4"; passwordHMAC = "30002c05d82daa210550e17a182db3f3$6071444151281e1aa8a2729f75e3e2d224e9d7cac3974810dab60e7c28ffaae4";
}; };
extraConfig = '' extraConfig = ''
# checkblocks: default 6: how many blocks to verify on start
checkblocks=3
# don't load the wallet, and disable wallet RPC calls # don't load the wallet, and disable wallet RPC calls
disablewallet=1 disablewallet=1
# proxy all outbound traffic through Tor # proxy all outbound traffic through Tor
proxy=127.0.0.1:9050 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" ]; 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" = { sops.secrets."bitcoin.conf" = {
mode = "0600"; mode = "0600";
owner = "colin"; owner = "colin";
group = "users"; 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, ... }: { 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"; } { 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 # see bitcoin.nix for how to generate this
services.bitcoind.mainnet.rpc.users.clightning.passwordHMAC = services.bitcoind.mainnet.rpc.users.clightning.passwordHMAC =
"befcb82d9821049164db5217beb85439$2c31ac7db3124612e43893ae13b9527dbe464ab2d992e814602e7cb07dc28985"; "befcb82d9821049164db5217beb85439$2c31ac7db3124612e43893ae13b9527dbe464ab2d992e814602e7cb07dc28985";
@@ -105,6 +103,7 @@
users.users.clightning.extraGroups = [ "tor" ]; users.users.clightning.extraGroups = [ "tor" ];
systemd.services.clightning.after = [ "tor.service" ]; systemd.services.clightning.after = [ "tor.service" ];
systemd.services.clightning.requires = [ "tor.service" ];
# lightning-config contains fields from here: # lightning-config contains fields from here:
# - <https://docs.corelightning.org/docs/configuration> # - <https://docs.corelightning.org/docs/configuration>
@@ -117,13 +116,15 @@
# - feature configs (i.e. experimental-xyz options) # - feature configs (i.e. experimental-xyz options)
sane.services.clightning.extraConfig = '' sane.services.clightning.extraConfig = ''
# log levels: "io", "debug", "info", "unusual", "broken" # log levels: "io", "debug", "info", "unusual", "broken"
log-level=info:lightningd log-level=info
# log-level=info:lightningd
# log-level=debug:lightningd # log-level=debug:lightningd
# log-level=debug
# peerswap: # peerswap:
# - config example: <https://github.com/fort-nix/nix-bitcoin/pull/462/files#diff-b357d832705b8ce8df1f41934d613f79adb77c4cd5cd9e9eb12a163fca3e16c6> # - config example: <https://github.com/fort-nix/nix-bitcoin/pull/462/files#diff-b357d832705b8ce8df1f41934d613f79adb77c4cd5cd9e9eb12a163fca3e16c6>
# XXX: peerswap crashes clightning on launch. stacktrace is useless. # 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-db-path=/var/lib/clightning/peerswap/swaps
# peerswap-policy-path=... # peerswap-policy-path=...
''; '';
@@ -134,6 +135,5 @@
group = "clightning"; 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:
sane.programs.clightning.packageUnwrapped = config.sane.services.clightning.package;
} }

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; 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. # 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 = [ sane.persist.sys.byStore.ext = [
# /var/lib/monero/lmdb is what consumes most of the space # /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> # tor settings: <https://2019.www.torproject.org/docs/tor-manual.html.en>
{ lib, ... }: { lib, ... }:
{ {
# tor hidden service hostnames aren't deterministic, so persist. sane.persist.sys.byStore.ephemeral = [
# might be able to get away with just persisting /var/lib/tor/onion, not sure. # N.B.: tor hidden service hostnames aren't deterministic, so if you need them
sane.persist.sys.byStore.plaintext = [ # 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"; } { user = "tor"; group = "tor"; mode = "0710"; path = "/var/lib/tor"; method = "bind"; }
]; ];

View File

@@ -7,10 +7,11 @@
./ejabberd.nix ./ejabberd.nix
./freshrss.nix ./freshrss.nix
./export ./export
./hickory-dns.nix
./gitea.nix ./gitea.nix
./goaccess.nix ./goaccess.nix
./ipfs.nix ./ipfs.nix
./jackett.nix ./jackett
./jellyfin.nix ./jellyfin.nix
./kiwix-serve.nix ./kiwix-serve.nix
./komga.nix ./komga.nix
@@ -20,13 +21,13 @@
./nginx.nix ./nginx.nix
./nixos-prebuild.nix ./nixos-prebuild.nix
./ntfy ./ntfy
./ollama.nix
./pict-rs.nix ./pict-rs.nix
./pleroma.nix ./pleroma.nix
./postgres.nix ./postgres.nix
./prosody ./prosody
./slskd.nix ./slskd.nix
./transmission ./transmission
./trust-dns.nix
./wikipedia.nix ./wikipedia.nix
]; ];
} }

View File

@@ -44,7 +44,7 @@ in
# everything configured below was fine: used ejabberd for several months. # everything configured below was fine: used ejabberd for several months.
lib.mkIf false lib.mkIf false
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.private = [
{ user = "ejabberd"; group = "ejabberd"; path = "/var/lib/ejabberd"; method = "bind"; } { user = "ejabberd"; group = "ejabberd"; path = "/var/lib/ejabberd"; method = "bind"; }
]; ];
sane.ports.ports = lib.mkMerge ([ sane.ports.ports = lib.mkMerge ([

View File

@@ -83,8 +83,8 @@
# sieve_plugins = sieve_imapsieve # sieve_plugins = sieve_imapsieve
# } # }
mail_debug = yes # mail_debug = yes
auth_debug = yes # auth_debug = yes
# verbose_ssl = yes # verbose_ssl = yes
''; '';

View File

@@ -1,4 +1,11 @@
# postfix config options: <https://www.postfix.org/postconf.5.html> # postfix config options: <https://www.postfix.org/postconf.5.html>
# config files:
# - /etc/postfix/main.cf
# - /etc/postfix/master.cf
#
# logs:
# - postfix logs directly to *syslog*,
# so check e.g. ~/.local/share/rsyslog
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
@@ -18,14 +25,14 @@ let
}; };
in in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.private = [
# TODO: mode? could be more granular # TODO: mode? could be more granular
{ user = "opendkim"; group = "opendkim"; path = "/var/lib/opendkim"; method = "bind"; } { user = "opendkim"; group = "opendkim"; path = "/var/lib/opendkim"; method = "bind"; } #< TODO: migrate to secrets
{ user = "root"; group = "root"; path = "/var/lib/postfix"; method = "bind"; }
{ user = "root"; group = "root"; path = "/var/spool/mail"; method = "bind"; } { user = "root"; group = "root"; path = "/var/spool/mail"; method = "bind"; }
# *probably* don't need these dirs: # *probably* don't need these dirs:
# "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix # "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix
# "/var/lib/dovecot" # "/var/lib/dovecot"
# "/var/lib/postfix"
]; ];
# XXX(2023/10/20): opening these ports in the firewall has the OPPOSITE effect as intended. # XXX(2023/10/20): opening these ports in the firewall has the OPPOSITE effect as intended.
@@ -95,6 +102,7 @@ in
services.postfix.sslCert = "/var/lib/acme/mx.uninsane.org/fullchain.pem"; services.postfix.sslCert = "/var/lib/acme/mx.uninsane.org/fullchain.pem";
services.postfix.sslKey = "/var/lib/acme/mx.uninsane.org/key.pem"; services.postfix.sslKey = "/var/lib/acme/mx.uninsane.org/key.pem";
# see: `man 5 virtual`
services.postfix.virtual = '' services.postfix.virtual = ''
notify.matrix@uninsane.org matrix-synapse notify.matrix@uninsane.org matrix-synapse
@uninsane.org colin @uninsane.org colin
@@ -135,6 +143,20 @@ in
# smtpd_sender_restrictions = reject_unknown_sender_domain # smtpd_sender_restrictions = reject_unknown_sender_domain
}; };
# debugging options:
# services.postfix.masterConfig = {
# "proxymap".args = [ "-v" ];
# "proxywrite".args = [ "-v" ];
# "relay".args = [ "-v" ];
# "smtp".args = [ "-v" ];
# "smtp_inet".args = [ "-v" ];
# "submission".args = [ "-v" ];
# "submissions".args = [ "-v" ];
# "submissions".chroot = false;
# "submissions".private = false;
# "submissions".privileged = true;
# };
services.postfix.enableSubmission = true; services.postfix.enableSubmission = true;
services.postfix.submissionOptions = submissionOptions; services.postfix.submissionOptions = submissionOptions;
services.postfix.enableSubmissions = true; services.postfix.enableSubmissions = true;
@@ -142,6 +164,10 @@ in
systemd.services.postfix.after = [ "wireguard-wg-ovpns.service" ]; systemd.services.postfix.after = [ "wireguard-wg-ovpns.service" ];
systemd.services.postfix.partOf = [ "wireguard-wg-ovpns.service" ]; systemd.services.postfix.partOf = [ "wireguard-wg-ovpns.service" ];
systemd.services.postfix.unitConfig.RequiresMountsFor = [
"/var/spool/mail" # spooky errors when postfix is run w/o this: `warning: connect #1 to subsystem private/proxymap: Connection refused`
"/var/lib/opendkim"
];
systemd.services.postfix.serviceConfig = { systemd.services.postfix.serviceConfig = {
# run this behind the OVPN static VPN # run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns"; NetworkNamespacePath = "/run/netns/ovpns";
@@ -175,23 +201,30 @@ in
#### OUTGOING MESSAGE REWRITING: #### OUTGOING MESSAGE REWRITING:
services.postfix.enableHeaderChecks = true; # - `man 5 header_checks`
services.postfix.headerChecks = [ # - <https://www.postfix.org/header_checks.5.html>
# intercept gitea registration confirmations and manually screen them # - populates `/var/lib/postfix/conf/header_checks`
{ # XXX(2024-08-06): registration gating via email matches is AWFUL:
# headerChecks are somehow ignorant of alias rules: have to redirect to a real user # 1. bypassed if the service offers localization.
action = "REDIRECT colin@uninsane.org"; # 2. if i try to forward the registration request, it may match the filter again and get sent back to my inbox.
pattern = "/^Subject: Please activate your account/"; # 3. header checks are possibly under-used in the ecosystem, and may break postfix config.
} # services.postfix.enableHeaderChecks = true;
# intercept Matrix registration confirmations # services.postfix.headerChecks = [
{ # # intercept gitea registration confirmations and manually screen them
action = "REDIRECT colin@uninsane.org";
pattern = "/^Subject:.*Validate your email/";
}
# XXX postfix only supports performing ONE action per header.
# { # {
# action = "REPLACE Subject: git application: Please activate your account"; # # headerChecks are somehow ignorant of alias rules: have to redirect to a real user
# pattern = "/^Subject:.*activate your account/"; # action = "REDIRECT colin@uninsane.org";
# pattern = "/^Subject: Please activate your account/";
# } # }
]; # # intercept Matrix registration confirmations
# {
# action = "REDIRECT colin@uninsane.org";
# pattern = "/^Subject:.*Validate your email/";
# }
# # XXX postfix only supports performing ONE action per header.
# # {
# # action = "REPLACE Subject: git application: Please activate your account";
# # pattern = "/^Subject:.*activate your account/";
# # }
# ];
} }

View File

@@ -12,10 +12,6 @@
device = "/var/media"; device = "/var/media";
options = [ "rbind" ]; options = [ "rbind" ];
}; };
fileSystems."/var/export/pub" = {
device = "/var/www/sites/uninsane.org/share";
options = [ "rbind" ];
};
# fileSystems."/var/export/playground" = { # fileSystems."/var/export/playground" = {
# device = config.fileSystems."/mnt/persist/ext".device; # device = config.fileSystems."/mnt/persist/ext".device;
# fsType = "btrfs"; # fsType = "btrfs";
@@ -41,18 +37,25 @@
wantedBy = [ "nfs.service" "sftpgo.service" ]; wantedBy = [ "nfs.service" "sftpgo.service" ];
file.text = '' file.text = ''
- media/ read-only: Videos, Music, Books, etc - media/ read-only: Videos, Music, Books, etc
- playground/ read-write: use it to share files with other users of this server, inaccessible from the www - 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 *if you can't write to it, make sure you're connected to the WiFi and not mobile.
''; '';
}; };
sane.fs."/var/export/playground/README.md" = { sane.fs."/var/export/playground/README.md" = {
wantedBy = [ "nfs.service" "sftpgo.service" ]; wantedBy = [ "nfs.service" "sftpgo.service" ];
file.text = '' file.text = ''
this directory is intentionally read+write by anyone with access (i.e. on the LAN). this directory is intentionally read+write by anyone with access.
- share files - share files
- write poetry - write poetry
- be a friendly troll - 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

@@ -80,12 +80,6 @@ in
port = 21; port = 21;
debug = true; 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 # binding this means any wireguard client can connect
address = "10.0.10.5"; address = "10.0.10.5";
@@ -93,6 +87,12 @@ in
debug = true; debug = true;
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command. tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
} }
{
# 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) # binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
address = "10.78.79.51"; address = "10.78.79.51";
@@ -107,6 +107,13 @@ in
debug = true; debug = true;
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command. 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.
}
]; ];
# active mode is susceptible to "bounce attacks", without much benefit over passive mode # active mode is susceptible to "bounce attacks", without much benefit over passive mode

View File

@@ -71,6 +71,9 @@ TRUSTED_CREDS = [
# $<method>$<salt>$<hash> # $<method>$<salt>$<hash>
"$6$Zq3c2u4ghUH4S6EP$pOuRt13sEKfX31OqPbbd1LuhS21C9MICMc94iRdTAgdAcJ9h95gQH/6Jf6Ie4Obb0oxQtojRJ1Pd/9QHOlFMW." #< m. rocket boy "$6$Zq3c2u4ghUH4S6EP$pOuRt13sEKfX31OqPbbd1LuhS21C9MICMc94iRdTAgdAcJ9h95gQH/6Jf6Ie4Obb0oxQtojRJ1Pd/9QHOlFMW." #< m. rocket boy
] ]
TRUSTED_VIEWING_OR_PLAYGROUND_CREDS = [
"$6$iikDajz5b.YH1.on$tfSzzBEtX8IeDiJJXCasOTxRTd7cFDKXU6dhlWYVhK6xDeJhV2fh6bmm1WIHItjIth9Eh9zNgUB8xibMIWCm/."
];
def mkAuthOk(username: str, permissions: dict[str, list[str]]) -> dict: def mkAuthOk(username: str, permissions: dict[str, list[str]]) -> dict:
return dict( return dict(
@@ -112,8 +115,8 @@ def isLan(ip: str) -> bool:
def isWireguard(ip: str) -> bool: def isWireguard(ip: str) -> bool:
return ip.startswith("10.0.10.") return ip.startswith("10.0.10.")
def isTrustedCred(password: str) -> bool: def isTrustedCred(password: str, credlist: list[str] = TRUSTED_CREDS) -> bool:
for cred in TRUSTED_CREDS: for cred in credlist:
if passlib.hosts.linux_context.verify(password, cred): if passlib.hosts.linux_context.verify(password, cred):
return True return True
@@ -129,14 +132,29 @@ def getAuthResponse(ip: str, username: str, password: str) -> dict:
return mkAuthOk(username, permissions = { return mkAuthOk(username, permissions = {
"/": PERM_RW, "/": PERM_RW,
"/playground": PERM_RW, "/playground": PERM_RW,
"/pub": PERM_RO, "/.public_for_test": PERM_RO,
})
if isTrustedCred(password, TRUSTED_VIEWING_OR_PLAYGROUND_CREDS) and username != "colin":
return mkAuthOk(username, permissions = {
# error prone, but... not the worst if i miss something
"/": PERM_LIST,
"/media/archive": PERM_DENY,
"/media/Books": PERM_RO,
"/media/collections": PERM_DENY,
"/media/games": PERM_RO,
"/media/Music": PERM_RO,
"/media/Pictures": PERM_RO,
"/media/torrents": PERM_DENY,
"/media/Videos": PERM_RO,
"/playground": PERM_RW,
"/.public_for_test": PERM_RO,
}) })
if isWireguard(ip): if isWireguard(ip):
# allow any user from wireguard # allow any user from wireguard
return mkAuthOk(username, permissions = { return mkAuthOk(username, permissions = {
"/": PERM_RW, "/": PERM_RW,
"/playground": PERM_RW, "/playground": PERM_RW,
"/pub": PERM_RO, "/.public_for_test": PERM_RO,
}) })
if isLan(ip): if isLan(ip):
if username == "anonymous": if username == "anonymous":
@@ -144,7 +162,7 @@ def getAuthResponse(ip: str, username: str, password: str) -> dict:
return mkAuthOk("anonymous", permissions = { return mkAuthOk("anonymous", permissions = {
"/": PERM_RO, "/": PERM_RO,
"/playground": PERM_RW, "/playground": PERM_RW,
"/pub": PERM_RO, "/.public_for_test": PERM_RO,
}) })
if username == "anonymous": if username == "anonymous":
# anonymous users from the www can have even more limited access. # anonymous users from the www can have even more limited access.
@@ -154,7 +172,7 @@ def getAuthResponse(ip: str, username: str, password: str) -> dict:
"/": PERM_LIST, #< REQUIRED, even for lftp to list a subdir "/": PERM_LIST, #< REQUIRED, even for lftp to list a subdir
"/media": PERM_DENY, "/media": PERM_DENY,
"/playground": PERM_DENY, "/playground": PERM_DENY,
"/pub": PERM_RO, "/.public_for_test": PERM_RO,
# "/README.md": PERM_RO, #< does not work # "/README.md": PERM_RO, #< does not work
}) })

View File

@@ -1,11 +1,14 @@
# config options: <https://docs.gitea.io/en-us/administration/config-cheat-sheet/> # config options: <https://docs.gitea.io/en-us/administration/config-cheat-sheet/>
# TODO: service shouldn't run as `git` user, but as `gitea`
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.private = [
# TODO: mode? could be more granular { user = "git"; group = "gitea"; mode = "0750"; path = "/var/lib/gitea"; method = "bind"; }
{ user = "git"; group = "gitea"; path = "/var/lib/gitea"; method = "bind"; }
]; ];
sane.programs.gitea.enableFor.user.colin = true; # for admin, and monitoring
services.gitea.enable = true; services.gitea.enable = true;
services.gitea.user = "git"; # default is 'gitea' services.gitea.user = "git"; # default is 'gitea'
services.gitea.database.type = "postgres"; services.gitea.database.type = "postgres";
@@ -41,14 +44,21 @@
# timeout for email approval. 5760 = 4 days. 10080 = 7 days # timeout for email approval. 5760 = 4 days. 10080 = 7 days
ACTIVE_CODE_LIVE_MINUTES = 10080; ACTIVE_CODE_LIVE_MINUTES = 10080;
# REGISTER_EMAIL_CONFIRM = false; # REGISTER_EMAIL_CONFIRM = false;
# REGISTER_MANUAL_CONFIRM = true; # REGISTER_EMAIL_CONFIRM = true; #< override REGISTER_MANUAL_CONFIRM
REGISTER_EMAIL_CONFIRM = true; REGISTER_MANUAL_CONFIRM = true;
# not sure what this notifies *on*... # not sure what this notifies *on*...
ENABLE_NOTIFY_MAIL = true; ENABLE_NOTIFY_MAIL = true;
# defaults to image-based captcha. # defaults to image-based captcha.
# also supports recaptcha (with custom URLs) or hCaptcha. # also supports recaptcha (with custom URLs) or hCaptcha.
ENABLE_CAPTCHA = true; ENABLE_CAPTCHA = true;
NOREPLY_ADDRESS = "noreply.anonymous.git@uninsane.org"; NOREPLY_ADDRESS = "noreply.anonymous.git@uninsane.org";
EMAIL_DOMAIN_BLOCKLIST = lib.concatStringsSep ", " [
"*.claychoen.top"
"*.gemmasmith.co.uk"
"*.jenniferlawrence.uk"
"*.sarahconnor.co.uk"
"*.marymarshall.co.uk"
];
}; };
session = { session = {
COOKIE_SECURE = true; COOKIE_SECURE = true;
@@ -109,6 +119,10 @@
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:3000"; 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. # 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). # 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" = { locations."~ ^/colin/phone-case-cq/raw/.*.html" = {

View File

@@ -48,16 +48,14 @@ in
# so, org. can specify ns2/ns3 as being to the VPN, with no mention of ns1. we provide ns1 here. # so, org. can specify ns2/ns3 as being to the VPN, with no mention of ns1. we provide ns1 here.
A."ns1" = "%ANATIVE%"; A."ns1" = "%ANATIVE%";
A."ns2" = "%ADOOF%"; A."ns2" = "%ADOOF%";
A."ns3" = "%AOVPNS%";
A."ovpns" = "%AOVPNS%"; A."ovpns" = "%AOVPNS%";
NS."@" = [ NS."@" = [
"ns1.uninsane.org." "ns1.uninsane.org."
"ns2.uninsane.org." "ns2.uninsane.org."
"ns3.uninsane.org."
]; ];
}; };
services.trust-dns.settings.zones = [ "uninsane.org" ]; services.hickory-dns.settings.zones = [ "uninsane.org" ];
networking.nat.enable = true; #< TODO: try removing this? networking.nat.enable = true; #< TODO: try removing this?
@@ -85,8 +83,8 @@ in
# }; # };
sane.services.trust-dns.enable = true; sane.services.hickory-dns.enable = true;
sane.services.trust-dns.instances = let sane.services.hickory-dns.instances = let
mkSubstitutions = flavor: { mkSubstitutions = flavor: {
"%ADOOF%" = config.sane.netns.doof.netnsPubIpv4; "%ADOOF%" = config.sane.netns.doof.netnsPubIpv4;
"%ANATIVE%" = nativeAddrs."servo.${flavor}"; "%ANATIVE%" = nativeAddrs."servo.${flavor}";
@@ -100,7 +98,9 @@ in
substitutions = mkSubstitutions "doof"; substitutions = mkSubstitutions "doof";
listenAddrsIpv4 = [ listenAddrsIpv4 = [
config.sane.netns.doof.hostVethIpv4 config.sane.netns.doof.hostVethIpv4
config.sane.netns.ovpns.hostVethIpv4 config.sane.netns.doof.netnsPubIpv4
nativeAddrs."servo.lan"
# config.sane.netns.ovpns.hostVethIpv4
]; ];
}; };
hn = { hn = {
@@ -128,11 +128,11 @@ in
# ]; # ];
# }; # };
}; };
lan = { # lan = {
substitutions = mkSubstitutions "lan"; # substitutions = mkSubstitutions "lan";
listenAddrsIpv4 = [ nativeAddrs."servo.lan" ]; # listenAddrsIpv4 = [ nativeAddrs."servo.lan" ];
# port = 1053; # # port = 1053;
}; # };
# wan = { # wan = {
# substitutions = mkSubstitutions "wan"; # substitutions = mkSubstitutions "wan";
# listenAddrsIpv4 = [ # listenAddrsIpv4 = [
@@ -141,10 +141,5 @@ in
# }; # };
}; };
sane.services.dyn-dns.restartOnChange = [ sane.services.dyn-dns.restartOnChange = lib.map (c: "${c.service}.service") (builtins.attrValues config.sane.services.hickory-dns.instances);
"trust-dns-doof.service"
"trust-dns-hn.service"
"trust-dns-lan.service"
# "trust-dns-wan.service"
];
} }

View File

@@ -10,7 +10,7 @@
lib.mkIf false # i don't actively use ipfs anymore 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 # TODO: mode? could be more granular
{ user = "261"; group = "261"; path = "/var/lib/ipfs"; method = "bind"; } { user = "261"; group = "261"; path = "/var/lib/ipfs"; method = "bind"; }
]; ];

View File

@@ -1,34 +0,0 @@
{ config, lib, pkgs, ... }:
{
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 ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # 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://${config.sane.netns.ovpns.netnsVethIpv4}: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; enableACME = true;
# inherit kTLS; # inherit kTLS;
locations."/".proxyPass = "http://127.0.0.1:8013"; 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"; sane.dns.zones."uninsane.org".inet.CNAME."w" = "native";

View File

@@ -17,6 +17,9 @@ in
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString port}"; 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"; sane.dns.zones."uninsane.org".inet.CNAME."komga" = "native";
} }

View File

@@ -38,15 +38,10 @@ in {
nginx.enable = true; 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 = { systemd.services.lemmy.environment = {
RUST_BACKTRACE = "full"; RUST_BACKTRACE = "full";
RUST_LOG = "warn"; RUST_LOG = "error";
# RUST_LOG = "warn";
# RUST_LOG = "debug"; # RUST_LOG = "debug";
# RUST_LOG = "trace"; # RUST_LOG = "trace";
# upstream defaults LEMMY_DATABASE_URL = "postgres:///lemmy?host=/run/postgresql"; # upstream defaults LEMMY_DATABASE_URL = "postgres:///lemmy?host=/run/postgresql";
@@ -73,6 +68,73 @@ in {
sane.dns.zones."uninsane.org".inet.CNAME."lemmy" = "native"; 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. #v DO NOT REMOVE: defaults to 0.3, instead of latest, so always need to explicitly set this.
services.pict-rs.package = pict-rs; services.pict-rs.package = pict-rs;
@@ -82,10 +144,38 @@ in {
# - via CLI flags (overrides everything above) # - 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. # 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> # 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" "${lib.getBin pict-rs}/bin/pict-rs run"
"--media-video-max-frame-count" (builtins.toString (30*60*60)) "--media-video-max-frame-count" (builtins.toString (30*60*60))
"--media-process-timeout 120" "--media-process-timeout 120"
"--media-video-allow-audio" # allow audio "--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

@@ -11,7 +11,7 @@
# - `curl --header "Authorization: Bearer <your_access_token>" --data '{ "app_display_name": "<topic>", "app_id": "ntfy.uninsane.org", "data": { "url": "https://ntfy.uninsane.org/_matrix/push/v1/notify", "format": "event_id_only" }, "device_display_name": "<topic>", "kind": "http", "lang": "en-US", "profile_tag": "", "pushkey": "<topic>" }' localhost:8008/_matrix/client/v3/pushers/set` # - `curl --header "Authorization: Bearer <your_access_token>" --data '{ "app_display_name": "<topic>", "app_id": "ntfy.uninsane.org", "data": { "url": "https://ntfy.uninsane.org/_matrix/push/v1/notify", "format": "event_id_only" }, "device_display_name": "<topic>", "kind": "http", "lang": "en-US", "profile_tag": "", "pushkey": "<topic>" }' localhost:8008/_matrix/client/v3/pushers/set`
# - delete a notification destination by setting `kind` to `null` (otherwise, request is identical to above) # - delete a notification destination by setting `kind` to `null` (otherwise, request is identical to above)
# #
{ config, lib, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ imports = [
@@ -20,17 +20,17 @@
./signal.nix ./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"; } { user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/matrix-synapse"; method = "bind"; }
]; ];
services.matrix-synapse.enable = true; services.matrix-synapse.enable = true;
services.matrix-synapse.log.root.level = "WARNING"; # accepts "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" (?) services.matrix-synapse.log.root.level = "ERROR"; # accepts "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" (?)
services.matrix-synapse.settings = { services.matrix-synapse.settings = {
server_name = "uninsane.org"; server_name = "uninsane.org";
# services.matrix-synapse.enable_registration_captcha = true; # services.matrix-synapse.enable_registration_captcha = true;
# services.matrix-synapse.enable_registration_without_verification = true; # services.matrix-synapse.enable_registration_without_verification = true;
enable_registration = true; # enable_registration = true;
# services.matrix-synapse.registration_shared_secret = "<shared key goes here>"; # services.matrix-synapse.registration_shared_secret = "<shared key goes here>";
# default for listeners is port = 8448, tls = true, x_forwarded = false. # default for listeners is port = 8448, tls = true, x_forwarded = false.

View File

@@ -5,7 +5,7 @@
# - recommended to use mautrix-discord: <https://github.com/NixOS/nixpkgs/pull/200462> # - recommended to use mautrix-discord: <https://github.com/NixOS/nixpkgs/pull/200462>
lib.mkIf false 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"; } { user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/mx-puppet-discord"; method = "bind"; }
]; ];

View File

@@ -1,6 +1,6 @@
# config docs: # config docs:
# - <https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml> # - <https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml>
{ config, lib, ... }: { lib, ... }:
let let
ircServer = { name, additionalAddresses ? [], ssl ? true, sasl ? true, port ? if ssl then 6697 else 6667 }: let ircServer = { name, additionalAddresses ? [], ssl ? true, sasl ? true, port ? if ssl then 6697 else 6667 }: let
@@ -99,7 +99,7 @@ in
}) })
]; ];
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.private = [
# TODO: mode? # TODO: mode?
{ user = "matrix-appservice-irc"; group = "matrix-appservice-irc"; path = "/var/lib/matrix-appservice-irc"; method = "bind"; } { user = "matrix-appservice-irc"; group = "matrix-appservice-irc"; path = "/var/lib/matrix-appservice-irc"; method = "bind"; }
]; ];
@@ -128,6 +128,7 @@ in
ircService = { ircService = {
logging.level = "warn"; # "error", "warn", "info", "debug" logging.level = "warn"; # "error", "warn", "info", "debug"
mediaProxy.publicUrl = "https://irc.matrix.uninsane.org/media";
servers = { servers = {
"irc.esper.net" = ircServer { "irc.esper.net" = ircServer {
name = "esper"; name = "esper";
@@ -168,4 +169,16 @@ in
# the service actively uses at least one of these, and both of them are fairly innocuous # the service actively uses at least one of these, and both of them are fairly innocuous
SystemCallFilter = lib.mkForce "~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io @setuid @swap"; SystemCallFilter = lib.mkForce "~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io @setuid @swap";
}; };
services.nginx.virtualHosts."irc.matrix.uninsane.org" = {
forceSSL = true;
enableACME = true;
locations."/media" = {
proxyPass = "http://127.0.0.1:11111";
};
};
sane.dns.zones."uninsane.org".inet = {
CNAME."irc.matrix" = "native";
};
} }

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 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 = "mautrix-signal"; group = "mautrix-signal"; path = "/var/lib/mautrix-signal"; method = "bind"; }
{ user = "signald"; group = "signald"; path = "/var/lib/signald"; method = "bind"; } { user = "signald"; group = "signald"; path = "/var/lib/signald"; method = "bind"; }
]; ];

View File

@@ -29,6 +29,12 @@ in
}; };
services.nginx.enable = true; 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 = '' services.nginx.appendConfig = ''
# use 1 process per core. # use 1 process per core.
# may want to increase worker_connections too, but `ulimit -n` must be increased first. # may want to increase worker_connections too, but `ulimit -n` must be increased first.
@@ -44,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"'; 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; 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; 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) # 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> # - doesn't seem to, actually: <https://www.ssllabs.com/ssltest/analyze.html?d=uninsane.org>
# caches TLS sessions for 10m # caches TLS sessions for 10m
@@ -99,6 +107,16 @@ in
disable_symlinks on; 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 # allow matrix users to discover that @user:uninsane.org is reachable via matrix.uninsane.org
locations."= /.well-known/matrix/server".extraConfig = locations."= /.well-known/matrix/server".extraConfig =
@@ -180,8 +198,15 @@ in
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "acme"; group = "acme"; path = "/var/lib/acme"; method = "bind"; } { 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"; } { 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: # let's encrypt default chain looks like:
# - End-entity certificate ← R3 ← ISRG Root X1 ← DST Root CA X3 # - End-entity certificate ← R3 ← ISRG Root X1 ← DST Root CA X3

View File

@@ -30,7 +30,7 @@ let
altPort = 2587; altPort = 2587;
in 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 # not 100% necessary to persist this, but ntfy does keep a 12hr (by default) cache
# for pushing notifications to users who become offline. # for pushing notifications to users who become offline.
# ACLs also live here. # ACLs also live here.
@@ -46,7 +46,7 @@ in
# defaults to 45s. # defaults to 45s.
# note that the client may still do its own TCP-level keepalives, typically every 30s # note that the client may still do its own TCP-level keepalives, typically every 30s
keepalive-interval = "15m"; 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"; auth-default-access = "deny-all";
}; };
systemd.services.ntfy-sh.serviceConfig.DynamicUser = lib.mkForce false; systemd.services.ntfy-sh.serviceConfig.DynamicUser = lib.mkForce false;

View File

@@ -0,0 +1,23 @@
# ollama: <https://github.com/ollama/ollama>
# use: `ollama run llama3.1`
# or: `ollama run llama3.1:70b`
# or use a remote session: <https://github.com/ggozad/oterm>
{ lib, ... }:
lib.mkIf false #< WIP
{
sane.persist.sys.byStore.plaintext = [
{ user = "ollama"; group = "ollama"; path = "/var/lib/ollama"; method = "bind"; }
];
services.ollama.enable = true;
services.ollama.user = "ollama";
services.ollama.group = "ollama";
users.groups.ollama = {};
users.users.ollama = {
group = "ollama";
isSystemUser = true;
};
systemd.services.ollama.serviceConfig.DynamicUser = lib.mkForce false;
}

View File

@@ -7,14 +7,15 @@
# to run it in a oci-container: <https://github.com/barrucadu/nixfiles/blob/master/services/pleroma.nix> # 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> # admin frontend: <https://fed.uninsane.org/pleroma/admin>
{ config, pkgs, ... }: { config, lib, pkgs, ... }:
let let
logLevel = "warn"; logLevel = "warn";
# logLevel = "debug"; # logLevel = "debug";
in 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"; } { user = "pleroma"; group = "pleroma"; path = "/var/lib/pleroma"; method = "bind"; }
]; ];
services.pleroma.enable = true; 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 # something inside pleroma invokes `sh` w/o specifying it by path, so this is needed to allow pleroma to start
pkgs.bash pkgs.bash
# used by Pleroma to strip geo tags from uploads # 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 # 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 # needed for email operations like password reset
pkgs.postfix 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 # postgres can be slow to service early requests, preventing pleroma from starting on the first try
Restart = "on-failure"; serviceConfig.Restart = "on-failure";
RestartSec = "10s"; serviceConfig.RestartSec = "10s";
};
# systemd.services.pleroma.serviceConfig = { # hardening (systemd-analyze security pleroma)
# # required for sendmail. see https://git.pleroma.social/pleroma/pleroma/-/issues/2259 # XXX(2024-07-28): this hasn't been rigorously tested:
# NoNewPrivileges = lib.mkForce false; # possible that i've set something too strict and won't notice right away
# PrivateTmp = lib.mkForce false; # make sure to test:
# CapabilityBoundingSet = lib.mkForce "~"; # - 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. # 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. # 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; KiB = n: 1024*n;
in in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.private = [
# TODO: mode? { user = "postgres"; group = "postgres"; mode = "0750"; path = "/var/lib/postgresql"; method = "bind"; }
{ user = "postgres"; group = "postgres"; path = "/var/lib/postgresql"; method = "bind"; } { user = "postgres"; group = "postgres"; mode = "0750"; path = "/var/backup/postgresql"; method = "bind"; }
]; ];
services.postgresql.enable = true; services.postgresql.enable = true;

View File

@@ -56,7 +56,8 @@ let
enableDebug = false; enableDebug = false;
in in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.private = [
# TODO: mode?
{ user = "prosody"; group = "prosody"; path = "/var/lib/prosody"; method = "bind"; } { user = "prosody"; group = "prosody"; path = "/var/lib/prosody"; method = "bind"; }
]; ];
sane.ports.ports."5000" = { sane.ports.ports."5000" = {

View File

@@ -10,7 +10,9 @@
{ config, lib, pkgs, ... }: { 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"; } { user = "slskd"; group = "media"; path = "/var/lib/slskd"; method = "bind"; }
]; ];
sops.secrets."slskd_env" = { sops.secrets."slskd_env" = {
@@ -68,12 +70,20 @@
# flags.volatile = true; # store searches and active transfers in RAM (completed transfers still go to disk). rec for btrfs/zfs # 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 # run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns"; serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # abort if public IP is not as expected 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 serviceConfig.Restart = lib.mkForce "always"; # exits "success" when it fails to connect to soulseek server
RestartSec = "60s"; 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

@@ -31,14 +31,14 @@ let
"coreutils" "coreutils"
"findutils" "findutils"
"rsync" "rsync"
"util-linux"
]; ];
}; };
in in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.private = [
# TODO: mode? we need this specifically for the stats tracking in .config/ # 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/lib/transmission"; method = "bind"; }
{ user = "transmission"; group = config.users.users.transmission.group; path = "/var/backup/torrents"; method = "bind"; }
]; ];
users.users.transmission.extraGroups = [ "media" ]; users.users.transmission.extraGroups = [ "media" ];
@@ -107,16 +107,31 @@ in
script-torrent-done-filename = "${torrent-done}/bin/torrent-done"; script-torrent-done-filename = "${torrent-done}/bin/torrent-done";
}; };
systemd.services.transmission.after = [ "wireguard-wg-ovpns.service" ]; systemd.services.transmission = {
systemd.services.transmission.partOf = [ "wireguard-wg-ovpns.service" ]; after = [ "wireguard-wg-ovpns.service" ];
systemd.services.transmission.serviceConfig = { partOf = [ "wireguard-wg-ovpns.service" ];
environment.TR_DEBUG = "1";
# run this behind the OVPN static VPN # run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns"; serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # abort if public IP is not as expected 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"; serviceConfig.Restart = "on-failure";
RestartSec = "30s"; serviceConfig.RestartSec = "30s";
BindPaths = [ "/var/media" ]; #< so it can move completed torrents into the media library 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 # service to automatically backup torrents i add to transmission

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p acl -p bash -p coreutils -p findutils -p rsync -p util-linux #!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: # 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. # - TR_TORRENT_DIR: full path to the folder i told transmission to download it to.
@@ -7,7 +7,6 @@
# optionally: # optionally:
# - TR_DRY_RUN=1 # - TR_DRY_RUN=1
# - TR_DEBUG=1 # - TR_DEBUG=1
# - TR_NO_HARDLINK=1
DOWNLOAD_DIR=/var/media/torrents DOWNLOAD_DIR=/var/media/torrents
@@ -41,10 +40,11 @@ REL_DIR="${TR_TORRENT_DIR#$DOWNLOAD_DIR/}"
MEDIA_DIR="/var/media/$REL_DIR" MEDIA_DIR="/var/media/$REL_DIR"
destructive mkdir -p "$(dirname "$MEDIA_DIR")" destructive mkdir -p "$(dirname "$MEDIA_DIR")"
destructive rsync -arv "$TR_TORRENT_DIR/" "$MEDIA_DIR/" destructive rsync -rlv "$TR_TORRENT_DIR/" "$MEDIA_DIR/"
# make the media rwx by anyone in the group # 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 setfacl --recursive --modify d:g::rwx,o::rx {} \;
destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \; destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \;
destructive find "$MEDIA_DIR" -type f -exec chmod g+rw,a+r {} \;
# if there's a single directory inside the media dir, then inline that # if there's a single directory inside the media dir, then inline that
subdirs=("$MEDIA_DIR"/*) subdirs=("$MEDIA_DIR"/*)
@@ -58,19 +58,13 @@ if [ ${#subdirs[@]} -eq 1 ]; then
fi fi
# remove noisy files: # remove noisy files:
# -iname means "insensitive", but the syntax is NOT regex -- more similar to shell matching
destructive find "$MEDIA_DIR/" -type f \(\ destructive find "$MEDIA_DIR/" -type f \(\
-iname '.*downloaded.?from.*' \ -iname '*downloaded?from*' \
-o -iname 'source.txt' \ -o -iname 'source.txt' \
-o -iname 'upcoming.?releases.*' \ -o -iname '*upcoming?releases*' \
-o -iname 'www.YTS.*.jpg' \ -o -iname 'www.YTS*.jpg' \
-o -iname 'WWW.YIFY*.COM.jpg' \ -o -iname 'WWW.YIFY*.COM.jpg' \
-o -iname 'YIFY*.com.txt' \ -o -iname 'YIFY*.com.txt' \
-o -iname 'YTS*.com.txt' \ -o -iname 'YTS*.com.txt' \
\) -exec rm {} \; \) -exec rm {} \;
if ! [ -n "${TR_NO_HARDLINK}" ]; then
# dedupe the whole media library.
# yeah, a bit excessive: move this to a cron job if that's problematic
# or make it run with only 1/N probability, etc.
destructive hardlink /var/media --reflink=always --ignore-time --verbose
fi

View File

@@ -25,10 +25,14 @@
# moby has to run recent kernels (defined elsewhere). # moby has to run recent kernels (defined elsewhere).
# meanwhile, kernel variation plays some minor role in things like sandboxing (landlock) and capabilities. # meanwhile, kernel variation plays some minor role in things like sandboxing (landlock) and capabilities.
# - as of 2024/08/xx, my boot fails on 6.6, but works on 6.9 and (probably; recently) 6.8.
# simpler to keep near the latest kernel on all devices, # simpler to keep near the latest kernel on all devices,
# and also makes certain that any weird system-level bugs i see aren't likely to be stale kernel bugs. # and also makes certain that any weird system-level bugs i see aren't likely to be stale kernel bugs.
# servo needs zfs though, which doesn't support every kernel. # servo needs zfs though, which doesn't support every kernel.
boot.kernelPackages = lib.mkDefault pkgs.zfs.latestCompatibleLinuxPackages; #
# further, `zfs.latestCompatibleLinuxPackage` ocassionally _downgrades_. e.g. when 6.8 EOL'd, it went back to 6.6.
# therefore, we have to use `zfs_unstable` (!!)
boot.kernelPackages = lib.mkDefault pkgs.zfs_unstable.latestCompatibleLinuxPackages;
# hack in the `boot.shell_on_fail` arg since that doesn't always seem to work. # hack in the `boot.shell_on_fail` arg since that doesn't always seem to work.
boot.initrd.preFailCommands = "allowShell=1"; boot.initrd.preFailCommands = "allowShell=1";
@@ -46,5 +50,6 @@
# manifests as spurious "No space left on device" when trying to install watches, # 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`. # 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> # 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

@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
imports = [ imports = [
./boot.nix ./boot.nix
@@ -10,7 +10,6 @@
./machine-id.nix ./machine-id.nix
./net ./net
./nix.nix ./nix.nix
./persist.nix
./polyunfill.nix ./polyunfill.nix
./programs ./programs
./quirks.nix ./quirks.nix

View File

@@ -2,7 +2,9 @@
# - universal search/directory: <https://podcastindex.org> # - universal search/directory: <https://podcastindex.org>
# - list of lists: <https://en.wikipedia.org/wiki/Category:Lists_of_podcasts> # - list of lists: <https://en.wikipedia.org/wiki/Category:Lists_of_podcasts>
# - podcasts w/ a community: <https://lemmyverse.net/communities?query=podcast> # - 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>
# #
{ lib, sane-data, ... }: { lib, sane-data, ... }:
let let
@@ -55,8 +57,10 @@ let
}; };
podcasts = [ podcasts = [
(fromDb "404media.co/the-404-media-podcast" // tech)
(fromDb "acquiredlpbonussecretsecret.libsyn.com" // tech) # ACQ2 - more "Acquired" episodes (fromDb "acquiredlpbonussecretsecret.libsyn.com" // tech) # ACQ2 - more "Acquired" episodes
(fromDb "allinchamathjason.libsyn.com" // pol) (fromDb "allinchamathjason.libsyn.com" // pol)
(fromDb "api.oyez.org/podcasts/oral-arguments/2015" // pol) # Supreme Court Oral Arguments ("2015" in URL means nothing -- it's still updated)
(fromDb "anchor.fm/s/34c7232c/podcast/rss" // tech) # Civboot -- https://anchor.fm/civboot (fromDb "anchor.fm/s/34c7232c/podcast/rss" // tech) # Civboot -- https://anchor.fm/civboot
(fromDb "anchor.fm/s/2da69154/podcast/rss" // tech) # POD OF JAKE -- https://podofjake.com/ (fromDb "anchor.fm/s/2da69154/podcast/rss" // tech) # POD OF JAKE -- https://podofjake.com/
(fromDb "cast.postmarketos.org" // tech) (fromDb "cast.postmarketos.org" // tech)
@@ -68,18 +72,22 @@ let
(fromDb "feeds.feedburner.com/80000HoursPodcast" // rat) (fromDb "feeds.feedburner.com/80000HoursPodcast" // rat)
(fromDb "feeds.feedburner.com/dancarlin/history" // rat) (fromDb "feeds.feedburner.com/dancarlin/history" // rat)
(fromDb "feeds.feedburner.com/radiolab" // pol) # Radiolab -- also available here, but ONLY OVER HTTP: <http://feeds.wnyc.org/radiolab> (fromDb "feeds.feedburner.com/radiolab" // pol) # Radiolab -- also available here, but ONLY OVER HTTP: <http://feeds.wnyc.org/radiolab>
(fromDb "feeds.megaphone.fm/GLT1412515089" // pol) # JRE: Joe Rogan Experience
(fromDb "feeds.megaphone.fm/behindthebastards" // pol) # also Maggie Killjoy (fromDb "feeds.megaphone.fm/behindthebastards" // pol) # also Maggie Killjoy
(fromDb "feeds.megaphone.fm/cspantheweekly" // pol)
(fromDb "feeds.megaphone.fm/recodedecode" // tech) # The Verge - Decoder (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/82FI35Px" // pol) # Ezra Klein Show
(fromDb "feeds.simplecast.com/wgl4xEgL" // rat) # Econ Talk (fromDb "feeds.simplecast.com/wgl4xEgL" // rat) # Econ Talk
(fromDb "feeds.simplecast.com/xKJ93w_w" // uncat) # Atlas Obscura (fromDb "feeds.simplecast.com/xKJ93w_w" // uncat) # Atlas Obscura
(fromDb "feeds.transistor.fm/acquired" // tech) (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 "feeds.twit.tv/floss.xml" // tech)
(fromDb "fulltimenix.com" // tech) (fromDb "fulltimenix.com" // tech)
(fromDb "futureofcoding.org/episodes" // tech) (fromDb "futureofcoding.org/episodes" // tech)
(fromDb "hackerpublicradio.org" // tech) (fromDb "hackerpublicradio.org" // tech)
(fromDb "lexfridman.com/podcast" // rat) (fromDb "lexfridman.com/podcast" // rat)
(fromDb "linktr.ee/betteroffline" // pol)
(fromDb "linuxdevtime.com" // tech)
(fromDb "mapspodcast.libsyn.com" // uncat) # Multidisciplinary Association for Psychedelic Studies (fromDb "mapspodcast.libsyn.com" // uncat) # Multidisciplinary Association for Psychedelic Studies
(fromDb "microarch.club" // tech) (fromDb "microarch.club" // tech)
(fromDb "mintcast.org" // tech) (fromDb "mintcast.org" // tech)
@@ -87,8 +95,8 @@ let
(fromDb "omny.fm/shows/cool-people-who-did-cool-stuff" // pol) # Maggie Killjoy -- referenced by Cory Doctorow (fromDb "omny.fm/shows/cool-people-who-did-cool-stuff" // pol) # Maggie Killjoy -- referenced by Cory Doctorow
(fromDb "omny.fm/shows/money-stuff-the-podcast") # Matt Levine (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 "omny.fm/shows/the-dollop-with-dave-anthony-and-gareth-reynolds") # The Dollop history/comedy
(fromDb "omny.fm/shows/weird-little-guys") # Cool Zone Media
(fromDb "originstories.libsyn.com" // uncat) (fromDb "originstories.libsyn.com" // uncat)
(fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol)
(fromDb "politicalorphanage.libsyn.com" // pol) (fromDb "politicalorphanage.libsyn.com" // pol)
(fromDb "reverseengineering.libsyn.com/rss" // tech) # UnNamed Reverse Engineering Podcast (fromDb "reverseengineering.libsyn.com/rss" // tech) # UnNamed Reverse Engineering Podcast
(fromDb "rss.acast.com/deconstructed") # The Intercept - Deconstructed (fromDb "rss.acast.com/deconstructed") # The Intercept - Deconstructed
@@ -105,18 +113,20 @@ let
(fromDb "theamphour.com" // tech) (fromDb "theamphour.com" // tech)
(fromDb "techtalesshow.com" // tech) # Corbin Davenport (fromDb "techtalesshow.com" // tech) # Corbin Davenport
(fromDb "techwontsave.us" // pol) # rec by Cory Doctorow (fromDb "techwontsave.us" // pol) # rec by Cory Doctorow
(fromDb "wakingup.libsyn.com" // pol) # Sam Harris
(fromDb "werenotwrong.fireside.fm" // pol) (fromDb "werenotwrong.fireside.fm" // pol)
(mkPod "https://sfconservancy.org/casts/the-corresponding-source/feeds/ogg/" // tech) (mkPod "https://sfconservancy.org/casts/the-corresponding-source/feeds/ogg/" // tech)
# (fromDb "feeds.libsyn.com/421877" // rat) # Less Wrong Curated # (fromDb "feeds.libsyn.com/421877" // rat) # Less Wrong Curated
# (fromDb "feeds.megaphone.fm/hubermanlab" // uncat) # Daniel Huberman on sleep # (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 "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 "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.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 # (fromDb "rss.prod.firstlook.media/deconstructed/podcast.rss" // pol) #< possible URL rot
# (fromDb "rss.prod.firstlook.media/intercepted/podcast.rss" // pol) #< possible URL rot # (fromDb "rss.prod.firstlook.media/intercepted/podcast.rss" // pol) #< possible URL rot
# (fromDb "trashfuturepodcast.podbean.com" // pol) # rec by Cory Doctorow, but way rambly # (fromDb "trashfuturepodcast.podbean.com" // pol) # rec by Cory Doctorow, but way rambly
# (fromDb "wakingup.libsyn.com" // pol) # Sam Harris, but he just repeats himself now
# (mkPod "https://anchor.fm/s/21bc734/podcast/rss" // pol // infrequent) # Emerge: making sense of what's next -- <https://www.whatisemerging.com/emergepodcast> # (mkPod "https://anchor.fm/s/21bc734/podcast/rss" // pol // infrequent) # Emerge: making sense of what's next -- <https://www.whatisemerging.com/emergepodcast>
# (mkPod "https://audioboom.com/channels/5097784.rss" // tech) # Lateral with Tom Scott # (mkPod "https://audioboom.com/channels/5097784.rss" // tech) # Lateral with Tom Scott
# (mkPod "https://feeds.megaphone.fm/RUNMED9919162779" // pol // infrequent) # The Witch Trials of J.K. Rowling: <https://www.thefp.com/witchtrials> # (mkPod "https://feeds.megaphone.fm/RUNMED9919162779" // pol // infrequent) # The Witch Trials of J.K. Rowling: <https://www.thefp.com/witchtrials>
@@ -127,6 +137,7 @@ let
(fromDb "acoup.blog/feed") # history, states. author: <https://historians.social/@bretdevereaux/following> (fromDb "acoup.blog/feed") # history, states. author: <https://historians.social/@bretdevereaux/following>
(fromDb "amosbbatto.wordpress.com" // tech) (fromDb "amosbbatto.wordpress.com" // tech)
(fromDb "anish.lakhwara.com" // tech) (fromDb "anish.lakhwara.com" // tech)
(fromDb "antipope.org") # Charles Stross
(fromDb "apenwarr.ca/log/rss.php" // tech) # CEO of tailscale (fromDb "apenwarr.ca/log/rss.php" // tech) # CEO of tailscale
(fromDb "applieddivinitystudies.com" // rat) (fromDb "applieddivinitystudies.com" // rat)
(fromDb "artemis.sh" // tech) (fromDb "artemis.sh" // tech)
@@ -141,6 +152,7 @@ let
(fromDb "blog.jmp.chat" // tech) (fromDb "blog.jmp.chat" // tech)
(fromDb "blog.rust-lang.org" // tech) (fromDb "blog.rust-lang.org" // tech)
(fromDb "blog.thalheim.io" // tech) # Mic92 (fromDb "blog.thalheim.io" // tech) # Mic92
(fromDb "blog.brixit.nl" // tech) # Martijn Braam
(fromDb "bunniestudios.com" // tech) # Bunnie Juang (fromDb "bunniestudios.com" // tech) # Bunnie Juang
(fromDb "capitolhillseattle.com" // pol) (fromDb "capitolhillseattle.com" // pol)
(fromDb "edwardsnowden.substack.com" // pol // text) (fromDb "edwardsnowden.substack.com" // pol // text)
@@ -153,6 +165,7 @@ let
(fromDb "interconnected.org/home/feed" // rat) # Matt Webb -- engineering-ish, but dreamy (fromDb "interconnected.org/home/feed" // rat) # Matt Webb -- engineering-ish, but dreamy
(fromDb "jeffgeerling.com" // tech) (fromDb "jeffgeerling.com" // tech)
(fromDb "jefftk.com" // tech) (fromDb "jefftk.com" // tech)
(fromDb "justine.lol" // tech)
(fromDb "jwz.org/blog" // tech // pol) # DNA lounge guy, loooong-time blogger (fromDb "jwz.org/blog" // tech // pol) # DNA lounge guy, loooong-time blogger
(fromDb "kill-the-newsletter.com/feeds/joh91bv7am2pnznv.xml" // pol) # Matt Levine - Money Stuff (fromDb "kill-the-newsletter.com/feeds/joh91bv7am2pnznv.xml" // pol) # Matt Levine - Money Stuff
(fromDb "kosmosghost.github.io/index.xml" // tech) (fromDb "kosmosghost.github.io/index.xml" // tech)
@@ -231,15 +244,16 @@ let
(fromDb "youtube.com/@Exurb1a") (fromDb "youtube.com/@Exurb1a")
(fromDb "youtube.com/@hbomberguy") (fromDb "youtube.com/@hbomberguy")
(fromDb "youtube.com/@JackStauber") (fromDb "youtube.com/@JackStauber")
(fromDb "youtube.com/@mii_beta" // tech) # Baby Wogue / gnome reviewer
(fromDb "youtube.com/@NativLang") (fromDb "youtube.com/@NativLang")
(fromDb "youtube.com/@PolyMatter") (fromDb "youtube.com/@PolyMatter")
(fromDb "youtube.com/@TechnologyConnections" // tech) (fromDb "youtube.com/@TechnologyConnections" // tech)
(fromDb "youtube.com/@TheB1M") (fromDb "youtube.com/@TheB1M")
(fromDb "youtube.com/@TomScottGo") (fromDb "youtube.com/@TomScottGo")
(fromDb "youtube.com/@Vihart") (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 # (fromDb "youtube.com/@rossmanngroup" // pol // tech) # Louis Rossmann
]; ];

View File

@@ -2,7 +2,7 @@
# - x-systemd options: <https://www.freedesktop.org/software/systemd/man/systemd.mount.html> # - x-systemd options: <https://www.freedesktop.org/software/systemd/man/systemd.mount.html>
# - fuse options: `man mount.fuse` # - fuse options: `man mount.fuse`
{ config, lib, pkgs, sane-lib, utils, ... }: { config, lib, utils, ... }:
let let
fsOpts = rec { fsOpts = rec {
@@ -45,7 +45,7 @@ let
"gid=100" "gid=100"
]; ];
ssh = common ++ fuse ++ [ ssh = common ++ fuseColin ++ [
"identityfile=/home/colin/.ssh/id_ed25519" "identityfile=/home/colin/.ssh/id_ed25519"
# i *think* idmap=user means that `colin` on `localhost` and `colin` on the remote are actually treated as the same user, even if their uid/gid differs? # i *think* idmap=user means that `colin` on `localhost` and `colin` on the remote are actually treated as the same user, even if their uid/gid differs?
# i.e., local colin's id is translated to/from remote colin's id on every operation? # i.e., local colin's id is translated to/from remote colin's id on every operation?
@@ -64,39 +64,6 @@ let
# # we don't transform_symlinks because that breaks the validity of remote /nix stores # # we don't transform_symlinks because that breaks the validity of remote /nix stores
# "sftp_server=/run/wrappers/bin/sudo\\040/run/current-system/sw/libexec/sftp-server" # "sftp_server=/run/wrappers/bin/sudo\\040/run/current-system/sw/libexec/sftp-server"
# ]; # ];
# in the event of hunt NFS mounts, consider:
# - <https://unix.stackexchange.com/questions/31979/stop-broken-nfs-mounts-from-locking-a-directory>
# NFS options: <https://linux.die.net/man/5/nfs>
# actimeo=n = how long (in seconds) to cache file/dir attributes (default: 3-60s)
# bg = retry failed mounts in the background
# retry=n = for how many minutes `mount` will retry NFS mount operation
# intr = allow Ctrl+C to abort I/O (it will error with `EINTR`)
# soft = on "major timeout", report I/O error to userspace
# softreval = on "major timeout", service the request using known-stale cache results instead of erroring -- if such cache data exists
# retrans=n = how many times to retry a NFS request before giving userspace a "server not responding" error (default: 3)
# timeo=n = number of *deciseconds* to wait for a response before retrying it (default: 600)
# note: client uses a linear backup, so the second request will have double this timeout, then triple, etc.
# proto=udp = encapsulate protocol ops inside UDP packets instead of a TCP session.
# requires `nfsvers=3` and a kernel compiled with `NFS_DISABLE_UDP_SUPPORT=n`.
# UDP might be preferable to TCP because the latter is liable to hang for ~100s (kernel TCP timeout) after a link drop.
# however, even UDP has issues with `umount` hanging.
#
# N.B.: don't change these without first testing the behavior of sandboxed apps on a flaky network.
nfs = common ++ [
# "actimeo=5"
# "bg"
"retrans=1"
"retry=0"
# "intr"
"soft"
"softreval"
"timeo=30"
"nofail" # don't fail remote-fs.target when this mount fails (not an option for sshfs else would be common)
# "proto=udp" # default kernel config doesn't support NFS over UDP: <https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1964093> (see comment 11).
# "nfsvers=3" # NFSv4+ doesn't support UDP at *all*. it's ok to omit nfsvers -- server + client will negotiate v3 based on udp requirement. but omitting causes confusing mount errors when the server is *offline*, because the client defaults to v4 and thinks the udp option is a config error.
# "x-systemd.idle-timeout=10" # auto-unmount after this much inactivity
];
# manually perform a ftp mount via e.g. # manually perform a ftp mount via e.g.
# curlftpfs -o ftpfs_debug=2,user=anonymous:anonymous,connect_timeout=10 -f -s ftp://servo-hn /mnt/my-ftp # curlftpfs -o ftpfs_debug=2,user=anonymous:anonymous,connect_timeout=10 -f -s ftp://servo-hn /mnt/my-ftp
@@ -107,66 +74,207 @@ let
"connect_timeout=20" "connect_timeout=20"
]; ];
}; };
remoteHome = host: {
ifSshAuthorized = lib.mkIf config.sane.hosts.by-name."${config.networking.hostName}".ssh.authorized;
remoteHome = name: { host ? name }: {
sane.programs.sshfs-fuse.enableFor.system = true; sane.programs.sshfs-fuse.enableFor.system = true;
fileSystems."/mnt/${host}/home" = { system.fsPackages = [
device = "colin@${host}:/home/colin"; config.sane.programs.sshfs-fuse.package
fsType = "fuse.sshfs"; ];
options = fsOpts.sshColin ++ fsOpts.lazyMount; fileSystems."/mnt/${name}/home" = {
device = "sshfs#colin@${host}:/home/colin";
fsType = "fuse3";
options = fsOpts.sshColin ++ fsOpts.lazyMount ++ [
# drop_privileges: after `mount.fuse3` opens /dev/fuse, it will drop all capabilities before invoking sshfs
"drop_privileges"
"auto_unmount" #< ensures that when the fs exits, it releases its mountpoint. then systemd can recognize it as failed.
];
noCheck = true; noCheck = true;
}; };
sane.fs."/mnt/${host}/home" = sane-lib.fs.wanted { sane.fs."/mnt/${name}/home" = {
dir.acl.user = "colin"; dir.acl.user = "colin";
dir.acl.group = "users"; dir.acl.group = "users";
dir.acl.mode = "0700"; dir.acl.mode = "0700";
wantedBy = [ "default.target" ];
mount.depends = [ "network-online.target" ];
mount.mountConfig.ExecSearchPath = [ "/run/current-system/sw/bin" ];
mount.mountConfig.User = "colin";
mount.mountConfig.AmbientCapabilities = "CAP_SETPCAP CAP_SYS_ADMIN";
# hardening (systemd-analyze security mnt-desko-home.mount):
# TODO: i can't use ProtectSystem=full here, because i can't create a new mount space; but...
# with drop_privileges, i *could* sandbox the actual `sshfs` program using e.g. bwrap
mount.mountConfig.CapabilityBoundingSet = "CAP_SETPCAP CAP_SYS_ADMIN";
mount.mountConfig.LockPersonality = true;
mount.mountConfig.MemoryDenyWriteExecute = true;
mount.mountConfig.NoNewPrivileges = true;
mount.mountConfig.ProtectClock = true;
mount.mountConfig.ProtectHostname = true;
mount.mountConfig.RemoveIPC = true;
mount.mountConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
#VVV this includes anything it reads from, e.g. /bin/sh; /nix/store/...
# see `systemd-analyze filesystems` for a full list
mount.mountConfig.RestrictFileSystems = "@common-block @basic-api fuse";
mount.mountConfig.RestrictRealtime = true;
mount.mountConfig.RestrictSUIDSGID = true;
mount.mountConfig.SystemCallArchitectures = "native";
mount.mountConfig.SystemCallFilter = [
"@system-service"
"@mount"
"~@chown"
"~@cpu-emulation"
"~@keyring"
# could remove almost all io calls, however one has to keep `open`, and `write`, to communicate with the fuse device.
# so that's pretty useless as a way to prevent write access
];
mount.mountConfig.IPAddressDeny = "any";
mount.mountConfig.IPAddressAllow = "10.0.0.0/8";
mount.mountConfig.DevicePolicy = "closed"; # only allow /dev/{null,zero,full,random,urandom}
mount.mountConfig.DeviceAllow = "/dev/fuse";
# mount.mountConfig.RestrictNamespaces = true; #< my sshfs sandboxing uses bwrap
}; };
}; };
remoteServo = subdir: { remoteServo = subdir: let
localPath = "/mnt/servo/${subdir}";
systemdName = utils.escapeSystemdPath localPath;
in {
sane.programs.curlftpfs.enableFor.system = true; sane.programs.curlftpfs.enableFor.system = true;
sane.fs."/mnt/servo/${subdir}" = sane-lib.fs.wanted { system.fsPackages = [
config.sane.programs.curlftpfs.package
];
fileSystems."${localPath}" = {
device = "curlftpfs#ftp://servo-hn:/${subdir}";
noCheck = true;
fsType = "fuse3";
options = fsOpts.ftp ++ fsOpts.noauto ++ [
# drop_privileges: after `mount.fuse3` opens /dev/fuse, it will drop all capabilities before invoking sshfs
"drop_privileges"
"auto_unmount" #< ensures that when the fs exits, it releases its mountpoint. then systemd can recognize it as failed.
];
};
sane.fs."${localPath}" = {
dir.acl.user = "colin"; dir.acl.user = "colin";
dir.acl.group = "users"; dir.acl.group = "users";
dir.acl.mode = "0750"; dir.acl.mode = "0750";
};
fileSystems."/mnt/servo/${subdir}" = {
device = "ftp://servo-hn:/${subdir}";
noCheck = true;
fsType = "fuse.curlftpfs";
options = fsOpts.ftp ++ fsOpts.noauto;
# fsType = "nfs";
# 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";
after = [ "network-online.target" ];
requires = [ "network-online.target" ];
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
mount.depends = [ "network-online.target" "${systemdName}-reachable.service" ];
#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
mount.unitConfig.OnFailure = [ "${systemdName}.timer" ];
mount.unitConfig.OnSuccess = [ "${systemdName}-restart-timer.target" ];
serviceConfig.Type = "simple"; mount.mountConfig.TimeoutSec = "10s";
serviceConfig.ExecStart = lib.escapeShellArgs [ mount.mountConfig.ExecSearchPath = [ "/run/current-system/sw/bin" ];
"/usr/bin/env" mount.mountConfig.User = "colin";
"PATH=/run/current-system/sw/bin" mount.mountConfig.AmbientCapabilities = "CAP_SETPCAP CAP_SYS_ADMIN";
"mount.${fs.fsType}" # hardening (systemd-analyze security mnt-servo-playground.mount)
"-f" # foreground (i.e. don't daemonize) mount.mountConfig.CapabilityBoundingSet = "CAP_SETPCAP CAP_SYS_ADMIN";
"-s" # single-threaded (TODO: it's probably ok to disable this?) mount.mountConfig.LockPersonality = true;
"-o" mount.mountConfig.MemoryDenyWriteExecute = true;
(lib.concatStringsSep "," (lib.filter (o: !lib.hasPrefix "x-systemd." o) fs.options)) mount.mountConfig.NoNewPrivileges = true;
fs.device mount.mountConfig.ProtectClock = true;
"/mnt/servo/${subdir}" mount.mountConfig.ProtectHostname = true;
mount.mountConfig.RemoveIPC = true;
mount.mountConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
#VVV this includes anything it reads from, e.g. /bin/sh; /nix/store/...
# see `systemd-analyze filesystems` for a full list
mount.mountConfig.RestrictFileSystems = "@common-block @basic-api fuse";
mount.mountConfig.RestrictRealtime = true;
mount.mountConfig.RestrictSUIDSGID = true;
mount.mountConfig.SystemCallArchitectures = "native";
mount.mountConfig.SystemCallFilter = [
"@system-service"
"@mount"
"~@chown"
"~@cpu-emulation"
"~@keyring"
# could remove almost all io calls, however one has to keep `open`, and `write`, to communicate with the fuse device.
# so that's pretty useless as a way to prevent write access
]; ];
# not sure if this configures a linear, or exponential backoff. mount.mountConfig.IPAddressDeny = "any";
# but the first restart will be after `RestartSec`, and the n'th restart (n = RestartSteps) will be RestartMaxDelaySec after the n-1'th exit. mount.mountConfig.IPAddressAllow = "10.0.10.5";
serviceConfig.Restart = "always"; mount.mountConfig.DevicePolicy = "closed"; # only allow /dev/{null,zero,full,random,urandom}
serviceConfig.RestartSec = "10s"; mount.mountConfig.DeviceAllow = "/dev/fuse";
serviceConfig.RestartMaxDelaySec = "120s"; # mount.mountConfig.RestrictNamespaces = true;
serviceConfig.RestartSteps = "5"; };
systemd.services."${systemdName}-reachable" = {
serviceConfig.ExecSearchPath = [ "/run/current-system/sw/bin" ];
serviceConfig.ExecStart = lib.escapeShellArgs [
"curlftpfs"
"ftp://servo-hn:/${subdir}"
"/dev/null"
"-o"
(lib.concatStringsSep "," ([
"exit_after_connect"
] ++ config.fileSystems."${localPath}".options))
];
serviceConfig.RemainAfterExit = true;
serviceConfig.Type = "oneshot";
unitConfig.BindsTo = [ "${systemdName}.mount" ];
# hardening (systemd-analyze security mnt-servo-playground-reachable.service)
serviceConfig.AmbientCapabilities = "";
serviceConfig.CapabilityBoundingSet = "";
serviceConfig.DynamicUser = true;
serviceConfig.LockPersonality = true;
serviceConfig.MemoryDenyWriteExecute = true;
serviceConfig.NoNewPrivileges = true;
serviceConfig.PrivateDevices = true;
serviceConfig.PrivateMounts = true;
serviceConfig.PrivateTmp = true;
serviceConfig.PrivateUsers = true;
serviceConfig.ProcSubset = "all";
serviceConfig.ProtectClock = true;
serviceConfig.ProtectControlGroups = true;
serviceConfig.ProtectHome = true;
serviceConfig.ProtectKernelModules = true;
serviceConfig.ProtectProc = "invisible";
serviceConfig.ProtectSystem = "strict";
serviceConfig.RemoveIPC = true;
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
# serviceConfig.RestrictFileSystems = "@common-block @basic-api"; #< NOPE
serviceConfig.RestrictRealtime = true;
serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native";
serviceConfig.SystemCallFilter = [
"@system-service"
"@mount"
"~@chown"
"~@cpu-emulation"
"~@keyring"
# "~@privileged" #< NOPE
"~@resources"
# could remove some more probably
];
serviceConfig.IPAddressDeny = "any";
serviceConfig.IPAddressAllow = "10.0.10.5";
serviceConfig.DevicePolicy = "closed";
# exceptions
serviceConfig.ProtectHostname = false;
serviceConfig.ProtectKernelLogs = false;
serviceConfig.ProtectKernelTunables = false;
};
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"
];
# cap the backoff to a fixed interval.
timerConfig.OnUnitActiveSec = [ "120s" ];
}; };
}; };
in in
@@ -203,19 +311,14 @@ lib.mkMerge [
# but it decreases working memory under the heaviest of loads by however much space the compressed memory occupies (e.g. 50% if 2:1; 25% if 4:1) # but it decreases working memory under the heaviest of loads by however much space the compressed memory occupies (e.g. 50% if 2:1; 25% if 4:1)
zramSwap.memoryPercent = 100; zramSwap.memoryPercent = 100;
# environment.pathsToLink = [
# # needed to achieve superuser access for user-mounted filesystems (see sshRoot above)
# # we can only link whole directories here, even though we're only interested in pkgs.openssh
# "/libexec"
# ];
programs.fuse.userAllowOther = true; #< necessary for `allow_other` or `allow_root` options. programs.fuse.userAllowOther = true; #< necessary for `allow_other` or `allow_root` options.
} }
(remoteHome "crappy") (ifSshAuthorized (remoteHome "crappy" {}))
(remoteHome "desko") (ifSshAuthorized (remoteHome "desko" {}))
(remoteHome "lappy") (ifSshAuthorized (remoteHome "lappy" {}))
(remoteHome "moby") (ifSshAuthorized (remoteHome "moby" { host = "moby-hn"; }))
(ifSshAuthorized (remoteHome "servo" {}))
# this granularity of servo media mounts is necessary to support sandboxing: # this granularity of servo media mounts is necessary to support sandboxing:
# for flaky mounts, we can only bind the mountpoint itself into the sandbox, # for flaky mounts, we can only bind the mountpoint itself into the sandbox,
# so it's either this or unconditionally bind all of media/. # so it's either this or unconditionally bind all of media/.

View File

@@ -1,31 +1,31 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
sane.user.persist.byStore.plaintext = [ 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" "dev"
# TODO: records should be private
"records"
"ref" "ref"
"tmp"
"use" "use"
"Books/local" "Books/local"
"Music" "Music"
# this is persisted simply to save on RAM. mesa_shader_cache is < 10 MB per boot.
# TODO: integrate with sane.programs.sandbox?
".cache/mesa_shader_cache"
".cache/mesa_shader_cache_db"
];
sane.user.persist.byStore.private = [
"archive"
"Pictures/albums" "Pictures/albums"
"Pictures/cat" "Pictures/cat"
"Pictures/from" "Pictures/from"
"Pictures/Screenshots" #< XXX: something is case-sensitive about this? "Pictures/Screenshots" #< XXX: something is case-sensitive about this?
"Pictures/Photos" "Pictures/Photos"
"Videos/local" "records"
"tmp"
# these are persisted simply to save on RAM.
# ~/.cache/nix can become several GB.
# mesa_shader_cache is < 10 MB.
# TODO: integrate with sane.programs.sandbox?
".cache/mesa_shader_cache"
".cache/nix"
];
sane.user.persist.byStore.private = [
"knowledge" "knowledge"
"Videos/local"
]; ];
# convenience # convenience
@@ -34,7 +34,7 @@
in { in {
".persist/private" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.private.origin; }; ".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/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"; "nixos".symlink.target = "dev/nixos";

View File

@@ -45,8 +45,8 @@
sane.ids.pict-rs.gid = 2409; sane.ids.pict-rs.gid = 2409;
sane.ids.sftpgo.uid = 2410; sane.ids.sftpgo.uid = 2410;
sane.ids.sftpgo.gid = 2410; sane.ids.sftpgo.gid = 2410;
sane.ids.trust-dns.uid = 2411; sane.ids.hickory-dns.uid = 2411; #< previously "trust-dns"
sane.ids.trust-dns.gid = 2411; sane.ids.hickory-dns.gid = 2411; #< previously "trust-dns"
sane.ids.export.gid = 2412; sane.ids.export.gid = 2412;
sane.ids.nfsuser.uid = 2413; sane.ids.nfsuser.uid = 2413;
sane.ids.media.gid = 2414; sane.ids.media.gid = 2414;
@@ -63,6 +63,8 @@
sane.ids.nix-serve.uid = 2420; sane.ids.nix-serve.uid = 2420;
sane.ids.nix-serve.gid = 2420; sane.ids.nix-serve.gid = 2420;
sane.ids.plugdev.gid = 2421; sane.ids.plugdev.gid = 2421;
sane.ids.ollama.uid = 2422;
sane.ids.ollama.gid = 2422;
sane.ids.colin.uid = 1000; sane.ids.colin.uid = 1000;
sane.ids.guest.uid = 1100; sane.ids.guest.uid = 1100;

View File

@@ -1,4 +1,4 @@
{ lib, ... }: { ... }:
{ {
imports = [ imports = [
@@ -12,6 +12,7 @@
systemd.network.enable = true; systemd.network.enable = true;
networking.useNetworkd = 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` # view refused/dropped packets with: `sudo journalctl -k`
# networking.firewall.logRefusedPackets = true; # networking.firewall.logRefusedPackets = true;

View File

@@ -23,16 +23,16 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
lib.mkMerge [ lib.mkMerge [
{ {
sane.services.trust-dns.enable = lib.mkDefault config.sane.services.trust-dns.asSystemResolver; sane.services.hickory-dns.enable = lib.mkDefault config.sane.services.hickory-dns.asSystemResolver;
sane.services.trust-dns.asSystemResolver = lib.mkDefault true; sane.services.hickory-dns.asSystemResolver = lib.mkDefault true;
} }
(lib.mkIf (!config.sane.services.trust-dns.asSystemResolver) { (lib.mkIf (!config.sane.services.hickory-dns.asSystemResolver) {
# use systemd's stub resolver. # use systemd's stub resolver.
# /etc/resolv.conf isn't sophisticated enough to use different servers per net namespace (or link). # /etc/resolv.conf isn't sophisticated enough to use different servers per net namespace (or link).
# instead, running the stub resolver on a known address in the root ns lets us rewrite packets # instead, running the stub resolver on a known address in the root ns lets us rewrite packets
# in servo's ovnps namespace to use the provider's DNS resolvers. # in servo's ovnps namespace to use the provider's DNS resolvers.
# a weakness is we can only query 1 NS at a time (unless we were to clone the packets?) # a weakness is we can only query 1 NS at a time (unless we were to clone the packets?)
# TODO: improve trust-dns recursive resolver and then remove this # TODO: improve hickory-dns recursive resolver and then remove this
services.resolved.enable = true; #< to disable, set ` = lib.mkForce false`, as other systemd features default to enabling `resolved`. services.resolved.enable = true; #< to disable, set ` = lib.mkForce false`, as other systemd features default to enabling `resolved`.
# without DNSSEC: # without DNSSEC:
# - dig matrix.org => works # - dig matrix.org => works
@@ -40,7 +40,7 @@ lib.mkMerge [
# with default DNSSEC: # with default DNSSEC:
# - dig matrix.org => works # - dig matrix.org => works
# - curl https://matrix.org => fails # - curl https://matrix.org => fails
# i don't know why. this might somehow be interfering with the DNS run on this device (trust-dns) # i don't know why. this might somehow be interfering with the DNS run on this device (hickory-dns)
services.resolved.dnssec = "false"; services.resolved.dnssec = "false";
networking.nameservers = [ networking.nameservers = [
# use systemd-resolved resolver # use systemd-resolved resolver
@@ -74,7 +74,7 @@ lib.mkMerge [
sane.silencedAssertions = [''.*Loading NSS modules from system.nssModules.*requires services.nscd.enable being set to true.*'']; sane.silencedAssertions = [''.*Loading NSS modules from system.nssModules.*requires services.nscd.enable being set to true.*''];
# add NSS modules into their own subdirectory. # 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. # 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 # TODO: i'm doing this so as to achieve mdns DNS resolution (avahi). it would be better to just have hickory-dns delegate .local to avahi
# (except avahi doesn't act as a local resolver over DNS protocol -- only dbus). # (except avahi doesn't act as a local resolver over DNS protocol -- only dbus).
environment.systemPackages = [(pkgs.symlinkJoin { environment.systemPackages = [(pkgs.symlinkJoin {
name = "nss-modules"; name = "nss-modules";

View File

@@ -14,7 +14,6 @@
# after = [ "polkit.service" ]; # after = [ "polkit.service" ];
# requires = [ "polkit.service" ]; # requires = [ "polkit.service" ];
wantedBy = [ "network.target" ]; #< default is `multi-user.target`, somehow it doesn't auto-start with that... 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.Type = "dbus";
# serviceConfig.BusName = "org.freedesktop.ModemManager1"; # serviceConfig.BusName = "org.freedesktop.ModemManager1";
@@ -38,7 +37,11 @@
# serviceConfig.RestrictAddressFamilies = "AF_NETLINK AF_UNIX AF_QIPCRTR"; # serviceConfig.RestrictAddressFamilies = "AF_NETLINK AF_UNIX AF_QIPCRTR";
# serviceConfig.NoNewPrivileges = true; # serviceConfig.NoNewPrivileges = true;
serviceConfig.CapabilityBoundingSet = [ "CAP_NET_ADMIN" ]; #< TODO: make sure this is *really* taking effect, and isn't supplemental to upstream's `CAP_SYS_ADMIN` setting serviceConfig.CapabilityBoundingSet = [
"" #< reset upstream capabilities
"CAP_NET_ADMIN"
"CAP_SYS_ADMIN" #< TODO: remove CAP_SYS_ADMIN!
];
serviceConfig.LockPersonality = true; serviceConfig.LockPersonality = true;
# serviceConfig.PrivateUsers = true; #< untried, not likely to work since it needs capabilities # serviceConfig.PrivateUsers = true; #< untried, not likely to work since it needs capabilities
serviceConfig.PrivateTmp = true; serviceConfig.PrivateTmp = true;

View File

@@ -2,21 +2,28 @@
let let
# networkmanager = pkgs.networkmanager; # networkmanager = pkgs.networkmanager;
networkmanager = pkgs.networkmanager.overrideAttrs (upstream: { networkmanager = pkgs.networkmanager.overrideAttrs (upstream: {
src = pkgs.fetchFromGitea { # src = pkgs.fetchFromGitea {
domain = "git.uninsane.org"; # domain = "git.uninsane.org";
owner = "colin"; # owner = "colin";
repo = "NetworkManager"; # repo = "NetworkManager";
# patched to fix polkit permissions (with `nmcli`) when NetworkManager runs as user networkmanager # # patched to fix polkit permissions (with `nmcli`) when NetworkManager runs as user networkmanager
rev = "dev-sane-1.48.0"; # rev = "dev-sane-1.48.0";
hash = "sha256-vGmOKtwVItxjYioZJlb1og3K6u9s4rcmDnjAPLBC3ao="; # hash = "sha256-vGmOKtwVItxjYioZJlb1og3K6u9s4rcmDnjAPLBC3ao=";
}; # };
# patches = []; 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* # split the package into `daemon` and `nmcli` outputs, because the networkmanager *service*
# doesn't need `nmcli`/`nmtui` tooling # doesn't need `nmcli`/`nmtui` tooling
networkmanager-split = pkgs.networkmanager-split.override { inherit networkmanager; }; networkmanager-split = pkgs.networkmanager-split.override { inherit networkmanager; };
in { in {
networking.networkmanager.enable = true; 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. # plugins mostly add support for establishing different VPN connections.
# the default plugin set includes mostly proprietary VPNs: # the default plugin set includes mostly proprietary VPNs:
# - fortisslvpn (Fortinet) # - fortisslvpn (Fortinet)
@@ -41,7 +48,9 @@ in {
# allow the bus to owned by either root or networkmanager users # allow the bus to owned by either root or networkmanager users
# use the group here, that way ordinary users can be elevated to control networkmanager # use the group here, that way ordinary users can be elevated to control networkmanager
# (via e.g. `nmcli`) # (via e.g. `nmcli`)
for f in org.freedesktop.NetworkManager.conf nm-dispatcher.conf ; do confs=(nm-dispatcher.conf)
confs+=(org.freedesktop.NetworkManager.conf)
for f in "''${confs[@]}" ; do
substitute $out/share/dbus-1/system.d/$f \ substitute $out/share/dbus-1/system.d/$f \
$out/share/dbus-1/system.d/networkmanager-$f \ $out/share/dbus-1/system.d/networkmanager-$f \
--replace-fail 'user="root"' 'group="networkmanager"' --replace-fail 'user="root"' 'group="networkmanager"'
@@ -59,6 +68,11 @@ in {
serviceConfig.User = "networkmanager"; serviceConfig.User = "networkmanager";
serviceConfig.Group = "networkmanager"; serviceConfig.Group = "networkmanager";
serviceConfig.AmbientCapabilities = [ serviceConfig.AmbientCapabilities = [
"CAP_NET_ADMIN"
"CAP_NET_RAW"
"CAP_NET_BIND_SERVICE"
];
serviceConfig.CapabilityBoundingSet = [
# "CAP_DAC_OVERRIDE" # "CAP_DAC_OVERRIDE"
"CAP_NET_ADMIN" "CAP_NET_ADMIN"
"CAP_NET_RAW" #< required, else `libndp: ndp_sock_open: Failed to create ICMP6 socket.` "CAP_NET_RAW" #< required, else `libndp: ndp_sock_open: Failed to create ICMP6 socket.`
@@ -69,6 +83,7 @@ in {
]; ];
serviceConfig.LockPersonality = true; serviceConfig.LockPersonality = true;
serviceConfig.NoNewPrivileges = true; serviceConfig.NoNewPrivileges = true;
serviceConfig.MemoryDenyWriteExecute = true;
serviceConfig.PrivateDevices = true; # remount /dev with just the basics, syscall filter to block @raw-io serviceConfig.PrivateDevices = true; # remount /dev with just the basics, syscall filter to block @raw-io
serviceConfig.PrivateIPC = true; serviceConfig.PrivateIPC = true;
serviceConfig.PrivateTmp = true; serviceConfig.PrivateTmp = true;
@@ -79,8 +94,11 @@ in {
serviceConfig.ProtectHostname = true; # probably not upstreamable: prevents changing hostname serviceConfig.ProtectHostname = true; # probably not upstreamable: prevents changing hostname
serviceConfig.ProtectKernelLogs = true; # disable /proc/kmsg, /dev/kmsg serviceConfig.ProtectKernelLogs = true; # disable /proc/kmsg, /dev/kmsg
serviceConfig.ProtectKernelModules = true; # syscall filter to prevent module calls (probably not upstreamable: NM will want to load modules like `ppp`) serviceConfig.ProtectKernelModules = true; # syscall filter to prevent module calls (probably not upstreamable: NM will want to load modules like `ppp`)
serviceConfig.ProtectKernelTunables = true; # but NM might need to write /proc/sys/net/... # serviceConfig.ProtectKernelTunables = true; # causes errors/warnings when opening files in /proc/sys/net/...; also breaks IPv6 SLAAC / link-local address creation!
serviceConfig.ProtectProc = "invisible";
serviceConfig.ProcSubset = "all";
serviceConfig.ProtectSystem = "strict"; # makes read-only: all but /dev, /proc, /sys. serviceConfig.ProtectSystem = "strict"; # makes read-only: all but /dev, /proc, /sys.
serviceConfig.RemoveIPC = true;
serviceConfig.RestrictAddressFamilies = [ serviceConfig.RestrictAddressFamilies = [
"AF_INET" "AF_INET"
"AF_INET6" "AF_INET6"
@@ -91,19 +109,25 @@ in {
# AF_BLUETOOTH ? # AF_BLUETOOTH ?
# AF_BRIDGE ? # AF_BRIDGE ?
]; ];
serviceConfig.RestrictNamespaces = true;
serviceConfig.RestrictSUIDSGID = true; serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native"; # prevents e.g. aarch64 syscalls in the event that the kernel is multi-architecture. serviceConfig.SystemCallArchitectures = "native"; # prevents e.g. aarch64 syscalls in the event that the kernel is multi-architecture.
serviceConfig.SystemCallFilter = [
"@system-service"
# TODO: restrict SystemCallFilter more aggressively
];
# TODO: restrict `DeviceAllow`
# from earlier `landlock` sandboxing, i know it needs these directories: # from earlier `landlock` sandboxing, i know it needs these directories:
# - "/proc/net" # - "/proc/net"
# - "/proc/sys/net" # - "/proc/sys/net"
# - "/run/NetworkManager" # - "/run/NetworkManager"
# - "/run/systemd" # for trust-dns-nmhook # - "/run/systemd" # for hickory-dns-nmhook
# - "/run/udev" # - "/run/udev"
# - # "/run/wg-home.priv" # - # "/run/wg-home.priv"
# - "/sys/class" # - "/sys/class"
# - "/sys/devices" # - "/sys/devices"
# - "/var/lib/NetworkManager" # - "/var/lib/NetworkManager"
# - "/var/lib/trust-dns" #< for trust-dns-nmhook # - "/var/lib/hickory-dns" #< for hickory-dns-nmhook
# - "/run/systemd" # - "/run/systemd"
}; };
@@ -115,7 +139,12 @@ in {
# fix NetworkManager-dispatcher to actually run as a daemon, # fix NetworkManager-dispatcher to actually run as a daemon,
# and sandbox it a bit # and sandbox it a bit
systemd.services.NetworkManager-dispatcher = { systemd.services.NetworkManager-dispatcher = {
after = [ "trust-dns-localhost.service" ]; #< so that /var/lib/trust-dns will exist #VVV so that /var/lib/hickory-dns will exist (the hook needs to write here).
# but this creates a cycle: hickory-dns-localhost > network.target > NetworkManager-dispatcher > hickory-dns-localhost.
# (seemingly) impossible to remove the network.target dep on NetworkManager-dispatcher.
# beffore would be to have the dispatcher not write hickory-dns files
# but rather just its own, and create a .path unit which restarts hickory-dns appropriately.
# after = [ "hickory-dns-localhost.service" ];
# serviceConfig.ExecStart = [ # serviceConfig.ExecStart = [
# "" # first blank line is to clear the upstream `ExecStart` field. # "" # first blank line is to clear the upstream `ExecStart` field.
# "${cfg.package}/libexec/nm-dispatcher --persist" # --persist is needed for it to actually run as a daemon # "${cfg.package}/libexec/nm-dispatcher --persist" # --persist is needed for it to actually run as a daemon
@@ -123,7 +152,7 @@ in {
# serviceConfig.Restart = "always"; # serviceConfig.Restart = "always";
# serviceConfig.RestartSec = "1s"; # serviceConfig.RestartSec = "1s";
# serviceConfig.DynamicUser = true; #< not possible, else we lose group perms (so can't write to `trust-dns`'s files in the nm hook) # serviceConfig.DynamicUser = true; #< not possible, else we lose group perms (so can't write to `hickory-dns`'s files in the nm hook)
serviceConfig.User = "networkmanager"; # TODO: should arguably use `DynamicUser` serviceConfig.User = "networkmanager"; # TODO: should arguably use `DynamicUser`
serviceConfig.Group = "networkmanager"; serviceConfig.Group = "networkmanager";
serviceConfig.LockPersonality = true; serviceConfig.LockPersonality = true;
@@ -139,7 +168,7 @@ in {
serviceConfig.ProtectKernelLogs = true; # disable /proc/kmsg, /dev/kmsg serviceConfig.ProtectKernelLogs = true; # disable /proc/kmsg, /dev/kmsg
serviceConfig.ProtectKernelModules = true; # syscall filter to prevent module calls serviceConfig.ProtectKernelModules = true; # syscall filter to prevent module calls
serviceConfig.ProtectKernelTunables = true; serviceConfig.ProtectKernelTunables = true;
serviceConfig.ProtectSystem = "full"; # makes read-only: /boot, /etc/, /usr. `strict` isn't possible due to trust-dns hook serviceConfig.ProtectSystem = "full"; # makes read-only: /boot, /etc/, /usr. `strict` isn't possible due to hickory-dns hook
serviceConfig.RestrictAddressFamilies = [ serviceConfig.RestrictAddressFamilies = [
"AF_UNIX" # required, probably for dbus or systemd connectivity "AF_UNIX" # required, probably for dbus or systemd connectivity
]; ];
@@ -199,9 +228,15 @@ in {
logging.level = "INFO"; logging.level = "INFO";
# main.dhcp = "internal"; #< default # 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 main.dns = if config.services.resolved.enable then
"systemd-resolved" "systemd-resolved"
else if config.sane.services.trust-dns.enable && config.sane.services.trust-dns.asSystemResolver then else if config.sane.services.hickory-dns.enable && config.sane.services.hickory-dns.asSystemResolver then
"none" "none"
else else
"internal" "internal"
@@ -243,7 +278,7 @@ in {
users.users.networkmanager = { users.users.networkmanager = {
isSystemUser = true; isSystemUser = true;
group = "networkmanager"; group = "networkmanager";
extraGroups = [ "trust-dns" ]; extraGroups = [ "hickory-dns" ];
}; };
# there is, unfortunately, no proper interface by which to plumb wpa_supplicant into the NixOS service, except by overlay. # there is, unfortunately, no proper interface by which to plumb wpa_supplicant into the NixOS service, except by overlay.

View File

@@ -16,5 +16,9 @@
${ipset}/bin/ipset create -! upnp hash:ip,port timeout 10 ${ipset}/bin/ipset create -! upnp hash:ip,port timeout 10
${iptables}/bin/iptables -A OUTPUT -d 239.255.255.250/32 -p udp -m udp --dport 1900 -j SET --add-set upnp src,src --exist ${iptables}/bin/iptables -A OUTPUT -d 239.255.255.250/32 -p udp -m udp --dport 1900 -j SET --add-set upnp src,src --exist
${iptables}/bin/iptables -A INPUT -p udp -m set --match-set upnp dst,dst -j ACCEPT ${iptables}/bin/iptables -A INPUT -p udp -m set --match-set upnp dst,dst -j ACCEPT
# IPv6 ruleset. ff02::/16 means *any* link-local multicast group (so this is probably more broad than it needs to be)
${ipset}/bin/ipset create -! upnp6 hash:ip,port timeout 10 family inet6
${iptables}/bin/ip6tables -A OUTPUT -d ff02::/16 -p udp -m udp --dport 1900 -j SET --add-set upnp6 src,src --exist
${iptables}/bin/ip6tables -A INPUT -p udp -m set --match-set upnp6 dst,dst -j ACCEPT
''; '';
} }

View File

@@ -5,7 +5,7 @@
# - generate config @ OVPN.com # - generate config @ OVPN.com
# - copy the Address, PublicKey, Endpoint from OVPN's config # - copy the Address, PublicKey, Endpoint from OVPN's config
{ config, lib, pkgs, ... }: { config, lib, ... }:
let let
# N.B.: OVPN issues each key (i.e. device) a different IP (addrV4), and requires you use it. # N.B.: OVPN issues each key (i.e. device) a different IP (addrV4), and requires you use it.
# the IP it issues can be used to connect to any of their VPNs. # the IP it issues can be used to connect to any of their VPNs.

View File

@@ -64,7 +64,12 @@
# it's an impurity that touches way more than i need and tends to cause hard-to-debug eval issues # it's an impurity that touches way more than i need and tends to cause hard-to-debug eval issues
# when it goes wrong. should i port my `nix-shell` scripts to something more tailored to my uses # when it goes wrong. should i port my `nix-shell` scripts to something more tailored to my uses
# and then delete `nixpkgs-overlays`? # and then delete `nixpkgs-overlays`?
"nixpkgs-overlays=/home/colin/dev/nixos/integrations/nixpkgs/nixpkgs-overlays.nix" # "nixpkgs-overlays=/home/colin/dev/nixos/integrations/nixpkgs/nixpkgs-overlays.nix"
# XXX(2024-09-02): nix 2.24.4 errors when nixpkgs-overlays includes a symlink component:
# "error: path '/home/colin/dev' is a symlink"
# apparently nix has to explicitly handle symlinks in every place it might encounter them,
# so the fixes inside nix for this are manual and fragile. dereference it ourselves:
"nixpkgs-overlays=${config.sane.fs."/home/colin/dev".symlink.target}/nixos/integrations/nixpkgs/nixpkgs-overlays.nix"
]; ];
# ensure new deployments have a source of this repo with which they can bootstrap. # ensure new deployments have a source of this repo with which they can bootstrap.

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,12 +1,11 @@
# strictly *decrease* the scope of the default nixos installation/config # strictly *decrease* the scope of the default nixos installation/config
{ lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
suidlessPam = pkgs.pam.overrideAttrs (upstream: { suidlessPam = pkgs.pam.overrideAttrs (upstream: {
# nixpkgs' pam hardcodes unix_chkpwd path to the /run/wrappers one, # nixpkgs' pam hardcodes unix_chkpwd path to the /run/wrappers one,
# but i don't want the wrapper, so undo that. # but i don't want the wrapper, so undo that.
# ideally i would patch this via an overlay, but pam is in the bootstrap so that forces a full rebuild. # ideally i would patch this via an overlay, but pam is in the bootstrap so that forces a full rebuild.
# TODO: add a `package` option to the nixos' pam module and substitute it that way.
postPatch = (if upstream.postPatch != null then upstream.postPatch else "") + '' postPatch = (if upstream.postPatch != null then upstream.postPatch else "") + ''
substituteInPlace modules/pam_unix/Makefile.am --replace-fail \ substituteInPlace modules/pam_unix/Makefile.am --replace-fail \
"/run/wrappers/bin/unix_chkpwd" "$out/bin/unix_chkpwd" "/run/wrappers/bin/unix_chkpwd" "$out/bin/unix_chkpwd"
@@ -39,8 +38,7 @@ in
])); ]));
}; };
options.security.pam.services = lib.mkOption { options.security.pam.services = lib.mkOption {
apply = services: let apply = lib.filterAttrs (name: _: !(builtins.elem name [
filtered = lib.filterAttrs (name: _: !(builtins.elem name [
# from <repo:nixos/nixpkgs:nixos/modules/security/pam.nix> # from <repo:nixos/nixpkgs:nixos/modules/security/pam.nix>
"i3lock" "i3lock"
"i3lock-color" "i3lock-color"
@@ -62,13 +60,7 @@ in
"usermod" "usermod"
# from <repo:nixos/nixpkgs:nixos/modules/system/boot/systemd/user.nix> # from <repo:nixos/nixpkgs:nixos/modules/system/boot/systemd/user.nix>
"systemd-user" #< N.B.: this causes the `systemd --user` service manager to not be started! "systemd-user" #< N.B.: this causes the `systemd --user` service manager to not be started!
])) services; ]));
in lib.mapAttrs (_serviceName: service: service // {
# replace references with the old pam_unix, which calls into /run/wrappers/bin/unix_chkpwd,
# with a pam_unix that calls into unix_chkpwd via the nix store.
# TODO: use `security.pam.package` instead once <https://github.com/NixOS/nixpkgs/pull/314791> lands.
text = lib.replaceStrings [" pam_unix.so" ] [ " ${suidlessPam}/lib/security/pam_unix.so" ] service.text;
}) filtered;
}; };
options.environment.systemPackages = lib.mkOption { options.environment.systemPackages = lib.mkOption {
@@ -111,7 +103,11 @@ in
# pkgs.which # pkgs.which
# pkgs.zstd # 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 { options.system.fsPackages = lib.mkOption {
@@ -212,5 +208,16 @@ in
# see: <repo:nixos/nixpkgs:nixos/modules/virtualisation/nixos-containers.nix> # see: <repo:nixos/nixpkgs:nixos/modules/virtualisation/nixos-containers.nix>
boot.enableContainers = lib.mkDefault false; 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 ];
security.pam.package = suidlessPam;
}; };
} }

View File

@@ -3,8 +3,8 @@
{ {
sane.programs.aerc = { sane.programs.aerc = {
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.wrapperType = "inplace"; #< /share/aerc/aerc.conf refers to other /share files by absolute path sandbox.wrapperType = "inplace"; #< /share/aerc/aerc.conf mentions (in comments) other (non-sandboxed) /share files by absolute path
sandbox.net = "clearnet"; sandbox.net = "clearnet";
secrets.".config/aerc/accounts.conf" = ../../../secrets/common/aerc_accounts.conf.bin; secrets.".config/aerc/accounts.conf" = ../../../secrets/common/aerc_accounts.conf.bin;
mime.associations."x-scheme-handler/mailto" = "aerc.desktop"; mime.associations."x-scheme-handler/mailto" = "aerc.desktop";

View File

@@ -15,8 +15,9 @@ in
}; };
# upstream alsa ships with PinePhone audio configs, but they don't actually produce sound. # upstream alsa ships with PinePhone audio configs, but they don't actually produce sound.
# - still true as of 2024-05-26 # - still true as of 2024-08-20
# - see: <https://github.com/alsa-project/alsa-ucm-conf/pull/134> # - see: <https://github.com/alsa-project/alsa-ucm-conf/pull/134>
# - see: <https://gitlab.com/postmarketOS/pmaports/-/issues/2115>
# #
# we can substitute working UCM conf in two ways: # we can substitute working UCM conf in two ways:
# 1. nixpkgs' override for the `alsa-ucm-conf` package # 1. nixpkgs' override for the `alsa-ucm-conf` package

View File

@@ -32,7 +32,7 @@
buildCost = 1; buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
persist.byStore.plaintext = [ persist.byStore.plaintext = [

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@
buildCost = 1; buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.autodetectCliPaths = "existingFile"; sandbox.autodetectCliPaths = "existingFile";

View File

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

View File

@@ -10,19 +10,33 @@
# - `LD_LIBRARY_PATH=/nix/store/ngwj3jqmxh8k4qji2z0lj7y1f8vzqrn2-nss-mdns-0.15.1/lib getent hosts desko.local` # - `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 # nss-mdns goes through avahi-daemon, so there IS caching here
# #
{ config, lib, ... }: { config, lib, pkgs, ... }:
let
cfg = config.sane.programs.avahi;
in
{ {
sane.programs.avahi = { sane.programs.avahi = {
sandbox.method = "bwrap"; packageUnwrapped = pkgs.avahi.overrideAttrs (upstream: {
# avahi wants to do its own sandboxing opaque to systemd & maybe in conflict with my bwrap.
# --no-drop-root disables that, so that i can e.g. run it as User=avahi, etc.
# do this here, because the nixos service isn't so easily patched.
postInstall = (upstream.postInstall or "") + ''
wrapProgram "$out/sbin/avahi-daemon" \
--add-flags --no-drop-root
'';
nativeBuildInputs = upstream.nativeBuildInputs ++ [
pkgs.makeBinaryWrapper
];
});
sandbox.method = "bunpen";
sandbox.whitelistDbus = [ "system" ]; sandbox.whitelistDbus = [ "system" ];
sandbox.net = "all"; #< otherwise it will show 'null' in place of each interface name. sandbox.net = "all"; #< otherwise it will show 'null' in place of each interface name.
sandbox.extraPaths = [ # sandbox.extraPaths = [ ]; #< may be missing some paths; only tried service discovery, not service advertisement.
"/" #< else the daemon exits immediately. TODO: decrease this scope.
];
}; };
services.avahi = lib.mkIf config.sane.programs.avahi.enabled {
services.avahi = lib.mkIf cfg.enabled {
enable = true; enable = true;
package = config.sane.programs.avahi.package; package = cfg.packageUnwrapped; #< use systemd sandboxing... not my own
publish.enable = true; publish.enable = true;
publish.userServices = true; publish.userServices = true;
nssmdns4 = true; nssmdns4 = true;
@@ -32,6 +46,7 @@
# particularly, the default config disallows loopback, which is kinda fucking retarded, right? # particularly, the default config disallows loopback, which is kinda fucking retarded, right?
"ens1" #< servo "ens1" #< servo
"enp5s0" #< desko "enp5s0" #< desko
"eth0"
"lo" "lo"
"wg-home" "wg-home"
"wlan0" #< moby "wlan0" #< moby
@@ -39,4 +54,54 @@
"wlp4s0" #< desko "wlp4s0" #< desko
]; ];
}; };
# fix "rpfilter drop ..." dmesg logspam.
# this might not be necessary?
networking.firewall.extraCommands = lib.mkIf cfg.enabled (with pkgs; ''
# after an outgoing mDNS query to the multicast address, open FW for incoming responses.
# ipset -! means "don't fail if set already exists"
${ipset}/bin/ipset create -! mdns hash:ip,port timeout 10
${iptables}/bin/iptables -A OUTPUT -d 239.255.255.250/32 -p udp -m udp --dport 5353 -j SET --add-set mdns src,src --exist
${iptables}/bin/iptables -A INPUT -p udp -m set --match-set mdns dst,dst -j ACCEPT
# IPv6 ruleset. ff02::/16 means *any* link-local multicast group (so this is probably more broad than it needs to be)
${ipset}/bin/ipset create -! mdns6 hash:ip,port timeout 10 family inet6
${iptables}/bin/ip6tables -A OUTPUT -d ff02::/16 -p udp -m udp --dport 5353 -j SET --add-set mdns6 src,src --exist
${iptables}/bin/ip6tables -A INPUT -p udp -m set --match-set mdns6 dst,dst -j ACCEPT
'');
systemd.services.avahi-daemon = lib.mkIf cfg.enabled {
# hardening: see `systemd-analyze security avahi-daemon`
serviceConfig.User = "avahi";
serviceConfig.Group = "avahi";
serviceConfig.AmbientCapabilities = "";
serviceConfig.CapabilityBoundingSet = "";
serviceConfig.LockPersonality = true;
serviceConfig.MemoryDenyWriteExecute = true;
serviceConfig.NoNewPrivileges = true;
serviceConfig.PrivateDevices = true;
serviceConfig.PrivateMounts = true;
serviceConfig.PrivateTmp = true;
serviceConfig.PrivateUsers = true;
serviceConfig.ProcSubset = "all";
serviceConfig.ProtectClock = true;
serviceConfig.ProtectControlGroups = true;
serviceConfig.ProtectHome = true;
serviceConfig.ProtectHostname = true;
serviceConfig.ProtectKernelLogs = true;
serviceConfig.ProtectKernelModules = true;
serviceConfig.ProtectKernelTunables = true;
serviceConfig.ProtectProc = "noaccess";
serviceConfig.ProtectSystem = "strict";
serviceConfig.RemoveIPC = true; #< this *might* slow down the initial connection?
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_NETLINK";
serviceConfig.RestrictRealtime = true;
serviceConfig.RestrictSUIDSGID = true;
serviceConfig.SystemCallArchitectures = "native";
serviceConfig.SystemCallFilter = [
"@system-service"
"@mount"
"~@resources"
# "~@privileged"
];
};
} }

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

@@ -24,7 +24,7 @@ let
in in
{ {
sane.programs.blast-ugjka = { sane.programs.blast-ugjka = {
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.net = "clearnet"; sandbox.net = "clearnet";
}; };
@@ -36,12 +36,12 @@ in
pkgs = [ "blast-ugjka" ]; pkgs = [ "blast-ugjka" ];
srcRoot = ./.; srcRoot = ./.;
}; };
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.net = "clearnet"; sandbox.net = "clearnet";
#v else it fails to reap its children (or, maybe, it fails to hook its parent's death signal?) #v else it fails to reap its children (or, maybe, it fails to hook its parent's death signal?)
#v might be possible to remove this, but kinda hard to see a clean way. #v might be possible to remove this, but kinda hard to see a clean way.
sandbox.isolatePids = false; sandbox.keepPidsAndProc = true;
suggestedPrograms = [ "blast-ugjka" "sane-die-with-parent" ]; suggestedPrograms = [ "blast-ugjka" "sane-die-with-parent" ];
}; };

View File

@@ -113,7 +113,7 @@ in
fs.".config/bonsai/bonsai_tree.json".symlink.target = pkgs.writers.writeJSON "bonsai_tree.json" cfg.config.transitions; fs.".config/bonsai/bonsai_tree.json".symlink.target = pkgs.writers.writeJSON "bonsai_tree.json" cfg.config.transitions;
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.extraRuntimePaths = [ sandbox.extraRuntimePaths = [
"bonsai" "bonsai"
]; ];

View File

@@ -3,12 +3,18 @@
sane.programs.brave = { sane.programs.brave = {
# convert eval error to build failure # convert eval error to build failure
packageUnwrapped = if (builtins.tryEval pkgs.brave).success then packageUnwrapped = if (builtins.tryEval pkgs.brave).success then
pkgs.brave pkgs.brave.overrideAttrs (upstream: {
# brave does crimes with `$0` which break under transparent wrapping
preFixup = (upstream.preFixup or "") + ''
substituteInPlace $out/opt/brave.com/brave/brave-browser \
--replace '$0' "$out/opt/brave.com/brave/brave-browser"
'';
})
else else
pkgs.runCommandLocal "brave-not-supported" {} "false" pkgs.runCommandLocal "brave-not-supported" {} "false"
; ;
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.wrapperType = "inplace"; # /opt/share/brave.com vendor-style packaging sandbox.wrapperType = "inplace"; #< package contains dangling symlinks which my wrapper doesn't understand
sandbox.net = "all"; sandbox.net = "all";
sandbox.extraHomePaths = [ sandbox.extraHomePaths = [
"dev" # for developing anything web-related "dev" # for developing anything web-related
@@ -21,7 +27,7 @@
sandbox.whitelistDri = true; sandbox.whitelistDri = true;
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
persist.byStore.cryptClearOnBoot = [ persist.byStore.ephemeral = [
".cache/BraveSoftware" ".cache/BraveSoftware"
".config/BraveSoftware" ".config/BraveSoftware"
]; ];

View File

@@ -4,7 +4,7 @@ let
in in
{ {
sane.programs.brightnessctl = { sane.programs.brightnessctl = {
sandbox.method = "landlock"; # also bwrap, but landlock is more responsive sandbox.method = "bunpen";
sandbox.extraPaths = [ sandbox.extraPaths = [
"/sys/class/backlight" "/sys/class/backlight"
"/sys/class/leds" "/sys/class/leds"

View File

@@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.bunpen;
in
{
sane.programs.bunpen = {
packageUnwrapped = pkgs.bunpen.overrideAttrs (base: {
# create a directory which holds just the `bunpen` so that we
# can add bunpen as a dependency to binaries via `PATH=/run/current-system/libexec/bunpen` without forcing rebuild every time bunpen changes
postInstall = ''
mkdir -p $out/libexec/bunpen
ln -s $out/bin/bunpen $out/libexec/bunpen/bunpen
'';
});
sandbox.enable = false;
};
environment.pathsToLink = lib.mkIf cfg.enabled [ "/libexec/bunpen" ];
}

View File

@@ -8,6 +8,23 @@
# - the bot will reply with auto-generated username/password plus a SIP server endpoint. # - the bot will reply with auto-generated username/password plus a SIP server endpoint.
# just copy those into gnome-calls' GUI configurator # just copy those into gnome-calls' GUI configurator
# - now gnome-calls can do outbound calls. inbound calls can be routed by messaging the bot: "configure calls" # - now gnome-calls can do outbound calls. inbound calls can be routed by messaging the bot: "configure calls"
#
# user guide:
# - "Use for Calls" means, "when i click a tel: URI, use this account": <https://gitlab.gnome.org/GNOME/calls/-/issues/513>
# - `calls -vvv` for verbosity
# - `SOFIA_DEBUG=9 NEA_DEBUG=9 NUA_DEBUG=9 NTA_DEBUG=9 SU_DEBUG=8 gnome-calls` to debug SIP related stuff
#
# LIMITATIONS, COMPATIBILITY (as of 2024-08-20):
# - when switching from wifi -> wwan (4g), may experience about a minute of audio loss.
# the call stays alive, but no sound in either direction.
# this appears to be ~40s of general net loss to servo-hn (NetworkManager being slow to switch the default device? wireguard being slow to refresh?),
# unknown how much time is lost in the upper layers (e.g. dns being refreshed)
# - wwan -> wifi switching is (near) flawless. prefer to keep modem powered until end of call, because of audio routing, but OK to power it off.
# - audio is not always routed to a good device when the modem is powered.
# solve by opening `pavucontrol`, go to "configuration" tab, change "Built-in audio" to anything and then back to "Make a phone call (Earpiece, Mic)".
# i expect my eg25-control-powered script messes with the audio routing.
# - `gnome-calls` takes about 2 minutes after launch until it shows the UI.
# seems to be sandbox related.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sane.programs.calls; cfg = config.sane.programs.calls;
@@ -24,18 +41,62 @@ in
}; };
}; };
packageUnwrapped = pkgs.rmDbusServicesInPlace (pkgs.calls.overrideAttrs (upstream: { packageUnwrapped = pkgs.rmDbusServicesInPlace ((pkgs.calls.override {
gtk3 = pkgs.gtk4;
libpeas = pkgs.libpeas2;
wrapGAppsHook3 = pkgs.wrapGAppsHook4;
sofia_sip = pkgs.sofia_sip.overrideAttrs (upstream: {
# use linphone's sofia_sip.
# Freeswitch sofia_sip has a bug where a failed DNS query will never return to the caller.
# see `outgoing_answer_a`: in linphone's this already calls the user's callback; in Freeswitch there's a branch which leaves the caller hanging.
version = "1.13.45bc-unstable-2024-08-05";
src = pkgs.fetchFromGitLab {
domain = "gitlab.linphone.org";
owner = "BC/public/external";
repo = "sofia-sip";
rev = "b924a57e8eeb24e8b9afc5fd0fb9b51d5993fe5d";
hash = "sha256-1VbKV+eAJ80IMlubNl7774B7QvLv4hE8SXANDSD9sRU=";
};
});
}).overrideAttrs (upstream: {
# XXX(2024-08-08): v46.3 has a bug where if it has no network connection on launch, it forever stays disconnected & never retries
version = "47_beta.0-unstable-2024-08-08";
src = lib.warnIf (lib.versionOlder "47.0" upstream.version) "gnome-calls outdated; remove src override? (keep UI patches though!)" pkgs.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = "calls";
fetchSubmodules = true;
# rev = "main";
rev = "ff213579a52222e7c95e585843d97b5b817b2a8b";
hash = "sha256-0QYC8FJpfg/X2lIjBDooba2idUfpJNQhcpv8Z5I/B4k=";
};
patches = (upstream.patches or []) ++ [ patches = (upstream.patches or []) ++ [
(pkgs.fetchpatch { (pkgs.fetchpatch {
# usability improvement... if the UI is visible, then i can receive calls. otherwise, i can't! # usability improvement... ties the UI visibility to the connection state, so if the UI is gone, then i can't receive calls (and will hopefully notice that more easily!)
url = "https://git.uninsane.org/colin/gnome-calls/commit/a19166d85927e59662fae189a780eed18bf876ce.patch"; url = "https://git.uninsane.org/colin/gnome-calls/commit/a19166d85927e59662fae189a780eed18bf876ce.patch";
name = "exit on close (i.e. never daemonize)"; name = "exit on close (i.e. never daemonize)";
hash = "sha256-NoVQV2TlkCcsBt0uwSyK82hBKySUW4pADrJVfLFvWgU="; hash = "sha256-NoVQV2TlkCcsBt0uwSyK82hBKySUW4pADrJVfLFvWgU=";
}) })
(pkgs.fetchpatch {
# solves the issue where flakey DNS (especially at boot) could take down call connectivity indefinitely.
# see: <https://gitlab.gnome.org/GNOME/calls/-/issues/659>
url = "https://git.uninsane.org/colin/gnome-calls/commit/db9192a69cff2b20b5e8870e34a9b1e694a81c7f.patch";
name = "sip: attempt reconnection anytime network is routable, not just when routability changes";
hash = "sha256-agPM3XKXiP5Rxrl26DNA+pnhEPTBEBQBxZe3CoptgII=";
})
];
nativeBuildInputs = upstream.nativeBuildInputs ++ [
pkgs.dbus #< for dbus-run-session (should be test only, but it's not)
];
buildInputs = upstream.buildInputs ++ [
pkgs.libadwaita
]; ];
})); }));
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.net = "vpn.wg-home"; #< XXX(2024/07/05): my cell carrier seems to block RTP, so tunnel it. sandbox.net = "vpn.wg-home"; #< XXX(2024/07/05): my cell carrier seems to block RTP, so tunnel it.
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # necessary for secrets, at the minimum sandbox.whitelistDbus = [ "user" ]; # necessary for secrets, at the minimum
@@ -55,6 +116,10 @@ in
"gnome-keyring" # to remember the password "gnome-keyring" # to remember the password
]; ];
mime.associations."x-scheme-handler/tel" = "org.gnome.Calls.desktop";
mime.associations."x-scheme-handler/sip" = "org.gnome.Calls.desktop";
mime.associations."x-scheme-handler/sips" = "org.gnome.Calls.desktop";
services.gnome-calls = { services.gnome-calls = {
description = "gnome-calls daemon to monitor incoming SIP calls"; description = "gnome-calls daemon to monitor incoming SIP calls";
partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ]; partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];

View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
{
sane.programs.capsh = {
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.libcap "capsh";
sandbox.enable = false; #< i use `capsh` as a sandboxer.
};
}

View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
sane.programs.captree = {
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.libcap-with-captree "captree";
sandbox.method = "bunpen";
sandbox.keepPidsAndProc = true;
};
}

View File

@@ -3,7 +3,7 @@
sane.programs.celeste64 = { sane.programs.celeste64 = {
buildCost = 1; buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDri = true; sandbox.whitelistDri = true;
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;

View File

@@ -1,7 +1,7 @@
{ pkgs, ... }: { ... }:
{ {
sane.programs.conky = { sane.programs.conky = {
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.net = "clearnet"; #< for the scripts it calls (weather) sandbox.net = "clearnet"; #< for the scripts it calls (weather)
sandbox.extraPaths = [ sandbox.extraPaths = [
"/sys/class/power_supply" "/sys/class/power_supply"

View File

@@ -15,7 +15,7 @@
buildCost = 1; buildCost = 1;
sandbox.method = "bwrap"; # landlock gives: _multiprocessing.SemLock: Permission Denied sandbox.method = "bwrap";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # mpris sandbox.whitelistDbus = [ "user" ]; # mpris
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;

View File

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

View File

@@ -1,35 +1,10 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.curlftpfs = { sane.programs.curlftpfs = {
packageUnwrapped = pkgs.curlftpfs.overrideAttrs (upstream: { packageUnwrapped = pkgs.curlftpfs-sane;
# my fork includes: sandbox.method = "bunpen";
# - per-operation timeouts (CURLOPT_TIMEOUT; would use CURLOPT_LOW_SPEED_TIME/CURLOPT_LOW_SPEED_LIMIT but they don't apply) sandbox.net = "all";
# - exit on timeout (so that one knows to abort the mount, instead of waiting indefinitely) sandbox.autodetectCliPaths = "existing";
# - support for "meta" keys found in /etc/fstab sandbox.keepPids = true;
src = pkgs.fetchFromGitea {
domain = "git.uninsane.org";
owner = "colin";
repo = "curlftpfs";
rev = "0890d32e709b5a01153f00d29ed4c00299744f5d";
hash = "sha256-M28PzHqEAkezQdtPeL16z56prwl3BfMZqry0dlpXJls=";
};
# `mount` clears PATH before calling the mount helper (see util-linux/lib/env.c),
# so the traditional /etc/fstab approach of fstype=fuse and device = curlftpfs#URI doesn't work.
# instead, install a `mount.curlftpfs` mount helper. this is what programs like `gocryptfs` do.
postInstall = (upstream.postInstall or "") + ''
ln -s curlftpfs $out/bin/mount.fuse.curlftpfs
ln -s curlftpfs $out/bin/mount.curlftpfs
'';
});
# TODO: try to sandbox this better? maybe i can have fuse (unsandboxed) invoke curlftpfs (sandboxed)?
# - landlock gives EPERM
# - bwrap just silently doesn't mount it, maybe because of setuid stuff around fuse?
# sandbox.method = "capshonly";
# sandbox.net = "all";
# sandbox.capabilities = [
# "sys_admin"
# "sys_module"
# ];
}; };
} }

View File

@@ -32,13 +32,13 @@ in
''; '';
}); });
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.extraRuntimePaths = [ sandbox.extraRuntimePaths = [
"/" #< it needs to create a file in the root. TODO: move the bus handle into a sandboxable subdirectory "dbus"
]; ];
sandbox.isolatePids = false; #< not actually sure *why* this is necessary, but it is sandbox.keepPids = true; #< not actually sure *why* this is necessary, but it is
env.DBUS_SESSION_BUS_ADDRESS = "unix:path=$XDG_RUNTIME_DIR/bus"; env.DBUS_SESSION_BUS_ADDRESS = "unix:path=$XDG_RUNTIME_DIR/dbus/bus";
# normally systemd would create a dbus session for us, but if you configure it not to do that # normally systemd would create a dbus session for us, but if you configure it not to do that
# then we can create our own. not sure if there's a dependency ordering issue here: lots # then we can create our own. not sure if there's a dependency ordering issue here: lots
@@ -47,8 +47,12 @@ in
services.dbus = { services.dbus = {
description = "dbus user session"; description = "dbus user session";
partOf = lib.mkIf cfg.config.autostart [ "default" ]; partOf = lib.mkIf cfg.config.autostart [ "default" ];
command = "dbus-daemon --session --nofork --address=$DBUS_SESSION_BUS_ADDRESS"; command = pkgs.writeShellScript "dbus-start" ''
readiness.waitExists = [ "$XDG_RUNTIME_DIR/bus" ]; # have to create the dbus directory before launching so that it's available in the sandbox
mkdir -p "$XDG_RUNTIME_DIR/dbus"
dbus-daemon --session --nofork --address="$DBUS_SESSION_BUS_ADDRESS"
'';
readiness.waitExists = [ "$XDG_RUNTIME_DIR/dbus/bus" ];
}; };
}; };
} }

View File

@@ -25,8 +25,7 @@ in
}; };
packageUnwrapped = pkgs.rmDbusServicesInPlace pkgs.dconf; packageUnwrapped = pkgs.rmDbusServicesInPlace pkgs.dconf;
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.wrapperType = "inplace"; #< dbus/systemd services live in `.out` but point to `.lib` data.
sandbox.whitelistDbus = [ "user" ]; sandbox.whitelistDbus = [ "user" ];
persist.byStore.private = [ persist.byStore.private = [
".config/dconf" ".config/dconf"

View File

@@ -12,20 +12,25 @@
./ausyscall.nix ./ausyscall.nix
./avahi.nix ./avahi.nix
./bemenu.nix ./bemenu.nix
./bitcoin-cli.nix
./blast-ugjka ./blast-ugjka
./bonsai.nix ./bonsai.nix
./brave.nix ./brave.nix
./brightnessctl.nix ./brightnessctl.nix
./bubblewrap.nix ./bubblewrap.nix
./bunpen.nix
./callaudiod.nix ./callaudiod.nix
./calls.nix ./calls.nix
./cantata.nix ./cantata.nix
./capsh.nix
./captree.nix
./catt.nix ./catt.nix
./celeste64.nix ./celeste64.nix
./chatty.nix ./chatty.nix
./conky ./conky
./cozy.nix ./cozy.nix
./cups.nix ./cups.nix
./curl.nix
./curlftpfs.nix ./curlftpfs.nix
./dbus.nix ./dbus.nix
./dconf.nix ./dconf.nix
@@ -35,15 +40,19 @@
./dissent.nix ./dissent.nix
./dtrx.nix ./dtrx.nix
./eg25-control.nix ./eg25-control.nix
./eg25-manager.nix
./element-desktop.nix ./element-desktop.nix
./engrampa.nix ./engrampa.nix
./epiphany.nix ./epiphany.nix
./errno.nix ./errno.nix
./evince.nix ./evince.nix
./exiftool.nix
./fcitx5.nix ./fcitx5.nix
./feedbackd.nix ./feedbackd.nix
./firefox.nix ./firefox
./firefox-xdg-open.nix
./flare-signal.nix ./flare-signal.nix
./foliate.nix
./fontconfig.nix ./fontconfig.nix
./fractal.nix ./fractal.nix
./free.nix ./free.nix
@@ -63,43 +72,53 @@
./gnome-maps.nix ./gnome-maps.nix
./gnome-weather.nix ./gnome-weather.nix
./go2tv.nix ./go2tv.nix
./gocryptfs.nix
./gpodder.nix ./gpodder.nix
./gpsd.nix ./gpsd.nix
./gps-share.nix ./gps-share.nix
./grimshot.nix ./grimshot.nix
./gst-device-monitor.nix ./gst-device-monitor.nix
./gst-launch.nix
./gthumb.nix ./gthumb.nix
./gvfs.nix ./gvfs.nix
./handbrake.nix ./handbrake.nix
./haredoc.nix
./helix.nix ./helix.nix
./htop ./htop
./iio-sensor-proxy.nix ./iio-sensor-proxy.nix
./imagemagick.nix ./imagemagick.nix
./inkscape.nix
./jellyfin-media-player.nix ./jellyfin-media-player.nix
./kdenlive.nix ./kdenlive.nix
./keymapp.nix ./keymapp.nix
./komikku.nix ./komikku.nix
./koreader ./koreader
./krita.nix
./less.nix ./less.nix
./lftp.nix ./lftp.nix
./lgtrombetta-compass.nix
./libcamera.nix
./libreoffice.nix ./libreoffice.nix
./lemoa.nix ./lemoa.nix
./loupe.nix ./loupe.nix
./mako.nix ./mako.nix
./megapixels.nix ./megapixels.nix
./megapixels-next.nix
./mepo.nix ./mepo.nix
./mimeo ./mimeo
./mimetype.nix
./mmcli.nix ./mmcli.nix
./mopidy.nix ./mopidy.nix
./mpv ./mpv
./msmtp.nix ./msmtp.nix
./nautilus.nix ./nautilus.nix
./neovim.nix ./neovim
./networkmanager_dmenu ./networkmanager_dmenu
./newsflash.nix ./newsflash.nix
./nheko.nix ./nheko.nix
./nicotine-plus.nix ./nicotine-plus.nix
./nix-index.nix ./nix-index.nix
./nix.nix
./nmcli.nix ./nmcli.nix
./notejot.nix ./notejot.nix
./ntfy-sh.nix ./ntfy-sh.nix
@@ -110,8 +129,9 @@
./ols.nix ./ols.nix
./open-in-mpv.nix ./open-in-mpv.nix
./pactl.nix ./pactl.nix
./papers.nix
./pidof.nix ./pidof.nix
./pipewire.nix ./pipewire
./pkill.nix ./pkill.nix
./planify.nix ./planify.nix
./portfolio-filemanager.nix ./portfolio-filemanager.nix
@@ -121,12 +141,16 @@
./rhythmbox.nix ./rhythmbox.nix
./ripgrep.nix ./ripgrep.nix
./rofi ./rofi
./rsyslog
./rtkit.nix ./rtkit.nix
./s6-rc.nix ./s6-rc.nix
./sane-deadlines.nix
./sane-input-handler ./sane-input-handler
./sane-open.nix ./sane-open.nix
./sane-private-unlock-remote.nix
./sane-screenshot.nix ./sane-screenshot.nix
./sane-scripts.nix ./sane-scripts.nix
./sane-secrets-unlock.nix
./sane-sysload.nix ./sane-sysload.nix
./sane-theme.nix ./sane-theme.nix
./sanebox.nix ./sanebox.nix
@@ -136,6 +160,9 @@
./sfeed.nix ./sfeed.nix
./shadow.nix ./shadow.nix
./signal-desktop.nix ./signal-desktop.nix
./sm64ex-coop.nix
./sm64ex-coop-deluxe.nix
./soundconverter.nix
./splatmoji.nix ./splatmoji.nix
./spot.nix ./spot.nix
./spotify.nix ./spotify.nix
@@ -155,6 +182,7 @@
./tor-browser.nix ./tor-browser.nix
./tuba.nix ./tuba.nix
./unl0kr ./unl0kr
./v4l-utils.nix
./via.nix ./via.nix
./visidata.nix ./visidata.nix
./vlc.nix ./vlc.nix
@@ -169,10 +197,13 @@
./wvkbd.nix ./wvkbd.nix
./xarchiver.nix ./xarchiver.nix
./xdg-desktop-portal.nix ./xdg-desktop-portal.nix
./xdg-desktop-portal-gnome
./xdg-desktop-portal-gtk.nix ./xdg-desktop-portal-gtk.nix
./xdg-desktop-portal-wlr.nix ./xdg-desktop-portal-wlr.nix
./xdg-terminal-exec.nix ./xdg-terminal-exec.nix
./xdg-utils.nix ./xdg-utils.nix
./youtube-tui.nix
./yt-dlp.nix
./zathura.nix ./zathura.nix
./zeal.nix ./zeal.nix
./zecwallet-lite.nix ./zecwallet-lite.nix

View File

@@ -14,7 +14,7 @@
buildCost = 1; buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.wrapperType = "inplace"; # share/search_providers/ calls back into the binary, weird wrap semantics sandbox.wrapperType = "inplace"; # share/search_providers/ calls back into the binary, weird wrap semantics
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.net = "clearnet"; sandbox.net = "clearnet";

View File

@@ -58,7 +58,7 @@ in
webrtc-audio-processing = null; webrtc-audio-processing = null;
}; };
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications sandbox.whitelistDbus = [ "user" ]; # notifications

View File

@@ -31,7 +31,7 @@ in
--replace-fail '"login"' '"Default_keyring"' --replace-fail '"login"' '"Default_keyring"'
''; '';
}); });
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications sandbox.whitelistDbus = [ "user" ]; # notifications

View File

@@ -9,7 +9,7 @@
# build without rpm support, since `rpm` package doesn't cross-compile. # build without rpm support, since `rpm` package doesn't cross-compile.
rpm = null; rpm = null;
}; };
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.whitelistPwd = true; sandbox.whitelistPwd = true;
sandbox.autodetectCliPaths = "existing"; #< for the archive sandbox.autodetectCliPaths = "existing"; #< for the archive
}; };

View File

@@ -6,8 +6,9 @@ in
sane.programs.eg25-control = { sane.programs.eg25-control = {
suggestedPrograms = [ "mmcli" ]; suggestedPrograms = [ "mmcli" ];
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.extraPaths = [ sandbox.extraPaths = [
"/dev/gpiochip1"
"/sys/class/modem-power" "/sys/class/modem-power"
"/sys/devices" "/sys/devices"
# "/var/lib/eg25-control" # "/var/lib/eg25-control"
@@ -32,6 +33,7 @@ in
startCommand = "eg25-control --enable-gps --dump-debug-info --verbose"; startCommand = "eg25-control --enable-gps --dump-debug-info --verbose";
cleanupCommand = "eg25-control --disable-gps --dump-debug-info --verbose"; cleanupCommand = "eg25-control --disable-gps --dump-debug-info --verbose";
depends = [ "eg25-control-powered" ]; depends = [ "eg25-control-powered" ];
partOf = [ "gps" ];
}; };
persist.byStore.plaintext = [ ".cache/eg25-control" ]; #< for cached agps data persist.byStore.plaintext = [ ".cache/eg25-control" ]; #< for cached agps data

View File

@@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.sane.programs.eg25-manager;
in
{
sane.programs.eg25-manager = {
# it has to be enabled system-wide for its udev rules to make it into /run/current-system/sw/lib/udev/rules.d.
enableFor.system = lib.mkIf (builtins.any (en: en) (builtins.attrValues cfg.enableFor.user)) true;
};
# not sure if this is required or if it's enough that eg25-manager is on system.packages.
services.udev.packages = lib.mkIf cfg.enabled [ cfg.package ];
}

View File

@@ -27,7 +27,7 @@
buildCost = 1; buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications sandbox.whitelistDbus = [ "user" ]; # notifications
@@ -45,6 +45,9 @@
"Videos/servo" "Videos/servo"
"tmp" "tmp"
]; ];
sandbox.extraPaths = [
"/dev/snd" #< needed only when playing embedded audio (not embedded video!)
];
# creds/session keys, etc # creds/session keys, etc
persist.byStore.private = [ ".config/Element" ]; persist.byStore.private = [ ".config/Element" ];

View File

@@ -2,7 +2,7 @@
{ {
sane.programs."mate.engrampa" = { sane.programs."mate.engrampa" = {
packageUnwrapped = pkgs.rmDbusServices pkgs.mate.engrampa; packageUnwrapped = pkgs.rmDbusServices pkgs.mate.engrampa;
sandbox.method = "bwrap"; # TODO:sandbox: untested sandbox.method = "bunpen";
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.autodetectCliPaths = "existingOrParent"; sandbox.autodetectCliPaths = "existingOrParent";
sandbox.extraHomePaths = [ sandbox.extraHomePaths = [

View File

@@ -8,7 +8,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.epiphany = { sane.programs.epiphany = {
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.wrapperType = "inplace"; # /share/epiphany/default-bookmarks.rdf refers back to /share; dbus files to /libexec sandbox.wrapperType = "inplace"; # /share/epiphany/default-bookmarks.rdf refers back to /share; dbus files to /libexec
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;

View File

@@ -1,21 +1,17 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.errno = { 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. # 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: { packageUnwrapped = pkgs.moreutils.overrideAttrs (base: {
makeFlags = (base.makeFlags or []) ++ [ makeFlags = (base.makeFlags or []) ++ [
"BINS=errno" "BINS=errno"
"MANS=errno.1" "MANS=errno.1"
"PERLSCRIPTS=errno" #< Makefile errors if empty, but this works :) "PERLSCRIPTS=errno" #< Makefile errors if empty, but this works :)
"INSTALL_BIN=install"
]; ];
#v disable the perl-specific stuff buildInputs = []; #< errno has no runtime perl deps, and they don't cross compile, so disable them.
propagatedBuildInputs = [];
postInstall = "";
}); });
sandbox.method = "landlock"; sandbox.method = "bunpen";
}; };
} }

View File

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

View File

@@ -24,7 +24,7 @@
# - nixpkgs has a few themes: `fcitx5-{material-color,nord,rose-pine}` # - nixpkgs has a few themes: `fcitx5-{material-color,nord,rose-pine}`
# - NUR has a few themes # - NUR has a few themes
# - <https://github.com/catppuccin/fcitx5> # - <https://github.com/catppuccin/fcitx5>
{ lib, pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.fcitx5 = { sane.programs.fcitx5 = {
packageUnwrapped = pkgs.fcitx5-with-addons.override { packageUnwrapped = pkgs.fcitx5-with-addons.override {
@@ -34,7 +34,7 @@
]; ];
}; };
sandbox.method = "bwrap"; sandbox.method = "bunpen";
sandbox.whitelistDbus = [ "user" ]; sandbox.whitelistDbus = [ "user" ];
sandbox.whitelistWayland = true; # for `fcitx5-configtool, if nothing else` sandbox.whitelistWayland = true; # for `fcitx5-configtool, if nothing else`
sandbox.extraHomePaths = [ sandbox.extraHomePaths = [

View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
sane.programs.firefox-xdg-open = {
packageUnwrapped = pkgs.firefox-extensions.firefox-xdg-open.systemComponent;
sandbox.method = "bunpen";
sandbox.whitelistDbus = [ "user" ]; # for xdg-open/portals
mime.associations."x-scheme-handler/xdg-open" = "xdg-open.desktop";
suggestedPrograms = [ "xdg-utils" ];
};
}

View File

@@ -1,388 +0,0 @@
# common settings to toggle (at runtime, in about:config):
# > security.ssl.require_safe_negotiation
# librewolf is a forked firefox which patches firefox to allow more things
# (like default search engines) to be configurable at runtime.
# many of the settings below won't have effect without those patches.
# see: https://gitlab.com/librewolf-community/settings/-/blob/master/distribution/policies.json
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.sane.programs.firefox.config;
mobile-prefs = lib.optionals false pkgs.librewolf-pmos-mobile.extraPrefsFiles;
# allow easy switching between firefox and librewolf with `defaultSettings`, below
librewolfSettings = {
browser = pkgs.librewolf-unwrapped.overrideAttrs (upstream: {
# TEMP(2023/11/21): fix eval bug in wrapFirefox
# see: <https://github.com/NixOS/nixpkgs/pull/244591>
passthru = upstream.passthru // {
requireSigning = false;
allowAddonSideload = true;
};
});
extraPrefsFiles = pkgs.librewolf-unwrapped.extraPrefsFiles ++ mobile-prefs;
libName = "librewolf";
dotDir = ".librewolf";
cacheDir = ".cache/librewolf";
desktop = "librewolf.desktop";
};
firefoxSettings = {
browser = pkgs.firefox-esr-unwrapped;
extraPrefsFiles = mobile-prefs;
libName = "firefox";
dotDir = ".mozilla/firefox";
cacheDir = ".cache/mozilla";
desktop = "firefox.desktop";
};
# defaultSettings = firefoxSettings;
defaultSettings = librewolfSettings;
packageUnwrapped = (pkgs.wrapFirefox cfg.browser.browser {
# inherit the default librewolf.cfg
# it can be further customized via ~/.librewolf/librewolf.overrides.cfg
inherit (cfg.browser) extraPrefsFiles libName;
nativeMessagingHosts = lib.optionals cfg.addons.browserpass-extension.enable [
pkgs.browserpass
] ++ lib.optionals cfg.addons.fxCast.enable [
pkgs.fx-cast-bridge
];
nixExtensions = concatMap (ext: optional ext.enable ext.package) (attrValues cfg.addons);
extraPolicies = {
FirefoxHome = {
Search = true;
Pocket = false;
Snippets = false;
TopSites = false;
Highlights = false;
};
NoDefaultBookmarks = true;
OfferToSaveLogins = false;
OfferToSaveLoginsDefault = false;
PasswordManagerEnabled = false;
SearchEngines = {
Default = "DuckDuckGo";
};
UserMessaging = {
ExtensionRecommendations = false;
FeatureRecommendations = false;
SkipOnboarding = true;
UrlbarInterventions = false;
WhatsNew = false;
};
# these were taken from Librewolf
AppUpdateURL = "https://localhost";
DisableAppUpdate = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DisableSystemAddonUpdate = true;
DisableFirefoxStudies = true;
DisableTelemetry = true;
DisableFeedbackCommands = true;
DisablePocket = true;
DisableSetDesktopBackground = false;
# remove many default search providers
# XXX this seems to prevent the `nixExtensions` from taking effect
# Extensions.Uninstall = [
# "google@search.mozilla.org"
# "bing@search.mozilla.org"
# "amazondotcom@search.mozilla.org"
# "ebay@search.mozilla.org"
# "twitter@search.mozilla.org"
# ];
# XXX doesn't seem to have any effect...
# docs: https://github.com/mozilla/policy-templates#homepage
# Homepage = {
# HomepageURL = "https://uninsane.org/";
# StartPage = "homepage";
# };
# NewTabPage = true;
};
# extraPrefs = ...
}).overrideAttrs (base: {
# 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.
buildCommand = (base.buildCommand or "") + ''
mkdir omni
echo "omni.ja BEFORE:"
ls -l $(readlink $out/lib/${cfg.browser.libName}/browser/omni.ja)
echo "unzipping omni.ja"
# N.B. `zip` exits non-zero even on successful extraction, if the file didn't 100% obey spec
${pkgs.buildPackages.unzip}/bin/unzip $out/lib/${cfg.browser.libName}/browser/omni.ja -d omni || true
echo "removing old omni.ja"
rm $out/lib/${cfg.browser.libName}/browser/omni.ja
echo "patching omni.ja"
${pkgs.buildPackages.gnused}/bin/sed -i s'/devtools-commandkey-inspector = C/devtools-commandkey-inspector = VK_F12/' omni/localization/en-US/devtools/startup/key-shortcuts.ftl
echo "re-zipping omni.ja"
pushd omni; ${pkgs.buildPackages.zip}/bin/zip $out/lib/${cfg.browser.libName}/browser/omni.ja -r ./*; popd
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 postFixup
'';
});
addonOpts = types.submodule {
options = {
package = mkOption {
type = types.package;
};
enable = mkOption {
type = types.bool;
};
};
};
configOpts = {
options = {
browser = mkOption {
default = defaultSettings;
type = types.anything;
};
persistData = mkOption {
description = "optional store name to which persist browsing data (like history)";
type = types.nullOr types.str;
default = null;
};
persistCache = mkOption {
description = "optional store name to which persist browser cache";
type = types.nullOr types.str;
default = "cryptClearOnBoot";
};
addons = mkOption {
type = types.attrsOf addonOpts;
default = {};
};
};
};
in
{
config = mkMerge [
({
sane.programs.firefox.configOption = mkOption {
type = types.submodule configOpts;
default = {};
};
sane.programs.firefox.config.addons = {
fxCast = {
# add a menu to cast to chromecast devices, but it doesn't seem to work very well.
# right click (or shift+rc) a video, then select "cast".
# - asciinema.org: icon appears, but glitches when clicked.
# - youtube.com: no icon appears, even when site is whitelisted.
# future: maybe better to have browser open all videos in mpv, and then use mpv for casting.
# see e.g. `ff2mpv`, `open-in-mpv` (both are packaged in nixpkgs)
package = pkgs.firefox-extensions.fx_cast;
enable = lib.mkDefault false;
};
browserpass-extension = {
package = pkgs.firefox-extensions.browserpass-extension;
enable = lib.mkDefault true;
};
bypass-paywalls-clean = {
package = pkgs.firefox-extensions.bypass-paywalls-clean;
enable = lib.mkDefault true;
};
ctrl-shift-c-should-copy = {
package = pkgs.firefox-extensions.ctrl-shift-c-should-copy;
enable = lib.mkDefault false; # prefer patching firefox source code, so it works in more places
};
ether-metamask = {
package = pkgs.firefox-extensions.ether-metamask;
enable = lib.mkDefault false; # until i can disable the first-run notification
};
i2p-in-private-browsing = {
package = pkgs.firefox-extensions.i2p-in-private-browsing;
enable = lib.mkDefault config.services.i2p.enable;
};
i-still-dont-care-about-cookies = {
package = pkgs.firefox-extensions.i-still-dont-care-about-cookies;
enable = lib.mkDefault false; #< obsoleted by uBlock Origin annoyances/cookies lists
};
open-in-mpv = {
# test: `open-in-mpv 'mpv:///open?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ'`
package = pkgs.firefox-extensions.open-in-mpv;
enable = lib.mkDefault config.sane.programs.open-in-mpv.enabled;
};
sidebery = {
package = pkgs.firefox-extensions.sidebery;
enable = lib.mkDefault true;
};
sponsorblock = {
package = pkgs.firefox-extensions.sponsorblock;
enable = lib.mkDefault true;
};
ublacklist = {
package = pkgs.firefox-extensions.ublacklist;
enable = lib.mkDefault false;
};
ublock-origin = {
package = pkgs.firefox-extensions.ublock-origin;
enable = lib.mkDefault true;
};
};
})
({
sane.programs.firefox = {
inherit packageUnwrapped;
sandbox.method = "bwrap"; # landlock works, but requires all of /proc to be linked
sandbox.wrapperType = "inplace"; # trivial package; cheap enough to wrap inplace
sandbox.net = "all";
sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # mpris
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
"dev" # for developing anything web-related
# for uploads/downloads.
# it still needs these paths despite using the portal's file-chooser :?
"tmp"
"Pictures/albums"
"Pictures/cat"
"Pictures/from"
"Pictures/Photos"
"Pictures/Screenshots"
"Pictures/servo-macros"
] ++ lib.optionals cfg.addons.browserpass-extension.enable [
# browserpass needs these paths:
# - knowledge/secrets/accounts: where the encrypted account secrets live
# at least one of:
# - .config/sops: for the sops key which can decrypt account secrets
# - .ssh: to unlock the sops key, if not unlocked (`sane-secrets-unlock`)
# 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"
# ".config/sops"
"knowledge/secrets/accounts"
];
fs.".config/sops".dir = lib.mkIf cfg.addons.browserpass-extension.enable {}; #< needs to be created, not *just* added to the sandbox
suggestedPrograms = [
"open-in-mpv"
];
mime.associations = let
inherit (cfg.browser) desktop;
in {
"text/html" = desktop;
"x-scheme-handler/http" = desktop;
"x-scheme-handler/https" = desktop;
"x-scheme-handler/about" = desktop;
"x-scheme-handler/unknown" = desktop;
};
# env.BROWSER = "${package}/bin/${cfg.browser.libName}";
env.BROWSER = cfg.browser.libName; # used by misc tools like xdg-email, as fallback
# uBlock configuration:
fs."${cfg.browser.dotDir}/managed-storage/uBlock0@raymondhill.net.json".symlink.target = cfg.addons.ublock-origin.package.makeConfig {
# more filter lists are available here:
# - <https://easylist.to>
# - <https://github.com/easylist/easylist.git>
# - <https://github.com/yokoffing/filterlists>
filterFiles = let
getUasset = n: "${pkgs.uassets}/share/filters/${n}.txt";
in [
# default ublock filters:
(getUasset "ublock-filters")
(getUasset "ublock-badware")
(getUasset "ublock-privacy")
(getUasset "ublock-quick-fixes")
(getUasset "ublock-unbreak")
(getUasset "easylist")
(getUasset "easyprivacy")
# (getUasset "urlhaus-1") #< TODO: i think this is the same as urlhaus-filter-online
(getUasset "urlhaus-filter-online")
# (getUasset "plowe-0") #< TODO: where does this come from?
# (getUasset "ublock-cookies-adguard") #< TODO: where does this come from?
# filters i've added:
(getUasset "easylist-annoyances") #< blocks in-page popups, "social media content" (e.g. FB like button; improves loading time)
(getUasset "easylist-cookies") #< blocks GDPR cookie consent popovers (e.g. at stackoverflow.com)
# (getUasset "ublock-annoyances-others")
# (getUasset "ublock-annoyances-cookies")
];
};
# TODO: this is better suited in `extraPrefs` during `wrapFirefox` call
fs."${cfg.browser.dotDir}/${cfg.browser.libName}.overrides.cfg".symlink.text = ''
// if we can't query the revocation status of a SSL cert because the issuer is offline,
// treat it as unrevoked.
// see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do>
defaultPref("security.OCSP.require", false);
// scrollbar configuration, see: <https://artemis.sh/2023/10/12/scrollbars.html>
// style=4 gives rectangular scrollbars
// could also enable "always show scrollbars" in about:preferences -- not sure what the actual pref name for that is
// note that too-large scrollbars (like 50px wide, even 20px) tend to obscure content (and make buttons unclickable)
defaultPref("widget.non-native-theme.scrollbar.size.override", 14);
defaultPref("widget.non-native-theme.scrollbar.style", 4);
// disable inertial/kinetic/momentum scrolling because it just gets in the way on touchpads
// source: <https://kparal.wordpress.com/2019/10/31/disabling-kinetic-scrolling-in-firefox/>
defaultPref("apz.gtk.kinetic_scroll.enabled", false);
// open external URIs/files via xdg-desktop-portal.
defaultPref("widget.use-xdg-desktop-portal.mime-handler", 1);
defaultPref("widget.use-xdg-desktop-portal.open-uri", 1);
defaultPref("browser.toolbars.bookmarks.visibility", "never");
// configure which extensions are visible by default (TODO: requires a lot of trial and error)
// defaultPref("browser.uiCustomization.state", ...);
// auto-open mpv:// URIs without prompting.
// can do this with other protocols too (e.g. matrix?). see about:config for common handlers.
defaultPref("network.protocol-handler.external.mpv", true);
// element:// for Element matrix client
defaultPref("network.protocol-handler.external.element", true);
// matrix: for Nheko matrix client
defaultPref("network.protocol-handler.external.matrix", true);
'';
# instruct Firefox to put the profile in a predictable directory (so we can do things like persist just it).
# XXX: the directory *must* exist, even if empty; Firefox will not create the directory itself.
fs."${cfg.browser.dotDir}/profiles.ini".symlink.text = ''
[Profile0]
Name=default
IsRelative=1
Path=default
Default=1
[General]
StartWithLastProfile=1
'';
# TODO: env.PASSWORD_STORE_DIR only needs to be present within the browser session.
env.PASSWORD_STORE_DIR = "/home/colin/knowledge/secrets/accounts";
# alternative to PASSWORD_STORE_DIR:
# fs.".password-store".symlink.target = lib.mkIf cfg.addons.browserpass-extension.enable "knowledge/secrets/accounts";
# flush the cache to disk to avoid it taking up too much tmp.
persist.byPath."${cfg.browser.cacheDir}".store =
if (cfg.persistData != null) then
cfg.persistData
else
"cryptClearOnBoot"
;
persist.byPath."${cfg.browser.dotDir}/default".store =
if (cfg.persistData != null) then
cfg.persistData
else
"cryptClearOnBoot"
;
};
})
];
}

View File

@@ -0,0 +1,128 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.firefox.config;
in
{
sane.programs.firefox = {
config.addons = {
fxCast = {
# add a menu to cast to chromecast devices, but it doesn't seem to work very well.
# right click (or shift+rc) a video, then select "cast".
# - asciinema.org: icon appears, but glitches when clicked.
# - youtube.com: no icon appears, even when site is whitelisted.
# future: maybe better to have browser open all videos in mpv, and then use mpv for casting.
# see e.g. `ff2mpv`, `open-in-mpv` (both are packaged in nixpkgs)
package = pkgs.firefox-extensions.fx_cast;
enable = lib.mkDefault false;
};
browserpass-extension = {
package = pkgs.firefox-extensions.browserpass-extension;
enable = lib.mkDefault true;
};
bypass-paywalls-clean = {
package = pkgs.firefox-extensions.bypass-paywalls-clean;
enable = lib.mkDefault true;
};
ctrl-shift-c-should-copy = {
package = pkgs.firefox-extensions.ctrl-shift-c-should-copy;
enable = lib.mkDefault false; # prefer patching firefox source code, so it works in more places
};
ether-metamask = {
package = pkgs.firefox-extensions.ether-metamask;
enable = lib.mkDefault false; # until i can disable the first-run notification
};
firefox-xdg-open = {
# test: `xdg-open xdg-open:https://uninsane.org`
package = pkgs.firefox-extensions.firefox-xdg-open;
enable = lib.mkDefault true;
};
i2p-in-private-browsing = {
package = pkgs.firefox-extensions.i2p-in-private-browsing;
enable = lib.mkDefault config.services.i2p.enable;
};
i-still-dont-care-about-cookies = {
package = pkgs.firefox-extensions.i-still-dont-care-about-cookies;
enable = lib.mkDefault false; #< obsoleted by uBlock Origin annoyances/cookies lists
};
open-in-mpv = {
# test: `open-in-mpv 'mpv:///open?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ'`
package = pkgs.firefox-extensions.open-in-mpv;
enable = lib.mkDefault false;
};
sidebery = {
package = pkgs.firefox-extensions.sidebery;
enable = lib.mkDefault true;
};
sponsorblock = {
package = pkgs.firefox-extensions.sponsorblock;
enable = lib.mkDefault true;
};
ublacklist = {
package = pkgs.firefox-extensions.ublacklist;
enable = lib.mkDefault false;
};
ublock-origin = {
package = pkgs.firefox-extensions.ublock-origin;
enable = lib.mkDefault true;
};
};
suggestedPrograms = lib.optionals cfg.addons.firefox-xdg-open.enable [
"firefox-xdg-open"
] ++ lib.optionals cfg.addons.open-in-mpv.enable [
"open-in-mpv"
];
sandbox.extraHomePaths = lib.optionals cfg.addons.browserpass-extension.enable [
# browserpass needs these paths:
# - knowledge/secrets/accounts: where the encrypted account secrets live
# at least one of:
# - .config/sops: for the sops key which can decrypt account secrets
# - .ssh: to unlock the sops key, if not unlocked (`sane-secrets-unlock`)
# 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"
# ".config/sops"
"knowledge/secrets/accounts"
];
fs.".config/sops".dir = lib.mkIf cfg.addons.browserpass-extension.enable {}; #< needs to be created, not *just* added to the sandbox
# uBlock configuration:
fs.".mozilla/firefox/managed-storage/uBlock0@raymondhill.net.json".symlink.target = cfg.addons.ublock-origin.package.makeConfig {
# more filter lists are available here:
# - <https://easylist.to>
# - <https://github.com/easylist/easylist.git>
# - <https://github.com/yokoffing/filterlists>
filterFiles = let
getUasset = n: "${pkgs.uassets}/share/filters/${n}.txt";
in [
# default ublock filters:
(getUasset "ublock-filters")
(getUasset "ublock-badware")
(getUasset "ublock-privacy")
(getUasset "ublock-quick-fixes")
(getUasset "ublock-unbreak")
(getUasset "easylist")
(getUasset "easyprivacy")
# (getUasset "urlhaus-1") #< TODO: i think this is the same as urlhaus-filter-online
(getUasset "urlhaus-filter-online")
# (getUasset "plowe-0") #< TODO: where does this come from?
# (getUasset "ublock-cookies-adguard") #< TODO: where does this come from?
# filters i've added:
(getUasset "easylist-annoyances") #< blocks in-page popups, "social media content" (e.g. FB like button; improves loading time)
(getUasset "easylist-cookies") #< blocks GDPR cookie consent popovers (e.g. at stackoverflow.com)
# (getUasset "ublock-annoyances-others")
# (getUasset "ublock-annoyances-cookies")
];
};
env = lib.mkIf cfg.addons.browserpass-extension.enable {
# TODO: env.PASSWORD_STORE_DIR only needs to be present within the browser session.
# alternative to PASSWORD_STORE_DIR:
# fs.".password-store".symlink.target = lib.mkIf cfg.addons.browserpass-extension.enable "knowledge/secrets/accounts";
PASSWORD_STORE_DIR = "/home/colin/knowledge/secrets/accounts";
};
};
}

View File

@@ -0,0 +1,25 @@
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'none'; img-src data: *; object-src 'none'"></meta>
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks Menu</H1>
<DL><p>
<DT><H3 ADD_DATE="1" LAST_MODIFIED="1" UNFILED_BOOKMARKS_FOLDER="true">Other Bookmarks</H3>
<DL><p>
<DT><A HREF="https://en.wikipedia.org/wiki/Special:Search?search=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="w">Search Wikipedia</A>
<DT><A HREF="https://duckduckgo.com/?t=h_&q=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="ddg">Search DuckDuckGo</A>
<DT><A HREF="https://www.youtube.com/results?search_query=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="yt">Search YouTube</A>
<DT><A HREF="https://search.nixos.org/options?channel=unstable&query=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="opt">Search NixOS Options</A>
<DT><A HREF="https://wiki.archlinux.org/index.php?title=Special%3ASearch&search=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="arch">Search ArchWiki</A>
<DT><A HREF="https://www.amazon.com/s/?url=search-alias%3Daps&field-keywords=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="am">Search Amazon.com</A>
<DT><A HREF="https://www.ebay.com/sch/i.html?_sacat=0&_nkw=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="ebay">Search eBay</A>
<DT><A HREF="https://github.com/nixos/nixpkgs/pulls?q=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="pr">Search nixpkgs PRs</A>
<DT><A HREF="https://repology.org/projects/?maintainer=&category=&inrepo=&notinrepo=&repos=&families=&repos_newest=&families_newest=&search=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="repo">Search Repology - packages</A>
<DT><A HREF="https://myanimelist.net/?type=all&topkeyword=%s" ADD_DATE="1" LAST_MODIFIED="1" SHORTCUTURL="mal">Search MyAnimeList.net</A>
</DL><p>
</DL>

View File

@@ -0,0 +1,319 @@
# common settings to toggle (at runtime, in about:config):
# > security.ssl.require_safe_negotiation
# librewolf is a forked firefox which patches firefox to allow more things
# (like default search engines) to be configurable at runtime.
# many of the settings below won't have effect without those patches.
# see: https://gitlab.com/librewolf-community/settings/-/blob/master/distribution/policies.json
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.sane.programs.firefox.config;
mobile-prefs = lib.optionals false pkgs.librewolf-pmos-mobile.extraPrefsFiles;
# allow easy switching between firefox and librewolf with `defaultSettings`, below
librewolfSettings = {
browser = pkgs.librewolf-unwrapped;
extraPrefsFiles = pkgs.librewolf-unwrapped.extraPrefsFiles ++ mobile-prefs;
libName = "librewolf";
dotDir = ".librewolf";
cacheDir = ".cache/librewolf";
desktop = "librewolf.desktop";
};
firefoxSettings = {
browser = pkgs.firefox-esr-unwrapped;
extraPrefsFiles = mobile-prefs;
libName = "firefox";
dotDir = ".mozilla/firefox";
cacheDir = ".cache/mozilla";
desktop = "firefox.desktop";
};
# defaultSettings = firefoxSettings;
defaultSettings = librewolfSettings;
packageUnwrapped = (pkgs.wrapFirefox cfg.browser.browser {
# inherit the default librewolf.cfg
# it can be further customized via ~/.librewolf/librewolf.overrides.cfg
inherit (cfg.browser) extraPrefsFiles libName;
nativeMessagingHosts = lib.optionals cfg.addons.browserpass-extension.enable [
pkgs.browserpass
] ++ lib.optionals cfg.addons.fxCast.enable [
pkgs.fx-cast-bridge
];
nixExtensions = concatMap (ext: optional ext.enable ext.package) (attrValues cfg.addons);
# extraPolicies: only really required if using firefox; else, easier to configure this via overrides.cfg.
# extraPolicies = {
# FirefoxHome = {
# Search = true;
# Pocket = false;
# Snippets = false;
# TopSites = false;
# Highlights = false;
# };
# NoDefaultBookmarks = true;
# OfferToSaveLogins = false;
# OfferToSaveLoginsDefault = false;
# PasswordManagerEnabled = false;
# SearchEngines = {
# Default = "DuckDuckGo";
# };
# UserMessaging = {
# ExtensionRecommendations = false;
# FeatureRecommendations = false;
# SkipOnboarding = true;
# UrlbarInterventions = false;
# WhatsNew = false;
# };
# # these were taken from Librewolf
# AppUpdateURL = "https://localhost";
# DisableAppUpdate = true;
# OverrideFirstRunPage = "";
# OverridePostUpdatePage = "";
# DisableSystemAddonUpdate = true;
# DisableFirefoxStudies = true;
# DisableTelemetry = true;
# DisableFeedbackCommands = true;
# DisablePocket = true;
# DisableSetDesktopBackground = false;
# # remove many default search providers
# # XXX this seems to prevent the `nixExtensions` from taking effect
# # Extensions.Uninstall = [
# # "google@search.mozilla.org"
# # "bing@search.mozilla.org"
# # "amazondotcom@search.mozilla.org"
# # "ebay@search.mozilla.org"
# # "twitter@search.mozilla.org"
# # ];
# # XXX doesn't seem to have any effect...
# # docs: https://github.com/mozilla/policy-templates#homepage
# # Homepage = {
# # HomepageURL = "https://uninsane.org/";
# # StartPage = "homepage";
# # };
# # NewTabPage = true;
# };
# 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 differenty-namespaced instance.
# OTOH, it may error about "only one instance can run at a time": close the other instance if you see that.
exec = "${lib.getExe pkgs.sane-scripts.vpn} do default -- ${cfg.browser.libName} --new-instance";
icon = cfg.browser.libName;
categories = [ "Network" "WebBrowser" ];
type = "Application";
})
(pkgs.makeDesktopItem {
name = "${cfg.browser.libName}-stub-dns";
desktopName = "${cfg.browser.libName} (stub DNS)";
genericName = "Web Browser";
# N.B.: --new-instance ensures we don't reuse an existing differently-namespaced instance.
# OTOH, it may error about "only one instance can run at a time": close the other instance if you see that.
exec = "${lib.getExe pkgs.sane-scripts.vpn} do none -- ${cfg.browser.libName} --new-instance";
icon = cfg.browser.libName;
categories = [ "Network" "WebBrowser" ];
type = "Application";
})
];
# TODO: could use `zip -f` to only update the one changed file, instead of rezipping everything.
buildCommand = (base.buildCommand or "") + ''
mkdir omni
echo "omni.ja BEFORE:"
ls -l $(readlink $out/lib/${cfg.browser.libName}/browser/omni.ja)
echo "unzipping omni.ja"
# N.B. `zip` exits non-zero even on successful extraction, if the file didn't 100% obey spec
${pkgs.buildPackages.unzip}/bin/unzip $out/lib/${cfg.browser.libName}/browser/omni.ja -d omni || true
echo "removing old omni.ja"
rm $out/lib/${cfg.browser.libName}/browser/omni.ja
echo "patching omni.ja"
# de-associate `ctrl+shift+c` from activating the devtools.
# see: <https://stackoverflow.com/a/54260938>
${lib.getExe pkgs.buildPackages.gnused} -i s'/devtools-commandkey-inspector = C/devtools-commandkey-inspector = VK_F12/' omni/localization/en-US/devtools/startup/key-shortcuts.ftl
# remap Close Tab shortcut from Ctrl+W to Ctrl+Shift+W
# see: <https://www.math.cmu.edu/~gautam/sj/blog/20220329-firefox-disable-ctrl-w.html>
${lib.getExe pkgs.buildPackages.gnused} -i s'/command="cmd_close" modifiers="accel"/command="cmd_close" modifiers="accel,shift"/' omni/chrome/browser/content/browser/browser.xhtml
echo "re-zipping omni.ja"
pushd omni; ${pkgs.buildPackages.zip}/bin/zip $out/lib/${cfg.browser.libName}/browser/omni.ja -r ./*; popd
echo "omni.ja AFTER:"
ls -l $out/lib/${cfg.browser.libName}/browser/omni.ja
runHook postBuild
runHook postInstall
runHook postFixup
'';
});
in
{
imports = [
./addons.nix
];
sane.programs.firefox = {
configOption = mkOption {
default = {};
type = types.submodule {
options = {
browser = mkOption {
default = defaultSettings;
type = types.anything;
};
persistData = mkOption {
description = "optional store name to which persist browsing data (like history)";
type = types.nullOr types.str;
default = null;
};
persistCache = mkOption {
description = "optional store name to which persist browser cache";
type = types.nullOr types.str;
default = "ephemeral";
};
addons = mkOption {
default = {};
type = types.attrsOf (types.submodule {
options = {
package = mkOption {
type = types.package;
};
enable = mkOption {
type = types.bool;
};
};
});
};
};
};
};
inherit packageUnwrapped;
sandbox.method = "bunpen";
sandbox.net = "all";
sandbox.whitelistAudio = true;
sandbox.whitelistAvDev = true; #< it doesn't seem to use pipewire, but direct /dev/videoN (as of 2024/09/12)
sandbox.whitelistDbus = [ "user" ]; # mpris
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
"dev" # for developing anything web-related
# for uploads/downloads.
# it still needs these paths despite using the portal's file-chooser :?
"tmp"
"Pictures/albums"
"Pictures/cat"
"Pictures/from"
"Pictures/Photos"
"Pictures/Screenshots"
"Pictures/servo-macros"
];
mime.associations = let
inherit (cfg.browser) desktop;
in {
"text/html" = desktop;
"x-scheme-handler/http" = desktop;
"x-scheme-handler/https" = desktop;
"x-scheme-handler/about" = desktop;
"x-scheme-handler/unknown" = desktop;
};
env.BROWSER = cfg.browser.libName; # used by misc tools like xdg-email, as fallback
# redirect librewolf configs to the firefox configs; this way addons don't have to care about the firefox/librewolf distinction.
fs.".librewolf/librewolf.overrides.cfg".symlink.target = "../.mozilla/firefox/firefox.overrides.cfg";
fs.".librewolf/profiles.ini".symlink.target = "../.mozilla/firefox/profiles.ini";
fs.".librewolf/managed-storage".symlink.target = "../.mozilla/firefox/managed-storage";
# N.B.: `overrides.cfg` might be librewolf-specific -- not supported by mainline firefox.
# firefox does support per-profile `user.js` files which have similar functionality.
fs.".mozilla/firefox/firefox.overrides.cfg".symlink.text = ''
// use `pref(...)` to force a preference
// use `defaultPref(...)` to allow runtime reconfiguration
// discover preference names via the `about:config` page
//
// if we can't query the revocation status of a SSL cert because the issuer is offline,
// treat it as unrevoked.
// see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do>
defaultPref("security.OCSP.require", false);
// scrollbar configuration, see: <https://artemis.sh/2023/10/12/scrollbars.html>
// style=4 gives rectangular scrollbars
// could also enable "always show scrollbars" in about:preferences -- not sure what the actual pref name for that is
// note that too-large scrollbars (like 50px wide, even 20px) tend to obscure content (and make buttons unclickable)
defaultPref("widget.non-native-theme.scrollbar.size.override", 14);
defaultPref("widget.non-native-theme.scrollbar.style", 4);
// disable inertial/kinetic/momentum scrolling because it just gets in the way on touchpads
// source: <https://kparal.wordpress.com/2019/10/31/disabling-kinetic-scrolling-in-firefox/>
defaultPref("apz.gtk.kinetic_scroll.enabled", false);
// open external URIs/files via xdg-desktop-portal.
defaultPref("widget.use-xdg-desktop-portal.mime-handler", 1);
defaultPref("widget.use-xdg-desktop-portal.open-uri", 1);
defaultPref("browser.toolbars.bookmarks.visibility", "never");
// configure which extensions are visible by default (TODO: requires a lot of trial and error)
// defaultPref("browser.uiCustomization.state", ...);
// auto-open specific URI schemes without prompting:
defaultPref("network.protocol-handler.external.xdg-open", true); // for firefox-xdg-open extension
defaultPref("network.protocol-handler.external.mpv", true); // for open-in-mpv extension
defaultPref("network.protocol-handler.external.element", true); // for Element matrix client
defaultPref("network.protocol-handler.external.matrix", true); // for Nheko matrix client
// statically configure bookmarks.
// notably, these bookmarks have "shortcut url" fields:
// - type `w thing` into the URL bar to search "thing" on Wikipedia.
// - to add a search shortcut: right-click any search box => "Add a keyword for this search".
// - to update the static bookmarks, export via Hamburger => bookmarks => manage bookmarks => Import and Backup => Export Bookmarks To HTML
defaultPref("browser.places.importBookmarksHTML", true);
defaultPref("browser.bookmarks.file", "${./bookmarks.html}");
defaultPref("browser.startup.homepage", "https://uninsane.org/places");
'';
# instruct Firefox to put the profile in a predictable directory (so we can do things like persist just it).
# XXX: the directory *must* exist, even if empty; Firefox will not create the directory itself.
fs.".mozilla/firefox/profiles.ini".symlink.text = ''
[Profile0]
Name=default
IsRelative=1
Path=default
Default=1
[General]
StartWithLastProfile=1
'';
# flush the cache to disk to avoid it taking up too much tmp.
persist.byPath."${cfg.browser.cacheDir}".store =
if (cfg.persistData != null) then
cfg.persistData
else
"ephemeral"
;
persist.byPath."${cfg.browser.dotDir}/default".store =
if (cfg.persistData != null) then
cfg.persistData
else
"ephemeral"
;
};
}

View File

@@ -1,12 +1,16 @@
# Flare is a 3rd-party GTK4 Signal app. # Flare is a 3rd-party GTK4 Signal app.
# UI is effectively a clone of Fractal. # UI is effectively a clone of Fractal.
# #
### compatibility: ### compatibility (2023-10-30):
# - desko: works fine. pairs, and exchanges contact list (but not message history) with the paired device. exchanges future messages fine. # - desko: works fine. pairs, and exchanges contact list (but not message history) with the paired device. exchanges future messages fine.
# - moby (cross compiled flare-signal-nixified): nope. it pairs, but can only *receive* messages and never *send* them. # - moby (cross compiled flare-signal-nixified): nope. it pairs, but can only *receive* messages and never *send* them.
# - even `rsync`ing the data and keyrings from desko -> moby, still fails in that same manner. # - even `rsync`ing the data and keyrings from desko -> moby, still fails in that same manner.
# - console shows error messages. quite possibly an endianness mismatch somewhere # - console shows error messages. quite possibly an endianness mismatch somewhere
# - moby (partially-emulated flare-signal): works! pairs and can send/receive messages, same as desko. # - moby (partially-emulated flare-signal): works! pairs and can send/receive messages, same as desko.
### compatibility (2024-08-07):
# - linking flare to iOS signal "works", but neither side can exchange messages nor contacts
# in iOS i see "A message from Colin could not be delivered"
# - registering as primary device does not work ("you are not authorized", or some such)
# #
### debugging: ### debugging:
# - `RUST_LOG=flare=trace flare` # - `RUST_LOG=flare=trace flare`
@@ -18,7 +22,7 @@
# ERROR presage::manager] Error opening envelope: ProtobufDecodeError(DecodeError { description: "invalid tag value: 0", stack: [("Content", "data_message")] }), message will be skipped! # ERROR presage::manager] Error opening envelope: ProtobufDecodeError(DecodeError { description: "invalid tag value: 0", stack: [("Content", "data_message")] }), message will be skipped!
# ERROR presage::manager] Error opening envelope: ProtobufDecodeError(DecodeError { description: "invalid tag value: 0", stack: [("Content", "data_message")] }), message will be skipped! # ERROR presage::manager] Error opening envelope: ProtobufDecodeError(DecodeError { description: "invalid tag value: 0", stack: [("Content", "data_message")] }), message will be skipped!
# ``` # ```
# - this occurs on moby, desko, `flare-signal` and `flare-signal-nixified` # - this occurs on moby, desko, `flare-signal` and `flare-signal-nixified` (2023-12-14)
# - the Websocket error seems to be unrelated, occurs during normal/good operation # - the Websocket error seems to be unrelated, occurs during normal/good operation
# - related issues: <https://github.com/whisperfish/presage/issues/152> # - related issues: <https://github.com/whisperfish/presage/issues/152>
# #
@@ -28,7 +32,7 @@
# No current session # No current session
# ERROR presage::manager] Error opening envelope: SignalProtocolError(InvalidKyberPreKeyId), message will be skipped! # ERROR presage::manager] Error opening envelope: SignalProtocolError(InvalidKyberPreKeyId), message will be skipped!
# ``` # ```
# - but signal iOS will still read it. # - but signal iOS will still read it (2023-12-14).
# #
#### HTTP 405 when linking flare to iOS signal: #### HTTP 405 when linking flare to iOS signal:
# [DEBUG libsignal_service_hyper::push_service] HTTP request PUT https://chat.signal.org/v1/devices/{uuid}.{timestamp?}:{b64-string} # [DEBUG libsignal_service_hyper::push_service] HTTP request PUT https://chat.signal.org/v1/devices/{uuid}.{timestamp?}:{b64-string}
@@ -43,7 +47,7 @@
# ), # ),
# ), # ),
# ) # )
# flare matrix suggests the signal endpoint has changed: # flare matrix suggests the signal endpoint has changed (2023-12-14):
# - "/v1/device/link instead of confirming via /v1/devices/{I'd}" # - "/v1/device/link instead of confirming via /v1/devices/{I'd}"
# - this endpoint is declared in libsignal-service-rs (used both by flare and presage) # - this endpoint is declared in libsignal-service-rs (used both by flare and presage)
# - libsignal-service/src/provisioning/manager.rs # - libsignal-service/src/provisioning/manager.rs
@@ -73,5 +77,13 @@
# and it persists some dconf settings (e.g. device name). reset with: # and it persists some dconf settings (e.g. device name). reset with:
# - `dconf reset -f /de/schmidhuberj/Flare/`. # - `dconf reset -f /de/schmidhuberj/Flare/`.
]; ];
#VVV flare complains if its data directory is a symlink, so put it in a subdirectory behind my persistence symlink.
env.FLARE_DATA_PATH = "$HOME/.local/share/flare/data";
# sandbox.method = "bwrap";
# sandbox.net = "clearnet";
# sandbox.whitelistWayland = true;
# sandbox.whitelistDbus = [
# "user" # so i can click on links, at least
# ];
}; };
} }

View File

@@ -0,0 +1,42 @@
# foliate: <https://johnfactotum.github.io/foliate/>
{ ... }:
{
sane.programs.foliate = {
sandbox.method = "bunpen";
sandbox.net = "clearnet"; #< for dictionary, wikipedia, online book libraries
sandbox.whitelistDbus = [ "user" ]; #< when clicking on links
sandbox.whitelistDri = true; # reduces startup time and subjective page flip time
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
"Books/local"
"Books/servo"
"tmp" #< for downloaded files
];
sandbox.extraPaths = [
# foliate sandboxes itself with bwrap, which needs these.
# but it actually only cares that /sys/{block,bus,class/block} *exist*: it doesn't care if there's anything in them.
# so bind empty (sub)directories
# and it looks like i might need to keep IPC namespace if i want TTS.
"/sys/block/loop7"
"/sys/bus/container/devices"
"/sys/class/block/loop7"
];
sandbox.autodetectCliPaths = "existing";
persist.byStore.plaintext = [
".local/share/com.github.johnfactotum.Foliate" #< books added, reading position
".cache/com.github.johnfactotum.Foliate" #< webkit cache
];
buildCost = 2; #< webkitgtk 6.0
# these associations were taken from its .desktop file
mime.associations."application/epub+zip" = "com.github.johnfactotum.Foliate.desktop";
mime.associations."application/x-mobipocket-ebook" = "com.github.johnfactotum.Foliate.desktop";
mime.associations."application/vnd.amazon.mobi8-ebook" = "com.github.johnfactotum.Foliate.desktop";
mime.associations."application/x-fictionbook+xml" = "com.github.johnfactotum.Foliate.desktop";
mime.associations."application/x-zip-compressed-fb2" = "com.github.johnfactotum.Foliate.desktop";
mime.associations."application/vnd.comicbook+zip" = "com.github.johnfactotum.Foliate.desktop"; # .cbz
mime.associations."x-scheme-handler/opds" = "com.github.johnfactotum.Foliate.desktop";
mime.priority = 120; #< default is 100; fallback to more specialized cbz handlers, e.g., but keep specializations for epub
};
}

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