Compare commits

...

722 Commits

Author SHA1 Message Date
a8293f348c modules/programs: sandbox: remove no-longer-needed /run/systemd/resolve from sandbox 2024-05-13 23:38:38 +00:00
0fbf35e0a9 networkmanager: tune config
mostly just pruning unused features
2024-05-13 23:38:38 +00:00
f037e6dc72 dns: deploy trust-dns as the default recursive resolver
outstanding issues: native.uninsane.org doesn't resolve. appears possibly to be an issue with following CNAMEs
2024-05-13 23:38:38 +00:00
fe5af959f4 trust-dns: use my patched version 2024-05-13 23:38:38 +00:00
bef0099eec scripts/clean: fix to cleanup more dangling result symlinks 2024-05-13 22:45:33 +00:00
67434caf45 scripts: add a script to clean the git dir 2024-05-13 22:45:33 +00:00
be84ab1f45 programs: set buildCost=1 for assorted low-priority programs 2024-05-13 22:45:33 +00:00
43d32641f3 programs: buildCost: introduce a new level between min and light 2024-05-13 22:45:33 +00:00
9bf0dbabae gnome.seahorse: disable 2024-05-13 22:45:33 +00:00
8c7880774e monero-gui: disable 2024-05-13 22:45:33 +00:00
5774aa4a8f zulip: dont ship 2024-05-13 22:45:33 +00:00
6c6d11578e cross: fix curl-impersonate-chome build 2024-05-13 22:45:33 +00:00
f33e960bdf cross: gnome-keyring: patch via nixpkgs patch instead of override 2024-05-13 22:45:33 +00:00
14202a5bcc neovim: wrap in such a way as to avoid cross-compilation-specific patching 2024-05-13 22:45:33 +00:00
3d2babf2bb overlays/cross: sync upstreaming status 2024-05-13 22:45:33 +00:00
9d51b2ecc7 nixpatches: stop applying patches i dont need 2024-05-13 22:45:33 +00:00
0b855efb5f nixpkgs: bump; nixpkgs-wayland: bump
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/6a217e9b1d39415076c7a6cfc44be5e935e7a839' (2024-05-13)
  → 'github:nixos/nixpkgs/eda36d7cf3391ad06097009b08822fb74acd5e00' (2024-05-13)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/6bc8c8a7ac13182ee24a5e2caab7ad739f1c55c5' (2024-05-13)
  → 'github:nixos/nixpkgs/0a949cf2618e8eab83aa008f1f8e03db137ed36c' (2024-05-13)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/5f7272dff81558143f93e2cb32189a52ef965892' (2024-05-13)
  → 'github:nix-community/nixpkgs-wayland/ed18785b8816fa878bdd9df7f2e8722695401ef8' (2024-05-13)
```
2024-05-13 22:45:33 +00:00
2ae286ff75 nixpkgs: 2024-05-08 -> 2024-05-13, nixpkgs-wayland, sops-nix
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/c8e3f684443d7c2875ff169f6ef2533534105e7b' (2024-05-08)
  → 'github:nixos/nixpkgs/6a217e9b1d39415076c7a6cfc44be5e935e7a839' (2024-05-13)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/a751e2faa2fc94c1337c32aaf6a6e417afe90be9' (2024-05-08)
  → 'github:nixos/nixpkgs/6bc8c8a7ac13182ee24a5e2caab7ad739f1c55c5' (2024-05-13)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/7dc8fb2aa7db995ac1ce2a8f2f8d8784b2af591c' (2024-05-08)
  → 'github:nix-community/nixpkgs-wayland/5f7272dff81558143f93e2cb32189a52ef965892' (2024-05-13)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/26fabca301e1133abd3d9192b1bcb6fb45b30f1d' (2024-05-05)
  → 'github:nix-community/lib-aggregate/09883ca828e8cfaacdb09e29190a7b84ad1d9925' (2024-05-12)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/4b620020fd73bdd5104e32c702e65b60b6869426' (2024-05-05)
  → 'github:nix-community/nixpkgs.lib/58e03b95f65dfdca21979a081aa62db0eed6b1d8' (2024-05-12)
• Updated input 'nixpkgs-wayland/nix-eval-jobs':
    'github:nix-community/nix-eval-jobs/7b6640f2a10701bf0db16aff048070f400e8ea7c' (2024-04-23)
  → 'github:nix-community/nix-eval-jobs/63154bdfb22091041b307d17863bdc0e01a32a00' (2024-05-09)
• Updated input 'nixpkgs-wayland/nix-eval-jobs/nixpkgs':
    'github:NixOS/nixpkgs/1e1dc66fe68972a76679644a5577828b6a7e8be4' (2024-04-22)
  → 'github:NixOS/nixpkgs/ad7efee13e0d216bf29992311536fce1d3eefbef' (2024-05-06)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/893e3df091f6838f4f9d71c61ab079d5c5dedbd1' (2024-05-06)
  → 'github:Mic92/sops-nix/b6cb5de2ce57acb10ecdaaf9bbd62a5ff24fa02e' (2024-05-12)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/b980b91038fc4b09067ef97bbe5ad07eecca1e76' (2024-05-04)
  → 'github:NixOS/nixpkgs/8e47858badee5594292921c2668c11004c3b0142' (2024-05-11)
```
2024-05-13 22:45:33 +00:00
a05fa53ee1 curlftpfs: EXPERIMENT: double the connect timeout to see if this reduces dropped conns 2024-05-13 07:52:43 +00:00
46d95805e9 programs: simplify sandbox symlink closure code 2024-05-13 07:49:00 +00:00
9346a066d1 sane-sandboxed: fix typo in derefOnce 2024-05-13 06:49:43 +00:00
567531727e sane-sandboxed: fix typos in normPath 2024-05-13 06:32:13 +00:00
6c65e4b313 sane-sandboxed: be a little more careful with out vars 2024-05-13 04:00:15 +00:00
e6b13adb61 sane-open: associate rofi-applications.desktop with keyboard 2024-05-13 03:19:03 +00:00
bd3e06982b sane-sandboxed: tweak symlink caching to allow /run/current-system to be bind-mounted instead of symlinked 2024-05-13 02:11:47 +00:00
660ba94c7c sane-sandboxed: introduce a symlink cache to reduce readlink calls even more
it's all a bit silly. i still do a bunch of -L tests: i just avoid the costly readlink fork :|
2024-05-13 01:31:30 +00:00
11ddce043d sane-sandboxed: reduce forking (use out vars) 2024-05-12 22:35:05 +00:00
980fe6b33c sane-sandboxed: use local where applicable 2024-05-12 22:15:34 +00:00
016df3ff74 sane-open: launch some .desktop files even when they point outside ~/.local/share/applications
an unfortunate reality is that symlinks tend to get dereferenced too
early by other programs.
2024-05-12 22:13:28 +00:00
d827235d31 sane-sandboxed: be more strict internally about keeping paths var as absolute-paths 2024-05-12 21:44:33 +00:00
f7a25d1421 sane-sandboxed: bwrap: expose symlinks to the sandbox directly, instead of binding
some things (e.g. `sane-open`) require the symlink, and lose too much
info when working only with the bind. having the sandboxed environment
stay similar to the out env sould make debugging things simpler
2024-05-12 21:42:31 +00:00
d148b19767 sane-sandboxed: expand symlinks before binding them into the sandbox 2024-05-12 21:41:49 +00:00
89135d08cb rofi: file browser: include an entry to open the app launcher 2024-05-12 19:46:51 +00:00
15a5afd2c4 sane-open: special-case how i open .desktop files to be compatible with portals 2024-05-12 19:46:03 +00:00
e63e359417 sane-open: fix so we can launch read-only files 2024-05-12 17:50:11 +00:00
3c1a74998e applications: hide .desktop files which arent meant to be user-visible 2024-05-12 17:43:07 +00:00
eadf85f66d sane-open: associate as the default launcher for .desktop files 2024-05-12 17:41:00 +00:00
536eb2154a sane-open: add auto-keyboard action for a few more apps 2024-05-12 17:23:08 +00:00
e62365436c sane-cast: implement --device option to choose a specific device non-interactively 2024-05-11 00:40:38 +00:00
4b04c283b6 fcitx5: temporarily disable 2024-05-10 17:51:37 +00:00
def5816003 sane-vpn: fix "regions" printing to print all regions 2024-05-10 09:07:59 +00:00
6f2ae56126 sane-cast: add an --always-ask option 2024-05-10 07:01:16 +00:00
a40f05260a unl0kr: simplify the crash edge-case handling 2024-05-09 08:42:41 +00:00
2b539fafcd unl0kr: handle some crashy edgecases 2024-05-09 08:38:22 +00:00
954c5c8344 trust-dns: fix so it starts as part of boot 2024-05-09 07:19:17 +00:00
2a8ecf0423 nixpkgs: 2024-04-28 -> 2024-05-08; nixpkgs-wayland, sops-nix
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/0e395f4da1693e39239ffac7abf73a0a6931c961' (2024-04-28)
  → 'github:nixos/nixpkgs/c8e3f684443d7c2875ff169f6ef2533534105e7b' (2024-05-08)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/93909e9c7b05634ad924ff97c259ae0859b81756' (2024-04-28)
  → 'github:nixos/nixpkgs/a751e2faa2fc94c1337c32aaf6a6e417afe90be9' (2024-05-08)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/4e58e2cf22d11426ed2f997551f3650de0639e3a' (2024-04-28)
  → 'github:nix-community/nixpkgs-wayland/7dc8fb2aa7db995ac1ce2a8f2f8d8784b2af591c' (2024-05-08)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/49d9b510614b9bd137e067eb31445a8feca83313' (2024-04-28)
  → 'github:nix-community/lib-aggregate/26fabca301e1133abd3d9192b1bcb6fb45b30f1d' (2024-05-05)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/ade4fb7bbf04cd52bc1705734d5dc67755d77ec9' (2024-04-28)
  → 'github:nix-community/nixpkgs.lib/4b620020fd73bdd5104e32c702e65b60b6869426' (2024-05-05)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/f1b0adc27265274e3b0c9b872a8f476a098679bd' (2024-04-23)
  → 'github:Mic92/sops-nix/893e3df091f6838f4f9d71c61ab079d5c5dedbd1' (2024-05-06)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/74574c38577914733b4f7a775dd77d24245081dd' (2024-04-20)
  → 'github:NixOS/nixpkgs/b980b91038fc4b09067ef97bbe5ad07eecca1e76' (2024-05-04)
```
2024-05-09 05:26:23 +00:00
a056ca84be todo.md: fix multiple-schlocks bug 2024-05-07 15:26:08 +00:00
8d8bf00a34 s6-rc: use s6-rc stop instead of exiting 125 in the no-restart branch of "restartCondition = on-failure"
exiting 125 stops the service, but does NOT put it in the down state, preventing it from being re-started
2024-05-07 15:24:14 +00:00
f58bcb4767 swaylock, schlock: convert to services 2024-05-07 15:02:46 +00:00
4f56acc316 s6-rc: implement restartCondition to allow restarting of the service only on failure 2024-05-07 15:01:40 +00:00
fdf1b20368 s6-rc: propagate service status out of run script 2024-05-07 12:50:09 +00:00
c12691a3a0 todo.md: document multi-instance schlock issue 2024-05-06 17:31:54 +00:00
06bfa05ec1 todo.md: complete swaync modem toggle perm bug 2024-05-06 17:29:41 +00:00
32e06ce998 programs: gnome-disk-utility: grant sandbox access to ~/tmp 2024-05-06 05:15:28 +00:00
c0a7b831cd sane-open: more robust auto-application/file detection 2024-05-05 05:19:07 +00:00
8c04023eba sway: fix sane-open integration to not mistake it as a file 2024-05-05 05:04:25 +00:00
cf3cfc5249 sane-open: add debug logging 2024-05-05 05:03:22 +00:00
a1625ea41d programs: ship zulip 2024-05-04 08:28:48 +00:00
2cedd2beb4 readme: fix renamed users.nix -> users/default.nix 2024-05-02 10:30:41 +00:00
6544b9aca4 doc: dns: fix typo 2024-05-02 10:27:38 +00:00
08a9b838e5 sane-input-handler: fix log bog 2024-04-30 19:22:37 +00:00
b7dd40e558 sane-open-desktop -> sane-open and have it auto-open/close the keyboard based on what an app wants 2024-04-30 19:22:37 +00:00
7f2abf7e6e sane-input-handler: fix missing newline when logging 2024-04-30 15:30:39 +00:00
825812e511 sane-input-handler: reset rofi directory to ~ when using the app + fsbrowser 2024-04-30 15:29:00 +00:00
69e5495cc9 sane-input-handler: set keyboard as appropriate for file/app browser 2024-04-30 15:16:59 +00:00
b422f15b59 sane-input-handler: swap volup tap/hold actions 2024-04-30 14:38:17 +00:00
889b332ade trust-dns: split the parts which are generalizable into their own file
i can try to build this into a recursive resolver for *all* my hosts
2024-04-30 14:35:56 +00:00
46d1a49f0f servo: enable sane-cast program 2024-04-29 21:50:03 +00:00
1b156dcb0a networkmanager: fix eval error when not enabled 2024-04-29 05:58:32 +00:00
efd2f14a13 nixpkgs: 2024-04-27 -> 2024-04-28; nixpkgs-wayland
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/19c30e016f04874d60ed0922bf58be4aa9a15e53' (2024-04-27)
  → 'github:nixos/nixpkgs/0e395f4da1693e39239ffac7abf73a0a6931c961' (2024-04-28)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/77759bd39047f1b92f12b26b55029f0cc2c88093' (2024-04-27)
  → 'github:nixos/nixpkgs/93909e9c7b05634ad924ff97c259ae0859b81756' (2024-04-28)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/ff41a88e80aaf3ae1561cc6a54636fc46f9214de' (2024-04-27)
  → 'github:nix-community/nixpkgs-wayland/4e58e2cf22d11426ed2f997551f3650de0639e3a' (2024-04-28)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/3b32a98eb3053f8c8ca55497d1881443ef2996e6' (2024-04-21)
  → 'github:nix-community/lib-aggregate/49d9b510614b9bd137e067eb31445a8feca83313' (2024-04-28)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/6882347415e352cfc9c277cc01f73e0f5cb7b93c' (2024-04-21)
  → 'github:nix-community/nixpkgs.lib/ade4fb7bbf04cd52bc1705734d5dc67755d77ec9' (2024-04-28)
```
2024-04-29 04:16:33 +00:00
d4d06d037c replace pipewire ffadoSupport toggle with a patch to fix cross compilation 2024-04-28 15:07:28 +00:00
9525c09c41 cross: remove obsoleted gpodder patch 2024-04-27 17:10:50 +00:00
e5876a1e5b nixpkgs: 2024-04-26 -> 2024-04-27; nixpkgs-wayland -> 2024-04-27
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/7d3f4eadec32d447a5f20d87fa309f00986cb288' (2024-04-26)
  → 'github:nixos/nixpkgs/19c30e016f04874d60ed0922bf58be4aa9a15e53' (2024-04-27)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/0b868df4ced96400774414f5baf30b696215b98f' (2024-04-26)
  → 'github:nixos/nixpkgs/77759bd39047f1b92f12b26b55029f0cc2c88093' (2024-04-27)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/ca9d278400c170935a95dd75e7e2537c2afd1cb7' (2024-04-26)
  → 'github:nix-community/nixpkgs-wayland/ff41a88e80aaf3ae1561cc6a54636fc46f9214de' (2024-04-27)
```
2024-04-27 16:18:28 +00:00
1757ea4492 cross: upstream eyeD3 patch 2024-04-27 13:31:47 +00:00
39d31c3ffd swaync-service-dispatcher: add -b to block on service state query, to avoid incorrect responses when run in parallel 2024-04-27 12:32:12 +00:00
c50ef59102 swaync: fix service state tracking for oneshot services 2024-04-27 12:13:34 +00:00
5fc4ca6dad modemmanager: ship udev rules 2024-04-27 12:01:01 +00:00
35c7527946 modemmanager: fix so it's active on boot 2024-04-27 11:54:08 +00:00
7e8a014f37 NetworkManager: use the upstream service file 2024-04-27 10:58:21 +00:00
4ce951bbed wpa_supplicant: re-enable 2024-04-27 10:34:25 +00:00
f784550b9b networkmanager: migrate from nixpkgs service to my own 2024-04-27 09:51:55 +00:00
1f2bbd4aec refactor: split modemmanager stuff into own file 2024-04-27 08:32:15 +00:00
2389757581 firefox-extensions.browserpass-extension: 3.7.2-2023-06-18 -> 3.8.0 2024-04-27 08:32:05 +00:00
9021ab9f05 s6: fix oneshot service runner
the runner previously couldn't find the 'live' directory, where the service state lives. now it can
2024-04-27 08:05:54 +00:00
547d71c19a nixpkgs: 2024-04-24 -> 2024-04-26, nixpkgs-wayland
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/acba655f267a49327f2cea95003f17b8540909c0' (2024-04-24)
  → 'github:nixos/nixpkgs/7d3f4eadec32d447a5f20d87fa309f00986cb288' (2024-04-26)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/1eb9a6980dee3970850f47ba8139c7402f54a9a0' (2024-04-24)
  → 'github:nixos/nixpkgs/0b868df4ced96400774414f5baf30b696215b98f' (2024-04-26)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/80659e4b2805654de851996e682b063a5d7eea5e' (2024-04-24)
  → 'github:nix-community/nixpkgs-wayland/ca9d278400c170935a95dd75e7e2537c2afd1cb7' (2024-04-26)
```
2024-04-27 06:33:24 +00:00
79bba42768 s6-rc: fix oneshot services to generate up, not run 2024-04-27 06:33:24 +00:00
8dd4fe06f3 s6: longshot -> longrun (typo) 2024-04-27 05:22:35 +00:00
19115dfb65 eg25-control: port to s6 (hopefully) 2024-04-26 21:44:13 +00:00
4c0ae75b00 todo.md: more context for the uosc volume issue 2024-04-26 17:21:32 +00:00
34842c00fe moby: make the modem powerable by the user, without root
this should allow migrating eg25-control to a user service
2024-04-26 17:19:38 +00:00
46a513b263 feeds: subscribe to SamuelDR 2024-04-26 17:19:38 +00:00
6129fbf2b3 lemmy: upstream the proxy headers 2024-04-26 16:44:43 +00:00
242541304e todo.md: document a few moby bugs around modem 2024-04-26 13:05:34 +00:00
f3d2dee470 lemmy: fix federation (broke due to invalid HTTP signatures) 2024-04-26 10:31:47 +00:00
3d207ab7bb coturn: allocate 256 ports instead of 16 2024-04-26 08:47:52 +00:00
95447eb765 goaccess: fix missing state dir 2024-04-26 08:47:09 +00:00
593268f620 coturn: run inside ovpns namespace 2024-04-26 08:01:34 +00:00
5c98a51cd6 dino: build without echo cancelation
this reduces CPU load on moby; it may also have implications for incoming call audio though, still sorting that out
2024-04-26 05:11:43 +00:00
4453bde815 dino: increase buffering 20ms -> 100ms (closer to 82ms, actually) 2024-04-25 11:28:22 +00:00
7843f9650a feeds: subscribe to The Amp Hour (podcast) 2024-04-25 05:54:10 +00:00
82dce71b9c feeds: add microarch.club podcast 2024-04-25 05:51:52 +00:00
8a981c3ca9 hackgregator: init at 2024-12-05
N.B.: it uses appstream/bwrap, and hence much be run with capsh --caps=
2024-04-25 03:56:57 +00:00
9c00c2c5cc zsh: add exit aliases: ecit, exi5 2024-04-25 01:51:45 +00:00
aad645f2c5 nixpkgs: 2024-04-22 -> 2024-04-24; nixpkgs-wayland; sops-nix
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/fe2b7d6a922c875221671df6aa360b6e73d47e2f' (2024-04-22)
  → 'github:nixos/nixpkgs/acba655f267a49327f2cea95003f17b8540909c0' (2024-04-24)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/8a3f95b79ba3083cfff90752296ef8a52a6bec9a' (2024-04-22)
  → 'github:nixos/nixpkgs/1eb9a6980dee3970850f47ba8139c7402f54a9a0' (2024-04-24)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/f01c36f09cc5c2d77cbab4475528e06d6641bff4' (2024-04-22)
  → 'github:nix-community/nixpkgs-wayland/80659e4b2805654de851996e682b063a5d7eea5e' (2024-04-24)
• Updated input 'nixpkgs-wayland/nix-eval-jobs':
    'github:nix-community/nix-eval-jobs/6b03a93296faf174b97546fd573c8b379f523a8d' (2024-01-14)
  → 'github:nix-community/nix-eval-jobs/7b6640f2a10701bf0db16aff048070f400e8ea7c' (2024-04-23)
• Updated input 'nixpkgs-wayland/nix-eval-jobs/flake-parts':
    'github:hercules-ci/flake-parts/34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5' (2023-12-01)
  → 'github:hercules-ci/flake-parts/9126214d0a59633752a136528f5f3b9aa8565b7d' (2024-04-01)
• Updated input 'nixpkgs-wayland/nix-eval-jobs/nix-github-actions':
    'github:nix-community/nix-github-actions/93e39cc1a087d65bcf7a132e75a650c44dd2b734' (2023-11-28)
  → 'github:nix-community/nix-github-actions/5163432afc817cf8bd1f031418d1869e4c9d5547' (2023-12-29)
• Updated input 'nixpkgs-wayland/nix-eval-jobs/nixpkgs':
    'github:NixOS/nixpkgs/d6863cbcbbb80e71cecfc03356db1cda38919523' (2023-12-21)
  → 'github:NixOS/nixpkgs/1e1dc66fe68972a76679644a5577828b6a7e8be4' (2024-04-22)
• Updated input 'nixpkgs-wayland/nix-eval-jobs/treefmt-nix':
    'github:numtide/treefmt-nix/2961375283668d867e64129c22af532de8e77734' (2023-12-19)
  → 'github:numtide/treefmt-nix/49dc4a92b02b8e68798abd99184f228243b6e3ac' (2024-04-01)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/4371a1301c4d36cc791069d90ae522613a3a335e' (2024-04-22)
  → 'github:Mic92/sops-nix/f1b0adc27265274e3b0c9b872a8f476a098679bd' (2024-04-23)
```
2024-04-24 22:19:36 +00:00
d01e49f566 pipewire: switch back to bwrap sandboxing and document limitations 2024-04-24 13:14:35 +00:00
7447d4879e pipewire: man: link to docs 2024-04-24 10:33:23 +00:00
215864e3d4 pipewire: reduce realtime priority so it doesnt crash moby gpu driver 2024-04-24 09:36:22 +00:00
0cbb81cfea WIP: pipewire: trying to tune so lima doesnt crash 2024-04-24 09:20:13 +00:00
9d7816a1cd koreader: fix sandboxing so that i can open links again 2024-04-24 01:02:02 +00:00
461aa5ede0 htop: include "PRIORITY" column 2024-04-23 12:01:15 +00:00
b5874f4b49 sane-cast: fix casting for relative paths to mp4-only devices 2024-04-23 09:12:53 +00:00
10fc7bbb84 curlftpfs: document sandbox attempt 2024-04-23 09:08:05 +00:00
87e3f2a9ef pipewire: split rtkit into own file, and use defaults from pipewire project 2024-04-23 09:08:05 +00:00
5006692594 linux-megous: 6.7-20240306 -> 6.8-20240405 2024-04-23 09:08:05 +00:00
9481131daf pipewire: sandbox with landlock (so that rtkit integration works) and split rtkit into own file 2024-04-23 09:08:05 +00:00
ae418fb2d1 valgrind: mark as not sandboxable 2024-04-23 09:08:05 +00:00
c174eddddf wireplumber: sandbox such that it gets higher sched priority 2024-04-23 09:08:05 +00:00
6d74c6616c pipewire: shrink the mount sandbox 2024-04-23 09:08:05 +00:00
7db40fbf47 sane-cast: add a menu for choosing which device to cast to whenever there are multiple 2024-04-23 08:10:05 +00:00
152a5d4c92 sane-cast: integrate with mpv 2024-04-23 07:52:48 +00:00
e33b7d7701 sane-cast: init 2024-04-23 07:37:17 +00:00
01e176d902 libjxl: fix hash 2024-04-23 05:42:24 +00:00
fd771cdb2c fs: mount media/torrents instead of media/freeleech (the latter was removed) 2024-04-23 01:25:57 +00:00
243e8b831b libjxl cross patch: push upstream 2024-04-22 23:40:06 +00:00
9a8b4395f1 nixpkgs: 2024-04-19 -> 2024-04-22; nixpkgs-wayland, sops-nix
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/6ad1fe08582fcdfedb2cb7c31b4a016a227bd38a' (2024-04-19)
  → 'github:nixos/nixpkgs/fe2b7d6a922c875221671df6aa360b6e73d47e2f' (2024-04-22)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/40d15ed86dd08eff6a29e0a9abc416001d19cd67' (2024-04-19)
  → 'github:nixos/nixpkgs/8a3f95b79ba3083cfff90752296ef8a52a6bec9a' (2024-04-22)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/ab0f8d391a960764348935e6497fc62ba0d2378d' (2024-04-19)
  → 'github:nix-community/nixpkgs-wayland/f01c36f09cc5c2d77cbab4475528e06d6641bff4' (2024-04-22)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/f347ed9a1cab12c27541ed4d173e2f2d5c9bc0bb' (2024-04-14)
  → 'github:nix-community/lib-aggregate/3b32a98eb3053f8c8ca55497d1881443ef2996e6' (2024-04-21)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/361d8a4f443bbfab20bd6d222f9022b8c6665906' (2024-04-14)
  → 'github:nix-community/nixpkgs.lib/6882347415e352cfc9c277cc01f73e0f5cb7b93c' (2024-04-21)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/b94c6edbb8355756c53efc8ca3874c63622f287a' (2024-04-18)
  → 'github:Mic92/sops-nix/4371a1301c4d36cc791069d90ae522613a3a335e' (2024-04-22)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/8494ae076b7878d61a7d2d25e89a847fe8f8364c' (2024-04-18)
  → 'github:NixOS/nixpkgs/74574c38577914733b4f7a775dd77d24245081dd' (2024-04-20)
```
2024-04-22 22:44:15 +00:00
4c7cd06212 go2tv: clarify compatibility 2024-04-22 12:45:55 +00:00
d0de6a9254 sftpgo: reduce the passive port range
hopefully this eases the load on the upstream firewall's UPNP service
2024-04-22 12:08:23 +00:00
12f2798140 servo: sftpgo: move to own directory 2024-04-22 12:05:16 +00:00
bd92076291 fontconfig: populate the cache directory even when cross compiling 2024-04-22 09:47:20 +00:00
9cbe774c5a sane-input-handler: fix power_hold -> power_tap_1_hold when inhibited by rofi 2024-04-22 06:27:33 +00:00
b4653b20a2 moby: button map: move vol{up,down}_hold to only act in power-off, else they may falsely trigger during other power-on actions 2024-04-22 05:13:29 +00:00
2c011df252 moby: tweak button mappings
- power hold: toggle media
- power x1 -> hold: kill

now nothing in screenoff uses power x2, which means we can get to
screen-on without waiting for any timeout.
2024-04-22 05:10:35 +00:00
9d472bb290 sane-input-handler: clean up suggestedPrograms 2024-04-22 04:13:56 +00:00
95b21cbed9 moby: update improve button mappings
- power + volup: screenshot
- power + voldown: camera
- volup_hold: file browser
- remove modal media controls
2024-04-22 04:05:52 +00:00
82007c9b40 bonsai: store the config in ~/.config to allow easier online editing 2024-04-22 04:05:15 +00:00
50c72de4f9 megapixels: fix folder icon to actually open ~/Pictures/Photos 2024-04-22 00:16:46 +00:00
36237a3201 megapixels: remove unnecessary ~/tmp directory from sandbox 2024-04-22 00:16:14 +00:00
eb9df628e6 megapixels: remove unnecessary ~/.local/share/applications from sandbox 2024-04-21 23:49:29 +00:00
6e04e288ea todo.md: document rofi crashes 2024-04-21 23:21:43 +00:00
a92960d778 megapixels: place photos in ~/Pictures/Photos instead of directly in ~/Pictures 2024-04-21 23:13:49 +00:00
ef9b0e9309 megapixels: fix .dng -> .jpg conversion 2024-04-21 21:59:05 +00:00
350e00e0cd firefox: decrease scrollbar width 20px -> 14px 2024-04-21 21:08:07 +00:00
e924363dfb sysvol: 2024-02-08 -> 2024-04-11
it no longer flashes the volume on init
2024-04-21 20:43:03 +00:00
b12f31652c todo.md: update blast items 2024-04-21 11:15:22 +00:00
b77e811ad4 blast-to-default: leverage sane-die-with-parent 2024-04-21 11:09:23 +00:00
a000a722ba mpv: fix so sane-sysvol doesnt hang exit 2024-04-21 10:08:46 +00:00
4dde01245e mpv: sane_sysvol: fix non_blocking_popen to use metatables and be more readable 2024-04-21 03:47:01 +00:00
f50c0a98c2 sane-sysvol -> sane_sysvol, sane-cast -> sane_cast
when a script contains a dash, mpv silently renames *parts* of it to _, which causes confusion
2024-04-21 00:27:30 +00:00
0625bfdd10 mpv: sane-cast: fix crash due to missing table.concat function 2024-04-21 00:24:46 +00:00
4dfee58d09 sops: fix sandbox path 2024-04-20 21:43:13 +00:00
a7b8eb179b pipewire: move the clock quantum config into sane.programs proper
this ensures it's available in the sandbox
2024-04-20 09:09:05 +00:00
f10bb6c86c sftpgo: adjust file mode to be compatible with Kodi 2024-04-20 08:07:00 +00:00
a59a7b5346 feeds: podcasts: add Tech Tales 2024-04-19 21:46:03 +00:00
1bd715e57e nixpkgs: 2024-04-18 -> 2024-04-19; nixpkgs-wayland, sops-nix
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/19d2eb80a0e23daf1c4a8cf25b1011fbdb2260fb' (2024-04-18)
  → 'github:nixos/nixpkgs/6ad1fe08582fcdfedb2cb7c31b4a016a227bd38a' (2024-04-19)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/457c34178411e0072e59564ee7986e86255a6eff' (2024-04-18)
  → 'github:nixos/nixpkgs/40d15ed86dd08eff6a29e0a9abc416001d19cd67' (2024-04-19)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/7867aa617c6eb205b1ac1b71d98cd18a2561bb18' (2024-04-17)
  → 'github:nix-community/nixpkgs-wayland/ab0f8d391a960764348935e6497fc62ba0d2378d' (2024-04-19)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/cc535d07cbcdd562bcca418e475c7b1959cefa4b' (2024-04-15)
  → 'github:Mic92/sops-nix/b94c6edbb8355756c53efc8ca3874c63622f287a' (2024-04-18)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/c27f3b6d8e29346af16eecc0e9d54b1071eae27e' (2024-04-13)
  → 'github:NixOS/nixpkgs/8494ae076b7878d61a7d2d25e89a847fe8f8364c' (2024-04-18)
```
2024-04-19 20:33:48 +00:00
b7d2020f10 sane-tag-music: fix --help message 2024-04-19 07:29:20 +00:00
317996b609 clightning-sane: document the status command more 2024-04-19 07:29:20 +00:00
e197f6f54d clightning-sane: fix build 2024-04-19 07:29:20 +00:00
135f63480b clightning-sane: add a help message 2024-04-19 07:29:20 +00:00
d9ffa5bb5a wike: fix sandboxing for 3.0 2024-04-19 01:26:58 +00:00
f59f13588f jackett/transmission/slskd: validate public IP address before starting 2024-04-18 20:05:59 +00:00
c668a895d4 static-nix-shell: populate meta.mainProgram 2024-04-18 20:00:47 +00:00
9442a87311 sane-ip-check: add an --expect option to abort if IP address is not as expected 2024-04-18 19:46:16 +00:00
3bd56fb565 sane-ip-check: refactor: split out a main function 2024-04-18 19:42:16 +00:00
bdc3b1ed0e sane-ip-check: port argument parsing to argparse 2024-04-18 19:40:44 +00:00
40af93a7fb feeds: add apenwarr 2024-04-18 17:29:50 +00:00
cd4fc97bde nixpkgs: 2024-04-17 -> 2024-04-18; nixpkgs-wayland
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/73f2b40dfc3413958695ae66fca3a52ee68451d6' (2024-04-17)
  → 'github:nixos/nixpkgs/19d2eb80a0e23daf1c4a8cf25b1011fbdb2260fb' (2024-04-18)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/2528b053e7c482baa8cd93cdce81172c3f0a3cee' (2024-04-17)
  → 'github:nixos/nixpkgs/457c34178411e0072e59564ee7986e86255a6eff' (2024-04-18)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/b0260157fccc94f4fe5a09fb3a1b1f62a87ae397' (2024-04-17)
  → 'github:nix-community/nixpkgs-wayland/7867aa617c6eb205b1ac1b71d98cd18a2561bb18' (2024-04-17)
```
2024-04-18 06:56:13 +00:00
a36ff517e7 servo: slskd: disable 2024-04-18 06:55:56 +00:00
3642ead646 trust-dns: 0.24.0 -> 0.24.1 2024-04-18 06:03:34 +00:00
60c370df3f sftpgo: fix domain name in banner 2024-04-18 05:01:57 +00:00
d80852c6c1 sftpgo: re-enable password login 2024-04-18 04:58:59 +00:00
62b3047fff sftpgo: support FTPS 2024-04-18 04:34:41 +00:00
de2c3a30ff programs: ship lftp ftp client 2024-04-18 04:17:10 +00:00
c08280589d lsof: fix sandboxing 2024-04-17 23:43:42 +00:00
9a9ffcbea9 transmission: fix faulty "find" expression (thanks shellcheck!) 2024-04-17 23:32:00 +00:00
733efcfaf7 servo: nginx: forceSSL for anything media related 2024-04-17 22:49:24 +00:00
b34d984572 servo: transmission: remove noisy files upon torrent completion 2024-04-17 20:47:00 +00:00
e2b58e1b77 servo: transmission: be extra strict about requiring VPN 2024-04-17 19:52:11 +00:00
b7e5bc5972 servo: sftpgo: disable external access 2024-04-17 19:41:57 +00:00
831b4ad72a nixpkgs: 2024-04-16 -> 2024-04-17; nixpkgs-wayland -> 2024-04-17
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/097ced11fa37dec3146e0480026c0c10d7d35e6f' (2024-04-16)
  → 'github:nixos/nixpkgs/73f2b40dfc3413958695ae66fca3a52ee68451d6' (2024-04-17)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/7f1c8f1b9071c77b81b62e3be62ef5e3d0c578ad' (2024-04-16)
  → 'github:nixos/nixpkgs/2528b053e7c482baa8cd93cdce81172c3f0a3cee' (2024-04-17)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/a03b8253e5cedb72a0957f7d534ad2702d7a54f0' (2024-04-15)
  → 'github:nix-community/nixpkgs-wayland/b0260157fccc94f4fe5a09fb3a1b1f62a87ae397' (2024-04-17)
```
2024-04-17 09:54:45 +00:00
54cefa247a dino: record another bug 2024-04-17 09:53:08 +00:00
e3898449b7 sane-tag-music: allow manually specifying the track number 2024-04-17 09:45:10 +00:00
e5bad6a74c sane-tag-music: fixup track numbers 2024-04-17 07:56:52 +00:00
254343a6af todo.md: sync 2024-04-17 02:26:09 +00:00
28bfd75114 sane-tag-music: split into two operations 2024-04-17 02:25:54 +00:00
b7fd5e78cc swaync: show volume-per-app (TODO: stylize it better) 2024-04-17 01:37:03 +00:00
79985ff009 dino: docs: update notes about BUGS 2024-04-16 20:50:00 +00:00
62f5b9276f pwvucontrol: whitelist DRI inside the sandbox, for better perf 2024-04-16 20:49:33 +00:00
276844af0b sane-tag-music: update docs 2024-04-16 19:56:58 +00:00
13c1f01a6b servo: pleroma: migrate port 4000 -> 4040
port 4000 is used by NFS
2024-04-16 18:57:54 +00:00
5f281f57de servo: transmission: inline nested torrent directories 2024-04-16 18:25:41 +00:00
089e434e3f servo: transmission: fix group permissions of media when copying them to public dir 2024-04-16 16:31:10 +00:00
b068b50d7c sane-bt: require specifying a title when torrenting films 2024-04-16 16:05:39 +00:00
14911868e4 nixpkgs: 2024-04-14 -> 2024-04-16; nixpkgs-wayland, sops-nix, uninsane-dot-org
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/2d0506704b7d92cc610412b176b515fe1a782095' (2024-04-14)
  → 'github:nixos/nixpkgs/097ced11fa37dec3146e0480026c0c10d7d35e6f' (2024-04-16)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/bc59f72803cf40fb50f05cb73068d85b5ce21297' (2024-04-14)
  → 'github:nixos/nixpkgs/7f1c8f1b9071c77b81b62e3be62ef5e3d0c578ad' (2024-04-16)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/b816217ba4fc77d19ca033ab8f13b35ba0331e91' (2024-04-13)
  → 'github:nix-community/nixpkgs-wayland/a03b8253e5cedb72a0957f7d534ad2702d7a54f0' (2024-04-15)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/2737d0204685c3274390229a09eb8f7eaa1a9e89' (2024-04-07)
  → 'github:nix-community/lib-aggregate/f347ed9a1cab12c27541ed4d173e2f2d5c9bc0bb' (2024-04-14)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/3c62b6a12571c9a7f65ab037173ee153d539905f' (2024-04-07)
  → 'github:nix-community/nixpkgs.lib/361d8a4f443bbfab20bd6d222f9022b8c6665906' (2024-04-14)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/226062b47fe0e2130ba3ee9f4f1c880dc815cf87' (2024-04-14)
  → 'github:Mic92/sops-nix/cc535d07cbcdd562bcca418e475c7b1959cefa4b' (2024-04-15)
• Updated input 'uninsane-dot-org':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=b9502e6f190752d327f8cee7fa4b139094bd7c16' (2024-03-25)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=af8420d1c256d990b5e24de14ad8592a5d85bf77' (2024-04-15)
```
2024-04-16 04:59:59 +00:00
539fe48947 swaync: cleanup 2024-04-16 04:14:07 +00:00
259c3af526 swaync-fbcli: fix CPU pegging when canceling a phone ringer 2024-04-16 02:18:51 +00:00
6b5e0e57bc swaync: unify the *DEBUG variables 2024-04-15 21:29:17 +00:00
b55c903a81 todo.md: made it so unl0kr starts with keyboard 2024-04-15 21:11:20 +00:00
4f06f0dc5e unl0kr: disable animations 2024-04-15 21:10:55 +00:00
c0dde0e540 unl0kr: populate config file with upstream defaults 2024-04-15 21:05:21 +00:00
6779063578 todo.md: sync 2024-04-15 19:57:58 +00:00
2eea562d1f sandbox: remove unused "binMap" option 2024-04-15 19:56:33 +00:00
0385c09f23 sane-sandboxed: split out into an actual package 2024-04-15 18:57:22 +00:00
bd57b95598 swaync-fbcli: fix so that the child actually exits when killed (critical is to use SIGINT) 2024-04-15 18:32:50 +00:00
465da7c939 swaync-fbcli: migrate an "echo" to a "log" 2024-04-15 18:22:30 +00:00
44f76e656a swaync-fbcli: fix that pkill expression wouldn't work for wrapped binaries 2024-04-15 18:21:27 +00:00
824046aca1 swaync-fbcli: fix CPU pegging 2024-04-15 18:09:21 +00:00
827c50ff43 swaync: cleanup the swaync-fbcli helper 2024-04-15 18:00:51 +00:00
0230291bb2 swaync: move the pkill logic into swaync-fbcli 2024-04-15 17:46:40 +00:00
3d3618256d swaync: split the fbcli wrapper into its own file 2024-04-15 17:46:40 +00:00
590cb2dd7f feeds: sort the list 2024-04-15 16:21:31 +00:00
d9dcab544c feeds: unsubscribe from Profectus 2024-04-15 16:20:17 +00:00
4ee0f0c659 feeds: disable TheSideView 2024-04-15 14:59:50 +00:00
7692ab0b3e firefox-extensions.sidebery: build from source 2024-04-15 05:25:19 +00:00
2af5bb3d78 i-still-dont-care-about-cookies: enable 2024-04-15 03:36:49 +00:00
e72a0a4300 firefox extensions: support more manifest formats 2024-04-15 03:36:27 +00:00
6b0cbf684f sidebery: 5.2.0.1 -> 5.2.0.7 2024-04-15 03:36:03 +00:00
62af314238 firefox-extensions.i-still-dont-care-about-cookies: init at 1.1.4 2024-04-15 03:02:19 +00:00
e8745b4312 firefox-extensions: ublock, metamask -> latest 2024-04-15 02:35:49 +00:00
5a10173ba3 schlock: fix to run on modern sway 2024-04-15 02:07:20 +00:00
2d8fe1d3e5 bonsai: tune niceness to hopefully be more responsive 2024-04-15 01:46:32 +00:00
0741d87bcb rofi: theme so that i can read more text on narrow moby display 2024-04-15 00:04:10 +00:00
2587c27f89 font-manager: fix sandboxing 2024-04-14 21:55:52 +00:00
2d74d0725d feeds: podcasts: add Money Stuff 2024-04-14 20:39:53 +00:00
b0d1d2e1af coppwr: remove (it's been upstreamed into nixpkgs) 2024-04-14 16:16:46 +00:00
61dc79a2ea cross: remove upstreamed webkitgtk patch 2024-04-14 16:08:48 +00:00
7804236499 xdg-terminal-exec: remove upstreamed patched 2024-04-14 14:16:50 +00:00
f908762cf8 nixpkgs: 2024-04-06 -> 2024-04-14; nixpkgs-wayland, sops-nix
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/7c74352f2f7eca1925729f5c9c80cb89df8e74a2' (2024-04-06)
  → 'github:nixos/nixpkgs/2d0506704b7d92cc610412b176b515fe1a782095' (2024-04-14)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/c58702222e0a29fd01cc42d70737d699995f6389' (2024-04-06)
  → 'github:nixos/nixpkgs/bc59f72803cf40fb50f05cb73068d85b5ce21297' (2024-04-14)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/9b77653338f52da4b498abdf4835efb6ff6e453e' (2024-04-04)
  → 'github:nix-community/nixpkgs-wayland/b816217ba4fc77d19ca033ab8f13b35ba0331e91' (2024-04-13)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/9c06929b83e57c18d125f1105ba6a423f24083d2' (2024-03-31)
  → 'github:nix-community/lib-aggregate/2737d0204685c3274390229a09eb8f7eaa1a9e89' (2024-04-07)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/90b1a963ff84dc532db92f678296ff2499a60a87' (2024-03-31)
  → 'github:nix-community/nixpkgs.lib/3c62b6a12571c9a7f65ab037173ee153d539905f' (2024-04-07)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/99b1e37f9fc0960d064a7862eb7adfb92e64fa10' (2024-03-31)
  → 'github:Mic92/sops-nix/226062b47fe0e2130ba3ee9f4f1c880dc815cf87' (2024-04-14)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/2b4e3ca0091049c6fbb4908c66b05b77eaef9f0c' (2024-03-30)
  → 'github:NixOS/nixpkgs/c27f3b6d8e29346af16eecc0e9d54b1071eae27e' (2024-04-13)
```
2024-04-14 14:15:02 +00:00
feb36d19ac programs: ship cups 2024-04-14 03:33:55 +00:00
06185ac870 todo.md: add a way to exit mpv fullscreen on moby 2024-04-13 20:30:30 +00:00
a8915661a7 style: refine the base pink color for mpv and sway/waybar
this matches swaync a little better. mpv had to be made lighter, i think because of transparency stuff. probably sway/waybar could be made normal lightness
2024-04-13 20:29:24 +00:00
d57aa473ac overlays/pkgs-debug: cleanup 2024-04-13 20:29:24 +00:00
a28b7d5616 todo.md: more mobile games, mpv improvements 2024-04-13 20:29:24 +00:00
dd58ba8b00 gvfs: enable as part of nautilus, not sway 2024-04-13 20:29:24 +00:00
a21508b6ba todo.md: fix schlock (moby) 2024-04-13 20:29:24 +00:00
94cff99f53 todo.md: ftps support 2024-04-13 20:29:24 +00:00
8aa8d773de cherry-pick orc update to fix Dino calls 2024-04-13 20:29:24 +00:00
0a888e205e programs: ship objdump 2024-04-13 20:29:24 +00:00
898dc89c8f overlays: add pkgsDebug for building packages with debug symbols and such 2024-04-13 20:29:24 +00:00
4b22fd95bf introduce 'moby-min' host variant for the quickest deployment (no webkitgtk) 2024-04-13 20:29:24 +00:00
527a9e7612 feeds: add The Side View 2024-04-10 04:47:34 +00:00
3686e6e508 feeds: subscribe to Future of Coding 2024-04-10 03:06:30 +00:00
cda50db23b loupe: associate with avif filetype 2024-04-09 19:22:59 +00:00
344e24fcd2 todo.md: ssh doesnt give the right linux capabilities 2024-04-09 18:38:04 +00:00
9be6960bbf sway: disable shortcuts for creating sub-splits
i'm just always accidentally triggering them
2024-04-09 16:24:02 +00:00
a45aabfb72 sway: todo: load background from a more traditional path 2024-04-09 16:19:56 +00:00
602bf59843 todo.md: disable sway sub-layouts 2024-04-09 16:15:27 +00:00
895d7f6f20 todo.md: note that mpv exit hangs because of sane-sysvol 2024-04-09 16:13:43 +00:00
876103ff7b mpv: remove legacy ao=alsa and volume-max config 2024-04-09 16:10:05 +00:00
46cda87d5e notejot: fix sandboxing 2024-04-09 15:44:01 +00:00
d728dfcd70 mpv: uosc: tweak the maximize button to actually act as a fullscreen toggle 2024-04-09 10:14:40 +00:00
19fcd0318c mpv: remove the double-click-to-fullscreen shortcut 2024-04-09 10:09:17 +00:00
030f6d1a99 mpv: fix so pseudo-gui mode doesnt break logging 2024-04-09 09:58:16 +00:00
86b495cb9f mpv: sane-sysvol: integrate with uosc mute button 2024-04-09 08:05:00 +00:00
c897f4fa4b mpv: sane-sysvol: fix pipewire mute to reflect onto uosc volume level
ideally it would actually show up as the mute parameter!
2024-04-09 08:05:00 +00:00
8181a0664d mpv: sane-sysvol: remove the unused id tracking 2024-04-09 08:05:00 +00:00
c37e94493f mpv: sane-sysvol: optimize 2024-04-09 08:05:00 +00:00
b9e107510d mpv: sane-sysvol: dont force system volume to zero on init 2024-04-09 08:05:00 +00:00
976ae65529 todo.md: remove deprecated use of 'crypt' 2024-04-09 08:05:00 +00:00
0f4c1ccfe3 mpv: update input.conf for sane-cast rename 2024-04-09 08:05:00 +00:00
9d9413c790 mpv: announce pipewire volume changes so uosc can listen for them 2024-04-09 08:05:00 +00:00
64c28ae657 mpv: don't need to force uosc volume state to 0 by default; nil is OK 2024-04-09 08:05:00 +00:00
d221625eb3 todo.md: add work around signal, mpv 2024-04-09 08:05:00 +00:00
1f4c885748 mpv: sane-sysvol script: init
it's a one-way volume control, but that's a start
2024-04-09 08:05:00 +00:00
0545b178af mpv: rename plugin: sane -> sane-cast 2024-04-09 08:04:51 +00:00
fe4b6c36c4 feeds: subscribe to jwz.org 2024-04-09 03:55:25 +00:00
fce3436c88 servo: expose Milkbags to the internet :) 2024-04-08 06:55:09 +00:00
03bec6aab2 coppwr: init at 1.5.1-unstable-2024-03-28 (4e7239d4bd5b2f24f7ebec0a02c1054648a4425c) 2024-04-06 23:42:25 +00:00
3aba91b360 mpv: fix race condition in uosc/ao-volume monitoring 2024-04-06 23:41:59 +00:00
907933612d htop: statically populate config 2024-04-06 23:41:59 +00:00
0db546bf82 nixpkgs: 2024-04-05 -> 2024-04-06
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/9a0c25978d78416219718437fd7e618668d9ad74' (2024-04-05)
  → 'github:nixos/nixpkgs/7c74352f2f7eca1925729f5c9c80cb89df8e74a2' (2024-04-06)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/3541c7628de9414f999ced044c95a284584f4ec1' (2024-04-05)
  → 'github:nixos/nixpkgs/c58702222e0a29fd01cc42d70737d699995f6389' (2024-04-06)
```
2024-04-06 10:20:03 +00:00
b4877a488e discord: add media into sandbox 2024-04-06 09:36:55 +00:00
4b3975367a fix warnings: remove xdg-desktop-portal patch; fix mautrix-meta enable logic 2024-04-05 21:40:42 +00:00
38c8d96e5a nixpkgs: 2024-04-04 -> 2024-04-05; nixpkgs-wayland -> 2024-04-04
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/1ea9e4ecab5010d29f557f7a1f8bb26ad3afd686' (2024-04-04)
  → 'github:nixos/nixpkgs/9a0c25978d78416219718437fd7e618668d9ad74' (2024-04-05)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/e52ada4e6beea931c244bf8cc4a75d8a07d62373' (2024-04-04)
  → 'github:nixos/nixpkgs/3541c7628de9414f999ced044c95a284584f4ec1' (2024-04-05)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/30aa5f8c558cd8a699f9a9227cf7310f291f1e29' (2024-04-03)
  → 'github:nix-community/nixpkgs-wayland/9b77653338f52da4b498abdf4835efb6ff6e453e' (2024-04-04)
```
2024-04-05 09:28:25 +00:00
28110c3e85 fix system hang during vim ctrl+z (disable io_uring in libuv) 2024-04-05 07:29:55 +00:00
43aa498ff9 mpv: fix uosc touch controls 2024-04-05 07:29:15 +00:00
f7e4504764 pict-rs: remove no-transcoding patch (it doesnt apply anymore) 2024-04-04 19:09:12 +00:00
4942fa8a38 nixpkgs: 2024-04-02 -> 2024-04-04
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/7a5ee8d0c786f9fd789b5bb07245d2a8b12193a4' (2024-04-02)
  → 'github:nixos/nixpkgs/1ea9e4ecab5010d29f557f7a1f8bb26ad3afd686' (2024-04-04)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/7ab59131642a42b92f4d6554173ef9a35cbb39f0' (2024-04-02)
  → 'github:nixos/nixpkgs/e52ada4e6beea931c244bf8cc4a75d8a07d62373' (2024-04-04)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/8c4df2153c615554b516ba698f5f7bd64f7bf520' (2024-03-31)
  → 'github:nix-community/nixpkgs-wayland/30aa5f8c558cd8a699f9a9227cf7310f291f1e29' (2024-04-03)
```
2024-04-04 06:27:24 +00:00
7ab148ea58 servo: migrate /var/media to be 100% on zfs pool 2024-04-04 06:20:50 +00:00
0dfeec3260 mpv-uosc: 5.2.0 -> 5.2.0-unstable-2024-03-13 2024-04-04 06:19:15 +00:00
eb2317a743 mpv: 0.37.0 -> 0.37.0-unstable-2024-03-31 2024-04-04 06:19:15 +00:00
1a0ef28377 sane-bt-add: document how to *move* a torrent 2024-04-03 11:00:54 +00:00
7c3ad85d75 sane-bt-add: fix sandboxing 2024-04-03 09:48:21 +00:00
7766e1cec1 sane_bt: save torrents to /var/media/torrents by default 2024-04-03 09:48:21 +00:00
158e674f83 sane_bt.py: fix dict typo 2024-04-03 09:48:21 +00:00
410097480f docs: servo: fs: fix setfacl typo 2024-04-03 09:48:10 +00:00
f5fadbe4cf transmission: place torrents in a separate directory, and copy them to the main media directory on completion 2024-04-03 09:48:10 +00:00
a0550660e7 feeds: add The Corresponding Source podcast 2024-04-02 22:10:36 +00:00
bad6c353ed sane-bt: refactor 2024-04-02 20:53:01 +00:00
a814832e48 feeds: add Hacker Public Radio podcast 2024-04-02 19:34:42 +00:00
a4312f1494 nixpkgs: 2024-04-01 -> 2024-04-02
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/409234ba0c73ce2cee676f14b68a88e2b5a52af8' (2024-04-01)
  → 'github:nixos/nixpkgs/7a5ee8d0c786f9fd789b5bb07245d2a8b12193a4' (2024-04-02)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/e7de14ea98fe984aa73a5a6b2f540ca817471106' (2024-04-01)
  → 'github:nixos/nixpkgs/7ab59131642a42b92f4d6554173ef9a35cbb39f0' (2024-04-02)
```
2024-04-02 09:46:40 +00:00
747032d9a4 dino: run with higher scheduling priority 2024-04-02 09:02:44 +00:00
9b2e35b93f pipewire: ship rtkit and unlock better scheduling priority 2024-04-02 09:02:06 +00:00
d2751237c1 xdg-desktop-portal-wlr: propery document its dependency on pipewire 2024-04-02 09:01:35 +00:00
ae87160de3 dino: 0.4.3 -> 0.4.3-unstable-2024-04-01 2024-04-02 04:57:11 +00:00
a90a213cc0 apps: gui: disable under-used "blanket" noise generator 2024-04-02 04:18:53 +00:00
24c04b8fc0 docs: xdg-desktop-portal: link to Door Knocker debugging tool 2024-04-02 04:18:53 +00:00
d0b022d1c6 libnice: 0.1.21 -> 0.1.22 2024-04-02 04:18:35 +00:00
9d9791814a audacity: fix sandboxing 2024-04-02 02:56:51 +00:00
b85d4b20f8 nixpkgs: 2024-03-31 -> 2024-04-01, nixpkgs-wayland
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/6b7b5776bef8eed645f63725ce31fa0946f997ff' (2024-03-31)
  → 'github:nixos/nixpkgs/409234ba0c73ce2cee676f14b68a88e2b5a52af8' (2024-04-01)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/7848d6f048d38c42a8aeeff7fe7d36916ffb8284' (2024-03-31)
  → 'github:nixos/nixpkgs/e7de14ea98fe984aa73a5a6b2f540ca817471106' (2024-04-01)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/11544449e6b696e209463aae094e736368eef757' (2024-03-30)
  → 'github:nix-community/nixpkgs-wayland/8c4df2153c615554b516ba698f5f7bd64f7bf520' (2024-03-31)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/120535dff702c551ec76a125a181d90131407264' (2024-03-24)
  → 'github:nix-community/lib-aggregate/9c06929b83e57c18d125f1105ba6a423f24083d2' (2024-03-31)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/b2a1eeef8c185f6bd27432b053ff09d773244cbc' (2024-03-24)
  → 'github:nix-community/nixpkgs.lib/90b1a963ff84dc532db92f678296ff2499a60a87' (2024-03-31)
```
2024-04-01 07:42:47 +00:00
331e673589 common/fs: mount /mnt/servo/media/* directories more granularly
this benefits sandboxing
2024-04-01 07:31:25 +00:00
bbb93600b7 /mnt/servo/*: mount in a way which doesn't block sandboxes 2024-04-01 06:00:17 +00:00
c0de54c11a curlftpfs: exit on timeout error 2024-04-01 04:02:32 +00:00
0d29722443 common/fs: refactor and DRY 2024-04-01 02:12:06 +00:00
1c2a375b6d common/fs: split curlftpfs into sane.programs
this makes it easier to build outside of /etc/fstab context, and opens a future path to sandboxing
2024-04-01 00:50:14 +00:00
b6840a3ed4 curlftpfs: build via my own repo 2024-04-01 00:43:07 +00:00
74e994598e feeds: add David Revoy 2024-03-31 20:28:41 +00:00
856b6fcd7a feeds: add Willow 2024-03-31 18:20:49 +00:00
2404fb66f3 nixpkgs: 2024-03-26 -> 2024-0-31; nixpkgs-wayland, sops
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/c904e6bf24e582e4fe28e988b7cdb7e9fda595c3' (2024-03-26)
  → 'github:nixos/nixpkgs/6b7b5776bef8eed645f63725ce31fa0946f997ff' (2024-03-31)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/da0502af1164c4fd04ebcd3acde1e378a861bd19' (2024-03-26)
  → 'github:nixos/nixpkgs/7848d6f048d38c42a8aeeff7fe7d36916ffb8284' (2024-03-31)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/7274c73cf5708ed3a814edc9605463ec4a116619' (2024-03-25)
  → 'github:nix-community/nixpkgs-wayland/11544449e6b696e209463aae094e736368eef757' (2024-03-30)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/405987a66cce9a4a82f321f11b205982a7127c88' (2024-03-24)
  → 'github:Mic92/sops-nix/99b1e37f9fc0960d064a7862eb7adfb92e64fa10' (2024-03-31)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/ac6bdf6181666ebb4f90dd20f31e2fa66ede6b68' (2024-03-23)
  → 'github:NixOS/nixpkgs/2b4e3ca0091049c6fbb4908c66b05b77eaef9f0c' (2024-03-30)
```
2024-03-31 06:30:10 +00:00
cd6a91e995 sway: tune sandboxing 2024-03-31 05:59:10 +00:00
89d4b0ae0b s6-rc: don't tee to /dev/stderr, as i don't want any logs going to the console and interfering with text entry 2024-03-31 05:20:33 +00:00
ade680d9d2 unl0kr: remove legacy wayland stuff (it's handled by s6 now) 2024-03-31 05:20:33 +00:00
6d4a43fa0d sway: warn when needed runtime dirs dont exist 2024-03-31 05:20:20 +00:00
d3ad661970 servo: zfs: enable reflink support 2024-03-31 03:48:34 +00:00
c9632b05f9 linux-megous: fix config so that it boots to graphics again
see: <https://github.com/NixOS/nixpkgs/pull/298332>
2024-03-31 03:24:33 +00:00
1e7de43da8 docs: sway: mention that hotplugging is broken 2024-03-31 03:24:33 +00:00
eff37765ae sane.image: fix so imgs.moby includes a working bootloader 2024-03-31 03:24:33 +00:00
a65673847a superTux, superTuxKard: don't ship on moby
i don't use it there; it wastes deploy time
2024-03-31 03:24:33 +00:00
930c5e2412 delfin: don't ship
i don't use it; it wastes deploy time
2024-03-31 03:24:33 +00:00
aff2a78ec3 sane-reclaim-boot-space: fix "self.format_attr" typo 2024-03-31 03:23:49 +00:00
f01758503c linux-megous: orange-pi-6.7-20240211-1928 -> orange-pi-6.7-20240306-2359
still getting PHY issues with it, but it boots to ssh
2024-03-29 18:18:37 +00:00
e855be4796 hosts/common: port /mnt/servo/* from NFS -> FTP
fuse ftp seems to be easier to debug than kernel nfs so far
2024-03-28 23:15:05 +00:00
701e10b121 hosts/common/fs: optimize NFS options 2024-03-28 23:15:05 +00:00
eadb2057d9 sane-wipe: port from systemd -> s6 2024-03-28 23:15:05 +00:00
5ed29ceb47 servo: /var/media: fixup permissions so everything is r/w by "media" group, including sftpgo 2024-03-28 23:14:40 +00:00
725ab13628 servo: nfs: allow UDP NFSv3 connections 2024-03-27 00:54:58 +00:00
32e691b85b feeds: add Hardcore Software by Steven Sinofsky 2024-03-26 14:08:13 +00:00
0108502055 feedbackd: fix so it depends on pipewire before launch 2024-03-26 13:48:13 +00:00
6c5b32aac2 s6-rc: fix so the service manager knows about readiness notifications again 2024-03-26 13:34:38 +00:00
f59dd99470 s6-rc: init services in the "down" state 2024-03-26 12:55:40 +00:00
55c8a98c33 s6-rc: pre-compute more stuff as nix exprs; don't even run s6-rc-init 2024-03-26 12:36:46 +00:00
7bb67391ae nixpkgs: remove obsoleted patches 2024-03-26 11:16:43 +00:00
c6a1f310a0 servo: net: actually assert that ovpns exists if we fail to add it 2024-03-26 11:13:10 +00:00
1d494513a9 slskd: document common errors/flakiness 2024-03-26 11:04:21 +00:00
fb79ca4c8e programs: iproute: use a less restrictive sandbox 2024-03-26 10:54:29 +00:00
3cf42db7dc slskd: fix for more recent nixpkgs 2024-03-26 10:47:20 +00:00
aba5eee837 nixpkgs: 2024-03-25 -> 2024-03-26; others
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/8794d573a4fdd15b0002135cebf65a8f5d9adb6c' (2024-03-25)
  → 'github:nixos/nixpkgs/c904e6bf24e582e4fe28e988b7cdb7e9fda595c3' (2024-03-26)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/0d2dc20762f21c3e43fc2acc03f9552adbc392bc' (2024-03-25)
  → 'github:nixos/nixpkgs/da0502af1164c4fd04ebcd3acde1e378a861bd19' (2024-03-26)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/59f7ad2c27737a7ea7ad16a48c95631f159ef822' (2024-03-24)
  → 'github:nix-community/nixpkgs-wayland/7274c73cf5708ed3a814edc9605463ec4a116619' (2024-03-25)
• Updated input 'uninsane-dot-org':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=9a3b2d74c3e6d177fd1317d03f4e3eecca7beb7b' (2024-03-19)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=b9502e6f190752d327f8cee7fa4b139094bd7c16' (2024-03-25)
```
2024-03-26 09:44:45 +00:00
5cd9f34884 s6-rc: remove more unnecessarily files from live dir 2024-03-26 00:45:24 +00:00
2cabe51956 s6-rc: remove a couple more unused files from the live dir 2024-03-26 00:22:14 +00:00
cb8e9b7a23 s6-rc: make it so, once started, other programs can start/stop services but NOT edit/create them 2024-03-26 00:11:02 +00:00
4eb6b5735e users/s6-rc: allow startS6 "" 2024-03-25 16:46:51 +00:00
5d3899959b users/s6-rc: split out compiled var 2024-03-25 14:56:41 +00:00
ad951ad919 users/s6-rc: add symlink capabilities to my fs abstraction 2024-03-25 14:46:43 +00:00
5ecabc57bf feeds: add low<-tech magazine 2024-03-25 13:13:41 +00:00
48a4c1bd26 feeds: add nixpkgs.news 2024-03-25 13:13:03 +00:00
1f47c5ba2e nixpkgs: 2024-03-23 -> 2024-03-25; nixpkgs-wayland; sops-nix
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/f4a0cee9233d6db356a0bdab307e865327a9b96b' (2024-03-23)
  → 'github:nixos/nixpkgs/8794d573a4fdd15b0002135cebf65a8f5d9adb6c' (2024-03-25)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/499583c00280ed90686b058e38a68fc9be2f4c4c' (2024-03-23)
  → 'github:nixos/nixpkgs/0d2dc20762f21c3e43fc2acc03f9552adbc392bc' (2024-03-25)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/0d291a959d01bb5d2bd2e20689b78258fa842cca' (2024-03-23)
  → 'github:nix-community/nixpkgs-wayland/59f7ad2c27737a7ea7ad16a48c95631f159ef822' (2024-03-24)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/f890211817b941d9ed9de48d62ba8553fa2c20f3' (2024-03-17)
  → 'github:nix-community/lib-aggregate/120535dff702c551ec76a125a181d90131407264' (2024-03-24)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/fa827dda806c5aa98f454da4c567991ab8ce422c' (2024-03-17)
  → 'github:nix-community/nixpkgs.lib/b2a1eeef8c185f6bd27432b053ff09d773244cbc' (2024-03-24)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/83b68a0e8c94b72cdd0a6e547a14ca7eb1c03616' (2024-03-17)
  → 'github:Mic92/sops-nix/405987a66cce9a4a82f321f11b205982a7127c88' (2024-03-24)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/6dc11d9859d6a18ab0c5e5829a5b8e4810658de3' (2024-03-16)
  → 'github:NixOS/nixpkgs/ac6bdf6181666ebb4f90dd20f31e2fa66ede6b68' (2024-03-23)
```
2024-03-25 00:23:58 +00:00
febedb9323 nits: update --replace uses to --replace-{fail,quiet} as appropriate 2024-03-24 12:49:18 +00:00
aed5ea4b2e static-nix-shell: dont fail build if "nix-shell" occurs in the file as a non-directive 2024-03-24 12:28:23 +00:00
4e74ba5bab swaync-service-dispatcher: fix start/stop inversion 2024-03-24 12:22:54 +00:00
03fbb780b2 sane.programs: sandbox: refactor extraRuntimePaths computation 2024-03-24 12:03:38 +00:00
9c0b175260 swaync: allow toggling of s6 services 2024-03-24 11:54:12 +00:00
e62be121e2 users/services: s6: fix so s6-rc stop can actually kill processes 2024-03-24 11:48:41 +00:00
774066e53c swaync: factor out a "service-dispatcher" 2024-03-24 09:21:07 +00:00
86400f45d6 swaync: port to s6 2024-03-24 08:56:06 +00:00
ddef2d0bfc swaync: rename: print-is-active -> print-systemd-active 2024-03-24 08:54:27 +00:00
0172aa0b69 swaync: refactor 2024-03-24 08:54:27 +00:00
ce991c8887 swaync: refactor 2024-03-24 08:54:27 +00:00
92d8d42997 swaync: split the buttons out of the main config file 2024-03-24 08:54:27 +00:00
1c4ef84ec7 swaync: remove legacy sxmo-specific notification visibility rules 2024-03-24 08:54:27 +00:00
a820ae57c0 swaync: remove sxmo timer rules 2024-03-24 08:54:27 +00:00
89f913cadc xdg-desktop-portal: 1.18.2 -> 1.18.2-unstable-2024-03-11
this will *hopefully* improve stability
2024-03-24 08:08:48 +00:00
d14fda2e62 engrampa: remove custom patch (upstream released a new version) 2024-03-24 07:46:22 +00:00
f680a4a25c engrampa: patch the package via sane.programs, not nixpkgs overlay 2024-03-24 07:44:30 +00:00
7c461cee2f pkgs: remove gnome-control-center (unused) 2024-03-24 07:38:22 +00:00
47d37b4ce5 xdg-desktop-portal: enable logging 2024-03-24 07:19:33 +00:00
a1cc045837 waybar: update persistent_workspaces -> persistent-workspaces
the former is deprecated
2024-03-24 06:17:43 +00:00
72dd556b72 assorted: fix meta.homepage URLs for nur packages 2024-03-24 03:54:09 +00:00
ff9e1111b3 nixpkgs: 2024-03-22 -> 2024-03-23
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/5132e88bc7caad27f4cf28cbaa7b04c915e2c261' (2024-03-22)
  → 'github:nixos/nixpkgs/f4a0cee9233d6db356a0bdab307e865327a9b96b' (2024-03-23)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/e5d75daa715cbaee8b989f58884a31c0be00a8a0' (2024-03-22)
  → 'github:nixos/nixpkgs/499583c00280ed90686b058e38a68fc9be2f4c4c' (2024-03-23)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/61e42f8f6c9b0c2b557a4c978ea11874d3761083' (2024-03-22)
  → 'github:nix-community/nixpkgs-wayland/0d291a959d01bb5d2bd2e20689b78258fa842cca' (2024-03-23)
```
2024-03-23 21:49:57 +00:00
7f8cae42ff s6: migrate to /run/user/$id/s6 2024-03-23 21:33:08 +00:00
5b83d4d944 s6-rc: patch to use /run/user/$id/s6 as the default live dir 2024-03-23 20:52:42 +00:00
f16a68f5bb element-desktop: use native wayland, not Xwayland 2024-03-23 18:51:41 +00:00
6646a21089 nixpatches: fix handbrake hash 2024-03-23 18:02:45 +00:00
4bf43d884a nixpkgs: minor bump
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/86b5ff8306a63bb266590018b21d2ae502a74880' (2024-03-22)
  → 'github:nixos/nixpkgs/5132e88bc7caad27f4cf28cbaa7b04c915e2c261' (2024-03-22)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/6e147dce88054c47dd90c0be8c33500e023f8261' (2024-03-22)
  → 'github:nixos/nixpkgs/e5d75daa715cbaee8b989f58884a31c0be00a8a0' (2024-03-22)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/7d053c33b7a130ddada43ba09b089244390b3a23' (2024-03-19)
  → 'github:nix-community/nixpkgs-wayland/61e42f8f6c9b0c2b557a4c978ea11874d3761083' (2024-03-22)
```
2024-03-23 18:01:51 +00:00
46fe6c690b sway: fix WAYLAND_DISPLAY to be relative 2024-03-23 17:59:37 +00:00
dd7b1dae5f sway: remove unnecessary pidspace sandbox exception
i guess this was from when SWAYSOCK was named after the pid?
2024-03-23 17:35:39 +00:00
2e58353b0e refactor: users/services: have waitExists support waiting on multiple paths 2024-03-23 17:28:29 +00:00
f65d3d04dc sway: do the WAYLAND_DISPLAY moving inside sway config itself 2024-03-23 17:09:57 +00:00
6102a0301d sway: move $WAYLAND_DISPLAY into a subdir to make it easier to sandbox 2024-03-23 16:37:22 +00:00
39de5b84c2 sway: fix readiness check 2024-03-23 15:54:20 +00:00
5205251f6f programs: xwayland: sandbox it without exposing net access 2024-03-23 15:33:23 +00:00
8c48adefa5 pipewire: move sockets into a subdirectory for easier sandboxing 2024-03-23 13:34:13 +00:00
db2801c652 sway: don't launch s6 from within the sway session 2024-03-23 13:11:14 +00:00
4418c16967 users/services: s6: push bundle dependencies down onto the actual atomic services 2024-03-23 13:04:12 +00:00
8008fd35cb modules/users: allow readiness.pathExists 2024-03-23 13:03:11 +00:00
36ea5b53ad sway: place SWAYSOCK in a subdirectory 2024-03-23 11:33:58 +00:00
552d14b1b5 nixpatches: fix hashes 2024-03-23 09:29:34 +00:00
c404c8b2ae xdg-terminal-exec: fix bad interaction with TERMINAL 2024-03-23 09:28:26 +00:00
d129ae2c03 koreader-from-src: remove a bunch of old cruft
this is beginning to look upstream-ready :)
2024-03-22 20:16:33 +00:00
58341b75f2 koreader-from-src: popen-noshell,turbo: populate more directly 2024-03-22 20:05:22 +00:00
373388c5b8 koreader-from-src: mupdf: populate more directly 2024-03-22 19:54:13 +00:00
8d45aad534 xdg-dirs: populate env vars at login
otherwise i believe they dont actually take effect?
2024-03-22 19:31:04 +00:00
a783bc9577 koreader-from-src: minizip: populate in a simpler manner 2024-03-22 19:24:19 +00:00
267d374b19 xdg-dirs: specify XDG_SCREENSHOTS_DIR 2024-03-22 19:23:14 +00:00
e67ce7576b koreader-from-src: lunasvg: populate in a simpler way 2024-03-22 19:16:45 +00:00
ce770dbea9 koreader: lodepng: provide in a more direct manner 2024-03-22 18:59:17 +00:00
e7a65abd0b koreader-from-src: libk2pdfopt: populate in a more direct manner 2024-03-22 18:53:23 +00:00
702a6cc7fa koreader: kobo-usbms: link into build environment in a simpler fashion 2024-03-22 18:28:19 +00:00
f889543aa5 koreader-from-src: fbink: provide the sources more directly 2024-03-22 18:21:26 +00:00
98073f5e19 koreader-from-src: inject tesseract sources via make args 2024-03-22 17:58:41 +00:00
96c330813f xterm: remove
xdg-terminal-exec updated recently, and it seems to prefer xterm over alacritty for some reason
2024-03-22 17:28:26 +00:00
a6d9c62bcf lemonade: 2023.10.29 -> 2024.03.20
not much changed
2024-03-22 17:27:20 +00:00
8ff34d8518 koreader: migrate leptonica dep away from the sources hack
i hope that by using the makefile vars i can eventually get rid of the
"stamp" nonsense.
2024-03-22 17:16:19 +00:00
e11dd0ecb0 firefox-extensions: update to latest 2024-03-22 16:27:23 +00:00
3b6dfea2d0 koreader-from-src: notes about updating leptonica 2024-03-22 15:53:17 +00:00
22254db74c koreader-from-src: cleanup (remove unused "machineAgnostic" and "package" third-party dependency options) 2024-03-22 14:42:37 +00:00
a316c87db6 koreader-from-src: use nixpkgs nanosvg (or, most of it) 2024-03-22 14:29:23 +00:00
fe2fb40565 koreader-from-src: don't vendor lj-wpaclient (unused) 2024-03-22 13:40:09 +00:00
cd63fdb510 koreader: cleanup 2024-03-22 12:12:14 +00:00
1e25f37774 nixpkgs: 2024-03-21 -> 2024-03-22
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/33cddc79aa062e243c59d3ac36b8b938f267748a' (2024-03-21)
  → 'github:nixos/nixpkgs/86b5ff8306a63bb266590018b21d2ae502a74880' (2024-03-22)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/783b241f949bea90e3347ce516ad8af84bde3126' (2024-03-21)
  → 'github:nixos/nixpkgs/6e147dce88054c47dd90c0be8c33500e023f8261' (2024-03-22)
```
2024-03-22 11:56:51 +00:00
cdac23211c nixpkgs: 2024-03-13 -> 2024-03-21; others
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/4ee0840ba2ecc50458ab1677d108afcd691f4815' (2024-03-13)
  → 'github:nixos/nixpkgs/33cddc79aa062e243c59d3ac36b8b938f267748a' (2024-03-21)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/2dbc8f62d8af7a1ab962e4b20d12b25ddcb86ced' (2024-03-13)
  → 'github:nixos/nixpkgs/783b241f949bea90e3347ce516ad8af84bde3126' (2024-03-21)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/771cb198c281db6918829651f194bf4db32e342d' (2024-03-13)
  → 'github:nix-community/nixpkgs-wayland/7d053c33b7a130ddada43ba09b089244390b3a23' (2024-03-19)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/45b75bf534592c0c1c881a1c447f7fdb37a87eaf' (2024-03-11)
  → 'github:nix-community/lib-aggregate/f890211817b941d9ed9de48d62ba8553fa2c20f3' (2024-03-17)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/630ebdc047ca96d8126e16bb664c7730dc52f6e6' (2024-03-10)
  → 'github:nix-community/nixpkgs.lib/fa827dda806c5aa98f454da4c567991ab8ce422c' (2024-03-17)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/e52d8117b330f690382f1d16d81ae43daeb4b880' (2024-03-11)
  → 'github:Mic92/sops-nix/83b68a0e8c94b72cdd0a6e547a14ca7eb1c03616' (2024-03-17)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/b17375d3bb7c79ffc52f3538028b2ec06eb79ef8' (2024-03-10)
  → 'github:NixOS/nixpkgs/6dc11d9859d6a18ab0c5e5829a5b8e4810658de3' (2024-03-16)
• Updated input 'uninsane-dot-org':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=bb10cd8853d05191e4d62947d93687c462e92c30' (2024-02-15)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=9a3b2d74c3e6d177fd1317d03f4e3eecca7beb7b' (2024-03-19)
```
2024-03-21 18:03:37 +00:00
e6c00e6215 users/services: implement dbus readiness checks for s6-rc 2024-03-21 17:16:11 +00:00
fff9d69e3e users/services: s6-rc: implement readiness polling 2024-03-21 17:16:11 +00:00
4fa7e6113d users/services: s6: exec into the run/finish commands 2024-03-21 17:16:11 +00:00
16ca71188f users/services: simplify the before/after/wantedBy criteria, to match s6 concepts 2024-03-21 17:16:11 +00:00
c5c37e79ac users/services: actually remove the systemd backend 2024-03-21 17:16:11 +00:00
d2f6648bce users/services: refactor: replace ExecStart/ExecStopPost with command/cleanupCommand
note that this completely breaks the systemd backend (though easily fixable if wanted)
2024-03-21 17:16:11 +00:00
5c9c7f8073 modules/users/s6-rc: add per-service logging 2024-03-21 17:16:11 +00:00
218072b2fe refactor: modules/users/s6-rc.nix 2024-03-21 17:16:11 +00:00
d4f217a4f5 refactor: modules/users/s6-rc.nix 2024-03-21 17:16:11 +00:00
40f6f88a64 users/services: s6: remove broken log stuff
apparently the /log shorthand is only applicable to base `s6-supervise`,
and not `s6-rc`. "pipeline"s are the s6-rc equivalent:
<https://wiki.gentoo.org/wiki/S6-rc#Longrun_pipelining>
2024-03-21 17:16:11 +00:00
fbbb09322a users/services: s6-rc: support ExecStopPost option 2024-03-21 17:16:11 +00:00
e7153ce4a1 users/services: remove ExecStartPre option 2024-03-21 17:16:11 +00:00
b13e7c38c7 users/services: remove script option 2024-03-21 17:16:11 +00:00
058c95bb2c sysvol: remove autostart option (assume true) 2024-03-21 17:16:11 +00:00
9b793ef4b8 programs: services: no need to fully-qualify paths anymore (s6 doesn't require) 2024-03-21 17:16:11 +00:00
1417497001 users/services: remove serviceConfig.Type option 2024-03-21 17:16:11 +00:00
db12e03f64 users/services: remove oneshot service type 2024-03-21 17:16:11 +00:00
dee4866737 users/services: remove ConditionEnvironment option 2024-03-21 17:16:11 +00:00
81a6c53c26 users/services: remove RemainAfterExit option 2024-03-21 17:16:11 +00:00
9afd9725d1 users: services: remove no-longer-needed Restart and RestartSec options 2024-03-21 17:16:11 +00:00
384bc9e816 xdg-desktop-portal: fix to not over-escape $HOME in s6 service definition 2024-03-21 17:16:11 +00:00
452619dbfc s6: log when a service starts up
it still seems to be all logging into a single file though?
2024-03-21 17:16:11 +00:00
6c6e10e470 s6: install manpages 2024-03-21 17:16:11 +00:00
dcdf58e1ab sway: simplify wrapper 2024-03-21 17:16:11 +00:00
48b2280f2e feedbackd: fix over-escaping of $HOME 2024-03-21 17:16:11 +00:00
8bedc860ae s6: add some minimal logging
the root s6 call seems to be doing some logging, notably feedbackd; still don't know where the other logs are going
2024-03-21 17:16:11 +00:00
cbecdc4a95 s6: use exec in the run trampoline, to forward file descriptors and keep a cleaner process tree 2024-03-21 17:16:11 +00:00
e1001f57c5 modules/users: remove no-longer-need environment option 2024-03-21 17:16:11 +00:00
291e704477 programs: replace systemd-specific 'environment' option with generic 'env'
note, these services no longer work with systemd, because systemd expects absolute paths
2024-03-21 17:16:11 +00:00
d199e9df99 programs: wob (and wob-audio): remove
i don't use it, and its service file was no longer compatible with s6 (it used 'environment')
2024-03-21 17:16:11 +00:00
2336767059 port service manager to s6
still a lot of cleanup to do (e.g. support dbus service types), but it boots to a usable desktop
2024-03-21 17:16:11 +00:00
63af94383b sane-input-handler: only inhibit controls if screen is on 2024-03-21 17:16:11 +00:00
05b37669e3 s6-rc: fix service run file to have expected format 2024-03-21 17:16:11 +00:00
ea9768c6ab modules/users: prototype s6 integration: ~/.config/s6/{sources,compiled} 2024-03-21 17:16:11 +00:00
38353dbc29 modules/users: remove unused requiredBy service option 2024-03-21 17:16:11 +00:00
ef4a8e1989 modules: users: split services -> fs mapping into own systemd.nix file 2024-03-21 17:16:11 +00:00
acc9a9cb48 modules/users: make it a directory 2024-03-21 17:16:11 +00:00
0335b89a12 fractal: stop persisting old directories 2024-03-21 17:16:01 +00:00
0a6b0cbec7 gtkcord4: rename to dissent 2024-03-21 17:16:01 +00:00
df2310d590 gnome-keyring: ensure the keyring directory is created before entering the sandbox 2024-03-21 17:16:01 +00:00
70b5c57b50 modules/programs: enforce (or rather document) a stricter schema
this should make it easier to switch to a different service manager
2024-03-21 17:16:01 +00:00
c28ac38652 modules/users: refactor to remove inherits 2024-03-21 17:16:01 +00:00
52133fde30 delfin: 0.4.1 -> 0.4.2 2024-03-21 13:51:46 +00:00
098cd2051e sftpgo: expose to the WAN 2024-03-14 13:11:44 +00:00
691a7d7ff7 sftpgo: configure for credential-gated r/w access 2024-03-14 13:11:44 +00:00
c7c2785ad8 sftpgo_external_auth_hook: refactor 2024-03-14 13:11:44 +00:00
4c1a7fc910 sftpgo: port auth program to python 2024-03-14 13:11:44 +00:00
3c43fba878 feeds: add NativLang per Ben's rec 2024-03-14 07:53:19 +00:00
7904957544 give self cap_sys_nice 2024-03-14 07:02:57 +00:00
b25df1d997 sane-sandboxed: fix capabilities example 2024-03-14 01:36:46 +00:00
d08f318e4b pmos: move to correct section 2024-03-13 23:51:24 +00:00
f655c31d77 Merge branch 'dev' 2024-03-13 23:48:48 +00:00
288d57e5d5 feeds: subscribe to pmOS blog 2024-03-13 23:20:45 +00:00
f669f2bfe8 procmail: merged into staging-next 2024-03-13 23:12:37 +00:00
5554ad9fe2 nixpkgs: 2024-03-12 -> 2024-03-13
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/2e2cc05898bbe54a8004801ea300525b231d24e2' (2024-03-12)
  → 'github:nixos/nixpkgs/4ee0840ba2ecc50458ab1677d108afcd691f4815' (2024-03-13)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/21adc4f16a8ab151fec83b9d9368cd62d9de86bc' (2024-03-12)
  → 'github:nixos/nixpkgs/2dbc8f62d8af7a1ab962e4b20d12b25ddcb86ced' (2024-03-13)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/0f9388d3a9daa597ad87b870de236fb45e24ba63' (2024-03-12)
  → 'github:nix-community/nixpkgs-wayland/771cb198c281db6918829651f194bf4db32e342d' (2024-03-13)
```
2024-03-13 15:37:50 +00:00
6595d177be gimp: fix sandboxing 2024-03-13 11:36:57 +00:00
d194abb4bf swaync: stylize the actual notifications 2024-03-13 11:29:05 +00:00
eaf45e2366 swaync: re-theme (pink/black) 2024-03-13 11:07:17 +00:00
66e04857b6 swaync: fix dimensions to be compatible with pinephone 2024-03-13 08:29:23 +00:00
fa0dcdc5be swaync: splie style.css out to own file 2024-03-13 08:18:34 +00:00
23b87a283a swaync: move to own directory 2024-03-13 08:17:14 +00:00
849ca59f68 swaync: fix styling of toggle buttons 2024-03-13 08:16:47 +00:00
5e1a6062af swaync: ensure it starts *after* pipewire-pulse so that the mpris plugin can function 2024-03-13 07:53:45 +00:00
8dacb93861 fontconfig: remove no-longer-needed cache; disable Font Awesome (emoji seem well-covered by Noto Color Emoji) 2024-03-13 05:28:57 +00:00
eafabe87c4 xdg-desktop-portal: tell systemd the BusName of the service so that it won't consider it started until after said bus name is acquired
this partially fixes an error in sandboxed gtk apps where they would try to connect to org.freedesktop.portal to query settings, and then fall back to bad default fonts when the endpoint errored (because xdp-gtk wasn't ready)
2024-03-13 05:27:43 +00:00
4510352c07 sane-sandboxed: implement --sane-sandbox-no-portal flag 2024-03-13 04:49:48 +00:00
430592632c sane-sandboxed: add a help message 2024-03-13 04:49:48 +00:00
ac22b36d78 dconf: invoke it ourselves instead of letting dbus do it for us 2024-03-13 04:49:48 +00:00
4439491bf0 dconf: fix over-restrictive sandboxing (because previously it was being run unsandboxed...) 2024-03-13 04:49:48 +00:00
56aca78d84 make-sandboxed: also sandbox the .lib output of a package 2024-03-13 04:49:48 +00:00
546482dc80 dconf: disable GIO_EXTRA_MODULES patch 2024-03-13 02:41:39 +00:00
2f07fff084 dconf: migrate to sane.programs 2024-03-13 02:33:02 +00:00
294563c655 dbus: fix to only search /run/current-system/sw/share/dbus-1 for service files 2024-03-13 02:04:02 +00:00
f6c3557b8c nixpkgs: 2024-03-11 -> 2024-03-12
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/ec7a981885b5ede88eabf9bb3516706107de00b2' (2024-03-11)
  → 'github:nixos/nixpkgs/2e2cc05898bbe54a8004801ea300525b231d24e2' (2024-03-12)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/0fbcc4b2e8571f4af39be41752581ea09dd9ab06' (2024-03-11)
  → 'github:nixos/nixpkgs/21adc4f16a8ab151fec83b9d9368cd62d9de86bc' (2024-03-12)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/27a56d7435094f141bf5adfe9cfe155932597935' (2024-03-11)
  → 'github:nix-community/nixpkgs-wayland/0f9388d3a9daa597ad87b870de236fb45e24ba63' (2024-03-12)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/b8a148b163687c9be602b63c6b0b7bc81eecb015' (2024-03-10)
  → 'github:nix-community/lib-aggregate/45b75bf534592c0c1c881a1c447f7fdb37a87eaf' (2024-03-11)
• Updated input 'nixpkgs-wayland/lib-aggregate/flake-utils':
    'github:numtide/flake-utils/d465f4819400de7c8d874d50b982301f28a84605' (2024-02-28)
  → 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/f8d5c8baa83fe620a28c0db633be9db3e34474b4' (2024-03-10)
  → 'github:Mic92/sops-nix/e52d8117b330f690382f1d16d81ae43daeb4b880' (2024-03-11)
```
2024-03-12 12:46:24 +00:00
7513811111 blast: minor cleanups 2024-03-12 12:06:57 +00:00
eabd113262 mpv: blast: shut it down properly even when sandboxed
it only cost everything. also, blast doesnt reliably clean up its pseudo devices
2024-03-12 11:51:15 +00:00
01fa9919fd mpv: route casting through a lua script
this lets me use `subcprocess` instead of `run`, and so the command terminate alongside mpv
2024-03-12 05:01:45 +00:00
56a2c4e49f mpv: split conf files out of main nix code 2024-03-12 03:32:07 +00:00
bf953fbdb5 mpv: move to own dir 2024-03-12 03:27:20 +00:00
4f2d0f2e56 mpv: tune uosc options 2024-03-12 03:05:56 +00:00
500c989e61 nixpkgs: 2024-03-10 -> 2024-03-11
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/85e4390bb2db2543b65a61a6fb601819ba331399' (2024-03-10)
  → 'github:nixos/nixpkgs/ec7a981885b5ede88eabf9bb3516706107de00b2' (2024-03-11)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/c916d4cbac62b2d8b70a3940d3471dbd0c57d2f4' (2024-03-10)
  → 'github:nixos/nixpkgs/0fbcc4b2e8571f4af39be41752581ea09dd9ab06' (2024-03-11)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/8af78a7dfb3a2041235c116cc9cc92f5a6d3a20c' (2024-03-11)
  → 'github:nix-community/nixpkgs-wayland/27a56d7435094f141bf5adfe9cfe155932597935' (2024-03-11)
```
2024-03-11 12:23:03 +00:00
08ee0375cc mpv: blast-to-default: remove unnecessary xdg-terminal-exec indirection 2024-03-11 12:07:08 +00:00
afd1a42ec7 mpv: refer to xdg-terminal-exec by name, not full path 2024-03-11 11:56:53 +00:00
21691fc2fd mpv: add a menu option to cast just the audio, via Blast 2024-03-11 11:43:53 +00:00
c1edf96ce0 blast-ugjka: introduce a helper blast-to-default program 2024-03-11 11:43:29 +00:00
21714849cf sway: get Celeste to run in fullscreen again 2024-03-11 08:04:21 +00:00
379f3ef9e0 zsh: deref alias: make the result writable 2024-03-11 08:01:27 +00:00
c07c23a9f8 ibus: remove cross patches (i don't use the package anymore) 2024-03-11 07:55:53 +00:00
f44a4c84ee moby: don't ship fcitx5 (doesn't cross compile) 2024-03-11 07:54:49 +00:00
6822dad9c0 splatmoji: remove from config 2024-03-11 07:53:48 +00:00
9f8e42ef92 fcitx5: enable 2024-03-11 07:44:21 +00:00
bda374db13 sway: ship the nightly version 2024-03-11 05:53:14 +00:00
180a217744 cleanup: remove unnecessary config = { ... } scope 2024-03-11 04:31:11 +00:00
f13ece2212 sway: tune resize more shortcuts; enable natural scrolling 2024-03-11 04:30:28 +00:00
00ab28fcac delfin: 0.4.0 -> 0.4.1 2024-03-11 00:13:13 +00:00
bb18f7355a firefox-extensions: update to latest 2024-03-11 00:00:49 +00:00
0905a658ad rofi: cherry-pick my patches instead of pinning to a fork
wayland upstream released 1.7.5+wayland3, which is compatible with my patches
2024-03-10 23:43:34 +00:00
90b9d00f37 swaync: remove mpris icon patch (upstreamed) 2024-03-10 23:16:33 +00:00
40effc08d6 fractal-nixified: 6 -> 6-unstable-2024-01-31
brings ability to enable/disable read and typing receipts
2024-03-10 23:15:02 +00:00
73a2c9d923 nixpkgs: update ~10hrs to remove now-upstreamed conky patch
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/32f638e62d638c9a0011c0162ed1be4a13d00ea9' (2024-03-10)
  → 'github:nixos/nixpkgs/85e4390bb2db2543b65a61a6fb601819ba331399' (2024-03-10)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/9fc2bd0eef6d2651638656c82fbe0b7a40478c3b' (2024-03-10)
  → 'github:nixos/nixpkgs/c916d4cbac62b2d8b70a3940d3471dbd0c57d2f4' (2024-03-10)
```
2024-03-10 22:31:33 +00:00
d93380938d nixpkgs: 2024-03-09 -> 2024-03-10; sops-nix -> 2024-03-10
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/8baf388f460b92102ea1a8e2ece55f1f1260fbfa' (2024-03-09)
  → 'github:nixos/nixpkgs/32f638e62d638c9a0011c0162ed1be4a13d00ea9' (2024-03-10)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/52d9c7906c26317adc3524d44bdd98b953e20ba1' (2024-03-09)
  → 'github:nixos/nixpkgs/9fc2bd0eef6d2651638656c82fbe0b7a40478c3b' (2024-03-10)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/25dd60fdd08fcacee2567a26ba6b91fe098941dc' (2024-03-06)
  → 'github:Mic92/sops-nix/f8d5c8baa83fe620a28c0db633be9db3e34474b4' (2024-03-10)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/66d65cb00b82ffa04ee03347595aa20e41fe3555' (2024-03-03)
  → 'github:NixOS/nixpkgs/b17375d3bb7c79ffc52f3538028b2ec06eb79ef8' (2024-03-10)
```
2024-03-10 13:36:58 +00:00
573a50fedc doc: pipewire: mention some debug env vars 2024-03-10 04:59:51 +00:00
f8797a77ff blast: ship it!
TODO: integrate into mpv :)
2024-03-10 04:09:34 +00:00
92115709f6 blast-ugjka: init at 0.6.2
it works! at least, with the Sony TV, LG TV is detected but might need some finessing
2024-03-10 02:35:10 +00:00
e6111c9d5e firefox: hide the bookmarks menuabar 2024-03-10 01:59:46 +00:00
975df698a4 pa-dlna: init at 0.7
it detects my TVs and adds them as sinks, but i can't the TVs to actually output anything
2024-03-10 01:55:29 +00:00
ce8c4a4f6f remove dead binfmt code 2024-03-10 01:05:33 +00:00
df33576090 todo.md: remove completed xdg-desktop-portal item 2024-03-10 01:03:23 +00:00
4d6eb705eb mpv: link to some useful extensions 2024-03-10 01:02:54 +00:00
fd70b6acbf rofi: tune maximum height 2024-03-09 23:34:43 +00:00
1d3576b892 sxmo-utils: mark as broken/unmaintained 2024-03-09 21:09:32 +00:00
30d49dc3c3 feeds: update Anish's URL 2024-03-09 20:51:15 +00:00
8e0031e770 feeds: update Byrne Hobart's feed URL 2024-03-09 20:49:01 +00:00
7a50fcf566 feeds: unsubscribe webcurious.co.uk (defunct) 2024-03-09 20:46:08 +00:00
c453dbac8e lwn.net: update feed URL 2024-03-09 20:42:03 +00:00
053b8cf737 nixpkgs: 2024-03-08 -> 2024-03-09
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/f391672e1727b933cf6933154817fe236c6f84c7' (2024-03-08)
  → 'github:nixos/nixpkgs/8baf388f460b92102ea1a8e2ece55f1f1260fbfa' (2024-03-09)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/baf89057836e5f9928696526b85774ea529c749d' (2024-03-08)
  → 'github:nixos/nixpkgs/52d9c7906c26317adc3524d44bdd98b953e20ba1' (2024-03-09)
```
2024-03-09 08:54:18 +00:00
8af962c3a6 mpv: auto-populate internal playlist with other files in the same directory, on launch
so now i can listen to whole albums by opening any file from within them.
and for shows the next episode will automatically launch.
2024-03-09 03:02:09 +00:00
9ea39799a5 zsh: fix c alias 2024-03-09 03:01:37 +00:00
e695459b40 geary-gtk4: init (broken!) 2024-03-09 00:58:44 +00:00
f2e760710d sysvol: tune its position 2024-03-08 23:06:37 +00:00
dc70ed8bd8 pipewire: wait for sockets to appear before considering it active
this fixes race around consumers like sysvol starting too early
2024-03-08 22:44:59 +00:00
b41c249830 disable vlc
i don't use it; it forces a bunch of extra qt builds
2024-03-08 18:53:25 +00:00
8f986e4616 nixpkgs: 2024-03-07 -> 2024-03-08
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/5e0cda94371075bead6d953e8a60a717ec022524' (2024-03-07)
  → 'github:nixos/nixpkgs/f391672e1727b933cf6933154817fe236c6f84c7' (2024-03-08)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/90714b18a06ddad90159cc312814f1871509e10e' (2024-03-07)
  → 'github:nixos/nixpkgs/baf89057836e5f9928696526b85774ea529c749d' (2024-03-08)
```
2024-03-08 13:15:25 +00:00
2b73ebb4c1 sysvol: don't start until after pipewire is ready 2024-03-08 12:55:33 +00:00
bffcaa668e sysvol: wrap with required gtk4 environment variables 2024-03-08 12:54:41 +00:00
ebb037bd48 sysvol: fix cross compilation 2024-03-08 12:25:32 +00:00
df98ef30e0 sysvol: integrate as a service (sane.programs) 2024-03-08 11:53:13 +00:00
e45d4d6ae7 sysvol: init at 0-unstable-2024-02-08 2024-03-08 10:10:50 +00:00
f3568b3ffc sway: port volume controls: pulse -> pipewire 2024-03-08 09:56:15 +00:00
9eaf4d71b2 sway: use simpler assign notation where applicable 2024-03-08 09:53:07 +00:00
3200188a32 sway: factor/generalize the TV workspace/output assignment 2024-03-08 09:50:35 +00:00
a4ab60b836 sway: auto-fullscreen everything on the TV 2024-03-08 09:42:07 +00:00
3282b40e9b doc: sway: consider how to auto-fullscreen mpv on external display 2024-03-08 09:31:08 +00:00
39411164af zsh: add deref function to turn a symlink into a real file 2024-03-08 08:50:28 +00:00
c0a94995a5 docs: note limitations of schlock 2024-03-08 08:16:11 +00:00
f4b5d3a70a sway: position certain apps (mpv, Celeste) on external displays by default 2024-03-08 06:27:16 +00:00
07373b5e6b sway: configure TV output 2024-03-08 06:23:33 +00:00
7281b94e23 deadd-notification-center: add to sane.programs
this is the bare, nearly-default config. i may come back to this,
or explore fixing swaync up into shape. deadd looks possibly a bit more
limited; needs much more effort to style.
2024-03-08 04:06:18 +00:00
0e83742096 sway: allow config reloading 2024-03-08 03:44:33 +00:00
7d8205352c moby: use screen scale of 2.0 in portrait AND landscape 2024-03-08 02:21:47 +00:00
c4994162e1 mpv: fix go2tv sandbox interaction 2024-03-08 02:06:23 +00:00
24a211bd3d sane-input-handler: remove keyboard launch fallback
it'll never work, because of sandboxing
2024-03-08 01:18:39 +00:00
3cf651b212 nixpkgs: 2024-03-06 -> 2024-03-07
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/09c267dae0dae6585ddbc98bd2301bd8153ac177' (2024-03-06)
  → 'github:nixos/nixpkgs/5e0cda94371075bead6d953e8a60a717ec022524' (2024-03-07)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/a85303aef29c6a9000a259ed21c9c14a1aa3859e' (2024-03-06)
  → 'github:nixos/nixpkgs/90714b18a06ddad90159cc312814f1871509e10e' (2024-03-07)
```
2024-03-08 01:12:05 +00:00
cb1c76a0db wvkbd-mk: init 2024-03-08 01:06:13 +00:00
27c12edec0 wvkbd: change default key border 2 -> 1 px
since moby is scaled 2x, it's actually 2 px *in practice*
2024-03-08 00:45:45 +00:00
b41320ffb3 megapixels: fix sandbox-related crash 2024-03-08 00:16:29 +00:00
ac41cfcd42 wvkbd: tune height (by guess) 2024-03-08 00:01:23 +00:00
62cbc65f12 epiphany: fix sandboxing 2024-03-07 23:24:33 +00:00
ccb856faf5 sane-input-handler: power -> vol to rotate display 2024-03-07 23:22:07 +00:00
d7f4438371 nixpatches: update procmail cross hash 2024-03-07 23:21:38 +00:00
f44c3f2e1f moby: auto-screenoff: bump timeout from 150s -> 300s 2024-03-07 23:14:03 +00:00
bb300a4eb5 swayidle: dont enable screenoff action by default 2024-03-07 11:18:34 +00:00
fd4842ab5b swayidle: auto screenoff 2024-03-07 10:59:44 +00:00
1cdc3b8bda moby: enable schlock screen locker 2024-03-07 10:37:18 +00:00
531ea11b3d schlock: fix cross build 2024-03-07 10:36:51 +00:00
041ce0654e schlock: sandbox + auto-launch via .desktop file 2024-03-07 10:32:40 +00:00
526a02bb73 schlock: ship a .desktop file 2024-03-07 10:25:41 +00:00
1d0458ab10 schlock: ship as sane.programs 2024-03-07 10:10:39 +00:00
4358f9471e schlock: init
it works! super jank; doesn't accept keyboard input, fails-open on
crash.
2024-03-07 09:36:53 +00:00
cb3a1fb3fe swaylock-mobile: init (i won't likely use it though) 2024-03-07 01:42:43 +00:00
72d52f9239 sxmo_swaylock: init at unstable-2023-04-26 (but i won't likely use it) 2024-03-07 01:34:53 +00:00
219fe67f34 systemd: reduce shutdown timeout from "20" to "10" sec (40s IRL) 2024-03-07 01:01:06 +00:00
b36d224b85 swaylock-plugin: init (but i likely won't be using it) 2024-03-07 01:00:44 +00:00
90e3c33536 feeds: subscribe to slatecave.net 2024-03-06 22:40:57 +00:00
a9419b7351 swayidle: sandbox 2024-03-06 21:33:11 +00:00
f0d0343b32 sway: lappy: fix output name 2024-03-06 21:18:43 +00:00
bd27f3a015 swayidle: enable; pair with swaylock 2024-03-06 20:55:01 +00:00
6a3e632335 sway: remove config for old external displays i no longer use 2024-03-06 19:03:13 +00:00
a4c4b0575c sway: map touch inputs to their correct display 2024-03-06 19:02:23 +00:00
4730a65008 nixpkgs: 2024-03-05 -> 2024-03-06
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/16bca48d251761297746d5bb7b9e47a3c6564c5a' (2024-03-05)
  → 'github:nixos/nixpkgs/09c267dae0dae6585ddbc98bd2301bd8153ac177' (2024-03-06)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/b3ed737064bc4cc0312081b6937fa2bb48d62afa' (2024-03-05)
  → 'github:nixos/nixpkgs/a85303aef29c6a9000a259ed21c9c14a1aa3859e' (2024-03-06)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/291aad29b59ceda517a06e59809f35cb0bb17c6b' (2024-03-04)
  → 'github:Mic92/sops-nix/25dd60fdd08fcacee2567a26ba6b91fe098941dc' (2024-03-06)
```
2024-03-06 09:54:23 +00:00
63d95edcbe zsh: fix c alias 2024-03-06 09:47:33 +00:00
687e72897b xdg-desktop-portal: don't always prompt the user for how to open every file 2024-03-06 06:25:36 +00:00
0e84744115 todo.md: xdg-desktop-portal improvements 2024-03-06 06:25:14 +00:00
1ee38d3aec todo.md: remove completed items 2024-03-06 05:28:18 +00:00
5f4e421ab9 sane-wipe: fix sandboxing 2024-03-06 05:11:24 +00:00
471339d237 hosts (all): remove sxmo-related polyfills 2024-03-06 05:07:30 +00:00
085232f18c wvkbd: configure layers 2024-03-06 05:07:30 +00:00
18c7fc17fd alacritty: configure font size per-host 2024-03-06 05:07:30 +00:00
a7567dfbe6 ship celeste64 2024-03-06 04:56:39 +00:00
bc0660b623 PDF viewer: evince -> zathura 2024-03-06 04:51:01 +00:00
cf86b4a67c xterm: move to pcGuiApps 2024-03-06 04:38:05 +00:00
d39bed46b5 rofi: allow access to Books 2024-03-06 01:39:48 +00:00
525450e21a fix backlight persistence 2024-03-06 00:58:11 +00:00
a4ee820921 /var/lib/colord: don't persist
files haven't changed in over a year; i assume it's legacy
2024-03-05 23:53:41 +00:00
4b5d6b16e1 alacritty: ignore media keys 2024-03-05 23:25:31 +00:00
41a141dba6 servo: disable navidrome 2024-03-05 18:48:25 +00:00
d5811f142d notifyActive activation script -> apply only to GUI systems
else i get warnings on every servo activation
2024-03-05 18:46:43 +00:00
4d6d79cc81 servo: /var/lib/uninsane/media -> /var/media 2024-03-05 18:44:30 +00:00
53d76920e4 servo: persist more specifically the /var/lib/uninsane/media directory 2024-03-05 18:39:23 +00:00
db892273ac nixpatches: fix imagemagick cross fix hash 2024-03-05 18:37:09 +00:00
65e206afde nixpkgs: 2024-03-04 -> 2024-03-05
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/1a3380fec6e3c2d539e58c4be6a4a094d7d14aea' (2024-03-04)
  → 'github:nixos/nixpkgs/16bca48d251761297746d5bb7b9e47a3c6564c5a' (2024-03-05)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/4c0862ebf8e474315767c5210c3d0a336625f318' (2024-03-04)
  → 'github:nixos/nixpkgs/b3ed737064bc4cc0312081b6937fa2bb48d62afa' (2024-03-05)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/075df9d85ee70cfb53e598058045e1738f05e273' (2024-03-03)
  → 'github:Mic92/sops-nix/291aad29b59ceda517a06e59809f35cb0bb17c6b' (2024-03-04)
```
2024-03-05 10:09:39 +00:00
6765fe8d7d wob: rename sxmo.wobsock -> wob.sock 2024-03-05 10:00:45 +00:00
955119e07b wob-audio: fix, by finishing the port to pipewire
also rewrote it in Python because bash can't do floating point math
2024-03-05 09:32:37 +00:00
daddf9314a gpodder: fix .desktop file(s) 2024-03-05 02:58:21 +00:00
e59123fd62 cozy: fix patch hash 2024-03-05 02:58:14 +00:00
d43cc6c61c alsa-ucm-conf: fold the Pinephone patches into sane.programs.alsa-ucm-conf & distribute to all hosts 2024-03-05 00:28:07 +00:00
a8bc77d40c nixpkgs sourceInfo patching: move to nixpatches/
previously i was using the sourceInfo of the flake, which is kinda wrong: and it would force a _new_ nixpkgs for every time i commit to my own repo -- not just when i bump it
2024-03-05 00:06:08 +00:00
dfc768e2e6 flake: place builds strictly in build/ directory 2024-03-04 23:47:31 +00:00
3544b4b132 nixpkgs: 2024-03-03 -> 2024-03-04
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/6a2985393fcc1dfabc6d36af148ca761a807e002' (2024-03-03)
  → 'github:nixos/nixpkgs/1a3380fec6e3c2d539e58c4be6a4a094d7d14aea' (2024-03-04)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/286977c08ddf540b4c6bebd8cd96fe30070bcb46' (2024-03-03)
  → 'github:nixos/nixpkgs/4c0862ebf8e474315767c5210c3d0a336625f318' (2024-03-04)
```
2024-03-04 09:41:23 +00:00
c86afca795 cozy: patch via sane.programs, not overlay 2024-03-04 09:26:25 +00:00
5f3ef37050 cozy: 1.2.1 -> 1.3.0 2024-03-04 08:57:52 +00:00
3b8252fe43 delfin: doc improvements 2024-03-04 08:28:50 +00:00
1e6e4d2644 cozy: doc improvements 2024-03-04 08:28:35 +00:00
60c447b6c4 signal-desktop: 6.44.0 -> 7.0.0 2024-03-04 08:26:59 +00:00
4fc2ffef56 koreader-from-src: 2024.01 -> 2024.03 2024-03-04 08:19:41 +00:00
9416ef1ff6 firefox-extensions: update 2024-03-04 08:18:48 +00:00
b1dff9bfa8 steam: fix controllers to work in the sandbox 2024-03-03 20:03:20 +00:00
0003acc091 nixpkgs: 2024-03-02 -> 2024-03-03
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/aefac840b87e8e0ab658fa5080539e292ad8a9ba' (2024-03-02)
  → 'github:nixos/nixpkgs/6a2985393fcc1dfabc6d36af148ca761a807e002' (2024-03-03)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/df41961bd4b7e838cb997543ea1297f4cbd7da15' (2024-03-02)
  → 'github:nixos/nixpkgs/286977c08ddf540b4c6bebd8cd96fe30070bcb46' (2024-03-03)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/a1c8de14f60924fafe13aea66b46157f0150f4cf' (2024-02-26)
  → 'github:Mic92/sops-nix/075df9d85ee70cfb53e598058045e1738f05e273' (2024-03-03)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/89a2a12e6c8c6a56c72eb3589982c8e2f89c70ea' (2024-02-25)
  → 'github:NixOS/nixpkgs/66d65cb00b82ffa04ee03347595aa20e41fe3555' (2024-03-03)
```
2024-03-03 10:11:16 +00:00
0630037f86 steam: sandbox
controllers are untested, probably need to be added; graphics and sound work fine
2024-03-03 10:10:14 +00:00
9513680538 sway: enable net access in the sandbox (for Xwayland) 2024-03-03 10:09:29 +00:00
0affeb098a rofi: optimize sizing 2024-03-03 07:36:33 +00:00
979d07d693 wob: port pulseaudio -> pipewire 2024-03-03 07:22:03 +00:00
fd072883dc sane-input-handler: port pulseaudio -> pipewire native 2024-03-03 07:13:23 +00:00
ed87792f9b sed: sandbox 2024-03-03 07:06:00 +00:00
8821b3ca7d procps: sandbox 2024-03-03 06:55:17 +00:00
5e5a1fbaae rofi: allow to use more space on moby when keyboard is active 2024-03-03 04:46:12 +00:00
d2f470dc74 wvkbd: sandbox 2024-03-03 04:44:23 +00:00
7933ef41a2 unl0kr: simplify this code 2024-03-03 04:43:44 +00:00
6b45589e54 wireplumber: ensure ALSA_UCM_CONF2 env var is on PATH
this is critical for pipewire/wireplumber to work on moby
2024-03-03 04:43:11 +00:00
b04357c9de nix.conf: dont ship NIX_PATH for light deploys
it's like 150 MiB
2024-03-03 03:53:13 +00:00
4b04cbc078 mpv: couple app volume to system volume 2024-03-03 03:22:28 +00:00
1498e364b2 doc: mimeo: mention jaro as alternative 2024-03-03 03:16:10 +00:00
0aaa3eaaeb mpv: remove legacy vo=wlshim hack 2024-03-02 23:46:52 +00:00
3ac6b92c18 /etc/nix/registry.json: don't generate for -light builds (it links back to src) 2024-03-02 23:42:58 +00:00
c747855810 bonsai: sandbox 2024-03-02 22:34:38 +00:00
711865018d /etc/nixos: don't link on '*-light' builds 2024-03-02 22:13:04 +00:00
f33fcc2018 nixpatches: update hashes 2024-03-02 21:23:44 +00:00
96ec0106ee sane-input-handler: leverage sane-open-desktop instead of making direct gdbus calls 2024-03-02 21:20:47 +00:00
0c4d7761d3 sane-input-handler: sandbox 2024-03-02 21:20:47 +00:00
fe10640821 wob-pulse: sandbox 2024-03-02 20:57:44 +00:00
1f208083be mpvScripts.uosc: 5.1.1 -> 5.2.0 2024-03-02 20:39:04 +00:00
6ec3126321 moby: fix display driver reload check to run before unl0kr
this should fix the no-graphics-on-boot bug i'm seeing. it was previously fixed for lightdm and greetd: just not unl0kr
2024-03-02 19:50:50 +00:00
8029744c90 modules/programs: don't expose *all* of /run/secrets/home to every program
this was actually causing a lot of bwrap errors because that directory's not user-readable

turns out any program which already uses programs.xyz.secrets gets the /run/secrets mounts for free via symlink following
2024-03-02 18:51:39 +00:00
1fcf0bfcb1 swaync: fix signal-desktop check to be --user 2024-03-02 18:33:35 +00:00
a3ae650273 dialect: fix so it works inside a sandbox 2024-03-02 18:25:13 +00:00
7e0bef549f nixpkgs: 2024-03-01 -> 2024-03-02
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/ee743c92310804de4b4505ff0ac40b4f3f4f49de' (2024-03-01)
  → 'github:nixos/nixpkgs/aefac840b87e8e0ab658fa5080539e292ad8a9ba' (2024-03-02)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/f7fca9d98b0ec282f4b0d63f1fc2e38caf4ea55a' (2024-03-01)
  → 'github:nixos/nixpkgs/df41961bd4b7e838cb997543ea1297f4cbd7da15' (2024-03-02)
```
2024-03-02 07:52:21 +00:00
3b603519ff fuzzel: sandbox (well, i probably dont even have it on my system anymore :P) 2024-03-02 07:43:42 +00:00
f69ca166f4 sway: sandbox 2024-03-02 07:41:51 +00:00
a45e42910d make-sandboxed: generalize runCommand patch to handle any derivation, called with or without callPackage 2024-03-02 07:11:45 +00:00
3dd1d18dcd less: sandbox 2024-03-02 07:11:45 +00:00
28cb705bd4 grim: sandbox 2024-03-02 07:11:45 +00:00
7fa1dbc5d5 slurp: sandbox 2024-03-02 07:11:45 +00:00
8b7575c205 swappy: sandbox 2024-03-02 07:11:45 +00:00
52e9902fa1 sane-screenshot: give it permissions to my screenshots dir (derp) 2024-03-02 06:14:05 +00:00
ab765a81af sway: integrate sane-screenshot as the PrintScreen shortcut 2024-03-02 06:14:05 +00:00
a7bd831ad8 sane-screenshot: port to sane.programs 2024-03-02 06:14:05 +00:00
063d99dd73 todo.md: task to remove /run/wrappers 2024-03-02 05:42:26 +00:00
0d48c462cb sane-screenshot: init 2024-03-02 02:04:48 +00:00
f4ec09f010 rofi: remember the last selected directory 2024-03-02 00:35:29 +00:00
a7ef9fc0b8 todo.md: task for better app integrations 2024-03-02 00:21:56 +00:00
a40cefc8a5 pipewire: speculatively add /dev/video* 2024-03-02 00:14:47 +00:00
f55bb3518f wireplumber: add missing /dev/video2 which is on moby 2024-03-02 00:14:21 +00:00
3d16aa62ea sway: let the pinephone default to it's normal scaling
it's actually pretty nice at 2.0 scaling with my current apps. i'll need to tweak swaync, conky, wvkbd, etc. later.
2024-03-01 23:53:31 +00:00
2548cfeadc xdg-desktop-portal-wlr: fix crashing due to over-restrictive sandbox 2024-03-01 21:17:31 +00:00
90acbf716d Videos/gPodder: allow access from mpv and rofi 2024-03-01 21:02:04 +00:00
4d98593b3f todo.md: sync 2024-03-01 20:48:56 +00:00
db89ac88f0 sane-sandboxed: add new --sane-sandbox-keep-namespace all option 2024-03-01 20:48:56 +00:00
bba149c670 zsh: new c helper to change into a dir and list it 2024-03-01 20:09:20 +00:00
c056984003 zsh: alias exiy -> exit 2024-03-01 19:56:09 +00:00
2324d75165 switch psmisc -> killall
otherwise a really shitty `pstree` makes its way onto my PATH
2024-03-01 18:50:20 +00:00
9296b7731b rofi: add a .desktop file to rofi-snippets 2024-03-01 18:07:52 +00:00
75e9ce509e static-nix-shell: add support for extra nativeBuildInputs 2024-03-01 18:07:07 +00:00
95c95d6f53 splatmoji: actually install the .desktop files 2024-03-01 18:03:45 +00:00
fca23e661a xdg-desktop-portal: disable debug logging 2024-03-01 17:50:49 +00:00
9a7ebbd9d3 rofi: configure window height/location 2024-03-01 17:18:40 +00:00
56b00d998e rofi: theme
i still need to figure out how to make it wider for moby
2024-03-01 16:40:09 +00:00
01ef182073 waybar: theme the indicator style
i don't know if it's perfect, but it is better
2024-03-01 15:32:52 +00:00
b6daeddfa2 waybar: show different modules for moby v.s. others 2024-03-01 15:25:42 +00:00
c6e956f3d2 waybar: fix button.urgent color to match sway's client.urgent 2024-03-01 15:03:14 +00:00
f9510e5d24 nixpkgs: 2024-02-29 -> 2024-03-01
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/e894afb6c101fea0771b47d7827bef022e89ee1e' (2024-02-29)
  → 'github:nixos/nixpkgs/ee743c92310804de4b4505ff0ac40b4f3f4f49de' (2024-03-01)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/d29fabd630000579f744d04639d625828ba412bf' (2024-02-29)
  → 'github:nixos/nixpkgs/f7fca9d98b0ec282f4b0d63f1fc2e38caf4ea55a' (2024-03-01)
```
2024-03-01 07:31:58 +00:00
2e737c2ab1 moby: sxmo -> sway
still several things need to be improved, but the groundwork is there
2024-03-01 07:26:26 +00:00
82368eb45a sway: desko: fix monitor layout
i guess my monitor's name changed... 👀
2024-03-01 07:19:00 +00:00
65fb9e1d57 rofi: allow access to more servo media paths 2024-03-01 07:14:41 +00:00
b02ae7ef74 moby: polyfill an OK sway layout 2024-03-01 05:20:28 +00:00
37ddb2ae17 waybar: fix font size to be more usable on moby 2024-03-01 04:46:06 +00:00
81e02e2885 sway: moby: fix layout/scale preferences 2024-03-01 04:38:26 +00:00
4a3f59468c sway: launch gui apps via sane-open-desktop instead of inline
this will allow for sandboxing, in the future
2024-03-01 04:19:19 +00:00
daab5939e7 rofi: split sane-open-desktop out as a helper 2024-03-01 04:19:19 +00:00
e7430c41f9 refactor: sway-config: for readability 2024-03-01 03:29:52 +00:00
5849e75577 sway-config: remove dead window specializations 2024-03-01 03:21:47 +00:00
296123651c sway: fold sway-config.nix into default.nix 2024-03-01 03:18:37 +00:00
7f0d5e7810 sane-input-handler: explain why i setsid 2024-03-01 03:11:06 +00:00
7af928a6d2 sway: direct inputs to bonsai WITHOUT swallowing them 2024-03-01 03:10:44 +00:00
b73569d675 wvkbd: fix service typo 2024-02-29 22:04:42 +00:00
50ee15ef2b send sway-related cross patches upstream 2024-02-29 21:35:02 +00:00
9764d5f095 sway/waybar: decrease cross-specific patches
cava cross compiles now (yay); sndio is actually required by waybar if cava is enabled, so remove the disable
2024-02-29 18:56:54 +00:00
43386f3ba5 nixpkgs: update; couple cross-compiling patches have merged upstream
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/0852bff4370133e3a62b0cc7d14d193b928a7c59' (2024-02-29)
  → 'github:nixos/nixpkgs/e894afb6c101fea0771b47d7827bef022e89ee1e' (2024-02-29)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/9f21aa90cb8c078969543956d88c19696b646743' (2024-02-29)
  → 'github:nixos/nixpkgs/d29fabd630000579f744d04639d625828ba412bf' (2024-02-29)
```
2024-02-29 18:22:35 +00:00
a3a6278a59 notifyActive: don't depend on sway
it was a little silly to be shipping sway on headless systems
2024-02-29 17:32:19 +00:00
083f743c1f remove nixpkgs less defaults and manage PAGER myself
this lets me avoid the lesspipe cross failures, notably
2024-02-29 15:18:51 +00:00
626ad97005 nixpkgs: 2024-02-27 -> 2024-02-29
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/6daf4de0662e1d895d220a4a4ddb356eb000abe9' (2024-02-27)
  → 'github:nixos/nixpkgs/0852bff4370133e3a62b0cc7d14d193b928a7c59' (2024-02-29)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/5bd8df40204f47a12263f3614c72cd5b6832a9a0' (2024-02-27)
  → 'github:nixos/nixpkgs/9f21aa90cb8c078969543956d88c19696b646743' (2024-02-29)
```
2024-02-29 06:42:18 +00:00
6253d1799a port sxmo_hook_inputhandler.sh -> sane-input-handler
this one can run outside the SXMO environment.
major thing missing at the moment is that rofi doesn't get volume
control inputs because bonsai out-competes it for exclusive control.
2024-02-29 01:26:38 +00:00
d8a8038cae xdg-terminal-exec: define a .desktop file 2024-02-29 00:17:26 +00:00
7fd56b63cb rofi: better patch for the DT_UNKNOWN edgecase 2024-02-28 21:41:59 +00:00
7a65bd36c7 rofi: patch the filebrowser to reliably list entries on remote filesystems
see: <https://github.com/davatorium/rofi/issues/1954>
2024-02-28 21:18:19 +00:00
bd4eeeeb3b nixpatches: imagemagick closure fix: mark as merged upstream 2024-02-28 18:27:15 +00:00
7c22b59b9d sane-which: handle relative symlinks 2024-02-28 18:16:08 +00:00
9e504676bd sane-which: only print the first 30 lines for text files 2024-02-28 18:09:38 +00:00
b515127101 sane-which: follow nix wrappers 2024-02-28 18:09:24 +00:00
40e30cf2f8 programs: make sandbox.wrapperType default to "wrappedDerivation" and remove everywhere i manually set that 2024-02-28 17:39:00 +00:00
812c0c8029 packages: reduce the number of packages which are using inplace sandbox wrapping 2024-02-28 17:35:40 +00:00
7ca5ae84b7 flake: deploy: abort on error 2024-02-28 17:34:45 +00:00
a4248fd5cc make-sandboxed: don't try to wrap directories
whoops. test -x is true for directories
2024-02-28 16:28:25 +00:00
70229e0839 rofi: persist the filebrowsercache 2024-02-28 15:41:52 +00:00
cd303a76bc rofi: disable "run" from combi
they wouldn't work, since i only 'xdg-open' the entries
2024-02-28 15:32:12 +00:00
e43aa3bb8b splatmoji: fix sandboxing so rofi can read its config/cache 2024-02-28 15:19:53 +00:00
6c2d80715c rofi-snippets: fix sandboxing so rofi can read its config/cache 2024-02-28 15:15:02 +00:00
db8456f152 flake: provide a "benchmark" target 2024-02-28 15:10:45 +00:00
d912190db5 sway: split snippets into own program (rofi-snippets) 2024-02-28 14:44:05 +00:00
c380f61bea fix "rescue" host to eval again 2024-02-28 14:19:45 +00:00
ff8cfc9372 flake: fix check.nur target 2024-02-28 13:47:51 +00:00
b302113fc0 modules/programs: require manual definition; don't auto-populate attrset
this greatly decreases nix eval time
2024-02-28 13:35:09 +00:00
9749ff0442 sane.gui.phosh: remove 2024-02-28 13:35:05 +00:00
0d97191f74 sane-wipe-browser: dont call pkill with sudo 2024-02-28 13:35:00 +00:00
316 changed files with 11435 additions and 6773 deletions

View File

@@ -15,13 +15,14 @@ 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) - ~~[`sxmo-utils`](./pkgs/additional/sxmo-utils/default.nix)~~
- [example SXMO deployment](./hosts/modules/gui/sxmo/default.nix) - ~~[example SXMO deployment](./hosts/modules/gui/sxmo/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)
- [modules/programs/](./modules/programs/default.nix) - [modules/programs/](./modules/programs/default.nix)
- [modules/users.nix](./modules/users.nix) - [modules/users/](./modules/users/default.nix)
[nixpkgs]: https://github.com/NixOS/nixpkgs [nixpkgs]: https://github.com/NixOS/nixpkgs
[sops]: https://github.com/Mic92/sops-nix [sops]: https://github.com/Mic92/sops-nix
@@ -108,9 +109,10 @@ i.e. you might find value in using these in your own config:
- `sane.programs.firefox.sandbox.whitelistWayland = true; # allow it to render a wayland window` - `sane.programs.firefox.sandbox.whitelistWayland = true; # allow it to render a wayland window`
- `sane.programs.firefox.sandbox.extraHomePaths = [ "Downloads" ]; # allow it read/write access to ~/Downloads` - `sane.programs.firefox.sandbox.extraHomePaths = [ "Downloads" ]; # allow it read/write access to ~/Downloads`
- integrated with `fs` and `persist` modules so that programs' config files and persisted data stores are linked into the sandbox w/o any extra involvement. - integrated with `fs` and `persist` modules so that programs' config files and persisted data stores are linked into the sandbox w/o any extra involvement.
- `modules/users.nix` - `modules/users/`
- convenience layer atop the above modules so that you can just write - convenience layer atop the above modules so that you can just write
`fs.".config/git"` instead of `fs."/home/colin/.config/git"` `fs.".config/git"` instead of `fs."/home/colin/.config/git"`
- per-user services managed by [s6-rc](https://www.skarnet.org/software/s6-rc/)
some things in here could easily find broader use. if you would find benefit in some things in here could easily find broader use. if you would find benefit in
them being factored out of my config, message me and we could work to make that happen. them being factored out of my config, message me and we could work to make that happen.

36
TODO.md
View File

@@ -1,9 +1,25 @@
## BUGS ## BUGS
- moby: my mobile ISP is adding spoofed AAAA records that break things like wireguard
- it only does this when i use their DNS resolvers though: if i run my own recursive resolver, they won't mess with it.
- moby: mpv uosc always starts at 40% volume
- is this just mpv remembering its last-played volume?
- moby: rofi crashes sporadically
- mpv: no way to exit fullscreen video on moby
- uosc hides controls on FS, and touch doesn't support unhiding
- i accidentally create sub-splits in sway all the time
- especially on moby => unusable
- like toplevel is split L/R, and then the L is a tabbed view and the R is a tabbed view
- Signal restart loop drains battery
- decrease s6 restart time?
- `ssh` access doesn't grant same linux capabilities as login
- ringer (i.e. dino incoming call) doesn't prevent moby from sleeping - ringer (i.e. dino incoming call) doesn't prevent moby from sleeping
- sway mouse/kb hotplug doesn't work
- `nix` operations from lappy hang when `desko` is unreachable - `nix` operations from lappy hang when `desko` is unreachable
- could at least direct the cache to `http://desko-hn:5001` - could at least direct the cache to `http://desko-hn:5001`
- sysvol (volume overlay): when casting with `blast`, sysvol doesn't react to volume changes
## REFACTORING: ## REFACTORING:
- REMOVE DEPRECATED `crypt` from sftpgo_auth_hook
- 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
@@ -11,16 +27,15 @@
### sops/secrets ### sops/secrets
- rework secrets to leverage `sane.fs` - rework secrets to leverage `sane.fs`
- remove sops activation script as it's covered by my systemd sane.fs impl - remove sops activation script as it's covered by my systemd sane.fs impl
- user secrets could just use `gocryptfs`, like with ~/private?
- can gocryptfs support nested filesystems, each with different perms (for desko, moby, etc)?
### roles ### roles
- allow any host to take the role of `uninsane.org` - allow any host to take the role of `uninsane.org`
- will make it easier to test new services? - will make it easier to test new services?
### upstreaming ### upstreaming
- split out a sxmo module usable by NUR consumers
- bump nodejs version in lemmy-ui
- add updateScripts to all my packages in nixpkgs - add updateScripts to all my packages in nixpkgs
- fix lightdm-mobile-greeter for newer libhandy
- REVIEW/integrate jellyfin dataDir config: <https://github.com/NixOS/nixpkgs/pull/233617> - REVIEW/integrate jellyfin dataDir config: <https://github.com/NixOS/nixpkgs/pull/233617>
#### upstreaming to non-nixpkgs repos #### upstreaming to non-nixpkgs repos
@@ -29,6 +44,7 @@
## IMPROVEMENTS: ## IMPROVEMENTS:
### security/resilience ### security/resilience
- add FTPS support for WAN users of uninsane.org (and possibly require it?)
- validate duplicity backups! - validate duplicity backups!
- encrypt more ~ dirs (~/archives, ~/records, ..?) - encrypt more ~ dirs (~/archives, ~/records, ..?)
- best to do this after i know for sure i have good backups - best to do this after i know for sure i have good backups
@@ -47,6 +63,8 @@
- limit access to `~/knowledge/secrets` through an agent that requires GUI approval, so a firefox exploit can't steal all my logins - limit access to `~/knowledge/secrets` through an agent that requires GUI approval, so a firefox exploit can't steal all my logins
- port sane-sandboxed to a compiled language (hare?) - port sane-sandboxed 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. - it adds like 50-70ms launch time _on my laptop_. i'd hate to know how much that is on the pinephone.
- remove /run/wrappers from the sandbox path
- they're mostly useless when using no-new-privs, just an opportunity to forget to specify deps
- 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.
- canaries for important services - canaries for important services
@@ -54,6 +72,13 @@
- integrate `nix check` into Gitea actions? - integrate `nix check` into Gitea actions?
### user experience ### user experience
- rofi: sort items case-insensitively
- give `mpv` better `nice`ness?
- xdg-desktop-portal shouldn't kill children on exit
- *maybe* a job for `setsid -f`?
- replace starship prompt with something more efficient
- watch `forkstat`: it does way too much
- cleanup waybar so that it's not invoking playerctl every 2 seconds
- install apps: - install apps:
- 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/>
@@ -73,9 +98,12 @@
- numberlink (generic name for Flow Free). not packaged in Nix - numberlink (generic name for Flow Free). not packaged in Nix
- Neverball (https://neverball.org/screenshots.php). nix: as `neverball` - Neverball (https://neverball.org/screenshots.php). nix: as `neverball`
- blurble (https://linuxphoneapps.org/games/app.drey.blurble/). nix: not as of 2024-02-05 - blurble (https://linuxphoneapps.org/games/app.drey.blurble/). nix: not as of 2024-02-05
- Trivia Quiz (https://linuxphoneapps.org/games/io.github.nokse22.trivia-quiz/)
- sane-sync-music: remove empty dirs
#### 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>
- moby: tune keyboard layout
- SwayNC: - SwayNC:
- don't show MPRIS if no players detected - don't show MPRIS if no players detected
- this is a problem of playerctld, i guess - this is a problem of playerctld, i guess
@@ -97,6 +125,7 @@
- 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) - neovim: set up language server (lsp; rnix-lsp; nvim-lspconfig)
- 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
- just not cookies or tabs - just not cookies or tabs
@@ -114,7 +143,6 @@
### perf ### perf
- debug nixos-rebuild times - debug nixos-rebuild times
- i bet sane.programs adds a LOT of time, with how it automatically creates an attrs for EVERY package in nixpkgs.
- add `pkgs.impure-cached.<foo>` package set to build things with ccache enabled - add `pkgs.impure-cached.<foo>` package set to build things with ccache enabled
- every package here can be auto-generated, and marked with some env var so that it doesn't pollute the pure package set - every package here can be auto-generated, and marked with some env var so that it doesn't pollute the pure package set
- would be super handy for package prototyping! - would be super handy for package prototyping!

241
flake.lock generated
View File

@@ -1,5 +1,79 @@
{ {
"nodes": { "nodes": {
"flake-compat": {
"locked": {
"lastModified": 1688025799,
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs-wayland",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"lib-aggregate": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1715515815,
"narHash": "sha256-yaLScMHNFCH6SbB0HSA/8DWDgK0PyOhCXoFTdHlWkhk=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "09883ca828e8cfaacdb09e29190a7b84ad1d9925",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "lib-aggregate",
"type": "github"
}
},
"mobile-nixos": { "mobile-nixos": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -17,13 +91,87 @@
"type": "github" "type": "github"
} }
}, },
"nix-eval-jobs": {
"inputs": {
"flake-parts": "flake-parts",
"nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1715248291,
"narHash": "sha256-npC9Swu4VIlRIiEP0XFGoIukd6vOufS/M3PdHk6rQpc=",
"owner": "nix-community",
"repo": "nix-eval-jobs",
"rev": "63154bdfb22091041b307d17863bdc0e01a32a00",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-eval-jobs",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"nixpkgs-wayland",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703863825,
"narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1715037484,
"narHash": "sha256-OUt8xQFmBU96Hmm4T9tOWTu4oCswCzoVl+pxSq/kiFc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ad7efee13e0d216bf29992311536fce1d3eefbef",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1715474941,
"narHash": "sha256-CNCqCGOHdxuiVnVkhTpp2WcqSSmSfeQjubhDOcgwGjU=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "58e03b95f65dfdca21979a081aa62db0eed6b1d8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs-next-unpatched": { "nixpkgs-next-unpatched": {
"locked": { "locked": {
"lastModified": 1708992120, "lastModified": 1715601680,
"narHash": "sha256-t/8QV+lEroW5fK44w5oEUalIM0eYYVGs833AHDCIl4s=", "narHash": "sha256-Gmz6U8NMZVVnP6AGX4sMl4X6RcQBASPl/2Gj9R5k1Pk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6daf4de0662e1d895d220a4a4ddb356eb000abe9", "rev": "eda36d7cf3391ad06097009b08822fb74acd5e00",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -35,11 +183,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1708819810, "lastModified": 1715458492,
"narHash": "sha256-1KosU+ZFXf31GPeCBNxobZWMgHsSOJcrSFA6F2jhzdE=", "narHash": "sha256-q0OFeZqKQaik2U8wwGDsELEkgoZMK7gvfF6tTXkpsqE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "89a2a12e6c8c6a56c72eb3589982c8e2f89c70ea", "rev": "8e47858badee5594292921c2668c11004c3b0142",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -51,11 +199,11 @@
}, },
"nixpkgs-unpatched": { "nixpkgs-unpatched": {
"locked": { "locked": {
"lastModified": 1708995544, "lastModified": 1715616096,
"narHash": "sha256-YJgLopKOKVTggnKzjX4OiAS22hx/vNv397DcsAyTZgY=", "narHash": "sha256-rxh2XECb5hRzgNR4Xqj3aAjg6821LmNTVRfF6sUW6fI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5bd8df40204f47a12263f3614c72cd5b6832a9a0", "rev": "0a949cf2618e8eab83aa008f1f8e03db137ed36c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -65,11 +213,35 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-wayland": {
"inputs": {
"flake-compat": "flake-compat",
"lib-aggregate": "lib-aggregate",
"nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": [
"nixpkgs-unpatched"
]
},
"locked": {
"lastModified": 1715609745,
"narHash": "sha256-z2lQ7G1AxljvYeqrHWjc1ctOI4QZP06vPtvLYJWfZSc=",
"owner": "nix-community",
"repo": "nixpkgs-wayland",
"rev": "ed18785b8816fa878bdd9df7f2e8722695401ef8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs-wayland",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"mobile-nixos": "mobile-nixos", "mobile-nixos": "mobile-nixos",
"nixpkgs-next-unpatched": "nixpkgs-next-unpatched", "nixpkgs-next-unpatched": "nixpkgs-next-unpatched",
"nixpkgs-unpatched": "nixpkgs-unpatched", "nixpkgs-unpatched": "nixpkgs-unpatched",
"nixpkgs-wayland": "nixpkgs-wayland",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"uninsane-dot-org": "uninsane-dot-org" "uninsane-dot-org": "uninsane-dot-org"
} }
@@ -82,11 +254,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1708987867, "lastModified": 1715482972,
"narHash": "sha256-k2lDaDWNTU5sBVHanYzjDKVDmk29RHIgdbbXu5sdzBA=", "narHash": "sha256-y1uMzXNlrVOWYj1YNcsGYLm4TOC2aJrwoUY1NjQs9fM=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "a1c8de14f60924fafe13aea66b46157f0150f4cf", "rev": "b6cb5de2ce57acb10ecdaaf9bbd62a5ff24fa02e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -95,6 +267,43 @@
"type": "github" "type": "github"
} }
}, },
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs-wayland",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1711963903,
"narHash": "sha256-N3QDhoaX+paWXHbEXZapqd1r95mdshxToGowtjtYkGI=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49dc4a92b02b8e68798abd99184f228243b6e3ac",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"uninsane-dot-org": { "uninsane-dot-org": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -102,11 +311,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1707981105, "lastModified": 1713198740,
"narHash": "sha256-YCU1eNslBHabjP+OCY+BxPycEFO9SRUts10MrN9QORE=", "narHash": "sha256-8SUaqMJdAkMOI9zhvlToL7eCr5Sl+2o2pDQ7nq+HoJU=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "bb10cd8853d05191e4d62947d93687c462e92c30", "rev": "af8420d1c256d990b5e24de14ad8592a5d85bf77",
"revCount": 235, "revCount": 239,
"type": "git", "type": "git",
"url": "https://git.uninsane.org/colin/uninsane" "url": "https://git.uninsane.org/colin/uninsane"
}, },

110
flake.nix
View File

@@ -48,6 +48,11 @@
# nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-staging-next"; # nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-staging-next";
nixpkgs-next-unpatched.url = "github:nixos/nixpkgs?ref=staging-next"; nixpkgs-next-unpatched.url = "github:nixos/nixpkgs?ref=staging-next";
nixpkgs-wayland = {
url = "github:nix-community/nixpkgs-wayland";
inputs.nixpkgs.follows = "nixpkgs-unpatched";
};
mobile-nixos = { mobile-nixos = {
# <https://github.com/nixos/mobile-nixos> # <https://github.com/nixos/mobile-nixos>
# only used for building disk images, not relevant after deployment # only used for building disk images, not relevant after deployment
@@ -76,6 +81,7 @@
self, self,
nixpkgs-unpatched, nixpkgs-unpatched,
nixpkgs-next-unpatched ? nixpkgs-unpatched, nixpkgs-next-unpatched ? nixpkgs-unpatched,
nixpkgs-wayland,
mobile-nixos, mobile-nixos,
sops-nix, sops-nix,
uninsane-dot-org, uninsane-dot-org,
@@ -97,35 +103,12 @@
patchNixpkgs = variant: nixpkgs: (import ./nixpatches/flake.nix).outputs { patchNixpkgs = variant: nixpkgs: (import ./nixpatches/flake.nix).outputs {
inherit variant nixpkgs; inherit variant nixpkgs;
self = patchNixpkgs variant nixpkgs; self = patchNixpkgs variant nixpkgs;
} // { };
# sourceInfo includes fields (square brackets for the ones which are not always present):
# - [dirtyRev]
# - [dirtyShortRev]
# - lastModified
# - lastModifiedDate
# - narHash
# - outPath
# - [rev]
# - [revCount]
# - [shortRev]
# - submodules
#
# these values are used within nixpkgs:
# - to give a friendly name to the nixos system (`readlink /run/current-system` -> `...nixos-system-desko-24.05.20240227.dirty`)
# - to alias `import <nixpkgs>` so that nix uses the system's nixpkgs when called externally (supposedly).
#
# these values seem to exist both within the `sourceInfo` attrset and at the top-level.
# for a list of all implicit flake outputs (which is what these seem to be):
# $ nix-repl
# > lf .
# > <tab>
inherit (self) sourceInfo;
} // self.sourceInfo;
nixpkgs' = patchNixpkgs "master" nixpkgs-unpatched; nixpkgs' = patchNixpkgs "master" nixpkgs-unpatched;
nixpkgsCompiledBy = system: nixpkgs'.legacyPackages."${system}"; nixpkgsCompiledBy = system: nixpkgs'.legacyPackages."${system}";
evalHost = { name, local, target, light ? false, nixpkgs ? nixpkgs' }: nixpkgs.lib.nixosSystem { evalHost = { name, local, target, variant ? null, nixpkgs ? nixpkgs' }: nixpkgs.lib.nixosSystem {
system = target; system = target;
modules = [ modules = [
{ {
@@ -137,8 +120,11 @@
# so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches. # so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches.
nixpkgs.hostPlatform.system = target; nixpkgs.hostPlatform.system = target;
}) })
(optionalAttrs light { (optionalAttrs (variant == "light") {
sane.enableSlowPrograms = false; sane.maxBuildCost = 2;
})
(optionalAttrs (variant == "min") {
sane.maxBuildCost = 0;
}) })
(import ./hosts/instantiate.nix { hostName = name; }) (import ./hosts/instantiate.nix { hostName = name; })
self.nixosModules.default self.nixosModules.default
@@ -156,11 +142,13 @@
hosts = { hosts = {
servo = { name = "servo"; local = "x86_64-linux"; target = "x86_64-linux"; }; servo = { name = "servo"; local = "x86_64-linux"; target = "x86_64-linux"; };
desko = { name = "desko"; local = "x86_64-linux"; target = "x86_64-linux"; }; desko = { name = "desko"; local = "x86_64-linux"; target = "x86_64-linux"; };
desko-light = { name = "desko"; local = "x86_64-linux"; target = "x86_64-linux"; light = true; }; desko-light = { name = "desko"; local = "x86_64-linux"; target = "x86_64-linux"; variant = "light"; };
lappy = { name = "lappy"; local = "x86_64-linux"; target = "x86_64-linux"; }; lappy = { name = "lappy"; local = "x86_64-linux"; target = "x86_64-linux"; };
lappy-light = { name = "lappy"; local = "x86_64-linux"; target = "x86_64-linux"; light = true; }; lappy-light = { name = "lappy"; local = "x86_64-linux"; target = "x86_64-linux"; variant = "light"; };
lappy-min = { name = "lappy"; local = "x86_64-linux"; target = "x86_64-linux"; variant = "min"; };
moby = { name = "moby"; local = "x86_64-linux"; target = "aarch64-linux"; }; moby = { name = "moby"; local = "x86_64-linux"; target = "aarch64-linux"; };
moby-light = { name = "moby"; local = "x86_64-linux"; target = "aarch64-linux"; light = true; }; moby-light = { name = "moby"; local = "x86_64-linux"; target = "aarch64-linux"; variant = "light"; };
moby-min = { name = "moby"; local = "x86_64-linux"; target = "aarch64-linux"; variant = "min"; };
rescue = { name = "rescue"; local = "x86_64-linux"; target = "x86_64-linux"; }; rescue = { name = "rescue"; local = "x86_64-linux"; target = "x86_64-linux"; };
}; };
hostsNext = mapAttrs' (h: v: { hostsNext = mapAttrs' (h: v: {
@@ -207,9 +195,18 @@
let let
mobile = (import "${mobile-nixos}/overlay/overlay.nix"); mobile = (import "${mobile-nixos}/overlay/overlay.nix");
uninsane = uninsane-dot-org.overlays.default; uninsane = uninsane-dot-org.overlays.default;
wayland = final: prev: {
# default is to dump the packages into `waylandPkgs` *and* the toplevel.
# but i just want the `waylandPkgs` set
inherit (nixpkgs-wayland.overlays.default final prev)
waylandPkgs
new-wayland-protocols #< 2024/03/10: nixpkgs-wayland assumes this will be in the toplevel
;
};
in in
(mobile final prev) (mobile final prev)
// (uninsane final prev) // (uninsane final prev)
// (wayland final prev)
; ;
}; };
@@ -265,6 +262,8 @@
pkgs = self.legacyPackages."x86_64-linux"; pkgs = self.legacyPackages."x86_64-linux";
sanePkgs = import ./pkgs { inherit pkgs; }; sanePkgs = import ./pkgs { inherit pkgs; };
deployScript = host: addr: action: pkgs.writeShellScript "deploy-${host}" '' deployScript = host: addr: action: pkgs.writeShellScript "deploy-${host}" ''
set -e
host="${host}" host="${host}"
addr="${addr}" addr="${addr}"
action="${if action != null then action else ""}" action="${if action != null then action else ""}"
@@ -278,8 +277,8 @@
fi fi
} }
nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --out-link "./result-$host" "$@" nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --out-link "./build/result-$host" "$@"
storePath="$(readlink ./result-$host)" storePath="$(readlink ./build/result-$host)"
# mimic `nixos-rebuild --target-host`, in effect: # mimic `nixos-rebuild --target-host`, in effect:
# - nix-copy-closure ... # - nix-copy-closure ...
@@ -382,6 +381,8 @@
- or `nix run '.#preDeploy'` to target all hosts - or `nix run '.#preDeploy'` to target all hosts
- `nix run '.#check'` - `nix run '.#check'`
- make sure all systems build; NUR evaluates - make sure all systems build; NUR evaluates
- `nix run '.#bench'`
- benchmark the eval time of common targets this flake provides
specific build targets of interest: specific build targets of interest:
- `nix build '.#imgs.rescue'` - `nix build '.#imgs.rescue'`
@@ -412,14 +413,17 @@
desko-light = deployApp "desko-light" "desko" "switch"; desko-light = deployApp "desko-light" "desko" "switch";
lappy = deployApp "lappy" "lappy" "switch"; lappy = deployApp "lappy" "lappy" "switch";
lappy-light = deployApp "lappy-light" "lappy" "switch"; lappy-light = deployApp "lappy-light" "lappy" "switch";
lappy-min = deployApp "lappy-min" "lappy" "switch";
moby = deployApp "moby" "moby" "switch"; moby = deployApp "moby" "moby" "switch";
moby-light = deployApp "moby-light" "moby" "switch"; moby-light = deployApp "moby-light" "moby" "switch";
moby-min = deployApp "moby-min" "moby" "switch";
moby-test = deployApp "moby" "moby" "test"; moby-test = deployApp "moby" "moby" "test";
servo = deployApp "servo" "servo" "switch"; servo = deployApp "servo" "servo" "switch";
# like `nixos-rebuild --flake . switch` # like `nixos-rebuild --flake . switch`
self = deployApp "$(hostname)" "" "switch"; self = deployApp "$(hostname)" "" "switch";
self-light = deployApp "$(hostname)-light" "" "switch"; self-light = deployApp "$(hostname)-light" "" "switch";
self-min = deployApp "$(hostname)-min" "" "switch";
type = "app"; type = "app";
program = builtins.toString (pkgs.writeShellScript "deploy-all" '' program = builtins.toString (pkgs.writeShellScript "deploy-all" ''
@@ -435,12 +439,16 @@
desko-light = deployApp "desko-light" "desko" null; desko-light = deployApp "desko-light" "desko" null;
lappy = deployApp "lappy" "lappy" null; lappy = deployApp "lappy" "lappy" null;
lappy-light = deployApp "lappy-light" "lappy" null; lappy-light = deployApp "lappy-light" "lappy" null;
lappy-min = deployApp "lappy-min" "lappy" null;
moby = deployApp "moby" "moby" null; moby = deployApp "moby" "moby" null;
moby-light = deployApp "moby-light" "moby" null; moby-light = deployApp "moby-light" "moby" null;
moby-min = deployApp "moby-min" "moby" null;
servo = deployApp "servo" "servo" null; servo = deployApp "servo" "servo" null;
type = "app"; type = "app";
program = builtins.toString (pkgs.writeShellScript "predeploy-all" '' program = builtins.toString (pkgs.writeShellScript "predeploy-all" ''
# copy the -light variants first; this might be run while waiting on a full build. or the full build failed. # copy the -min/-light variants first; this might be run while waiting on a full build. or the full build failed.
nix run '.#preDeploy.moby-min' -- "$@"
nix run '.#preDeploy.lappy-min' -- "$@"
nix run '.#preDeploy.moby-light' -- "$@" nix run '.#preDeploy.moby-light' -- "$@"
nix run '.#preDeploy.lappy-light' -- "$@" nix run '.#preDeploy.lappy-light' -- "$@"
nix run '.#preDeploy.desko-light' -- "$@" nix run '.#preDeploy.desko-light' -- "$@"
@@ -525,6 +533,7 @@
--option allow-import-from-derivation true \ --option allow-import-from-derivation true \
--drv-path --show-trace \ --drv-path --show-trace \
-I nixpkgs=${nixpkgs-unpatched} \ -I nixpkgs=${nixpkgs-unpatched} \
-I nixpkgs-overlays=${./.}/hosts/common/nix/overlay \
-I ../../ \ -I ../../ \
| tee # tee to prevent interactive mode | tee # tee to prevent interactive mode
''); '');
@@ -536,7 +545,7 @@
checkHost = host: let checkHost = host: let
shellHost = pkgs.lib.replaceStrings [ "-" ] [ "_" ] host; shellHost = pkgs.lib.replaceStrings [ "-" ] [ "_" ] host;
in '' in ''
nix build -v '.#nixosConfigurations.${host}.config.system.build.toplevel' --out-link ./result-${host} -j2 "$@" nix build -v '.#nixosConfigurations.${host}.config.system.build.toplevel' --out-link ./build/result-${host} -j2 "$@"
RC_${shellHost}=$? RC_${shellHost}=$?
''; '';
in builtins.toString (pkgs.writeShellScript in builtins.toString (pkgs.writeShellScript
@@ -544,6 +553,9 @@
'' ''
# build minimally-usable hosts first, then their full image. # build minimally-usable hosts first, then their full image.
# this gives me a minimal image i can deploy or copy over, early. # this gives me a minimal image i can deploy or copy over, early.
${checkHost "lappy-min"}
${checkHost "moby-min"}
${checkHost "desko-light"} ${checkHost "desko-light"}
${checkHost "moby-light"} ${checkHost "moby-light"}
${checkHost "lappy-light"} ${checkHost "lappy-light"}
@@ -585,7 +597,31 @@
check.rescue = { check.rescue = {
type = "app"; type = "app";
program = builtins.toString (pkgs.writeShellScript "check-rescue" '' program = builtins.toString (pkgs.writeShellScript "check-rescue" ''
nix build -v '.#imgs.rescue' --out-link ./result-rescue-img -j2 nix build -v '.#imgs.rescue' --out-link ./build/result-rescue-img -j2
'');
};
bench = {
type = "app";
program = builtins.toString (pkgs.writeShellScript "bench" ''
doBench() {
attrPath="$1"
shift
echo -n "benchmarking eval of '$attrPath'... "
/run/current-system/sw/bin/time -f "%e sec" -o /dev/stdout \
nix eval --no-eval-cache --quiet --raw ".#$attrPath" --apply 'result: if result != null then "" else "unexpected null"' $@ 2> /dev/null
}
if [ -n "$1" ]; then
doBench "$@"
else
doBench hostConfigs
doBench hostConfigs.lappy
doBench hostConfigs.lappy.sane.programs
doBench hostConfigs.lappy.sane.users.colin
doBench hostConfigs.lappy.sane.fs
doBench hostConfigs.lappy.environment.systemPackages
fi
''); '');
}; };
}; };

View File

@@ -28,6 +28,7 @@
sane.nixcache.substituters.desko = false; sane.nixcache.substituters.desko = false;
sane.nixcache.remote-builders.desko = false; sane.nixcache.remote-builders.desko = false;
sane.programs.cups.enableFor.user.colin = true;
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;

View File

@@ -2,7 +2,6 @@
{ {
imports = [ imports = [
./fs.nix ./fs.nix
./polyfill.nix
]; ];
sane.roles.client = true; sane.roles.client = true;
@@ -15,10 +14,12 @@
boot.loader.efi.canTouchEfiVariables = false; boot.loader.efi.canTouchEfiVariables = false;
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ]; sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
sane.programs.cups.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."gnome.geary".config.autostart = true; sane.programs."gnome.geary".config.autostart = true;
sane.programs.signal-desktop.config.autostart = true; sane.programs.signal-desktop.config.autostart = true;
sane.programs.stepmania.enableFor.user.colin = true;
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;

View File

@@ -1,41 +0,0 @@
# doesn't actually *enable* anything,
# but sets up any modules such that if they *were* enabled, they'll act as expected.
{ pkgs, ... }:
{
sane.gui.sxmo = {
noidle = true; #< power button requires 1s hold, which makes it impractical to be dealing with.
settings = {
# XXX: make sure the user is part of the `input` group!
SXMO_LISGD_INPUT_DEVICE = "/dev/input/by-id/usb-Wacom_Co._Ltd._Pen_and_multitouch_sensor-event-if00";
# these identifiers are from `swaymsg -t get_inputs`
SXMO_VOLUME_BUTTON = "1:1:AT_Translated_Set_2_keyboard";
# SXMO_VOLUME_BUTTON = "none";
# N.B.: thinkpad's power button requires a full second press to do anything
SXMO_POWER_BUTTON = "0:1:Power_Button";
# SXMO_POWER_BUTTON = "none";
SXMO_DISABLE_LEDS = "1";
SXMO_UNLOCK_IDLE_TIME = "120"; # default
# sxmo tries to determine device type from /proc/device-tree/compatible,
# but that doesn't seem to exist on NixOS? (or maybe it just doesn't exist
# on non-aarch64 builds).
# the device type informs (at least):
# - SXMO_WIFI_MODULE
# - SXMO_RTW_SCAN_INTERVAL
# - SXMO_TOUCHSCREEN_ID
# - SXMO_MONITOR
# - SXMO_ALSA_CONTROL_NAME
# - SXMO_SWAY_SCALE
# see <repo:mil/sxmo-utils:scripts/deviceprofiles>
# SXMO_DEVICE_NAME = "pine64,pinephone-1.2";
# if sxmo doesn't know the device, it can't decide whether to use one_button or three_button mode
# and so it just wouldn't handle any button inputs (sxmo_hook_inputhandler.sh not on path)
SXMO_DEVICE_NAME = "three_button_touchscreen";
};
package = (pkgs.sxmo-utils.override { preferSystemd = true; }).overrideAttrs (base: {
postPatch = (base.postPatch or "") + ''
# after volume-button navigation mode, restore full keyboard functionality
cp ${./xkb_mobile_normal_buttons} ./configs/xkb/xkb_mobile_normal_buttons
'';
});
};
}

View File

@@ -1,12 +1,22 @@
# tow-boot: <https://tow-boot.org>
# docs (pinephone specific): <https://github.com/Tow-Boot/Tow-Boot/tree/development/boards/pine64-pinephoneA64>
# LED and button behavior is defined here: <https://github.com/Tow-Boot/Tow-Boot/blob/development/modules/tow-boot/phone-ux.nix>
# - hold VOLDOWN: enter recovery mode
# - LED will turn aqua instead of yellow
# - recovery mode would ordinarily allow a selection of entries, but for pinephone i guess it doesn't do anything?
# - hold VOLUP: force it to load the OS from eMMC?
# - LED will turn blue instead of yellow
# boot LEDs:
# - yellow = entered tow-boot
# - 10 red flashes => poweroff means tow-boot couldn't boot into the next stage (i.e. distroboot)
# - distroboot: <https://source.denx.de/u-boot/u-boot/-/blob/v2022.04/doc/develop/distro.rst>)
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
# we need space in the GPT header to place tow-boot. # we need space in the GPT header to place tow-boot.
# only actually need 1 MB, but better to over-allocate than under-allocate # only actually need 1 MB, but better to over-allocate than under-allocate
sane.image.extraGPTPadding = 16 * 1024 * 1024; sane.image.extraGPTPadding = 16 * 1024 * 1024;
sane.image.firstPartGap = 0; sane.image.firstPartGap = 0;
system.build.img = pkgs.runCommand "nixos_full-disk-image.img" {} '' sane.image.installBootloader = ''
cp -v ${config.system.build.img-without-firmware}/nixos.img $out dd if=${pkgs.tow-boot-pinephone}/Tow-Boot.noenv.bin of=$out/nixos.img bs=1024 seek=8 conv=notrunc
chmod +w $out
dd if=${pkgs.tow-boot-pinephone}/Tow-Boot.noenv.bin of=$out bs=1024 seek=8 conv=notrunc
''; '';
} }

View File

@@ -36,10 +36,15 @@
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;
sane.gui.sxmo.enable = true; # sane.gui.sxmo.enable = true;
# sane.programs.consoleUtils.enableFor.user.colin = false; sane.programs.sway.enableFor.user.colin = true;
# sane.programs.guiApps.enableFor.user.colin = false; sane.programs.swaylock.enableFor.user.colin = false; #< not usable on touch
sane.programs.schlock.enableFor.user.colin = true;
sane.programs.swayidle.config.actions.screenoff.delay = 300;
sane.programs.swayidle.config.actions.screenoff.enable = true;
sane.programs.sane-input-handler.enableFor.user.colin = true;
sane.programs.blueberry.enableFor.user.colin = false; # bluetooth manager: doesn't cross compile! 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.mercurial.enableFor.user.colin = false; # does not cross compile
sane.programs.nvme-cli.enableFor.system = false; # does not cross compile (libhugetlbfs) sane.programs.nvme-cli.enableFor.system = false; # does not cross compile (libhugetlbfs)
@@ -52,24 +57,13 @@
# sane.programs.signal-desktop.config.autostart = true; # TODO: enable once electron stops derping. # sane.programs.signal-desktop.config.autostart = true; # TODO: enable once electron stops derping.
# sane.programs."gnome.geary".config.autostart = true; # sane.programs."gnome.geary".config.autostart = true;
# sane.programs.calls.config.autostart = true; # sane.programs.calls.config.autostart = true;
sane.programs.mpv.config.vo = "wlshm"; #< see hosts/common/programs/mpv.nix for details
sane.programs.firefox.mime.priority = 300; # prefer other browsers when possible sane.programs.firefox.mime.priority = 300; # prefer other browsers when possible
# HACK/TODO: make `programs.P.env.VAR` behave according to `mime.priority` # HACK/TODO: make `programs.P.env.VAR` behave according to `mime.priority`
sane.programs.firefox.env = lib.mkForce {}; sane.programs.firefox.env = lib.mkForce {};
sane.programs.epiphany.env.BROWSER = "epiphany"; sane.programs.epiphany.env.BROWSER = "epiphany";
sane.programs.pipewire.config = {
# note the .conf.d approach: using ~/.config/pipewire/pipewire.conf directly breaks all audio, # tune so Dino doesn't drop audio
# presumably because that deletes the defaults entirely whereas the .conf.d approach selectively overrides defaults
sane.user.fs.".config/pipewire/pipewire.conf.d/10-fix-dino-mic-cutout.conf".symlink.text = ''
# config docs: <https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-PipeWire#properties>
# useful to run `pw-top` to see that these settings are actually having effect,
# and `pw-metadata` to see if any settings conflict (e.g. max-quantum < min-quantum)
#
# restart pipewire after editing these files:
# - `systemctl --user restart pipewire`
# - pipewire users will likely stop outputting audio until they are also restarted
#
# there's seemingly two buffers for the mic (see: <https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#pipewire-buffering-explained>) # there's seemingly two buffers for the mic (see: <https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#pipewire-buffering-explained>)
# 1. Pipewire buffering out of the driver and into its own member. # 1. Pipewire buffering out of the driver and into its own member.
# 2. Pipewire buffering into Dino. # 2. Pipewire buffering into Dino.
@@ -80,11 +74,9 @@
# `pw-metadata -n settings 0 clock.force-quantum 1024` reduces to about 1 error per second. # `pw-metadata -n settings 0 clock.force-quantum 1024` reduces to about 1 error per second.
# `pw-metadata -n settings 0 clock.force-quantum 2048` reduces to 1 error every < 10s. # `pw-metadata -n settings 0 clock.force-quantum 2048` reduces to 1 error every < 10s.
# pipewire default config includes `clock.power-of-two-quantum = true` # pipewire default config includes `clock.power-of-two-quantum = true`
context.properties = { min-quantum = 2048;
default.clock.min-quantum = 2048 max-quantum = 8192;
default.clock.max-quantum = 8192 };
}
'';
boot.loader.efi.canTouchEfiVariables = false; boot.loader.efi.canTouchEfiVariables = false;
# /boot space is at a premium. default was 20. # /boot space is at a premium. default was 20.
@@ -124,44 +116,6 @@
# enable rotation sensor # enable rotation sensor
hardware.sensor.iio.enable = true; hardware.sensor.iio.enable = true;
# inject specialized alsa configs via the environment.
# specifically, this gets the pinephone headphones & internal earpiece working.
# see pkgs/patched/alsa-ucm-conf for more info.
environment.variables.ALSA_CONFIG_UCM2 = "/run/current-system/sw/share/alsa/ucm2";
environment.pathsToLink = [ "/share/alsa/ucm2" ];
environment.systemPackages = [
(pkgs.alsa-ucm-conf-sane.override {
# internal speaker has a tendency to break :(
preferEarpiece = true;
})
];
systemd = let
ucm-env = config.environment.variables.ALSA_CONFIG_UCM2;
in {
# cribbed from <repo:nixos/mobile-nixos:modules/quirks/audio.nix>
# pipewire
user.services.pipewire.environment.ALSA_CONFIG_UCM2 = ucm-env;
user.services.pipewire-pulse.environment.ALSA_CONFIG_UCM2 = ucm-env;
user.services.wireplumber.environment.ALSA_CONFIG_UCM2 = ucm-env;
services.pipewire.environment.ALSA_CONFIG_UCM2 = ucm-env;
services.pipewire-pulse.environment.ALSA_CONFIG_UCM2 = ucm-env;
services.wireplumber.environment.ALSA_CONFIG_UCM2 = ucm-env;
# pulseaudio
# user.services.pulseaudio.environment.ALSA_CONFIG_UCM2 = ucm-env;
# services.pulseaudio.environment.ALSA_CONFIG_UCM2 = ucm-env;
# TODO: move elsewhere...
services.ModemManager.serviceConfig = {
# N.B.: the extra "" in ExecStart serves to force upstream ExecStart to be ignored
ExecStart = [ "" "${pkgs.modemmanager}/bin/ModemManager --debug" ];
# --debug sets DEBUG level logging: so reset
ExecStartPost = [ "${pkgs.modemmanager}/bin/mmcli --set-logging=INFO" ];
};
};
services.udev.extraRules = let services.udev.extraRules = let
chmod = "${pkgs.coreutils}/bin/chmod"; chmod = "${pkgs.coreutils}/bin/chmod";
chown = "${pkgs.coreutils}/bin/chown"; chown = "${pkgs.coreutils}/bin/chown";

View File

@@ -64,6 +64,5 @@
"dialout" # TODO: figure out if dialout is required. that's for /dev/ttyUSB1, but geoclue probably doesn't read that? "dialout" # TODO: figure out if dialout is required. that's for /dev/ttyUSB1, but geoclue probably doesn't read that?
]; ];
sane.services.eg25-control.enable = true;
sane.programs.where-am-i.enableFor.user.colin = true; sane.programs.where-am-i.enableFor.user.colin = true;
} }

View File

@@ -85,6 +85,7 @@ in
"lima.sched_timeout_ms=2000" "lima.sched_timeout_ms=2000"
]; ];
services.xserver.displayManager.job.preStart = ensureHWReady; # services.xserver.displayManager.job.preStart = ensureHWReady;
systemd.services.greetd.preStart = ensureHWReady; # systemd.services.greetd.preStart = ensureHWReady;
systemd.services.unl0kr.preStart = ensureHWReady;
} }

View File

@@ -24,73 +24,22 @@
backlight = "backlight"; # /sys/class/backlight/*backlight*/brightness backlight = "backlight"; # /sys/class/backlight/*backlight*/brightness
}; };
sane.gui.sxmo = { sane.programs.alacritty.config.fontSize = 9;
nogesture = true;
settings = {
### hardware: touch screen
SXMO_LISGD_INPUT_DEVICE = "/dev/input/by-path/platform-1c2ac00.i2c-event";
# vol and power are detected correctly by upstream
### preferences sane.programs.sway.config = {
DEFAULT_COUNTRY = "US"; font = "pango:monospace 10";
mod = "Mod1"; # prefer Alt
workspace_layout = "tabbed";
};
SXMO_AUTOROTATE = "1"; # enable auto-rotation at launch. has no meaning in stock/upstream sxmo-utils sane.programs.waybar.config = {
fontSize = 14;
# BEMENU lines (wayland DMENU): height = 26;
# - camera is 9th entry persistWorkspaces = [ "1" "2" "3" "4" "5" ];
# - flashlight is 10th entry modules.media = false;
# - config is 14th entry. inside that: modules.network = false;
# - autorotate is 11th entry modules.perf = false;
# - system menu is 19th entry modules.windowTitle = false;
# - close is 20th entry # TODO: show modem state
# - power is 15th entry
# - close is 16th entry
SXMO_BEMENU_LANDSCAPE_LINES = "11"; # default 8
SXMO_BEMENU_PORTRAIT_LINES = "16"; # default 16
SXMO_LOCK_IDLE_TIME = "15"; # how long between screenoff -> lock -> back to screenoff (default: 8)
# gravity: how far to tilt the device before the screen rotates
# for a given setting, normal <-> invert requires more movement then left <-> right
# i.e. the settingd doesn't feel completely symmetric
# SXMO_ROTATION_GRAVITY default is 16374
# SXMO_ROTATION_GRAVITY = "12800"; # uncomfortably high
# SXMO_ROTATION_GRAVITY = "12500"; # kinda uncomfortable when walking
SXMO_ROTATION_GRAVITY = "12000";
SXMO_SCREENSHOT_DIR = "/home/colin/Pictures"; # default: "$HOME"
# sway/wayland scaling:
# - conflicting info out there on how scaling actually works
# at the least, for things where it matters (mpv), it seems like scale settings have 0 effect on perf
# ways to enforce scaling:
# - <https://wiki.archlinux.org/title/HiDPI>
# - `swaymsg -- output DSI-1 scale 2.0` (scales everything)
# - `dconf write /org/gnome/desktop/interface/text-scaling-factor 2.0` (scales ONLY TEXT)
# - `GDK_DPI_SCALE=2.0` (scales ONLY TEXT)
#
# application notes:
# - cozy: in landscape, playback position is not visible unless scale <= 1.7
# - if in a tab, then scale 1.6 is the max
# SXMO_SWAY_SCALE = "1.5"; # hard to press gPodder icons
SXMO_SWAY_SCALE = "1.6";
# SXMO_SWAY_SCALE = "1.8";
# SXMO_SWAY_SCALE = "2";
SXMO_WORKSPACE_WRAPPING = "5"; # how many workspaces. default: 4
# wvkbd layers:
# - full
# - landscape
# - special (e.g. coding symbols like ~)
# - emoji
# - nav
# - simple (like landscape, but no parens/tab/etc; even fewer chars)
# - simplegrid (simple, but grid layout)
# - dialer (digits)
# - cyrillic
# - arabic
# - persian
# - greek
# - georgian
WVKBD_LANDSCAPE_LAYERS = "landscape,special,emoji";
WVKBD_LAYERS = "full,special,emoji";
};
}; };
} }

View File

@@ -6,7 +6,7 @@
boot.loader.efi.canTouchEfiVariables = false; boot.loader.efi.canTouchEfiVariables = false;
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ]; sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
sane.persist.enable = false; sane.persist.enable = false; # what we mean here is that the image is immutable; `/` is still tmpfs.
sane.nixcache.enable = false; # don't want to be calling out to dead machines that we're *trying* to rescue sane.nixcache.enable = false; # don't want to be calling out to dead machines that we're *trying* to rescue
# auto-login at shell # auto-login at shell

View File

@@ -8,6 +8,7 @@
# - 1. identify disk IDs: `ls -l /dev/disk/by-id` # - 1. identify disk IDs: `ls -l /dev/disk/by-id`
# - 2. pool these disks: `zpool create -f -m legacy pool raidz ata-ST4000VN008-2DR166_WDH0VB45 ata-ST4000VN008-2DR166_WDH17616 ata-ST4000VN008-2DR166_WDH0VC8Q ata-ST4000VN008-2DR166_WDH17680` # - 2. pool these disks: `zpool create -f -m legacy pool raidz ata-ST4000VN008-2DR166_WDH0VB45 ata-ST4000VN008-2DR166_WDH17616 ata-ST4000VN008-2DR166_WDH0VC8Q ata-ST4000VN008-2DR166_WDH17680`
# - legacy documented: <https://superuser.com/questions/790036/what-is-a-zfs-legacy-mount-point> # - legacy documented: <https://superuser.com/questions/790036/what-is-a-zfs-legacy-mount-point>
# - 3. enable acl support: `zfs set acltype=posixacl pool`
# #
# import pools: `zpool import pool` # import pools: `zpool import pool`
# show zfs datasets: `zfs list` (will be empty if haven't imported) # show zfs datasets: `zfs list` (will be empty if haven't imported)
@@ -25,6 +26,7 @@
# scrub all zfs pools weekly: # scrub all zfs pools weekly:
services.zfs.autoScrub.enable = true; services.zfs.autoScrub.enable = true;
boot.extraModprobeConfig = '' boot.extraModprobeConfig = ''
### zfs_arc_max tunable:
# ZFS likes to use half the ram for its own cache and let the kernel push everything else to swap. # ZFS likes to use half the ram for its own cache and let the kernel push everything else to swap.
# so, reduce its cache size # so, reduce its cache size
# see: <https://askubuntu.com/a/1290387> # see: <https://askubuntu.com/a/1290387>
@@ -33,7 +35,13 @@
# for all tunables, see: `man 4 zfs` # for all tunables, see: `man 4 zfs`
# to update these parameters without rebooting: # to update these parameters without rebooting:
# - `echo '4294967296' | sane-sudo-redirect /sys/module/zfs/parameters/zfs_arc_max` # - `echo '4294967296' | sane-sudo-redirect /sys/module/zfs/parameters/zfs_arc_max`
options zfs zfs_arc_max=4294967296 ### zfs_bclone_enabled tunable
# this allows `cp --reflink=always FOO BAR` to work. i.e. shallow copies.
# it's unstable as of 2.2.3. led to *actual* corruption in 2.2.1, but hopefully better by now.
# - <https://github.com/openzfs/zfs/issues/405>
# note that `du -h` won't *always* show the reduced size for reflink'd files (?).
# `zpool get all | grep clone` seems to be the way to *actually* see how much data is being deduped
options zfs zfs_arc_max=4294967296 zfs_bclone_enabled=1
''; '';
# to be able to mount the pool like this, make sure to tell zfs to NOT manage it itself. # to be able to mount the pool like this, make sure to tell zfs to NOT manage it itself.
# otherwise local-fs.target will FAIL and you will be dropped into a rescue shell. # otherwise local-fs.target will FAIL and you will be dropped into a rescue shell.
@@ -43,6 +51,7 @@
fileSystems."/mnt/pool" = { fileSystems."/mnt/pool" = {
device = "pool"; device = "pool";
fsType = "zfs"; fsType = "zfs";
options = [ "acl" ]; #< not sure if this `acl` flag is actually necessary. it mounts without it.
}; };
# services.zfs.zed = ... # TODO: zfs can send me emails when disks fail # services.zfs.zed = ... # TODO: zfs can send me emails when disks fail
sane.programs.sysadminUtils.suggestedPrograms = [ "zfs" ]; sane.programs.sysadminUtils.suggestedPrograms = [ "zfs" ];
@@ -82,61 +91,45 @@
}; };
sane.fs."/mnt/usb-hdd".mount = {}; sane.fs."/mnt/usb-hdd".mount = {};
sane.persist.sys.byStore.plaintext = [ # FIRST TIME SETUP FOR MEDIA DIRECTORY:
# TODO: this is overly broad; only need media and share directories to be persisted # - set the group stick bit: `sudo find /var/media -type d -exec chmod g+s {} +`
{ user = "colin"; group = "users"; path = "/var/lib/uninsane"; method = "bind"; } # - this ensures new files/dirs inherit the group of their parent dir (instead of the user who creates them)
]; # - ensure everything under /var/media is mounted with `-o acl`, to support acls
# force some problematic directories to always get correct permissions: # - ensure all files are rwx by group: `setfacl --recursive --modify d:g::rwx /var/media`
sane.fs."/var/lib/uninsane/media".dir.acl = { # - alternatively, `d:g:media:rwx` to grant `media` group even when file has a different owner, but that's a bit complex
user = "colin"; group = "media"; mode = "0775"; sane.persist.sys.byStore.ext = [{
}; path = "/var/media";
sane.fs."/var/lib/uninsane/media/archive".dir = {}; user = "colin";
group = "media";
mode = "0775";
}];
sane.fs."/var/media/archive".dir = {};
# this is file.text instead of symlink.text so that it may be read over a remote mount (where consumers might not have any /nix/store/.../README.md path) # this is file.text instead of symlink.text so that it may be read over a remote mount (where consumers might not have any /nix/store/.../README.md path)
sane.fs."/var/lib/uninsane/media/archive/README.md".file.text = '' sane.fs."/var/media/archive/README.md".file.text = ''
this directory is for media i wish to remove from my library, this directory is for media i wish to remove from my library,
but keep for a short time in case i reverse my decision. but keep for a short time in case i reverse my decision.
treat it like a system trash can. treat it like a system trash can.
''; '';
sane.fs."/var/lib/uninsane/media/Books".dir = {}; sane.fs."/var/media/Books".dir = {};
sane.fs."/var/lib/uninsane/media/Books/Audiobooks".dir = {}; sane.fs."/var/media/Books/Audiobooks".dir = {};
sane.fs."/var/lib/uninsane/media/Books/Books".dir = {}; sane.fs."/var/media/Books/Books".dir = {};
sane.fs."/var/lib/uninsane/media/Books/Visual".dir = {}; sane.fs."/var/media/Books/Visual".dir = {};
sane.fs."/var/lib/uninsane/media/collections".dir = {}; sane.fs."/var/media/collections".dir = {};
sane.fs."/var/lib/uninsane/media/datasets".dir = {}; # sane.fs."/var/media/datasets".dir = {};
sane.fs."/var/lib/uninsane/media/freeleech".dir = {}; sane.fs."/var/media/freeleech".dir = {};
sane.fs."/var/lib/uninsane/media/Music".dir = {}; sane.fs."/var/media/Music".dir = {};
sane.fs."/var/lib/uninsane/media/Pictures".dir = {}; sane.fs."/var/media/Pictures".dir = {};
sane.fs."/var/lib/uninsane/media/Videos".dir = {}; sane.fs."/var/media/Videos".dir = {};
sane.fs."/var/lib/uninsane/media/Videos/Film".dir = {}; sane.fs."/var/media/Videos/Film".dir = {};
sane.fs."/var/lib/uninsane/media/Videos/Shows".dir = {}; sane.fs."/var/media/Videos/Shows".dir = {};
sane.fs."/var/lib/uninsane/media/Videos/Talks".dir = {}; sane.fs."/var/media/Videos/Talks".dir = {};
# this is file.text instead of symlink.text so that it may be read over a remote mount (where consumers might not have any /nix/store/.../README.md path) # this is file.text instead of symlink.text so that it may be read over a remote mount (where consumers might not have any /nix/store/.../README.md path)
sane.fs."/var/lib/uninsane/datasets/README.md".file.text = '' sane.fs."/var/lib/uninsane/datasets/README.md".file.text = ''
this directory may seem redundant with ../media/datasets. it isn't. this directory may seem redundant with ../media/datasets. it isn't.
this directory exists on SSD, allowing for speedy access to specific datasets when necessary. this directory exists on SSD, allowing for speedy access to specific datasets when necessary.
the contents should be a subset of what's in ../media/datasets. the contents should be a subset of what's in ../media/datasets.
''; '';
# make sure large media is stored to the HDD
sane.persist.sys.byStore.ext = [
{
user = "colin";
group = "users";
mode = "0777";
path = "/var/lib/uninsane/media/Videos";
}
{
user = "colin";
group = "users";
mode = "0777";
path = "/var/lib/uninsane/media/freeleech";
}
{
user = "colin";
group = "users";
mode = "0777";
path = "/var/lib/uninsane/media/datasets";
}
];
# btrfs doesn't easily support swapfiles # btrfs doesn't easily support swapfiles
# swapDevices = [ # swapDevices = [

View File

@@ -87,7 +87,7 @@ in
} }
]; ];
preSetup = '' preSetup = ''
${ip} netns add ovpns || echo "ovpns already exists" ${ip} netns add ovpns || (test -e /run/netns/ovpns && echo "ovpns already exists")
''; '';
postShutdown = '' postShutdown = ''
${in-ns} ip link del ovpns-veth-b || echo "couldn't delete ovpns-veth-b" ${in-ns} ip link del ovpns-veth-b || echo "couldn't delete ovpns-veth-b"

View File

@@ -24,7 +24,7 @@ lib.mkIf false
# services.calibre-web.options.calibreLibrary = svc-dir; # services.calibre-web.options.calibreLibrary = svc-dir;
services.nginx.virtualHosts."calibre.uninsane.org" = { services.nginx.virtualHosts."calibre.uninsane.org" = {
addSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://${ip}:${builtins.toString port}"; proxyPass = "http://${ip}:${builtins.toString port}";

View File

@@ -24,50 +24,57 @@
# that is NOT the case when the STUN server and client A are on the same LAN # that is NOT the case when the STUN server and client A are on the same LAN
# even if client A contacts the STUN server via its WAN address with port reflection enabled. # even if client A contacts the STUN server via its WAN address with port reflection enabled.
# hence, there's no obvious way to put the STUN server on the same LAN as either client and expect the rest to work. # hence, there's no obvious way to put the STUN server on the same LAN as either client and expect the rest to work.
# - there an old version which *half worked*, which is:
# - run the turn server in the root namespace.
# - bind the turn server to the veth connecting it to the VPN namespace (so it sends outgoing traffic to the right place).
# - NAT the turn port range from VPN into root namespace (so it receives incomming traffic).
# - this approach would fail the prosody conversations.im check, but i didn't notice *obvious* call routing errors.
{ lib, ... }: { lib, ... }:
let let
# TODO: this range could be larger, but right now that's costly because each element is its own UPnP forward # TURN port range (inclusive).
# TURN port range (inclusive) # default coturn behavior is to use the upper quarter of all ports. i.e. 49152 - 65535.
turnPortLow = 49152; # i believe TURN allocations expire after either 5 or 10 minutes of inactivity.
turnPortHigh = 49167; turnPortLow = 49152; # 49152 = 0xc000
turnPortHigh = turnPortLow + 256;
turnPortRange = lib.range turnPortLow turnPortHigh; turnPortRange = lib.range turnPortLow turnPortHigh;
in in
{ {
sane.ports.ports = lib.mkMerge ([ # the port definitions are only needed if running in the root net namespace
{ # sane.ports.ports = lib.mkMerge ([
"3478" = { # {
# this is the "control" port. # "3478" = {
# i.e. no client data is forwarded through it, but it's where clients request tunnels. # # this is the "control" port.
protocol = [ "tcp" "udp" ]; # # i.e. no client data is forwarded through it, but it's where clients request tunnels.
# visibleTo.lan = true; # protocol = [ "tcp" "udp" ];
# visibleTo.wan = true; # # visibleTo.lan = true;
visibleTo.ovpn = true; # # visibleTo.wan = true;
description = "colin-stun-turn"; # visibleTo.ovpn = true; # forward traffic from the VPN to the root NS
}; # description = "colin-stun-turn";
"5349" = { # };
# the other port 3478 also supports TLS/DTLS, but presumably clients wanting TLS will default 5349 # "5349" = {
protocol = [ "tcp" ]; # # the other port 3478 also supports TLS/DTLS, but presumably clients wanting TLS will default 5349
# visibleTo.lan = true; # protocol = [ "tcp" ];
# visibleTo.wan = true; # # visibleTo.lan = true;
visibleTo.ovpn = true; # # visibleTo.wan = true;
description = "colin-stun-turn-over-tls"; # visibleTo.ovpn = true;
}; # description = "colin-stun-turn-over-tls";
} # };
] ++ (builtins.map # }
(port: { # ] ++ (builtins.map
"${builtins.toString port}" = let # (port: {
count = port - turnPortLow + 1; # "${builtins.toString port}" = let
numPorts = turnPortHigh - turnPortLow + 1; # count = port - turnPortLow + 1;
in { # numPorts = turnPortHigh - turnPortLow + 1;
protocol = [ "tcp" "udp" ]; # in {
# visibleTo.lan = true; # protocol = [ "tcp" "udp" ];
# visibleTo.wan = true; # # visibleTo.lan = true;
visibleTo.ovpn = true; # # visibleTo.wan = true;
description = "colin-turn-${builtins.toString count}-of-${builtins.toString numPorts}"; # visibleTo.ovpn = true;
}; # description = "colin-turn-${builtins.toString count}-of-${builtins.toString numPorts}";
}) # };
turnPortRange # })
)); # turnPortRange
# ));
services.nginx.virtualHosts."turn.uninsane.org" = { services.nginx.virtualHosts."turn.uninsane.org" = {
# allow ACME to procure a cert via nginx for this domain # allow ACME to procure a cert via nginx for this domain
@@ -113,12 +120,15 @@ in
"verbose" "verbose"
# "Verbose" #< even MORE verbosity than "verbose" # "Verbose" #< even MORE verbosity than "verbose"
# "no-multicast-peers" # disables sending to IPv4 broadcast addresses (e.g. 224.0.0.0/3) # "no-multicast-peers" # disables sending to IPv4 broadcast addresses (e.g. 224.0.0.0/3)
"listening-ip=10.0.1.5" # "listening-ip=10.0.1.5" "external-ip=185.157.162.178" #< 2024/04/25: works, if running in root namespace
"listening-ip=185.157.162.178" "external-ip=185.157.162.178"
# old attempts:
# "external-ip=185.157.162.178/10.0.1.5" # "external-ip=185.157.162.178/10.0.1.5"
"external-ip=185.157.162.178"
# "listening-ip=10.78.79.51" # can be specified multiple times; omit for * # "listening-ip=10.78.79.51" # can be specified multiple times; omit for *
# "external-ip=97.113.128.229/10.78.79.51" # "external-ip=97.113.128.229/10.78.79.51"
# "external-ip=97.113.128.229" # "external-ip=97.113.128.229"
# "mobility" # "mobility with ICE (MICE) specs support" (?) # "mobility" # "mobility with ICE (MICE) specs support" (?)
]; ];
systemd.services.coturn.serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
} }

View File

@@ -1,6 +1,22 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.pyln-client ])" #!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.pyln-client ])"
"""
clightning-sane: helper to perform common Lightning node admin operations:
- view channel balances
- rebalance channels
COMMON OPERATIONS:
- view channel balances: `clightning-sane status`
- rebalance channels to improve routability (without paying any fees): `clightning-sane autobalance`
FULL OPERATION:
- `clightning-sane status --full`
- `P$`: represents how many msats i've captured in fees from this channel.
- `COST`: rough measure of how much it's "costing" me to let my channel partner hold funds on his side of the channel.
this is based on the notion that i only capture fees from outbound transactions, and so the channel partner holding all liquidity means i can't capture fees on that liquidity.
"""
# pyln-client docs: <https://github.com/ElementsProject/lightning/tree/master/contrib/pyln-client> # pyln-client docs: <https://github.com/ElementsProject/lightning/tree/master/contrib/pyln-client>
# terminology: # terminology:
# - "scid": "Short Channel ID", e.g. 123456x7890x0 # - "scid": "Short Channel ID", e.g. 123456x7890x0
@@ -726,7 +742,7 @@ def main():
logging.basicConfig() logging.basicConfig()
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
parser = argparse.ArgumentParser(description="rebalance lightning channel balances") parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--verbose", action="store_true", help="more logging") parser.add_argument("--verbose", action="store_true", help="more logging")
parser.add_argument("--min-msat", default="999", help="min transaction size") parser.add_argument("--min-msat", default="999", help="min transaction size")
parser.add_argument("--max-msat", default="1000000", help="max transaction size") parser.add_argument("--max-msat", default="1000000", help="max transaction size")

View File

@@ -2,14 +2,14 @@
{ {
imports = [ imports = [
./nfs.nix ./nfs.nix
./sftpgo.nix ./sftpgo
]; ];
users.groups.export = {}; users.groups.export = {};
fileSystems."/var/export/media" = { fileSystems."/var/export/media" = {
# everything in here could be considered publicly readable (based on the viewer's legal jurisdiction) # everything in here could be considered publicly readable (based on the viewer's legal jurisdiction)
device = "/var/lib/uninsane/media"; device = "/var/media";
options = [ "rbind" ]; options = [ "rbind" ];
}; };
# fileSystems."/var/export/playground" = { # fileSystems."/var/export/playground" = {

View File

@@ -26,7 +26,7 @@
description = "NFS server portmapper"; description = "NFS server portmapper";
}; };
sane.ports.ports."2049" = { sane.ports.ports."2049" = {
protocol = [ "tcp" ]; protocol = [ "tcp" "udp" ];
visibleTo.lan = true; visibleTo.lan = true;
description = "NFS server"; description = "NFS server";
}; };
@@ -51,6 +51,23 @@
services.nfs.server.mountdPort = 4002; services.nfs.server.mountdPort = 4002;
services.nfs.server.statdPort = 4000; services.nfs.server.statdPort = 4000;
services.nfs.extraConfig = ''
[nfsd]
# XXX: NFS over UDP REQUIRES SPECIAL CONFIG TO AVOID DATA LOSS.
# see `man 5 nfs`: "Using NFS over UDP on high-speed links".
# it's actually just a general property of UDP over IPv4 (IPv6 fixes it).
# both the client and the server should configure a shorter-than-default IPv4 fragment reassembly window to mitigate.
# OTOH, tunneling NFS over Wireguard also bypasses this weakness, because a mis-assembled packet would not have a valid signature.
udp=y
[exports]
# all export paths are relative to rootdir.
# for NFSv4, the export with fsid=0 behaves as `/` publicly,
# but NFSv3 implements no such feature.
# using `rootdir` instead of relying on `fsid=0` allows consistent export paths regardless of NFS proto version
rootdir=/var/export
'';
# format: # format:
# fspoint visibility(options) # fspoint visibility(options)
# options: # options:
@@ -85,13 +102,20 @@
in "${export} 10.78.79.0/22(${lib.concatStringsSep "," lanOpts}) 10.0.10.0/24(${lib.concatStringsSep "," vpnOpts})"; in "${export} 10.78.79.0/22(${lib.concatStringsSep "," lanOpts}) 10.0.10.0/24(${lib.concatStringsSep "," vpnOpts})";
in lib.concatStringsSep "\n" [ in lib.concatStringsSep "\n" [
(fmtExport { (fmtExport {
export = "/var/export"; export = "/";
baseOpts = [ "crossmnt" "fsid=root" ]; baseOpts = [ "crossmnt" "fsid=root" ];
extraLanOpts = [ "ro" ]; extraLanOpts = [ "ro" ];
extraVpnOpts = [ "rw" "no_root_squash" ]; extraVpnOpts = [ "rw" "no_root_squash" ];
}) })
(fmtExport { (fmtExport {
export = "/var/export/playground"; # provide /media as an explicit export. NFSv4 can transparently mount a subdir of an export, but NFSv3 can only mount paths which are exports.
export = "/media";
baseOpts = [ "crossmnt" ]; # TODO: is crossmnt needed here?
extraLanOpts = [ "ro" ];
extraVpnOpts = [ "rw" "no_root_squash" ];
})
(fmtExport {
export = "/playground";
baseOpts = [ baseOpts = [
"mountpoint" "mountpoint"
"all_squash" "all_squash"

View File

@@ -1,186 +0,0 @@
# docs:
# - <https://github.com/drakkan/sftpgo>
# - config options: <https://github.com/drakkan/sftpgo/blob/main/docs/full-configuration.md>
# - config defaults: <https://github.com/drakkan/sftpgo/blob/main/sftpgo.json>
# - nixos options: <repo:nixos/nixpkgs:nixos/modules/services/web-apps/sftpgo.nix>
# - nixos example: <repo:nixos/nixpkgs:nixos/tests/sftpgo.nix>
#
# sftpgo is a FTP server that also supports WebDAV, SFTP, and web clients.
#
# TODO: change umask so sftpgo-created files default to 644.
# - it does indeed appear that the 600 is not something sftpgo is explicitly doing.
{ config, lib, pkgs, sane-lib, ... }:
let
# user permissions:
# - see <repo:drakkan/sftpgo:internal/dataprovider/user.go>
# - "*" = grant all permissions
# - read-only perms:
# - "list" = list files and directories
# - "download"
# - rw perms:
# - "upload"
# - "overwrite" = allow uploads to replace existing files
# - "delete" = delete files and directories
# - "delete_files"
# - "delete_dirs"
# - "rename" = rename files and directories
# - "rename_files"
# - "rename_dirs"
# - "create_dirs"
# - "create_symlinks"
# - "chmod"
# - "chown"
# - "chtimes" = change atime/mtime (access and modification times)
#
# home_dir:
# - it seems (empirically) that a user can't cd above their home directory.
# though i don't have a reference for that in the docs.
authResponseSuccess = {
status = 1;
username = "anonymous";
expiration_date = 0;
home_dir = "/var/export";
# uid/gid 0 means to inherit sftpgo uid.
# - i.e. users can't read files which Linux user `sftpgo` can't read
# - uploaded files belong to Linux user `sftpgo`
# other uid/gid values aren't possible for localfs backend, unless i let sftpgo use `sudo`.
uid = 0;
gid = 0;
# uid = 65534;
# gid = 65534;
max_sessions = 0;
# quota_*: 0 means to not use SFTP's quota system
quota_size = 0;
quota_files = 0;
permissions = {
"/" = [ "list" "download" ];
"/playground" = [
# read-only:
"list"
"download"
# write:
"upload"
"overwrite"
"delete"
"rename"
"create_dirs"
"create_symlinks"
# intentionally omitted:
# "chmod"
# "chown"
# "chtimes"
];
};
upload_bandwidth = 0;
download_bandwidth = 0;
filters = {
allowed_ip = [];
denied_ip = [];
};
public_keys = [];
# other fields:
# ? groups
# ? virtual_folders
};
authResponseFail = {
username = "";
};
authSuccessJson = pkgs.writeText "sftp-auth-success.json" (builtins.toJSON authResponseSuccess);
authFailJson = pkgs.writeText "sftp-auth-fail.json" (builtins.toJSON authResponseFail);
unwrappedAuthProgram = pkgs.static-nix-shell.mkBash {
pname = "sftpgo_external_auth_hook";
srcRoot = ./.;
pkgs = [ "coreutils" ];
};
authProgram = pkgs.writeShellScript "sftpgo-auth-hook" ''
${unwrappedAuthProgram}/bin/sftpgo_external_auth_hook ${authFailJson} ${authSuccessJson}
'';
in
{
# Client initiates a FTP "control connection" on port 21.
# - this handles the client -> server commands, and the server -> client status, but not the actual data
# - file data, directory listings, etc need to be transferred on an ephemeral "data port".
# - 50000-50100 is a common port range for this.
sane.ports.ports = {
"21" = {
protocol = [ "tcp" ];
visibleTo.lan = true;
description = "colin-FTP server";
};
} // (sane-lib.mapToAttrs
(port: {
name = builtins.toString port;
value = {
protocol = [ "tcp" ];
visibleTo.lan = true;
description = "colin-FTP server data port range";
};
})
(lib.range 50000 50100)
);
services.sftpgo = {
enable = true;
group = "export";
settings = {
ftpd = {
bindings = [
{
# binding this means any wireguard client can connect
address = "10.0.10.5";
port = 21;
debug = true;
}
{
# binding this means any LAN client can connect
address = "10.78.79.51";
port = 21;
debug = true;
}
];
# active mode is susceptible to "bounce attacks", without much benefit over passive mode
disable_active_mode = true;
hash_support = true;
passive_port_range = {
start = 50000;
end = 50100;
};
banner = ''
Welcome, friends, to Colin's read-only FTP server! Also available via NFS on the same host.
Username: "anonymous"
Password: "anonymous"
CONFIGURE YOUR CLIENT FOR "PASSIVE" mode, e.g. `ftp --passive uninsane.org`
Please let me know if anything's broken or not as it should be. Otherwise, browse and DL freely :)
'';
};
data_provider = {
driver = "memory";
external_auth_hook = "${authProgram}";
# track_quota:
# - 0: disable quota tracking
# - 1: quota is updated on every upload/delete, even if user has no quota restriction
# - 2: quota is updated on every upload/delete, but only if user/folder has a quota restriction (default, i think)
# track_quota = 2;
};
};
};
users.users.sftpgo.extraGroups = [ "export" ];
systemd.services.sftpgo = {
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig = {
ReadOnlyPaths = [ "/var/export" ];
ReadWritePaths = [ "/var/export/playground" ];
Restart = "always";
RestartSec = "20s";
};
};
}

View File

@@ -0,0 +1,167 @@
# docs:
# - <https://github.com/drakkan/sftpgo>
# - config options: <https://github.com/drakkan/sftpgo/blob/main/docs/full-configuration.md>
# - config defaults: <https://github.com/drakkan/sftpgo/blob/main/sftpgo.json>
# - nixos options: <repo:nixos/nixpkgs:nixos/modules/services/web-apps/sftpgo.nix>
# - nixos example: <repo:nixos/nixpkgs:nixos/tests/sftpgo.nix>
#
# sftpgo is a FTP server that also supports WebDAV, SFTP, and web clients.
{ config, lib, pkgs, sane-lib, ... }:
let
external_auth_hook = pkgs.static-nix-shell.mkPython3Bin {
pname = "external_auth_hook";
srcRoot = ./.;
};
# Client initiates a FTP "control connection" on port 21.
# - this handles the client -> server commands, and the server -> client status, but not the actual data
# - file data, directory listings, etc need to be transferred on an ephemeral "data port".
# - 50000-50100 is a common port range for this.
# 50000 is used by soulseek.
passiveStart = 50050;
passiveEnd = 50070;
in
{
sane.ports.ports = {
"21" = {
protocol = [ "tcp" ];
visibleTo.lan = true;
# visibleTo.wan = true;
description = "colin-FTP server";
};
"990" = {
protocol = [ "tcp" ];
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-FTPS server";
};
} // (sane-lib.mapToAttrs
(port: {
name = builtins.toString port;
value = {
protocol = [ "tcp" ];
visibleTo.lan = true;
visibleTo.wan = true;
description = "colin-FTP server data port range";
};
})
(lib.range passiveStart passiveEnd)
);
# use nginx/acme to produce a cert for FTPS
services.nginx.virtualHosts."ftp.uninsane.org" = {
addSSL = true;
enableACME = true;
};
sane.dns.zones."uninsane.org".inet.CNAME."ftp" = "native";
services.sftpgo = {
enable = true;
group = "export";
package = lib.warnIf (lib.versionOlder "2.5.6" pkgs.sftpgo.version) "sftpgo update: safe to use nixpkgs' sftpgo but keep my own `patches`" pkgs.buildGoModule {
inherit (pkgs.sftpgo) name ldflags nativeBuildInputs doCheck subPackages postInstall passthru meta;
version = "2.5.6-unstable-2024-04-18";
src = pkgs.fetchFromGitHub {
# need to use > 2.5.6 for sftpgo_safe_fileinfo.patch to apply
owner = "drakkan";
repo = "sftpgo";
rev = "950cf67e4c03a12c7e439802cabbb0b42d4ee5f5";
hash = "sha256-UfiFd9NK3DdZ1J+FPGZrM7r2mo9xlKi0dsSlLEinYXM=";
};
vendorHash = "sha256-n1/9A2em3BCtFX+132ualh4NQwkwewMxYIMOphJEamg=";
patches = (pkgs.sftpgo.patches or []) ++ [
# fix for compatibility with kodi:
# ftp LIST operation returns entries over-the-wire like:
# - dgrwxrwxr-x 1 ftp ftp 9 Apr 9 15:05 Videos
# however not all clients understand all mode bits (like that `g`, indicating SGID / group sticky bit).
# instead, only send mode bits which are well-understood.
# the full set of bits, from which i filter, is found here: <https://pkg.go.dev/io/fs#FileMode>
./safe_fileinfo.patch
];
};
settings = {
ftpd = {
bindings = [
{
# binding this means any wireguard client can connect
address = "10.0.10.5";
port = 21;
debug = true;
}
{
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
address = "10.78.79.51";
port = 21;
debug = true;
}
{
# binding this means any wireguard client can connect
address = "10.0.10.5";
port = 990;
debug = true;
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
}
{
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
address = "10.78.79.51";
port = 990;
debug = true;
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
}
];
# active mode is susceptible to "bounce attacks", without much benefit over passive mode
disable_active_mode = true;
hash_support = true;
passive_port_range = {
start = passiveStart;
end = passiveEnd;
};
certificate_file = "/var/lib/acme/ftp.uninsane.org/full.pem";
certificate_key_file = "/var/lib/acme/ftp.uninsane.org/key.pem";
banner = ''
Welcome, friends, to Colin's FTP server! Also available via NFS on the same host, but LAN-only.
Read-only access (LAN-restricted):
Username: "anonymous"
Password: "anonymous"
CONFIGURE YOUR CLIENT FOR "PASSIVE" MODE, e.g. `ftp --passive ftp.uninsane.org`.
Please let me know if anything's broken or not as it should be. Otherwise, browse and transfer freely :)
'';
};
data_provider = {
driver = "memory";
external_auth_hook = "${external_auth_hook}/bin/external_auth_hook";
# track_quota:
# - 0: disable quota tracking
# - 1: quota is updated on every upload/delete, even if user has no quota restriction
# - 2: quota is updated on every upload/delete, but only if user/folder has a quota restriction (default, i think)
# track_quota = 2;
};
};
};
users.users.sftpgo.extraGroups = [
"export"
"media"
"nginx" # to access certs
];
systemd.services.sftpgo = {
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig = {
ReadWritePaths = [ "/var/export" ];
Restart = "always";
RestartSec = "20s";
UMask = lib.mkForce "0002";
};
};
}

View File

@@ -0,0 +1,157 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])"
# vim: set filetype=python :
#
# available environment variables:
# - SFTPGO_AUTHD_USERNAME
# - SFTPGO_AUTHD_USER
# - SFTPGO_AUTHD_IP
# - SFTPGO_AUTHD_PROTOCOL = { "DAV", "FTP", "HTTP", "SSH" }
# - SFTPGO_AUTHD_PASSWORD
# - SFTPGO_AUTHD_PUBLIC_KEY
# - SFTPGO_AUTHD_KEYBOARD_INTERACTIVE
# - SFTPGO_AUTHD_TLS_CERT
#
# user permissions:
# - see <repo:drakkan/sftpgo:internal/dataprovider/user.go>
# - "*" = grant all permissions
# - read-only perms:
# - "list" = list files and directories
# - "download"
# - rw perms:
# - "upload"
# - "overwrite" = allow uploads to replace existing files
# - "delete" = delete files and directories
# - "delete_files"
# - "delete_dirs"
# - "rename" = rename files and directories
# - "rename_files"
# - "rename_dirs"
# - "create_dirs"
# - "create_symlinks"
# - "chmod"
# - "chown"
# - "chtimes" = change atime/mtime (access and modification times)
#
# home_dir:
# - it seems (empirically) that a user can't cd above their home directory.
# though i don't have a reference for that in the docs.
import crypt
import json
import os
from hmac import compare_digest
authFail = dict(username="")
PERM_RO = [ "list", "download" ]
PERM_RW = [
# read-only:
"list",
"download",
# write:
"upload",
"overwrite",
"delete",
"rename",
"create_dirs",
"create_symlinks",
# intentionally omitted:
# "chmod",
# "chown",
# "chtimes",
]
TRUSTED_CREDS = [
# /etc/shadow style creds.
# mkpasswd -m sha-512
# $<method>$<salt>$<hash>
"$6$Zq3c2u4ghUH4S6EP$pOuRt13sEKfX31OqPbbd1LuhS21C9MICMc94iRdTAgdAcJ9h95gQH/6Jf6Ie4Obb0oxQtojRJ1Pd/9QHOlFMW." #< m. rocket boy
]
def mkAuthOk(username: str, permissions: dict[str, list[str]]) -> dict:
return dict(
status = 1,
username = username,
expiration_date = 0,
home_dir = "/var/export",
# uid/gid 0 means to inherit sftpgo uid.
# - i.e. users can't read files which Linux user `sftpgo` can't read
# - uploaded files belong to Linux user `sftpgo`
# other uid/gid values aren't possible for localfs backend, unless i let sftpgo use `sudo`.
uid = 0,
gid = 0,
# uid = 65534,
# gid = 65534,
max_sessions = 0,
# quota_*: 0 means to not use SFTP's quota system
quota_size = 0,
quota_files = 0,
permissions = permissions,
upload_bandwidth = 0,
download_bandwidth = 0,
filters = dict(
allowed_ip = [],
denied_ip = [],
),
public_keys = [],
# other fields:
# ? groups
# ? virtual_folders
)
def isLan(ip: str) -> bool:
return ip.startswith("10.78.76.") \
or ip.startswith("10.78.77.") \
or ip.startswith("10.78.78.") \
or ip.startswith("10.78.79.")
def isWireguard(ip: str) -> bool:
return ip.startswith("10.0.10.")
def isTrustedCred(password: str) -> bool:
for cred in TRUSTED_CREDS:
_, method, salt, hash_ = cred.split("$")
# assert method == "6", f"unrecognized crypt entry: {cred}"
if crypt.crypt(password, f"${method}${salt}") == cred:
return True
return False
def getAuthResponse(ip: str, username: str, password: str) -> dict:
"""
return a sftpgo auth response either denying the user or approving them
with a set of permissions.
"""
if isTrustedCred(password) and username != "colin":
# allow r/w access from those with a special token
return mkAuthOk(username, permissions = {
"/": PERM_RW,
"/playground": PERM_RW,
})
if isWireguard(ip):
# allow any user from wireguard
return mkAuthOk(username, permissions = {
"/": PERM_RW,
"/playground": PERM_RW,
})
if isLan(ip):
if username == "anonymous":
# allow anonymous users on the LAN
return mkAuthOk("anonymous", permissions = {
"/": PERM_RO,
"/playground": PERM_RW,
})
return authFail
def main():
ip = os.environ.get("SFTPGO_AUTHD_IP", "")
username = os.environ.get("SFTPGO_AUTHD_USERNAME", "")
password = os.environ.get("SFTPGO_AUTHD_PASSWORD", "")
resp = getAuthResponse(ip, username, password)
print(json.dumps(resp))
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,32 @@
diff --git a/internal/ftpd/handler.go b/internal/ftpd/handler.go
index 036c3977..33211261 100644
--- a/internal/ftpd/handler.go
+++ b/internal/ftpd/handler.go
@@ -169,7 +169,7 @@ func (c *Connection) Stat(name string) (os.FileInfo, error) {
}
return nil, err
}
- return fi, nil
+ return vfs.NewFileInfo(name, fi.IsDir(), fi.Size(), fi.ModTime(), false), nil
}
// Name returns the name of this connection
@@ -315,7 +315,17 @@ func (c *Connection) ReadDir(name string) (ftpserver.DirLister, error) {
}, nil
}
- return c.ListDir(name)
+ lister, err := c.ListDir(name)
+ if err != nil {
+ return nil, err
+ }
+ return &patternDirLister{
+ DirLister: lister,
+ pattern: "*",
+ lastCommand: c.clientContext.GetLastCommand(),
+ dirName: name,
+ connectionPath: c.clientContext.Path(),
+ }, nil
}
// GetHandle implements ClientDriverExtentionFileTransfer

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils
# vim: set filetype=bash :
#
# available environment variables:
# - SFTPGO_AUTHD_USERNAME
# - SFTPGO_AUTHD_USER
# - SFTPGO_AUTHD_IP
# - SFTPGO_AUTHD_PROTOCOL = { "DAV", "FTP", "HTTP", "SSH" }
# - SFTPGO_AUTHD_PASSWORD
# - SFTPGO_AUTHD_PUBLIC_KEY
# - SFTPGO_AUTHD_KEYBOARD_INTERACTIVE
# - SFTPGO_AUTHD_TLS_CERT
#
#
# call with <script_name> /path/to/fail/response.json /path/to/success/response.json
if [ "$SFTPGO_AUTHD_USERNAME" = "anonymous" ]; then
cat "$2"
else
cat "$1"
fi

View File

@@ -20,7 +20,7 @@
--ignore-panel=HOSTS \ --ignore-panel=HOSTS \
--ws-url=wss://sink.uninsane.org:443/ws \ --ws-url=wss://sink.uninsane.org:443/ws \
--port=7890 \ --port=7890 \
-o /var/lib/uninsane/sink/index.html -o /var/lib/goaccess/index.html
''; '';
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Type = "simple"; Type = "simple";
@@ -28,17 +28,19 @@
RestartSec = "10s"; RestartSec = "10s";
# hardening # hardening
WorkingDirectory = "/tmp"; # TODO: run as `goaccess` user and add `goaccess` user to group `nginx`.
NoNewPrivileges = true; NoNewPrivileges = true;
PrivateDevices = "yes";
PrivateTmp = true; PrivateTmp = true;
ProtectHome = "read-only"; ProtectHome = "read-only";
ProtectSystem = "strict";
SystemCallFilter = "~@clock @cpu-emulation @debug @keyring @memlock @module @mount @obsolete @privileged @reboot @resources @setuid @swap @raw-io";
ReadOnlyPaths = "/";
ReadWritePaths = [ "/proc/self" "/var/lib/uninsane/sink" ];
PrivateDevices = "yes";
ProtectKernelModules = "yes"; ProtectKernelModules = "yes";
ProtectKernelTunables = "yes"; ProtectKernelTunables = "yes";
ProtectSystem = "strict";
ReadOnlyPaths = [ "/var/log/nginx" ];
ReadWritePaths = [ "/proc/self" "/var/lib/goaccess" ];
StateDirectory = "goaccess";
SystemCallFilter = "~@clock @cpu-emulation @debug @keyring @memlock @module @mount @obsolete @privileged @reboot @resources @setuid @swap @raw-io";
WorkingDirectory = "/var/lib/goaccess";
}; };
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
@@ -49,7 +51,7 @@
addSSL = true; addSSL = true;
enableACME = true; enableACME = true;
# inherit kTLS; # inherit kTLS;
root = "/var/lib/uninsane/sink"; root = "/var/lib/goaccess";
locations."/ws" = { locations."/ws" = {
proxyPass = "http://127.0.0.1:7890"; proxyPass = "http://127.0.0.1:7890";

View File

@@ -1,4 +1,4 @@
{ ... }: { lib, pkgs, ... }:
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
@@ -12,6 +12,8 @@
systemd.services.jackett.serviceConfig = { systemd.services.jackett.serviceConfig = {
# run this behind the OVPN static VPN # run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns"; NetworkNamespacePath = "/run/netns/ovpns";
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
# patch jackett to listen on the public interfaces # patch jackett to listen on the public interfaces
# ExecStart = lib.mkForce "${pkgs.jackett}/bin/Jackett --NoUpdates --DataFolder /var/lib/jackett/.config/Jackett --ListenPublic"; # ExecStart = lib.mkForce "${pkgs.jackett}/bin/Jackett --NoUpdates --DataFolder /var/lib/jackett/.config/Jackett --ListenPublic";
}; };

View File

@@ -75,7 +75,7 @@
# Jellyfin multimedia server # Jellyfin multimedia server
# this is mostly taken from the official jellfin.org docs # this is mostly taken from the official jellfin.org docs
services.nginx.virtualHosts."jelly.uninsane.org" = { services.nginx.virtualHosts."jelly.uninsane.org" = {
addSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
# inherit kTLS; # inherit kTLS;

View File

@@ -12,7 +12,7 @@ in
services.komga.port = 11319; # chosen at random services.komga.port = 11319; # chosen at random
services.nginx.virtualHosts."komga.uninsane.org" = { services.nginx.virtualHosts."komga.uninsane.org" = {
addSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString port}"; proxyPass = "http://127.0.0.1:${builtins.toString port}";

View File

@@ -10,16 +10,21 @@ let
uiPort = 1234; # default ui port is 1234 uiPort = 1234; # default ui port is 1234
backendPort = 8536; # default backend port is 8536 backendPort = 8536; # default backend port is 8536
#^ i guess the "backend" port is used for federation? #^ i guess the "backend" port is used for federation?
pict-rs = pkgs.pict-rs.overrideAttrs (upstream: { pict-rs = pkgs.pict-rs;
# as of v 0.4.2, all non-GIF video is forcibly transcoded. # pict-rs = pkgs.pict-rs.overrideAttrs (upstream: {
# that breaks lemmy, because of the request latency. # # as of v0.4.2, all non-GIF video is forcibly transcoded.
# and it eats up hella CPU. # # that breaks lemmy, because of the request latency.
# pict-rs is iffy around video altogether: mp4 seems the best supported. # # and it eats up hella CPU.
postPatch = (upstream.postPatch or "") + '' # # pict-rs is iffy around video altogether: mp4 seems the best supported.
substituteInPlace src/validate.rs \ # # XXX: this patch no longer applies after 0.5.10 -> 0.5.11 update.
--replace 'if transcode_options.needs_reencode() {' 'if false {' # # git log is hard to parse, but *suggests* that video is natively supported
''; # # better than in the 0.4.2 days, e.g. 5fd59fc5b42d31559120dc28bfef4e5002fb509e
}); # # "Change commandline flag to allow disabling video, since it is enabled by default"
# postPatch = (upstream.postPatch or "") + ''
# substituteInPlace src/validate.rs \
# --replace 'if transcode_options.needs_reencode() {' 'if false {'
# '';
# });
in { in {
services.lemmy = { services.lemmy = {
enable = true; enable = true;

View File

@@ -1,5 +1,6 @@
{ lib, ... }: { lib, ... }:
lib.mkIf false #< i don't actively use navidrome
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "navidrome"; group = "navidrome"; path = "/var/lib/navidrome"; method = "bind"; } { user = "navidrome"; group = "navidrome"; path = "/var/lib/navidrome"; method = "bind"; }
@@ -9,7 +10,7 @@
# docs: https://www.navidrome.org/docs/usage/configuration-options/ # docs: https://www.navidrome.org/docs/usage/configuration-options/
Address = "127.0.0.1"; Address = "127.0.0.1";
Port = 4533; Port = 4533;
MusicFolder = "/var/lib/uninsane/media/Music"; MusicFolder = "/var/media/Music";
CovertArtPriority = "*.jpg, *.JPG, *.png, *.PNG, embedded"; CovertArtPriority = "*.jpg, *.JPG, *.png, *.PNG, embedded";
AutoImportPlaylists = false; AutoImportPlaylists = false;
ScanSchedule = "@every 1h"; ScanSchedule = "@every 1h";

View File

@@ -55,8 +55,8 @@ in
# web blog/personal site # web blog/personal site
# alternative way to link stuff into the share: # alternative way to link stuff into the share:
# sane.fs."/var/lib/uninsane/share/Ubunchu".mount.bind = "/var/lib/uninsane/media/Books/Visual/HiroshiSeo/Ubunchu"; # sane.fs."/var/www/sites/uninsane.org/share/Ubunchu".mount.bind = "/var/media/Books/Visual/HiroshiSeo/Ubunchu";
# sane.fs."/var/lib/uninsane/media/Books/Visual/HiroshiSeo/Ubunchu".dir = {}; # sane.fs."/var/media/Books/Visual/HiroshiSeo/Ubunchu".dir = {};
services.nginx.virtualHosts."uninsane.org" = publog { services.nginx.virtualHosts."uninsane.org" = publog {
# a lot of places hardcode https://uninsane.org, # a lot of places hardcode https://uninsane.org,
# and then when we mix http + non-https, we get CORS violations # and then when we mix http + non-https, we get CORS violations
@@ -89,6 +89,16 @@ in
disable_symlinks on; disable_symlinks on;
''; '';
}; };
locations."/share/Milkbags/" = {
alias = "/var/media/Videos/Milkbags/";
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 =

View File

@@ -25,7 +25,7 @@ in
config :pleroma, Pleroma.Web.Endpoint, config :pleroma, Pleroma.Web.Endpoint,
url: [host: "fed.uninsane.org", scheme: "https", port: 443], url: [host: "fed.uninsane.org", scheme: "https", port: 443],
http: [ip: {127, 0, 0, 1}, port: 4000] http: [ip: {127, 0, 0, 1}, port: 4040]
# secret_key_base: "{secrets.pleroma.secret_key_base}", # secret_key_base: "{secrets.pleroma.secret_key_base}",
# signing_salt: "{secrets.pleroma.signing_salt}" # signing_salt: "{secrets.pleroma.signing_salt}"
@@ -167,7 +167,7 @@ in
enableACME = true; enableACME = true;
# inherit kTLS; # inherit kTLS;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:4000"; proxyPass = "http://127.0.0.1:4040";
recommendedProxySettings = true; recommendedProxySettings = true;
# documented: https://git.pleroma.social/pleroma/pleroma/-/blob/develop/installation/pleroma.nginx # documented: https://git.pleroma.social/pleroma/pleroma/-/blob/develop/installation/pleroma.nginx
extraConfig = '' extraConfig = ''

View File

@@ -3,10 +3,17 @@
# #
# config precedence (higher precedence overrules lower precedence): # config precedence (higher precedence overrules lower precedence):
# - Default Values < Environment Variables < YAML Configuraiton File < Command Line Arguments # - Default Values < Environment Variables < YAML Configuraiton File < Command Line Arguments
{ config, lib, ... }: #
# debugging:
# - soulseek is just *flaky*. if you see e.g. DNS errors, even though you can't replicate them via `dig` or `getent ahostsv4`, just give it 10 minutes to work out:
# - "Soulseek.AddressException: Failed to resolve address 'vps.slsknet.org': Resource temporarily unavailable"
{ config, lib, pkgs, ... }:
# TODO: re-enable once i'm satisfied this isn't escaping the net sandbox
lib.mkIf false
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "slskd"; group = "slskd"; path = "/var/lib/slskd"; method = "bind"; } { user = "slskd"; group = "media"; path = "/var/lib/slskd"; method = "bind"; }
]; ];
sops.secrets."slskd_env" = { sops.secrets."slskd_env" = {
owner = config.users.users.slskd.name; owner = config.users.users.slskd.name;
@@ -15,7 +22,7 @@
users.users.slskd.extraGroups = [ "media" ]; users.users.slskd.extraGroups = [ "media" ];
sane.ports.ports."50000" = { sane.ports.ports."50300" = {
protocol = [ "tcp" ]; protocol = [ "tcp" ];
# not visible to WAN: i run this in a separate netns # not visible to WAN: i run this in a separate netns
visibleTo.ovpn = true; visibleTo.ovpn = true;
@@ -28,12 +35,14 @@
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://10.0.1.6:5001"; proxyPass = "http://10.0.1.6:5030";
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };
services.slskd.enable = true; services.slskd.enable = true;
services.slskd.domain = null; # i'll manage nginx for it
services.slskd.group = "media";
# env file, for auth (SLSKD_SLSK_PASSWORD, SLSKD_SLSK_USERNAME) # env file, for auth (SLSKD_SLSK_PASSWORD, SLSKD_SLSK_USERNAME)
services.slskd.environmentFile = config.sops.secrets.slskd_env.path; services.slskd.environmentFile = config.sops.secrets.slskd_env.path;
services.slskd.settings = { services.slskd.settings = {
@@ -44,13 +53,13 @@
# [Alias]/path/on/disk # [Alias]/path/on/disk
# NOTE: Music library is quick to scan; videos take a solid 10min to scan. # NOTE: Music library is quick to scan; videos take a solid 10min to scan.
# TODO: re-enable the other libraries # TODO: re-enable the other libraries
# "[Audioooks]/var/lib/uninsane/media/Books/Audiobooks" # "[Audioooks]/var/media/Books/Audiobooks"
# "[Books]/var/lib/uninsane/media/Books/Books" # "[Books]/var/media/Books/Books"
# "[Manga]/var/lib/uninsane/media/Books/Visual" # "[Manga]/var/media/Books/Visual"
# "[games]/var/lib/uninsane/media/games" # "[games]/var/media/games"
"[Music]/var/lib/uninsane/media/Music" "[Music]/var/media/Music"
# "[Film]/var/lib/uninsane/media/Videos/Film" # "[Film]/var/media/Videos/Film"
# "[Shows]/var/lib/uninsane/media/Videos/Shows" # "[Shows]/var/media/Videos/Shows"
]; ];
# directories.downloads = "..." # TODO # directories.downloads = "..." # TODO
# directories.incomplete = "..." # TODO # directories.incomplete = "..." # TODO
@@ -62,13 +71,12 @@
# 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 = { systemd.services.slskd.serviceConfig = {
serviceConfig = { # run this behind the OVPN static VPN
# run this behind the OVPN static VPN NetworkNamespacePath = "/run/netns/ovpns";
NetworkNamespacePath = "/run/netns/ovpns"; ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
Restart = lib.mkForce "always"; # exits "success" when it fails to connect to soulseek server
RestartSec = "60s"; Restart = lib.mkForce "always"; # exits "success" when it fails to connect to soulseek server
Group = "media"; RestartSec = "60s";
};
}; };
} }

View File

@@ -22,6 +22,65 @@ let
--replace-fail 'set(TR_USER_AGENT_PREFIX "''${TR_SEMVER}")' 'set(TR_USER_AGENT_PREFIX "3.00")' --replace-fail 'set(TR_USER_AGENT_PREFIX "''${TR_SEMVER}")' 'set(TR_USER_AGENT_PREFIX "3.00")'
''; '';
}); });
download-dir = "/var/media/torrents";
torrent-done = pkgs.writeShellApplication {
name = "torrent-done";
runtimeInputs = with pkgs; [
acl
coreutils
findutils
rsync
util-linux
];
text = ''
destructive() {
if [ -n "''${TR_DRY_RUN-}" ]; then
echo "$*"
else
"$@"
fi
}
if [[ "$TR_TORRENT_DIR" =~ ^.*freeleech.*$ ]]; then
# freeleech torrents have no place in my permanent library
echo "freeleech: nothing to do"
exit 0
fi
if ! [[ "$TR_TORRENT_DIR" =~ ^${download-dir}/.*$ ]]; then
echo "unexpected torrent dir, aborting: $TR_TORRENT_DIR"
exit 0
fi
REL_DIR="''${TR_TORRENT_DIR#${download-dir}/}"
MEDIA_DIR="/var/media/$REL_DIR"
destructive mkdir -p "$(dirname "$MEDIA_DIR")"
destructive rsync -arv "$TR_TORRENT_DIR/" "$MEDIA_DIR/"
# make the media rwx by anyone in the group
destructive find "$MEDIA_DIR" -type d -exec setfacl --recursive --modify d:g::rwx,o::rx {} \;
destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \;
# if there's a single directory inside the media dir, then inline that
subdirs=("$MEDIA_DIR"/*)
if [ ''${#subdirs} -eq 1 ]; then
dirname="''${subdirs[0]}"
if [ -d "$dirname" ]; then
mv "$dirname"/* "$MEDIA_DIR/" && rmdir "$dirname"
fi
fi
# remove noisy files:
find "$MEDIA_DIR/" -type f \(\
-iname 'www.YTS.*.jpg' \
-o -iname 'WWW.YIFY*.COM.jpg' \
-o -iname 'YIFY*.com.txt' \
-o -iname 'YTS*.com.txt' \
\) -exec rm {} \;
# dedupe the whole media library.
# yeah, a bit excessive: move this to a cron job if that's problematic.
destructive hardlink /var/media --reflink=always --ignore-time --verbose
'';
};
in in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
@@ -46,8 +105,8 @@ in
# DOCUMENTATION/options list: <https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options> # DOCUMENTATION/options list: <https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options>
# message-level = 3; #< enable for debug logging. 0-3, default is 2. # message-level = 3; #< enable for debug logging. 0-3, default is 2.
# 0.0.0.0 => allow rpc from any host: we gate it via firewall and auth requirement # 10.0.1.6 => allow rpc only from the root servo ns. it'll tunnel things to the net, if need be.
rpc-bind-address = "0.0.0.0"; rpc-bind-address = "10.0.1.6";
#rpc-host-whitelist = "bt.uninsane.org"; #rpc-host-whitelist = "bt.uninsane.org";
#rpc-whitelist = "*.*.*.*"; #rpc-whitelist = "*.*.*.*";
rpc-authentication-required = true; rpc-authentication-required = true;
@@ -57,6 +116,10 @@ in
rpc-password = "{503fc8928344f495efb8e1f955111ca5c862ce0656SzQnQ5"; rpc-password = "{503fc8928344f495efb8e1f955111ca5c862ce0656SzQnQ5";
rpc-whitelist-enabled = false; rpc-whitelist-enabled = false;
# force behind ovpns in case the NetworkNamespace fails somehow
bind-address-ipv4 = "185.157.162.178";
port-forwarding-enabled = false;
# hopefully, make the downloads world-readable # hopefully, make the downloads world-readable
# umask = 0; #< default is 2: i.e. deny writes from world # umask = 0; #< default is 2: i.e. deny writes from world
@@ -72,11 +135,23 @@ in
# see: https://git.zknt.org/mirror/transmission/commit/cfce6e2e3a9b9d31a9dafedd0bdc8bf2cdb6e876?lang=bg-BG # see: https://git.zknt.org/mirror/transmission/commit/cfce6e2e3a9b9d31a9dafedd0bdc8bf2cdb6e876?lang=bg-BG
anti-brute-force-enabled = false; anti-brute-force-enabled = false;
download-dir = "/var/lib/uninsane/media"; inherit download-dir;
incomplete-dir = "/var/lib/uninsane/media/incomplete"; incomplete-dir = "${download-dir}/incomplete";
# transmission regularly fails to move stuff from the incomplete dir to the main one, so disable: # transmission regularly fails to move stuff from the incomplete dir to the main one, so disable:
# TODO: uncomment this line!
incomplete-dir-enabled = false; incomplete-dir-enabled = false;
# env vars available in script:
# - TR_APP_VERSION - Transmission's short version string, e.g. `4.0.0`
# - TR_TIME_LOCALTIME
# - TR_TORRENT_BYTES_DOWNLOADED - Number of bytes that were downloaded for this torrent
# - TR_TORRENT_DIR - Location of the downloaded data
# - TR_TORRENT_HASH - The torrent's info hash
# - TR_TORRENT_ID
# - TR_TORRENT_LABELS - A comma-delimited list of the torrent's labels
# - TR_TORRENT_NAME - Name of torrent (not filename)
# - TR_TORRENT_TRACKERS - A comma-delimited list of the torrent's trackers' announce URLs
script-torrent-done-enabled = true;
script-torrent-done-filename = "${torrent-done}/bin/torrent-done";
}; };
systemd.services.transmission.after = [ "wireguard-wg-ovpns.service" ]; systemd.services.transmission.after = [ "wireguard-wg-ovpns.service" ];
@@ -84,8 +159,11 @@ in
systemd.services.transmission.serviceConfig = { systemd.services.transmission.serviceConfig = {
# run this behind the OVPN static VPN # run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns"; NetworkNamespacePath = "/run/netns/ovpns";
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "30s"; RestartSec = "30s";
BindPaths = [ "/var/media" ]; #< so it can move completed torrents into the media library
}; };
# service to automatically backup torrents i add to transmission # service to automatically backup torrents i add to transmission

View File

@@ -2,19 +2,11 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
dyn-dns = config.sane.services.dyn-dns;
nativeAddrs = lib.mapAttrs (_name: builtins.head) config.sane.dns.zones."uninsane.org".inet.A; nativeAddrs = lib.mapAttrs (_name: builtins.head) config.sane.dns.zones."uninsane.org".inet.A;
bindOvpn = "10.0.1.5"; bindOvpn = "10.0.1.5";
in lib.mkMerge [ in
{ {
services.trust-dns.enable = true;
# don't bind to IPv6 until i explicitly test that stack
services.trust-dns.settings.listen_addrs_ipv6 = [];
services.trust-dns.quiet = true;
# FIXME(2023/11/26): services.trust-dns.debug doesn't log requests: use RUST_LOG=debug env for that.
# - see: <https://github.com/hickory-dns/hickory-dns/issues/2082>
# services.trust-dns.debug = true;
sane.ports.ports."53" = { sane.ports.ports."53" = {
protocol = [ "udp" "tcp" ]; protocol = [ "udp" "tcp" ];
visibleTo.lan = true; visibleTo.lan = true;
@@ -66,23 +58,6 @@ in lib.mkMerge [
services.trust-dns.settings.zones = [ "uninsane.org" ]; services.trust-dns.settings.zones = [ "uninsane.org" ];
# TODO: can i transform this into some sort of service group?
# have `systemctl restart trust-dns.service` restart all the individual services?
systemd.services.trust-dns.serviceConfig = {
DynamicUser = lib.mkForce false;
User = "trust-dns";
Group = "trust-dns";
wantedBy = lib.mkForce [];
};
systemd.services.trust-dns.enable = false;
users.groups.trust-dns = {};
users.users.trust-dns = {
group = "trust-dns";
isSystemUser = true;
};
# sane.services.dyn-dns.restartOnChange = [ "trust-dns.service" ];
networking.nat.enable = true; networking.nat.enable = true;
networking.nat.extraCommands = '' networking.nat.extraCommands = ''
@@ -107,98 +82,73 @@ in lib.mkMerge [
visibleTo.lan = true; visibleTo.lan = true;
description = "colin-redirected-dns-for-lan-namespace"; description = "colin-redirected-dns-for-lan-namespace";
}; };
}
{
systemd.services =
let
sed = "${pkgs.gnused}/bin/sed";
stateDir = "/var/lib/trust-dns";
zoneTemplate = pkgs.writeText "uninsane.org.zone.in" config.sane.dns.zones."uninsane.org".rendered;
zoneDirFor = flavor: "${stateDir}/${flavor}";
zoneFor = flavor: "${zoneDirFor flavor}/uninsane.org.zone";
mkTrustDnsService = opts: flavor: let
flags = let baseCfg = config.services.trust-dns; in
(lib.optional baseCfg.debug "--debug") ++ (lib.optional baseCfg.quiet "--quiet");
flagsStr = builtins.concatStringsSep " " flags;
anative = nativeAddrs."servo.${flavor}"; sane.services.trust-dns.enable = true;
sane.services.trust-dns.instances = let
toml = pkgs.formats.toml { }; mkSubstitutions = flavor: {
configTemplate = opts.config or (toml.generate "trust-dns-${flavor}.toml" ( "%AWAN%" = "$(cat '${dyn-dns.ipPath}')";
( "%CNAMENATIVE%" = "servo.${flavor}";
lib.filterAttrsRecursive (_: v: v != null) config.services.trust-dns.settings "%ANATIVE%" = nativeAddrs."servo.${flavor}";
) // { "%AOVPNS%" = "185.157.162.178";
listen_addrs_ipv4 = opts.listen or [ anative ];
}
));
configFile = "${stateDir}/${flavor}-config.toml";
port = opts.port or 53;
in {
description = "trust-dns Domain Name Server (serving ${flavor})";
unitConfig.Documentation = "https://trust-dns.org/";
preStart = ''
wan=$(cat '${config.sane.services.dyn-dns.ipPath}')
${sed} s/%AWAN%/$wan/ ${configTemplate} > ${configFile}
'' + lib.optionalString (!opts ? config) ''
mkdir -p ${zoneDirFor flavor}
${sed} \
-e s/%CNAMENATIVE%/servo.${flavor}/ \
-e s/%ANATIVE%/${anative}/ \
-e s/%AWAN%/$wan/ \
-e s/%AOVPNS%/185.157.162.178/ \
${zoneTemplate} > ${zoneFor flavor}
'';
serviceConfig = config.systemd.services.trust-dns.serviceConfig // {
ExecStart = ''
${pkgs.trust-dns}/bin/${pkgs.trust-dns.meta.mainProgram} \
--port ${builtins.toString port} \
--zonedir ${zoneDirFor flavor}/ \
--config ${configFile} ${flagsStr}
'';
};
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
};
in {
trust-dns-wan = mkTrustDnsService { listen = [ nativeAddrs."servo.lan" bindOvpn ]; } "wan";
trust-dns-lan = mkTrustDnsService { port = 1053; } "lan";
trust-dns-hn = mkTrustDnsService { port = 1053; } "hn";
trust-dns-hn-resolver = mkTrustDnsService {
config = pkgs.writeText "hn-resolver-config.toml" ''
# i host a resolver in the wireguard VPN so that clients can resolve DNS through the VPN.
# (that's what this file achieves).
#
# one would expect this resolver could host the authoritative zone for `uninsane.org`, and then forward everything else to the system resolver...
# and while that works for `dig`, it breaks for `nslookup` (and so `ssh`, etc).
#
# DNS responses include a flag for if the responding server is the authority of the zone queried.
# it seems that default Linux stub resolvers either:
# - expect DNSSEC when the response includes that bit, or
# - expect A records to be in the `answer` section instead of `additional` section.
# or perhaps something more nuanced. but for `nslookup` to be reliable, it has to talk to an
# instance of trust-dns which is strictly a resolver, with no authority.
# hence, this config: a resolver which forwards to the actual authority.
listen_addrs_ipv4 = ["${nativeAddrs."servo.hn"}"]
listen_addrs_ipv6 = []
[[zones]]
zone = "uninsane.org"
zone_type = "Forward"
stores = { type = "forward", name_servers = [{ socket_addr = "${nativeAddrs."servo.hn"}:1053", protocol = "udp", trust_nx_responses = true }] }
[[zones]]
# forward the root zone to the local DNS resolver
zone = "."
zone_type = "Forward"
stores = { type = "forward", name_servers = [{ socket_addr = "127.0.0.53:53", protocol = "udp", trust_nx_responses = true }] }
'';
} "hn-resolver";
}; };
in
{
wan = {
substitutions = mkSubstitutions "wan";
listenAddrs = [
nativeAddrs."servo.lan"
bindOvpn
];
};
lan = {
substitutions = mkSubstitutions "lan";
listenAddrs = [ nativeAddrs."servo.lan" ];
port = 1053;
};
hn = {
substitutions = mkSubstitutions "hn";
listenAddrs = [ nativeAddrs."servo.hn" ];
port = 1053;
};
hn-resolver = {
# don't need %AWAN% here because we forward to the hn instance.
listenAddrs = [ nativeAddrs."servo.hn" ];
extraConfig = {
zones = [
{
zone = "uninsane.org";
zone_type = "Forward";
stores = {
type = "forward";
name_servers = [
{
socket_addr = "${nativeAddrs."servo.hn"}:1053";
protocol = "udp";
trust_nx_responses = true;
}
];
};
}
{
# forward the root zone to the local DNS resolver
zone = ".";
zone_type = "Forward";
stores = {
type = "forward";
name_servers = [
{
socket_addr = "127.0.0.53:53";
protocol = "udp";
trust_nx_responses = true;
}
];
};
}
];
};
};
};
sane.services.dyn-dns.restartOnChange = [ sane.services.dyn-dns.restartOnChange = [
"trust-dns-wan.service" "trust-dns-wan.service"
@@ -207,4 +157,3 @@ in lib.mkMerge [
# "trust-dns-hn-resolver.service" # doesn't need restart because it doesn't know about WAN IP # "trust-dns-hn-resolver.service" # doesn't need restart because it doesn't know about WAN IP
]; ];
} }
]

View File

@@ -43,17 +43,6 @@
fi fi
''; '';
}; };
system.activationScripts.notifyActive = {
text = ''
# send a notification to any sway users logged in, that the system has been activated/upgraded.
# this probably doesn't work if more than one sway session exists on the system.
_notifyActiveSwaySock="$(echo /run/user/*/sway-ipc*.sock)"
if [ -e "$_notifyActiveSwaySock" ]; then
SWAYSOCK="$_notifyActiveSwaySock" ${config.sane.programs.sway.packageUnwrapped}/bin/swaymsg -- exec \
"${pkgs.libnotify}/bin/notify-send 'nixos activated' 'version: $(cat $systemConfig/nixos-version)'"
fi
'';
};
# link debug symbols into /run/current-system/sw/lib/debug # link debug symbols into /run/current-system/sw/lib/debug
# hopefully picked up by gdb automatically? # hopefully picked up by gdb automatically?

View File

@@ -81,10 +81,14 @@ let
(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 "fulltimenix.com" // tech) (fromDb "fulltimenix.com" // tech)
(fromDb "futureofcoding.org/episodes" // tech)
(fromDb "hackerpublicradio.org" // tech)
(fromDb "lexfridman.com/podcast" // rat) (fromDb "lexfridman.com/podcast" // rat)
(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 "omegataupodcast.net" // tech) # 3/4 German; 1/4 eps are English (fromDb "omegataupodcast.net" // tech) # 3/4 German; 1/4 eps are English
(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/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 "originstories.libsyn.com" // uncat) (fromDb "originstories.libsyn.com" // uncat)
(fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol) (fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol)
@@ -100,9 +104,12 @@ let
(fromDb "sharkbytes.transistor.fm" // tech) # Wireshark Podcast o_0 (fromDb "sharkbytes.transistor.fm" // tech) # Wireshark Podcast o_0
(fromDb "sscpodcast.libsyn.com" // rat) # Astral Codex Ten (fromDb "sscpodcast.libsyn.com" // rat) # Astral Codex Ten
(fromDb "talesfromthebridge.buzzsprout.com" // tech) # Sci-Fi? has Peter Watts; author of No Moods, Ads or Cutesy Fucking Icons (rifters.com) (fromDb "talesfromthebridge.buzzsprout.com" // tech) # Sci-Fi? has Peter Watts; author of No Moods, Ads or Cutesy Fucking Icons (rifters.com)
(fromDb "theamphour.com" // tech)
(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 "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)
# (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
@@ -121,11 +128,12 @@ let
texts = [ texts = [
(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 "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)
(fromDb "ascii.textfiles.com" // tech) # Jason Scott (fromDb "ascii.textfiles.com" // tech) # Jason Scott
(fromDb "austinvernon.site" // tech) (fromDb "austinvernon.site" // tech)
# (fromDb "balajis.com" // pol) # Balaji
(fromDb "ben-evans.com/benedictevans" // pol) (fromDb "ben-evans.com/benedictevans" // pol)
(fromDb "bitbashing.io" // tech) (fromDb "bitbashing.io" // tech)
(fromDb "bitsaboutmoney.com" // uncat) (fromDb "bitsaboutmoney.com" // uncat)
@@ -136,20 +144,19 @@ let
(fromDb "blog.thalheim.io" // tech) # Mic92 (fromDb "blog.thalheim.io" // tech) # Mic92
(fromDb "bunniestudios.com" // tech) # Bunnie Juang (fromDb "bunniestudios.com" // tech) # Bunnie Juang
(fromDb "capitolhillseattle.com" // pol) (fromDb "capitolhillseattle.com" // pol)
# (fromDb "drewdevault.com" // tech)
# (fromDb "econlib.org" // pol)
(fromDb "edwardsnowden.substack.com" // pol // text) (fromDb "edwardsnowden.substack.com" // pol // text)
(fromDb "fasterthanli.me" // tech) (fromDb "fasterthanli.me" // tech)
(fromDb "gwern.net" // rat) (fromDb "gwern.net" // rat)
(fromDb "hardcoresoftware.learningbyshipping.com" // tech) # Steven Sinofsky
(fromDb "harihareswara.net" // tech // pol) # rec by Cory Doctorow (fromDb "harihareswara.net" // tech // pol) # rec by Cory Doctorow
(fromDb "ianthehenry.com" // tech) (fromDb "ianthehenry.com" // tech)
(fromDb "idiomdrottning.org" // uncat) (fromDb "idiomdrottning.org" // uncat)
(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 "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)
# (fromDb "lesswrong.com" // rat)
(fromDb "linmob.net" // tech) (fromDb "linmob.net" // tech)
(fromDb "lwn.net" // tech) (fromDb "lwn.net" // tech)
(fromDb "lynalden.com" // pol) (fromDb "lynalden.com" // pol)
@@ -157,51 +164,62 @@ let
(fromDb "mg.lol" // tech) (fromDb "mg.lol" // tech)
(fromDb "mindingourway.com" // rat) (fromDb "mindingourway.com" // rat)
(fromDb "morningbrew.com/feed" // pol) (fromDb "morningbrew.com/feed" // pol)
(fromDb "nixpkgs.news" // tech)
(fromDb "overcomingbias.com" // rat) # Robin Hanson (fromDb "overcomingbias.com" // rat) # Robin Hanson
(fromDb "palladiummag.com" // uncat) (fromDb "palladiummag.com" // uncat)
(fromDb "philosopher.coach" // rat) # Peter Saint-Andre -- side project of stpeter.im (fromDb "philosopher.coach" // rat) # Peter Saint-Andre -- side project of stpeter.im
(fromDb "pomeroyb.com" // tech) (fromDb "pomeroyb.com" // tech)
(fromDb "postmarketos.org/blog" // tech)
(fromDb "preposterousuniverse.com" // rat) # Sean Carroll (fromDb "preposterousuniverse.com" // rat) # Sean Carroll
(fromDb "profectusmag.com" // uncat)
(fromDb "project-insanity.org" // tech) # shared blog by a few NixOS devs, notably onny (fromDb "project-insanity.org" // tech) # shared blog by a few NixOS devs, notably onny
(fromDb "putanumonit.com" // rat) # mostly dating topics. not advice, or humor, but looking through a social lens (fromDb "putanumonit.com" // rat) # mostly dating topics. not advice, or humor, but looking through a social lens
(fromDb "richardcarrier.info" // rat) (fromDb "richardcarrier.info" // rat)
(fromDb "rifters.com/crawl" // uncat) # No Moods, Ads or Cutesy Fucking Icons (fromDb "rifters.com/crawl" // uncat) # No Moods, Ads or Cutesy Fucking Icons
(fromDb "righto.com" // tech) # Ken Shirriff (fromDb "righto.com" // tech) # Ken Shirriff
(fromDb "rootsofprogress.org" // rat) # Jason Crawford (fromDb "rootsofprogress.org" // rat) # Jason Crawford
(fromDb "samuel.dionne-riel.com" // tech) # SamuelDR
(fromDb "sagacioussuricata.com" // tech) # ian (Sanctuary) (fromDb "sagacioussuricata.com" // tech) # ian (Sanctuary)
(fromDb "semiaccurate.com" // tech) (fromDb "semiaccurate.com" // tech)
(fromDb "sideways-view.com" // rat) # Paul Christiano (fromDb "sideways-view.com" // rat) # Paul Christiano
(fromDb "slatecave.net" // tech)
(fromDb "slimemoldtimemold.com" // rat) (fromDb "slimemoldtimemold.com" // rat)
(fromDb "spectrum.ieee.org" // tech) (fromDb "spectrum.ieee.org" // tech)
(fromDb "stpeter.im/atom.xml" // pol) (fromDb "stpeter.im/atom.xml" // pol)
# (fromDb "theregister.com" // tech) (fromDb "thediff.co" // pol) # Byrne Hobart
(fromDb "thisweek.gnome.org" // tech) (fromDb "thisweek.gnome.org" // tech)
(fromDb "tuxphones.com" // tech) (fromDb "tuxphones.com" // tech)
(fromDb "uninsane.org" // tech) (fromDb "uninsane.org" // tech)
(fromDb "unintendedconsequenc.es" // rat) (fromDb "unintendedconsequenc.es" // rat)
# (fromDb "vitalik.ca" // tech) # moved to vitalik.eth.limo
(fromDb "vitalik.eth.limo" // tech) # Vitalik Buterin (fromDb "vitalik.eth.limo" // tech) # Vitalik Buterin
(fromDb "webcurious.co.uk" // uncat) (fromDb "willow.phantoma.online") # wizard@xyzzy.link
(fromDb "xn--gckvb8fzb.com" // tech) (fromDb "xn--gckvb8fzb.com" // tech)
(mkSubstack "astralcodexten" // rat // daily) # Scott Alexander (mkSubstack "astralcodexten" // rat // daily) # Scott Alexander
(mkSubstack "byrnehobart" // pol // infrequent)
# (mkSubstack "doomberg" // tech // weekly) # articles are all pay-walled
(mkSubstack "eliqian" // rat // weekly) (mkSubstack "eliqian" // rat // weekly)
(mkSubstack "oversharing" // pol // daily) (mkSubstack "oversharing" // pol // daily)
(mkSubstack "samkriss" // humor // infrequent) (mkSubstack "samkriss" // humor // infrequent)
(mkText "http://benjaminrosshoffman.com/feed" // pol // weekly) (mkText "http://benjaminrosshoffman.com/feed" // pol // weekly)
(mkText "http://boginjr.com/feed" // tech // infrequent) (mkText "http://boginjr.com/feed" // tech // infrequent)
(mkText "https://anish.lakhwara.com/home.html" // tech // weekly)
(mkText "https://forum.merveilles.town/rss.xml" // pol // infrequent) #quality RSS list here: <https://forum.merveilles.town/thread/57/share-your-rss-feeds%21-6/> (mkText "https://forum.merveilles.town/rss.xml" // pol // infrequent) #quality RSS list here: <https://forum.merveilles.town/thread/57/share-your-rss-feeds%21-6/>
# (mkText "https://github.com/Kaiteki-Fedi/Kaiteki/commits/master.atom" // tech // infrequent)
(mkText "https://jvns.ca/atom.xml" // tech // weekly) # Julia Evans (mkText "https://jvns.ca/atom.xml" // tech // weekly) # Julia Evans
(mkText "https://linuxphoneapps.org/blog/atom.xml" // tech // infrequent) (mkText "https://linuxphoneapps.org/blog/atom.xml" // tech // infrequent)
(mkText "https://nixos.org/blog/announcements-rss.xml" // tech // infrequent) # more nixos stuff here, but unclear how to subscribe: <https://nixos.org/blog/categories.html> (mkText "https://nixos.org/blog/announcements-rss.xml" // tech // infrequent) # more nixos stuff here, but unclear how to subscribe: <https://nixos.org/blog/categories.html>
(mkText "https://nixos.org/blog/stories-rss.xml" // tech // weekly) (mkText "https://nixos.org/blog/stories-rss.xml" // tech // weekly)
(mkText "https://solar.lowtechmagazine.com/posts/index.xml" // tech // weekly)
(mkText "https://www.stratechery.com/rss" // pol // weekly) # Ben Thompson
# (fromDb "balajis.com" // pol) # Balaji
# (fromDb "drewdevault.com" // tech)
# (fromDb "econlib.org" // pol)
# (fromDb "lesswrong.com" // rat)
# (fromDb "profectusmag.com" // pol) # some conservative/libertarian think tank
# (fromDb "thesideview.co" // uncat) # spiritual journal; RSS items are stubs
# (fromDb "theregister.com" // tech)
# (fromDb "vitalik.ca" // tech) # moved to vitalik.eth.limo
# (fromDb "webcurious.co.uk" // uncat) # link aggregator; defunct?
# (mkSubstack "doomberg" // tech // weekly) # articles are all pay-walled
# (mkText "https://github.com/Kaiteki-Fedi/Kaiteki/commits/master.atom" // tech // infrequent)
# (mkText "https://til.simonwillison.net/tils/feed.atom" // tech // weekly) # (mkText "https://til.simonwillison.net/tils/feed.atom" // tech // weekly)
# (mkText "https://www.bloomberg.com/opinion/authors/ARbTQlRLRjE/matthew-s-levine.rss" // pol // weekly) # Matt Levine (preview/paywalled) # (mkText "https://www.bloomberg.com/opinion/authors/ARbTQlRLRjE/matthew-s-levine.rss" // pol // weekly) # Matt Levine (preview/paywalled)
(mkText "https://www.stratechery.com/rss" // pol // weekly) # Ben Thompson
]; ];
videos = [ videos = [
@@ -211,18 +229,21 @@ 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/@NativLang")
(fromDb "youtube.com/@PolyMatter") (fromDb "youtube.com/@PolyMatter")
# (fromDb "youtube.com/@rossmanngroup" // pol // tech) # Louis Rossmann
(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/@Vox")
(fromDb "youtube.com/@Vsauce") (fromDb "youtube.com/@Vsauce")
# (fromDb "youtube.com/@rossmanngroup" // pol // tech) # Louis Rossmann
]; ];
images = [ images = [
(fromDb "catandgirl.com" // img // humor) (fromDb "catandgirl.com" // img // humor)
(fromDb "davidrevoy.com" // img // art)
(fromDb "miniature-calendar.com" // img // art // daily) (fromDb "miniature-calendar.com" // img // art // daily)
(fromDb "pbfcomics.com" // img // humor) (fromDb "pbfcomics.com" // img // humor)
(fromDb "poorlydrawnlines.com/feed" // img // humor) (fromDb "poorlydrawnlines.com/feed" // img // humor)

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`
{ lib, pkgs, sane-lib, ... }: { config, lib, pkgs, sane-lib, utils, ... }:
let let
fsOpts = rec { fsOpts = rec {
@@ -23,15 +23,15 @@ let
# N.B.: `remote-fs.target` is a dependency of multi-user.target, itself of graphical.target. # N.B.: `remote-fs.target` is a dependency of multi-user.target, itself of graphical.target.
# hence, omitting `noauto` can slow down boots. # hence, omitting `noauto` can slow down boots.
noauto = [ "noauto" ]; noauto = [ "noauto" ];
# lazyMount: defer mounting until first access from userspace # lazyMount: defer mounting until first access from userspace.
# see: `man systemd.automount`, `man automount`, `man autofs`
lazyMount = noauto ++ automount; lazyMount = noauto ++ automount;
wg = [ wg = [
"x-systemd.requires=wireguard-wg-home.service" "x-systemd.requires=wireguard-wg-home.service"
"x-systemd.after=wireguard-wg-home.service" "x-systemd.after=wireguard-wg-home.service"
]; ];
ssh = common ++ [ fuse = [
"identityfile=/home/colin/.ssh/id_ed25519"
"allow_other" # allow users other than the one who mounts it to access it. needed, if systemd is the one mounting this fs (as root) "allow_other" # allow users other than the one who mounts it to access it. needed, if systemd is the one mounting this fs (as root)
# allow_root: allow root to access files on this fs (if mounted by non-root, else it can always access them). # allow_root: allow root to access files on this fs (if mounted by non-root, else it can always access them).
# N.B.: if both allow_root and allow_other are specified, then only allow_root takes effect. # N.B.: if both allow_root and allow_other are specified, then only allow_root takes effect.
@@ -44,7 +44,18 @@ let
# with default_permissions, sshfs doesn't tunnel file ops from users until checking that said user could perform said op on an equivalent local fs. # with default_permissions, sshfs doesn't tunnel file ops from users until checking that said user could perform said op on an equivalent local fs.
"default_permissions" "default_permissions"
]; ];
sshColin = ssh ++ [ fuseColin = fuse ++ [
"uid=1000"
"gid=100"
];
ssh = common ++ fuse ++ [
"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.e., local colin's id is translated to/from remote colin's id on every operation?
"idmap=user"
];
sshColin = ssh ++ fuseColin ++ [
# follow_symlinks: remote files which are symlinks are presented to the local system as ordinary files (as the target of the symlink). # follow_symlinks: remote files which are symlinks are presented to the local system as ordinary files (as the target of the symlink).
# if the symlink target does not exist, the presentation is unspecified. # if the symlink target does not exist, the presentation is unspecified.
# symlinks which point outside the mount ARE followed. so this is more capable than `transform_symlinks` # symlinks which point outside the mount ARE followed. so this is more capable than `transform_symlinks`
@@ -52,9 +63,6 @@ let
# symlinks on the remote fs which are absolute paths are presented to the local system as relative symlinks pointing to the expected data on the remote fs. # symlinks on the remote fs which are absolute paths are presented to the local system as relative symlinks pointing to the expected data on the remote fs.
# only symlinks which would point inside the mountpoint are translated. # only symlinks which would point inside the mountpoint are translated.
"transform_symlinks" "transform_symlinks"
"idmap=user"
"uid=1000"
"gid=100"
]; ];
# sshRoot = ssh ++ [ # sshRoot = ssh ++ [
# # 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
@@ -67,21 +75,44 @@ let
# actimeo=n = how long (in seconds) to cache file/dir attributes (default: 3-60s) # actimeo=n = how long (in seconds) to cache file/dir attributes (default: 3-60s)
# bg = retry failed mounts in the background # bg = retry failed mounts in the background
# retry=n = for how many minutes `mount` will retry NFS mount operation # 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 # 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) # 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) # 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. # 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 ++ [ nfs = common ++ [
# "actimeo=10" # "actimeo=5"
"bg" # "bg"
"retrans=4" "retrans=1"
"retry=0" "retry=0"
# "intr"
"soft" "soft"
"timeo=15" "softreval"
"timeo=30"
"nofail" # don't fail remote-fs.target when this mount fails (not an option for sshfs else would be common) "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.
# curlftpfs -o ftpfs_debug=2,user=anonymous:anonymous,connect_timeout=10 -f -s ftp://servo-hn /mnt/my-ftp
ftp = common ++ fuseColin ++ [
# "ftpfs_debug=2"
"user=colin:ipauth"
# connect_timeout=10: casting shows to T.V. fails partway through about half the time
"connect_timeout=20"
]; ];
}; };
remoteHome = host: { remoteHome = host: {
sane.programs.sshfs-fuse.enableFor.system = true;
fileSystems."/mnt/${host}/home" = { fileSystems."/mnt/${host}/home" = {
device = "colin@${host}:/home/colin"; device = "colin@${host}:/home/colin";
fsType = "fuse.sshfs"; fsType = "fuse.sshfs";
@@ -94,6 +125,54 @@ let
dir.acl.mode = "0700"; dir.acl.mode = "0700";
}; };
}; };
remoteServo = subdir: {
sane.programs.curlftpfs.enableFor.system = true;
sane.fs."/mnt/servo/${subdir}" = sane-lib.fs.wanted {
dir.acl.user = "colin";
dir.acl.group = "users";
dir.acl.mode = "0750";
};
fileSystems."/mnt/servo/${subdir}" = {
device = "ftp://servo-hn:/${subdir}";
noCheck = true;
fsType = "fuse.curlftpfs";
options = fsOpts.ftp ++ fsOpts.noauto ++ fsOpts.wg;
# fsType = "nfs";
# options = fsOpts.nfs ++ fsOpts.lazyMount ++ fsOpts.wg;
};
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" ];
serviceConfig.Type = "simple";
serviceConfig.ExecStart = lib.escapeShellArgs [
"/usr/bin/env"
"PATH=/run/current-system/sw/bin"
"mount.${fs.fsType}"
"-f" # foreground (i.e. don't daemonize)
"-s" # single-threaded (TODO: it's probably ok to disable this?)
"-o"
(lib.concatStringsSep "," (lib.filter (o: !lib.hasPrefix "x-systemd." o) fs.options))
fs.device
"/mnt/servo/${subdir}"
];
# not sure if this configures a linear, or exponential backoff.
# but the first restart will be after `RestartSec`, and the n'th restart (n = RestartSteps) will be RestartMaxDelaySec after the n-1'th exit.
serviceConfig.Restart = "always";
serviceConfig.RestartSec = "10s";
serviceConfig.RestartMaxDelaySec = "120s";
serviceConfig.RestartSteps = "5";
};
};
in in
lib.mkMerge [ lib.mkMerge [
{ {
@@ -128,35 +207,6 @@ 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;
# fileSystems."/mnt/servo-nfs" = {
# device = "servo-hn:/";
# noCheck = true;
# fsType = "nfs";
# options = fsOpts.nfs ++ fsOpts.automount ++ fsOpts.wg;
# };
fileSystems."/mnt/servo/media" = {
device = "servo-hn:/media";
noCheck = true;
fsType = "nfs";
options = fsOpts.nfs ++ fsOpts.lazyMount ++ fsOpts.wg;
};
sane.fs."/mnt/servo/media" = sane-lib.fs.wanted {
dir.acl.user = "colin";
dir.acl.group = "users";
dir.acl.mode = "0750";
};
fileSystems."/mnt/servo/playground" = {
device = "servo-hn:/playground";
noCheck = true;
fsType = "nfs";
options = fsOpts.nfs ++ fsOpts.lazyMount ++ fsOpts.wg;
};
sane.fs."/mnt/servo/playground" = sane-lib.fs.wanted {
dir.acl.user = "colin";
dir.acl.group = "users";
dir.acl.mode = "0750";
};
# environment.pathsToLink = [ # environment.pathsToLink = [
# # needed to achieve superuser access for user-mounted filesystems (see sshRoot above) # # 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 # # we can only link whole directories here, even though we're only interested in pkgs.openssh
@@ -164,13 +214,23 @@ lib.mkMerge [
# ]; # ];
programs.fuse.userAllowOther = true; #< necessary for `allow_other` or `allow_root` options. programs.fuse.userAllowOther = true; #< necessary for `allow_other` or `allow_root` options.
environment.systemPackages = [
pkgs.sshfs-fuse
];
} }
(remoteHome "desko") (remoteHome "desko")
(remoteHome "lappy") (remoteHome "lappy")
(remoteHome "moby") (remoteHome "moby")
# this granularity of servo media mounts is necessary to support sandboxing:
# for flaky mounts, we can only bind the mountpoint itself into the sandbox,
# so it's either this or unconditionally bind all of media/.
(remoteServo "media/archive")
(remoteServo "media/Books")
(remoteServo "media/collections")
# (remoteServo "media/datasets")
(remoteServo "media/games")
(remoteServo "media/Music")
(remoteServo "media/Pictures/macros")
(remoteServo "media/torrents")
(remoteServo "media/Videos")
(remoteServo "playground")
] ]

View File

@@ -35,6 +35,16 @@
# 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; boot.kernelPackages = lib.mkDefault pkgs.zfs.latestCompatibleLinuxPackages;
# TODO: remove after linux 6.9. see: <https://github.com/axboe/liburing/issues/1113>
# - <https://github.com/neovim/neovim/issues/28149>
# - <https://git.kernel.dk/cgit/linux/commit/?h=io_uring-6.9&id=e5444baa42e545bb929ba56c497e7f3c73634099>
# when removing, try starting and suspending (ctrl+z) two instances of neovim simultaneously.
# if the system doesn't freeze, then this is safe to remove.
# added 2024-04-04
sane.user.fs.".profile".symlink.text = lib.mkBefore ''
export UV_USE_IO_URING=0
'';
# 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";
@@ -79,11 +89,6 @@
HandleLidSwitch=lock HandleLidSwitch=lock
''; '';
# some packages build only if binfmt *isn't* present
nix.settings.system-features = lib.mkIf (config.boot.binfmt.emulatedSystems == []) [
"no-binfmt"
];
# services.snapper.configs = { # services.snapper.configs = {
# root = { # root = {
# subvolume = "/"; # subvolume = "/";

View File

@@ -1,4 +1,4 @@
{ config, ... }: { config, lib, ... }:
{ {
sane.user.persist.byStore.plaintext = [ sane.user.persist.byStore.plaintext = [
"archive" "archive"
@@ -29,14 +29,17 @@
]; ];
# convenience # convenience
sane.user.fs.".persist/private".symlink.target = config.sane.persist.stores.private.origin; sane.user.fs = let
sane.user.fs.".persist/plaintext".symlink.target = config.sane.persist.stores.plaintext.origin; persistEnabled = config.sane.persist.enable;
sane.user.fs.".persist/ephemeral".symlink.target = config.sane.persist.stores.cryptClearOnBoot.origin; in {
".persist/private" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.private.origin; };
".persist/plaintext" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.plaintext.origin; };
".persist/ephemeral" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.cryptClearOnBoot.origin; };
sane.user.fs."nixos".symlink.target = "dev/nixos"; "nixos".symlink.target = "dev/nixos";
sane.user.fs."Books/servo".symlink.target = "/mnt/servo/media/Books"; "Books/servo".symlink.target = "/mnt/servo/media/Books";
sane.user.fs."Videos/servo".symlink.target = "/mnt/servo/media/Videos"; "Videos/servo".symlink.target = "/mnt/servo/media/Videos";
# sane.user.fs."Music/servo".symlink.target = "/mnt/servo/media/Music"; "Pictures/servo-macros".symlink.target = "/mnt/servo/media/Pictures/macros";
sane.user.fs."Pictures/servo-macros".symlink.target = "/mnt/servo/media/Pictures/macros"; };
} }

View File

@@ -3,13 +3,18 @@
{ {
# XDG defines things like ~/Desktop, ~/Downloads, etc. # XDG defines things like ~/Desktop, ~/Downloads, etc.
# these clutter the home, so i mostly don't use them. # these clutter the home, so i mostly don't use them.
# note that several of these are not actually standardized anywhere.
# some are even non-conventional, like:
# - XDG_PHOTOS_DIR: only works because i patch e.g. megapixels
sane.user.fs.".config/user-dirs.dirs".symlink.text = '' sane.user.fs.".config/user-dirs.dirs".symlink.text = ''
XDG_DESKTOP_DIR="$HOME/.xdg/Desktop" XDG_DESKTOP_DIR="$HOME/.xdg/Desktop"
XDG_DOCUMENTS_DIR="$HOME/dev" XDG_DOCUMENTS_DIR="$HOME/dev"
XDG_DOWNLOAD_DIR="$HOME/tmp" XDG_DOWNLOAD_DIR="$HOME/tmp"
XDG_MUSIC_DIR="$HOME/Music" XDG_MUSIC_DIR="$HOME/Music"
XDG_PHOTOS_DIR="$HOME/Pictures/Photos"
XDG_PICTURES_DIR="$HOME/Pictures" XDG_PICTURES_DIR="$HOME/Pictures"
XDG_PUBLICSHARE_DIR="$HOME/.xdg/Public" XDG_PUBLICSHARE_DIR="$HOME/.xdg/Public"
XDG_SCREENSHOTS_DIR="$HOME/Pictures/Screenshots"
XDG_TEMPLATES_DIR="$HOME/.xdg/Templates" XDG_TEMPLATES_DIR="$HOME/.xdg/Templates"
XDG_VIDEOS_DIR="$HOME/Videos" XDG_VIDEOS_DIR="$HOME/Videos"
''; '';
@@ -17,4 +22,12 @@
# prevent `xdg-user-dirs-update` from overriding/updating our config # prevent `xdg-user-dirs-update` from overriding/updating our config
# see <https://manpages.ubuntu.com/manpages/bionic/man5/user-dirs.conf.5.html> # see <https://manpages.ubuntu.com/manpages/bionic/man5/user-dirs.conf.5.html>
sane.user.fs.".config/user-dirs.conf".symlink.text = "enabled=False"; sane.user.fs.".config/user-dirs.conf".symlink.text = "enabled=False";
sane.user.fs.".profile".symlink.text = ''
# configure XDG_<type>_DIR preferences (e.g. for downloads, screenshots, etc)
# surround with `set -o allexport` since user-dirs.dirs doesn't `export` its vars
set -a
source $HOME/.config/user-dirs.dirs
set +a
'';
} }

View File

@@ -60,8 +60,5 @@
networking.networkmanager.plugins = lib.mkForce []; networking.networkmanager.plugins = lib.mkForce [];
# keyfile.path = where networkmanager should look for connection credentials # keyfile.path = where networkmanager should look for connection credentials
networking.networkmanager.extraConfig = '' networking.networkmanager.settings.keyfile.path = "/var/lib/NetworkManager/system-connections";
[keyfile]
path=/var/lib/NetworkManager/system-connections
'';
} }

View File

@@ -19,30 +19,40 @@
# #
# namespacing: # namespacing:
# - each namespace can use a different /etc/resolv.conf to specify different DNS servers (see `firejail --dns=...`) # - each namespace can use a different /etc/resolv.conf to specify different DNS servers (see `firejail --dns=...`)
# - nscd breaks namespacing: the host nscd is unaware of the guest's /etc/resolv.conf, and so direct's the guest's DNS requests to the host's servers. # - nscd breaks namespacing: the host nscd is unaware of the guest's /etc/resolv.conf, and so directs the guest's DNS requests to the host's servers.
# - this is fixed by either `firejail --blacklist=/var/run/nscd/socket`, or disabling nscd altogether. # - this is fixed by either `firejail --blacklist=/var/run/nscd/socket`, or disabling nscd altogether.
{ lib, ... }: { lib, ... }:
{ {
# 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: rework servo's netns to use `firejail`, which is capable of spoofing /etc/resolv.conf. # # TODO: rework servo's netns to use `firejail`, which is capable of spoofing /etc/resolv.conf.
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
# - curl https://matrix.org => works # # - curl https://matrix.org => works
# 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 (trust-dns)
services.resolved.dnssec = "false"; # services.resolved.dnssec = "false";
# networking.nameservers = [
# # use systemd-resolved resolver
# # full resolver (which understands /etc/hosts) lives on 127.0.0.53
# # stub resolver (just forwards upstream) lives on 127.0.0.54
# "127.0.0.53"
# ];
services.resolved.enable = lib.mkForce false;
sane.services.trust-dns.enable = true;
sane.services.trust-dns.instances.localhost = {
listenAddrs = [ "127.0.0.1" ];
enableRecursiveResolver = true;
};
networking.nameservers = [ networking.nameservers = [
# use systemd-resolved resolver "127.0.0.1"
# full resolver (which understands /etc/hosts) lives on 127.0.0.53
# stub resolver (just forwards upstream) lives on 127.0.0.54
"127.0.0.53"
]; ];
# nscd -- the Name Service Caching Daemon -- caches DNS query responses # nscd -- the Name Service Caching Daemon -- caches DNS query responses

View File

@@ -53,8 +53,9 @@
# allow `nix-shell` (and probably nix-index?) to locate our patched and custom packages. # allow `nix-shell` (and probably nix-index?) to locate our patched and custom packages.
# this is actually a no-op, and the real action happens in assigning `nix.settings.nix-path`. # this is actually a no-op, and the real action happens in assigning `nix.settings.nix-path`.
nix.nixPath = [ nix.nixPath = (lib.optionals (config.sane.maxBuildCost >= 2) [
"nixpkgs=${pkgs.path}" "nixpkgs=${pkgs.path}"
]) ++ [
# note the import starts at repo root: this allows `./overlay/default.nix` to access the stuff at the root # note the import starts at repo root: this allows `./overlay/default.nix` to access the stuff at the root
# "nixpkgs-overlays=${../../..}/hosts/common/nix-path/overlay" # "nixpkgs-overlays=${../../..}/hosts/common/nix-path/overlay"
# as long as my system itself doesn't rely on NIXPKGS at runtime, we can point the overlays to git # as long as my system itself doesn't rely on NIXPKGS at runtime, we can point the overlays to git
@@ -63,7 +64,13 @@
]; ];
# 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.
environment.etc."nixos".source = ../../..; # this however changes on every commit and can be slow to copy for e.g. `moby`.
environment.etc."nixos" = lib.mkIf (config.sane.maxBuildCost >= 2) {
source = ../../..;
};
environment.etc."nix/registry.json" = lib.mkIf (config.sane.maxBuildCost < 2) {
enable = false;
};
systemd.services.nix-daemon.serviceConfig = { systemd.services.nix-daemon.serviceConfig = {
# the nix-daemon manages nix builders # the nix-daemon manages nix builders

View File

@@ -13,7 +13,7 @@
"/run/current-system/sw" "/run/current-system/sw"
]; ];
# NIXPKGS_CONFIG defaults to "/etc/nix/nixpkgs-config.nix", for idfk why. # NIXPKGS_CONFIG defaults to "/etc/nix/nixpkgs-config.nix" in <nixos/modules/programs/environment.nix>.
# that's never existed on my system and everything does fine without it set empty (no nixpkgs API to forcibly *unset* it). # that's never existed on my system and everything does fine without it set empty (no nixpkgs API to forcibly *unset* it).
environment.variables.NIXPKGS_CONFIG = lib.mkForce ""; environment.variables.NIXPKGS_CONFIG = lib.mkForce "";
# XDG_CONFIG_DIRS defaults to "/etc/xdg", which doesn't exist. # XDG_CONFIG_DIRS defaults to "/etc/xdg", which doesn't exist.
@@ -42,4 +42,31 @@
# so as to inform when trying to run a non-nixos binary? # so as to inform when trying to run a non-nixos binary?
# IMO that's confusing: i thought /lib/ld-linux.so was some file actually required by nix. # IMO that's confusing: i thought /lib/ld-linux.so was some file actually required by nix.
environment.stub-ld.enable = false; environment.stub-ld.enable = false;
# `less.enable` sets LESSKEYIN_SYSTEM, LESSOPEN, LESSCLOSE env vars, which does confusing "lesspipe" things, so disable that.
# it's enabled by default from `<nixos/modules/programs/environment.nix>`, who also sets `PAGER="less"` and `EDITOR="nano"` (keep).
programs.less.enable = lib.mkForce false;
environment.variables.PAGER = lib.mkOverride 900 ""; # mkDefault sets 1000. non-override is 100. 900 will beat the nixpkgs `mkDefault` but not anyone else.
environment.variables.EDITOR = lib.mkOverride 900 "";
# several packages (dconf, modemmanager, networkmanager, gvfs, polkit, udisks, bluez/blueman, feedbackd, etc)
# will add themselves to the dbus search path.
# i prefer dbus to only search XDG paths (/share/dbus-1) for service files, as that's more introspectable.
# see: <repo:nixos/nixpkgs:nixos/modules/services/system/dbus.nix>
# TODO: sandbox dbus? i pretty explicitly don't want to use it as a launcher.
services.dbus.packages = lib.mkForce [
"/run/current-system/sw"
# config.system.path
# pkgs.dbus
# pkgs.polkit.out
# pkgs.modemmanager
# pkgs.networkmanager
# pkgs.udisks
# pkgs.wpa_supplicant
];
# systemd by default forces shitty defaults for e.g. /tmp/.X11-unix.
# nixos propagates those in: <nixos/modules/system/boot/systemd/tmpfiles.nix>
# by overwriting this with an empty file, we can effectively remove it.
environment.etc."tmpfiles.d/x11.conf".text = "# (removed by Colin)";
} }

View File

@@ -87,13 +87,8 @@ in
services.abaddon = { services.abaddon = {
description = "unofficial Discord chat client"; description = "unofficial Discord chat client";
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
serviceConfig = { command = "abaddon";
ExecStart = "${cfg.package}/bin/abaddon";
Type = "simple";
Restart = "always";
RestartSec = "20s";
};
}; };
}; };
} }

View File

@@ -4,7 +4,7 @@
{ {
sane.programs.aerc = { sane.programs.aerc = {
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "inplace"; sandbox.wrapperType = "inplace"; #< /share/aerc/aerc.conf refers to other /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

@@ -3,14 +3,28 @@
# - `man 5 alacritty` # - `man 5 alacritty`
# - defaults: <https://github.com/alacritty/alacritty/releases> -> alacritty.yml # - defaults: <https://github.com/alacritty/alacritty/releases> -> alacritty.yml
# - irc: #alacritty on libera.chat # - irc: #alacritty on libera.chat
{ lib, ... }: { config, lib, ... }:
let
cfg = config.sane.programs.alacritty;
in
{ {
sane.programs.alacritty = { sane.programs.alacritty = {
configOption = with lib; mkOption {
default = {};
type = types.submodule {
options.fontSize = mkOption {
type = types.int;
default = 14;
};
};
};
sandbox.enable = false; sandbox.enable = false;
env.TERMINAL = lib.mkDefault "alacritty"; env.TERMINAL = lib.mkDefault "alacritty";
fs.".config/alacritty/alacritty.toml".symlink.text = '' fs.".config/alacritty/alacritty.toml".symlink.text = ''
[font] [font]
size = 14 size = ${builtins.toString cfg.config.fontSize}
[[keyboard.bindings]] [[keyboard.bindings]]
mods = "Control" mods = "Control"
@@ -36,6 +50,21 @@
mods = "Control|Shift" mods = "Control|Shift"
key = "PageDown" key = "PageDown"
action = "ScrollPageDown" action = "ScrollPageDown"
# disable OS shortcuts which leak through...
# see sway config or sane-input-handler for more info on why these leak through
[[keyboard.bindings]]
key = "AudioVolumeUp"
action = "None"
[[keyboard.bindings]]
key = "AudioVolumeDown"
action = "None"
[[keyboard.bindings]]
key = "Power"
action = "None"
[[keyboard.bindings]]
key = "PowerOff"
action = "None"
''; '';
}; };
} }

View File

@@ -0,0 +1,65 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.alsa-ucm-conf;
in
{
sane.programs.alsa-ucm-conf = {
configOption = with lib; mkOption {
default = {};
type = types.submodule {
options.preferEarpiece = mkOption {
type = types.bool;
default = true;
};
};
};
# upstream alsa ships with PinePhone audio configs, but they don't actually produce sound.
# see: <https://github.com/alsa-project/alsa-ucm-conf/pull/134>
# these audio files come from some revision of:
# - <https://gitlab.manjaro.org/manjaro-arm/packages/community/phosh/alsa-ucm-pinephone>
#
# alternative to patching is to plumb `ALSA_CONFIG_UCM2 = "${./ucm2}"` environment variable into the relevant places
# e.g. `systemd.services.pulseaudio.environment`.
# that leaves more opportunity for gaps (i.e. missing a service),
# on the other hand this method causes about 500 packages to be rebuilt (including qt5 and webkitgtk).
#
# note that with these files, the following audio device support:
# - headphones work.
# - "internal earpiece" works.
# - "internal speaker" doesn't work (but that's probably because i broke the ribbon cable)
# - "analog output" doesn't work.
packageUnwrapped = pkgs.alsa-ucm-conf.overrideAttrs (upstream: {
postPatch = (upstream.postPatch or "") + ''
cp ${./ucm2/PinePhone}/* ucm2/Allwinner/A64/PinePhone/
# fix the self-contained ucm files i source from to have correct path within the alsa-ucm-conf source tree
substituteInPlace ucm2/Allwinner/A64/PinePhone/PinePhone.conf \
--replace-fail 'HiFi.conf' '/Allwinner/A64/PinePhone/HiFi.conf'
substituteInPlace ucm2/Allwinner/A64/PinePhone/PinePhone.conf \
--replace-fail 'VoiceCall.conf' '/Allwinner/A64/PinePhone/VoiceCall.conf'
'' + lib.optionalString cfg.config.preferEarpiece ''
# decrease the priority of the internal speaker so that sounds are routed
# to the earpiece by default.
# this is just personal preference.
substituteInPlace ucm2/Allwinner/A64/PinePhone/{HiFi.conf,VoiceCall.conf} \
--replace-fail 'PlaybackPriority 300' 'PlaybackPriority 100'
'';
});
sandbox.enable = false; #< only provides #out/share/alsa
# alsa-lib package only looks in its $out/share/alsa to find runtime config data, by default.
# but ALSA_CONFIG_UCM2 is an env var that can override that.
# this is particularly needed by wireplumber;
# also *maybe* pipewire and pipewire-pulse.
# taken from <repo:nixos/mobile-nixos:modules/quirks/audio.nix>
env.ALSA_CONFIG_UCM2 = "/run/current-system/sw/share/alsa/ucm2";
enableFor.system = lib.mkIf (builtins.any (en: en) (builtins.attrValues cfg.enableFor.user)) true;
};
environment.pathsToLink = lib.mkIf cfg.enabled [
"/share/alsa/ucm2"
];
}

View File

@@ -30,8 +30,9 @@
}); });
}; };
buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
persist.byStore.plaintext = [ persist.byStore.plaintext = [

View File

@@ -62,6 +62,8 @@ in
# "iw" # "iw"
"jq" "jq"
"killall" "killall"
"less"
"lftp"
# "libcap_ng" # for `netcap` # "libcap_ng" # for `netcap`
"lsof" "lsof"
# "miniupnpc" # "miniupnpc"
@@ -78,6 +80,7 @@ in
"powertop" "powertop"
"pstree" "pstree"
"ripgrep" "ripgrep"
"s6-rc" # service manager
"screen" "screen"
"smartmontools" # smartctl "smartmontools" # smartctl
# "socat" # "socat"
@@ -87,6 +90,7 @@ in
"tree" "tree"
"usbutils" # lsusb "usbutils" # lsusb
"util-linux" # lsblk, lscpu, etc "util-linux" # lsblk, lscpu, etc
"valgrind"
"wget" "wget"
"wirelesstools" # iwlist "wirelesstools" # iwlist
# "xq" # jq for XML # "xq" # jq for XML
@@ -106,7 +110,6 @@ in
# - debugging? # - debugging?
consoleUtils = declPackageSet [ consoleUtils = declPackageSet [
"alsaUtils" # for aplay, speaker-test "alsaUtils" # for aplay, speaker-test
"strings"
# "cdrtools" # "cdrtools"
# "clinfo" # "clinfo"
# "dmidecode" # "dmidecode"
@@ -121,6 +124,7 @@ in
# "gopass" # "gopass"
# "gopass-jsonapi" # "gopass-jsonapi"
# "helix" # text editor # "helix" # text editor
"htop" # needed as a user package, for ~/.config/htop
# "libsecret" # for managing user keyrings (secret-tool) # "libsecret" # for managing user keyrings (secret-tool)
# "lm_sensors" # for sensors-detect # "lm_sensors" # for sensors-detect
# "lshw" # "lshw"
@@ -134,6 +138,7 @@ in
"nmon" "nmon"
# "node2nix" # "node2nix"
# "oathToolkit" # for oathtool # "oathToolkit" # for oathtool
"objdump"
# "ponymix" # "ponymix"
"pulsemixer" "pulsemixer"
"python3-repl" "python3-repl"
@@ -146,6 +151,7 @@ in
"sops" # for manually viewing secrets; outside `sane-secrets` (TODO: improve sane-secrets!) "sops" # for manually viewing secrets; outside `sane-secrets` (TODO: improve sane-secrets!)
"speedtest-cli" "speedtest-cli"
# "ssh-to-age" # "ssh-to-age"
"strings"
"sudo" "sudo"
# "tageditor" # music tagging # "tageditor" # music tagging
# "unar" # "unar"
@@ -165,10 +171,12 @@ in
]; ];
consoleMediaUtils = declPackageSet [ consoleMediaUtils = declPackageSet [
"blast-ugjka" # cast audio to UPNP/DLNA devices (via pulseaudio sink)
# "catt" # cast videos to chromecast # "catt" # cast videos to chromecast
"ffmpeg" "ffmpeg"
"go2tv" # cast videos to UPNP/DLNA device (i.e. tv). "go2tv" # cast videos to UPNP/DLNA device (i.e. tv).
"imagemagick" "imagemagick"
"sane-cast" # cast videos to UPNP/DLNA, with compatibility
"sox" "sox"
"yt-dlp" "yt-dlp"
]; ];
@@ -203,17 +211,18 @@ in
# INDIVIDUAL PACKAGE DEFINITIONS # INDIVIDUAL PACKAGE DEFINITIONS
alsaUtils.sandbox.method = "landlock"; alsaUtils.sandbox.method = "landlock";
alsaUtils.sandbox.wrapperType = "wrappedDerivation";
alsaUtils.sandbox.whitelistAudio = true; #< not strictly necessary? alsaUtils.sandbox.whitelistAudio = true; #< not strictly necessary?
backblaze-b2 = {};
blanket.buildCost = 1;
blanket.sandbox.method = "bwrap"; blanket.sandbox.method = "bwrap";
blanket.sandbox.wrapperType = "wrappedDerivation";
blanket.sandbox.whitelistAudio = true; blanket.sandbox.whitelistAudio = true;
# blanket.sandbox.whitelistDbus = [ "user" ]; # TODO: untested # blanket.sandbox.whitelistDbus = [ "user" ]; # TODO: untested
blanket.sandbox.whitelistWayland = true; blanket.sandbox.whitelistWayland = true;
blueberry.sandbox.method = "bwrap"; blueberry.sandbox.method = "bwrap";
blueberry.sandbox.wrapperType = "inplace"; # /etc/xdg/autostart hardcodes paths blueberry.sandbox.wrapperType = "inplace"; #< various /lib scripts refer to the bins by full path
blueberry.sandbox.whitelistWayland = true; blueberry.sandbox.whitelistWayland = true;
blueberry.sandbox.extraPaths = [ blueberry.sandbox.extraPaths = [
"/dev/rfkill" "/dev/rfkill"
@@ -223,11 +232,9 @@ in
]; ];
bridge-utils.sandbox.method = "bwrap"; #< bwrap, landlock: both work bridge-utils.sandbox.method = "bwrap"; #< bwrap, landlock: both work
bridge-utils.sandbox.wrapperType = "wrappedDerivation";
bridge-utils.sandbox.net = "all"; bridge-utils.sandbox.net = "all";
brightnessctl.sandbox.method = "landlock"; # also bwrap, but landlock is more responsive brightnessctl.sandbox.method = "landlock"; # also bwrap, but landlock is more responsive
brightnessctl.sandbox.wrapperType = "wrappedDerivation";
brightnessctl.sandbox.extraPaths = [ brightnessctl.sandbox.extraPaths = [
"/sys/class/backlight" "/sys/class/backlight"
"/sys/class/leds" "/sys/class/leds"
@@ -236,16 +243,16 @@ in
brightnessctl.sandbox.whitelistDbus = [ "system" ]; brightnessctl.sandbox.whitelistDbus = [ "system" ];
btrfs-progs.sandbox.method = "bwrap"; #< bwrap, landlock: both work btrfs-progs.sandbox.method = "bwrap"; #< bwrap, landlock: both work
btrfs-progs.sandbox.wrapperType = "wrappedDerivation";
btrfs-progs.sandbox.autodetectCliPaths = "existing"; # e.g. `btrfs filesystem df /my/fs` btrfs-progs.sandbox.autodetectCliPaths = "existing"; # e.g. `btrfs filesystem df /my/fs`
"cacert.unbundled".sandbox.enable = false; "cacert.unbundled".sandbox.enable = false;
cargo.persist.byStore.plaintext = [ ".cargo" ]; cargo.persist.byStore.plaintext = [ ".cargo" ];
clang = {};
# cryptsetup: typical use is `cryptsetup open /dev/loopxyz mappedName`, and creates `/dev/mapper/mappedName` # cryptsetup: typical use is `cryptsetup open /dev/loopxyz mappedName`, and creates `/dev/mapper/mappedName`
cryptsetup.sandbox.method = "landlock"; cryptsetup.sandbox.method = "landlock";
cryptsetup.sandbox.wrapperType = "wrappedDerivation";
cryptsetup.sandbox.extraPaths = [ cryptsetup.sandbox.extraPaths = [
"/dev/mapper" "/dev/mapper"
"/dev/random" "/dev/random"
@@ -259,59 +266,65 @@ in
cryptsetup.sandbox.autodetectCliPaths = "existing"; cryptsetup.sandbox.autodetectCliPaths = "existing";
ddrescue.sandbox.method = "landlock"; # TODO:sandbox: untested ddrescue.sandbox.method = "landlock"; # TODO:sandbox: untested
ddrescue.sandbox.wrapperType = "wrappedDerivation";
ddrescue.sandbox.autodetectCliPaths = "existingOrParent"; ddrescue.sandbox.autodetectCliPaths = "existingOrParent";
# auth token, preferences delfin.buildCost = 1;
delfin.sandbox.method = "bwrap"; delfin.sandbox.method = "bwrap";
delfin.sandbox.wrapperType = "wrappedDerivation";
delfin.sandbox.whitelistAudio = true; delfin.sandbox.whitelistAudio = true;
delfin.sandbox.whitelistDbus = [ "user" ]; # else `mpris` plugin crashes the player delfin.sandbox.whitelistDbus = [ "user" ]; # else `mpris` plugin crashes the player
delfin.sandbox.whitelistDri = true; delfin.sandbox.whitelistDri = true;
delfin.sandbox.whitelistWayland = true; delfin.sandbox.whitelistWayland = true;
delfin.sandbox.net = "clearnet"; delfin.sandbox.net = "clearnet";
# auth token, preferences
delfin.persist.byStore.private = [ ".config/delfin" ]; delfin.persist.byStore.private = [ ".config/delfin" ];
dig.sandbox.method = "bwrap"; dig.sandbox.method = "bwrap";
dig.sandbox.wrapperType = "wrappedDerivation";
dig.sandbox.net = "all"; dig.sandbox.net = "all";
# creds, but also 200 MB of node modules, etc # creds, but also 200 MB of node modules, etc
discord.persist.byStore.private = [ ".config/discord" ];
discord.suggestedPrograms = [ "xwayland" ];
discord.sandbox.method = "bwrap"; discord.sandbox.method = "bwrap";
discord.sandbox.wrapperType = "inplace"; #< /opt-style packaging discord.sandbox.wrapperType = "inplace"; #< /opt-style packaging
discord.sandbox.whitelistAudio = true; discord.sandbox.whitelistAudio = true;
discord.sandbox.whitelistDbus = [ "user" ]; # needed for xdg-open discord.sandbox.whitelistDbus = [ "user" ]; # needed for xdg-open
discord.sandbox.whitelistWayland = true; discord.sandbox.whitelistWayland = true;
discord.sandbox.whitelistX = true;
discord.sandbox.net = "clearnet"; discord.sandbox.net = "clearnet";
discord.persist.byStore.private = [ ".config/discord" ]; discord.sandbox.extraHomePaths = [
# still needs these paths despite it using the portal's file-chooser :?
"Pictures/cat"
"Pictures/Screenshots"
"Pictures/servo-macros"
"Videos/local"
"Videos/servo"
"tmp"
];
dtc.sandbox.method = "bwrap"; dtc.sandbox.method = "bwrap";
dtc.sandbox.autodetectCliPaths = true; # TODO:sandbox: untested dtc.sandbox.autodetectCliPaths = true; # TODO:sandbox: untested
dtrx.sandbox.method = "bwrap"; duplicity = {};
dtrx.sandbox.wrapperType = "wrappedDerivation";
dtrx.sandbox.whitelistPwd = true;
dtrx.sandbox.autodetectCliPaths = "existing"; #< for the archive
e2fsprogs.sandbox.method = "landlock"; e2fsprogs.sandbox.method = "landlock";
e2fsprogs.sandbox.wrapperType = "wrappedDerivation";
e2fsprogs.sandbox.autodetectCliPaths = "existing"; e2fsprogs.sandbox.autodetectCliPaths = "existing";
efibootmgr.sandbox.method = "landlock"; efibootmgr.sandbox.method = "landlock";
efibootmgr.sandbox.wrapperType = "wrappedDerivation";
efibootmgr.sandbox.extraPaths = [ efibootmgr.sandbox.extraPaths = [
"/sys/firmware/efi" "/sys/firmware/efi"
]; ];
eg25-control = {};
electrum.buildCost = 1;
electrum.sandbox.method = "bwrap"; # TODO:sandbox: untested electrum.sandbox.method = "bwrap"; # TODO:sandbox: untested
electrum.sandbox.wrapperType = "wrappedDerivation";
electrum.sandbox.net = "all"; # TODO: probably want to make this run behind a VPN, always electrum.sandbox.net = "all"; # TODO: probably want to make this run behind a VPN, always
electrum.sandbox.whitelistWayland = true; electrum.sandbox.whitelistWayland = true;
electrum.persist.byStore.cryptClearOnBoot = [ ".electrum" ]; #< TODO: use XDG dirs! electrum.persist.byStore.cryptClearOnBoot = [ ".electrum" ]; #< TODO: use XDG dirs!
endless-sky.buildCost = 1;
endless-sky.persist.byStore.plaintext = [ ".local/share/endless-sky" ]; endless-sky.persist.byStore.plaintext = [ ".local/share/endless-sky" ];
endless-sky.sandbox.method = "bwrap"; endless-sky.sandbox.method = "bwrap";
endless-sky.sandbox.wrapperType = "wrappedDerivation";
endless-sky.sandbox.whitelistAudio = true; endless-sky.sandbox.whitelistAudio = true;
endless-sky.sandbox.whitelistDri = true; endless-sky.sandbox.whitelistDri = true;
endless-sky.sandbox.whitelistWayland = true; endless-sky.sandbox.whitelistWayland = true;
@@ -322,14 +335,12 @@ in
emote.persist.byStore.plaintext = [ ".local/share/Emote" ]; emote.persist.byStore.plaintext = [ ".local/share/Emote" ];
ethtool.sandbox.method = "landlock"; ethtool.sandbox.method = "landlock";
ethtool.sandbox.wrapperType = "wrappedDerivation";
ethtool.sandbox.capabilities = [ "net_admin" ]; ethtool.sandbox.capabilities = [ "net_admin" ];
# eza `ls` replacement # eza `ls` replacement
# landlock is OK, only `whitelistPwd` doesn't make the intermediate symlinks traversable, so it breaks on e.g. ~/Videos/servo/Shows/foo # landlock is OK, only `whitelistPwd` doesn't make the intermediate symlinks traversable, so it breaks on e.g. ~/Videos/servo/Shows/foo
# eza.sandbox.method = "landlock"; # eza.sandbox.method = "landlock";
eza.sandbox.method = "bwrap"; eza.sandbox.method = "bwrap";
eza.sandbox.wrapperType = "wrappedDerivation"; # slow to build
eza.sandbox.autodetectCliPaths = true; eza.sandbox.autodetectCliPaths = true;
eza.sandbox.whitelistPwd = true; eza.sandbox.whitelistPwd = true;
eza.sandbox.extraHomePaths = [ eza.sandbox.extraHomePaths = [
@@ -339,11 +350,9 @@ in
]; ];
fatresize.sandbox.method = "landlock"; fatresize.sandbox.method = "landlock";
fatresize.sandbox.wrapperType = "wrappedDerivation";
fatresize.sandbox.autodetectCliPaths = "parent"; # /dev/sda1 -> needs /dev/sda fatresize.sandbox.autodetectCliPaths = "parent"; # /dev/sda1 -> needs /dev/sda
fd.sandbox.method = "landlock"; fd.sandbox.method = "landlock";
fd.sandbox.wrapperType = "wrappedDerivation"; # slow to build
fd.sandbox.autodetectCliPaths = true; fd.sandbox.autodetectCliPaths = true;
fd.sandbox.whitelistPwd = true; fd.sandbox.whitelistPwd = true;
fd.sandbox.extraHomePaths = [ fd.sandbox.extraHomePaths = [
@@ -352,16 +361,14 @@ in
".persist/plaintext" ".persist/plaintext"
]; ];
ffmpeg.buildCost = 1;
ffmpeg.sandbox.method = "bwrap"; ffmpeg.sandbox.method = "bwrap";
ffmpeg.sandbox.wrapperType = "wrappedDerivation"; # slow to build
ffmpeg.sandbox.autodetectCliPaths = "existingFileOrParent"; # it outputs uncreated files -> parent dir needs mounting ffmpeg.sandbox.autodetectCliPaths = "existingFileOrParent"; # it outputs uncreated files -> parent dir needs mounting
file.sandbox.method = "bwrap"; file.sandbox.method = "bwrap";
file.sandbox.wrapperType = "wrappedDerivation";
file.sandbox.autodetectCliPaths = true; file.sandbox.autodetectCliPaths = true;
findutils.sandbox.method = "bwrap"; findutils.sandbox.method = "bwrap";
findutils.sandbox.wrapperType = "wrappedDerivation";
findutils.sandbox.autodetectCliPaths = true; findutils.sandbox.autodetectCliPaths = true;
findutils.sandbox.whitelistPwd = true; findutils.sandbox.whitelistPwd = true;
findutils.sandbox.extraHomePaths = [ findutils.sandbox.extraHomePaths = [
@@ -372,15 +379,15 @@ in
fluffychat-moby.persist.byStore.plaintext = [ ".local/share/chat.fluffy.fluffychat" ]; fluffychat-moby.persist.byStore.plaintext = [ ".local/share/chat.fluffy.fluffychat" ];
font-manager.buildCost = 1;
font-manager.sandbox.method = "bwrap"; font-manager.sandbox.method = "bwrap";
font-manager.sandbox.wrapperType = "inplace"; # .desktop and dbus .service file refer to /libexec font-manager.sandbox.whitelistWayland = true;
font-manager.packageUnwrapped = pkgs.font-manager.override { font-manager.packageUnwrapped = pkgs.rmDbusServicesInPlace (pkgs.font-manager.override {
# build without the "Google Fonts" integration feature, to save closure / avoid webkitgtk_4_0 # build without the "Google Fonts" integration feature, to save closure / avoid webkitgtk_4_0
withWebkit = false; withWebkit = false;
}; });
forkstat.sandbox.method = "landlock"; #< doesn't seem to support bwrap forkstat.sandbox.method = "landlock"; #< doesn't seem to support bwrap
forkstat.sandbox.wrapperType = "wrappedDerivation";
forkstat.sandbox.extraConfig = [ forkstat.sandbox.extraConfig = [
"--sane-sandbox-keep-namespace" "pid" "--sane-sandbox-keep-namespace" "pid"
]; ];
@@ -388,12 +395,7 @@ in
"/proc" "/proc"
]; ];
# fuzzel: TODO: re-enable sandbox. i use fuzzel both as an entry system (snippets) AND an app-launcher.
# as an app-launcher, it cannot be sandboxed without over-restricting the app it launches.
# should probably make it not be an app-launcher
fuzzel.sandbox.enable = false;
fuzzel.sandbox.method = "bwrap"; #< landlock nearly works, but unable to open ~/.cache fuzzel.sandbox.method = "bwrap"; #< landlock nearly works, but unable to open ~/.cache
fuzzel.sandbox.wrapperType = "wrappedDerivation";
fuzzel.sandbox.whitelistWayland = true; fuzzel.sandbox.whitelistWayland = true;
fuzzel.persist.byStore.private = [ fuzzel.persist.byStore.private = [
# this is a file of recent selections # this is a file of recent selections
@@ -401,20 +403,22 @@ in
]; ];
gawk.sandbox.method = "bwrap"; # TODO:sandbox: untested gawk.sandbox.method = "bwrap"; # TODO:sandbox: untested
gawk.sandbox.wrapperType = "inplace"; # share/gawk libraries refer to /libexec gawk.sandbox.wrapperType = "inplace"; # /share/gawk libraries refer to /libexec
gawk.sandbox.autodetectCliPaths = true; gawk.sandbox.autodetectCliPaths = true;
gdb.sandbox.enable = false; # gdb doesn't sandbox well. i don't know how you could. gdb.sandbox.enable = false; # gdb doesn't sandbox well. i don't know how you could.
# gdb.sandbox.method = "landlock"; # permission denied when trying to attach, even as root # gdb.sandbox.method = "landlock"; # permission denied when trying to attach, even as root
gdb.sandbox.wrapperType = "wrappedDerivation";
gdb.sandbox.autodetectCliPaths = true; gdb.sandbox.autodetectCliPaths = true;
geoclue2-with-demo-agent = {};
# MS GitHub stores auth token in .config # MS GitHub stores auth token in .config
# TODO: we can populate gh's stuff statically; it even lets us use the same oauth across machines # TODO: we can populate gh's stuff statically; it even lets us use the same oauth across machines
gh.persist.byStore.private = [ ".config/gh" ]; gh.persist.byStore.private = [ ".config/gh" ];
gimp.buildCost = 1;
gimp.sandbox.method = "bwrap"; gimp.sandbox.method = "bwrap";
gimp.sandbox.wrapperType = "wrappedDerivation"; gimp.sandbox.whitelistX = true;
gimp.sandbox.whitelistWayland = true; gimp.sandbox.whitelistWayland = true;
gimp.sandbox.extraHomePaths = [ gimp.sandbox.extraHomePaths = [
"Pictures/albums" "Pictures/albums"
@@ -432,40 +436,45 @@ in
"/tmp" # "Cannot open display:" if it can't mount /tmp 👀 "/tmp" # "Cannot open display:" if it can't mount /tmp 👀
]; ];
"gnome.gnome-calculator".buildCost = 1;
"gnome.gnome-calculator".sandbox.method = "bwrap"; "gnome.gnome-calculator".sandbox.method = "bwrap";
"gnome.gnome-calculator".sandbox.wrapperType = "inplace"; # /libexec/gnome-calculator-search-provider
"gnome.gnome-calculator".sandbox.whitelistWayland = true; "gnome.gnome-calculator".sandbox.whitelistWayland = true;
"gnome.gnome-calendar".buildCost = 1;
# gnome-calendar surely has data to persist, but i use it strictly to do date math, not track events. # gnome-calendar surely has data to persist, but i use it strictly to do date math, not track events.
"gnome.gnome-calendar".sandbox.method = "bwrap"; "gnome.gnome-calendar".sandbox.method = "bwrap";
"gnome.gnome-calendar".sandbox.wrapperType = "wrappedDerivation";
"gnome.gnome-calendar".sandbox.whitelistWayland = true; "gnome.gnome-calendar".sandbox.whitelistWayland = true;
"gnome.gnome-clocks".buildCost = 1;
"gnome.gnome-clocks".sandbox.method = "bwrap"; "gnome.gnome-clocks".sandbox.method = "bwrap";
"gnome.gnome-clocks".sandbox.wrapperType = "wrappedDerivation";
"gnome.gnome-clocks".sandbox.whitelistWayland = true; "gnome.gnome-clocks".sandbox.whitelistWayland = true;
"gnome.gnome-clocks".suggestedPrograms = [ "dconf" ]; "gnome.gnome-clocks".suggestedPrograms = [ "dconf" ];
# gnome-disks # gnome-disks
"gnome.gnome-disk-utility".buildCost = 1;
"gnome.gnome-disk-utility".sandbox.method = "bwrap"; "gnome.gnome-disk-utility".sandbox.method = "bwrap";
"gnome.gnome-disk-utility".sandbox.wrapperType = "inplace"; # /etc/xdg/autostart
"gnome.gnome-disk-utility".sandbox.whitelistDbus = [ "system" ]; "gnome.gnome-disk-utility".sandbox.whitelistDbus = [ "system" ];
"gnome.gnome-disk-utility".sandbox.whitelistWayland = true; "gnome.gnome-disk-utility".sandbox.whitelistWayland = true;
"gnome.gnome-disk-utility".sandbox.extraHomePaths = [
"tmp"
"use/iso"
# TODO: probably need /dev and such
];
# seahorse: dump gnome-keyring secrets. # seahorse: dump gnome-keyring secrets.
"gnome.seahorse".buildCost = 1;
# N.B.: it can also manage ~/.ssh keys, but i explicitly don't add those to the sandbox for now. # N.B.: it can also manage ~/.ssh keys, but i explicitly don't add those to the sandbox for now.
"gnome.seahorse".sandbox.method = "bwrap"; "gnome.seahorse".sandbox.method = "bwrap";
"gnome.seahorse".sandbox.wrapperType = "wrappedDerivation";
"gnome.seahorse".sandbox.whitelistDbus = [ "user" ]; "gnome.seahorse".sandbox.whitelistDbus = [ "user" ];
"gnome.seahorse".sandbox.whitelistWayland = true; "gnome.seahorse".sandbox.whitelistWayland = true;
gnome-2048.buildCost = 1;
gnome-2048.sandbox.method = "bwrap"; gnome-2048.sandbox.method = "bwrap";
gnome-2048.sandbox.wrapperType = "wrappedDerivation";
gnome-2048.sandbox.whitelistWayland = true; gnome-2048.sandbox.whitelistWayland = true;
gnome-2048.persist.byStore.plaintext = [ ".local/share/gnome-2048/scores" ]; gnome-2048.persist.byStore.plaintext = [ ".local/share/gnome-2048/scores" ];
gnome-frog.buildCost = 1;
gnome-frog.sandbox.method = "bwrap"; gnome-frog.sandbox.method = "bwrap";
gnome-frog.sandbox.wrapperType = "wrappedDerivation";
gnome-frog.sandbox.whitelistWayland = true; gnome-frog.sandbox.whitelistWayland = true;
gnome-frog.sandbox.whitelistDbus = [ "user" ]; gnome-frog.sandbox.whitelistDbus = [ "user" ];
gnome-frog.sandbox.extraPaths = [ gnome-frog.sandbox.extraPaths = [
@@ -491,12 +500,11 @@ in
# 1. no number may appear unshaded more than once in the same row/column # 1. no number may appear unshaded more than once in the same row/column
# 2. no two shaded tiles can be direct N/S/E/W neighbors # 2. no two shaded tiles can be direct N/S/E/W neighbors
# - win once (1) and (2) are satisfied # - win once (1) and (2) are satisfied
"gnome.hitori".buildCost = 1;
"gnome.hitori".sandbox.method = "bwrap"; "gnome.hitori".sandbox.method = "bwrap";
"gnome.hitori".sandbox.wrapperType = "wrappedDerivation";
"gnome.hitori".sandbox.whitelistWayland = true; "gnome.hitori".sandbox.whitelistWayland = true;
gnugrep.sandbox.method = "bwrap"; gnugrep.sandbox.method = "bwrap";
gnugrep.sandbox.wrapperType = "wrappedDerivation";
gnugrep.sandbox.autodetectCliPaths = true; gnugrep.sandbox.autodetectCliPaths = true;
gnugrep.sandbox.whitelistPwd = true; gnugrep.sandbox.whitelistPwd = true;
gnugrep.sandbox.extraHomePaths = [ gnugrep.sandbox.extraHomePaths = [
@@ -505,15 +513,25 @@ in
".persist/plaintext" ".persist/plaintext"
]; ];
# sed: there is an edgecase of `--file=<foo>`, wherein `foo` won't be whitelisted.
gnused.sandbox.method = "bwrap";
gnused.sandbox.autodetectCliPaths = "existingFile";
gnused.sandbox.whitelistPwd = true; #< `-i` flag creates a temporary file in pwd (?) and then moves it.
gpsd = {};
gptfdisk.sandbox.method = "landlock"; gptfdisk.sandbox.method = "landlock";
gptfdisk.sandbox.wrapperType = "wrappedDerivation";
gptfdisk.sandbox.extraPaths = [ gptfdisk.sandbox.extraPaths = [
"/dev" "/dev"
]; ];
gptfdisk.sandbox.autodetectCliPaths = "existing"; #< sometimes you'll use gdisk on a device file. gptfdisk.sandbox.autodetectCliPaths = "existing"; #< sometimes you'll use gdisk on a device file.
grim.sandbox.method = "bwrap";
grim.sandbox.autodetectCliPaths = "existingOrParent";
grim.sandbox.whitelistWayland = true;
hase.buildCost = 1;
hase.sandbox.method = "bwrap"; hase.sandbox.method = "bwrap";
hase.sandbox.wrapperType = "wrappedDerivation";
hase.sandbox.net = "clearnet"; hase.sandbox.net = "clearnet";
hase.sandbox.whitelistAudio = true; hase.sandbox.whitelistAudio = true;
hase.sandbox.whitelistDri = true; hase.sandbox.whitelistDri = true;
@@ -521,35 +539,20 @@ in
# hdparm: has to be run as sudo. e.g. `sudo hdparm -i /dev/sda` # hdparm: has to be run as sudo. e.g. `sudo hdparm -i /dev/sda`
hdparm.sandbox.method = "bwrap"; hdparm.sandbox.method = "bwrap";
hdparm.sandbox.wrapperType = "wrappedDerivation";
hdparm.sandbox.autodetectCliPaths = true; hdparm.sandbox.autodetectCliPaths = true;
host.sandbox.method = "landlock"; host.sandbox.method = "landlock";
host.sandbox.wrapperType = "wrappedDerivation";
host.sandbox.net = "all"; #< technically, only needs to contact localhost's DNS server host.sandbox.net = "all"; #< technically, only needs to contact localhost's DNS server
htop.sandbox.method = "landlock";
htop.sandbox.wrapperType = "wrappedDerivation";
htop.sandbox.extraPaths = [
"/proc"
"/sys/devices"
];
htop.persist.byStore.plaintext = [
# consider setting `show_program_path=0` and either `hide_userland_threads=1` or `show_thread_names=1`
".config/htop"
];
iftop.sandbox.method = "landlock"; iftop.sandbox.method = "landlock";
iftop.sandbox.wrapperType = "wrappedDerivation";
iftop.sandbox.capabilities = [ "net_raw" ]; iftop.sandbox.capabilities = [ "net_raw" ];
# inetutils: ping, ifconfig, hostname, traceroute, whois, .... # inetutils: ping, ifconfig, hostname, traceroute, whois, ....
# N.B.: inetutils' `ping` is shadowed by iputils' ping (by nixos, intentionally). # N.B.: inetutils' `ping` is shadowed by iputils' ping (by nixos, intentionally).
inetutils.sandbox.method = "landlock"; # want to keep the same netns, at least. inetutils.sandbox.method = "landlock"; # want to keep the same netns, at least.
inetutils.sandbox.wrapperType = "wrappedDerivation";
inkscape.buildCost = 1;
inkscape.sandbox.method = "bwrap"; inkscape.sandbox.method = "bwrap";
inkscape.sandbox.wrapperType = "wrappedDerivation";
inkscape.sandbox.whitelistWayland = true; inkscape.sandbox.whitelistWayland = true;
inkscape.sandbox.extraHomePaths = [ inkscape.sandbox.extraHomePaths = [
"Pictures/albums" "Pictures/albums"
@@ -565,7 +568,6 @@ in
inkscape.sandbox.autodetectCliPaths = true; inkscape.sandbox.autodetectCliPaths = true;
iotop.sandbox.method = "landlock"; iotop.sandbox.method = "landlock";
iotop.sandbox.wrapperType = "wrappedDerivation";
iotop.sandbox.extraPaths = [ iotop.sandbox.extraPaths = [
"/proc" "/proc"
]; ];
@@ -573,38 +575,36 @@ in
# provides `ip`, `routel`, others # provides `ip`, `routel`, others
iproute2.sandbox.method = "landlock"; iproute2.sandbox.method = "landlock";
iproute2.sandbox.wrapperType = "wrappedDerivation";
iproute2.sandbox.net = "all"; iproute2.sandbox.net = "all";
iproute2.sandbox.capabilities = [ "net_admin" ]; iproute2.sandbox.capabilities = [ "net_admin" ];
iproute2.sandbox.extraPaths = [
"/run/netns" # for `ip netns ...` to work
"/var/run/netns"
];
iptables.sandbox.method = "landlock"; iptables.sandbox.method = "landlock";
iptables.sandbox.wrapperType = "wrappedDerivation";
iptables.sandbox.net = "all"; iptables.sandbox.net = "all";
iptables.sandbox.capabilities = [ "net_admin" ]; iptables.sandbox.capabilities = [ "net_admin" ];
# iputils provides `ping` (and arping, clockdiff, tracepath) # iputils provides `ping` (and arping, clockdiff, tracepath)
iputils.sandbox.method = "landlock"; iputils.sandbox.method = "landlock";
iputils.sandbox.wrapperType = "wrappedDerivation";
iputils.sandbox.net = "all"; iputils.sandbox.net = "all";
iputils.sandbox.capabilities = [ "net_raw" ]; iputils.sandbox.capabilities = [ "net_raw" ];
iw.sandbox.method = "landlock"; iw.sandbox.method = "landlock";
iw.sandbox.wrapperType = "wrappedDerivation";
iw.sandbox.net = "all"; iw.sandbox.net = "all";
iw.sandbox.capabilities = [ "net_admin" ]; iw.sandbox.capabilities = [ "net_admin" ];
jq.sandbox.method = "bwrap"; jq.sandbox.method = "bwrap";
jq.sandbox.wrapperType = "wrappedDerivation";
jq.sandbox.autodetectCliPaths = "existingFile"; jq.sandbox.autodetectCliPaths = "existingFile";
killall.sandbox.method = "landlock"; killall.sandbox.method = "landlock";
killall.sandbox.wrapperType = "wrappedDerivation";
killall.sandbox.extraPaths = [ killall.sandbox.extraPaths = [
"/proc" "/proc"
]; ];
krita.buildCost = 1;
krita.sandbox.method = "bwrap"; krita.sandbox.method = "bwrap";
krita.sandbox.wrapperType = "wrappedDerivation";
krita.sandbox.whitelistWayland = true; krita.sandbox.whitelistWayland = true;
krita.sandbox.autodetectCliPaths = "existing"; krita.sandbox.autodetectCliPaths = "existing";
krita.sandbox.extraHomePaths = [ krita.sandbox.extraHomePaths = [
@@ -622,11 +622,10 @@ in
libcap_ng.sandbox.enable = false; # there's something about /proc/$pid/fd which breaks `readlink`/stat with every sandbox technique (except capsh-only) libcap_ng.sandbox.enable = false; # there's something about /proc/$pid/fd which breaks `readlink`/stat with every sandbox technique (except capsh-only)
libnotify.sandbox.method = "bwrap"; libnotify.sandbox.method = "bwrap";
libnotify.sandbox.wrapperType = "wrappedDerivation";
libnotify.sandbox.whitelistDbus = [ "user" ]; # notify-send libnotify.sandbox.whitelistDbus = [ "user" ]; # notify-send
losslesscut-bin.buildCost = 1;
losslesscut-bin.sandbox.method = "bwrap"; losslesscut-bin.sandbox.method = "bwrap";
losslesscut-bin.sandbox.wrapperType = "wrappedDerivation";
losslesscut-bin.sandbox.extraHomePaths = [ losslesscut-bin.sandbox.extraHomePaths = [
"Music" "Music"
"Pictures/from" # videos from e.g. mobile phone "Pictures/from" # videos from e.g. mobile phone
@@ -641,53 +640,38 @@ in
losslesscut-bin.sandbox.whitelistX = true; losslesscut-bin.sandbox.whitelistX = true;
lsof.sandbox.method = "capshonly"; # lsof doesn't sandbox under bwrap or even landlock w/ full access to / lsof.sandbox.method = "capshonly"; # lsof doesn't sandbox under bwrap or even landlock w/ full access to /
lsof.sandbox.wrapperType = "wrappedDerivation"; lsof.sandbox.capabilities = [ "dac_override" "sys_ptrace" ];
"mate.engrampa".sandbox.method = "bwrap"; # TODO:sandbox: untested lua = {};
"mate.engrampa".sandbox.wrapperType = "inplace";
"mate.engrampa".sandbox.whitelistWayland = true;
"mate.engrampa".sandbox.autodetectCliPaths = "existingOrParent";
"mate.engrampa".sandbox.extraHomePaths = [
"archive"
"Books/local"
"Books/servo"
"records"
"ref"
"tmp"
];
mercurial.sandbox.method = "bwrap"; # TODO:sandbox: untested mercurial.sandbox.method = "bwrap"; # TODO:sandbox: untested
mercurial.sandbox.wrapperType = "wrappedDerivation";
mercurial.sandbox.net = "clearnet"; mercurial.sandbox.net = "clearnet";
mercurial.sandbox.whitelistPwd = true; mercurial.sandbox.whitelistPwd = true;
# actual monero blockchain (not wallet/etc; safe to delete, just slow to regenerate) # actual monero blockchain (not wallet/etc; safe to delete, just slow to regenerate)
monero-gui.buildCost = 1;
# XXX: is it really safe to persist this? it doesn't have info that could de-anonymize if captured? # XXX: is it really safe to persist this? it doesn't have info that could de-anonymize if captured?
monero-gui.persist.byStore.plaintext = [ ".bitmonero" ]; monero-gui.persist.byStore.plaintext = [ ".bitmonero" ];
monero-gui.sandbox.method = "bwrap"; monero-gui.sandbox.method = "bwrap";
monero-gui.sandbox.wrapperType = "wrappedDerivation";
monero-gui.sandbox.net = "all"; monero-gui.sandbox.net = "all";
monero-gui.sandbox.extraHomePaths = [ monero-gui.sandbox.extraHomePaths = [
"records/finance/cryptocurrencies/monero" "records/finance/cryptocurrencies/monero"
]; ];
mumble.buildCost = 1;
mumble.persist.byStore.private = [ ".local/share/Mumble" ]; mumble.persist.byStore.private = [ ".local/share/Mumble" ];
nano.sandbox.method = "bwrap"; nano.sandbox.method = "bwrap";
nano.sandbox.wrapperType = "wrappedDerivation";
nano.sandbox.autodetectCliPaths = "existingFileOrParent"; nano.sandbox.autodetectCliPaths = "existingFileOrParent";
netcat.sandbox.method = "landlock"; netcat.sandbox.method = "landlock";
netcat.sandbox.wrapperType = "wrappedDerivation";
netcat.sandbox.net = "all"; netcat.sandbox.net = "all";
nethogs.sandbox.method = "capshonly"; # *partially* works under landlock w/ full access to / nethogs.sandbox.method = "capshonly"; # *partially* works under landlock w/ full access to /
nethogs.sandbox.wrapperType = "wrappedDerivation";
nethogs.sandbox.capabilities = [ "net_admin" "net_raw" ]; nethogs.sandbox.capabilities = [ "net_admin" "net_raw" ];
# provides `arp`, `hostname`, `route`, `ifconfig` # provides `arp`, `hostname`, `route`, `ifconfig`
nettools.sandbox.method = "landlock"; nettools.sandbox.method = "landlock";
nettools.sandbox.wrapperType = "wrappedDerivation";
nettools.sandbox.net = "all"; nettools.sandbox.net = "all";
nettools.sandbox.capabilities = [ "net_admin" "net_raw" ]; nettools.sandbox.capabilities = [ "net_admin" "net_raw" ];
nettools.sandbox.extraPaths = [ nettools.sandbox.extraPaths = [
@@ -695,7 +679,6 @@ in
]; ];
networkmanagerapplet.sandbox.method = "bwrap"; networkmanagerapplet.sandbox.method = "bwrap";
networkmanagerapplet.sandbox.wrapperType = "wrappedDerivation";
networkmanagerapplet.sandbox.whitelistWayland = true; networkmanagerapplet.sandbox.whitelistWayland = true;
networkmanagerapplet.sandbox.whitelistDbus = [ "system" ]; networkmanagerapplet.sandbox.whitelistDbus = [ "system" ];
@@ -708,18 +691,17 @@ in
]; ];
nmap.sandbox.method = "bwrap"; nmap.sandbox.method = "bwrap";
nmap.sandbox.wrapperType = "wrappedDerivation";
nmap.sandbox.net = "all"; # clearnet and lan nmap.sandbox.net = "all"; # clearnet and lan
nmon.sandbox.method = "landlock"; nmon.sandbox.method = "landlock";
nmon.sandbox.wrapperType = "wrappedDerivation";
nmon.sandbox.extraPaths = [ nmon.sandbox.extraPaths = [
"/proc" "/proc"
]; ];
nodejs = {};
# `nvme list` only shows results when run as root. # `nvme list` only shows results when run as root.
nvme-cli.sandbox.method = "landlock"; nvme-cli.sandbox.method = "landlock";
nvme-cli.sandbox.wrapperType = "wrappedDerivation";
nvme-cli.sandbox.extraPaths = [ nvme-cli.sandbox.extraPaths = [
"/sys/devices" "/sys/devices"
"/sys/class/nvme" "/sys/class/nvme"
@@ -731,25 +713,23 @@ in
# contains only `oathtool`, which i only use for evaluating TOTP codes from CLI/stdin # contains only `oathtool`, which i only use for evaluating TOTP codes from CLI/stdin
oath-toolkit.sandbox.method = "bwrap"; oath-toolkit.sandbox.method = "bwrap";
oath-toolkit.sandbox.wrapperType = "wrappedDerivation";
# settings (electron app) # settings (electron app)
obsidian.persist.byStore.plaintext = [ ".config/obsidian" ]; obsidian.persist.byStore.plaintext = [ ".config/obsidian" ];
parted.sandbox.method = "landlock"; parted.sandbox.method = "landlock";
parted.sandbox.wrapperType = "wrappedDerivation";
parted.sandbox.extraPaths = [ parted.sandbox.extraPaths = [
"/dev" "/dev"
]; ];
parted.sandbox.autodetectCliPaths = "existing"; #< sometimes you'll use parted on a device file. parted.sandbox.autodetectCliPaths = "existing"; #< sometimes you'll use parted on a device file.
patchelf = {};
pavucontrol.sandbox.method = "bwrap"; pavucontrol.sandbox.method = "bwrap";
pavucontrol.sandbox.wrapperType = "wrappedDerivation";
pavucontrol.sandbox.whitelistAudio = true; pavucontrol.sandbox.whitelistAudio = true;
pavucontrol.sandbox.whitelistWayland = true; pavucontrol.sandbox.whitelistWayland = true;
pciutils.sandbox.method = "landlock"; pciutils.sandbox.method = "landlock";
pciutils.sandbox.wrapperType = "wrappedDerivation";
pciutils.sandbox.extraPaths = [ pciutils.sandbox.extraPaths = [
"/sys/bus/pci" "/sys/bus/pci"
"/sys/devices" "/sys/devices"
@@ -758,7 +738,6 @@ in
"perlPackages.FileMimeInfo".sandbox.enable = false; #< TODO: sandbox `mimetype` but not `mimeopen`. "perlPackages.FileMimeInfo".sandbox.enable = false; #< TODO: sandbox `mimetype` but not `mimeopen`.
powertop.sandbox.method = "landlock"; powertop.sandbox.method = "landlock";
powertop.sandbox.wrapperType = "wrappedDerivation";
powertop.sandbox.capabilities = [ "ipc_lock" "sys_admin" ]; powertop.sandbox.capabilities = [ "ipc_lock" "sys_admin" ];
powertop.sandbox.extraPaths = [ powertop.sandbox.extraPaths = [
"/proc" "/proc"
@@ -767,26 +746,33 @@ in
"/sys/kernel" "/sys/kernel"
]; ];
# procps: free, pgrep, pidof, pkill, ps, pwait, top, uptime, couple others
procps.sandbox.method = "bwrap";
procps.sandbox.extraConfig = [
"--sane-sandbox-keep-namespace" "pid"
];
pstree.sandbox.method = "landlock"; pstree.sandbox.method = "landlock";
pstree.sandbox.wrapperType = "wrappedDerivation";
pstree.sandbox.extraPaths = [ pstree.sandbox.extraPaths = [
"/proc" "/proc"
]; ];
pulseaudio = {};
pulsemixer.sandbox.method = "landlock"; pulsemixer.sandbox.method = "landlock";
pulsemixer.sandbox.wrapperType = "wrappedDerivation";
pulsemixer.sandbox.whitelistAudio = true; pulsemixer.sandbox.whitelistAudio = true;
pwvucontrol.buildCost = 1;
pwvucontrol.sandbox.method = "bwrap"; pwvucontrol.sandbox.method = "bwrap";
pwvucontrol.sandbox.wrapperType = "wrappedDerivation";
pwvucontrol.sandbox.whitelistAudio = true; pwvucontrol.sandbox.whitelistAudio = true;
pwvucontrol.sandbox.whitelistDri = true; # else perf on moby is unusable
pwvucontrol.sandbox.whitelistWayland = true; pwvucontrol.sandbox.whitelistWayland = true;
python3-repl.packageUnwrapped = pkgs.python3.withPackages (ps: with ps; [ python3-repl.packageUnwrapped = pkgs.python3.withPackages (ps: with ps; [
psutil
requests requests
]); ]);
python3-repl.sandbox.method = "bwrap"; python3-repl.sandbox.method = "bwrap";
python3-repl.sandbox.wrapperType = "wrappedDerivation";
python3-repl.sandbox.net = "clearnet"; python3-repl.sandbox.net = "clearnet";
python3-repl.sandbox.extraHomePaths = [ python3-repl.sandbox.extraHomePaths = [
"/" "/"
@@ -794,30 +780,38 @@ in
]; ];
qemu.sandbox.enable = false; #< it's a launcher qemu.sandbox.enable = false; #< it's a launcher
qemu.slowToBuild = true; qemu.buildCost = 2;
rsync.sandbox.method = "bwrap"; rsync.sandbox.method = "bwrap";
rsync.sandbox.wrapperType = "wrappedDerivation";
rsync.sandbox.net = "clearnet"; rsync.sandbox.net = "clearnet";
rsync.sandbox.autodetectCliPaths = "existingOrParent"; rsync.sandbox.autodetectCliPaths = "existingOrParent";
rustc = {};
sane-cast = {}; #< TODO: sandbox this the same way i sandbox go2tv
sane-die-with-parent.sandbox.enable = false; #< it's a launcher; can't sandbox
screen.sandbox.enable = false; #< tty; needs to run anything screen.sandbox.enable = false; #< tty; needs to run anything
sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested
sequoia.sandbox.wrapperType = "wrappedDerivation"; # slow to build
sequoia.sandbox.whitelistPwd = true; sequoia.sandbox.whitelistPwd = true;
sequoia.sandbox.autodetectCliPaths = true; sequoia.sandbox.autodetectCliPaths = true;
shattered-pixel-dungeon.buildCost = 1;
shattered-pixel-dungeon.persist.byStore.plaintext = [ ".local/share/.shatteredpixel/shattered-pixel-dungeon" ]; shattered-pixel-dungeon.persist.byStore.plaintext = [ ".local/share/.shatteredpixel/shattered-pixel-dungeon" ];
shattered-pixel-dungeon.sandbox.method = "bwrap"; shattered-pixel-dungeon.sandbox.method = "bwrap";
shattered-pixel-dungeon.sandbox.wrapperType = "wrappedDerivation";
shattered-pixel-dungeon.sandbox.whitelistAudio = true; shattered-pixel-dungeon.sandbox.whitelistAudio = true;
shattered-pixel-dungeon.sandbox.whitelistDri = true; shattered-pixel-dungeon.sandbox.whitelistDri = true;
shattered-pixel-dungeon.sandbox.whitelistWayland = true; shattered-pixel-dungeon.sandbox.whitelistWayland = true;
# printer/filament settings # printer/filament settings
slic3r.buildCost = 1;
slic3r.persist.byStore.plaintext = [ ".Slic3r" ]; slic3r.persist.byStore.plaintext = [ ".Slic3r" ];
slurp.sandbox.method = "bwrap";
slurp.sandbox.whitelistWayland = true;
# use like `sudo smartctl /dev/sda -a` # use like `sudo smartctl /dev/sda -a`
smartmontools.sandbox.method = "landlock"; smartmontools.sandbox.method = "landlock";
smartmontools.sandbox.wrapperType = "inplace"; # ships a script in /etc that calls into its bin smartmontools.sandbox.wrapperType = "inplace"; # ships a script in /etc that calls into its bin
@@ -825,17 +819,16 @@ in
smartmontools.sandbox.capabilities = [ "sys_rawio" ]; smartmontools.sandbox.capabilities = [ "sys_rawio" ];
sops.sandbox.method = "bwrap"; # TODO:sandbox: untested sops.sandbox.method = "bwrap"; # TODO:sandbox: untested
sops.sandbox.wrapperType = "wrappedDerivation";
sops.sandbox.extraHomePaths = [ sops.sandbox.extraHomePaths = [
".config/sops" ".config/sops"
"dev/nixos" "nixos"
# TODO: sops should only need access to knowledge/secrets, # TODO: sops should only need access to knowledge/secrets,
# except that i currently put its .sops.yaml config in the root of ~/knowledge # except that i currently put its .sops.yaml config in the root of ~/knowledge
"knowledge" "knowledge"
]; ];
soundconverter.buildCost = 1;
soundconverter.sandbox.method = "bwrap"; soundconverter.sandbox.method = "bwrap";
soundconverter.sandbox.wrapperType = "wrappedDerivation";
soundconverter.sandbox.whitelistWayland = true; soundconverter.sandbox.whitelistWayland = true;
soundconverter.sandbox.extraHomePaths = [ soundconverter.sandbox.extraHomePaths = [
"Music" "Music"
@@ -849,29 +842,31 @@ in
soundconverter.sandbox.autodetectCliPaths = "existingOrParent"; soundconverter.sandbox.autodetectCliPaths = "existingOrParent";
sox.sandbox.method = "bwrap"; sox.sandbox.method = "bwrap";
sox.sandbox.wrapperType = "wrappedDerivation";
sox.sandbox.autodetectCliPaths = "existingFileOrParent"; sox.sandbox.autodetectCliPaths = "existingFileOrParent";
sox.sandbox.whitelistAudio = true; sox.sandbox.whitelistAudio = true;
space-cadet-pinball.buildCost = 1;
space-cadet-pinball.persist.byStore.plaintext = [ ".local/share/SpaceCadetPinball" ]; space-cadet-pinball.persist.byStore.plaintext = [ ".local/share/SpaceCadetPinball" ];
space-cadet-pinball.sandbox.method = "bwrap"; space-cadet-pinball.sandbox.method = "bwrap";
space-cadet-pinball.sandbox.wrapperType = "wrappedDerivation";
space-cadet-pinball.sandbox.whitelistAudio = true; space-cadet-pinball.sandbox.whitelistAudio = true;
space-cadet-pinball.sandbox.whitelistDri = true; space-cadet-pinball.sandbox.whitelistDri = true;
space-cadet-pinball.sandbox.whitelistWayland = true; space-cadet-pinball.sandbox.whitelistWayland = true;
speedtest-cli.sandbox.method = "bwrap"; speedtest-cli.sandbox.method = "bwrap";
speedtest-cli.sandbox.wrapperType = "wrappedDerivation";
speedtest-cli.sandbox.net = "all"; speedtest-cli.sandbox.net = "all";
sqlite = {};
sshfs-fuse = {}; # used by fs.nix
strace.sandbox.enable = false; #< needs to `exec` its args, and therefore support *anything* strace.sandbox.enable = false; #< needs to `exec` its args, and therefore support *anything*
subversion.sandbox.method = "bwrap"; subversion.sandbox.method = "bwrap";
subversion.sandbox.wrapperType = "wrappedDerivation";
subversion.sandbox.net = "clearnet"; subversion.sandbox.net = "clearnet";
subversion.sandbox.whitelistPwd = true; subversion.sandbox.whitelistPwd = true;
sudo.sandbox.enable = false; sudo.sandbox.enable = false;
superTux.buildCost = 1;
superTux.sandbox.method = "bwrap"; superTux.sandbox.method = "bwrap";
superTux.sandbox.wrapperType = "inplace"; # package Makefile incorrectly installs to $out/games/superTux instead of $out/share/games superTux.sandbox.wrapperType = "inplace"; # package Makefile incorrectly installs to $out/games/superTux instead of $out/share/games
superTux.sandbox.whitelistAudio = true; superTux.sandbox.whitelistAudio = true;
@@ -879,23 +874,26 @@ in
superTux.sandbox.whitelistWayland = true; superTux.sandbox.whitelistWayland = true;
superTux.persist.byStore.plaintext = [ ".local/share/supertux2" ]; superTux.persist.byStore.plaintext = [ ".local/share/supertux2" ];
swappy.sandbox.method = "bwrap";
swappy.sandbox.autodetectCliPaths = "existingFileOrParent";
swappy.sandbox.whitelistWayland = true;
tcpdump.sandbox.method = "landlock"; tcpdump.sandbox.method = "landlock";
tcpdump.sandbox.wrapperType = "wrappedDerivation";
tcpdump.sandbox.net = "all"; tcpdump.sandbox.net = "all";
tcpdump.sandbox.autodetectCliPaths = "existingFileOrParent"; tcpdump.sandbox.autodetectCliPaths = "existingFileOrParent";
tcpdump.sandbox.capabilities = [ "net_admin" "net_raw" ]; tcpdump.sandbox.capabilities = [ "net_admin" "net_raw" ];
tdesktop.persist.byStore.private = [ ".local/share/TelegramDesktop" ]; tdesktop.persist.byStore.private = [ ".local/share/TelegramDesktop" ];
tokodon.buildCost = 1;
tokodon.persist.byStore.private = [ ".cache/KDE/tokodon" ]; tokodon.persist.byStore.private = [ ".cache/KDE/tokodon" ];
tree.sandbox.method = "landlock"; tree.sandbox.method = "landlock";
tree.sandbox.wrapperType = "wrappedDerivation";
tree.sandbox.autodetectCliPaths = true; tree.sandbox.autodetectCliPaths = true;
tree.sandbox.whitelistPwd = true; tree.sandbox.whitelistPwd = true;
tumiki-fighters.buildCost = 1;
tumiki-fighters.sandbox.method = "bwrap"; tumiki-fighters.sandbox.method = "bwrap";
tumiki-fighters.sandbox.wrapperType = "wrappedDerivation";
tumiki-fighters.sandbox.whitelistAudio = true; tumiki-fighters.sandbox.whitelistAudio = true;
tumiki-fighters.sandbox.whitelistDri = true; #< not strictly necessary, but triples CPU perf tumiki-fighters.sandbox.whitelistDri = true; #< not strictly necessary, but triples CPU perf
tumiki-fighters.sandbox.whitelistWayland = true; tumiki-fighters.sandbox.whitelistWayland = true;
@@ -904,34 +902,32 @@ in
util-linux.sandbox.enable = false; #< TODO: possible to sandbox if i specific a different profile for each of its ~50 binaries util-linux.sandbox.enable = false; #< TODO: possible to sandbox if i specific a different profile for each of its ~50 binaries
unzip.sandbox.method = "bwrap"; unzip.sandbox.method = "bwrap";
unzip.sandbox.wrapperType = "wrappedDerivation";
unzip.sandbox.autodetectCliPaths = "existingOrParent"; unzip.sandbox.autodetectCliPaths = "existingOrParent";
unzip.sandbox.whitelistPwd = true; unzip.sandbox.whitelistPwd = true;
usbutils.sandbox.method = "bwrap"; # breaks `usbhid-dump`, but `lsusb`, `usb-devices` work usbutils.sandbox.method = "bwrap"; # breaks `usbhid-dump`, but `lsusb`, `usb-devices` work
usbutils.sandbox.wrapperType = "wrappedDerivation";
usbutils.sandbox.extraPaths = [ usbutils.sandbox.extraPaths = [
"/sys/devices" "/sys/devices"
"/sys/bus/usb" "/sys/bus/usb"
]; ];
valgrind.buildCost = 1;
valgrind.sandbox.enable = false; #< it's a launcher: can't sandbox
visidata.sandbox.method = "bwrap"; # TODO:sandbox: untested visidata.sandbox.method = "bwrap"; # TODO:sandbox: untested
visidata.sandbox.wrapperType = "wrappedDerivation";
visidata.sandbox.autodetectCliPaths = true; visidata.sandbox.autodetectCliPaths = true;
# `vulkaninfo`, `vkcube` # `vulkaninfo`, `vkcube`
vulkan-tools.sandbox.method = "landlock"; vulkan-tools.sandbox.method = "landlock";
vulkan-tools.sandbox.wrapperType = "wrappedDerivation";
vvvvvv.buildCost = 1;
vvvvvv.sandbox.method = "bwrap"; vvvvvv.sandbox.method = "bwrap";
vvvvvv.sandbox.wrapperType = "wrappedDerivation";
vvvvvv.sandbox.whitelistAudio = true; vvvvvv.sandbox.whitelistAudio = true;
vvvvvv.sandbox.whitelistDri = true; #< playable without, but burns noticably more CPU vvvvvv.sandbox.whitelistDri = true; #< playable without, but burns noticably more CPU
vvvvvv.sandbox.whitelistWayland = true; vvvvvv.sandbox.whitelistWayland = true;
vvvvvv.persist.byStore.plaintext = [ ".local/share/VVVVVV" ]; vvvvvv.persist.byStore.plaintext = [ ".local/share/VVVVVV" ];
w3m.sandbox.method = "bwrap"; w3m.sandbox.method = "bwrap";
w3m.sandbox.wrapperType = "wrappedDerivation";
w3m.sandbox.net = "all"; w3m.sandbox.net = "all";
w3m.sandbox.extraHomePaths = [ w3m.sandbox.extraHomePaths = [
# little-used feature, but you can save web pages :) # little-used feature, but you can save web pages :)
@@ -939,52 +935,46 @@ in
]; ];
wdisplays.sandbox.method = "bwrap"; wdisplays.sandbox.method = "bwrap";
wdisplays.sandbox.wrapperType = "wrappedDerivation";
wdisplays.sandbox.whitelistWayland = true; wdisplays.sandbox.whitelistWayland = true;
wget.sandbox.method = "bwrap"; wget.sandbox.method = "bwrap";
wget.sandbox.wrapperType = "wrappedDerivation";
wget.sandbox.net = "all"; wget.sandbox.net = "all";
wget.sandbox.whitelistPwd = true; # saves to pwd by default wget.sandbox.whitelistPwd = true; # saves to pwd by default
whalebird.buildCost = 1;
whalebird.persist.byStore.private = [ ".config/Whalebird" ]; whalebird.persist.byStore.private = [ ".config/Whalebird" ];
# `wg`, `wg-quick` # `wg`, `wg-quick`
wireguard-tools.sandbox.method = "landlock"; wireguard-tools.sandbox.method = "landlock";
wireguard-tools.sandbox.wrapperType = "wrappedDerivation";
wireguard-tools.sandbox.capabilities = [ "net_admin" ]; wireguard-tools.sandbox.capabilities = [ "net_admin" ];
# provides `iwconfig`, `iwlist`, `iwpriv`, ... # provides `iwconfig`, `iwlist`, `iwpriv`, ...
wirelesstools.sandbox.method = "landlock"; wirelesstools.sandbox.method = "landlock";
wirelesstools.sandbox.wrapperType = "wrappedDerivation";
wirelesstools.sandbox.capabilities = [ "net_admin" ]; wirelesstools.sandbox.capabilities = [ "net_admin" ];
wl-clipboard.sandbox.method = "bwrap"; wl-clipboard.sandbox.method = "bwrap";
wl-clipboard.sandbox.wrapperType = "wrappedDerivation";
wl-clipboard.sandbox.whitelistWayland = true; wl-clipboard.sandbox.whitelistWayland = true;
wtype = {};
xwayland.sandbox.method = "bwrap"; xwayland.sandbox.method = "bwrap";
xwayland.sandbox.wrapperType = "inplace"; #< consumers use it as a library (e.g. wlroots) xwayland.sandbox.wrapperType = "inplace"; #< consumers use it as a library (e.g. wlroots)
xwayland.sandbox.whitelistWayland = true; #< just assuming this is needed xwayland.sandbox.whitelistWayland = true; #< just assuming this is needed
xwayland.sandbox.net = "clearnet"; #< just assuming this is needed (X11 traffic) xwayland.sandbox.whitelistX = true;
xwayland.sandbox.whitelistDri = true; #< would assume this gives better gfx perf xwayland.sandbox.whitelistDri = true; #< would assume this gives better gfx perf
xdg-terminal-exec.sandbox.enable = false; # xdg-terminal-exec is a launcher for $TERM
xterm.sandbox.enable = false; # need to be able to do everything xterm.sandbox.enable = false; # need to be able to do everything
yarn.persist.byStore.plaintext = [ ".cache/yarn" ]; yarn.persist.byStore.plaintext = [ ".cache/yarn" ];
yt-dlp.sandbox.method = "bwrap"; # TODO:sandbox: untested yt-dlp.sandbox.method = "bwrap"; # TODO:sandbox: untested
yt-dlp.sandbox.wrapperType = "wrappedDerivation";
yt-dlp.sandbox.net = "all"; yt-dlp.sandbox.net = "all";
yt-dlp.sandbox.whitelistPwd = true; # saves to pwd by default yt-dlp.sandbox.whitelistPwd = true; # saves to pwd by default
zfs = {};
}; };
programs.feedbackd = lib.mkIf config.sane.programs.feedbackd.enabled { programs.feedbackd = lib.mkIf config.sane.programs.feedbackd.enabled {
enable = true; enable = true;
}; };
programs.firejail = lib.mkIf config.sane.programs.firejail.enabled {
enable = true; #< install the suid binary
};
} }

View File

@@ -1,3 +1,8 @@
# tips/tricks
# - audio recording
# - default recording input will be silent, on lappy.
# - Audio Setup -> Rescan Audio Devices ...
# - Audio Setup -> Recording device -> sysdefault
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.audacity = { sane.programs.audacity = {
@@ -9,8 +14,9 @@
}; };
}; };
buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.autodetectCliPaths = true; sandbox.autodetectCliPaths = true;
@@ -21,6 +27,9 @@
# audacity needs the entire config dir mounted if running in a sandbox # audacity needs the entire config dir mounted if running in a sandbox
".config/audacity" ".config/audacity"
]; ];
sandbox.extraPaths = [
"/dev/snd" # for recording audio inputs to work
];
# disable first-run splash screen # disable first-run splash screen
fs.".config/audacity/audacity.cfg".file.text = '' fs.".config/audacity/audacity.cfg".file.text = ''

View File

@@ -88,7 +88,6 @@ in
{ {
sane.programs.bemenu = { sane.programs.bemenu = {
sandbox.method = "bwrap"; # landlock works, but requires *all* of /run/user/$ID to be granted. sandbox.method = "bwrap"; # landlock works, but requires *all* of /run/user/$ID to be granted.
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [ sandbox.extraHomePaths = [
".cache/fontconfig" #< else it complains, and is *way* slower ".cache/fontconfig" #< else it complains, and is *way* slower

View File

@@ -0,0 +1,163 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p blast-ugjka
# vim: set filetype=python :
import logging
import socket
import subprocess
from enum import Enum
logger = logging.getLogger(__name__)
# map from known devices -> required flags
DEVICE_MAP = {
"Theater TV": [],
"[LG] webOS TV OLED55C9PUA": [ "-usewav" ],
}
def get_ranked_ip_addrs():
"""
return the IP addresses most likely to be LAN addresses
based on: <https://stackoverflow.com/a/1267524>
"""
_name, _aliases, static_addrs = socket.gethostbyname_ex(socket.gethostname())
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("1", 53))
con_addr, _port = s.getsockname()
return sorted(set(static_addrs + [ con_addr ]), key=lambda a: (a.startswith("127"), a))
class ParserState(Enum):
Break = "break"
Receiver = "receiver"
Ips = "ip"
class Status(Enum):
Continue = "continue"
Error = "error"
RedoWithFlags = "redo_with_flags"
Launched = "launched"
class BlastDriver:
parsing: ParserState | None = None
last_write: str | None = None
def __init__(self, blast_flags: list[str] = []):
self.ranked_ips = get_ranked_ip_addrs()
self.blast = subprocess.Popen(
["blast", "-source", "blast.monitor"] + blast_flags,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
self.blast_flags = list(blast_flags)
self.receiver_names = []
self.ips = []
def writeline(self, line: str) -> None:
logger.debug("[send] %s", line)
self.blast.stdin.write(f"{line}\n".encode())
self.blast.stdin.flush()
self.last_write = line
def readline(self) -> str:
line = self.blast.stdout.readline().decode('utf-8').strip()
line = line.replace('\x1b[1A\x1b[K', '') #< escape codes
logger.debug("[recv] %r", line)
return line
def set_state(self, state: ParserState):
logger.debug("[pars] %s", state)
self.parsing = state
def feedline(self, line: str) -> (Status, str|None):
"""
apply a line from blast's stdout to modify parser state.
returns a status code (e.g. Status.Continue), and optionally a reply to send back to blast.
"""
if line == "Loading...":
return Status.Continue, None
elif line == "----------":
self.set_state(ParserState.Break)
return Status.Continue, None
elif line == "DLNA receivers":
self.set_state(ParserState.Receiver)
return Status.Continue, None
elif line == "Your LAN ip addresses":
self.set_state(ParserState.Ips)
return Status.Continue, None
elif line == "Select the DLNA device:":
assert len(self.receiver_names) == 1, self.receiver_names
name = self.receiver_names[0]
if name in DEVICE_MAP and DEVICE_MAP[name] != self.blast_flags:
return Status.RedoWithFlags, None
return Status.Continue, "0"
elif line == "Select the lan IP address for the stream:":
for r in self.ranked_ips:
if r in self.ips:
return Status.Launched, str(self.ips.index(r))
# fallback: just guess the best IP
return Status.Launched, "0"
elif self.parsing == ParserState.Receiver:
id_, name = line.split(": ")
assert id_ == str(len(self.receiver_names)), (id_, self.receiver_names)
self.receiver_names.append(name)
return Status.Continue, None
elif self.parsing == ParserState.Ips:
id_, ip = line.split(": ")
assert id_ == str(len(self.ips)), (id_, self.ips)
self.ips.append(ip)
return Status.Continue, None
elif line == f"[{self.last_write}]":
# it's echoing to us what we wrote
return Status.Continue, None
# elif line == "":
# return Status.Continue, None
else:
logger.info("unrecognized output (state=%s): %r", self.parsing, line)
return Status.Error, None
def step(self) -> Status:
"""
advance the interaction between us and blast.
reads a line from blast, modifies internal state, maybe sends a reply.
could block indefinitely.
"""
line = self.readline()
status, reply = self.feedline(line)
if reply is not None:
self.writeline(reply)
return status
def try_blast(*args, **kwargs) -> BlastDriver | None:
blast = BlastDriver(*args, **kwargs)
status = Status.Continue
while status == Status.Continue:
status = blast.step()
if status == Status.RedoWithFlags:
dev = blast.receiver_names[0]
blast_flags = DEVICE_MAP[dev]
logger.info("re-exec blast for %s with flags: %r", dev, blast_flags)
blast.blast.terminate()
return try_blast(blast_flags=blast_flags)
elif status == Status.Error:
logger.info("blast error => terminating")
blast.blast.terminate()
else:
# successfully launched
return blast
def main():
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
blast = try_blast()
if blast is not None:
logger.info("waiting until blast exits")
blast.blast.wait()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,51 @@
# blast: tunnel audio from a pulseaudio sink to a UPnP/DLNA device (like a TV).
# - expect 7s of latency
# - can cast the default sink, or create a new one "blast.monitor"
# and either assign that to default or assign apps to it.
# compatibility:
# - there is no single invocation which will be compatible with all known devices.
# - sony tv:
# - `blast` (default): WORKS
# - `-usewav`: FAILS
# - LG TV:
# - `-usewav`: WORKS!
# - `-useaac`: FAILS
# - `-useflac`: FAILS
# - `-uselpcm`: FAILS
# - `-uselpcmle`: FAILS
# - `-format aac`: FAILS
# - `-bitrate 128`: FAILS
# - `-nochunked`: FAILS
# - `-format "ogg" -mime 'audio/x-opus+ogg'`: FAILS
# - `-mime audio/ac3 -format ac3`: FAILS
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.blast-ugjka;
in
{
sane.programs.blast-ugjka = {
sandbox.method = "bwrap";
sandbox.whitelistAudio = true;
sandbox.net = "clearnet";
};
sane.programs.blast-to-default = {
# helper to deal with blast's interactive CLI
packageUnwrapped = pkgs.static-nix-shell.mkPython3Bin {
pname = "blast-to-default";
pkgs = [ "blast-ugjka" ];
srcRoot = ./.;
};
sandbox.method = "bwrap";
sandbox.whitelistAudio = true;
sandbox.net = "clearnet";
sandbox.extraConfig = [
# else it fails to reap its children (or, maybe, it fails to hook its parent's death signal?)
# might be possible to remove this, but kinda hard to see a clean way.
"--sane-sandbox-keep-namespace" "pid"
];
suggestedPrograms = [ "blast-ugjka" "sane-die-with-parent" ];
};
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enabled [ 9000 ];
}

View File

@@ -99,32 +99,23 @@ in
type = types.listOf transitionType; type = types.listOf transitionType;
default = []; default = [];
}; };
configFile = mkOption {
type = types.path;
default = pkgs.writeText "bonsai_tree.json" (builtins.toJSON cfg.config.transitions);
description = ''
configuration file to pass to bonsai.
usually auto-generated from the sibling options; exposed mainly for debugging or convenience.
'';
};
}; };
}; };
}; };
fs.".config/bonsai/bonsai_tree.json".symlink.text = builtins.toJSON cfg.config.transitions;
sandbox.method = "bwrap";
sandbox.extraRuntimePaths = [
"/" #< just needs "bonsai", but needs to create it first...
];
services.bonsaid = { services.bonsaid = {
description = "bonsai: programmable input dispatcher"; description = "bonsai: programmable input dispatcher";
after = [ "graphical-session.target" ]; partOf = [ "graphical-session" ];
wantedBy = [ "graphical-session.target" ]; # nice -n -11 chosen arbitrarily. i hope this will allow for faster response to inputs, but without audio underruns (pipewire is -21, dino -15-ish)
command = "nice -n -11 bonsaid -t $HOME/.config/bonsai/bonsai_tree.json";
script = '' cleanupCommand = "rm -f $XDG_RUNTIME_DIR/bonsai";
${pkgs.coreutils}/bin/rm -f $XDG_RUNTIME_DIR/bonsai
exec ${cfg.package}/bin/bonsaid -t ${cfg.config.configFile}
'';
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "5s";
};
}; };
}; };
} }

View File

@@ -21,12 +21,12 @@
# note that invoking bwrap with capabilities in the 'init' namespace does NOT grant the sandboxed process # note that invoking bwrap with capabilities in the 'init' namespace does NOT grant the sandboxed process
# capabilities in the 'init' namespace. it's a limitation of namespaces that namespaced processes can # capabilities in the 'init' namespace. it's a limitation of namespaces that namespaced processes can
# never receive capabilities in their parent namespace. # never receive capabilities in their parent namespace.
substituteInPlace bubblewrap.c --replace \ substituteInPlace bubblewrap.c --replace-fail \
'die ("Unexpected capabilities but not setuid, old file caps config?");' \ 'die ("Unexpected capabilities but not setuid, old file caps config?");' \
'// die ("Unexpected capabilities but not setuid, old file caps config?");' '// die ("Unexpected capabilities but not setuid, old file caps config?");'
# enable debug printing # enable debug printing
# substituteInPlace utils.h --replace \ # substituteInPlace utils.h --replace-fail \
# '#define __debug__(x)' \ # '#define __debug__(x)' \
# '#define __debug__(x) printf x' # '#define __debug__(x) printf x'
''; '';

View File

@@ -44,15 +44,9 @@ in
services.gnome-calls = { services.gnome-calls = {
# TODO: prevent gnome-calls from daemonizing when started manually # TODO: prevent gnome-calls from daemonizing when started manually
description = "gnome-calls daemon to monitor incoming SIP calls"; description = "gnome-calls daemon to monitor incoming SIP calls";
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
serviceConfig = { # add --verbose for more debugging
# add --verbose for more debugging command = "env G_MESSAGES_DEBUG=all gnome-calls --daemon";
ExecStart = "${cfg.package}/bin/gnome-calls --daemon";
Type = "simple";
Restart = "always";
RestartSec = "10s";
};
environment.G_MESSAGES_DEBUG = "all";
}; };
}; };
programs.calls = lib.mkIf cfg.enabled { programs.calls = lib.mkIf cfg.enabled {

View File

@@ -0,0 +1,19 @@
{ ... }:
{
sane.programs.celeste64 = {
buildCost = 1;
sandbox.method = "bwrap";
sandbox.whitelistAudio = true;
sandbox.whitelistDri = true;
sandbox.whitelistWayland = true;
sandbox.extraPaths = [
"/dev/input" #< for controllers
];
persist.byStore.plaintext = [
# save data, controls map
".local/share/Celeste64"
];
};
}

View File

@@ -1,4 +1,4 @@
{ config, pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.conky = { sane.programs.conky = {
# TODO: non-sandboxed `conky` still ships via `sxmo-utils`, but unused # TODO: non-sandboxed `conky` still ships via `sxmo-utils`, but unused
@@ -14,6 +14,7 @@
fs.".config/conky/conky.conf".symlink.target = fs.".config/conky/conky.conf".symlink.target =
let let
# TODO: make this just another `suggestedPrograms`!
battery_estimate = pkgs.static-nix-shell.mkBash { battery_estimate = pkgs.static-nix-shell.mkBash {
pname = "battery_estimate"; pname = "battery_estimate";
srcRoot = ./.; srcRoot = ./.;
@@ -26,14 +27,8 @@
services.conky = { services.conky = {
description = "conky dynamic desktop background"; description = "conky dynamic desktop background";
after = [ "graphical-session.target" ]; partOf = [ "graphical-session" ];
# partOf = [ "graphical-session.target" ]; # propagate stop/restart signal from graphical-session to this unit command = "conky";
wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky";
serviceConfig.Type = "simple";
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s";
}; };
}; };
} }

View File

@@ -1,9 +1,21 @@
{ ... }: { pkgs, ... }:
{ {
sane.programs.cozy = { sane.programs.cozy = {
packageUnwrapped = pkgs.cozy.overrideAttrs (upstream: {
postPatch = (upstream.postPatch or "") + ''
# disable all reporting.
# this can be done via the settings, but that's troublesome and easy to forget.
# specifically, i don't want moby to be making these network requests several times per hour
# while it might be roaming or trying to put the RF to sleep.
substituteInPlace cozy/application_settings.py \
--replace-fail 'self._settings.get_int("report-level")' '0'
'';
});
buildCost = 1;
sandbox.method = "bwrap"; # landlock gives: _multiprocessing.SemLock: Permission Denied sandbox.method = "bwrap"; # landlock gives: _multiprocessing.SemLock: Permission Denied
sandbox.wrapperType = "wrappedDerivation";
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,34 @@
# docs: <https://wiki.nixos.org/wiki/Printing>
# to add a printer:
# 1. <http://localhost:631/admin/>
# 2. click "find new printers" and follow prompts
# - prefer to use the "Generic IPP Everywhere Printer" driver
# alternatively, add/modify printers by running
# - `system-config-printer`
{ config, lib, ... }:
let
cfg = config.sane.programs.cups;
in
{
sane.programs.cups = {
suggestedPrograms = [
"system-config-printer"
];
};
sane.programs.system-config-printer = {};
services.printing = lib.mkIf cfg.enabled {
enable = true;
startWhenNeeded = false; #< a.k.a. socket activated?
# webInterface = false;
# logLevel = "debug"; # default: "info"
# extraConfig = "<lines ... >";
# drivers = [ <cups driver packages...> ]
};
# services.avahi = lib.mkIf cfg.enabled {
# # only needed for wireless printing
# enable = true;
# nssmdns4 = true;
# openFirewall = true;
# };
}

View File

@@ -0,0 +1,35 @@
{ pkgs, ... }:
{
sane.programs.curlftpfs = {
packageUnwrapped = pkgs.curlftpfs.overrideAttrs (upstream: {
# my fork includes:
# - per-operation timeouts (CURLOPT_TIMEOUT; would use CURLOPT_LOW_SPEED_TIME/CURLOPT_LOW_SPEED_LIMIT but they don't apply)
# - exit on timeout (so that one knows to abort the mount, instead of waiting indefinitely)
# - support for "meta" keys found in /etc/fstab
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

@@ -9,17 +9,40 @@ let
in in
{ {
sane.programs.dconf = { sane.programs.dconf = {
configOption = with lib; mkOption {
type = types.submodule {
options = {
site = mkOption {
type = types.listOf types.package;
default = [];
description = ''
extra packages to link into /etc/dconf
'';
};
};
};
default = {};
};
packageUnwrapped = pkgs.rmDbusServicesInPlace pkgs.dconf;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation"; sandbox.wrapperType = "inplace"; #< dbus/systemd services live in `.out` but point to `.lib` data.
sandbox.whitelistDbus = [ "user" ];
persist.byStore.private = [ persist.byStore.private = [
".config/dconf" ".config/dconf"
]; ];
};
programs.dconf = lib.mkIf cfg.enabled { services.dconf = {
# note that `programs.dconf` doesn't allow specifying the dconf package. description = "dconf configuration database/server";
enable = true; partOf = [ "graphical-session" ];
packages = [ command = "${lib.getLib cfg.package}/libexec/dconf-service";
};
# supposedly necessary for packages which haven't been wrapped (i.e. wrapGtkApp?),
# but in practice seems unnecessary.
# env.GIO_EXTRA_MODULES = "${pkgs.dconf.lib}/lib/gio/modules";
config.site = [
(pkgs.writeTextFile { (pkgs.writeTextFile {
name = "dconf-user-profile"; name = "dconf-user-profile";
destination = "/etc/dconf/profile/user"; destination = "/etc/dconf/profile/user";
@@ -30,4 +53,18 @@ in
}) })
]; ];
}; };
# TODO: get dconf to read these from ~/.config/dconf ?
environment.etc.dconf = lib.mkIf cfg.enabled {
source = pkgs.symlinkJoin {
name = "dconf-system-config";
paths = map (x: "${x}/etc/dconf") cfg.config.site;
nativeBuildInputs = [ (lib.getBin pkgs.dconf) ];
postBuild = ''
if test -d $out/db; then
dconf update $out/db
fi
'';
};
};
} }

View File

@@ -0,0 +1,139 @@
/* Notification center */
.blurredBG, #main_window, .blurredBG.low, .blurredBG.normal {
background: rgba(255, 255, 255, 1.0);
}
.noti-center.time {
font-size: 32px;
}
/* Notifications */
.notification.content {
margin-left: 15px;
margin-right: 15px;
}
.title {
font-weight: bold;
font-size: 16px;
}
.appname {
font-size: 12px;
}
.time {
font-size: 12px;
}
.blurredBG.notification {
background: rgba(255, 255, 255, 0.4);
}
.blurredBG.notification.critical {
background: rgba(255, 0, 0, 0.5);
}
.notificationInCenter.critical {
background: rgba(155, 0, 20, 0.5);
}
/* Labels */
label {
color: #322;
}
label.notification {
color: #322;
}
label.critical {
color: #000;
}
.notificationInCenter label.critical {
color: #000;
}
/* Buttons */
button {
background: transparent;
color: #322;
border-radius: 3px;
border-width: 0px;
background-position: 0px 0px;
text-shadow: none;
}
button:hover {
border-radius: 3px;
background: rgba(0, 20, 20, 0.2);
border-width: 0px;
border-top: transparent;
border-color: #f00;
color: #fee;
}
/* Custom Buttons */
.userbutton {
background: rgba(20,0,0, 0.15);
}
.userbuttonlabel {
color: #222;
font-size: 12px;
}
.userbutton:hover {
background: rgba(20, 0, 0, 0.2);
}
.userbuttonlabel:hover {
color: #111;
}
button.buttonState1 {
background: rgba(20,0,0,0.5);
}
.userbuttonlabel.buttonState1 {
color: #fff;
}
button.buttonState1:hover {
background: rgba(20,0,0, 0.4);
}
.userbuttonlabel.buttonState1:hover {
color: #111;
}
button.buttonState2 {
background: rgba(255,255,255,0.3);
}
.userbuttonlabel.buttonState2 {
color: #111;
}
button.buttonState2:hover {
background: rgba(20,0,0, 0.3);
}
.userbuttonlabel.buttonState2:hover {
color: #000;
}
/* Images */
image.deadd-noti-center.notification.image {
margin-left: 20px;
}

View File

@@ -0,0 +1,263 @@
### Margins for notification-center/notifications
margin-top: 0
margin-right: 0
### Margins for notification-center
margin-bottom: 0
### Width of the notification center/notifications in pixels.
width: 360
### Command to run at startup. This can be used to setup
### button states.
# startup-command: deadd-notification-center-startup
### Monitor on which the notification center/notifications will be
### printed. If "follow-mouse" is set true, this does nothing.
monitor: 0
### If true, the notification center/notifications will open on the
### screen, on which the mouse is. Overrides the "monitor" setting.
follow-mouse: false
notification-center:
### Margin at the top/right/bottom of the notification center in
### pixels. This can be used to avoid overlap between the notification
### center and bars such as polybar or i3blocks.
margin-top: 40
# margin-right: 0
# margin-bottom: 0
### Width of the notification center in pixels.
# width: 500
### Monitor on which the notification center will be printed. If
### "follow-mouse" is set true, this does nothing.
# monitor: 0
### If true, the notification center will open on the screen, on which
### the mouse is. Overrides the "monitor" setting.
# follow-mouse: false
### Notification center closes when the mouse leaves it
hide-on-mouse-leave: true
### If newFirst is set to true, newest notifications appear on the top
### of the notification center. Else, notifications stack, from top to
### bottom.
new-first: true
### If true, the transient field in notifications will be ignored,
### thus the notification will be persisted in the notification
### center anyways
ignore-transient: false
### Custom buttons in notification center
buttons:
### Numbers of buttons that can be drawn on a row of the notification
### center.
# buttons-per-row: 5
### Height of buttons in the notification center (in pixels).
# buttons-height: 60
### Horizontal and vertical margin between each button in the
### notification center (in pixels).
# buttons-margin: 2
### Button actions and labels. For each button you must specify a
### label and a command.
actions:
# - label: VPN
# command: "sudo vpnToggle"
# - label: Bluetooth
# command: bluetoothToggle
# - label: Wifi
# command: wifiToggle
# - label: Screensaver
# command: screensaverToggle
# - label: Keyboard
# command: keyboardToggle
notification:
### If true, markup (<u>, <i>, <b>, <a>) will be displayed properly
use-markup: true
### If true, html entities (&#38; for &, &#37; for %, etc) will be
### parsed properly. This is useful for chromium-based apps, which
### tend to send these in notifications.
parse-html-entities: true
dbus:
### If noti-closed messages are enabled, the sending application
### will know that a notification was closed/timed out. This can
### be an issue for certain applications, that overwrite
### notifications on status updates (e.g. Spotify on each
### song). When one of these applications thinks, the notification
### has been closed/timed out, they will not overwrite existing
### notifications but send new ones. This can lead to redundant
### notifications in the notification center, as the close-message
### is send regardless of the notification being persisted.
send-noti-closed: false
app-icon:
### If set to true: If no icon is passed by the app_icon parameter
### and no application "desktop-entry"-hint is present, deadd will
### try to guess the icon from the application name (if present).
guess-icon-from-name: true
### The display size of the application icons in the notification
### pop-ups and in the notification center
icon-size: 20
image:
### The maximal display size of images that are part of
### notifications for notification pop-ups and in the notification
### center
size: 100
### The margin around the top, bottom, left, and right of
### notification images.
margin-top: 15
margin-bottom: 15
margin-left: 15
margin-right: 0
### Apply modifications to certain notifications:
### Each modification rule needs a "match" and either a "modify" or
### a "script" entry.
modifications:
### Match:
### Matches the notifications against these rules. If all of the
### values (of one modification rule) match, the "modify"/"script"
### part is applied.
# - match:
### Possible match criteria:
# title: "Notification title"
# body: "Notification body"
# time: "12:44"
# app-name: "App name"
# urgency: "low" # "low", "normal" or "critical"
# modify:
### Possible modifications
# title: "abc"
# body: "abc"
# app-name: "abc"
# app-icon: "file:///abc.png"
### The timeout has three special values:
### timeout: 0 -> don't time out at all
### timeout: -1 -> use default timeout
### timeout: 1 -> don't show as pop-up
### timeout: >1 -> milliseconds until timeout
# timeout: 1
# margin-right: 10
# margin-top: 10
# image: "file:///abc.png"
# image-size: 10
# transient: true
# send-noti-closed: false
### Remove action buttons from notifications
# remove-actions: true
### Set the action-icons hint to true, action labels will then
### be intergreted as GTK icon names
# action-icons: true
### List of actions, where the even elements (0, 2, ...) are the
### action name and the odd elements are the label
# actions:
# - previous
# - media-skip-backward
# - play
# - media-playback-start
# - next
# - media-skip-forward
### Action commands, where the keys (e.g. "play") is the action
### name and the value is a program call that should be executed
### on action. Prevents sending of the action to the application.
# action-commands:
# play: playerctl play-pause
# previous: playerctl previous
# next: playerctl next
### Add a class-name to the notification container, that can be
### used for specific styling of notifications using the
### deadd.css file
# class-name: "abc"
# - match:
# app-name: "Chromium"
### Instead of modifying a notification directly, a script can be
### run, which will receive the notification as JSON on STDIN. It
### is expected to return JSON/YAML configuration that defines the
### modifications that should be applied. Minimum complete return
### value must be '{"modify": {}, "match": {}}'. Always leave the "match"
### object empty (technical reasons, i.e. I am lazy).
# script: "linux-notification-center-parse-chromium"
- match:
app-name: "Spotify"
modify:
image-size: 80
timeout: 1
send-noti-closed: true
class-name: "Spotify"
action-icons: true
actions:
- previous
- media-skip-backward
- play
- media-playback-start
- next
- media-skip-forward
action-commands:
play: playerctl play-pause
previous: playerctl previous
next: playerctl next
# - match:
# title: Bildschirmhelligkeit
# modify:
# image-size: 60
popup:
### Default timeout used for notifications in milli-seconds. This can
### be overwritten with the "-t" option (or "--expire-time") of the
### notify-send command.
default-timeout: 10000
### Margin above/right/between notifications (in pixels). This can
### be used to avoid overlap between notifications and a bar such as
### polybar or i3blocks.
margin-top: 50
margin-right: 50
margin-between: 20
### Defines after how many lines of text the body will be truncated.
### Use 0 if you want to disable truncation.
max-lines-in-body: 3
### Determines whether the GTK widget that displays the notification body
### in the notification popup will be hidden when empty. This is especially
### useful for transient notifications that display a progress bar.
# hide-body-if-empty: false
### Monitor on which the notifications will be
### printed. If "follow-mouse" is set true, this does nothing.
# monitor: 0
### If true, the notifications will open on the
### screen, on which the mouse is. Overrides the "monitor" setting.
# follow-mouse: false
click-behavior:
### The mouse button for dismissing a popup. Must be either "mouse1",
### "mouse2", "mouse3", "mouse4", or "mouse5"
dismiss: mouse1
### The mouse button for opening a popup with the default action.
### Must be either "mouse1", "mouse2", "mouse3", "mouse4", or "mouse5"
default-action: mouse3

View File

@@ -0,0 +1,17 @@
# docs are via README only:
# - <https://github.com/phuhl/linux_notification_center>
# reload config:
# - `notify-send a --hint=boolean:deadd-notification-center:true --hint=string:type:reloadStyle`
# toggle visibility:
# - `kill -s USR1 $(pidof deadd-notification-center)`
# clear notifications:
# - `notify-send a --hint=boolean:deadd-notification-center:true --hint=string:type:clearInCenter`
# set state of user button 0 to "highlighted" (true)
# - `notify-send a --hint=boolean:deadd-notification-center:true --hint=int:id:0 --hint=boolean:state:true --hint=type:string:buttons`
{ ... }:
{
sane.programs.deadd-notification-center = {
fs.".config/deadd/deadd.css".symlink.target = ./deadd.css;
fs.".config/deadd/deadd.yml".symlink.target = ./deadd.yml;
};
}

View File

@@ -5,27 +5,39 @@
./abaddon.nix ./abaddon.nix
./aerc.nix ./aerc.nix
./alacritty.nix ./alacritty.nix
./alsa-ucm-conf
./animatch.nix ./animatch.nix
./assorted.nix ./assorted.nix
./audacity.nix ./audacity.nix
./bemenu.nix ./bemenu.nix
./blast-ugjka
./bonsai.nix ./bonsai.nix
./brave.nix ./brave.nix
./bubblewrap.nix ./bubblewrap.nix
./calls.nix ./calls.nix
./cantata.nix ./cantata.nix
./catt.nix ./catt.nix
./celeste64.nix
./chatty.nix ./chatty.nix
./conky ./conky
./cozy.nix ./cozy.nix
./cups.nix
./curlftpfs.nix
./dconf.nix ./dconf.nix
./deadd-notification-center
./dialect.nix ./dialect.nix
./dino.nix ./dino.nix
./dissent.nix
./dtrx.nix
./eg25-control.nix
./element-desktop.nix ./element-desktop.nix
./engrampa.nix
./epiphany.nix ./epiphany.nix
./evince.nix ./evince.nix
./fcitx5.nix
./feedbackd.nix ./feedbackd.nix
./firefox.nix ./firefox.nix
./firejail.nix
./flare-signal.nix ./flare-signal.nix
./fontconfig.nix ./fontconfig.nix
./fractal.nix ./fractal.nix
@@ -44,14 +56,17 @@
./gpodder.nix ./gpodder.nix
./grimshot.nix ./grimshot.nix
./gthumb.nix ./gthumb.nix
./gtkcord4.nix ./gvfs.nix
./handbrake.nix ./handbrake.nix
./helix.nix ./helix.nix
./htop
./imagemagick.nix ./imagemagick.nix
./jellyfin-media-player.nix ./jellyfin-media-player.nix
./kdenlive.nix ./kdenlive.nix
./komikku.nix ./komikku.nix
./koreader ./koreader
./less.nix
./lftp.nix
./libreoffice.nix ./libreoffice.nix
./lemoa.nix ./lemoa.nix
./loupe.nix ./loupe.nix
@@ -59,17 +74,20 @@
./megapixels.nix ./megapixels.nix
./mepo.nix ./mepo.nix
./mimeo ./mimeo
./modemmanager.nix
./mopidy.nix ./mopidy.nix
./mpv.nix ./mpv
./msmtp.nix ./msmtp.nix
./nautilus.nix ./nautilus.nix
./neovim.nix ./neovim.nix
./networkmanager.nix
./newsflash.nix ./newsflash.nix
./nheko.nix ./nheko.nix
./nicotine-plus.nix ./nicotine-plus.nix
./nix-index.nix ./nix-index.nix
./notejot.nix ./notejot.nix
./ntfy-sh.nix ./ntfy-sh.nix
./objdump.nix
./obsidian.nix ./obsidian.nix
./offlineimap.nix ./offlineimap.nix
./open-in-mpv.nix ./open-in-mpv.nix
@@ -80,7 +98,14 @@
./rhythmbox.nix ./rhythmbox.nix
./ripgrep.nix ./ripgrep.nix
./rofi ./rofi
./rtkit.nix
./s6-rc.nix
./sane-input-handler
./sane-open.nix
./sane-sandboxed.nix
./sane-screenshot.nix
./sane-scripts.nix ./sane-scripts.nix
./schlock.nix
./sfeed.nix ./sfeed.nix
./signal-desktop.nix ./signal-desktop.nix
./splatmoji.nix ./splatmoji.nix
@@ -93,8 +118,10 @@
./supertuxkart.nix ./supertuxkart.nix
./sway ./sway
./sway-autoscaler ./sway-autoscaler
./swayidle.nix
./swaylock.nix ./swaylock.nix
./swaynotificationcenter.nix ./swaynotificationcenter
./sysvol.nix
./tangram.nix ./tangram.nix
./tor-browser.nix ./tor-browser.nix
./tuba.nix ./tuba.nix
@@ -106,20 +133,21 @@
./wine.nix ./wine.nix
./wireplumber.nix ./wireplumber.nix
./wireshark.nix ./wireshark.nix
./wob ./wpa_supplicant.nix
./wvkbd.nix
./xarchiver.nix ./xarchiver.nix
./xdg-desktop-portal.nix ./xdg-desktop-portal.nix
./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-utils.nix ./xdg-utils.nix
./zathura.nix
./zeal.nix ./zeal.nix
./zecwallet-lite.nix ./zecwallet-lite.nix
./zulip.nix
./zsh ./zsh
]; ];
config = { # XXX: this might not be necessary. try removing this and cacert.unbundled (servo)?
# XXX: this might not be necessary. try removing this and cacert.unbundled (servo)? environment.etc."ssl/certs".source = "${pkgs.cacert.unbundled}/etc/ssl/certs/*";
environment.etc."ssl/certs".source = "${pkgs.cacert.unbundled}/etc/ssl/certs/*";
};
} }

View File

@@ -1,12 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.dialect = { sane.programs.dialect = {
sandbox.method = "bwrap";
sandbox.wrapperType = "inplace"; # share/search_providers/ calls back into the binary, weird wrap semantics
sandbox.whitelistWayland = true;
sandbox.net = "clearnet";
suggestedPrograms = [ "dconf" ]; #< to persist settings
packageUnwrapped = pkgs.dialect.overrideAttrs (upstream: { packageUnwrapped = pkgs.dialect.overrideAttrs (upstream: {
# TODO: send upstream # TODO: send upstream
# TODO: figure out how to get audio working # TODO: figure out how to get audio working
@@ -15,5 +9,17 @@
pkgs.glib-networking # for TLS pkgs.glib-networking # for TLS
]; ];
}); });
suggestedPrograms = [ "dconf" ]; #< to persist settings
buildCost = 1;
sandbox.method = "bwrap";
sandbox.wrapperType = "inplace"; # share/search_providers/ calls back into the binary, weird wrap semantics
sandbox.whitelistWayland = true;
sandbox.net = "clearnet";
sandbox.extraHomePaths = [
".config/dconf" # won't start without it
];
}; };
} }

View File

@@ -14,22 +14,27 @@
# but at present it has no "start in tray" type of option: it must render a window. # but at present it has no "start in tray" type of option: it must render a window.
# #
# outstanding bugs: # outstanding bugs:
# - NAT holepunching burns CPU/NET when multiple interfaces are up
# - fix by just `ip link set ovpnd-xyz down`
# - setting `wg-home` down *seems* to be not necessary
# - characterized by UPnP/SOAP error 500/718 in wireshark
# - seems it asks router A to open a port mapping for an IP address which belongs to a different subnet...
# - mic is sometimes disabled at call start despite presenting as enabled # - mic is sometimes disabled at call start despite presenting as enabled
# - fix is to toggle it off -> on in the Dino UI # - fix is to toggle it off -> on in the Dino UI
# - default mic gain is WAY TOO MUCH (heavily distorted) # - default mic gain is WAY TOO MUCH (heavily distorted)
# - TODO: dino should have more optimal niceness/priority to ensure it can process its buffers # - on lappy/desktop, right-clicking the mic button allows to toggle audio devices, but impossible to trigger this on moby/touch screen!
# - possibly this is solved by enabling RealtimeKit (rtkit)
# - TODO: see if Dino calls work better with `echo full > /sys/kernel/debug/sched/preempt` # - TODO: see if Dino calls work better with `echo full > /sys/kernel/debug/sched/preempt`
# #
# probably fixed: # probably fixed:
# - once per 1-2 minutes dino will temporarily drop mic input: # - once per 1-2 minutes dino will temporarily drop mic input:
# - `rtp-WRNING: plugin.vala:148: Warning in pipeline: Can't record audio fast enough # - `rtp-WARNING: plugin.vala:148: Warning in pipeline: Can't record audio fast enough
# - this was *partially* fixed by bumping the pipewire mic buffer to 2048 samples (from ~512) # - this was *partially* fixed by bumping the pipewire mic buffer to 2048 samples (from ~512)
# - this was further fixed by setting PULSE_LATENCY_MSEC=20. # - this was further fixed by setting PULSE_LATENCY_MSEC=20.
# - possibly Dino should be updated internally: `info.rate / 100` -> `info.rate / 50`. # - possibly Dino should be updated internally: `info.rate / 100` -> `info.rate / 50`.
# - i think that affects the batching for echo cancellation, adaptive gain control, etc. # - i think that affects the batching for echo cancellation, adaptive gain control, etc.
# - dino *should* be able to use Pipewire directly for calls instead of going through pulse, but had trouble achieving that in actuality
# #
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sane.programs.dino; cfg = config.sane.programs.dino;
in in
@@ -45,8 +50,34 @@ in
}; };
}; };
packageUnwrapped = (pkgs.dino.override {
# XXX(2024/04/24): build without echo cancelation (i.e. force WITH_VOICE_PROCESSOR to be undefined).
# this means that if the other end of the call is on speaker phone, i'm liable to hear my own voice
# leave their speaker, enter their mic, and then return to me.
# the benefit is a >50% reduction in CPU use. insignificant on any modern PC; make-or-break on a low-power Pinephone.
webrtc-audio-processing = null;
}).overrideAttrs (upstream: {
# i'm updating experimentally to see if it improves call performance.
# i don't *think* this is actually necessary; i don't notice any difference.
version = "0.4.3-unstable-2024-04-28";
src = lib.warnIf (lib.versionOlder "0.4.3" upstream.version) "dino update: safe to remove sane patches" pkgs.fetchFromGitHub {
owner = "dino";
repo = "dino";
rev = "657502955567dd538e56f300e075c7db52e25d74";
hash = "sha256-SApJy9FgxxLOB5A/zGtpdFZtSqSiS03vggRrCte1tFE=";
};
# avoid double-application of upstreamed patches
# https://github.com/NixOS/nixpkgs/pull/309265
patches = [];
checkPhase = ''
runHook preCheck
./xmpp-vala-test
# ./signal-protocol-vala-test # doesn't exist anymore
runHook postCheck
'';
});
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications sandbox.whitelistDbus = [ "user" ]; # notifications
@@ -69,26 +100,34 @@ in
services.dino = { services.dino = {
description = "dino XMPP client"; description = "dino XMPP client";
after = [ "graphical-session.target" ]; partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
# partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/dino";
Type = "simple";
Restart = "always";
RestartSec = "20s";
};
# audio buffering; see: <https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#pipewire-buffering-explained> # audio buffering; see: <https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#pipewire-buffering-explained>
# dino defaults to 10ms mic buffer, which causes underruns, which Dino handles *very* poorly # dino defaults to 10ms mic buffer, which causes underruns, which Dino handles *very* poorly
# as in, the other end of the call will just not receive sound from us for a couple seconds. # as in, the other end of the call will just not receive sound from us for a couple seconds.
# pipewire uses power-of-two buffering for the mic itself. that would put us at 21.33 ms, but this env var supports only whole numbers (21ms ends up not power-of-two). # pipewire uses power-of-two buffering for the mic itself (by default), but this env var supports only whole numbers, which isn't quite reconcilable:
# also, Dino's likely still doing things in 10ms batches internally anyway. # - 1024/48000 = 21.33ms
environment.PULSE_LATENCY_MSEC = "20"; # - 2048/48000 = 42.67ms
# - 4096/48000 = 85.33ms
# also, Dino's likely still doing things in 10ms batches internally.
#
# note that this number supposedly is just the buffer size which Dino asks Pulse (pipewire) to share with it.
# in theory, it's equivalent to adjusting pipewire's quanta setting, and so isn't additive to the existing pipewire buffers.
# (and would also be overriden by pipewire's quanta.min setting).
# but in practice, setting this seems to have some more effect beyond just the buffer sizes visible in `pw-top`.
#
# further: decrease the "niceness" of dino, so that it can take precedence over anything else.
# ideally this would target just the audio processing, rather than the whole program.
# pipewire is the equivalent of `nice -n -21`, so probably don't want to go any more extreme than that.
# nice -n -15 chosen arbitrarily; not optimized (and seems to have very little impact in practice anyway).
# buffer size:
# - 1024 (PULSE_LATENCY_MSEC=20): `pw-top` shows several underruns per second.
# - 2048 (PULSE_LATENCY_MSEC=50): `pw-top` shows very few underruns: maybe 1-5 per minute. with voice processor disabled, this works well. with it enabled, i still get gaps in which the mic "disappears".
# - 4096 (PULSE_LATENCY_MSEC=100): `pw-top` shows 0 underruns. with voice processor disabled, i seem to be permanently muted. with it enabled, this works well.
#
# note that debug logging during calls produces so much journal spam that it pegs the CPU and causes dropped audio # note that debug logging during calls produces so much journal spam that it pegs the CPU and causes dropped audio
# environment.G_MESSAGES_DEBUG = "all"; # env G_MESSAGES_DEBUG = "all";
command = "env PULSE_LATENCY_MSEC=50 nice -n -15 dino";
}; };
}; };
} }

View File

@@ -3,10 +3,10 @@
# - notification sounds can be handled by swaync # - notification sounds can be handled by swaync
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sane.programs.gtkcord4; cfg = config.sane.programs.dissent;
in in
{ {
sane.programs.gtkcord4 = { sane.programs.dissent = {
configOption = with lib; mkOption { configOption = with lib; mkOption {
default = {}; default = {};
type = types.submodule { type = types.submodule {
@@ -17,22 +17,21 @@ in
}; };
}; };
packageUnwrapped = pkgs.gtkcord4.overrideAttrs (upstream: { packageUnwrapped = pkgs.dissent.overrideAttrs (upstream: {
postConfigure = (upstream.postConfigure or "") + '' postConfigure = (upstream.postConfigure or "") + ''
# gtkcord4 uses go-keyring to interface with the org.freedesktop.secrets provider (i.e. gnome-keyring). # dissent uses go-keyring to interface with the org.freedesktop.secrets provider (i.e. gnome-keyring).
# go-keyring hardcodes `login.keyring` as the keyring to store secrets in, instead of reading `~/.local/share/keyring/default`. # go-keyring hardcodes `login.keyring` as the keyring to store secrets in, instead of reading `~/.local/share/keyring/default`.
# `login.keyring` seems to be a special keyring preconfigured (by gnome-keyring) to encrypt everything to the user's password. # `login.keyring` seems to be a special keyring preconfigured (by gnome-keyring) to encrypt everything to the user's password.
# that's redundant with my fs-level encryption and makes the keyring less inspectable, # that's redundant with my fs-level encryption and makes the keyring less inspectable,
# so patch gtkcord4 to use Default_keyring instead. # so patch dissent to use Default_keyring instead.
# see: # see:
# - <https://github.com/diamondburned/gtkcord4/issues/139> # - <https://github.com/diamondburned/dissent/issues/139>
# - <https://github.com/zalando/go-keyring/issues/46> # - <https://github.com/zalando/go-keyring/issues/46>
substituteInPlace vendor/github.com/zalando/go-keyring/secret_service/secret_service.go \ substituteInPlace vendor/github.com/zalando/go-keyring/secret_service/secret_service.go \
--replace '"login"' '"Default_keyring"' --replace-fail '"login"' '"Default_keyring"'
''; '';
}); });
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications sandbox.whitelistDbus = [ "user" ]; # notifications
@@ -52,22 +51,14 @@ in
]; ];
persist.byStore.private = [ persist.byStore.private = [
".cache/gtkcord4" ".cache/dissent"
".config/gtkcord4" # empty? ".config/dissent" # empty?
]; ];
services.gtkcord4 = { services.dissent = {
description = "gtkcord4 Discord client"; description = "dissent Discord client";
after = [ "graphical-session.target" ]; partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
# partOf = [ "graphical-session.target" ]; command = "dissent";
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/gtkcord4";
Type = "simple";
Restart = "always";
RestartSec = "20s";
};
}; };
}; };
} }

View File

@@ -0,0 +1,16 @@
{ pkgs, ... }:
{
sane.programs.dtrx = {
packageUnwrapped = pkgs.dtrx.override {
# `binutils` is the nix wrapper, which reads nix-related env vars
# before passing on to e.g. `ld`.
# dtrx probably only needs `ar` at runtime, not even `ld`.
binutils = pkgs.binutils-unwrapped;
# build without rpm support, since `rpm` package doesn't cross-compile.
rpm = null;
};
sandbox.method = "bwrap";
sandbox.whitelistPwd = true;
sandbox.autodetectCliPaths = "existing"; #< for the archive
};
}

View File

@@ -0,0 +1,74 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.eg25-control;
in
{
sane.programs.eg25-control = {
suggestedPrograms = [ "modemmanager" ];
services.eg25-control-powered = {
description = "eg25-control-powered: power to the Qualcomm eg25 modem used by PinePhone";
startCommand = "eg25-control --power-on --verbose";
cleanupCommand = "eg25-control --power-off --verbose";
# depends = [ "ModemManager" ]
};
services.eg25-control-gps = {
# TODO: separate almanac upload from GPS enablement
# - don't want to re-upload the almanac everytime the GPS is toggled
# - want to upload almanac even when GPS *isn't* enabled, if we have internet connection.
description = "eg25-control-gps: background GPS tracking";
startCommand = "eg25-control --enable-gps --dump-debug-info --verbose";
cleanupCommand = "eg25-control --disable-gps --dump-debug-info --verbose";
depends = [ "eg25-control-powered" ];
};
};
# TODO: port to s6
systemd.services.eg25-control-freshen-agps = lib.mkIf cfg.enabled {
description = "keep assisted-GPS data fresh";
serviceConfig = {
# XXX: this can have a race condition with eg25-control-gps
# - eg25-control-gps initiates DL of new/<agps>
# - eg25-control-gps tests new/<agps>: it works
# - eg25-control-freshen-agps initiates DL of new/<agps>
# - eg25-control-gps: moves new/<agps> into cache/
# - but it moved the result (possibly incomplete) of eg25-control-freshen-agps, incorrectly
# in practice, i don't expect much issue from this.
ExecStart = "${cfg.package}/bin/eg25-control --ensure-agps-cache --verbose";
Restart = "no";
User = "eg25-control";
WorkingDirectory = "/var/lib/eg25-control";
StateDirectory = "eg25-control";
};
startAt = "hourly"; # this is a bit more than necessary, but idk systemd calendar syntax
after = [ "network-online.target" "nss-lookup.target" ];
requires = [ "network-online.target" ];
# wantedBy = [ "network-online.target" ]; # auto-start immediately after boot
};
users = lib.mkIf cfg.enabled {
groups.eg25-control = {};
users.eg25-control = {
group = "eg25-control";
isSystemUser = true;
home = "/var/lib/eg25-control";
extraGroups = [
"dialout" # required to read /dev/ttyUSB1
"networkmanager" # required to authenticate with mmcli
];
};
};
sane.persist.sys.byStore.plaintext = lib.mkIf cfg.enabled [
# to persist agps data, i think.
{ user = "eg25-control"; group = "eg25-control"; path = "/var/lib/eg25-control"; }
];
services.udev.extraRules = let
chmod = "${pkgs.coreutils}/bin/chmod";
chown = "${pkgs.coreutils}/bin/chown";
in ''
# make Modem controllable by user
DRIVER=="modem-power", RUN+="${chmod} g+w /sys%p/powered", RUN+="${chown} :networkmanager /sys%p/powered"
'';
}

View File

@@ -4,20 +4,30 @@
# - <https://github.com/vector-im/element-desktop/issues/1029#issuecomment-1632688224> # - <https://github.com/vector-im/element-desktop/issues/1029#issuecomment-1632688224>
# - `rm -rf ~/.config/Element/GPUCache` # - `rm -rf ~/.config/Element/GPUCache`
# - <https://github.com/NixOS/nixpkgs/issues/244486> # - <https://github.com/NixOS/nixpkgs/issues/244486>
{ pkgs, ... }: { lib, pkgs, ... }:
{ {
sane.programs.element-desktop = { sane.programs.element-desktop = {
packageUnwrapped = pkgs.element-desktop.override { packageUnwrapped = (pkgs.element-desktop.override {
# use pre-build electron because otherwise it takes 4 hrs to build from source. # use pre-built electron because otherwise it takes 4 hrs to build from source.
electron = pkgs.electron-bin; electron = pkgs.electron_28-bin;
}; }).overrideAttrs (upstream: {
# fix to use wayland instead of Xwayland:
# - replace `NIXOS_OZONE_WL` non-empty check with `WAYLAND_DISPLAY`
# - use `wayland` instead of `auto` because --ozone-platform-hint=auto still prefers X over wayland when both are available
# alternatively, set env var: `ELECTRON_OZONE_PLATFORM_HINT=wayland` and ignore all of this
installPhase = lib.replaceStrings
[ "NIXOS_OZONE_WL" "--ozone-platform-hint=auto" ]
[ "WAYLAND_DISPLAY" "--ozone-platform-hint=wayland" ]
upstream.installPhase
;
});
suggestedPrograms = [ suggestedPrograms = [
"gnome-keyring" "gnome-keyring"
"xwayland"
]; ];
buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications sandbox.whitelistDbus = [ "user" ]; # notifications

View File

@@ -0,0 +1,17 @@
{ pkgs, ... }:
{
sane.programs."mate.engrampa" = {
packageUnwrapped = pkgs.rmDbusServices pkgs.mate.engrampa;
sandbox.method = "bwrap"; # TODO:sandbox: untested
sandbox.whitelistWayland = true;
sandbox.autodetectCliPaths = "existingOrParent";
sandbox.extraHomePaths = [
"archive"
"Books/local"
"Books/servo"
"records"
"ref"
"tmp"
];
};
}

View File

@@ -12,15 +12,19 @@
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;
sandbox.whitelistDbus = [ "user" ]; #< silently fails to start without it.
# default sandboxing breaks rendering in weird ways. sites are super zoomed in / not scaled. # default sandboxing breaks rendering in weird ways. sites are super zoomed in / not scaled.
# enabling DRI/DRM (as below) seems to fix that. # enabling DRI/DRM (as below) seems to fix that.
sandbox.whitelistDri = true; sandbox.whitelistDri = true;
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [ sandbox.extraHomePaths = [
".config/dconf" # else will always prompt "make default browser?"
".config/epiphany" #< else it gets angry at launch ".config/epiphany" #< else it gets angry at launch
"tmp" "tmp"
]; ];
buildCost = 2;
# XXX(2023/07/08): running on moby without `WEBKIT_DISABLE_SANDBOX...` fails, with: # XXX(2023/07/08): running on moby without `WEBKIT_DISABLE_SANDBOX...` fails, with:
# - `bwrap: Can't make symlink at /var/run: File exists` # - `bwrap: Can't make symlink at /var/run: File exists`
# this could be due to: # this could be due to:

View File

@@ -1,6 +1,8 @@
{ ... }: { ... }:
{ {
sane.programs.evince = { sane.programs.evince = {
buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.autodetectCliPaths = true; sandbox.autodetectCliPaths = true;
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;

View File

@@ -0,0 +1,113 @@
# fcitx5 is an "input method", to e.g. allow typing CJK on qwerty.
# but i also misuse it to allow typing emoji on qwerty:
# - press `Super+backtick`
# - type something like "effort"
# - it should be underlined, at the least
# - if well supported (e.g. Firefox; also gtk4, alacritty on sway 1.10+), a drop-down fuzzy matcher will appear
# - press space
# - "effort" should be replaced by `(ง •̀_•́)ง`
#
## debugging
# - `fcitx5-diagnose`
#
## config/docs:
# - `fcitx5-configtool`, then check ~/.config/fcitx5 files
# - <https://fcitx-im.org/wiki/Fcitx_5>
# - <https://wiki.archlinux.org/title/Fcitx5>
# - theming: <https://wiki.archlinux.org/title/Fcitx5#Themes_and_appearance>
# - <https://en.wikipedia.org/wiki/Fcitx>
# - wayland specifics: <https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland>
# - quickphrase (emoji): <https://fcitx-im.org/wiki/QuickPhrase>
# - override phrases via `~/.config/fcitx/data/QuickPhrase.mb`
# - customize bindings via `fcitx5-configtool` > addons > QuickPhrase
# - theming:
# - nixpkgs has a few themes: `fcitx5-{material-color,nord,rose-pine}`
# - NUR has a few themes
# - <https://github.com/catppuccin/fcitx5>
{ lib, pkgs, ... }:
{
sane.programs.fcitx5 = {
packageUnwrapped = pkgs.fcitx5-with-addons.override {
addons = with pkgs; [
# fcitx5-mozc # japanese input: <https://github.com/fcitx/mozc>
fcitx5-gtk # <https://github.com/fcitx/fcitx5-gtk>
];
};
sandbox.method = "bwrap";
sandbox.whitelistDbus = [ "user" ];
sandbox.whitelistWayland = true; # for `fcitx5-configtool, if nothing else`
sandbox.extraHomePaths = [
# ".config/fcitx"
".config/fcitx5"
".local/share/fcitx5"
];
fs.".config/fcitx5/conf/quickphrase.conf".symlink.text = ''
# Choose key modifier
Choose Modifier=None
# Enable Spell check
Spell=True
FallbackSpellLanguage=en
[TriggerKey]
# defaults: Super+grave, Super+semicolon
# gtk apps use ctrl+period, so super+period is a nice complement
0=Super+grave
1=Super+semicolon
2=Super+period
'';
fs.".config/fcitx5/conf/classicui.conf".symlink.text = ''
Theme=sane
Font="Sans 20"
Vertical Candidate List=True
'';
fs.".local/share/fcitx5/themes/sane/theme.conf".symlink.text = ''
# i omit several keys, especially the ones which don't seem to do much.
# for a theme which uses many more options, see:
# - <https://github.com/catppuccin/fcitx5/blob/main/src/catppuccin-mocha/theme.conf>
[Metadata]
Name=sane
ScaleWithDPI=True
[InputPanel]
NormalColor=#d8d8d8
HighlightCandidateColor=#FFFFFF
HighlightColor=#FFFFFF
HighlightBackgroundColor=#1f5e54
[InputPanel/Background]
Color=#1f5e54
[InputPanel/Highlight]
Color=#418379
[InputPanel/Highlight/Margin]
Left=20
Right=20
Top=7
Bottom=7
[InputPanel/TextMargin]
Left=20
Right=20
Top=6
Bottom=6
'';
services.fcitx5 = {
description = "fcitx5: input method (IME) for emoji/internationalization";
partOf = [ "graphical-session" ];
command = "fcitx5";
};
env.XMODIFIERS = "@im=fcitx";
# setting IM_MODULE is generally not required on wayland, but can be used to override the toolkit's own dialogs with our own.
# env.GTK_IM_MODULE = "fcitx";
# enable if you want them:
# env.QT_IM_MODULE = "fcitx";
# env.QT_PLUGIN_PATH = [ "${cfg.package}/${pkgs.qt6.qtbase.qtPluginPrefix}" ];
# env.SDL_IM_MODULE = "fcitx";
# env.GLFW_IM_MODULE = "ibus"; # for KiTTY, as per <https://wiki.archlinux.org/title/Fcitx5#Integration>
};
}

View File

@@ -25,7 +25,6 @@ in
}; };
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistDbus = [ "user" ]; sandbox.whitelistDbus = [ "user" ];
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
@@ -97,18 +96,16 @@ in
services.feedbackd = { services.feedbackd = {
description = "feedbackd audio/vibration/led controller"; description = "feedbackd audio/vibration/led controller";
wantedBy = [ "default.target" ]; #< should technically be `sound.target`, but that doesn't seem to get auto-started? depends = [ "sound" ];
serviceConfig = { partOf = [ "default" ];
ExecStart = "${cfg.package}/libexec/feedbackd"; command = lib.concatStringsSep " " ([
Type = "simple"; "env"
Restart = "on-failure"; "G_MESSAGES_DEBUG=all"
RestartSec = "10s"; ] ++ lib.optionals cfg.config.proxied [
}; "FEEDBACK_THEME=$HOME/.config/feedbackd/themes/proxied.json"
environment = { ] ++ [
G_MESSAGES_DEBUG = "all"; "${cfg.package}/libexec/feedbackd"
} // (lib.optionalAttrs cfg.config.proxied { ]);
FEEDBACK_THEME = "/home/colin/.config/feedbackd/themes/proxied.json";
});
}; };
}; };

View File

@@ -207,6 +207,10 @@ in
package = pkgs.firefox-extensions.i2p-in-private-browsing; package = pkgs.firefox-extensions.i2p-in-private-browsing;
enable = lib.mkDefault config.services.i2p.enable; 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 true;
};
open-in-mpv = { open-in-mpv = {
# test: `open-in-mpv 'mpv:///open?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ'` # test: `open-in-mpv 'mpv:///open?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ'`
package = pkgs.firefox-extensions.open-in-mpv; package = pkgs.firefox-extensions.open-in-mpv;
@@ -234,7 +238,7 @@ in
sane.programs.firefox = { sane.programs.firefox = {
inherit packageUnwrapped; inherit packageUnwrapped;
sandbox.method = "bwrap"; # landlock works, but requires all of /proc to be linked sandbox.method = "bwrap"; # landlock works, but requires all of /proc to be linked
sandbox.wrapperType = "inplace"; # probably wrappedDerivation could work too. sandbox.wrapperType = "inplace"; # trivial package; cheap enough to wrap inplace
sandbox.net = "all"; sandbox.net = "all";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # mpris sandbox.whitelistDbus = [ "user" ]; # mpris
@@ -310,8 +314,8 @@ in
// scrollbar configuration, see: <https://artemis.sh/2023/10/12/scrollbars.html> // scrollbar configuration, see: <https://artemis.sh/2023/10/12/scrollbars.html>
// style=4 gives rectangular scrollbars // style=4 gives rectangular scrollbars
// could also enable "always show scrollbars" in about:preferences -- not sure what the actual pref name for that is // 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) tend to obscure content (and make buttons unclickable) // 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", 20); defaultPref("widget.non-native-theme.scrollbar.size.override", 14);
defaultPref("widget.non-native-theme.scrollbar.style", 4); defaultPref("widget.non-native-theme.scrollbar.style", 4);
// disable inertial/kinetic/momentum scrolling because it just gets in the way on touchpads // disable inertial/kinetic/momentum scrolling because it just gets in the way on touchpads
@@ -322,6 +326,8 @@ in
defaultPref("widget.use-xdg-desktop-portal.mime-handler", 1); defaultPref("widget.use-xdg-desktop-portal.mime-handler", 1);
defaultPref("widget.use-xdg-desktop-portal.open-uri", 1); defaultPref("widget.use-xdg-desktop-portal.open-uri", 1);
defaultPref("browser.toolbars.bookmarks.visibility", "never");
// auto-open mpv:// URIs without prompting. // auto-open mpv:// URIs without prompting.
// can do this with other protocols too (e.g. matrix?). see about:config for common handlers. // can do this with other protocols too (e.g. matrix?). see about:config for common handlers.
defaultPref("network.protocol-handler.external.mpv", true); defaultPref("network.protocol-handler.external.mpv", true);

View File

@@ -0,0 +1,8 @@
{ lib, config, ... }:
{
sane.programs.firejail = {};
programs.firejail = lib.mkIf config.sane.programs.firejail.enabled {
enable = true; #< install the suid binary
};
}

View File

@@ -1,6 +1,10 @@
# to preview fonts: # to preview fonts:
# - `font-manager` (gui) # - `font-manager` (gui)
# - useful to determine official name; codepoint support # - useful to determine official name; codepoint support
# docs:
# - <https://slatecave.net/notebook/fontconfig/>
# debugging:
# - `fc-conflist` -> show all config files loaded
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
# nerdfonts takes popular open fonts and patches them to support a wider range of glyphs, notably emoji. # nerdfonts takes popular open fonts and patches them to support a wider range of glyphs, notably emoji.
@@ -26,17 +30,40 @@ let
nerdfontPkgs = builtins.map nerdfontPkgs = builtins.map
(f: pkgs.nerdfonts.override { fonts = [ f ]; }) (f: pkgs.nerdfonts.override { fonts = [ f ]; })
wantedNerdfonts; wantedNerdfonts;
# see: <repo:nixos/nixpkgs:nixos/modules/config/fonts/fontconfig.nix>
# and: <repo:nixos/nixpkgs:pkgs/development/libraries/fontconfig/make-fonts-cache.nix>
# nixpkgs creates a fontconfig cache, but only when *not* cross compiling.
# but the alternative is that fonts are cached purely at runtime, in ~/.cache/fontconfig,
# and that needs to either be added to the sandbox of *every* app,
# or font-heavy apps are several *seconds* slower to launch.
#
# TODO: upstream this into `make-fonts-cache.nix`?
cache = (pkgs.makeFontsCache { fontDirectories = config.fonts.packages; }).overrideAttrs (upstream: {
buildCommand = lib.replaceStrings
[ "fc-cache" ]
[ "${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${pkgs.fontconfig.bin}/bin/fc-cache" ]
upstream.buildCommand
;
});
cacheConf = pkgs.writeTextDir "etc/fonts/conf.d/01-nixos-cache-cross.conf" ''
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
<!-- Pre-generated font caches -->
<cachedir>${cache}</cachedir>
</fontconfig>
'';
in in
{ {
sane.programs.fontconfig = { sane.programs.fontconfig = {
sandbox.method = "bwrap"; # TODO:sandbox: untested sandbox.method = "bwrap"; # TODO:sandbox: untested
sandbox.wrapperType = "wrappedDerivation";
sandbox.autodetectCliPaths = "existingOrParent"; #< this might be overkill; or, how many programs reference fontconfig internally? sandbox.autodetectCliPaths = "existingOrParent"; #< this might be overkill; or, how many programs reference fontconfig internally?
persist.byStore.plaintext = [ # persist.byStore.plaintext = [
# < 10 MiB # # < 10 MiB. however, nixos generates its own fontconfig cache at build time now.
".cache/fontconfig" # ".cache/fontconfig"
]; # ];
}; };
fonts = lib.mkIf config.sane.programs.fontconfig.enabled { fonts = lib.mkIf config.sane.programs.fontconfig.enabled {
@@ -44,8 +71,8 @@ in
fontconfig.defaultFonts = { fontconfig.defaultFonts = {
emoji = [ emoji = [
"Noto Color Emoji" "Noto Color Emoji"
"Font Awesome 6 Free" # "Font Awesome 6 Free"
"Font Awesome 6 Brands" # "Font Awesome 6 Brands"
]; ];
monospace = [ monospace = [
"Hack Nerd Font Propo" "Hack Nerd Font Propo"
@@ -61,13 +88,15 @@ in
"DejaVu Sans" "DejaVu Sans"
]; ];
}; };
# nixpkgs builds a cache file, but only for non-cross. i want it always, so add my own cache -- but ONLY for cross.
fontconfig.confPackages = lib.mkIf (pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform) [ cacheConf ];
#vvv enables dejavu_fonts, freefont_ttf, gyre-fonts, liberation_ttf, unifont, noto-fonts-emoji #vvv enables dejavu_fonts, freefont_ttf, gyre-fonts, liberation_ttf, unifont, noto-fonts-emoji
enableDefaultPackages = false; enableDefaultPackages = false;
packages = with pkgs; [ packages = with pkgs; [
# TODO: reduce this font set. # TODO: reduce this font set.
# - probably need only one of dejavu/freefont/liberation # - probably need only one of dejavu/freefont/liberation
dejavu_fonts # 10 MiB; DejaVu {Sans,Serif,Sans Mono,Math TeX Gyre}; also available as a NerdFonts (Sans Mono only) dejavu_fonts # 10 MiB; DejaVu {Sans,Serif,Sans Mono,Math TeX Gyre}; also available as a NerdFonts (Sans Mono only)
font-awesome # 2 MiB; Font Awesome 6 {Free,Brands} # font-awesome # 2 MiB; Font Awesome 6 {Free,Brands}
freefont_ttf # 11 MiB; Free{Mono,Sans,Serif} freefont_ttf # 11 MiB; Free{Mono,Sans,Serif}
gyre-fonts # 4 MiB; Tex Gyre *; ttf substitutes for standard PostScript fonts gyre-fonts # 4 MiB; Tex Gyre *; ttf substitutes for standard PostScript fonts
# hack-font # 1 MiB; Hack; also available as a NerdFonts # hack-font # 1 MiB; Hack; also available as a NerdFonts

View File

@@ -28,7 +28,6 @@ in
# packageUnwrapped = pkgs.fractal-next; # packageUnwrapped = pkgs.fractal-next;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications sandbox.whitelistDbus = [ "user" ]; # notifications
@@ -60,26 +59,19 @@ in
persist.byStore.private = [ persist.byStore.private = [
# XXX by default fractal stores its state in ~/.local/share/<build-profile>/<UUID>. # XXX by default fractal stores its state in ~/.local/share/<build-profile>/<UUID>.
".local/share/hack" # for debug-like builds # ".local/share/hack" # for debug-like builds
".local/share/stable" # for normal releases # ".local/share/stable" # for normal releases
".local/share/fractal" # for version 5+, i think? ".local/share/fractal" # for version 5+
]; ];
suggestedPrograms = [ "gnome-keyring" ]; suggestedPrograms = [ "gnome-keyring" ];
services.fractal = { services.fractal = {
description = "fractal Matrix client"; description = "fractal Matrix client";
after = [ "graphical-session.target" ]; partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
# partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { # env "G_MESSAGES_DEBUG=all"
ExecStart = "${cfg.package}/bin/fractal"; command = "fractal";
Type = "simple";
Restart = "always";
RestartSec = "20s";
};
# environment.G_MESSAGES_DEBUG = "all";
}; };
}; };
} }

View File

@@ -2,12 +2,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.frozen-bubble = { sane.programs.frozen-bubble = {
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet"; # net play
sandbox.whitelistAudio = true;
sandbox.whitelistWayland = true;
packageUnwrapped = pkgs.frozen-bubble.overrideAttrs (upstream: { packageUnwrapped = pkgs.frozen-bubble.overrideAttrs (upstream: {
# patch so it stores its dot-files not in root ~. # patch so it stores its dot-files not in root ~.
postPatch = (upstream.postPatch or "") + '' postPatch = (upstream.postPatch or "") + ''
@@ -15,6 +9,12 @@
--replace-fail '$FBHOME = "$ENV{HOME}/.frozen-bubble"' '$FBHOME = "$ENV{HOME}/.local/share/frozen-bubble"' --replace-fail '$FBHOME = "$ENV{HOME}/.frozen-bubble"' '$FBHOME = "$ENV{HOME}/.local/share/frozen-bubble"'
''; '';
}); });
buildCost = 1;
sandbox.method = "bwrap";
sandbox.net = "clearnet"; # net play
sandbox.whitelistAudio = true;
sandbox.whitelistWayland = true;
persist.byStore.plaintext = [ persist.byStore.plaintext = [
".local/share/frozen-bubble" # preferences, high scores ".local/share/frozen-bubble" # preferences, high scores

View File

@@ -1,5 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
sane.programs.fwupd = {};
services.fwupd = lib.mkIf config.sane.programs.fwupd.enabled { services.fwupd = lib.mkIf config.sane.programs.fwupd.enabled {
# enables the dbus service, which i think the frontend speaks to. # enables the dbus service, which i think the frontend speaks to.
enable = true; enable = true;

View File

@@ -8,8 +8,9 @@
{ ... }: { ... }:
{ {
sane.programs.g4music = { sane.programs.g4music = {
buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # mpris sandbox.whitelistDbus = [ "user" ]; # mpris
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;

View File

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

View File

@@ -20,7 +20,6 @@ in
}; };
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistDbus = [ "user" ]; # notifications sandbox.whitelistDbus = [ "user" ]; # notifications
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
@@ -38,7 +37,7 @@ in
# fs.".config/geary".dir = {}; # fs.".config/geary".dir = {};
# fs.".local/share/folks".dir = {}; # fs.".local/share/folks".dir = {};
slowToBuild = true; # uses webkitgtk 4.1 buildCost = 3; # uses webkitgtk 4.1
persist.byStore.private = [ persist.byStore.private = [
# attachments, and email -- contained in a sqlite db # attachments, and email -- contained in a sqlite db
".local/share/geary" ".local/share/geary"
@@ -88,16 +87,8 @@ in
services.geary = { services.geary = {
description = "geary email client"; description = "geary email client";
after = [ "graphical-session.target" ]; partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
# partOf = [ "graphical-session.target" ]; command = "geary";
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/geary";
Type = "simple";
Restart = "always";
RestartSec = "20s";
};
}; };
}; };

View File

@@ -19,7 +19,6 @@ in
''; '';
}); });
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.whitelistPwd = true; sandbox.whitelistPwd = true;
sandbox.autodetectCliPaths = true; # necessary for git-upload-pack sandbox.autodetectCliPaths = true; # necessary for git-upload-pack

View File

@@ -1,15 +1,12 @@
{ config, lib, pkgs, ... }: { lib, pkgs, ... }:
let
cfg = config.sane.programs.gnome-keyring;
in
{ {
sane.programs.gnome-keyring = { sane.programs.gnome-keyring = {
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome.gnome-keyring; packageUnwrapped = pkgs.rmDbusServices pkgs.gnome.gnome-keyring;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistDbus = [ "user" ]; sandbox.whitelistDbus = [ "user" ];
sandbox.extraRuntimePaths = [ sandbox.extraRuntimePaths = [
"keyring/control" "keyring" #< only needs keyring/control, but has to *create* that.
# "keyring/control"
]; ];
sandbox.capabilities = [ sandbox.capabilities = [
# ipc_lock: used to `mlock` the secrets so they don't get swapped out. # ipc_lock: used to `mlock` the secrets so they don't get swapped out.
@@ -28,10 +25,10 @@ in
fs.".local/share/keyrings/default" = { fs.".local/share/keyrings/default" = {
file.text = "Default_keyring.keyring"; #< no trailing newline file.text = "Default_keyring.keyring"; #< no trailing newline
wantedBy = [ config.sane.fs."${config.sane.persist.stores.private.origin}".unit ]; # wantedBy = [ config.sane.fs."${config.sane.persist.stores.private.origin}".unit ];
wantedBeforeBy = [ #< don't create this as part of `multi-user.target` # wantedBeforeBy = [ #< don't create this as part of `multi-user.target`
"gnome-keyring.service" # TODO: sane.programs should declare this dependency for us # "gnome-keyring.service" # TODO: sane.programs should declare this dependency for us
]; # ];
}; };
# N.B.: certain keyring names have special significance # N.B.: certain keyring names have special significance
# `login.keyring` is forcibly encrypted to the user's password, so that pam gnome-keyring can unlock it on login. # `login.keyring` is forcibly encrypted to the user's password, so that pam gnome-keyring can unlock it on login.
@@ -43,22 +40,21 @@ in
lock-on-idle=false lock-on-idle=false
lock-after=false lock-after=false
''; '';
wantedBy = [ config.sane.fs."${config.sane.persist.stores.private.origin}".unit ]; # wantedBy = [ config.sane.fs."${config.sane.persist.stores.private.origin}".unit ];
wantedBeforeBy = [ #< don't create this as part of `multi-user.target` # wantedBeforeBy = [ #< don't create this as part of `multi-user.target`
"gnome-keyring.service" # "gnome-keyring.service"
]; # ];
}; };
services.gnome-keyring = { services.gnome-keyring = {
description = "gnome-keyring-daemon: secret provider"; description = "gnome-keyring-daemon: secret provider";
after = [ "graphical-session.target" ]; partOf = [ "graphical-session" ];
wantedBy = [ "graphical-session.target" ]; command = let
serviceConfig = { gkr-start = pkgs.writeShellScriptBin "gnome-keyring-daemon-start" ''
ExecStart = "${cfg.package}/bin/gnome-keyring-daemon --start --foreground --components=secrets"; mkdir -m 0700 -p $XDG_RUNTIME_DIR/keyring
Type = "simple"; exec gnome-keyring-daemon --start --foreground --components=secrets
Restart = "always"; '';
RestartSec = "20s"; in "${gkr-start}/bin/gnome-keyring-daemon-start";
};
}; };
}; };
} }

View File

@@ -1,8 +1,8 @@
{ ... }: { pkgs, ... }:
{ {
sane.programs."gnome.gnome-maps" = { sane.programs."gnome.gnome-maps" = {
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome.gnome-maps;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "inplace"; #< dbus files
sandbox.whitelistDri = true; # for perf sandbox.whitelistDri = true; # for perf
sandbox.whitelistDbus = [ sandbox.whitelistDbus = [
"system" # system is required for non-portal location services "system" # system is required for non-portal location services

View File

@@ -3,8 +3,10 @@
{ ... }: { ... }:
{ {
sane.programs."gnome.gnome-weather" = { sane.programs."gnome.gnome-weather" = {
buildCost = 1;
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "inplace"; sandbox.wrapperType = "inplace"; #< /share/org.gnome.Weather/org.gnome.Weather file refers to bins by full path
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.net = "clearnet"; sandbox.net = "clearnet";
suggestedPrograms = [ "dconf" ]; #< stores city/location settings suggestedPrograms = [ "dconf" ]; #< stores city/location settings

View File

@@ -2,8 +2,20 @@
# - turn the tv off and on again (no, really...) # - turn the tv off and on again (no, really...)
# #
# SANITY CHECKS: # SANITY CHECKS:
# - `go2tv -u 'https://uninsane.org/share/AmenBreak.mp4'` # - `go2tv -u 'https://uninsane.org/share/Milkbags/AmenBreak.mp4'`
# - LGTV: works, but not seekable # - LGTV: works, but not seekable
# - Samsung: "Cannot play video."
# - `go2tv -v /mnt/servo/media/Videos/Milkbags/AmenBreak.mp4`
# - Samsung: works
# - `go2tv -v /mnt/servo/media/Videos/Milkbags/COLIN.webm`
# - Samsung: works
# - `go2tv -v /mnt/servo/media/Videos/Shows/Lucky.Star/S01/S01E01-The.Girl.who.Dashes.Off.mkv`
# - Samsung: error 500
# - `go2tv -tc -v /mnt/servo/media/Videos/Shows/Lucky.Star/S01/S01E01-The.Girl.who.Dashes.Off.mkv`
# - Samsung: error 500
# - note that it still advertized .mkv to the TV
# - `cp /mnt/servo/media/Videos/Shows/Lucky.Star/S01/S01E01-The.Girl.who.Dashes.Off.mkv S01E01-The.Girl.who.Dashes.Off.mp4 && go2tv -v S01E01-The.Girl.who.Dashes.Off.mp4`
# - Samsung: WORKS
# - `go2tv -u 'https://youtu.be/p3G5IXn0K7A'` # - `go2tv -u 'https://youtu.be/p3G5IXn0K7A'`
# - LGTV: FAILS ("this file cannot be recognized") # - LGTV: FAILS ("this file cannot be recognized")
# - no fix via transcoding, altering the URI, etc. # - no fix via transcoding, altering the URI, etc.
@@ -17,6 +29,8 @@
# - LGTV: works # - LGTV: works
# #
# WHEN TO TRANSCODE: # WHEN TO TRANSCODE:
# - mkv container + *:
# - Samsung: rename to .mp4 and cast that: no need to transcode
# - mkv container + mpeg-2 video + AC-3/48k stereo audio: # - mkv container + mpeg-2 video + AC-3/48k stereo audio:
# - LGTV: no transcoding needed # - LGTV: no transcoding needed
# - mkv container + H.264 video + AAC/48k 5.1 audio: # - mkv container + H.264 video + AAC/48k 5.1 audio:
@@ -27,6 +41,7 @@
# - LGTV: no transcoding needed # - LGTV: no transcoding needed
# - mkv container + H.265 video + E-AC-3/48k stereo audio: # - mkv container + H.265 video + E-AC-3/48k stereo audio:
# - LGTV: no transcoding needed # - LGTV: no transcoding needed
#
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sane.programs.go2tv; cfg = config.sane.programs.go2tv;
@@ -34,7 +49,6 @@ in
{ {
sane.programs.go2tv = { sane.programs.go2tv = {
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet"; sandbox.net = "clearnet";
sandbox.autodetectCliPaths = true; sandbox.autodetectCliPaths = true;
# for GUI invocation, allow the common media directories # for GUI invocation, allow the common media directories

View File

@@ -23,7 +23,6 @@ in {
}); });
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistDbus = [ "user" ]; # it won't launch without it, dunno exactly why. sandbox.whitelistDbus = [ "user" ]; # it won't launch without it, dunno exactly why.
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.net = "clearnet"; sandbox.net = "clearnet";

View File

@@ -15,7 +15,6 @@
"wl-clipboard" "wl-clipboard"
]; ];
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
sandbox.whitelistDbus = [ "user" ]; sandbox.whitelistDbus = [ "user" ];
sandbox.autodetectCliPaths = "existingFileOrParent"; sandbox.autodetectCliPaths = "existingFileOrParent";

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