Compare commits

...

1244 Commits

Author SHA1 Message Date
084541da4c modules/programs: require manual definition; don't auto-populate attrset
this greatly decreases nix eval time
2024-02-28 13:32:52 +00:00
f7a82a845c sane.gui.phosh: remove 2024-02-28 13:32:52 +00:00
2bdef04552 nix-fast-build: fix to only populate it on supported platforms 2024-02-28 12:46:38 +00:00
2822a6f0dd import nix-fast-build
it's not really working on lappy (uses too much RAM), but maybe it'll help on desko
2024-02-28 12:37:50 +00:00
ab6e362f0c sane-wipe-browser: dont call pkill with sudo 2024-02-28 10:36:13 +00:00
3816393e06 rofi: try integrating rofi-emoji (failed) 2024-02-28 01:28:05 +00:00
4c6c470c86 sway: snippets: port from fuzzel -> rofi 2024-02-28 01:26:22 +00:00
409a4db232 splatmoji: use rofi instead of fuzzel
will be best if i can port everything to one dmenu helper
2024-02-28 01:18:51 +00:00
c73684557e overlays: remove dead optimizations overlay (old ccache stuff) 2024-02-28 00:19:29 +00:00
44067f6570 cross: document the state of gnome-keyring 2024-02-28 00:05:23 +00:00
466e7a9ecd cross: libshumate: push patch upstream 2024-02-27 23:58:49 +00:00
6b2d189771 cross: graphicsmagick: push patch upstream 2024-02-27 23:46:05 +00:00
6ef729bbaf assorted: prefer runCommandLocal over runCommand where it makes sense 2024-02-27 22:26:56 +00:00
8f424dcd5a programs: sandboxing: link /etc into sandboxed programs
this is crucial for e.g. swaync, to find its resource files.
maybe a good idea to link *every* package directory which i also link
into /run/current-system.
2024-02-27 22:25:17 +00:00
7fb7f72bc0 cross: remove modemmanager patch; it compiles OOTB :)
thanks Cole!
2024-02-27 22:08:12 +00:00
67536e3c1f programs: assorted: correct sandbox paths now that Pictures/Videos/Books are categorized
i don't like this Pictures/ approach though. i may reconsolidate some of those
2024-02-27 21:37:20 +00:00
715de37954 rofi: fix files to be opened with xdg-open 2024-02-27 21:20:12 +00:00
c8035abddf fs: Books: persist subdirectories individually
TODO: KOReader will need to be updated for this
2024-02-27 20:48:38 +00:00
ef1cdac6b4 fs: split Pictures into separate persisted directory
TODO: update camera and screenshot apps to be aware of these directories
2024-02-27 20:46:25 +00:00
e37a7d85b3 ~/Videos: don't persist ALL videos: just ~/Videos/local
otherwise, ~/Videos/servo is a symlink which the programs module doesn't know how to traverse (and hence, sandbox).
2024-02-27 20:45:56 +00:00
36f6c72183 rofi: sandbox, and launch apps via xdg-open or gdbus 2024-02-27 18:35:15 +00:00
20a1aeb5b3 programs: add gdbus as a standalone program, separate from the rest of glib 2024-02-27 18:28:24 +00:00
9ba0833d5f todo.md: remove completed/obsoleted tasks 2024-02-27 17:40:42 +00:00
15f353f883 overlays: remove disable-flakey-tests: everything there only applied to emulated builds, which i no longer do 2024-02-27 17:34:22 +00:00
27af0002c8 nixpatches: remove obsoleted j4-menu-desktop build fix 2024-02-27 17:32:56 +00:00
9265252e04 nixpatches: remove stale commented-out patches 2024-02-27 17:29:17 +00:00
11a53c402d nixpatches: procure procmail cross fix from nixpkgs PR 2024-02-27 17:24:20 +00:00
464f439f4a nixpatches: remove ccache cross fix
i assume this was only needed when i was using binfmt?? anyways it doesn't apply cleanly
2024-02-27 17:04:44 +00:00
a4dbf18d7a nixpatches: remove upstreamed "allow i2p to build on aarch64" patch 2024-02-27 17:04:40 +00:00
1579e089e9 cross: remove superfluous spandsp fix
it was upstreamed to nixpkgs 2.5 years ago:
<https://github.com/NixOS/nixpkgs/pull/134698>

meanwhile, my patch was added in 46dabcd33f
2023-03-07: "cross compilation: speculatively compile spandsp with ac_cv_func_malloc_0_nonnull"

this was at a time when nixpkgs spandsp had version 3 and 0.0.6,
and *possibly* only 0.0.6 had the fix.
the fix was added to version 3 in nixpkgs
88cbe74d05cac6e037e934ee7fbe8b1f0d164f25, dated 2023-02-26.
2024-02-27 16:54:59 +00:00
4ce0c23c19 cross: comment out/remove a few more cross fixes for packages i don't plan to use 2024-02-27 16:44:47 +00:00
9710d55c6a cross: comment out/remove cross fixes for packages i don't plan to use anytime soon 2024-02-27 16:20:55 +00:00
4b014af4b1 cross: disable unneeded libei patch 2024-02-27 16:11:59 +00:00
4379addf9e plumb my configured sway through to everywhere that wants pkgs.sway.
kinda ugly. this lets me avoid having multiple versions of sway on my
system.
2024-02-27 16:11:10 +00:00
5c7eceeb55 grimshot: move to own file 2024-02-27 14:54:53 +00:00
50aa16df81 cross compilation: remove unused patches; note upstreaming status 2024-02-27 14:53:26 +00:00
b1e943c9bb swaynotificationcenter: push cross fix upstream 2024-02-27 11:59:36 +00:00
be5fae369f swaynotificationcenter: fix cross compilation 2024-02-27 11:32:48 +00:00
40e22533fb swaynotificationcenter: update config/patches to be compatible with 0.10.0 2024-02-27 11:19:29 +00:00
03c5f82dbf flake: fix sourceInfo propagation (and hence, nixosConfiguration naming!) 2024-02-27 10:34:20 +00:00
e90bbfe551 nixpkgs: 2024-02-25 -> 2024-02-27
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/f42891a2fa716dcab10336a1b7313993430568ea' (2024-02-25)
  → 'github:nixos/nixpkgs/6daf4de0662e1d895d220a4a4ddb356eb000abe9' (2024-02-27)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/8e474340ed0592ca21c1398d88dd89bf7100e881' (2024-02-25)
  → 'github:nixos/nixpkgs/5bd8df40204f47a12263f3614c72cd5b6832a9a0' (2024-02-27)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/2874fbbe4a65bd2484b0ad757d27a16107f6bc17' (2024-02-25)
  → 'github:Mic92/sops-nix/a1c8de14f60924fafe13aea66b46157f0150f4cf' (2024-02-26)
```
2024-02-27 01:24:07 +00:00
92033c8414 rofi: place druncache into rofi cache dir 2024-02-27 01:21:27 +00:00
16f0424631 rofi: patch so that i can use -run-command "my-launcher {app_id}.desktop"
this plus xdg-desktop-portal's DynamicLauncher should provide a way to sandbox everything
2024-02-27 01:03:21 +00:00
6fd1ce1f61 rofi: port cache from plaintext to cryptClearOnBoot
because i don't think it has any invalidation logic
2024-02-26 23:04:50 +00:00
a7c325c8e1 xdg-desktop-portal: link applications so that DynamicLauncher portal can work 2024-02-26 22:31:48 +00:00
fc7814e6cd docs: mime: document gio launch 2024-02-26 22:29:15 +00:00
245e6c93cd docs: xdg-desktop-portal: document notable dbus endpoints 2024-02-26 22:29:03 +00:00
ec073592ed sway: use rofi app launcher instead of fuzzel 2024-02-26 21:22:03 +00:00
617525a317 programs: add rofi (dmenu-style launcher/file browser) 2024-02-26 21:21:30 +00:00
1098d121b4 firefox-extensions.sidebery: 5.0.0 -> 5.1.1.7 2024-02-26 18:07:45 +00:00
821c631b1d firefox-extensions.sponsorblock: 5.5.5 -> 5.5.6 2024-02-26 18:03:44 +00:00
96347ad7ac firefox-extensions.bypass-paywalls-clean: 3.5.5.0 -> 3.5.7.0 2024-02-26 18:02:10 +00:00
4f933cc0fa fix "update.pkgs" script 2024-02-26 18:01:47 +00:00
03615ce244 nixpkgs: 2024-02-24 -> 2024-02-25; sops-nix -> 2024-02-25
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/a3e2b0de906a8fe0143c2783199abdc132dee56a' (2024-02-24)
  → 'github:nixos/nixpkgs/f42891a2fa716dcab10336a1b7313993430568ea' (2024-02-25)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/b66514c14e85cd7d853d6dbbf1a421ba232eff10' (2024-02-24)
  → 'github:nixos/nixpkgs/8e474340ed0592ca21c1398d88dd89bf7100e881' (2024-02-25)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/f6b80ab6cd25e57f297fe466ad689d8a77057c11' (2024-02-21)
  → 'github:Mic92/sops-nix/2874fbbe4a65bd2484b0ad757d27a16107f6bc17' (2024-02-25)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/69405156cffbdf2be50153f13cbdf9a0bea38e49' (2024-02-17)
  → 'github:NixOS/nixpkgs/89a2a12e6c8c6a56c72eb3589982c8e2f89c70ea' (2024-02-25)
```
2024-02-26 17:35:34 +00:00
7d613d90d8 nixcache: disable my own substituters by default 2024-02-26 17:35:34 +00:00
afd52014d1 sane-reclaim-disk-space: note to run as root 2024-02-26 15:25:12 +00:00
dd6e1c5e38 flake: fix "deploy" commands to bypass substituters, and address deprecated nix path signing 2024-02-26 15:01:14 +00:00
d0d7994c2f sxmo: remove 'greeter' option 2024-02-26 07:27:33 +00:00
b5da7a86fa libkiwix: 12.1.1 -> 13.1.0 2024-02-26 06:10:37 +00:00
f2e1bb6b86 programs: python3-repl: sandbox 2024-02-25 18:52:55 +00:00
fe0f6988bd programs: disable wine (unused) 2024-02-25 18:42:25 +00:00
c402a265cd programs: stepmania: sandbox 2024-02-25 18:26:32 +00:00
d5643a6a5d assorted static-nix-shell packages: use srcRoot 2024-02-25 17:37:38 +00:00
e757e35065 static-nix-shell: add a srcRoot argument which allows more precisely specifying the source files and avoiding unnecessary rebuilds 2024-02-25 17:37:10 +00:00
953dd98b0f refactor: static-nix-shell: remove unused options 2024-02-25 17:28:00 +00:00
c9c1181242 programs: wireplumber: sandbox 2024-02-25 17:11:48 +00:00
f9888fe8d6 programs: sane-private-init: sandbox 2024-02-25 16:46:10 +00:00
036145e6ba programs: sane-private-change-passwd: sandbox
note that this is entirely untested
2024-02-25 16:35:13 +00:00
5b647a1a90 programs: sane-private-change-passwd: rewrite based on how my system looks today
i haven't tested this
2024-02-25 16:28:57 +00:00
7c486492c8 programs: pipewire: port sandbox to bwrap and restrict further 2024-02-25 15:19:57 +00:00
890b41f563 programs: pipewire: sandbox
still need to sandbox wireplumber
2024-02-25 14:34:11 +00:00
ca36fe1b96 programs: gnome.seahorse: sandbox 2024-02-25 12:03:42 +00:00
d2df668c9e modules/programs: sane-sandboxed: replace --sane-sandbox-keep-pidspace with --sane-sandbox-keep-namespace <pid|cgroup|ipc|uts> 2024-02-25 12:00:00 +00:00
b7921ac41b refactor: programs: sort 2024-02-25 11:53:49 +00:00
c304367e21 programs: gnome-maps: sandbox 2024-02-25 11:51:50 +00:00
2ad33a49df refactor: pipewire: remove dead code 2024-02-25 10:38:42 +00:00
0b4efd2ab2 pipewire: migrate services to sane.programs to completely disable socket activation
see: https://github.com/NixOS/nixpkgs/issues/291318
2024-02-25 10:36:21 +00:00
0745e9fc06 refactor: programs: split gnome-maps into own file 2024-02-25 09:06:32 +00:00
e0267b5669 programs: pipewire: disable socket activation 2024-02-25 08:55:59 +00:00
b3c7aac8c5 programs: wike: sandbox: enable DRI to fix graphical glitches 2024-02-25 08:38:10 +00:00
c788596c45 programs: sane-private-do: grant net access
crucial for e.g. sane-private-do git push
2024-02-25 08:25:13 +00:00
f807d7c0a2 modules/programs: sane-sandboxed: bwrap: don't virtualize {/dev,/proc,/tmp} if explicitly asked to bind them instead
this is necessary for some programs which want a near-maximial sandbox, like
launchers or shells, or more specifically, `sane-private-do`.
2024-02-25 08:15:39 +00:00
6ab5dd8a8f modules/persist: ensure that the mountpoint for the private store is created at boot 2024-02-25 07:51:24 +00:00
52b8cd0209 modules/persist: ensure backing directory is created *before* we mount 2024-02-25 07:22:50 +00:00
6865331b48 programs: sandbox sane-scripts.private-do 2024-02-25 05:41:27 +00:00
dd00a2fe6e sane-private-do: run a shell by default, and leave the mount in its original state on exit 2024-02-25 05:41:27 +00:00
4ee02151f4 sane-private-{lock,unlock}: just defer to mount 2024-02-25 05:19:44 +00:00
00bf2f79cc ssh: clean up /etc/ssh/host_keys persistence 2024-02-25 05:19:44 +00:00
04a6055d06 remove /libexec from environment.pathsToLink 2024-02-25 05:12:44 +00:00
15a7793f0d bonsai: 1.0.2 -> 1.1.0 2024-02-25 01:59:01 +00:00
f714bd8281 programs: jq: sandbox 2024-02-25 01:59:01 +00:00
73b2594d9b programs: sandboxing: distinguish between "existingFileOrParent" and "existingOrParent" 2024-02-25 01:59:01 +00:00
a55dc5332d modules/programs: sane-sandboxed: introduce "existingOrParent" autodetect-cli option
some programs will want this, to create directories by name; e.g. archive managers
2024-02-25 01:48:10 +00:00
86108518da modules/programs: sane-sandboxed: add a new "existingFile" option for the cli autodetect 2024-02-25 01:43:39 +00:00
0f1ad0f3c9 fs: auto-mount /mnt/<host>/home and enable "follow_symlinks" option 2024-02-24 16:04:04 +00:00
bcd7a6f646 nixpkgs: 2024-02-22 -> 2024-02-24
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/024149d718e25378f4decfeeb614b88208c2f700' (2024-02-22)
  → 'github:nixos/nixpkgs/a3e2b0de906a8fe0143c2783199abdc132dee56a' (2024-02-24)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/a7fa133a1e973c127e9c83e2c8e3407ae3797099' (2024-02-22)
  → 'github:nixos/nixpkgs/b66514c14e85cd7d853d6dbbf1a421ba232eff10' (2024-02-24)
```
2024-02-24 12:21:27 +00:00
92c2eb8383 nixpatches: update the icu cross fix 2024-02-24 12:14:29 +00:00
879d01ac2e modules/ssh: note that theres a better store to place the ssh host_keys in 2024-02-24 12:14:14 +00:00
0448df51e3 modules/programs: sane-sandboxed: add a --sane-sandbox-dry-run flag 2024-02-24 12:00:58 +00:00
8e3eed7d51 modules/programs: sane-sandboxed: factor out the actual execution of the sandbox/program into the toplevel
this will make it easier to intercept
2024-02-24 11:57:42 +00:00
88a70b41f1 modules/programs: handle more symlink forms when calculating a program's sandbox closure 2024-02-24 11:47:39 +00:00
6f59254a22 modules/programs: fix symlink following 2024-02-24 05:36:44 +00:00
4023960dc0 README: MANUAL MIGRATION: move "plaintext" store to /nix/persist/plaintext
to migrate the data:
```sh
$ sudo mkdir /nix/persist/plaintext
$ sudo mv /nix/persist/{etc,home,var} /nix/persist/plaintext
$ sudo ln -s plaintext/etc /nix/persist/etc  #< temporarily; if deploying over ssh
$ switch
$ reboot
$ sudo rm /nix/persist/etc  #< if you did the symlink earlier
```
2024-02-23 18:02:17 +00:00
fff9f9d49a README: MANUAL MIGRATION: move "private" store to /nix/persist/private
to migrate the data, first unmount `~/private` (`sane-private-lock`), then:
```sh
$ sudo mv /nix/persist/home/colin/private /nix/persist
$ switch
$ reboot
```
2024-02-23 16:01:09 +00:00
eecb98e2ee programs: bonsai: fix eval error 2024-02-23 16:00:32 +00:00
5838603953 programs: sane-private-unlock: unbreak
it still doesn't work inside a sandbox, because 'mount' requires suid
2024-02-23 15:59:56 +00:00
c6ebcfe66e servo: port legacy /var/lib users over to "method = bind" persistence
i may wittle these down in the future
2024-02-23 15:49:54 +00:00
d7402ae170 persist: stores: make naming more consistent 2024-02-23 14:57:20 +00:00
bd7ca20361 desko: fs: remove dead code 2024-02-23 14:45:57 +00:00
f5ef1e96ca lappy: fs: remove dead code 2024-02-23 14:44:49 +00:00
6267e7f966 tidy up small persist/private nitpicks 2024-02-23 14:44:38 +00:00
120a41b169 persistence: split /var/log persistence into dedicated "initrd" store 2024-02-23 14:42:47 +00:00
aa0991bd6c persistence: cleanup so it all works well with symlink-based stores 2024-02-23 13:09:44 +00:00
af2f97d61e fs: ensure-file: don't error if the file already exists 2024-02-23 11:29:14 +00:00
5b8f13d9cc fs: notice when a fs entry is set to two incompatible types (e.g. symlink + dir) and error 2024-02-23 11:24:32 +00:00
62b39bf01e firefox: integrate the "persist" config into "sane.programs" 2024-02-23 11:23:41 +00:00
0d8307e877 programs: gnome-keyring: sandbox
and now secrets are readable again. they were broken for the last ~10 commits :)
2024-02-23 09:49:35 +00:00
9b1a2ae9bb programs: mpv: remove useless "extraRuntimePaths = []" override 2024-02-23 09:32:19 +00:00
b8b805765b programs: gnome-keyring-daemon: remove the SUID wrapper
it's not actually mandated. just, when enabled, gkd will `mlock` its
secrets into memory. but i don't use swap anyway. plus, i'll enable that
momentarily anyway (though systemd will probably not understand the
capablity)
2024-02-23 09:28:41 +00:00
84eae20765 gnome-keyring: don't integrate with PAM
PAM integration is only required if the keyring is encrypted on-disk
2024-02-23 09:15:30 +00:00
4a10c5f729 gnome-keyring: start as systemd service explicitly, not as implicit dbus service 2024-02-23 09:09:54 +00:00
c2696c1cd9 gnome-keyring: use sane.fs abstractions to write out the keyrings 2024-02-23 08:57:41 +00:00
c23e4dc9c7 servo: note why i use file.text instead of symlink.text here 2024-02-23 08:14:27 +00:00
ea6f45555c gnome-keyring: simplify the scripts (untested) 2024-02-23 08:14:09 +00:00
687db545b4 gnome-keyring: move persistence and init script to sane.programs 2024-02-23 07:22:07 +00:00
24d1d13d0a programs: simplify sandboxing of file browsers/etc now that private data lives on a different mount 2024-02-23 07:06:29 +00:00
2ada436634 home: remove ~/private symlink; move to .persist/private and add related aliases 2024-02-23 07:06:29 +00:00
e5ad0862fb refactor: move ~/ fs definitions into hosts/common/home, not users/ 2024-02-23 07:06:29 +00:00
057b9e3fed replace links/references to ~/private/FOO with just ~/FOO 2024-02-23 07:06:29 +00:00
1bcfccf7e3 refactor: persist ~/knowledge formally instead of relying on the symlink 2024-02-23 07:06:29 +00:00
170eeeacc4 programs: dereference not just the leaf, but any part of the path, when determining a program's sandbox closure 2024-02-23 07:06:29 +00:00
a402822084 move "private" store to /mnt/persist/private instead of ~/private
this will allow me to add all of ~ to a sandbox without giving all of ~/private
2024-02-23 07:06:29 +00:00
80ecdcc4f9 persist: plaintext: consider "/mnt/persist/plaintext" as the logical root, and abstract away "/nix/persist" 2024-02-23 07:06:29 +00:00
0864790bb7 docs: modules/persist: document the "origin" store parameter 2024-02-23 07:06:29 +00:00
478747a96e modules/persist: change default mounting method to symlink
this changes the plaintext and cryptClearOnBoot stores: private was already symlink-based.
this isn't strictly necessary: the rationale is:
1. `mount` syscall *requires* CAP_SYS_ADMIN (i.e. superuser/suid).
   that's causing problems with sandboxing, particularly ~/private.
   that doesn't affect other stores *yet*, but it may in the future.
2. visibility. i.e. it makes *clear* where anything is persisted.
   if `realpath` doesn't evaluate to `/nix/persist`, then it's not
   persisted.
2024-02-23 07:06:29 +00:00
771dc2e1ce fs: allow common /mnt points to be mounted by me without sudo 2024-02-23 07:06:29 +00:00
4a316d4b91 bonsai: lift out of sxmo 2024-02-23 07:06:29 +00:00
0ff8154e96 icu: fix cross compilation 2024-02-23 07:04:39 +00:00
af03b3f6e8 xwayland: sandbox 2024-02-23 01:05:24 +00:00
5819f07181 programs: xwayland: sandbox 2024-02-22 22:12:03 +00:00
122f3fa5cc sway: remove xwayland-specific placement of Signal
it breaks non-xwayland sway config parsing, and Signal is native Wayland now anyway even with Xwayland running'
2024-02-22 22:01:48 +00:00
ece612ea70 nixpkgs: 2024-02-21 -> 2024-02-22
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/97c19bdc7ecbe44755084a52acf38e17bdf2bc71' (2024-02-21)
  → 'github:nixos/nixpkgs/024149d718e25378f4decfeeb614b88208c2f700' (2024-02-22)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/0e74ca98a74bc7270d28838369593635a5db3260' (2024-02-21)
  → 'github:nixos/nixpkgs/a7fa133a1e973c127e9c83e2c8e3407ae3797099' (2024-02-22)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/acfcce2a36da17ebb724d2e100d47881880c2e48' (2024-02-20)
  → 'github:Mic92/sops-nix/f6b80ab6cd25e57f297fe466ad689d8a77057c11' (2024-02-21)
```
2024-02-22 07:07:29 +00:00
f27f994090 systemd: fix the timeout for the user service manager 2024-02-22 00:24:05 +00:00
473999c001 sway: re-enable networkmanager 2024-02-21 23:46:25 +00:00
d1de9efde1 sway: port xwayland use to sane.programs API 2024-02-21 23:32:10 +00:00
50c3f04714 pipewire: remove dead alsa comments 2024-02-21 23:26:40 +00:00
49bad8f186 sway: split pipewire persisted file into pipewire.nix 2024-02-21 23:26:25 +00:00
fd9f500e97 sway: split pipewire config into separate sane.programs.pipewire 2024-02-21 23:23:52 +00:00
386651044e sway: port to sane.programs API 2024-02-21 23:18:57 +00:00
55a6c828f2 sway: lift portal/menu reset into polyunfill.nix 2024-02-21 22:09:53 +00:00
7ecebd7521 sway: treat fontconfig as an ordinary sane.programs 2024-02-21 22:08:45 +00:00
7b299176e3 sway: simplify the wrapper 2024-02-21 22:06:10 +00:00
4da9cb5ac8 sway: simplify the wrapper... slightly 2024-02-21 21:42:48 +00:00
f068da709f sway: compile with xwayland only if we plan to use it at runtime
else it's just extra weight
2024-02-21 21:05:41 +00:00
5b21257e4f gui: sway: remove useGreeter option (provide a greeter always, via suggestedPrograms) 2024-02-21 20:59:34 +00:00
d77a12ce7b unl0kr: remove the "afterLogin" option and choose automatically which desktop to launch 2024-02-21 20:47:48 +00:00
153d2a1047 GSK_RENDERER: don't set globally, but just for the apps which _actually_ require it
this way i can avoid conflicts around apps which don't expect this to be set (e.g. delfin)
2024-02-21 16:56:56 +00:00
2a528a5d8e sane-sandboxed: leave a note about future mount work 2024-02-21 16:08:42 +00:00
b8f090be93 programs: delfin: add required mpris permissions 2024-02-21 13:27:19 +00:00
b16902bec1 delfin: downgrade 0.4.1 -> 0.4.0
0.4.1 doesn't cross compile because of rust requirement. 0.4.0 does
2024-02-21 13:26:54 +00:00
c919372324 delfin: add option to build in debug mode, and with debug patches 2024-02-21 12:09:48 +00:00
60371585e4 delfin: 0.4.0 -> 0.4.1 2024-02-21 09:04:49 +00:00
20cb850fb5 nixpkgs: 2024-02-18 -> 2024-02-21
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/d076cde70cbceca9315a11bdc609ddfcec9dfbca' (2024-02-18)
  → 'github:nixos/nixpkgs/97c19bdc7ecbe44755084a52acf38e17bdf2bc71' (2024-02-21)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/9511a7b219df1f8d8f5c2a58c4870fde169fe397' (2024-02-18)
  → 'github:nixos/nixpkgs/0e74ca98a74bc7270d28838369593635a5db3260' (2024-02-21)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/ffed177a9d2c685901781c3c6c9024ae0ffc252b' (2024-02-18)
  → 'github:Mic92/sops-nix/acfcce2a36da17ebb724d2e100d47881880c2e48' (2024-02-20)
```
2024-02-21 00:35:14 +00:00
c6470918de types.string -> types.str 2024-02-21 00:25:44 +00:00
c0f374bd80 programs: sane-secrets-dump: don't leak secrets onto proc/cmdline 2024-02-21 00:24:31 +00:00
5a0760a571 programs: sandbox oathtools 2024-02-21 00:03:48 +00:00
757ab79724 programs: dconf: sandbox 2024-02-20 23:43:25 +00:00
81148b7b42 programs: explicitly depend on dconf instead of manually persisting dconf's dirs 2024-02-20 23:39:27 +00:00
429d0c53e7 programs: ripgrep: sandbox with bwrap instead of landlock
this provides network isolation
2024-02-20 23:32:54 +00:00
6cf1bc5a28 programs: grep: sandbox 2024-02-20 23:32:28 +00:00
768b340c93 findutils: sandbox
use bwrap instead of landlock for the dumb preference that i can disable
net
2024-02-20 23:31:58 +00:00
d9901aa161 programs: sane-secrets-*: sandbox 2024-02-20 23:31:39 +00:00
be2098c18a programs: sane-vpn: sandbox 2024-02-20 23:05:24 +00:00
ee7d99289a sane-vpn: allow shorthands like "sane-vpn up us" instead of full ovpnd-us 2024-02-20 23:01:53 +00:00
bb569b1668 sane-vpn: port away from systemd so that i can use it as an ordinary user (no sudo) 2024-02-20 22:21:02 +00:00
34524ea3e4 modules/vpn: fix the vpn-* systemd services 2024-02-20 20:40:46 +00:00
71025329e7 programs: sane-dev-cargo-loop: sandbox 2024-02-20 19:26:38 +00:00
ca4d1e3b9d programs: sane-tag-music: sandbox 2024-02-20 19:26:18 +00:00
284b698015 sane-reclaim-boot-space: fix, and sandbox
well i didn't get to test this thoroughly: might still have problems
2024-02-20 19:16:36 +00:00
bc50daf685 nix.settings: port to structured attrs 2024-02-20 18:35:03 +00:00
47dcfb9cba fix nix.settings.nix-path to actually take effect
now i can `nix-shell` again! nix-path takes precedence over `NIX_PATH`
env var.
2024-02-20 17:54:25 +00:00
2bd99f6e51 remove no-longer-needed nix trusted-users setting
well, it *seems* to work, at least!
2024-02-20 13:43:41 +00:00
8beac8df2f programs: sandbox sane-shutdown, sane-reboot 2024-02-20 13:43:05 +00:00
58db553c84 programs: unl0kr: sandbox 2024-02-20 13:29:56 +00:00
2ea3776d84 programs: sane-sync-from-servo: remove
this was obsoleted by the top-level flake `sync` scripts
2024-02-20 13:16:21 +00:00
d596d005ca systemd: configure a 25s stop timeout for the user manager too (hopefully) 2024-02-20 13:11:47 +00:00
e92db138ef systemd: allow ordinary users to invoke shutdown/reboot 2024-02-20 12:25:04 +00:00
5fed127c23 refactor: split systemd config into own file 2024-02-20 12:18:28 +00:00
db49f0461c refactor: move nix stuff out of common/default.nix -> common/nix/default.nix 2024-02-20 12:16:00 +00:00
73bb7827c0 refactor: nix-path/ -> nix/ 2024-02-20 12:13:52 +00:00
a624571b22 move glib program recommendation into programs/assorted.nix 2024-02-20 12:11:26 +00:00
53cbe5c8da dconf: split into own sane.programs definition 2024-02-20 12:09:52 +00:00
46de7b7e0d move environment.defaultPackages clearing into polyunfill.nix 2024-02-20 11:54:39 +00:00
d7be5da483 warnings.nix: port to a proper module 2024-02-20 11:19:12 +00:00
902e351085 hack: silence the warning about using hashedPasswordFile *and* initialPassword
see: <https://github.com/NixOS/nixpkgs/pull/287506>

i'll factor this into something more general, later
2024-02-20 11:11:07 +00:00
9e8e1d82a6 flake: add a deploy.self-light target 2024-02-20 10:24:33 +00:00
a05184f956 programs: neovim: fix nvim-treesitter typo 2024-02-20 10:23:52 +00:00
36ad2d5421 programs: unl0kr: auto-derive the user option 2024-02-20 07:21:22 +00:00
b0f62830a5 unl0kr: port to sane.programs 2024-02-20 07:14:30 +00:00
f970679266 sxmo: remove symlinks for legacy sxmo_hook_{poweroff,reboot}.sh 2024-02-20 06:49:42 +00:00
c7f4661c1c programs: htop: persist config 2024-02-20 05:38:45 +00:00
e8306831c5 programs: qemu: mark as slowToBuild 2024-02-20 05:34:47 +00:00
41b1a013d7 programs: sane-sudo-redirect: disable sandbox 2024-02-19 17:09:27 +00:00
f785ccd351 programs: sane-reclaim-disk-space: sandbox 2024-02-19 17:06:22 +00:00
48744dcaaa programs: sane-ip-reconnect: remove (unused) 2024-02-19 17:05:27 +00:00
9373864b60 programs: sane-git-init: remove (unused) 2024-02-19 16:53:59 +00:00
c16c9dfe0b programs: sandbox a bunch of sane scripts 2024-02-19 16:51:53 +00:00
292a411fb3 linux-megous: 6.7.2 (20240127-1717) -> 6.7.4 (20240211-1928) 2024-02-19 16:37:11 +00:00
2d17826731 programs: eza: sandbox with bwrap instead of landlock 2024-02-19 15:32:40 +00:00
34dedcff57 modules/programs: sane-sandboxed: fix normPath handling of paths containing special characters like [ 2024-02-19 15:32:23 +00:00
de297f22be programs: split sane-scripts out of assorted.nix 2024-02-19 14:19:10 +00:00
4b47b76461 programs: sfeed: sandbox 2024-02-19 14:14:59 +00:00
3effd59c9b xdg-desktop-portal-{gtk,wlr}: start via service manager, with ordered deps, instead of letting dbus activate it for us
that gets more reliable environment importing, etc
2024-02-19 13:44:23 +00:00
a3d0691d99 trivial-builders: add rmDbusServicesInPlace for when the symlink method isnt applicable 2024-02-19 13:43:22 +00:00
44647e0d36 programs: forkstat: sandbox 2024-02-19 13:15:15 +00:00
da1053d635 programs: configure auto-launching programs to only start *after* graphical-session.target
this ensures they really have their environment
2024-02-19 12:58:08 +00:00
273b1b84e3 systemd: reduce the stop job timeout 2024-02-19 12:58:08 +00:00
0b6b98bba6 sway: add a safeguard to catch if the systemd environ race condition is re-introduced 2024-02-19 12:58:08 +00:00
8886177c23 xdg-desktop-portal: fix it to find all the portal configs again
maybe i broke this when i simplified XDG_CONFIG_DIRS? not sure
2024-02-19 12:58:08 +00:00
7e343bfc05 sway: fix race condition around dbus/systemd environment importing 2024-02-19 10:52:51 +00:00
f72bdb6f3a activationScripts: notify on deploy: fix to work with new SWAYSOCK name 2024-02-19 08:21:23 +00:00
5666a05ef0 strip out a bunch of unused nixpkgs defaults 2024-02-19 06:20:13 +00:00
05daf738fc nixpkgs: 2024-02-17 -> 2024-02-18
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/6caa6affcc4774c81467ed08fa3ec35da40fd1d9' (2024-02-17)
  → 'github:nixos/nixpkgs/d076cde70cbceca9315a11bdc609ddfcec9dfbca' (2024-02-18)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/28d6a724f54085377102db7c3278ba82a0a5255f' (2024-02-17)
  → 'github:nixos/nixpkgs/9511a7b219df1f8d8f5c2a58c4870fde169fe397' (2024-02-18)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/48afd3264ec52bee85231a7122612e2c5202fa74' (2024-02-13)
  → 'github:Mic92/sops-nix/ffed177a9d2c685901781c3c6c9024ae0ffc252b' (2024-02-18)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/d8cd80616c8800feec0cab64331d7c3d5a1a6d98' (2024-02-10)
  → 'github:NixOS/nixpkgs/69405156cffbdf2be50153f13cbdf9a0bea38e49' (2024-02-17)
```
2024-02-18 19:05:04 +00:00
35b4cc779f megapixels: switch to bwrap, to support Loupe image viewer 2024-02-18 18:46:37 +00:00
c7d111a318 megapixels: 1.7.0 -> 1.8.0 2024-02-18 18:27:47 +00:00
7e5eb6324d megapixels: sandbox
it's iffy... 1.8.0 is released, which can be sandboxed w/o sys/dev/char or ~/.local/share/applications, but seems to be even flakier
2024-02-18 17:44:49 +00:00
95cb5624ca modules/programs: sane-sandboxed: fix but that --sane-sandbox-path / wasnt being canonicalized 2024-02-18 13:53:53 +00:00
55c305812d WIP: megapixels: sandbox 2024-02-18 13:53:18 +00:00
600f6eb56c modules/programs: sane-sandboxed: remove all remaining forks/subshells
launchtime for firefox in bwrap is about 65ms; 35ms for --sane-sandbox-method none
2024-02-18 13:15:04 +00:00
fd6f8493a7 modules/programs: sane-sandboxed: remove all forking from normPath
reduces time for librewolf benchmark from 90ms -> 65ms. there's still _some_ forking in this script, but it's constant now.
2024-02-18 12:25:03 +00:00
f10f1ee7b1 modules/programs: sane-sandboxed: optimize "normPath" to not invoke subshells
each subshell causes like 5ms just on my laptop, which really adds up.
this implementation still forks internally, but doesn't exec.
runtime decreases from 150ms -> 90ms for
`time librewolf --sane-sandbox-replace-cli true`
2024-02-18 12:08:23 +00:00
67395bdcd3 programs: ship forkstat 2024-02-18 11:58:30 +00:00
90ceeede74 programs: flare-signal: disable (unused) 2024-02-18 07:07:29 +00:00
32a704b1b8 moby: disable unused "calls" program
i may have future use for it, but as-is currently it's not worth the difficulty of sandboxing
2024-02-18 07:07:29 +00:00
a591be98d4 programs: portfolio-filemanager: sandbox 2024-02-18 07:07:29 +00:00
82e028e37d programs: nautilus: assign a mime priority 2024-02-18 07:07:29 +00:00
a531676d0d mime: include an error message when two file associations have identical mime priority 2024-02-18 07:07:29 +00:00
7f7543ee78 programs: planify: sandbox 2024-02-18 07:07:29 +00:00
8d0e3e0db3 programs: notejot: sandbox 2024-02-18 07:07:29 +00:00
bf352d184c programs: tangram: sandbox 2024-02-18 07:07:29 +00:00
81a6600f54 programs: xarchiver: sandbox 2024-02-18 07:07:29 +00:00
9fde167e71 firefox-extensions.open-in-mpv: build from source
this ensures that the extension and the native component stay in sync
2024-02-18 06:14:49 +00:00
4e180e11df open-in-mpv: update the non-browser component to 2.2.0
i _suppose_ i should keep these in sync... hmm
2024-02-18 06:02:00 +00:00
902166e45a sxmo-utils: 2024-01-01 -> 2024-02-05 2024-02-18 04:57:20 +00:00
797bc4e188 delfin: 0.3.0 -> 0.4.0
i can't upstream this until i figure out why both versions fail to open media for me (portal stuff?)
2024-02-18 04:54:35 +00:00
536f0aedc3 open-in-mpv: remove my patch which has been upstreamed, previously required to use xdg-open 2024-02-18 04:52:27 +00:00
b855df902f firefox-extensions: metamask,open-in-mpv,sponsorblock,ublacklist: update to latest 2024-02-18 04:50:03 +00:00
80ce49c579 firefox-extensions.bypass-paywalls-clean: 3.5.3.0 -> 3.5.5.0 2024-02-18 04:49:18 +00:00
408059420d snippets: prefer the repology link which specifically shows my outdated packages 2024-02-18 04:15:05 +00:00
a3102c9395 pkgs overlay: prefer my own packages, if theyre newer than whats in nixpkgs
this gives me an easier way to test updates for the packages i maintain than a workflow based on patching nixpkgs
2024-02-18 04:07:23 +00:00
6760fcf1f4 snippets: remove home-manager; add repology 2024-02-18 03:43:32 +00:00
a90898491e flake: fix "preDeploy" action mishandling null 2024-02-18 01:24:05 +00:00
059940d8e7 nixpkgs: 2024-02-16 -> 2024-02-17
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/0ec5bef772dc12003df7a55f7be1f7b8809f8b48' (2024-02-16)
  → 'github:nixos/nixpkgs/6caa6affcc4774c81467ed08fa3ec35da40fd1d9' (2024-02-17)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/1225df86908f6f5b23553e9d77da4df4bfdd58ef' (2024-02-16)
  → 'github:nixos/nixpkgs/28d6a724f54085377102db7c3278ba82a0a5255f' (2024-02-17)
```
2024-02-17 17:18:38 +00:00
98aafead94 programs: wob: add missing "coreutils" dep
it *should* be acquired via user's PATH, but wob-pulse can start before sway imports PATH to systemd
2024-02-17 16:38:22 +00:00
cef2591425 modules/programs: sane-sandboxed: capshonly/landlock: don't request capabilities we know won't be granted 2024-02-17 16:30:18 +00:00
f8663cd827 programs: monero-gui: sandbox 2024-02-17 16:06:58 +00:00
af1ee1734d programs: wireguard-tools: sandbox 2024-02-17 15:54:16 +00:00
5375cab716 programs: ntfy-sh: sandbox 2024-02-17 15:47:47 +00:00
162b3f5674 imagemagick: don't add 'ghostscript' package to path 2024-02-17 15:45:50 +00:00
a729f91d21 programs: jq: add working sandbox criteria, but don't enable yet
i need to handle the extremely common `cat foo | jq .` without adding
`.` to the sandbox
2024-02-17 15:36:41 +00:00
a273b559e2 programs: gnome-disk-utility: sandbox 2024-02-17 15:36:28 +00:00
785b375671 programs: smartmontools (smartctl): sandbox 2024-02-17 15:36:13 +00:00
24cba0c856 programs: xq: remove 2024-02-17 15:30:23 +00:00
df1db5d01c programs: sox: sandbox 2024-02-17 15:27:22 +00:00
6749b64bca programs: nautilus: add mounted media to the sandbox 2024-02-17 15:26:49 +00:00
d3e4bdfcd5 programs: gdisk: fix sandboxing 2024-02-17 15:26:16 +00:00
799cd4373f programs: socat: disable 2024-02-17 15:11:12 +00:00
2efa6d1e27 programs: mepo: sandbox 2024-02-17 15:08:21 +00:00
a1470956a5 programs: gdisk: sandbox 2024-02-17 14:57:33 +00:00
556c20bc04 programs: vulkan-tools: sandbox 2024-02-17 14:53:22 +00:00
cf5f58dda6 programs: nmap: sandbox 2024-02-17 14:51:26 +00:00
fd30f7abbc dev-machines: disable broken ldd-aarch64 program 2024-02-17 14:47:28 +00:00
6f8c299c69 programs: xdg-desktop-portal: log more 2024-02-17 14:40:56 +00:00
bbf7aac062 programs: gnome-frog: sandbox 2024-02-17 14:40:42 +00:00
7d1fd2f30a programs: nvme-cli: sandbox 2024-02-17 14:40:29 +00:00
472987f164 programs: gimp: fix sandboxing failure 2024-02-17 13:43:35 +00:00
784c2145f3 programs: iputils: sandbox 2024-02-17 03:33:05 +00:00
4ced02b0b2 modules/programs: make-sandboxed: fix incorrect "priority" attribute 2024-02-17 03:32:49 +00:00
0000afb315 programs: make nixosBuiltins package set more precise 2024-02-17 03:08:14 +00:00
31fa21bd20 programs: host/iproute2/iw/nettools/wirelesstools: sandbox 2024-02-17 03:05:58 +00:00
9510817604 programs: document nixosBuiltins programs 2024-02-17 02:40:28 +00:00
4a84de3ee4 programs: inetutils/iptables: sandbox 2024-02-17 02:32:57 +00:00
ab42a4cc5a programs: qemu: disable sandbox 2024-02-17 01:43:58 +00:00
f6537b083a programs: discord: add dbus to sandbox 2024-02-17 01:42:22 +00:00
5ff1d014b8 servo: transmission: fix user agent 2024-02-17 01:35:40 +00:00
fa41e6c402 nixpkgs: 2024-02-14 -> 2024-02-16; uninsane-dot-org -> 2024-02-15
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/52e165035c897a7b41ff26bc235f8d841e9d3850' (2024-02-14)
  → 'github:nixos/nixpkgs/0ec5bef772dc12003df7a55f7be1f7b8809f8b48' (2024-02-16)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/c0a130d16b170f4820c3d2ed294a7aaabf451bfd' (2024-02-14)
  → 'github:nixos/nixpkgs/1225df86908f6f5b23553e9d77da4df4bfdd58ef' (2024-02-16)
• Updated input 'uninsane-dot-org':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=4a1fa488e64e6c87c6c951e3fafb2684692f64d3' (2024-01-01)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=bb10cd8853d05191e4d62947d93687c462e92c30' (2024-02-15)
```
2024-02-16 15:34:19 +00:00
1b4306e649 programs: switch bridge-utils, btrfs-progs from landlock -> bwrap
landlock can't isolate net yet, so bwrap gives better sandboxing
2024-02-16 15:32:41 +00:00
af8a8358bd programs: hdparm: sandbox 2024-02-16 15:32:41 +00:00
464c6c56c5 programs: btrfs-progs: sandbox 2024-02-16 15:32:41 +00:00
8e314e8b73 programs: bridge-utils: sandbox 2024-02-16 15:32:41 +00:00
198029f95f programs: netcat: sandbox 2024-02-16 15:32:41 +00:00
1d646459ab programs: pulsemixer: sandbox 2024-02-16 15:32:41 +00:00
8f3bab3636 programs: sort 2024-02-16 15:32:41 +00:00
a909a93c29 programs: strings: fix sandboxing 2024-02-16 15:32:41 +00:00
6aaa724abf programs: strings: sandbox 2024-02-16 14:57:25 +00:00
a1c721d5b4 programs: binutils-unwrapped -> strings: distribute just the binary i care about 2024-02-16 14:57:25 +00:00
4002a57e03 servo: transmission: advertise as 3.00 to deal with old trackers 2024-02-16 12:58:08 +00:00
74a0b0d125 gitea: serve phone-case-cq/ build files as proper html/js content type 2024-02-16 12:07:28 +00:00
cd3b4dde7b programs: nix-index: sandbox 2024-02-16 11:39:05 +00:00
a9d384688a programs: alsaUtils: sandbox 2024-02-16 11:28:43 +00:00
fffd6f4204 programs: pciutils: sandbox 2024-02-16 11:12:47 +00:00
324485d105 programs: networkmanagerapplet: sandbox 2024-02-16 11:07:24 +00:00
7cb8b144b2 programs: sandbox fatresize 2024-02-16 10:45:56 +00:00
c2bb97e7e6 programs: ethtool: sandbox 2024-02-16 10:38:39 +00:00
3cbdc03369 programs: zeal: disable sandboxing 2024-02-16 10:32:49 +00:00
5c7fa591a0 programs: sandbox: dtrx/e2fsprogs/efibootmgr/electrum 2024-02-16 10:32:18 +00:00
18c54e8b04 programs: sandbox cryptsetup and ddrescue (latter is untested, probably lacking!) 2024-02-16 10:05:24 +00:00
1416856fb6 programs: blueberry: sandbox 2024-02-16 07:58:00 +00:00
2a5bc6f612 programs: util-linux: disable sandbox 2024-02-16 07:37:59 +00:00
c56a6a8c24 programs: disable libcap_ng since it cant sandbox 2024-02-16 07:32:34 +00:00
f5a4bdedaf programs: libcap_ng (netcap): disable sandbox 2024-02-16 07:32:05 +00:00
114a45f347 programs: pstree: sandbox 2024-02-16 06:57:45 +00:00
d53344d527 programs: killall: sandbox 2024-02-16 06:57:32 +00:00
561447de70 programs: shattered-pixel-dungeon: sandbox 2024-02-16 06:57:03 +00:00
b6f918c32f TODO.md: update sandboxing tasks 2024-02-16 06:18:11 +00:00
9cc12fab5d programs: gpodder: fix to work in sandbox (add dbus) 2024-02-16 06:07:46 +00:00
5cda3b2805 programs: firefox/fractal: document portal filechooser limitations 2024-02-16 05:49:56 +00:00
4afd56ff4c programs: powertop: fix capabilities typo in sandbox definition 2024-02-16 05:49:13 +00:00
029ba43bd6 modules/programs: sane-sandboxed: invoke "capsh" with the --no-new-privs argument 2024-02-16 05:48:50 +00:00
00e4078300 programs: disable lemoa. it's broken and development doesn't seem to be progressing 2024-02-16 05:34:24 +00:00
94b4f78e39 programs: lemoa: sandbox 2024-02-16 05:32:22 +00:00
3fd89ec91b programs: sandbox powertop 2024-02-16 05:28:17 +00:00
4085828575 programs: sandbox parted 2024-02-16 05:28:07 +00:00
1a972927b6 programs: sandbox nethogs, nmon, nixpkgs-review 2024-02-16 05:27:50 +00:00
5f3ec42f57 programs: sandbox lsof with capsh only
can't get it to sandbox any more aggressively with either landlock or
bwrap
2024-02-16 04:55:18 +00:00
28aaeb051f programs: disable sandboxing for strace and screen 2024-02-16 04:51:52 +00:00
9d252d095e programs: htop/iotop/iftop: sandbox 2024-02-16 04:51:18 +00:00
4e5e4219ec programs: usbutils: sandbox 2024-02-16 04:03:47 +00:00
824dd7c1f5 programs: endless-sky: sandbox with bwrap 2024-02-16 04:00:27 +00:00
b840a0d61c programs: space-cadet-pinball: sandbox w/ bwrap 2024-02-16 03:58:09 +00:00
36bcecfd68 programs: sort 2024-02-16 03:53:53 +00:00
c3a5fb9394 programs: wdisplays: sandbox with bwrap 2024-02-16 03:53:27 +00:00
30507c3564 programs: soundconverter: sandbox with bwrap 2024-02-16 03:51:23 +00:00
2b66ffc58a programs: feedbackd: sandbox w/ bwrap 2024-02-16 03:49:59 +00:00
48d96c1f36 programs: hase: sandbox with bwrap
couldn't test the net feature, because hase servers have since gone
offline :((
2024-02-16 03:48:59 +00:00
cdf61755a3 programs: splatmoji: document the sandboxing approach 2024-02-16 03:46:48 +00:00
dd1dc69530 packages: remove unused kid3 2024-02-16 03:39:45 +00:00
481f54ea2f packages: disable unused packages: makemkv, mumble, openscad 2024-02-16 03:20:17 +00:00
511752fab5 programs: xdg-desktop-portal{-gtk,-wlr}: enable sandbox 2024-02-16 03:17:19 +00:00
40ed7cff1b programs: git: fix failing sandbox build 2024-02-16 03:16:46 +00:00
5e7f914354 programs: superTux: fix failing sandbox build 2024-02-16 03:16:28 +00:00
8c9c6ec979 modules/programs: make-sandboxed: support /libexec binaries 2024-02-16 03:15:45 +00:00
0dec8b6d5b programs: fontconfig: sandbox 2024-02-15 18:26:45 +00:00
7eaffc9fa0 programs: w3m: enable sandbox 2024-02-15 18:25:48 +00:00
b7c1a6331d programs: mate.engrampa: enable sandbox 2024-02-15 18:24:27 +00:00
d6868d58e6 xdg-desktop-portal: disable sandbox 2024-02-15 18:23:40 +00:00
1edb1fc8b6 modules/programs: sane-sandboxed: avoid adding the sandbox implementation to $PATH 2024-02-15 17:58:22 +00:00
52d768a162 programs: xterm: mark as not needing a sandbox 2024-02-15 17:26:55 +00:00
7a685d8de9 programs: inkscape: sandbox with bwrap 2024-02-15 17:26:37 +00:00
838c6d7dc8 programs: swaync: sandbox 2024-02-15 16:38:38 +00:00
8d20dcadd1 modules/programs: sane-sandboxed: add --sane-sandbox-keep-pidspace flag 2024-02-15 15:05:28 +00:00
9d706df5b5 programs: waybar: narrow the /run/user paths to just sway-ipc.sock 2024-02-15 14:40:01 +00:00
06f1f1e9ea sway: give SWAYSOCK a consistent name 2024-02-15 14:38:54 +00:00
2fbbe7fd78 sway: remove unused "sane.gui.sway.package" option 2024-02-15 14:38:10 +00:00
24d23f7903 programs: bemenu: fix sandboxing 2024-02-15 14:33:20 +00:00
0394aa65e9 sway: simplify config 2024-02-15 14:25:45 +00:00
5090c4e88c sway: define without using nixos "programs.sway"
motivation was to leverage 'sane.programs.sway.env' to statically configure SWAYSOCK. i think that's still the right way: we'll see
2024-02-15 14:25:27 +00:00
081114da65 programs: waybar: sandbox in a way that works well for moby too 2024-02-15 13:16:18 +00:00
c943442c94 modules/programs: sane-sandboxed: add --sane-sandbox-method none for benchmarking 2024-02-15 13:13:39 +00:00
02b7586ffa programs: komikku: add dbus to the sandbox to fix it 2024-02-15 11:58:08 +00:00
02dd629616 modules/programs: sane-sandboxed: rework so portal env vars arent set when sandbox is disabled
and by setting them only at launch time we aid introspectability/debugging
2024-02-15 11:57:36 +00:00
25dcb7f89a programs: open-in-mpv: document that upstream merged my PR 2024-02-15 11:38:37 +00:00
88f1d63b6e firefox: properly integrate xdg-desktop-portal for opening media 2024-02-15 11:36:50 +00:00
d36e269edd programs: loupe: remove the dbus services to make it work with Firefox 2024-02-15 11:36:24 +00:00
40af8b95fd pkgs.rmDbusServices: also remove dbus properties from .desktop files 2024-02-15 11:35:52 +00:00
582a003739 programs: waybar: fix battery indicator within sandbox 2024-02-15 10:35:24 +00:00
df60be8c61 open-in-mpv: sandbox with bwrap 2024-02-15 09:49:03 +00:00
e8b4c36442 programs: nautilus: specify inode/directory mime association 2024-02-15 09:48:26 +00:00
2f699737f5 firefox: fix open-in-mpv integration
two parts: add open-in-mpv's config to firefox's sandbox; patch open-in-mpv to forward to xdg-open
2024-02-15 09:14:57 +00:00
4a3d24be3f waybar: migrate all config to "sane.programs" 2024-02-15 07:18:12 +00:00
10feb319fe sway: lift waybar to own file and sandbox it 2024-02-15 02:33:40 +00:00
fde1e5d872 README: add a graphic 2024-02-15 01:01:31 +00:00
b2fcf6fdfd programs: messengers (fractal, signal, dino, tuba): add media libraries to the sandbox 2024-02-15 00:49:24 +00:00
dcc2eb265d programs: re-enable sandbox for tumiki-fighters and losslesscut (X applications) 2024-02-15 00:09:40 +00:00
5f1036118f modules/programs: sandboxing: add a "whitelistX" option 2024-02-15 00:09:16 +00:00
8ac4869f10 gpodder-adaptive: fix meta.position and thereby fix NUR eval
idk why it broke. seems that attrset members (passthru.*) don't preserve their position anymore
2024-02-14 23:39:18 +00:00
226425bbef nixpkgs: 2024-02-13 -> 2024-02-14; sops-nix -> 2024-02-13
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/013603a52da98fe4abf15a5700479a58fa5899a5' (2024-02-13)
  → 'github:nixos/nixpkgs/52e165035c897a7b41ff26bc235f8d841e9d3850' (2024-02-14)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/40a7b182e0a00245d69f6b8c1dfd3ea4bfc6257c' (2024-02-13)
  → 'github:nixos/nixpkgs/c0a130d16b170f4820c3d2ed294a7aaabf451bfd' (2024-02-14)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/695275c349bb27f91b2b06cb742510899c887b81' (2024-02-12)
  → 'github:Mic92/sops-nix/48afd3264ec52bee85231a7122612e2c5202fa74' (2024-02-13)
```
2024-02-14 22:50:47 +00:00
518c3afd07 programs: sandbox: disable losslesscut/tumiki-fighters sandbox until i can figure out Xwayland 2024-02-14 14:37:59 +00:00
90dee85664 programs: sort alphabetically 2024-02-14 14:28:22 +00:00
26fc283fd9 programs: losslesscut: sandbox 2024-02-14 14:26:56 +00:00
d0430ce1e9 programs: pavucontrol/pwvucontrol: enable audio devices inside the sandbox 2024-02-14 14:26:56 +00:00
368a52b91e programs: speedtest-cli: sandbox with bwrap 2024-02-14 14:26:56 +00:00
d90dacee1f programs: grimshot: sandbox with bwrap 2024-02-14 14:17:41 +00:00
a6e2b3bc5c programs: xdg-terminal-exec: disable sandbox 2024-02-14 14:11:35 +00:00
8863a3c674 programs: wob: sandbox with bwrap 2024-02-14 14:10:20 +00:00
fa8d6dbb9f programs: wob: fix config substitution 2024-02-14 14:04:54 +00:00
e5e79a6b60 programs: FileMimeInfo: disable sandbox 2024-02-14 13:54:21 +00:00
95f7eeeb5c programs: libnotify: sandbox with bwrap 2024-02-14 13:49:48 +00:00
29d638c68b programs: dig: sandbox with bwrap 2024-02-14 13:47:44 +00:00
7d22a5466f programs: zsh: fix "switch" function to be friendly to sandboxing 2024-02-14 13:45:56 +00:00
b747742e23 flake: implement "deploy.self" app as replacement for nixos-rebuild switch 2024-02-14 13:45:15 +00:00
5907d9fa42 Revert "xdg-desktop-portal-gtk: build without support for notifications"
This reverts commit c9e02bfd8a.

disable notifications at this level did not cause fractal (gtk app) to
send its notifications to swaync. instead, it still tried to deliver to
the Portal, where the Portal wasn't expecting anything and just returned
an error to fractal.

setting `GNOTIFICATION_BACKEND = "freedesktop"` seems to be the correct
way to get gtk apps to behave as desired with their notifications.
2024-02-14 11:09:37 +00:00
67fe8d4666 swaync: propagate GNOTIFICATION_BACKEND = "freedesktop" to all users 2024-02-14 11:09:20 +00:00
22ca253ae0 modules/programs: better document the env option 2024-02-14 11:08:43 +00:00
c9e02bfd8a xdg-desktop-portal-gtk: build without support for notifications 2024-02-14 10:51:18 +00:00
03b58b3cab programs: vim: support system copy/paste inside of sandbox 2024-02-14 09:11:31 +00:00
ae01c17c05 programs: splatmoji: fix to work inside a sandbox again 2024-02-14 09:11:12 +00:00
677e6e679b programs: sandbox {s,}waylock lockscreen 2024-02-14 08:48:03 +00:00
3eb47a9a8d programs: swaylock: *partially* sandbox with capsh 2024-02-14 05:46:36 +00:00
f11e443678 programs: waylock: *partially* sandbox with capsh 2024-02-14 05:46:28 +00:00
9faf1bb52c README: document the sandboxing feature of my "programs" module 2024-02-14 05:24:48 +00:00
e599724811 README: use consistent tab width (2 spaces) 2024-02-14 05:18:43 +00:00
c0b03950dc README: format links to local files in a way that markdown will render them 2024-02-14 05:16:59 +00:00
8f8ec090c4 programs: add "waylock" 2024-02-14 05:01:33 +00:00
e174eaeff0 programs: loupe: fix sandboxing 2024-02-14 04:32:10 +00:00
8b32f2f231 modules/programs: add support for 'autodetectCliPaths = parent' 2024-02-14 04:31:59 +00:00
f12b7afa1e programs: mimeo: dont sandbox 2024-02-14 01:51:26 +00:00
080bd856ec programs: sandboxing: only permit wayland socket access to those specific apps which require it 2024-02-14 01:49:49 +00:00
548a95a7e1 modules/programs: sandboxing: unshare ipc/cgroup/uts by default 2024-02-14 01:48:59 +00:00
2d7c5b9fa5 programs: mpv: explicitly add Videos/servo, Books/servo to sandbox 2024-02-13 15:38:57 +00:00
e696cb96b6 nixpkgs: 2024-02-12 -> 2024-02-13
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/f176844192a0b4ab719dffd91fcf356fc24ccbff' (2024-02-12)
  → 'github:nixos/nixpkgs/013603a52da98fe4abf15a5700479a58fa5899a5' (2024-02-13)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/b05b56d24858cfbc2064bda18d00a242bed5ddfb' (2024-02-12)
  → 'github:nixos/nixpkgs/40a7b182e0a00245d69f6b8c1dfd3ea4bfc6257c' (2024-02-13)
```
2024-02-13 12:54:00 +00:00
83cb29aeeb xdg-utils: re-add mimetype package 2024-02-13 12:31:04 +00:00
34b148f6cc modules/programs: allow specifying perlPackages members as programs, as i do with python3Packages, etc 2024-02-13 12:31:04 +00:00
44c2f8bcc0 cross: xdg-utils: build xdg-screensaver, and simplify a bit 2024-02-13 12:31:04 +00:00
9c18aa2765 cross: fix xdg-utils 2024-02-13 12:31:04 +00:00
4458a74e4c nixpkgs: 2024-02-09 -> 2024-02-12; sops-nix -> 2024-02-12
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/b38903da74d4fa07bd7045e89bb31e6d4cc13548' (2024-02-09)
  → 'github:nixos/nixpkgs/f176844192a0b4ab719dffd91fcf356fc24ccbff' (2024-02-12)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/410b90f31644cc71ffc145261d76a351012aac66' (2024-02-09)
  → 'github:nixos/nixpkgs/b05b56d24858cfbc2064bda18d00a242bed5ddfb' (2024-02-12)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/2168851d58595431ee11ebfc3a49d60d318b7312' (2024-02-08)
  → 'github:Mic92/sops-nix/695275c349bb27f91b2b06cb742510899c887b81' (2024-02-12)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/bc6cb3d59b7aab88e967264254f8c1aa4c0284e9' (2024-02-08)
  → 'github:NixOS/nixpkgs/d8cd80616c8800feec0cab64331d7c3d5a1a6d98' (2024-02-10)
```
2024-02-13 12:31:04 +00:00
1a18ed533b programs: don't include dbus in the sandbox by default 2024-02-13 11:58:33 +00:00
18eec98cae programs: brightnessctl: switch to landlock 2024-02-13 11:58:33 +00:00
82c386a6a4 programs: tor-browser-bundle-bin -> tor-browser
they're the same (aliased), only my programs API expects 'tor-browser' specifically
2024-02-13 11:58:33 +00:00
634dc318cd programs: spotify: remove old/unused firejail config 2024-02-13 11:15:30 +00:00
6eaaeeb91a programs: remove audio from the sandbox by default 2024-02-13 11:14:38 +00:00
94be4a7551 programs: wob: fix service definition (Exec -> ExecStart) 2024-02-13 11:03:18 +00:00
b4a20da78a programs: brightnessctl: sandbox 2024-02-13 10:55:44 +00:00
bb68506839 modules/programs: add separate "user" v.s. "system" options for whitelistDbus 2024-02-13 10:55:10 +00:00
77e2af0ed9 programs: krita: enable sandbox 2024-02-13 10:36:42 +00:00
126f3e4922 programs: sandboxing: restrict /run/user dir to just dbus/pipewire/pulse/wayland, by default 2024-02-13 10:28:30 +00:00
73afceb8c6 modules/programs: sandbox: add whitelistWayland option 2024-02-13 10:24:35 +00:00
371af5939e programs: mpv: tighten the /run/user portion of the sandbox 2024-02-12 15:24:07 +00:00
27fd81ad80 modules/programs: add new options for whitelisting audio/dbus 2024-02-12 15:23:35 +00:00
d82b4b0f62 modules/programs: sane-sandboxed: reorder the --sane-sandbox-profile-dir arg so it takes precedence 2024-02-12 14:56:48 +00:00
7b28023e08 modules/programs: re-introduce the "withEmbeddedSandboxer" passthru attr 2024-02-12 14:27:48 +00:00
2b9db897a1 implement sane.defaultUser attr 2024-02-12 14:27:32 +00:00
6124cb9b36 modules/programs: sane-sandboxed: search for profiles in XDG_DATA_DIRS, not NIX_PROFILES 2024-02-12 13:16:48 +00:00
b0394d877d modules/programs: rename allowedRootPaths -> allowedPaths
now that allowedHomePaths doesn't exist
2024-02-12 13:00:10 +00:00
14d8230821 modules/programs: sane-sandboxed: remove --sane-sandbox-home-path argument and plumbing
no longer needed, and mixing this with root paths is liable to cause troubles at this point, around symlink dereferencing/canonicalization/etc
2024-02-12 12:57:54 +00:00
e94e338040 programs: handbrake: remove unneeded Pictures/servo-macros from sandbox 2024-02-12 12:54:41 +00:00
354ce378f6 programs: assorted: convert /mnt/servo "extraPaths" into "extraHomePaths" where possible 2024-02-12 12:54:16 +00:00
a90b5b53db modules/programs: sandboxing: dereference symlinks and also include those in the sandbox 2024-02-12 12:48:02 +00:00
eee3e138ff modules/programs: sandboxing: allow specifying individual /run/user/$uid paths to expose to the sandbox 2024-02-12 12:18:59 +00:00
f61cd17e99 modules/programs: sandboxing: specialize profiles per-user by expanding $HOME 2024-02-12 12:08:58 +00:00
3e0b0a0f02 modules/programs: make-sandboxed: lift profile creation logic out to the toplevel 2024-02-12 11:52:33 +00:00
2ee34e9af3 modules/profiles: remove sandbox.embedProfile option
with upcoming refactors, this setting would force a different package to be installed per user, which doesn't mesh with the existing sane.programs infra
2024-02-12 11:35:59 +00:00
f9a998eb92 programs: koreader: remove "sandbox.embedProfile = true"
i guess this was set while i was debugging
2024-02-12 11:33:55 +00:00
7c05d221d6 modules/programs: split "make-sandbox-profile" out of "make-sandboxed" 2024-02-12 11:20:40 +00:00
93012664e5 modules/programs: simplify how sandbox profiles make it into system packages 2024-02-12 10:52:44 +00:00
c424f7ac3b sane-sandboxed: load all profiles, not just the first one we find
this allows some amount of overriding, or splitting profiles between system and user dirs
2024-02-12 10:40:15 +00:00
088b6f1b9a sane-sandboxed: load profiles via $NIX_PROFILES env var 2024-02-12 10:37:26 +00:00
96575acf3a programs: sane-sandboxed: move parseArgsExtra to outer scope; improve docs 2024-02-12 10:28:14 +00:00
1e05119adc mpv: fix loading of album art within sandbox 2024-02-12 08:59:46 +00:00
e81df0ac86 modules/programs: enforce that user services don't accidentally override PATH 2024-02-12 08:44:55 +00:00
b19492ba23 programs: mpv: add .config/mpv to sandbox paths 2024-02-12 08:26:51 +00:00
8b26fa1303 programs: wob: split the script into an actual package 2024-02-12 08:26:51 +00:00
c0883dc777 sway: refactor: store sway-portals.conf in the user dir instead of system-wide
it's a user service, so prefer to configure it via user/home conf dirs
2024-02-12 07:13:39 +00:00
6b3a71aadf programs: xdg-desktop-portal: dont show app chooser for apps which are the default association 2024-02-12 07:12:04 +00:00
8d0d20757e gui: fold xdg-desktop-portal.nix back into sway config 2024-02-12 01:38:05 +00:00
66ca822ac1 remove xdg-desktop-portal-gtk service; xdg-desktop-portal knows how to start that itself 2024-02-12 01:33:34 +00:00
db7a414030 xdg-desktop-portal(s): dont install globally 2024-02-12 01:16:17 +00:00
87050a0500 feeds: add "FullTimeNix" podcast :) 2024-02-12 00:09:49 +00:00
bf53e3628a xdg-utils: cleanup 2024-02-11 23:57:50 +00:00
d35f938806 mime.nix: fix cross build 2024-02-11 23:44:55 +00:00
d719eb0f11 programs: gPodder: enable Videos/gPodder in sandbox 2024-02-11 23:37:16 +00:00
0861edd7f9 modules/programs: remove ~/.config/mimeo from sandbox defaults 2024-02-11 23:35:27 +00:00
b6bf8720c9 modules/programs: implement --sane-sandbox-portal flag for apps which want to use the portal to open other apps 2024-02-11 23:32:24 +00:00
0fbc10fce3 mime: store mime associations in ~/.local/share/applications instead of /run/current-system/sw/share/applications to facilitate sandboxing 2024-02-11 23:31:43 +00:00
772f1070e7 xdg-desktop-portal: configure myself, to unblock future portal-related work 2024-02-11 23:29:07 +00:00
50c6e406bc programs: disable zecwallet-lite 2024-02-09 20:23:56 +00:00
41020b2c0d nixpkgs: 2024-02-08 -> 2024-02-09
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/74098fff8838394e2cdf78012bbc7f5bf835197e' (2024-02-08)
  → 'github:nixos/nixpkgs/b38903da74d4fa07bd7045e89bb31e6d4cc13548' (2024-02-09)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/075bf9cffe5b04d39874747239022de9aec5cdcd' (2024-02-08)
  → 'github:nixos/nixpkgs/410b90f31644cc71ffc145261d76a351012aac66' (2024-02-09)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/23f61b897c00b66855074db471ba016e0cda20dd' (2024-02-04)
  → 'github:Mic92/sops-nix/2168851d58595431ee11ebfc3a49d60d318b7312' (2024-02-08)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/9a333eaa80901efe01df07eade2c16d183761fa3' (2024-01-22)
  → 'github:NixOS/nixpkgs/bc6cb3d59b7aab88e967264254f8c1aa4c0284e9' (2024-02-08)
```
2024-02-09 10:39:27 +00:00
590a239f7d programs: gpodder: sandbox with bwrap
which we can do, now that xdg-open works correctly within sandboxes
2024-02-09 10:31:42 +00:00
bcbc57f5ef programs: get xdg-open to work from within sandboxes
note that implementation may have a quirk that applications launched via the portal cannot themselves "xdg-open" through the portal, because of the environment variable manipulation.

not sure how best to address that.
2024-02-09 10:27:30 +00:00
0d3adcdc5c modules: users: have user services inherit PATH from environment rather than forcibly overwriting it 2024-02-09 09:50:26 +00:00
d19907a38d sway: enable OpenURI interface in xdg-desktop-portal 2024-02-09 05:57:02 +00:00
9ac0e0e4fc modules/programs: put things in a pid namespace by default 2024-02-08 23:36:59 +00:00
c9af5bf9b4 programs: sandboxing: enable net isolation for most sandboxed programs 2024-02-08 21:51:32 +00:00
bc85169e3d programs: sandboxer: allow disable net access 2024-02-08 21:07:34 +00:00
7b9b3344a0 nixpkgs: 2024-02-07 -> 2024-02-08
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/966fd30804ad0e400fa3502e9f848bfad63b1852' (2024-02-07)
  → 'github:nixos/nixpkgs/74098fff8838394e2cdf78012bbc7f5bf835197e' (2024-02-08)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/be4596f17b30403478c629b27d87fd914a2b9f8a' (2024-02-07)
  → 'github:nixos/nixpkgs/075bf9cffe5b04d39874747239022de9aec5cdcd' (2024-02-08)
```
2024-02-08 11:09:25 +00:00
f6ca6210f9 feeds: link to podcastindex.org 2024-02-07 21:47:19 +00:00
19cfc86d1a nixpkgs: 2024-02-06 -> 2024-02-07
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/952bd699447d82d69f4b15d994d5dc232e7addfb' (2024-02-06)
  → 'github:nixos/nixpkgs/966fd30804ad0e400fa3502e9f848bfad63b1852' (2024-02-07)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/8ad5408ea36be34ae262b04c8e913a95f8248fc7' (2024-02-06)
  → 'github:nixos/nixpkgs/be4596f17b30403478c629b27d87fd914a2b9f8a' (2024-02-07)
```
2024-02-07 09:45:02 +00:00
227d159c66 sway: map Super+Shift+PageUp/Down to next/prev track 2024-02-06 23:52:53 +00:00
a6becb8c42 sway: add Super+space to toggle media 2024-02-06 23:22:24 +00:00
2a5398beb3 sway: simplify brightness_up_cmd
sxmo just uses brightnessctl internally, plus a call to 'notify'

i don't really need the notification, and if i did i could implement wob support on both desktop and mobile
2024-02-06 23:10:01 +00:00
0f12ed68f7 sway: simplify config templating 2024-02-06 23:04:44 +00:00
0c050d1953 programs: fuzzel: fix overly-aggressive sandboxing 2024-02-06 20:10:29 +00:00
2fc1fe7510 modules/programs: make-sandboxed: fix that /share/* was being linked into top-level /; better way to enforce sandboxing of /share entries 2024-02-06 19:55:55 +00:00
8d705af7a0 nixpkgs: 2024-02-04 -> 2024-02-06
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/259981b0af5c285bb3cc7146de1da1b5af92236d' (2024-02-04)
  → 'github:nixos/nixpkgs/952bd699447d82d69f4b15d994d5dc232e7addfb' (2024-02-06)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/2be0b5db83fbea4a838f753994e8ebd35af91968' (2024-02-04)
  → 'github:nixos/nixpkgs/8ad5408ea36be34ae262b04c8e913a95f8248fc7' (2024-02-06)
```
2024-02-06 06:18:59 +00:00
e91ec2c35e todo.md: task to consolidate ~/dev and ~/ref 2024-02-06 06:08:06 +00:00
5fbf66fb15 programs: loupe: sandbox with bwrap 2024-02-06 06:05:32 +00:00
97d50629e9 programs: handbrake: sandbox with landlock 2024-02-06 05:48:54 +00:00
5f8699fcef rearrange /mnt structure for host-based subdirs
e.g. /mnt/servo/media, /mnt/desko/home, etc
2024-02-06 05:48:11 +00:00
7ce957c3af gtk: set GSK_RENDERER=cairo to fix a bug somewhere in moby's render stack 2024-02-06 05:02:02 +00:00
d7612d5034 modules/programs: make-sandboxed: avoid deep-copying all of /share when sandboxing
saves like 1 GiB of closure. but i haven't thoroughly tested this
2024-02-06 05:02:02 +00:00
5ff7bf0c69 programs: fuzzel: sandbox 2024-02-06 02:34:46 +00:00
2495200b67 tidy: programs: wget: remove warning about the sandbox being untested 2024-02-06 01:34:40 +00:00
4c499629f5 programs: vvvvvv: sandbox with bwrap 2024-02-06 01:34:04 +00:00
7b9f54dd54 programs: superTux: sandbox with bwrap 2024-02-06 01:16:36 +00:00
bda932c3df programs: supertuxkart: sandbox with bwrap 2024-02-06 01:10:39 +00:00
3f96f4af82 sway: refer to fewer programs in the config by absolute path
this aids in sandboxing and swapping stuff in/out at runtime
2024-02-05 23:40:18 +00:00
1c4e2f97fe swaylock: mark sandboxing as unsupported 2024-02-05 23:36:35 +00:00
594a729968 feeds: remove balaji 2024-02-05 22:48:09 +00:00
5c8bb55cec todo.md: better sandboxing around /mnt/servo-media 2024-02-05 22:33:42 +00:00
6eb2a3d67f programs: handbrake: sandbox with bwrap 2024-02-05 22:28:15 +00:00
ddc41bc9d8 programs: pavucontrol/pwvucontrol: sandbox with bwrap 2024-02-05 22:15:48 +00:00
7d833ebf76 programs: kdenlive: sandbox with bwrap 2024-02-05 22:07:37 +00:00
bfc0eadfaa programs: hitori: sandbox with bwrap 2024-02-05 21:52:57 +00:00
ff1cbcc16b programs: gnome-clocks,gnome-calendar: sandbox with bwrap 2024-02-05 21:46:27 +00:00
fd81e35c31 todo.md: package blurble game! 2024-02-05 21:46:09 +00:00
9a8d8a20bd programs: frozen-bubble: persist data and sandbox with bwrap 2024-02-05 21:32:58 +00:00
cd1d22e7b9 programs: gnome-calculator: sandbox with bwrap 2024-02-05 20:58:38 +00:00
2c0e93826d programs: gimp: sandbox with bwrap 2024-02-05 20:53:05 +00:00
cab346f3ad programs: delfin: sandbox with bwrap 2024-02-05 20:44:47 +00:00
568a72f6a4 gpodder-configured: remove unused derivation inputs 2024-02-05 20:22:27 +00:00
a2decaff9c programs: bemenu: sandbox with landlock 2024-02-05 18:41:52 +00:00
23411ed973 todo.md: make dconf stuff less monolithic 2024-02-05 18:33:03 +00:00
8ef9f7a485 epiphany: persist dconf settings; reduce sandboxer errors 2024-02-05 18:31:38 +00:00
12846732b9 programs: blanket: sandbox with bwrap 2024-02-05 18:26:21 +00:00
e84079e84c programs: firefox: allow sandbox access to ~/dev 2024-02-05 18:17:49 +00:00
45ffd9246d programs: brave: sandbox with bwrap 2024-02-05 18:17:28 +00:00
ed3935318d feeds: subscribe to non-paywalled Matt Levine 2024-02-05 16:41:38 +00:00
8052f62796 programs: sane-wipe browser: also clear epiphany artifacts 2024-02-05 16:31:19 +00:00
413903d03c make-sandboxed: also embed profiles for the withEmbeddedSandboxer passthru pkg 2024-02-05 08:26:40 +00:00
6d1eae2200 programs: gnome-2048: sandbox with bwrap 2024-02-05 08:26:06 +00:00
4d51c34ad2 programs: allow sane.strictSandboxing = "warn" 2024-02-05 05:28:02 +00:00
bc50a8c489 nixpkgs: 2024-02-03 -> 2024-02-04; sops-nix -> 2024-02-04
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/94db8d8c016a54feeaaf2643e2ce42bf4cc29286' (2024-02-03)
  → 'github:nixos/nixpkgs/259981b0af5c285bb3cc7146de1da1b5af92236d' (2024-02-04)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/79a13f1437e149dc7be2d1290c74d378dad60814' (2024-02-03)
  → 'github:nixos/nixpkgs/2be0b5db83fbea4a838f753994e8ebd35af91968' (2024-02-04)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/73bf36912e31a6b21af6e0f39218e067283c67ef' (2024-01-28)
  → 'github:Mic92/sops-nix/23f61b897c00b66855074db471ba016e0cda20dd' (2024-02-04)
```
2024-02-04 22:55:03 +00:00
ee8e33b795 koreader: remove dead patching code
it still builds (in 3:00 minutes), huh
2024-02-04 22:08:12 +00:00
8afb6406a1 koreader: remove dead code/build inputs 2024-02-04 22:02:03 +00:00
7ac1ee66ad koreader: use nixpkgs' luasocket and luasec 2024-02-04 21:30:30 +00:00
8a47eb92ed koreader: use nixpkgs' lua-rapidjson 2024-02-04 21:30:30 +00:00
b87934d5f8 koreader: use nixpkgs lpeg and remove vendor-external-projects.patch 2024-02-04 20:37:10 +00:00
293eab8225 koreader: use modern openssl 2024-02-04 20:05:02 +00:00
abdbb83e10 koreader: replace vendored dependencies with their nixpkgs equivalents much more effectively
the old method was still causing everything to be re-compiled within koreader, rather than linking against the nix store.

decreases build time to about 3m on a desktop
2024-02-04 19:39:32 +00:00
4a96fa233a koreader: 2023.10 -> 2024.01 2024-02-04 02:51:27 +00:00
4bd73ddca3 koreader-from-src: build even more from source 2024-02-03 23:58:41 +00:00
dc74bca06a programs: vim: add private/knowledge to sandbox 2024-02-03 23:53:53 +00:00
42523b75a8 programs: gdb: disable sandboxing 2024-02-03 23:53:34 +00:00
79736a4a0a koreader-from-src: tidy 2024-02-03 16:30:03 +00:00
111946eb1d programs: vim, imagemagick: fix sandboxing to consider uncreated files 2024-02-03 14:07:53 +00:00
09f3bfc944 flake: make "nix run .#deploy" deploy to all hosts 2024-02-03 02:55:13 +00:00
b8fc75ebd6 nixpkgs: 2024-02-02 -> 2024-02-03
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/1bfd22b6448ac4d407510bd37fe16d87a9dcb41b' (2024-02-02)
  → 'github:nixos/nixpkgs/94db8d8c016a54feeaaf2643e2ce42bf4cc29286' (2024-02-03)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/eef63ea04722d812a09a5974ed18c9761088a6e1' (2024-02-02)
  → 'github:nixos/nixpkgs/79a13f1437e149dc7be2d1290c74d378dad60814' (2024-02-03)
```
2024-02-03 02:15:09 +00:00
8de015f098 flake: preDeploy: fix host/addr mixup 2024-02-03 02:15:05 +00:00
6da85f6d8f flake: add a preDeploy target 2024-02-03 02:04:41 +00:00
2dc6da476b flake: deploy app: remove the last call to nixos-rebuild 2024-02-03 01:42:54 +00:00
453f40d0a8 flake: sync photos from moby with "nix run .#sync.moby" 2024-02-03 00:54:04 +00:00
14b20fd9c2 programs: komikku: fix sandboxing 2024-02-03 00:52:17 +00:00
2df1b20f02 programs: epiphany: simplify the sandboxing 2024-02-03 00:44:23 +00:00
56e7e9a7cc remove unused "default.nix.cmp" file
should have never been checked in
2024-02-03 00:18:33 +00:00
2f9fad503c programs: fix sandboxing errors for programs which create files (notably: ffmpeg) 2024-02-03 00:17:54 +00:00
3439ca34b8 sane-sandboxed: add more autodetect options, and a "withEmbeddedSandboxer" package output (for dev) 2024-02-03 00:17:24 +00:00
24e6e6cacc firefox-extensions.sidebery: downgrade 5.1.1 -> 5.0.0
release format is inconsistent; would need to build from-source to reliably use the latest version(s)
2024-02-02 23:26:14 +00:00
0ee9f2026c sane-sandboxed: hopefully fix a problem with path normalization for paths with spaces 2024-02-02 22:56:43 +00:00
5e3c2636db programs: make-sandboxed: handle packages which use relative links in bin (like spotify) 2024-02-02 22:38:36 +00:00
cd0a046776 dovecot: remove dead code 2024-02-02 20:47:55 +00:00
27edee0bbf dovecot2: fix sieves 2024-02-02 20:47:20 +00:00
56734fe5da mpv: add /dev/dri to the sandbox 2024-02-02 19:18:30 +00:00
832a572d56 firefox-extensions: bump to latest 2024-02-02 19:17:04 +00:00
3c96f6d418 programs: koreader: enable DRI in the sandbox, and use wrappedDerivation 2024-02-02 17:22:57 +00:00
86b23e8183 programs: fractal: enable DRI in sandbox 2024-02-02 17:19:35 +00:00
2bb9115f35 modules/programs: sandboxing: add "whitelistDri" option for gfx-intensive apps 2024-02-02 17:18:51 +00:00
065d045640 fix so sway inherits program env vars 2024-02-02 15:36:06 +00:00
d3eaa69261 lappy/desko: auto-start signal-desktop 2024-02-02 14:22:08 +00:00
6151eee8d5 programs (assorted): fix wantedBy = "default.target" to be more specific
now GUI apps aren't stuck in a restart loop until sway starts

in particular, signal-desktop can actually be autostarted
2024-02-02 14:21:57 +00:00
483a1d1780 sway: signal on launch to systemd that the graphical-session.target is ready
this allows auto-launching of other services which require a compositor (i.e. messaging apps)
2024-02-02 14:20:30 +00:00
567c7993b6 modules/programs: sandbox: allow mimeo config in any sandbox 2024-02-02 12:52:36 +00:00
f6eeab5650 nixpkgs: 2024-02-01 -> 2024-02-02
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/06002f375e1d20f1481abcb696a50f232202e7ac' (2024-02-01)
  → 'github:nixos/nixpkgs/1bfd22b6448ac4d407510bd37fe16d87a9dcb41b' (2024-02-02)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/fbba9b8f0b6364928f60ef1b97e686b569cdb64e' (2024-02-01)
  → 'github:nixos/nixpkgs/eef63ea04722d812a09a5974ed18c9761088a6e1' (2024-02-02)
```
2024-02-02 01:07:32 +00:00
2824671bde tune nix deploy parameters (specifically for moby)
this is experimental; hard to understand immediately how significant are the effects
2024-02-02 00:50:25 +00:00
efcaef2c35 lappy/desko/servo: downgrade kernel 6.7 -> 6.6 (latest supported by zfs) 2024-02-01 16:21:46 +00:00
25707eb79e servo: address deprecation warning: dovecot2.sieveScripts -> sieve.scripts 2024-02-01 15:47:56 +00:00
18679cd8c3 fix deprecation warnings: overrideScope' -> overrideScope 2024-02-01 15:44:46 +00:00
09923b60ea moby: disable desko as nixcache 2024-02-01 15:41:43 +00:00
3100189172 purge supercap
i no longer have access to dispatch build jobs to it :((((
2024-02-01 15:36:37 +00:00
715ac42f13 remove samba from closure
current samba hangs during configurePhase. this is not the first time samba has failed to build. nor the third. purge it.
2024-02-01 15:28:40 +00:00
a9810e7343 re-ship linux 6.7 to lappy/desko/servo
now that landlock-sandboxer builds against the correct linux headers,
this can actually work.
2024-02-01 13:54:44 +00:00
4f352c5725 landlock-sandboxer: build against headers which match the sandboxer source 2024-02-01 13:53:39 +00:00
17f35a3619 linux-megous: 6.6.0 -> 6.7.2 2024-02-01 12:51:53 +00:00
89d4f3eec3 nixpkgs: 2024-01-29 -> 2024-02-01
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/aa476d3e0de89aeb67950a1bc76b4fd576c24505' (2024-01-29)
  → 'github:nixos/nixpkgs/06002f375e1d20f1481abcb696a50f232202e7ac' (2024-02-01)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/a31b9bd76009c73a2f932fbdaa7145ac4a79544f' (2024-01-29)
  → 'github:nixos/nixpkgs/fbba9b8f0b6364928f60ef1b97e686b569cdb64e' (2024-02-01)
```
2024-02-01 11:32:36 +00:00
44419d71a5 lemmy-lemonade: init at 2023.10.29 2024-02-01 11:32:07 +00:00
02e597a862 fractal-nixified: 5 -> 6 2024-02-01 10:57:01 +00:00
00f995aec9 fixup landlock-sandboxer to work well for all systems
downgrade lappy/desko/servo back to default linux; zfs doesn't support latest

build landlock-sandboxer against the specific kernel being deployed; it's less noisy that way
2024-01-31 21:19:10 +00:00
368eb2c29b programs: git: whitelist more repo roots 2024-01-31 21:17:48 +00:00
5f793523d1 ship linux 6.7 to lappy/desko/servo 2024-01-31 20:33:15 +00:00
33bee7ac2e unl0kr: be a little more robust against bad password entry 2024-01-31 20:32:26 +00:00
84af8aca3c unl0kr: remove debugging code 2024-01-31 20:10:57 +00:00
a0f00313a7 moby: disable signal-desktop autostart 2024-01-31 20:09:03 +00:00
6603115192 moby: disable getty auto-login
i think this interacts badly with unl0kr style logins, though
honestly kinda hard to tell if that was a fluke or real.
2024-01-31 19:47:24 +00:00
ac968e1589 sxmo: allow the option to disable greeter entirely 2024-01-31 19:46:37 +00:00
2d4fc4f274 landlock-sandboxer: build against latest compatible linux 2024-01-31 17:45:46 +00:00
1d72e13a98 sxmo: launch via unl0kr by default 2024-01-31 17:40:36 +00:00
d9667653e7 docs: sway: point out that one can launch sway directly from a TTY 2024-01-31 16:29:27 +00:00
8c6bf07102 todo.md: sync 2024-01-31 16:28:56 +00:00
634520a1e9 unl0kr: fix cross compilation 2024-01-31 16:23:55 +00:00
13be5a1731 unl0kr: fix LOGIN_TIMEOUT to be infinite 2024-01-31 15:43:30 +00:00
30288cd67f user: add CAP_NET_ADMIN,CAP_NET_RAW even outside of systemd session
in fact, *only* outside of systemd session because they broke ambient caps in 255
2024-01-31 15:42:43 +00:00
87e2509af4 doc: cozy: mention that upstream has merged the patch i apply 2024-01-31 15:36:54 +00:00
8736ca478b programs: firefox: allow access to servo image-macros 2024-01-31 15:36:09 +00:00
cb3960fb21 programs: git: fix access to ~/private/knowledge 2024-01-31 15:35:21 +00:00
6e24a1ff28 programs: re-enable sops 2024-01-31 15:30:15 +00:00
91eae95b32 modules.gui.gnome: fix build 2024-01-31 15:29:49 +00:00
f5c88853ee sway: replace "greetd" with "unl0kr"-based login process 2024-01-31 15:20:27 +00:00
0009e5ca4c programs: sandboxing: use wrapperType="wrappedDerivation" where applicable 2024-01-29 15:21:16 +00:00
0403d5c03e nixpkgs: 2024-01-28 -> 2024-01-29
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/a86d1125195505d4ea8997b12507b9c623511256' (2024-01-28)
  → 'github:nixos/nixpkgs/aa476d3e0de89aeb67950a1bc76b4fd576c24505' (2024-01-29)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/f58fe0f36dbbef39b3f5ec8542a02dece7c9559b' (2024-01-28)
  → 'github:nixos/nixpkgs/a31b9bd76009c73a2f932fbdaa7145ac4a79544f' (2024-01-29)
```
2024-01-29 13:49:54 +00:00
db6ba61429 programs: sandbox more apps with wrapperType=wrappedDerivation 2024-01-29 13:45:57 +00:00
881d2f79ed modules/programs: add "unchecked" passthru to aid debugging 2024-01-29 13:36:01 +00:00
47abdfb831 modules/programs: patch dbus-1 files to use sandboxed binaries 2024-01-29 13:09:43 +00:00
3831c6f087 TODO: fold 2024-01-29 13:07:44 +00:00
d3f7a036ce ripgrep: move options out of assorted.nix into its own file 2024-01-29 12:57:56 +00:00
0454abacd9 komikku: sandbox 2024-01-29 12:56:08 +00:00
4f8d476ebf modules/programs: patch old /nix/store paths in .desktop files 2024-01-29 12:56:08 +00:00
1cb2c5225f programs: use wrapperType=wrappedDerivation where possible 2024-01-29 12:07:04 +00:00
7af970f38c modules/programs: extend wrapperType="wrappedDerivation" to handle common share/ items 2024-01-29 11:59:38 +00:00
6f86e61a00 firefox: fix build
zip was giving some complaints... i'm not sure why, i think it still works
2024-01-29 09:57:35 +00:00
3ea3776281 nixpkgs: 2024-01-27 -> 2024-01-28
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/ef4dd61b7d53af44b060473308c50fa3b34d5681' (2024-01-27)
  → 'github:nixos/nixpkgs/a86d1125195505d4ea8997b12507b9c623511256' (2024-01-28)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/c002c6aa977ad22c60398daaa9be52f2203d0006' (2024-01-27)
  → 'github:nixos/nixpkgs/f58fe0f36dbbef39b3f5ec8542a02dece7c9559b' (2024-01-28)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/4606d9b1595e42ffd9b75b9e69667708c70b1d68' (2024-01-24)
  → 'github:Mic92/sops-nix/73bf36912e31a6b21af6e0f39218e067283c67ef' (2024-01-28)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/a1982c92d8980a0114372973cbdfe0a307f1bdea' (2024-01-12)
  → 'github:NixOS/nixpkgs/9a333eaa80901efe01df07eade2c16d183761fa3' (2024-01-22)
```
2024-01-29 09:57:35 +00:00
a7eb8dd6fa nixpkgs: 2024-01-22 -> 2024-01-27
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/dceddd03df4f840ea28c65887c199495793fb322' (2024-01-22)
  → 'github:nixos/nixpkgs/ef4dd61b7d53af44b060473308c50fa3b34d5681' (2024-01-27)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/8cccce637e19577815de54c5ecc3132dff965aee' (2024-01-22)
  → 'github:nixos/nixpkgs/c002c6aa977ad22c60398daaa9be52f2203d0006' (2024-01-27)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/ae171b54e76ced88d506245249609f8c87305752' (2024-01-21)
  → 'github:Mic92/sops-nix/4606d9b1595e42ffd9b75b9e69667708c70b1d68' (2024-01-24)
```

this breaks sway login for lappy. not obvious why.
2024-01-29 09:57:35 +00:00
c1a1f51ca2 git: fix git-upload-pack (used on the remote when doing git pull) 2024-01-29 09:57:27 +00:00
32824cfade modules/programs: sandbox in a manner that's more compatible with link-heavy apps like busybox, git, etc 2024-01-29 09:56:30 +00:00
51fc61b211 sane-sandboxed: cleanup 2024-01-29 09:14:43 +00:00
7b9795ea3d modules/programs: implement embedWrapper option 2024-01-29 09:13:49 +00:00
5f3e481fe4 sane-sandboxed: refactor and avoid passing duplicate/subpaths into the sandbox 2024-01-29 07:15:02 +00:00
86219d7006 sane-sandboxed: simplify: consolidate homePaths and rootPaths into just "paths" 2024-01-29 05:43:10 +00:00
381da74e6c users: enable pam_cap for "login" program 2024-01-28 17:55:19 +00:00
24c70c3683 feeds: switch acoup.blog to the database type feed
at some point my feed script became capable of understanding his RSS :)
2024-01-28 12:37:38 +00:00
bfec531fa2 sandbox a bunch more apps 2024-01-28 11:43:05 +00:00
de11edffa5 programs/assorted: remove more unused programs 2024-01-28 11:34:33 +00:00
294f167df0 sane-sandboxed: fix CLI escaping with capsh 2024-01-28 11:11:07 +00:00
e536e3c718 programs/assorted.nix: remove unused tree-sitter package 2024-01-28 11:03:09 +00:00
17d14dbac2 programs/assorted.nix: uninstall some programs i don't frequently use 2024-01-28 10:40:57 +00:00
94981ef335 vim: sandbox 2024-01-28 10:39:08 +00:00
3cd244be76 git: sandbox with bwrap 2024-01-28 10:36:19 +00:00
f100595257 modules/programs: properly forward autodetectCliPaths to the sandboxer 2024-01-28 10:31:07 +00:00
e84da827c2 sane-sandboxed: fix typo in add-pwd flag 2024-01-28 09:17:12 +00:00
42f9fa029d modules/programs: fix that whitelistPwd wasnt passed into the sandbox profile 2024-01-28 09:04:27 +00:00
40fee97b06 modules/programs: make-sandboxed: disallowReferences to the fake sane-sandboxed used during checkPhase 2024-01-28 08:58:13 +00:00
3cc8292d8b modules/programs: make-sandboxed: support packages with checkPhase by bypassing the sandbox 2024-01-28 07:45:08 +00:00
9261d30a34 modules/programs: reformatting 2024-01-28 05:58:08 +00:00
3eb3a8db5a modules/programs: add a whitelistPwd option to grant the program access to the directory it was called from 2024-01-28 05:57:30 +00:00
97129268f0 modules/programs: sandbox: add "capshonly" as a valid sandbox.method 2024-01-28 05:57:11 +00:00
fa39a965ca TODO: investigate sane.programs as a contributor to nixos-rebuild times 2024-01-28 05:55:32 +00:00
7da979503b bubblewrap: explicitly disable sandboxing 2024-01-27 17:20:40 +00:00
3b32c26026 zsh: explicitly disable sandboxing 2024-01-27 17:20:24 +00:00
cad25306e7 alacritty: explicitly disable sandbox 2024-01-27 17:20:11 +00:00
4d7414c941 programs: introduce and use "autodetectCliPaths" nix config 2024-01-27 17:19:48 +00:00
b29b8bdec7 wireshark: specify capabilities via sandbox.capabilities config 2024-01-27 17:12:40 +00:00
a7d081bfcb modules/programs: add a sane.strictSandboxing option 2024-01-27 17:11:07 +00:00
5ca208d07f modules/programs: sandbox: add enable flag and capabilities structured config 2024-01-27 17:08:27 +00:00
6c605944c5 pkgs: firefox-extensions: update to latest 2024-01-27 15:50:47 +00:00
02b6e17449 nicotine-plus: disable
now i have no firejail programs; no more setuid wrapper in /run/wrappers :)
2024-01-27 15:37:43 +00:00
770db96ec6 go2tv: sandbox with bwrap 2024-01-27 15:31:08 +00:00
ff356fdd49 playerctl: sandbox with bwrap 2024-01-27 15:18:56 +00:00
eec89e2cc1 librewolf: sandbox with bwrap 2024-01-27 15:16:53 +00:00
d69d8f64f3 tor-browser: sandbox with bwrap; remove useHardenedMalloc patch 2024-01-27 15:04:22 +00:00
4ee2562202 programs: tidy: prefer "sandbox.extraHomePaths" over "fs" for external deps 2024-01-27 14:54:17 +00:00
08b1ece56e programs: gnome-weather: sandbox with bwrap 2024-01-27 14:53:38 +00:00
26b978dcf2 modules/programs: sandbox: fix "inline" -> "inplace" typo 2024-01-27 14:42:25 +00:00
b22c2e094c koreader: sandbox with bwrap 2024-01-27 14:39:22 +00:00
b40775f97c koreader-from-src: document FTP configuration 2024-01-27 14:39:02 +00:00
a27a72646c koreader-from-src: fix non-cross build 2024-01-27 14:38:52 +00:00
100ddad40e wike: link to issue about state directory 2024-01-27 14:27:02 +00:00
d8b6d419b6 modules/programs: sandboxing: add wrapperType = "wrappedDerivation" to wrap without rebuilding the whole package 2024-01-27 14:26:41 +00:00
1bde38bf72 cozy: sandbox with bwrap 2024-01-27 13:11:22 +00:00
a06c81643c sane-sandboxed: don't error if ~ files aren't available to be bound 2024-01-27 12:48:58 +00:00
15fd7bf4a5 sane-sandboxed: implement a "capshonly" backend 2024-01-27 12:39:36 +00:00
0a25ef544f wike: sandbox with bwrap 2024-01-27 12:29:58 +00:00
a6b824d3c4 modules/programs/sandbox: add an "embedProfile" option to source sandbox settings from the package instead of the system 2024-01-27 12:23:25 +00:00
79ee47bada firefox: get away with linking slightly less into the sandbox 2024-01-27 11:41:18 +00:00
be06e61bfb programs: geary: fix sandboxing
this is an UGLY one. geary itself uses bwrap, and that fails if it's sandboxed AT ALL in landlock (i.e. even with just / landlocked as RW).

maybe this has to do with what landlock-sandboxer considers 'read/write' to be, and there's actually more file ops i need to enable on /
2024-01-27 11:28:08 +00:00
3b4884fcf1 sane-sandbox: fix secret binding 2024-01-27 11:26:10 +00:00
4319dc58eb programs: landlock: restrict the capabilities of sandboxed processes 2024-01-27 09:49:51 +00:00
3122434908 programs: add an option to configure extra home paths to make accessible in the sandbox 2024-01-27 09:11:32 +00:00
dae7785ee2 wireshark: remove dead code 2024-01-27 09:04:08 +00:00
d54f8b1e93 programs: fix so environment variables make it onto user sessions 2024-01-27 09:02:55 +00:00
27f3b2bd76 firefox: allow ~/tmp and ~/Pictures access 2024-01-27 06:00:46 +00:00
b417f60769 sane-sandboxed: try binding /proc/self in landlock. still doesnt work well 2024-01-27 05:59:40 +00:00
df2d5b6d01 sane-sandboxed: fixup /dev/std* for wireshark 2024-01-27 05:12:43 +00:00
3e6278fa21 wireshark: sandbox with landlock instead of firejail
and remove the SUID wrapper, yay!
2024-01-27 04:44:21 +00:00
a66b257644 sane-sandboxed: better support for landlock and SANE_SANDBOX_PREPEND/APPEND 2024-01-27 04:43:42 +00:00
ef66d2ec72 sane-sandboxed: add support for landlock backend 2024-01-27 03:39:26 +00:00
e21dbd507d landlock-sandboxer: init 2024-01-26 16:52:33 +00:00
64878bee67 sane-sandboxed: add SANE_SANDBOX_PREPEND, SANE_SANDBOX_APPEND env vars 2024-01-26 09:14:18 +00:00
557a080ffc TODO.md: try landlocked for sandboxing, instead of bubblewrap 2024-01-26 09:13:46 +00:00
8ecb17ed3e programs: enable libcap_ng/netcap 2024-01-26 09:13:20 +00:00
c4874c85b1 bubblewrap: debugging 2024-01-26 09:13:00 +00:00
563a75e9b2 users: launch entire systemd --user namespace with cap_net_admin, cap_net_raw
this should make sandboxing wireshark *much* easier, and same with things which require net namespaces, in the future
2024-01-25 15:05:35 +00:00
7f002b8718 programs: sane-sandboxed: implement --sane-sandbox-cap for capabilities setting 2024-01-24 06:34:11 +00:00
79e2bd2913 epiphany: sandbox with bwrap
this is the first app which *requires* DRI/DRM to function correctly. maybe this effects anything webkitgtk (like wike)?
2024-01-24 06:25:20 +00:00
95161b55cd spot: sandbox with bwrap 2024-01-24 05:47:04 +00:00
d91759068c element-desktop: sandbox with bwrap 2024-01-24 05:37:46 +00:00
c23c496066 programs: tuba: sandbox with bwrap
it complains "Fontconfig error: No writable cache directories"
seeeeeveral times. not sure if that's new or not. no obvious
consequences.
2024-01-24 05:34:10 +00:00
824630f7d1 programs: sandboxing: document /dev/dri a bit more 2024-01-24 05:28:27 +00:00
f8e8d23857 vlc: sandbox with bwrap instead of firejail 2024-01-24 05:19:20 +00:00
8484bb7978 docs: mime: document how to show the nix mime associations 2024-01-24 05:00:35 +00:00
57105c6861 sane-sandboxed: autodetect: handle file:/// URIs 2024-01-24 05:00:08 +00:00
3758044e7b sane-sandboxed: better handle "--" 2024-01-24 04:59:24 +00:00
bfaf098c31 sane-sandboxed: fix handling of -- (which previously smushed arguments) 2024-01-24 02:52:01 +00:00
0e99b296bc animatch: remove the (unused) .config directory 2024-01-24 02:18:58 +00:00
089f86d5e4 programs: make /usr/bin/env available in the sandbox
enables KOReader to run
2024-01-24 01:48:02 +00:00
d0e1241bd1 animatch: fix to run on wayland w/o Xwayland, and enable bwrap sandbox 2024-01-24 01:43:33 +00:00
c1a0a08b76 gtkcord4: sandbox with bwrap 2024-01-24 00:12:12 +00:00
e8748ce0a0 servo: lemmy: pict-rs: port the media-enable-full-video -> media-video-allow-audio CLI flag 2024-01-23 17:12:13 +00:00
7cf9b342cc gpodder: fixup GPODDER_DOWNLOAD_DIR to be more friendly to sandboxing 2024-01-23 16:44:47 +00:00
8739851f48 evince: port sandbox from firejail to bwrap 2024-01-23 16:44:13 +00:00
d945b43f6b signal-desktop: switch sandbox from firejail -> bwrap 2024-01-23 16:42:48 +00:00
fcc3ea1e39 todo: update containerization tasks 2024-01-23 16:41:06 +00:00
7722acecee sway: obtain deps via "config.sane.programs", so that i get the sandboxed version of e.g. splatmoji 2024-01-23 16:32:42 +00:00
bdd70f8fa2 sane-sandboxed: ignore the executable path when autodetecting media 2024-01-23 16:32:06 +00:00
571a0a9d06 gui: disable unused abaddon app 2024-01-23 16:30:06 +00:00
ccf4f66dd9 programs: dialect: sandbox with bubblewrap 2024-01-23 16:23:14 +00:00
b38e5403a5 splatmoji: sandbox 2024-01-23 16:01:27 +00:00
09af041745 g4music: ensure it can access the Music dir in its sandbox 2024-01-23 16:00:21 +00:00
cb5131746f programs: audacity: sandbox with bubblewrap 2024-01-23 15:59:50 +00:00
2fbd0f8ee1 nixpatches: apply bonsai refactor PR 2024-01-23 15:50:32 +00:00
bfd5630e21 programs: sandbox: omit media dirs by default, and implement --sane-sandbox-autodetect for programs which are liable to load data from paths 2024-01-23 15:48:12 +00:00
026f5dee4d programs: g4music: sandbox with bwrap 2024-01-23 15:06:45 +00:00
b59be8338a firefox: fix up sandboxing of ssh/sops 2024-01-23 14:57:57 +00:00
ab4bbc2224 programs: remove explicit firejail installation; let sane.programs decide when to install it sys-wide 2024-01-23 14:57:33 +00:00
156fcd1bf2 aerc: enable bwrap sandbox 2024-01-23 14:57:33 +00:00
576d2c32f0 programs: support secrets even when sandboxed 2024-01-23 14:57:33 +00:00
bb63a594ab conky: fixup needed paths for bwrap 2024-01-23 14:57:33 +00:00
25739ec2ba programs: sane-sandboxed: avoid reading firejail profiles when the backend isnt firejail
this should provide a marginal perf gain
2024-01-23 14:57:33 +00:00
f148334b58 programs: port extraFirejailConfig to extraConfig 2024-01-23 14:57:33 +00:00
da537ea8ea fractal: switch from firejail -> bwrap 2024-01-23 14:13:09 +00:00
18d224dc34 dino: switch from firejail to bwrap 2024-01-23 14:12:52 +00:00
3a6ee8708e programs: sane-sandboxed: dont error if network mountpoints are offline 2024-01-23 13:13:31 +00:00
983bf93d8f programs: sane-sandboxed: make the profile handle arguments with spaces 2024-01-23 12:47:25 +00:00
40cc8f5d1c programs: sane-sandboxed: make more debuggable 2024-01-23 12:27:23 +00:00
cce03a5dc8 programs: sandbox: use --dev-bind-try for root paths; fixes mpv on moby 2024-01-23 12:18:32 +00:00
38fd171713 spotify: sandbox with bwrap instead of firejail 2024-01-23 12:12:56 +00:00
84c78d9256 conky: sandbox with bwrap instead of firejail 2024-01-23 12:11:22 +00:00
973203d85e programs: mpv: sandbox with bwrap instead of firejail 2024-01-23 11:37:37 +00:00
f9174dd2aa programs: firefox: sandbox with bwrap instead of firejail 2024-01-23 11:37:19 +00:00
98dfc3aa5a programs: sandbox: allow all programs to access media
hopefully this is just a stopgap
2024-01-23 11:36:58 +00:00
27b56b1a12 programs: sane-sandbox: implement a cleaner debugshell and test API 2024-01-23 11:19:52 +00:00
6e9220d2bb programs: allow programs to specify "sandbox.method = "bwrap"" for bubblewrap sandboxing 2024-01-23 10:44:13 +00:00
0ddcfcaa23 sane-sandboxed: retrieve profiles from /share/sane-sandboxed/profiles so they can be customized without mass rebuilds 2024-01-23 08:01:23 +00:00
a4cb6645b4 programs: indirect firejail access through sane-sandboxed 2024-01-23 04:02:31 +00:00
2492ed2ca7 programs: introduce a sane-sandboxed helper
not yet used, but will be soon
2024-01-23 02:29:33 +00:00
f49d2a1e0e programs: split "makeSandboxed" into its own file 2024-01-23 01:23:14 +00:00
0dc3f4f7f2 modules/programs: move to subdir
this will help me factor out helpers
2024-01-23 01:02:04 +00:00
0bed4d0ada mpv: disable firejail sandboxing (it fails on moby) 2024-01-23 01:01:21 +00:00
f3e8af3fdb doc: libreoffice: mention "still" v.s. "fresh" variants 2024-01-23 01:00:34 +00:00
af542ec05f docs: gnome-keyring: point out that system gnome-keyring doesn't inherit my sandboxing 2024-01-23 01:00:06 +00:00
399a1d2052 steam: use wrapped package as system steam 2024-01-23 00:59:23 +00:00
bb6e5611d4 docs: conky: point out that un-sandboxed conky is used by sxmo-utils 2024-01-23 00:58:56 +00:00
d5901afb8e programs: firejail: specify profile via : (clarifies to firejail that its an identifier and not a path); invoke firejail via name instead of absolute path 2024-01-22 23:58:54 +00:00
c11f5a1401 wireshark: fix security.wrappers when wireshark is disabled 2024-01-22 23:58:04 +00:00
5b220f3fec wireshark: enable firejail isolation 2024-01-22 13:12:10 +00:00
8bf41ea858 programs: fix missing newline in firejail config concatenation 2024-01-22 13:11:47 +00:00
df861a3ef0 programs: firejail: inject custom firejail config through /etc/firejail
this improves rebuild times, and makes it easier for packages to inject their own free-form config
2024-01-22 11:12:18 +00:00
d6754b6cac evince: sandbox with firejail 2024-01-22 10:20:29 +00:00
b03d7f7fb0 geary: test the firejail profile; it's not ready 2024-01-22 10:04:18 +00:00
008b186479 audacity: test the firejail profile; it's not ready 2024-01-22 10:04:03 +00:00
914f9b3703 vlc: sandbox with firejail 2024-01-22 09:47:24 +00:00
ed7ec4a371 conky: sandbox with firejail 2024-01-22 09:31:00 +00:00
2d338201a5 signal-desktop: sandbox with firejail
TODO: fix URL opening / xdg-open
2024-01-22 09:30:34 +00:00
a8aad1f98f dino: sandbox with firejail
TODO: fix URL opening / xdg-open
2024-01-22 09:30:13 +00:00
2d06b93118 fractal: sandbox with firejail
TODO: seems this broke link opening? (xdg-open?)
2024-01-22 09:28:50 +00:00
60547204a8 sane.programs: firejail: support wrapping "runCommand" packages 2024-01-22 09:16:25 +00:00
3d763a0021 tor-browser-bundle-bin -> tor-browser
upstream nixpgs just has tor-browser-bundle-bin as an alias for tor-browser
2024-01-22 08:13:37 +00:00
ad474873e2 dovecot: fix unparseable config
upstream/nixpkgs is doing some shit, ugh
2024-01-22 08:09:37 +00:00
dd35136ac0 firejail: fix so /run/wrappers are available inside a jail 2024-01-22 07:18:50 +00:00
cfe6e9c20a nixpkgs: 2024-01-19 -> 2024-01-22
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/331c78971299375240001d946861951b6cc98176' (2024-01-19)
  → 'github:nixos/nixpkgs/dceddd03df4f840ea28c65887c199495793fb322' (2024-01-22)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/bbec4099302591a41304d360e3bab805e5ccc0be' (2024-01-19)
  → 'github:nixos/nixpkgs/8cccce637e19577815de54c5ecc3132dff965aee' (2024-01-22)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/87755331580fdf23df7e39b46d63ac88236bf42c' (2024-01-15)
  → 'github:Mic92/sops-nix/ae171b54e76ced88d506245249609f8c87305752' (2024-01-21)
```
2024-01-22 04:05:59 +00:00
0f3f0933b1 mpv: sandbox with firejail 2024-01-22 03:50:28 +00:00
f8440e3811 go2tv: allow more ports through the firewall 2024-01-22 03:50:04 +00:00
829460a076 todo: update firejail/sandboxing tasks 2024-01-22 02:04:32 +00:00
9ecd0adcbe firefox: sandbox with firejail
TODO: get it so open-in-mpv launches an mpv that has access to ~/.config/mpv

i guess this is the 'firejail url problem'
2024-01-21 23:59:15 +00:00
ad92a2e158 programs: abort when no firejail profile is found for a program.
in the future, i can whitelist specific binaries to omit their firejail
profiles.
2024-01-21 04:32:49 +00:00
5f5891d241 programs: apply firejail profile to programs which are net isolated 2024-01-21 04:28:48 +00:00
cf475c4696 nicotine-plus: remove distro-specific symlink 2024-01-21 03:56:33 +00:00
992194a1f0 programs: achieve network sandboxing without "sane-vpn do" 2024-01-21 03:51:12 +00:00
bad6a7bfee programs: implement "default vpn" with native nix code instead of sane-vpn 2024-01-21 01:04:31 +00:00
66d5e204be vpn: enforce "id" restrictions 2024-01-21 00:57:46 +00:00
ce35330923 vpn.nix: factor into a proper module
this will allow for better integration with 'sane.programs'
2024-01-21 00:49:34 +00:00
bdab1aa7e3 firefox-extensions: update to latest 2024-01-20 21:30:15 +00:00
080c8dbe3d sane-bt-search: try to install some logging for a sporadic error 2024-01-20 21:19:18 +00:00
a31fe44624 sane-bt-add: handle https:// URIs which forward to magnet: 2024-01-20 21:18:58 +00:00
59187a0ec0 programs: allow running binaries in a netns-style firejail 2024-01-20 11:11:12 +00:00
03fbf42680 servo: lemmy: pict-rs: fix broken CLI argument 2024-01-20 03:15:06 +00:00
f3b2a98874 firejail: fix cross compilation 2024-01-20 03:14:32 +00:00
2e9084c9ef nixpkgs: 2024-01-14 -> 2024-01-19; sops-nix -> 2024-01-15
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/724e39ebb9b8eda97f17d423f66fbc5a991f4f8d' (2024-01-14)
  → 'github:nixos/nixpkgs/331c78971299375240001d946861951b6cc98176' (2024-01-19)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/6c08fe3ccf437d8b26bec010fd925ddd6bb0d0d5' (2024-01-14)
  → 'github:nixos/nixpkgs/bbec4099302591a41304d360e3bab805e5ccc0be' (2024-01-19)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/70dd0d521f7849338e487a219c1a07c429a66d77' (2024-01-14)
  → 'github:Mic92/sops-nix/87755331580fdf23df7e39b46d63ac88236bf42c' (2024-01-15)
```
2024-01-20 03:14:32 +00:00
0907240fda sane-vpn: implement the "do" command, to run a program in a netns 2024-01-19 22:55:26 +00:00
7d670facd4 feeds: sort 2024-01-19 21:38:45 +00:00
61e5704fd6 feeds: unsub LW
too verbose, and too many of y'all turned into authoritarians
2024-01-19 21:38:14 +00:00
fd0723169f nix-serve: fix coredump loop 2024-01-19 21:34:45 +00:00
a725d42bf5 ip_forward: consolidate the options to fix servo build 2024-01-19 21:34:18 +00:00
c03cea2d4e net/vpn.nix: cleanup dead code 2024-01-19 09:58:13 +00:00
f43d6bff92 route VPN traffic such that i can configure any app to selectively use the VPN
e.g. firejail --net=br-ovpnd-us-mi --noprofile --dns=46.227.67.134 getent ahostsv4 uninsane.org
2024-01-19 09:54:01 +00:00
43a8ca90a7 feeds: add Cat and Girl 2024-01-16 19:12:25 +00:00
dac6046828 firefox-extensions: update to latest 2024-01-16 19:10:32 +00:00
e2a6ae22dc sxmo-utils: 2024-12-28 -> 2024-01-01 2024-01-16 19:10:08 +00:00
f2ee43d1ef delfin: 0.2.1 -> 0.3.0 2024-01-16 19:09:50 +00:00
3d80b46570 lemoa: 0.5.0 -> 0.5.1 2024-01-16 19:09:38 +00:00
e7d383604a signal-desktop-from-src: 6.42.0 -> 6.44.0 2024-01-16 19:09:25 +00:00
7d504892be servo: dovecot: fix broken sieve 2024-01-16 06:28:25 +00:00
d7a2bf9d26 servo: remove networking.useDHCP=false override
seems likely that the change to systemd-networkd renamed the ethernet interface, and so eth0.useDHCP wasn't right. this change seems to restore networking
2024-01-16 06:09:19 +00:00
d6184a7b6d sane-vpn: update to be compatible with newer systemd-network vpn implementation 2024-01-16 03:36:37 +00:00
851c15aa6d vpn: port ovpnd connections to use systemd-network
this should allow better integration with e.g. systemd-run, in future
2024-01-16 03:20:40 +00:00
c45898f903 WIP: wg-dev 2024-01-15 04:15:17 +00:00
0efec20904 hosts/common/net/vpn: remove unused "extraOptions" argument 2024-01-15 03:52:31 +00:00
2f04b563d1 nixpkgs: 2024-01-11 -> 2024-01-14
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/06797d4df4baaa51b229081083a88b92dac3ff7c' (2024-01-11)
  → 'github:nixos/nixpkgs/724e39ebb9b8eda97f17d423f66fbc5a991f4f8d' (2024-01-14)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/51f399ec47c082d678261883095bb8ad552e6500' (2024-01-11)
  → 'github:nixos/nixpkgs/6c08fe3ccf437d8b26bec010fd925ddd6bb0d0d5' (2024-01-14)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/c0b3a5af90fae3ba95645bbf85d2b64880addd76' (2024-01-10)
  → 'github:Mic92/sops-nix/70dd0d521f7849338e487a219c1a07c429a66d77' (2024-01-14)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/70bdadeb94ffc8806c0570eb5c2695ad29f0e421' (2024-01-03)
  → 'github:NixOS/nixpkgs/a1982c92d8980a0114372973cbdfe0a307f1bdea' (2024-01-12)
```
2024-01-15 01:32:07 +00:00
5b9c58dbc6 hosts/common: use servo-style dns on all machines
it'll be handy as i want to place individual applications inside VPNs/namespaces
2024-01-15 01:16:22 +00:00
a7964c4f0c hosts/common: net: split upnp config into own file 2024-01-15 01:12:09 +00:00
006a7e9f72 consolidate net-related stuff into hosts/common/net/ directory 2024-01-15 01:11:13 +00:00
3856710faf net: annotate the UPNP rule 2024-01-15 01:08:10 +00:00
6cbc0bedf3 ddns-he (HurricaneElectric): remove
it's unused for a year
2024-01-15 00:55:10 +00:00
fbc0c7615a ddns-afraid (afraid.org): remove
it's unused for a year
2024-01-15 00:54:41 +00:00
34bcdb5128 firefox: disable kinetic scrolling 2024-01-14 20:34:14 +00:00
a5c6e41622 feeds: subscribe to POD OF JAKE 2024-01-14 05:20:28 +00:00
02e03227d8 servo: try to integrate peerswap with clightning, but it fails 2024-01-14 04:33:12 +00:00
faa0a7c9ea peerswap: init at unstable-20240111 2024-01-14 02:55:32 +00:00
812a02bc6b feeds: add The Dollop podcast 2024-01-14 00:49:29 +00:00
27898ecdc8 feeds: unsubscribe from Louis Rossman
his channel is kinda just the same idea  played over and over
2024-01-14 00:36:52 +00:00
1c2324cca4 servo: clightning-sane: status command: show profits from fees 2024-01-13 16:43:49 +00:00
70f059eaac feeds: subscribe to Jack Stauber 2024-01-13 16:43:41 +00:00
bac72be730 servo: clightning-sane: status command: show in/out payment sums 2024-01-13 15:53:48 +00:00
99858c1384 servo: clightning-sane: centralize metric reporting, fix so we blacklist our own channels less frequently 2024-01-13 04:47:20 +00:00
103a300e77 servo: clightning-sane: implement an autobalance subcommand 2024-01-13 03:04:24 +00:00
6b5cdd7508 servo: clightning-sane: log before we give up 2024-01-13 01:10:52 +00:00
2f1e354400 servo: clightning-sane: drop caches after so many failures 2024-01-12 23:54:06 +00:00
585a87130c servo: clightning-sane: remove unused loop_once_with_retries method 2024-01-12 23:31:30 +00:00
0e68533776 servo: clightning-sane: introduce parallelism 2024-01-12 23:30:52 +00:00
882cc5bfd0 servo: clightning-sane: rename Balancer -> LoopRouter 2024-01-12 21:36:20 +00:00
91847a9a8e servo: clightning-sane: factor "loop" action into own subroutine 2024-01-12 21:28:20 +00:00
5c649ff216 servo: clightning-sane: include peer_id in status --full 2024-01-12 20:56:00 +00:00
abdd224211 servo: clightning-sane: increase CLTV 9->18 2024-01-12 20:55:32 +00:00
0c72c59190 servo: clightning-sane: handle closed channels in status listing 2024-01-12 20:28:57 +00:00
432170a69e servo: clightning-sane: rename ppm in/out to theirs/mine 2024-01-12 19:31:39 +00:00
805b37a9a5 servo: clightning-sane: add a --full option for more info 2024-01-12 19:24:50 +00:00
87a0bda011 servo: clightning-sane: perform rebalance operation in a loop 2024-01-12 19:17:07 +00:00
5d2c6e1978 servo: clightning-sane: mark channels which cant be rebalanced freely 2024-01-12 18:43:58 +00:00
abafbd811b servo: clightning-sane: minor bugfixes 2024-01-12 18:30:49 +00:00
aca50d9946 servo: clightning-sane: add a "status" subcommand 2024-01-12 17:42:44 +00:00
bd4f4dab81 servo: clightning-sane: factor out a subcommands interface 2024-01-12 15:42:12 +00:00
aebd11ea82 alacritty: port config: yaml to toml 2024-01-12 03:24:55 +00:00
fa6906fdf9 cross: fix appstream/eyed3 failures from nixpkgs update 2024-01-12 03:24:55 +00:00
cec21375a5 servo: disable mautrix-signal 2024-01-12 03:24:55 +00:00
0428f64afa nixpkgs: 2024-01-10 -> 2024-01-11
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/2f9e98ccf3283a34ce9301c7ee4ca18d219d829d' (2024-01-10)
  → 'github:nixos/nixpkgs/06797d4df4baaa51b229081083a88b92dac3ff7c' (2024-01-11)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/32afa5e024e45885dacadf1c8ad65e9ebc51a901' (2024-01-10)
  → 'github:nixos/nixpkgs/51f399ec47c082d678261883095bb8ad552e6500' (2024-01-11)
```
2024-01-12 03:24:55 +00:00
e0864edefc nixpkgs: 2024-01-10 -> 2024-01-10
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/0231e3ccf485b7b110f0e0e55be6a711cb0093fb' (2024-01-10)
  → 'github:nixos/nixpkgs/2f9e98ccf3283a34ce9301c7ee4ca18d219d829d' (2024-01-10)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/a962df01db9bff000df83733bf6d7ef60a855057' (2024-01-10)
  → 'github:nixos/nixpkgs/32afa5e024e45885dacadf1c8ad65e9ebc51a901' (2024-01-10)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/0ded57412079011f1210c2fcc10e112427d4c0e6' (2024-01-08)
  → 'github:Mic92/sops-nix/c0b3a5af90fae3ba95645bbf85d2b64880addd76' (2024-01-10)
```
2024-01-12 03:24:55 +00:00
7460fd283c nixpkgs: 2024-01-09 -> 2024-01-10
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/fcff3d7883a38ef71832899085ba365658c96867' (2024-01-09)
  → 'github:nixos/nixpkgs/0231e3ccf485b7b110f0e0e55be6a711cb0093fb' (2024-01-10)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/519c93eda20a7c361e6159d853bf33b1e6236141' (2024-01-09)
  → 'github:nixos/nixpkgs/a962df01db9bff000df83733bf6d7ef60a855057' (2024-01-10)
```
2024-01-12 03:24:55 +00:00
7a7dee1630 nixpkgs: 2023-12-29 -> 2024-01-09; sops-nix; uninsane-dot-org
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/f50aae4fb10dd51bd6ffcce0eb96d02b608a9595' (2023-12-29)
  → 'github:nixos/nixpkgs/fcff3d7883a38ef71832899085ba365658c96867' (2024-01-09)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/04df6aa7bad237aeeb69f603e1f4ec1a2c28a4da' (2023-12-29)
  → 'github:nixos/nixpkgs/519c93eda20a7c361e6159d853bf33b1e6236141' (2024-01-09)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/e523e89763ff45f0a6cf15bcb1092636b1da9ed3' (2023-12-24)
  → 'github:Mic92/sops-nix/0ded57412079011f1210c2fcc10e112427d4c0e6' (2024-01-08)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/7790e078f8979a9fcd543f9a47427eeaba38f268' (2023-12-23)
  → 'github:NixOS/nixpkgs/70bdadeb94ffc8806c0570eb5c2695ad29f0e421' (2024-01-03)
• Updated input 'uninsane-dot-org':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=b21e6899490f25fa450fb9e3efa0c8774bcee0d3' (2023-12-31)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=4a1fa488e64e6c87c6c951e3fafb2684692f64d3' (2024-01-01)
```
2024-01-12 03:24:55 +00:00
913403aac6 servo: clightning-sane: tidy 2024-01-12 01:25:56 +00:00
432a66bf5f servo: clightning: initialize a script for rebalancing with peers 2024-01-11 23:11:33 +00:00
e2a43ddfa0 servo: clightning: allow group members to run lightning-cli 2024-01-11 15:59:32 +00:00
b2ba204ca1 nixpatches: update hashes (?) 2024-01-11 15:58:44 +00:00
892b045342 pyln-client: init at 23.11.2 2024-01-11 00:38:08 +00:00
8644e6705a servo: decrease ZFS cache size 2024-01-11 00:20:52 +00:00
3f60206eef servo: clightning: tune config 2024-01-10 23:40:17 +00:00
568ead4bd7 servo: lightning: tune config 2024-01-10 21:01:36 +00:00
14241d54c9 flake: fix packages output to eval (even though its dumb and i just use hostPkgs.<machine>.<xyz>) 2024-01-10 11:48:20 +00:00
e4d75c5f38 servo: clightning: disable features which are incompatible with lnd 2024-01-10 11:18:54 +00:00
c42dda1bab servo: clightning: document more parts of the config 2024-01-09 16:19:48 +00:00
3295ae3b74 servo: clightning: update config 2024-01-09 16:13:08 +00:00
e63438bedf feeds: disable The Linux Experience 2024-01-09 00:45:18 +00:00
25422da9ba servo: tune clightning config 2024-01-09 00:42:37 +00:00
37583d8c9c clightning: tune fees, logging 2024-01-06 18:08:51 +00:00
62b3863722 servo: clightning: enable experimental features 2024-01-06 09:13:17 +00:00
b11f03bd18 servo: clightning: docs 2024-01-05 22:09:32 +00:00
63620fa058 servo: clightning: node personalization and docs 2024-01-04 21:55:13 +00:00
cecb114810 clightning: harden 2024-01-04 18:47:40 +00:00
4ce93f74c6 wob: add debug logging 2024-01-04 17:07:47 +00:00
09b806d7a7 go2tv: document youtube workarounds 2024-01-04 16:26:25 +00:00
2f31100c3f servo: ship go2tv 2024-01-04 16:25:50 +00:00
ca3f97ec51 docs: go2tv: elaborate seeking limitations 2024-01-04 16:25:49 +00:00
7378d6c5b2 bitcoind: host behind tor 2024-01-04 16:25:49 +00:00
276de5d662 tor: fix /var/lib/tor directory permissions 2024-01-04 16:25:49 +00:00
6f449cf35f clightning: document some places to find nodes for channels 2024-01-04 16:25:49 +00:00
daf046861c wob: implement as part of sway instead of exclusive to sxmo 2024-01-04 13:08:20 +00:00
43498c62f9 clightning: integrate with tor 2024-01-03 18:29:16 +00:00
22f5853741 firefox: remove unused functions 2024-01-03 14:59:59 +00:00
fe217f6667 firefox: disable ctrl+shift+c shortcut more broadly 2024-01-03 14:59:27 +00:00
41ae86f40f servo: enable clightning 2024-01-03 13:56:42 +00:00
6d52c8ecf8 servo: split tor/i2p into own files 2024-01-03 13:56:14 +00:00
75b649543a firefox: enable ctrl-shift-c-should-copy extension 2024-01-03 13:42:58 +00:00
1261a6f452 firefox-extensions.ctrl-shift-c-should-copy: init at unstable-2023-03-04 2024-01-03 13:33:32 +00:00
041855dbc7 zsh: fix broken <del> and <ctrl>+<arrow> keybindings 2024-01-03 13:07:29 +00:00
3e52956a3a servo: clightning: integrate, but do not enable 2024-01-02 18:32:34 +00:00
d8f4158bc6 servo: consolidate blockchains under cryptocurrencies directory 2024-01-02 18:16:58 +00:00
36638e80a3 bitcoin: add myself as an authenticated rpcuser 2024-01-02 18:11:46 +00:00
28d0a72c62 define (but dont activate) a clighting bitcoin service 2024-01-02 14:29:52 +00:00
6471524f4a programs: zecwallet-lite: move to own file 2024-01-01 15:17:51 +00:00
61b2b8f2cd nixpatches: cleanup 2024-01-01 14:46:37 +00:00
02aae4bb8b conky: start upstreaming it 2024-01-01 14:38:08 +00:00
3efecb9560 sxmo_hook_block_suspend: re-introduce exponential backoff 2024-01-01 13:03:26 +00:00
8d0707699c mpv/vlc: associate with flv video type 2024-01-01 11:48:18 +00:00
318774a2a0 sxmo_suspend: fix that "sxmo_jobs periodic_blink" would hang post-wakeup 2024-01-01 11:48:03 +00:00
b14e997a43 sxmo: remove sxmo_hook_screenoff.sh override
generally, i can get away with the defaults and patch my alternative into sxmo_suspend.sh more reliably/simply
2024-01-01 10:33:24 +00:00
b949438be5 sxmo_suspend.sh: stop, and resume, the sxmo LED blinking
then later i can remove the custom screenoff hook
2024-01-01 10:01:48 +00:00
6ee9e8e405 sxmo_hook_screenoff: decrease the blink frequency even more
if i was smarter i'd just disable the periodic blinking right before entering sleep
2024-01-01 07:24:08 +00:00
09ee8e6efc sxmo_hook_block_suspend: forward only to the next script, not all next scripts 2024-01-01 07:01:09 +00:00
49527edaa9 sxmo_suspend.sh: fix rtcwake to use sudo 2024-01-01 06:38:43 +00:00
92d193ffe3 sxmo_hook_block_suspend: fix recursion counter 2024-01-01 06:19:30 +00:00
4805510073 sxmo-utils: ship with gojq 2024-01-01 06:15:31 +00:00
6fe195e2dd sxmo: block suspend if go2tv is active 2024-01-01 04:56:39 +00:00
c54df8d9c4 hare-ev: 2023-10-31 -> 2023-12-04 2024-01-01 03:56:45 +00:00
6d8b6c61a2 feeds: sort 2024-01-01 03:56:25 +00:00
822653ec10 feeds: vitalik.ca -> vitalik.eth.limo 2024-01-01 03:48:06 +00:00
68502ca944 feeds: add webcurious.co.uk link aggregator 2024-01-01 03:46:52 +00:00
103d11a87c net: fix broken firewall/ipset setup 2023-12-31 14:25:36 +00:00
0028c41bdc uninsane-dot-org: update 2023-12-31 12:22:23 +00:00
a4fe002607 sway: always render KOReader titlebar 2023-12-30 11:57:33 +00:00
b54ab9391b sxmo-utils: add Notejot app 2023-12-30 11:41:36 +00:00
0c7612c83f sxmo-utils: 2023-12-17 -> 2023-12-28
this should fix spurious screenoff -> unlock transitions (thanks Aren!)
2023-12-30 11:31:36 +00:00
f9361af41c go2tv: remove firewall fix and allow SSDP at the iptables layer 2023-12-30 06:16:17 +00:00
3cd3ebed51 nixpkgs -> latest 2023-12-30 05:34:23 +00:00
4ad209020a disable chatty (doesnt cross compile) 2023-12-30 05:34:02 +00:00
556327740b nixpkgs: 2023-12-26 -> 2023-12-29
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/0db7618e46243d3710ff2b8040aca5f6e0102900' (2023-12-26)
  → 'github:nixos/nixpkgs/bd7fd36fe22e0de1162f1623f1736517c1506164' (2023-12-29)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/d956588517edbcde71781bd8ac3a9947a9fc55a6' (2023-12-26)
  → 'github:nixos/nixpkgs/f46c267fc63f01c75fa9f6d9fb8345e6a1ed0063' (2023-12-29)
```
2023-12-29 15:52:32 +00:00
b0ddb1b31c conky: use the same percent symbol even in battery_estimate 2023-12-28 17:43:34 +00:00
70ee98736a conky/battery_estimate: handle the static state better 2023-12-28 17:35:33 +00:00
5de06cef35 conky: fix text substitutions 2023-12-28 17:07:29 +00:00
4f3706622c conky/battery_estimate: render stylized 2023-12-28 03:05:27 +00:00
104e76de47 conky/battery_estimate: render h/m indicators as superscript 2023-12-28 01:53:43 +00:00
1df99978bb conky/battery_estimte: select icon based on battery percentage 2023-12-28 01:11:51 +00:00
3846322f12 conky/battery_estimate: support new-style Thinkpad batteries 2023-12-28 00:41:23 +00:00
623b2c6611 conky/battery_estimate: add debugging 2023-12-28 00:35:48 +00:00
cb4d73f959 nixpkgs: 2023-12-23 -> 2023-12-26
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/2125288b9266cde9e3333a6787525bc151918742' (2023-12-23)
  → 'github:nixos/nixpkgs/0db7618e46243d3710ff2b8040aca5f6e0102900' (2023-12-26)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/d8aba6fe4067abdd8b1a7f398f2b90f21c608530' (2023-12-23)
  → 'github:nixos/nixpkgs/d956588517edbcde71781bd8ac3a9947a9fc55a6' (2023-12-26)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/f7db64b88dabc95e4f7bee20455f418e7ab805d4' (2023-12-18)
  → 'github:Mic92/sops-nix/e523e89763ff45f0a6cf15bcb1092636b1da9ed3' (2023-12-24)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/a19a71d1ee93226fd71984359552affbc1cd3dc3' (2023-12-17)
  → 'github:NixOS/nixpkgs/7790e078f8979a9fcd543f9a47427eeaba38f268' (2023-12-23)
```
2023-12-27 00:34:48 +00:00
58febf51bd remove most useDHCP=false settings
networking.useDHCP was deprecated, and then later undeprecated: it's safe to keep it defaulted
2023-12-24 02:17:06 +00:00
b254379fb1 firefox-extensions: update to latest 2023-12-23 21:31:13 +00:00
835d933719 nixpkgs: 2023-12-22 -> 2023-12-23
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/21e572254ecbbb9d55be98841b279d21ee5754b6' (2023-12-22)
  → 'github:nixos/nixpkgs/2125288b9266cde9e3333a6787525bc151918742' (2023-12-23)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/66bda599f409f9834c6fd6abc602e452a5c16b61' (2023-12-22)
  → 'github:nixos/nixpkgs/d8aba6fe4067abdd8b1a7f398f2b90f21c608530' (2023-12-23)
```
2023-12-23 21:18:25 +00:00
31130d90bc nixpatches: fix broken hash 2023-12-23 12:44:17 +00:00
237c493252 slskd: fix Restart option 2023-12-23 10:23:17 +00:00
18e7acd9e7 slskd: restart even on non-failure exit 2023-12-23 05:39:22 +00:00
906026e333 nixpkgs: 2023-12-21 -> 2023-12-22
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/63fbe1a992e6030fbf444ac9d6b629ec76ab86ad' (2023-12-21)
  → 'github:nixos/nixpkgs/21e572254ecbbb9d55be98841b279d21ee5754b6' (2023-12-22)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/490828bce1b0cdfe328adc7f6280a519d7e68ed4' (2023-12-21)
  → 'github:nixos/nixpkgs/66bda599f409f9834c6fd6abc602e452a5c16b61' (2023-12-22)
```
2023-12-22 19:07:32 +00:00
9e24fba5ee document that loupe is an image viewer 2023-12-21 22:58:23 +00:00
12edd60969 nixpkgs: bump 2023-12-21
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/459873d8d6492b492ca7f9b03d5a50117099abfa' (2023-12-21)
  → 'github:nixos/nixpkgs/63fbe1a992e6030fbf444ac9d6b629ec76ab86ad' (2023-12-21)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/38bbf09b10659db891af01288bd99a5e8e8d7861' (2023-12-21)
  → 'github:nixos/nixpkgs/490828bce1b0cdfe328adc7f6280a519d7e68ed4' (2023-12-21)
```
2023-12-21 20:03:06 +00:00
0f429caaca nixpkgs: 2023-12-20 -> 2023-12-21
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/7749fa1e8c5e2f6a003fd4d3a2ed52924c4a7217' (2023-12-20)
  → 'github:nixos/nixpkgs/459873d8d6492b492ca7f9b03d5a50117099abfa' (2023-12-21)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/9ee63abe2cbeea5bf15f319a0a5aaf0919fe22e8' (2023-12-20)
  → 'github:nixos/nixpkgs/38bbf09b10659db891af01288bd99a5e8e8d7861' (2023-12-21)
```
2023-12-21 18:41:55 +00:00
940f1140a3 disable webkit for erlang 2023-12-21 05:22:45 +00:00
dbb6773634 audacity: disable first-run splashscreen 2023-12-21 04:08:05 +00:00
245a0544bc audacity: ship w/o the webkitgtk dependency 2023-12-21 03:10:38 +00:00
cbd65f0816 argyllcms: build without qemu 2023-12-21 01:44:36 +00:00
f8ea711f6a cross compilation: remove dead code 2023-12-21 00:20:42 +00:00
ace94cf4d6 cross: use newer jbig2dec fix; send dconf upstream 2023-12-20 22:32:07 +00:00
829fde4336 bonsai: grab from upstream PR 2023-12-20 09:24:41 +00:00
ba8774d6e5 hare-ev: remove (upstreamed) 2023-12-20 09:21:11 +00:00
7597853cda nixpkgs: 2023-12-19 -> 2023-12-20
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/7467ab39493e17abc28c7f66179feb0a69a3dbd4' (2023-12-19)
  → 'github:nixos/nixpkgs/7749fa1e8c5e2f6a003fd4d3a2ed52924c4a7217' (2023-12-20)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/63dd8e1d2e81aaecb7de9b70ca143a607b19a3b9' (2023-12-19)
  → 'github:nixos/nixpkgs/9ee63abe2cbeea5bf15f319a0a5aaf0919fe22e8' (2023-12-20)
```
2023-12-20 09:08:42 +00:00
21077c0e34 cross: document rustPlatform cross compilation woes 2023-12-20 08:00:40 +00:00
b6a45656af gui: add planify app 2023-12-19 22:31:14 +00:00
33d2f0895f signal-desktop-from-src: 6.40.0 -> 6.42.0 2023-12-19 20:53:33 +00:00
5cd92279b7 firefox-extensions: update to latest 2023-12-19 19:40:24 +00:00
4085f60018 firefox-extensions.bypass-paywalls-clean: 3.4.6.0 -> 3.4.7.0 2023-12-19 19:40:08 +00:00
3faee78717 docs: cross: update upstreaming status 2023-12-19 19:39:38 +00:00
e96e07ac21 lemoa: todo: fold 2023-12-19 19:39:11 +00:00
0c34aec8ec lemoa: 0.4.0 -> 0.5.0 2023-12-19 18:08:16 +00:00
9d04037bec hare-ev: remove unnecessary rec 2023-12-19 17:44:04 +00:00
6af44bfd86 delfin: add an updateScript 2023-12-19 17:43:07 +00:00
5ceefa4d6d nixpkgs: 2023-12-18 -> 2023-12-19; uninsane-dot-org -> 2023-12-18
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/ab47e6046f991dc98641ffbd9f881afcd304cfca' (2023-12-18)
  → 'github:nixos/nixpkgs/7467ab39493e17abc28c7f66179feb0a69a3dbd4' (2023-12-19)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/f61b7ce80fcc95be72c5c4fea19fba928072af8b' (2023-12-18)
  → 'github:nixos/nixpkgs/63dd8e1d2e81aaecb7de9b70ca143a607b19a3b9' (2023-12-19)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/21f2b8f123a1601fef3cf6bbbdf5171257290a77' (2023-12-17)
  → 'github:Mic92/sops-nix/f7db64b88dabc95e4f7bee20455f418e7ab805d4' (2023-12-18)
• Updated input 'uninsane-dot-org':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=ee722a13732b8d03bae56be8147333d144a02126' (2023-12-10)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=41354f754107376f5c9265eae89d07275f0305de' (2023-12-18)
• Removed input 'uninsane-dot-org/flake-utils'
• Removed input 'uninsane-dot-org/flake-utils/systems'
```
2023-12-19 16:44:22 +00:00
f618925190 gui: ship openscad 2023-12-19 08:04:20 +00:00
68ae723543 nixos-prebuild: disable 2023-12-19 01:58:59 +00:00
e4123759f5 nginx: only auto-index /share 2023-12-19 00:12:27 +00:00
5e727a83b3 slskd: disable debug logging 2023-12-18 18:09:58 +00:00
dc288d9aa7 sane_ssdp: reduce verbosity 2023-12-18 18:00:12 +00:00
8d49c423ca transmission: disable debug logging 2023-12-18 17:58:04 +00:00
c056564c9c nixpkgs: 2023-12-17 -> 2023-12-18
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/ec02adf37f19c5dcd891ebf9f175ebb1c4fba80a' (2023-12-17)
  → 'github:nixos/nixpkgs/ab47e6046f991dc98641ffbd9f881afcd304cfca' (2023-12-18)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/91a00709aebb3602f172a0bf47ba1ef013e34835' (2023-12-17)
  → 'github:nixos/nixpkgs/f61b7ce80fcc95be72c5c4fea19fba928072af8b' (2023-12-18)
```
2023-12-18 16:39:25 +00:00
efb2815fa5 uninsane.org: simplify the /share routing (and generalize it to other subdirectories) 2023-12-18 06:03:49 +00:00
577d149728 sxmo-utils: 2023-12-09 -> 2023-12-17 2023-12-18 00:05:14 +00:00
45c2bfaaeb nixpkgs: 2023-12-16 -> 2023-12-17
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/029c707186e2b00f9e98f590b9a019320ccc21d7' (2023-12-16)
  → 'github:nixos/nixpkgs/ec02adf37f19c5dcd891ebf9f175ebb1c4fba80a' (2023-12-17)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/ceb8e4efd95627c0a86f106ba2afcd207ad5c6b3' (2023-12-16)
  → 'github:nixos/nixpkgs/91a00709aebb3602f172a0bf47ba1ef013e34835' (2023-12-17)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/d806e546f96c88cd9f7d91c1c19ebc99ba6277d9' (2023-12-10)
  → 'github:Mic92/sops-nix/21f2b8f123a1601fef3cf6bbbdf5171257290a77' (2023-12-17)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/b8f33c044e51de6dde3ad80a9676945e0e4e3227' (2023-12-09)
  → 'github:NixOS/nixpkgs/a19a71d1ee93226fd71984359552affbc1cd3dc3' (2023-12-17)
```
2023-12-18 00:02:23 +00:00
16d4c9cdf2 nixpkgs: 2023-12-15 -> 2023-12-16
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/9ad53b7aaf2b9e9e0d7e36ff4f8a779bf9b0195f' (2023-12-15)
  → 'github:nixos/nixpkgs/029c707186e2b00f9e98f590b9a019320ccc21d7' (2023-12-16)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/8a205497ba6f6938b7b516c184b7cf326ab15548' (2023-12-15)
  → 'github:nixos/nixpkgs/ceb8e4efd95627c0a86f106ba2afcd207ad5c6b3' (2023-12-16)
```
2023-12-17 21:26:41 +00:00
1063a89541 powerbutton/lid-switch: tune the desired actions 2023-12-17 21:08:16 +00:00
fd0f709d50 git: remove a/ b/ prefixes from diffs 2023-12-17 20:48:31 +00:00
5edd10c332 move kiwix data to /var/lib/kiwix and persist 2023-12-16 03:05:15 +00:00
5c36ee79be kiwix: wikipedia snapshot: 2022-05 -> 2023-11 2023-12-16 01:54:34 +00:00
b2bf9d63a3 mpv: don't assume xdg-terminal-exec is on PATH 2023-12-16 00:43:43 +00:00
e297df011d xdg-terminal-exec: remove (it exists upstream now) 2023-12-16 00:41:51 +00:00
bcac00d766 mpv: uosc: add a "cast" option to the menu 2023-12-16 00:39:36 +00:00
c256d7ded5 koreader: implement copy-to-clipboard 2023-12-15 20:53:04 +00:00
7ba39ea831 koreader: document how to configure 2023-12-15 20:05:06 +00:00
28f90e4421 sxmo: lengthen voldown hold time before revealing terminal 2023-12-15 19:12:26 +00:00
5d66a1e6a5 hare-json: remove. it's been upstreamed as hareThirdParty.hare-json 2023-12-15 17:59:09 +00:00
1522eccfb3 nixpkgs: 2023-12-14 -> 2023-12-15
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/248d12a902bfc36134176f31beba87b1fe30a3c1' (2023-12-14)
  → 'github:nixos/nixpkgs/9ad53b7aaf2b9e9e0d7e36ff4f8a779bf9b0195f' (2023-12-15)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/fd7914c96f7c006047e0154dd239aa2396478094' (2023-12-14)
  → 'github:nixos/nixpkgs/8a205497ba6f6938b7b516c184b7cf326ab15548' (2023-12-15)
```
2023-12-15 17:40:44 +00:00
728604e036 gui hosts: ship delfin 2023-12-15 08:44:32 +00:00
58d4f0d512 delfin: fix cross build 2023-12-15 08:43:10 +00:00
1f7fc8700e delfin: fix icons 2023-12-15 08:30:20 +00:00
a933f8b512 delfin: persist server settings 2023-12-15 08:17:07 +00:00
83b83841d6 delfin: init at 0.2.1 2023-12-15 08:08:11 +00:00
ef8a8bc246 go2tv: document known-good format matrix 2023-12-15 03:22:03 +00:00
136ddda055 nautilus: enable the A/V pane 2023-12-15 02:57:25 +00:00
5fbf2166f1 moby: enable go2tv/catt 2023-12-15 02:33:18 +00:00
ba7bc3bd03 go2tv: docs: show that some mp4s work w/o transcoding 2023-12-15 02:32:44 +00:00
311412c5ee go2tv: configure firewall as needed 2023-12-15 00:50:58 +00:00
d18e94ea87 feeds: subscribe to linmob.net 2023-12-14 22:20:30 +00:00
6a548366cd sway: enable gvfs to support remote filesystems 2023-12-14 21:59:42 +00:00
54d2e875f6 koreader: disable image-based feeds; text only 2023-12-14 20:51:09 +00:00
c5cc0e90a3 wob: theme 2023-12-14 20:49:48 +00:00
50ce8da68c sxmo: remove sxmo-set-permissions job. upstream refactored it to not exist and they use doas now instead 2023-12-14 19:17:38 +00:00
3449bfc2a9 sxmo: bonsai: tune timings: powerhold: 1000ms -> 900ms; volhold: 400ms -> 600ms
this should improve: (1) awkwardly long power hold until window is killed, (2) accidentally seeking the media player when i meant to only adjust volume
2023-12-14 19:12:08 +00:00
18d301d9dd cross: dino: remove patch which has been upstreame into nixpkgs 2023-12-14 19:08:08 +00:00
357bf7f4ca nixpkgs: 2023-12-13 -> 2023-12-14
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/022a4231437548b719eb9e5b8bae1a7f6117fa93' (2023-12-13)
  → 'github:nixos/nixpkgs/1aca249f1846b6bb7a156b809c312de58945c85a' (2023-12-14)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/8556109c1f04574ad59dcb0c4882f44eb27ea581' (2023-12-13)
  → 'github:nixos/nixpkgs/8e23dec5ac5ebc36057e980d4e6a3eb6a44da74b' (2023-12-14)
```
2023-12-14 18:50:36 +00:00
f763448d6f go2tv: docs: firewall 2023-12-14 10:56:07 +00:00
deb828e98a programs: enable go2tv 2023-12-14 10:39:33 +00:00
cbca41accf permit moby to ssh into my devices 2023-12-14 10:35:36 +00:00
ac22e07388 sxmo: bring wob service in-house 2023-12-14 10:33:33 +00:00
cb0d9e077b programs: enable catt 2023-12-14 08:41:16 +00:00
58105e9b62 fix open-in-mpv extension 2023-12-14 07:26:50 +00:00
32fb79d43d dino: auto-start 2023-12-14 01:57:32 +00:00
f129afdae8 flare-signal: document linking/registration issue 2023-12-14 01:56:54 +00:00
29cde5e724 firefox: support Element and Nheko URIs 2023-12-13 23:14:04 +00:00
3467a5df48 feeds: subscribe Origin Stories 2023-12-13 22:31:58 +00:00
694dd59e27 feeds: subscribe bitsaboutmoney 2023-12-13 22:29:22 +00:00
540b3e4af2 firefox: auto-dispatch mpv:// URI handlers 2023-12-13 21:41:06 +00:00
e0211646b2 firefox: extraNativeMessagingHosts -> nativeMessagingHosts 2023-12-13 21:34:59 +00:00
94dcb0f08a firefox: ship open-in-mpv extension 2023-12-13 21:34:34 +00:00
0b38ed2f2a firefox: docs: clarify fxCast behavior 2023-12-13 20:58:45 +00:00
15622251ef firefox: define the fx_cast addon 2023-12-13 20:51:57 +00:00
4eb79a4a5c gui: ship pwvucontrol 2023-12-13 20:43:16 +00:00
9f54413d46 pwvucontrol: support cross compilation 2023-12-13 20:02:48 +00:00
f467898a04 sync TODO 2023-12-13 17:41:31 +00:00
413c8a4fef sponsorblock: re-disable the first-launch nag 2023-12-13 17:37:48 +00:00
d4440736dd nixpkgs: 2023-12-12 -> 2023-12-13
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/a3eee1a84ec0aadb7f567175d79574d63dcecff2' (2023-12-12)
  → 'github:nixos/nixpkgs/022a4231437548b719eb9e5b8bae1a7f6117fa93' (2023-12-13)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/47bca5bb0209496389f3a70d2e388c5531831d60' (2023-12-12)
  → 'github:nixos/nixpkgs/8556109c1f04574ad59dcb0c4882f44eb27ea581' (2023-12-13)
```
2023-12-13 16:27:18 +00:00
bb1ceaed12 gui: disable newsflash
it doesn't cross compile. also, gnome-feeds would be a better implementation if i can get the package updated
2023-12-13 16:27:18 +00:00
51a90136ea sxmo-utils: default preferSystemd to true
this probably removes some duplicate sxmo-utils packages from my install
2023-12-13 16:27:18 +00:00
e7cfa19897 sxmo-utils: use xdg-open in sxmo_open.sh 2023-12-13 16:27:18 +00:00
41411e005f flare-signal-nixified: document experience with 10.1-xx seies 2023-12-13 08:10:50 +00:00
c22119f69b flare-signal-nixified: enable primary device registration 2023-12-13 07:17:17 +00:00
354a4e523b flare-signal-nixified: 0.10.1-beta.4 -> 0.10.1-beta.6 2023-12-13 07:01:16 +00:00
b34b8a249c nixpatches: link but dont apply gnome-feeds update 2023-12-13 03:47:20 +00:00
508257da87 newsflash: enable podcasts/videos; document 2023-12-13 03:45:07 +00:00
fadcf7d7c1 mpv: youtube: associate with another URL variant 2023-12-13 03:44:57 +00:00
7f43360120 newsflash: enable 2023-12-13 03:06:08 +00:00
f9a8389f58 gui: switch from gthumb to loupe for image viewing 2023-12-13 02:29:43 +00:00
f77a18a655 cross: enable Loupe for cross compilation 2023-12-13 02:00:43 +00:00
7e4d6853f5 cross: glycin-loaders: simplify 2023-12-13 01:48:26 +00:00
5615c7cf6e cross: glycin-loader: fix compilation 2023-12-13 01:40:36 +00:00
54c51a5636 fractal-latest: remove old comments 2023-12-12 21:02:09 +00:00
1119726c64 docs: koreader: dictionary installation 2023-12-12 20:56:46 +00:00
101a2bc3af hare-ev: 2023-10-30 -> 2023-12-04 2023-12-12 20:45:46 +00:00
f4bfaf3581 firefox-extensions: update to latest 2023-12-12 20:44:56 +00:00
e8dfc1dc71 sxmo-utils: 2023-11-26 -> 2023-12-09 2023-12-12 20:44:27 +00:00
ef26b9085c nixpatches: remove merged numpy patch 2023-12-12 20:37:55 +00:00
85d9c11733 sxmo: add an option to disable wob 2023-12-12 19:00:43 +00:00
6d41f1f1db sxmo: re-enable audio
SXMO_NO_AUDIO disables too much. i just want to not launch the daemons, and customizing sxmo_hook_start is enough for that
2023-12-12 18:59:31 +00:00
f9434215db nixpkgs: 2023-12-11 -> 2023-12-12
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/43f7188eba3bc2eb73031bf8f9ad1a02224b6be1' (2023-12-12)
  → 'github:nixos/nixpkgs/a3eee1a84ec0aadb7f567175d79574d63dcecff2' (2023-12-12)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/a8dac2fa64af92360f126d2e20f47cd4ccf1c905' (2023-12-11)
  → 'github:nixos/nixpkgs/47bca5bb0209496389f3a70d2e388c5531831d60' (2023-12-12)
```
2023-12-12 18:40:06 +00:00
83d402eb77 nixos-prebuild: fix typo 2023-12-12 18:39:46 +00:00
cec48e0270 nixpkgs: 2023-12-11 -> 2023-12-12
```
• Updated input 'nixpkgs-next-unpatched':
    'github:nixos/nixpkgs/f81605387c494a302c16901ac6459e877c45f913' (2023-12-11)
  → 'github:nixos/nixpkgs/43f7188eba3bc2eb73031bf8f9ad1a02224b6be1' (2023-12-12)
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d' (2023-12-11)
  → 'github:nixos/nixpkgs/a59c7364955e5f32798d0314fbb6aae347ff064d' (2023-12-12)
```
2023-12-12 09:34:52 +00:00
322038ca21 flake.nix: expose the patched nixpkgs as an output, for debugging 2023-12-12 09:34:28 +00:00
6395e60f17 nixpatches: fix date check to be based on when upstream nixpkgs was updated, not this repo 2023-12-12 09:34:28 +00:00
7969eb12d6 cross: partially fix glycin-loaders 2023-12-12 09:34:28 +00:00
f942e2c5a9 nixpatches: revise numpy master merge date 2023-12-12 09:34:28 +00:00
089f676c4a gui: switch back to gthumb; loupe does not cross compile yet 2023-12-12 08:44:08 +00:00
d2012b4e40 notejot: fix store typo 2023-12-12 07:55:18 +00:00
a319017567 gui: switch from gthumb to loupe 2023-12-12 07:38:13 +00:00
a669c9c88b gui: add Loupe image viewer specialization 2023-12-12 07:36:21 +00:00
8391e500c9 gui: handheld: ship notejot 2023-12-12 07:31:00 +00:00
5f27c8fddf servo: nixos-prebuild: cleanup garbage better 2023-12-12 06:47:47 +00:00
a4ae41e627 servo: nixos-prebuild: dont ship jobs to other builders 2023-12-12 06:44:08 +00:00
a5126ae8fb cross: re-enable jbig2dec fix (turns out it is necessary) 2023-12-12 06:20:43 +00:00
f33776e0ed flake: check.nur: simplify nixpkgs path 2023-12-12 03:53:54 +00:00
189eccb01e nixpatches: improve patch conditionality 2023-12-12 03:22:25 +00:00
4336d68e6f flake: fix CLI argument quoting 2023-12-12 02:16:06 +00:00
4f45adb063 gui: disable slic3r 2023-12-12 02:16:06 +00:00
e6b16624c3 ntfy-waiter: fix port typo in service description 2023-12-12 02:15:01 +00:00
e87d2f545c sftpgo: fix systemd after/wants typo 2023-12-12 02:14:45 +00:00
69bc219efa ports: fix systemd RandomizedDelaySec typo 2023-12-12 02:14:27 +00:00
e4f1cfb53f servo: deploy a service which periodically rebuilds my nix config to populate the cache 2023-12-12 02:13:59 +00:00
f1e59061d7 flake: check.hostConfigs: build *-light first even for -next 2023-12-11 23:00:15 +00:00
cd312e41d4 flake: remove check.hostConfigs variants 2023-12-11 22:51:58 +00:00
1bd2d0dfc1 flake: remove separate nixpkgs-staging and staging-next 2023-12-11 22:33:38 +00:00
49235a4d83 flake: add check.hostConfigsNext 2023-12-11 22:23:14 +00:00
e7826e0648 flake: add host outputs for nixpkgs-staging and nixpkgs-staging-next 2023-12-11 22:15:35 +00:00
e7edb4739f flake.nix: fix for better caching on non-cross builds 2023-12-11 21:24:33 +00:00
4a622c558e signal-desktop-from-src: fix nodejs to 18.x 2023-12-11 21:07:42 +00:00
bfe69a4708 flake: fix patching process to assume less about nixpkgs internals 2023-12-11 21:07:17 +00:00
688b4edf13 mpv: handle shorthand youtu.be URLs too 2023-12-11 16:19:51 +00:00
7ca2e5f539 nixpkgs: 2023-12-10 -> 2023-12-11; uninsane-dot-org
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/64292b08dc5d1538d7ab88817a90b2713c34c8a0' (2023-12-10)
  → 'github:nixos/nixpkgs/e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d' (2023-12-11)
• Updated input 'uninsane-dot-org':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=8f7a3f3f7ce95f21131f94418c522062a8dc2055' (2023-12-09)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=ee722a13732b8d03bae56be8147333d144a02126' (2023-12-10)
```
2023-12-11 06:23:43 +00:00
4c5fb74c7d feeds: subscribe to kosmosghost 2023-12-11 04:55:47 +00:00
ad82bb2630 mimeo: fix infinite loop when dispatching non-specialized http/s URLs 2023-12-11 04:52:49 +00:00
008a6192d4 mpv: associate with https://youtube.com/... 2023-12-11 04:52:49 +00:00
f4d4c7a92a sxmo-utils: remove gojq and just use normal jq 2023-12-11 04:44:45 +00:00
0a41192eb1 sxmo-utils: remove gojq requirement 2023-12-11 03:27:58 +00:00
f044fcb584 gnome-frog: fix cross compilation 2023-12-11 03:27:46 +00:00
9e2c0a7112 megapixels: simplify zbar fix 2023-12-11 03:27:29 +00:00
d2e1441d1f sane-clone: grab package data from ~/nixos instead of nixpkgs
this way i can clone my own packages
2023-12-10 17:28:30 +00:00
abbd28a634 git: add an "amend" alias 2023-12-10 17:01:58 +00:00
b309402784 nixpkgs: update; sops-nix: 2023-12-04 -> 2023-12-10
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/852e0ea0e8e1bd174bf1af9706f6b855319a5f1d' (2023-12-10)
  → 'github:nixos/nixpkgs/64292b08dc5d1538d7ab88817a90b2713c34c8a0' (2023-12-10)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/e91ece6d2cf5a0ae729796b8f0dedceab5107c3d' (2023-12-04)
  → 'github:Mic92/sops-nix/d806e546f96c88cd9f7d91c1c19ebc99ba6277d9' (2023-12-10)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/dc01248a9c946953ad4d438b0a626f5c987a93e4' (2023-12-03)
  → 'github:NixOS/nixpkgs/b8f33c044e51de6dde3ad80a9676945e0e4e3227' (2023-12-09)
```
2023-12-10 16:50:24 +00:00
a7d3ac95aa nginx: uninsane.org: redirect common feed URIs to the canonical feed 2023-12-10 16:31:30 +00:00
255da2b976 docs: gtkcord4: explain how to disable notif sounds 2023-12-10 16:26:26 +00:00
8cdb4aa53d docs: feedbackd: show how to trigger a sound 2023-12-10 16:25:13 +00:00
4d5b462b2c swaync: add rules to help with debugging 2023-12-10 16:18:55 +00:00
f7a318c937 modules/users: fix services to specify PATH with correct precedence 2023-12-10 15:18:26 +00:00
eb5b9b083c mpv-uosc-latest: remove (no longer needed)
nixpkgs mpv-uosc was recently updated, seems to work well out-of-the-box
2023-12-10 02:32:33 +00:00
e0d9a59d10 nixpkgs: 2023-12-09 -> 2023-12-10
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/61b691834e5ce9590c44690e73392ee7e001d45a' (2023-12-09)
  → 'github:nixos/nixpkgs/852e0ea0e8e1bd174bf1af9706f6b855319a5f1d' (2023-12-10)
```
2023-12-10 02:13:59 +00:00
119ac4cf95 cross: start upstreaming wob patch 2023-12-09 20:20:10 +00:00
f53d0e16ff cross: start upstreaming dino patch 2023-12-09 20:11:36 +00:00
5321ccc980 uninsane-dot-org: mobile-linux-push-notifications: fix src-port -> dest-port typo 2023-12-09 18:28:28 +00:00
e8a6fa3506 uninsane-dot-org: mobile-linux-push-notifications: fix link typo 2023-12-09 18:22:58 +00:00
26e1cc2a7a uninsane-dot-org: revise linux-mobile-notifications for sxmo integration 2023-12-09 18:16:32 +00:00
cec4b4b78e sway: fix app_id for gtkcord4 2023-12-09 16:48:17 +00:00
7ce3cb79c9 switch from abaddon -> gtkcord4 as default discord client 2023-12-09 16:45:40 +00:00
4c553b1525 gtkcord4: fix to Default_keyring instead of login.keyring 2023-12-09 16:42:27 +00:00
84ec809fb5 gui: ship gnome.seahorse 2023-12-09 15:02:00 +00:00
f49e466ce8 flake: add a "hostSystems" target 2023-12-09 14:11:37 +00:00
402baa1011 uninsane-dot-org: 2023-12-03 -> 2023-12-09; nixpkgs 2023-12-09 14:01:51 +00:00
01de6f84cf feeds: subscribe to Louis Rossmann 2023-12-09 08:14:16 +00:00
e1e9047664 nixpkgs: 2023-12-08 -> 2023-12-09
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/c89d45747b4ba510caa6b2704b574484b6f93e96' (2023-12-08)
  → 'github:nixos/nixpkgs/d02151974acd5d2e1a47cee3245d97e130c3ecfa' (2023-12-09)
```
2023-12-09 05:51:01 +00:00
0be9831b0c cross: update upstreaming status 2023-12-08 22:49:18 +00:00
1db9d4d10b roles/build-machine: re-enable big-parallel 2023-12-08 20:20:55 +00:00
ccef9d1414 nixpkgs: update
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/f63903a90faf6cce169eb2bcc93fb45c457b1d31' (2023-12-08)
  → 'github:nixos/nixpkgs/c89d45747b4ba510caa6b2704b574484b6f93e96' (2023-12-08)
```
2023-12-08 20:14:44 +00:00
8b09599c5e sane-sync-music: update files if mtime differs
*presumably* most tagging software updates the mtime when tags change, but i didn't actually check
2023-12-08 15:07:12 +00:00
368099e95a cross: ostree: apply Mindavi's PR feedback 2023-12-08 15:00:29 +00:00
34342b7f48 sync.moby: reduce job count 2023-12-08 14:52:11 +00:00
fcc7ebf5c1 sync.desko: fix mountpoint typo 2023-12-08 12:24:00 +00:00
114bdb30e8 flake: sync-*: refactor 2023-12-08 10:25:01 +00:00
4caf61387e sane-sync-music: add --compress and --compat options 2023-12-08 10:24:48 +00:00
ab020327f4 nixpkgs: 2023-12-07 -> 2023-12-08
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/449c6fb06be60edd4233bb9fe748a0754df185b1' (2023-12-07)
  → 'github:nixos/nixpkgs/f63903a90faf6cce169eb2bcc93fb45c457b1d31' (2023-12-08)
```
2023-12-08 04:26:09 +00:00
bacad0f111 sane-sync-music: add a --force-copy flag 2023-12-07 19:00:51 +00:00
9619c6d2e1 sane-sync-music: refactor to facilitate future tweaks 2023-12-07 18:49:01 +00:00
07c7050335 docs: sane-sync-music: document a bug 2023-12-07 18:17:21 +00:00
24a6fba008 sane-tag-music: remove prefer-path flag to force 2023-12-07 18:08:41 +00:00
51c53b2103 sane-tag-music: allow manually specifying tags via CLI 2023-12-07 18:08:41 +00:00
4ae01aa353 sane-tag-music: auto-create id3 tags for MP3 files 2023-12-07 18:08:41 +00:00
0db1e3728a sway: dont ship custom gtk icons
the GNOME 45 update makes it so default adwaita icons are reliable on moby
2023-12-07 17:56:56 +00:00
83c7657951 sane-tag-music: better handle track names for compilation albums 2023-12-07 17:29:10 +00:00
e20386299f sane-tag-music: add a --force flag 2023-12-07 17:29:10 +00:00
d6e43effde sane-tag-music: better handle verbose track names 2023-12-07 17:29:10 +00:00
bbe8f4a852 sane-tag-music: support opus, aac (limited) 2023-12-07 17:29:10 +00:00
8c98e38053 sane-tag-music: better handling of "Various Artists" 2023-12-07 17:29:10 +00:00
96a36d4d6b sane-tag-music: support ogg files 2023-12-07 17:29:10 +00:00
366a9cea0d fractal: ship optimized build 2023-12-07 16:39:36 +00:00
e810774202 fractal,flare: note that release is incompatible with cross compilation 2023-12-07 16:39:36 +00:00
f2de781cbc nixpkgs: update
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/17411d69e415b5f4910f9a66f89dc6a1866cb410' (2023-12-07)
  → 'github:nixos/nixpkgs/449c6fb06be60edd4233bb9fe748a0754df185b1' (2023-12-07)
```
2023-12-07 16:39:36 +00:00
7f08ad01db sane-tag-music: handle more character encoding edgecases 2023-12-07 15:52:28 +00:00
2c66d8cad0 sane-tag-music: don't crash when file opening fails 2023-12-07 15:51:51 +00:00
fc4803f3fd sane-tag-music: fix bug that song would be extracted into a list of chars 2023-12-07 15:51:17 +00:00
5a6d1dd3c2 sane-tag-music: don't write empty tags 2023-12-07 13:55:45 +00:00
ba42ff7469 sane-tag-music: support mp3 2023-12-07 13:55:45 +00:00
a6cc698c69 signal-desktop-from-src: simplify build process 2023-12-07 13:49:07 +00:00
19b0a62fee flake: support cross deployments from non-binfmt machines 2023-12-07 13:49:07 +00:00
1a6ce11b07 disable binfmt emulation on my build machines 2023-12-07 13:49:07 +00:00
49d8578b83 signal-desktop-from-src: build without emulation 2023-12-07 13:49:07 +00:00
53c0cd570a update todos: moby: install games 2023-12-07 13:49:07 +00:00
4d84bdafed koreader: cross-compile without binfmt 2023-12-07 13:49:07 +00:00
059cd38e7b cross: comment out the firefox hacks
they're unused and broken anyway
2023-12-07 13:49:07 +00:00
8f89d11435 cross: fix wob compilation 2023-12-07 13:49:07 +00:00
243f78ff0e nixpkgs: 2023-12-06 -> 2023-12-07
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/2bea1bc0f98bb316e26d1a5a17df58fce54ca8c4' (2023-12-06)
  → 'github:nixos/nixpkgs/17411d69e415b5f4910f9a66f89dc6a1866cb410' (2023-12-07)

```
2023-12-07 13:49:07 +00:00
21be1b392e servo: switch external storage to zfs pool 2023-12-07 08:57:26 +00:00
8b71e6ac5a sane-stop-all-servo: update with newer services 2023-12-07 05:36:09 +00:00
f5f6298284 re-enable flare-signal 2023-12-06 19:27:47 +00:00
c8370bc290 cross: tried to get cinny to cross-compile, not quite there 2023-12-06 19:26:18 +00:00
abc0ac88d3 flare-signal-nixified: cross-compile without emulation 2023-12-06 19:25:09 +00:00
9da604c0af fractal-nixified: fix build 2023-12-06 19:22:45 +00:00
801da9d321 cross: add a cantBinfmt option to force a package to be built on a non-binfmt machine 2023-12-06 19:20:39 +00:00
ac3b0b873b transmission: increase speed limits 2023-12-06 18:03:08 +00:00
9beee146f2 feeds: sort Youtube feeds 2023-12-06 16:49:40 +00:00
2d06401f3c feeds: subscribe to Tom Scott 2023-12-06 16:19:37 +00:00
2db56f2499 feeds: subscribe to TheB1M 2023-12-06 16:18:03 +00:00
63ea6d7002 feeds: subscribe to Exurb1a 2023-12-06 16:16:29 +00:00
3e2523cc2c feeds: subscribe to Cold Fusion 2023-12-06 16:15:25 +00:00
ad3f5e305e feeds: subscribe to Vox
don't @ me
2023-12-06 16:13:08 +00:00
aa5b9e3db3 user services: wrap with user PATH
notably, this alllows Fractal to open links with the preferred browser
2023-12-06 16:09:07 +00:00
46123719e9 feeds: subscribe to Vihart 2023-12-06 16:09:07 +00:00
16bce990c6 feeds: subscribe to PolyMatter 2023-12-06 16:09:07 +00:00
d55e387187 feeds: subscribe to Vsauce 2023-12-06 16:09:06 +00:00
e75c3375dc feeds: subscribe to Channel5 News 2023-12-06 16:08:50 +00:00
b1c7cb367a feeds: subcsribe to hbomberguy 2023-12-06 15:47:39 +00:00
d63d660ec2 feeds: subscribe to ContraPoints 2023-12-06 15:45:43 +00:00
f24a0a84b5 gpodder: ship on all systems
it's more useful on desko/lappy now that i can ship Youtube feeds.
2023-12-06 15:36:41 +00:00
9704dcc997 feeds: add support for video; subscribe to videos in gpodder 2023-12-06 15:36:05 +00:00
80875d6312 feeds: subscribe to Technology Connections 2023-12-06 15:35:38 +00:00
79f4c9f98c flare-signal-nixified: support defaultCrateOverrides 2023-12-06 14:22:16 +00:00
e2735e151e cross: make buildInQemu more flexible to non-stdenv builders 2023-12-06 14:08:46 +00:00
afb4a88830 moby: enable dialect 2023-12-06 14:00:34 +00:00
84dc8cfd23 cross: build dialect so that it doesn't depend on build binaries at runtime 2023-12-06 13:56:39 +00:00
6ef52677ee nixpkgs: 2023-12-05 -> 2023-12-06
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/3532bd963c2a1417e7d5d9a13b90f3ab8e6b6538' (2023-12-05)
  → 'github:nixos/nixpkgs/2bea1bc0f98bb316e26d1a5a17df58fce54ca8c4' (2023-12-06)
```
2023-12-06 01:45:09 +00:00
73c0e9a742 cross: update error message for fractal 2023-12-05 17:02:33 +00:00
7ff259073e swaync: decrease mpris icon size 64 -> 48px 2023-12-05 17:01:57 +00:00
2bf10c60ee swaynotificationcenter: fix mpris icon height even when it fails to load an icon 2023-12-05 16:57:24 +00:00
72f4b43b54 sxmo: better input mappings 2023-12-05 15:12:08 +00:00
e1ced7a7fe sxmo_hook_inputhandler.sh: remove unused VOL_INCR_2 variable 2023-12-05 10:08:16 +00:00
f41b1cf3b5 sxmo: enable powertoggle -> volup/down for seeking even when screen is on
it's not currently mapped to anything else, so...
2023-12-05 10:04:01 +00:00
70693c2052 sxmo: simplify shortcuts
remove power -> volup DE menu map -- it's accessible via sysmenu now

replace power -> voldown terminal map with just voldown hold
2023-12-05 10:02:19 +00:00
f61d7d0f7d sxmo: decrease power-button timeout 2023-12-05 08:54:18 +00:00
3d7ea75bfc sxmo: simplify XDG_SESSION_TYPE fix 2023-12-05 08:50:19 +00:00
f350d7949c sxmo: fix missing XDG_SESSION_TYPE env var 2023-12-05 08:06:14 +00:00
10c21714ef tangram: build without emulation 2023-12-05 06:02:38 +00:00
2dbae69d50 komikku: build without emulation 2023-12-05 05:16:40 +00:00
4cc5eed884 feeds: subscribe to srslywrong.com 2023-12-05 04:25:25 +00:00
9967868e80 nixpkgs: update
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/d90955124ff3af2d469bf10000b09b9d7dfc5240' (2023-12-04)
  → 'github:nixos/nixpkgs/3532bd963c2a1417e7d5d9a13b90f3ab8e6b6538'
```
2023-12-05 02:04:40 +00:00
bb79752101 cross: gnome-online-accounts: disable unnecessary needsBinfmt
perhaps this was fixed in gnome 44 -> gnome 45
2023-12-04 17:50:12 +00:00
ebd24e5999 cross: evolution-data-server: build w/o binfmt/qemu 2023-12-04 17:50:12 +00:00
7a3fa88559 cross: gnome.mutter: build without binfmt/qemu 2023-12-04 17:50:12 +00:00
cff4fdc5f5 feeds: unsubscribe from Daniel Huberman 2023-12-04 12:36:10 +00:00
e7fc52ff20 cross: build neovim w/o binfmt/qemu 2023-12-04 11:26:28 +00:00
b061aff76e IOCTL_... errrors: track mesa 23.3.1 PR which SHOULD fix them? 2023-12-04 11:07:59 +00:00
b14214761b cross: get jbig2dec to build without binfmt/qemu 2023-12-04 11:07:53 +00:00
9bd684a971 cross: waybar: build without binfmt/qemu 2023-12-04 08:57:57 +00:00
89286be9e1 cross: tidy: remove explicit "final." 2023-12-04 07:42:11 +00:00
991a6a7552 cross: build libpanel w/o binfmt/qemu 2023-12-04 07:26:56 +00:00
04af5558b5 ibus: cross compile without binfmt/qemu 2023-12-04 06:59:00 +00:00
3ee487ca94 cross: fix flatpak to not require binfmt/qemu 2023-12-04 05:05:26 +00:00
20352ff170 calls: cross compile without binfmt/qemu 2023-12-04 04:24:53 +00:00
819894ccbf dino: compile without binfmt/qemu 2023-12-04 04:02:07 +00:00
aa46c4cb8f chatty: remove redundant evolution-data-server override: its done in overlays/preferences.nix 2023-12-04 02:09:52 +00:00
1c75977da7 firefox-extensions: update bypass-paywalls-clean, ublacklist, ublock-origin 2023-12-04 01:47:35 +00:00
c099483305 cross: mark as needsBinfmtOrQemu those packages which can build in either 2023-12-04 01:47:35 +00:00
959e200837 cross: remove upstreamed vulkan-tools fix 2023-12-04 00:38:54 +00:00
d9f0bdb089 nixpkgs, sops-nix, uninsane-dot-org -> 2023-12-04
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/0616776a5e4072e9455e3966d1fce58feefa7a58' (2023-12-03)
  → 'github:nixos/nixpkgs/d90955124ff3af2d469bf10000b09b9d7dfc5240' (2023-12-04)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/e19071f9958c8da4f4347d3d78790d97e98ba22f' (2023-12-02)
  → 'github:Mic92/sops-nix/8bca48cb9a12bbd8766f359ad00336924e91b7f7' (2023-12-03)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/dfb95385d21475da10b63da74ae96d89ab352431' (2023-11-25)
  → 'github:NixOS/nixpkgs/dc01248a9c946953ad4d438b0a626f5c987a93e4' (2023-12-03)
• Updated input 'uninsane-dot-org':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=8a4273489d945f21d7e0ca6aac952460c7d4c391' (2023-11-09)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs/heads/master&rev=f865fdd262e249bb1b829900f99cbb67f21a0365' (2023-12-03)
```
2023-12-04 00:34:27 +00:00
b50d723158 servo: nginx: remove "root" in uninsane share path 2023-12-03 15:53:29 +00:00
14739af1b9 servo: nginx: dont follow symlinks in the /share directory 2023-12-03 15:51:01 +00:00
747511c6a8 waybar: link to a better playerctl integration 2023-12-03 15:19:55 +00:00
c96f9cd4de ibus: 1.5.29-rc1 -> 1.5.29
TODO: cleanup this patch and then send to nixpkgs :)
2023-12-03 14:41:56 +00:00
31da2f10c9 sane-wipe: support dino 2023-12-03 14:40:14 +00:00
9e51d7f150 sane-wipe-*: consolidate into one sane-wipe binary 2023-12-03 14:25:35 +00:00
b1b1f8d659 cross: vulkan-tools: link to upstream PR 2023-12-03 14:02:57 +00:00
0c0e7881b1 signal-desktop: document a known bug 2023-12-03 13:58:30 +00:00
6c2f07aab1 cross: disable gnome-2048 fix in light of vala fix being upstreamed (still in staging) 2023-12-03 13:46:01 +00:00
84d2b31c51 cross: fix vulkan-tools compilation 2023-12-03 13:29:44 +00:00
2f23d916f5 sxmo: disable xwayland 2023-12-03 13:03:57 +00:00
d413f4a782 gtkcord4: partially re-enable 2023-12-03 13:01:52 +00:00
c2080cfe1e sway: position Signal on the correct desktop even when run without Xwayland 2023-12-03 13:00:29 +00:00
c687d059c5 signal-desktop: support wayland even when running as a service 2023-12-03 13:00:29 +00:00
a131358c36 signal-desktop: support wayland 2023-12-03 13:00:29 +00:00
0ba012fd7c guis: ship vulkan-tools 2023-12-03 13:00:29 +00:00
b43a693a1e nginx: render directory listings for uninsane.org/share 2023-12-03 09:00:45 +00:00
6f4072efdd servo: enable bitcoind 2023-12-03 08:49:24 +00:00
908984c285 cross: mark mutter as needs binfmt 2023-12-03 02:10:34 +00:00
8772aaec65 zfs: dont ship on moby 2023-12-03 00:58:49 +00:00
f3d605bb63 cross: fix fractal-nixified dep which needs binfmt 2023-12-03 00:40:08 +00:00
6741e0b9e1 nixpkgs: -> tip; sops-nix: 2023-11-27 -> 2023-12-02
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/eb18da27b9cb7e2006574cd962f8a22baf2955f1' (2023-12-02)
  → 'github:nixos/nixpkgs/0616776a5e4072e9455e3966d1fce58feefa7a58' (2023-12-03)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/b1edbf5c0464b4cced90a3ba6f999e671f0af631' (2023-11-27)
  → 'github:Mic92/sops-nix/e19071f9958c8da4f4347d3d78790d97e98ba22f' (2023-12-02)
```
2023-12-03 00:22:07 +00:00
a9f932408c servo: add zfs dataset 2023-12-02 17:38:00 +00:00
a00e6984d9 nixpkgs: 2023-12-01 -> 2023-12-02
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/7c12c8615307e2677a5f769e27ddb0ab4e36a940' (2023-12-01)
  → 'github:nixos/nixpkgs/eb18da27b9cb7e2006574cd962f8a22baf2955f1' (2023-12-02)
```
2023-12-02 00:12:16 +00:00
b4738438b1 nixpkgs: 2023-11-30 -> 2023-12-01
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/8d0f0ca32319439fe9940b1de917dbbdcb8e6f3d' (2023-11-30)
  → 'github:nixos/nixpkgs/7c12c8615307e2677a5f769e27ddb0ab4e36a940' (2023-12-01)
```
2023-12-01 16:19:05 +00:00
416c2f2f39 feeds: remove Hard Fork 2023-12-01 15:35:15 +00:00
589f86010f fix that servo had too low of a inotify watch limit for wan.txt path unit to work 2023-12-01 13:18:05 +00:00
76a7c19996 waybar-sxmo-status: fix volume 2023-12-01 12:51:55 +00:00
3fa676e169 sxmo: waybar: include the volume sxmo status (i.e. microphone/headphones) 2023-12-01 08:45:31 +00:00
3193028c48 sxmo_hook_start: dont start the statusbar items 2023-12-01 07:56:43 +00:00
ba823e8283 sxmo: waybar: provide status more granularly 2023-12-01 07:43:20 +00:00
55f4ef9a4f firefox-extensions.metamask: 11.6.2 -> 11.6.3 2023-12-01 04:33:03 +00:00
200b0dcf7c sxmo: better integrate the status components into waybar
maybe i'll remove all the sxmo-specific logic eventually: it seems generalizable
2023-12-01 03:28:32 +00:00
181f9597c2 Merge branch 'dev' 2023-12-01 01:52:12 +00:00
e55c264c29 activationScripts: fix error messages which would occur on boot, for scripts which only want to run during upgrades 2023-12-01 01:51:37 +00:00
dfbae7e7b5 notify user when nixos deploy/activation completes 2023-12-01 01:29:37 +00:00
98fa50d0eb nixpkgs: 2023-11-29 -> 2023-11-30
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/6711380ae7874005d707d7d03830bd5eee40b43b' (2023-11-29)
  → 'github:nixos/nixpkgs/8d0f0ca32319439fe9940b1de917dbbdcb8e6f3d' (2023-11-30)
```
2023-11-30 23:53:17 +00:00
9503658dec sane-tag-music: handle tracks with soundcloud ID at end of title 2023-11-30 13:59:08 +00:00
3c9bf681b2 sane-tag-music: better handle compilation albums 2023-11-30 13:23:55 +00:00
c1b20675c1 sane-tag-music: handle more path schemas 2023-11-30 12:53:04 +00:00
5703caac19 remove unused scripts/ensure-perms script 2023-11-30 12:53:04 +00:00
7abf7459f9 signal-desktop-from-src: 6.38.0 -> 6.40.0 2023-11-30 09:58:25 +00:00
b14c6ecd5b firefox-extensions: update to latest 2023-11-30 09:47:09 +00:00
455127219d flake: rename check.host-configs -> check.hostConfigs 2023-11-30 01:40:50 +00:00
e235014bde cross: lift defaultCrateOverrides patches to toplevel 2023-11-30 01:40:02 +00:00
ed1bf899b6 fractal: annotate crates which require binfmt for cross compilation 2023-11-30 01:36:53 +00:00
36c7f77a98 nixpkgs: 2023-11-28 -> 2023-11-29
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/c9702bf40b036c0f1d3d5b0aaf3eee2bf920124c' (2023-11-28)
  → 'github:nixos/nixpkgs/6711380ae7874005d707d7d03830bd5eee40b43b' (2023-11-29)
```
2023-11-30 00:50:35 +00:00
996b4f8366 sane-tag-music: update tags even if file had no existing tags 2023-11-29 13:05:05 +00:00
39d94b34d7 sane-tag-music: better handle singles 2023-11-29 12:57:16 +00:00
6edc6841bf sane-tag-music: support directory/tree operations 2023-11-29 12:52:35 +00:00
b2806bd649 sxmo: ship codemadness-frontends 0.6 2023-11-29 12:31:36 +00:00
936118b8cb sane-tag-music: init 2023-11-29 12:29:58 +00:00
120f251590 sxmo-utils: enable sxmo_youtube.sh script 2023-11-29 10:16:00 +00:00
d9962e1b03 codemadness-frontends: fix cross compilation 2023-11-29 10:15:39 +00:00
1396eb2c58 codemadness-frontends: init at 0.8 2023-11-29 09:51:42 +00:00
372 changed files with 18168 additions and 12877 deletions

117
README.md
View File

@@ -1,3 +1,7 @@
![hello](doc/hello.gif)
# .❄≡We|_c0m3 7o m`/ f14k≡❄.
## What's Here ## What's Here
this is the top-level repo from which i configure/deploy all my NixOS machines: this is the top-level repo from which i configure/deploy all my NixOS machines:
@@ -6,18 +10,18 @@ this is the top-level repo from which i configure/deploy all my NixOS machines:
- server - server
- mobile phone (Pinephone) - mobile phone (Pinephone)
everything outside of <./hosts/> and <./secrets/> is intended for export, to be importable for use by 3rd parties. everything outside of [hosts/](./hosts/) and [secrets/](./secrets/) is intended for export, to be importable for use by 3rd parties.
the only hard dependency for my exported pkgs/modules should be [nixpkgs][nixpkgs]. the only hard dependency for my exported pkgs/modules should be [nixpkgs][nixpkgs].
building <./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)
- [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/default.nix> - [modules/fs/](./modules/fs/default.nix)
- <./modules/programs.nix> - [modules/programs/](./modules/programs/default.nix)
- <./modules/users.nix> - [modules/users.nix](./modules/users.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
@@ -35,37 +39,37 @@ or follow the instructions [here][NUR] to use it via the Nix User Repositories.
## Layout ## Layout
- `doc/` - `doc/`
- instructions for tasks i find myself doing semi-occasionally in this repo. - instructions for tasks i find myself doing semi-occasionally in this repo.
- `hosts/` - `hosts/`
- the bulk of config which isn't factored with external use in mind. - the bulk of config which isn't factored with external use in mind.
- that is, if you were to add this repo to a flake.nix for your own use, - that is, if you were to add this repo to a flake.nix for your own use,
you won't likely be depending on anything in this directory. you won't likely be depending on anything in this directory.
- `integrations/` - `integrations/`
- code intended for consumption by external tools (e.g. the Nix User Repos) - code intended for consumption by external tools (e.g. the Nix User Repos)
- `modules/` - `modules/`
- config which is gated behind `enable` flags, in similar style to nixpkgs' - config which is gated behind `enable` flags, in similar style to nixpkgs'
`nixos/` directory. `nixos/` directory.
- if you depend on this repo, it's most likely for something in this directory. - if you depend on this repo, it's most likely for something in this directory.
- `nixpatches/` - `nixpatches/`
- literally, diffs i apply atop upstream nixpkgs before performing further eval. - literally, diffs i apply atop upstream nixpkgs before performing further eval.
- `overlays/` - `overlays/`
- exposed via the `overlays` output in `flake.nix`. - exposed via the `overlays` output in `flake.nix`.
- predominantly a list of `callPackage` directives. - predominantly a list of `callPackage` directives.
- `pkgs/` - `pkgs/`
- derivations for things not yet packaged in nixpkgs. - derivations for things not yet packaged in nixpkgs.
- derivations for things from nixpkgs which i need to `override` for some reason. - derivations for things from nixpkgs which i need to `override` for some reason.
- inline code for wholly custom packages (e.g. `pkgs/additional/sane-scripts/` for CLI tools - inline code for wholly custom packages (e.g. `pkgs/additional/sane-scripts/` for CLI tools
that are highly specific to my setup). that are highly specific to my setup).
- `scripts/` - `scripts/`
- scripts which aren't reachable on a deployed system, but may aid manual deployments - scripts which aren't reachable on a deployed system, but may aid manual deployments
- `secrets/` - `secrets/`
- encrypted keys, API tokens, anything which one or more of my machines needs - encrypted keys, API tokens, anything which one or more of my machines needs
read access to but shouldn't be world-readable. read access to but shouldn't be world-readable.
- not much to see here - not much to see here
- `templates/` - `templates/`
- exposed via the `templates` output in `flake.nix`. - exposed via the `templates` output in `flake.nix`.
- used to instantiate short-lived environments. - used to instantiate short-lived environments.
- used to auto-fill the boiler-plate portions of new packages. - used to auto-fill the boiler-plate portions of new packages.
## Key Points of Interest ## Key Points of Interest
@@ -73,35 +77,40 @@ or follow the instructions [here][NUR] to use it via the Nix User Repositories.
i.e. you might find value in using these in your own config: i.e. you might find value in using these in your own config:
- `modules/fs/` - `modules/fs/`
- use this to statically define leafs and nodes anywhere in the filesystem, - use this to statically define leafs and nodes anywhere in the filesystem,
not just inside `/nix/store`. not just inside `/nix/store`.
- e.g. specify that `/var/www` should be: - e.g. specify that `/var/www` should be:
- owned by a specific user/group - owned by a specific user/group
- set to a specific mode - set to a specific mode
- symlinked to some other path - symlinked to some other path
- populated with some statically-defined data - populated with some statically-defined data
- populated according to some script - populated according to some script
- created as a dependency of some service (e.g. `nginx`) - created as a dependency of some service (e.g. `nginx`)
- values defined here are applied neither at evaluation time _nor_ at activation time. - values defined here are applied neither at evaluation time _nor_ at activation time.
- rather, they become systemd services. - rather, they become systemd services.
- systemd manages dependencies - systemd manages dependencies
- e.g. link `/var/www -> /mnt/my-drive/www` only _after_ `/mnt/my-drive/www` appears) - e.g. link `/var/www -> /mnt/my-drive/www` only _after_ `/mnt/my-drive/www` appears)
- this is akin to using [Home Manager's][home-manager] file API -- the part which lets you - this is akin to using [Home Manager's][home-manager] file API -- the part which lets you
statically define `~/.config` files -- just with a different philosophy. statically define `~/.config` files -- just with a different philosophy.
- `modules/persist/` - `modules/persist/`
- my alternative to the Impermanence module. - my alternative to the Impermanence module.
- this builds atop `modules/fs/` to achieve things stock impermanence can't: - this builds atop `modules/fs/` to achieve things stock impermanence can't:
- persist things to encrypted storage which is unlocked at login time (pam_mount). - persist things to encrypted storage which is unlocked at login time (pam_mount).
- "persist" cache directories -- to free up RAM -- but auto-wipe them on mount - "persist" cache directories -- to free up RAM -- but auto-wipe them on mount
and encrypt them to ephemeral keys so they're unreadable post shutdown/unmount. and encrypt them to ephemeral keys so they're unreadable post shutdown/unmount.
- `modules/programs.nix` - `modules/programs/`
- like nixpkgs' `programs` options, but allows both system-wide or per-user deployment. - like nixpkgs' `programs` options, but allows both system-wide or per-user deployment.
- allows `fs` and `persist` config values to be gated behind program deployment: - allows `fs` and `persist` config values to be gated behind program deployment:
- e.g. `/home/<user>/.mozilla/firefox` is persisted only for users who - e.g. `/home/<user>/.mozilla/firefox` is persisted only for users who
`sane.programs.firefox.enableFor.user."<user>" = true;` `sane.programs.firefox.enableFor.user."<user>" = true;`
- allows aggressive sandboxing any program:
- `sane.programs.firefox.sandbox.method = "bwrap"; # sandbox with bubblewrap`
- `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`
- 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.nix`
- 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"`
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.

56
TODO.md
View File

@@ -1,16 +1,14 @@
## BUGS ## BUGS
- ringer (i.e. dino incoming call) doesn't prevent moby from sleeping - ringer (i.e. dino incoming call) doesn't prevent moby from sleeping
- Fractal opens links with non-preferred web browser
- `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`
- waybar isn't visible on moby until after `swaymsg reload`
## REFACTORING: ## REFACTORING:
- consolidate ~/dev and ~/ref
- ~/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
### sops/secrets ### sops/secrets
- attach secrets to the thing they're used by (sane.programs)
- 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
@@ -23,12 +21,10 @@
- bump nodejs version in lemmy-ui - 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 - fix lightdm-mobile-greeter for newer libhandy
- port zecwallet-lite to a from-source build
- 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
- gtk: build schemas even on cross compilation: <https://github.com/NixOS/nixpkgs/pull/247844> - gtk: build schemas even on cross compilation: <https://github.com/NixOS/nixpkgs/pull/247844>
- sxmo: add new app entries
## IMPROVEMENTS: ## IMPROVEMENTS:
@@ -36,23 +32,27 @@
- 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
- have `sane.programs` be wrapped such that they run in a cgroup? - /mnt/desko/home, etc, shouldn't include secrets (~/private)
- at least, only give them access to the portion of the fs they *need*. - 95% of its use is for remote media access and stuff which isn't in VCS (~/records)
- Android takes approach of giving each app its own user: could hack that in here. - port all sane.programs to be sandboxed
- **systemd-run** takes a command and runs it in a temporary scope (cgroup) - enforce that all `environment.packages` has a sandbox profile (or explicitly opts out)
- presumably uses the same options as systemd services - revisit "non-sandboxable" apps and check that i'm not actually just missing mountpoints
- see e.g. <https://github.com/NixOS/nixpkgs/issues/113903#issuecomment-857296349> - LL_FS_RW=/ isn't enough -- need all mount points like `=/:/proc:/sys:...`.
- flatpak does this, somehow - ensure non-bin package outputs are linked for sandboxed apps
- apparmor? SElinux? (desktop) "portals"? - i.e. `outputs.man`, `outputs.debug`, `outputs.doc`, ...
- see Spectrum OS; Alyssa Ross; etc - lock down dbus calls within the sandbox
- bubblewrap-based sandboxing: <https://github.com/nixpak/nixpak> - otherwise anyone can `systemd-run --user ...` to potentially escape a sandbox
- <https://github.com/flatpak/xdg-dbus-proxy>
- remove `.ssh` access from Firefox!
- limit access to `~/knowledge/secrets` through an agent that requires GUI approval, so a firefox exploit can't steal all my logins
- port 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.
- make dconf stuff less monolithic
- i.e. per-app dconf profiles for those which need it. possible static config.
- canaries for important services - canaries for important services
- e.g. daily email checks; daily backup checks - e.g. daily email checks; daily backup checks
- integrate `nix check` into Gitea actions? - integrate `nix check` into Gitea actions?
### faster/better deployments
- remove audacity's dependency on webkitgtk (via wxwidgets)
### user experience ### user experience
- 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/>
@@ -70,14 +70,15 @@
- UnCiv (Civ V clone; nixpkgs `unciv`; doesn't cross-compile): <https://github.com/yairm210/UnCiv> - UnCiv (Civ V clone; nixpkgs `unciv`; doesn't cross-compile): <https://github.com/yairm210/UnCiv>
- Simon Tatham's Puzzle Collection (not in nixpkgs) <https://git.tartarus.org/?p=simon/puzzles.git> - Simon Tatham's Puzzle Collection (not in nixpkgs) <https://git.tartarus.org/?p=simon/puzzles.git>
- Shootin Stars (Godot; not in nixpkgs) <https://gitlab.com/greenbeast/shootin-stars> - Shootin Stars (Godot; not in nixpkgs) <https://gitlab.com/greenbeast/shootin-stars>
- numberlink (generic name for Flow Free). not packaged in Nix
- Neverball (https://neverball.org/screenshots.php). nix: as `neverball`
- blurble (https://linuxphoneapps.org/games/app.drey.blurble/). nix: not as of 2024-02-05
#### 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>
- 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
- also, the album icon when "Not playing" doesn't follow the size we give in the config
- that means mpris always takes up excessive space on moby
- add option to change audio output - add option to change audio output
- fix colors (red alert) to match overall theme - fix colors (red alert) to match overall theme
- moby: tune GPS - moby: tune GPS
@@ -88,15 +89,9 @@
- manually do smoothing, as some layer between mepo and geoclue/gpsd? - manually do smoothing, as some layer between mepo and geoclue/gpsd?
- moby: show battery state on ssh login - moby: show battery state on ssh login
- moby: improve gPodder launch time - moby: improve gPodder launch time
- sxmo: port to swaybar like i use on desktop
- users in #sxmo claim it's way better perf
- sxmo: fix youtube scripts (package youtube-cli)
- moby: theme GTK apps (i.e. non-adwaita styles) - moby: theme GTK apps (i.e. non-adwaita styles)
- combine multiple icon themes to get one which has the full icon set?
- get adwaita-icon-theme to ship everything even when cross-compiled?
- especially, make the menubar collapsible - especially, make the menubar collapsible
- try Gradience tool specifically for theming adwaita? <https://linuxphoneapps.org/apps/com.github.gradienceteam.gradience/> - try Gradience tool specifically for theming adwaita? <https://linuxphoneapps.org/apps/com.github.gradienceteam.gradience/>
- phog: remove the gnome-shell runtime dependency to save hella closure size
#### non-moby #### non-moby
- RSS: integrate a paywall bypass - RSS: integrate a paywall bypass
@@ -118,16 +113,13 @@
- could change junk filter from "no DKIM success" to explicit "DKIM failed" - could change junk filter from "no DKIM success" to explicit "DKIM failed"
### perf ### perf
- 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!
- get moby to build without binfmt emulation (i.e. make all emulation explicit)
- then i can distribute builds across servo + desko, and also allow servo to pull packages from desko w/o worrying about purity
## NEW FEATURES: ## NEW FEATURES:
- migrate MAME cabinet to nix - migrate MAME cabinet to nix
- boot it from PXE from servo? - boot it from PXE from servo?
- deploy to new server, and use it as a remote builder
- enable IPv6 - enable IPv6
- package lemonade lemmy app: <https://linuxphoneapps.org/apps/ml.mdwalters.lemonade/>

BIN
doc/hello.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

143
flake.lock generated
View File

@@ -1,20 +1,20 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-parts": {
"inputs": { "inputs": {
"systems": "systems" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1698882062,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=",
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "flake-parts",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "flake-parts",
"type": "github" "type": "github"
} }
}, },
@@ -35,29 +35,99 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": { "nix-fast-build": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix"
},
"locked": { "locked": {
"lastModified": 1700905716, "lastModified": 1703607026,
"narHash": "sha256-w1vHn2MbGfdC+CrP3xLZ3scsI06N0iQLU7eTHIVEFGw=", "narHash": "sha256-Emh0BPoqlS4ntp2UJrwydXfIP4qIMF0VBB2FUE3/M/E=",
"owner": "Mic92",
"repo": "nix-fast-build",
"rev": "4376b8a33b217ee2f78ba3dcff01a3e464d13a46",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "nix-fast-build",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1698890957,
"narHash": "sha256-DJ+SppjpPBoJr0Aro9TAcP3sxApCSieY6BYBCoWGUX8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dfb95385d21475da10b63da74ae96d89ab352431", "rev": "c082856b850ec60cda9f0a0db2bc7bd8900d708c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "release-23.05", "ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1698611440,
"narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-next-unpatched": {
"locked": {
"lastModified": 1708992120,
"narHash": "sha256-t/8QV+lEroW5fK44w5oEUalIM0eYYVGs833AHDCIl4s=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6daf4de0662e1d895d220a4a4ddb356eb000abe9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "staging-next",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1708819810,
"narHash": "sha256-1KosU+ZFXf31GPeCBNxobZWMgHsSOJcrSFA6F2jhzdE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "89a2a12e6c8c6a56c72eb3589982c8e2f89c70ea",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-23.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unpatched": { "nixpkgs-unpatched": {
"locked": { "locked": {
"lastModified": 1701180790, "lastModified": 1708995544,
"narHash": "sha256-kYWcHsk2A1VUpiOvSo7Pq175WnSVeltspTGM2q+Cr3U=", "narHash": "sha256-YJgLopKOKVTggnKzjX4OiAS22hx/vNv397DcsAyTZgY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c9702bf40b036c0f1d3d5b0aaf3eee2bf920124c", "rev": "5bd8df40204f47a12263f3614c72cd5b6832a9a0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -70,6 +140,8 @@
"root": { "root": {
"inputs": { "inputs": {
"mobile-nixos": "mobile-nixos", "mobile-nixos": "mobile-nixos",
"nix-fast-build": "nix-fast-build",
"nixpkgs-next-unpatched": "nixpkgs-next-unpatched",
"nixpkgs-unpatched": "nixpkgs-unpatched", "nixpkgs-unpatched": "nixpkgs-unpatched",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"uninsane-dot-org": "uninsane-dot-org" "uninsane-dot-org": "uninsane-dot-org"
@@ -83,11 +155,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1701127353, "lastModified": 1708987867,
"narHash": "sha256-qVNX0wOl0b7+I35aRu78xUphOyELh+mtUp1KBx89K1Q=", "narHash": "sha256-k2lDaDWNTU5sBVHanYzjDKVDmk29RHIgdbbXu5sdzBA=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "b1edbf5c0464b4cced90a3ba6f999e671f0af631", "rev": "a1c8de14f60924fafe13aea66b46157f0150f4cf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -96,34 +168,39 @@
"type": "github" "type": "github"
} }
}, },
"systems": { "treefmt-nix": {
"inputs": {
"nixpkgs": [
"nix-fast-build",
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1698438538,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-AWxaKTDL3MtxaVTVU5lYBvSnlspOS0Fjt8GxBgnU0Do=",
"owner": "nix-systems", "owner": "numtide",
"repo": "default", "repo": "treefmt-nix",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "5deb8dc125a9f83b65ca86cf0c8167c46593e0b1",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "numtide",
"repo": "default", "repo": "treefmt-nix",
"type": "github" "type": "github"
} }
}, },
"uninsane-dot-org": { "uninsane-dot-org": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [
"nixpkgs-unpatched" "nixpkgs-unpatched"
] ]
}, },
"locked": { "locked": {
"lastModified": 1699515935, "lastModified": 1707981105,
"narHash": "sha256-cJIuVrYorhIzG5pRFZb+ZtaKhTFD92ThC42SaxvSe/E=", "narHash": "sha256-YCU1eNslBHabjP+OCY+BxPycEFO9SRUts10MrN9QORE=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "8a4273489d945f21d7e0ca6aac952460c7d4c391", "rev": "bb10cd8853d05191e4d62947d93687c462e92c30",
"revCount": 216, "revCount": 235,
"type": "git", "type": "git",
"url": "https://git.uninsane.org/colin/uninsane" "url": "https://git.uninsane.org/colin/uninsane"
}, },

307
flake.nix
View File

@@ -29,7 +29,7 @@
# - daily: # - daily:
# - nixos-unstable cut from master after enough packages have been built in caches. # - nixos-unstable cut from master after enough packages have been built in caches.
# - every 6 hours: # - every 6 hours:
# - master auto-merged into staging. # - master auto-merged into staging and staging-next
# - staging-next auto-merged into staging. # - staging-next auto-merged into staging.
# - manually, approximately once per month: # - manually, approximately once per month:
# - staging-next is cut from staging. # - staging-next is cut from staging.
@@ -44,8 +44,9 @@
# <https://github.com/nixos/nixpkgs/tree/nixos-unstable> # <https://github.com/nixos/nixpkgs/tree/nixos-unstable>
# nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-unstable"; # nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=master"; nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=master";
# nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=staging-next"; # nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-staging";
# nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=staging"; # nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-staging-next";
nixpkgs-next-unpatched.url = "github:nixos/nixpkgs?ref=staging-next";
mobile-nixos = { mobile-nixos = {
# <https://github.com/nixos/mobile-nixos> # <https://github.com/nixos/mobile-nixos>
@@ -56,6 +57,10 @@
url = "github:nixos/mobile-nixos?ref=d25d3b87e7f300d8066e31d792337d9cd7ecd23b"; url = "github:nixos/mobile-nixos?ref=d25d3b87e7f300d8066e31d792337d9cd7ecd23b";
flake = false; flake = false;
}; };
nix-fast-build = {
# https://github.com/Mic92/nix-fast-build
url = "github:Mic92/nix-fast-build";
};
sops-nix = { sops-nix = {
# <https://github.com/Mic92/sops-nix> # <https://github.com/Mic92/sops-nix>
# used to distribute secrets to my hosts # used to distribute secrets to my hosts
@@ -74,7 +79,9 @@
outputs = { outputs = {
self, self,
nixpkgs-unpatched, nixpkgs-unpatched,
nixpkgs-next-unpatched ? nixpkgs-unpatched,
mobile-nixos, mobile-nixos,
nix-fast-build,
sops-nix, sops-nix,
uninsane-dot-org, uninsane-dot-org,
... ...
@@ -92,39 +99,49 @@
# rather than apply our nixpkgs patches as a flake input, do that here instead. # rather than apply our nixpkgs patches as a flake input, do that here instead.
# this (temporarily?) resolves the bad UX wherein a subflake residing in the same git # this (temporarily?) resolves the bad UX wherein a subflake residing in the same git
# repo as the main flake causes the main flake to have an unstable hash. # repo as the main flake causes the main flake to have an unstable hash.
nixpkgs = (import ./nixpatches/flake.nix).outputs { patchNixpkgs = variant: nixpkgs: (import ./nixpatches/flake.nix).outputs {
self = nixpkgs; inherit variant nixpkgs;
nixpkgs = nixpkgs-unpatched; self = patchNixpkgs variant nixpkgs;
} // { } // {
# provide values that nixpkgs ordinarily sources from the flake.lock file, # sourceInfo includes fields (square brackets for the ones which are not always present):
# inaccessible to it here because of the import-from-derivation. # - [dirtyRev]
# rev and shortRev seem to not always exist (e.g. if the working tree is dirty), # - [dirtyShortRev]
# so those are made conditional. # - lastModified
# - lastModifiedDate
# - narHash
# - outPath
# - [rev]
# - [revCount]
# - [shortRev]
# - submodules
# #
# these values impact the name of a produced nixos system. having date/rev in the # these values are used within nixpkgs:
# `readlink /run/current-system` store path helps debuggability. # - to give a friendly name to the nixos system (`readlink /run/current-system` -> `...nixos-system-desko-24.05.20240227.dirty`)
inherit (self) lastModifiedDate lastModified; # - to alias `import <nixpkgs>` so that nix uses the system's nixpkgs when called externally (supposedly).
} // optionalAttrs (self ? rev) { #
inherit (self) rev; # these values seem to exist both within the `sourceInfo` attrset and at the top-level.
} // optionalAttrs (self ? shortRev) { # for a list of all implicit flake outputs (which is what these seem to be):
inherit (self) shortRev; # $ nix-repl
}; # > lf .
# > <tab>
inherit (self) sourceInfo;
} // self.sourceInfo;
nixpkgsCompiledBy = system: nixpkgs.legacyPackages."${system}"; nixpkgs' = patchNixpkgs "master" nixpkgs-unpatched;
nixpkgsCompiledBy = system: nixpkgs'.legacyPackages."${system}";
evalHost = { name, local, target, light ? false }: nixpkgs.lib.nixosSystem { evalHost = { name, local, target, light ? false, nixpkgs ? nixpkgs' }: nixpkgs.lib.nixosSystem {
system = target; system = target;
modules = [ modules = [
{ {
nixpkgs = (if (local != null) then { nixpkgs.buildPlatform.system = local;
buildPlatform = local;
} else {}) // {
# TODO: does the earlier `system` arg to nixosSystem make its way here?
hostPlatform.system = target;
};
# nixpkgs.buildPlatform = local; # set by instantiate.nix instead
# nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv; # nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv;
} }
(optionalAttrs (local != target) {
# XXX(2023/12/11): cache.nixos.org uses `system = ...` instead of `hostPlatform.system`, and that choice impacts the closure of every package.
# so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches.
nixpkgs.hostPlatform.system = target;
})
(optionalAttrs light { (optionalAttrs light {
sane.enableSlowPrograms = false; sane.enableSlowPrograms = false;
}) })
@@ -140,39 +157,24 @@
]; ];
}; };
in { in {
nixosConfigurations = nixosConfigurations = let
let 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"; light = true; }; 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"; light = true; }; 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"; light = true; }; 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: {
# cross-compiled builds: instead of emulating the host, build using a cross-compiler. name = "${h}-next";
# - these are faster to *build* than the emulated variants (useful when tweaking packages), value = v // { nixpkgs = patchNixpkgs "staging-next" nixpkgs-next-unpatched; };
# - but fewer of their packages can be found in upstream caches. }) hosts;
cross = mapAttrValues evalHost hosts; in mapAttrValues evalHost (
emulated = mapAttrValues hosts // hostsNext
(args: evalHost (args // { local = null; })) );
hosts;
prefixAttrs = prefix: attrs: mapAttrs'
(name: value: {
name = prefix + name;
inherit value;
})
attrs;
in
(prefixAttrs "cross-" cross) //
(prefixAttrs "emulated-" emulated) // {
# prefer native builds for these machines:
inherit (emulated) servo desko desko-light lappy lappy-light rescue;
# prefer cross-compiled builds for these machines:
inherit (cross) moby moby-light;
};
# unofficial output # unofficial output
# this produces a EFI-bootable .img file (GPT with a /boot partition and a system (/ or /nix) partition). # this produces a EFI-bootable .img file (GPT with a /boot partition and a system (/ or /nix) partition).
@@ -192,25 +194,29 @@
# unofficial output # unofficial output
hostConfigs = mapAttrValues (host: host.config) self.nixosConfigurations; hostConfigs = mapAttrValues (host: host.config) self.nixosConfigurations;
hostSystems = mapAttrValues (host: host.config.system.build.toplevel) self.nixosConfigurations;
hostPkgs = mapAttrValues (host: host.config.system.build.pkgs) self.nixosConfigurations; hostPkgs = mapAttrValues (host: host.config.system.build.pkgs) self.nixosConfigurations;
hostPrograms = mapAttrValues (host: mapAttrValues (p: p.package) host.config.sane.programs) self.nixosConfigurations; hostPrograms = mapAttrValues (host: mapAttrValues (p: p.package) host.config.sane.programs) self.nixosConfigurations;
patched.nixpkgs = nixpkgs';
overlays = { overlays = {
# N.B.: `nix flake check` requires every overlay to take `final: prev:` at defn site, # N.B.: `nix flake check` requires every overlay to take `final: prev:` at defn site,
# hence the weird redundancy. # hence the weird redundancy.
default = final: prev: self.overlays.pkgs final prev; default = final: prev: self.overlays.pkgs final prev;
sane-all = final: prev: import ./overlays/all.nix final prev; sane-all = final: prev: import ./overlays/all.nix final prev;
disable-flakey-tests = final: prev: import ./overlays/disable-flakey-tests.nix final prev;
pkgs = final: prev: import ./overlays/pkgs.nix final prev; pkgs = final: prev: import ./overlays/pkgs.nix final prev;
pins = final: prev: import ./overlays/pins.nix final prev; pins = final: prev: import ./overlays/pins.nix final prev;
preferences = final: prev: import ./overlays/preferences.nix final prev; preferences = final: prev: import ./overlays/preferences.nix final prev;
optimizations = final: prev: import ./overlays/optimizations.nix final prev;
passthru = final: prev: passthru = final: prev:
let let
mobile = (import "${mobile-nixos}/overlay/overlay.nix"); mobile = (import "${mobile-nixos}/overlay/overlay.nix");
uninsane = uninsane-dot-org.overlay; uninsane = uninsane-dot-org.overlays.default;
# TODO: why do i have to use `self.inputs.nix-fast-build` instead of just `nix-fast-build` here?
nix-fast-build = (_: prev: self.inputs.nix-fast-build.packages."${prev.stdenv.system}" or {});
in in
(mobile final prev) (mobile final prev)
// (nix-fast-build final prev)
// (uninsane final prev) // (uninsane final prev)
; ;
}; };
@@ -239,23 +245,27 @@
# extract only our own packages from the full set. # extract only our own packages from the full set.
# because of `nix flake check`, we flatten the package set and only surface x86_64-linux packages. # because of `nix flake check`, we flatten the package set and only surface x86_64-linux packages.
packages = mapAttrs packages = mapAttrs
(system: allPkgs: (system: passthruPkgs: passthruPkgs.lib.filterAttrs
allPkgs.lib.filterAttrs (name: pkg: (name: pkg:
# keep only packages which will pass `nix flake check`, i.e. keep only: # keep only packages which will pass `nix flake check`, i.e. keep only:
# - derivations (not package sets) # - derivations (not package sets)
# - packages that build for the given platform # - packages that build for the given platform
(! elem name [ "feeds" "pythonPackagesExtensions" ]) (! elem name [ "feeds" "pythonPackagesExtensions" ])
&& (allPkgs.lib.meta.availableOn allPkgs.stdenv.hostPlatform pkg) && (passthruPkgs.lib.meta.availableOn passthruPkgs.stdenv.hostPlatform pkg)
) )
( (
# expose sane packages and chosen inputs (uninsane.org) # expose sane packages and chosen inputs (uninsane.org)
(import ./pkgs { pkgs = allPkgs; }) // { (import ./pkgs { pkgs = passthruPkgs; }) // {
inherit (allPkgs) uninsane-dot-org; inherit (passthruPkgs) uninsane-dot-org;
} }
) )
) )
# self.legacyPackages; # self.legacyPackages;
{ inherit (self.legacyPackages) x86_64-linux; } {
x86_64-linux = (nixpkgsCompiledBy "x86_64-linux").appendOverlays [
self.overlays.passthru
];
}
; ;
apps."x86_64-linux" = apps."x86_64-linux" =
@@ -263,13 +273,43 @@
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}" ''
nix build '.#nixosConfigurations.${host}.config.system.build.toplevel' --out-link ./result-${host} $@ host="${host}"
sudo nix sign-paths -r -k /run/secrets/nix_serve_privkey $(readlink ./result-${host}) addr="${addr}"
action="${if action != null then action else ""}"
runOnTarget() {
# run the command ($@) on the machine we're deploying to.
# if that's a remote machine, then do it via ssh, else local shell.
if [ -n "$addr" ]; then
ssh "$addr" "$@"
else
"$@"
fi
}
# XXX: this triggers another config eval & (potentially) build. nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --out-link "./result-$host" "$@"
# if the config changed between these invocations, the above signatures might not apply to the deployed config. storePath="$(readlink ./result-$host)"
# let the user handle that edge case by re-running this whole command
nixos-rebuild --flake '.#${host}' ${action} --target-host colin@${addr} --use-remote-sudo $@ # mimic `nixos-rebuild --target-host`, in effect:
# - nix-copy-closure ...
# - nix-env --set ...
# - switch-to-configuration <boot|dry-activate|switch|test|>
# avoid the actual `nixos-rebuild` for a few reasons:
# - fewer nix evals
# - more introspectability and debuggability
# - sandbox friendliness (especially: `git` doesn't have to be run as root)
if [ -n "$addr" ]; then
sudo nix store sign -r -k /run/secrets/nix_serve_privkey "$storePath"
# add more `-v` for more verbosity (up to 5).
# builders-use-substitutes false: optimizes so that the remote machine doesn't try to get paths from its substituters.
# we already have all paths here, and the remote substitution is slow to check and SERIOUSLY flaky on moby in particular.
nix copy -vv --option builders-use-substitutes false --to "ssh-ng://$addr" "$storePath"
fi
if [ -n "$action" ]; then
runOnTarget sudo nix-env -p /nix/var/nix/profiles/system --set "$storePath"
runOnTarget sudo "$storePath/bin/switch-to-configuration" "$action"
fi
''; '';
deployApp = host: addr: action: { deployApp = host: addr: action: {
type = "app"; type = "app";
@@ -343,7 +383,11 @@
- `nix run '.#update.feeds'` - `nix run '.#update.feeds'`
- updates metadata for all feeds - updates metadata for all feeds
- `nix run '.#init-feed' <url>` - `nix run '.#init-feed' <url>`
- `nix run '.#deploy.{desko,lappy,moby,servo}[-light][.test]' [nixos-rebuild args ...]` - `nix run '.#deploy.{desko,lappy,moby,servo}[-light|-test]' [nix args ...]`
- build and deploy the host
- `nix run '.#preDeploy.{desko,lappy,moby,servo}[-light]' [nix args ...]`
- copy closures to a host, but don't activate it
- 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
@@ -372,31 +416,92 @@
}; };
deploy = { deploy = {
desko = deployApp "desko" "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";
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-test = deployApp "moby" "moby" "test"; moby-test = deployApp "moby" "moby" "test";
servo = deployApp "servo" "servo" "switch"; servo = deployApp "servo" "servo" "switch";
};
sync-moby = { # like `nixos-rebuild --flake . switch`
# copy music from the current device to moby self = deployApp "$(hostname)" "" "switch";
# TODO: should i actually sync from /mnt/servo-media/Music instead of the local drive? self-light = deployApp "$(hostname)-light" "" "switch";
type = "app"; type = "app";
program = builtins.toString (pkgs.writeShellScript "sync-to-moby" '' program = builtins.toString (pkgs.writeShellScript "deploy-all" ''
sudo mount /mnt/moby-home nix run '.#deploy.lappy'
${pkgs.sane-scripts.sync-music}/bin/sane-sync-music ~/Music /mnt/moby-home/Music nix run '.#deploy.moby'
nix run '.#deploy.desko'
nix run '.#deploy.servo'
'');
};
preDeploy = {
# build the host and copy the runtime closure to that host, but don't activate it.
desko = deployApp "desko" "desko" null;
desko-light = deployApp "desko-light" "desko" null;
lappy = deployApp "lappy" "lappy" null;
lappy-light = deployApp "lappy-light" "lappy" null;
moby = deployApp "moby" "moby" null;
moby-light = deployApp "moby-light" "moby" null;
servo = deployApp "servo" "servo" null;
type = "app";
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.
nix run '.#preDeploy.moby-light' -- "$@"
nix run '.#preDeploy.lappy-light' -- "$@"
nix run '.#preDeploy.desko-light' -- "$@"
nix run '.#preDeploy.lappy' -- "$@"
nix run '.#preDeploy.servo' -- "$@"
nix run '.#preDeploy.moby' -- "$@"
nix run '.#preDeploy.desko' -- "$@"
''); '');
}; };
sync-lappy = { sync = {
type = "app";
program = builtins.toString (pkgs.writeShellScript "sync-all" ''
RC_lappy=$(nix run '.#sync.lappy' -- "$@")
RC_moby=$(nix run '.#sync.moby' -- "$@")
RC_desko=$(nix run '.#sync.desko' -- "$@")
echo "lappy: $RC_lappy"
echo "moby: $RC_moby"
echo "desko: $RC_desko"
'');
};
sync.desko = {
# copy music from servo to desko
# can run this from any device that has ssh access to desko and servo
type = "app";
program = builtins.toString (pkgs.writeShellScript "sync-to-desko" ''
sudo mount /mnt/desko/home
${pkgs.sane-scripts.sync-music}/bin/sane-sync-music --compat /mnt/servo/media/Music /mnt/desko/home/Music "$@"
'');
};
sync.lappy = {
# copy music from servo to lappy # copy music from servo to lappy
# can run this from any device that has ssh access to lappy # can run this from any device that has ssh access to lappy and servo
type = "app"; type = "app";
program = builtins.toString (pkgs.writeShellScript "sync-to-lappy" '' program = builtins.toString (pkgs.writeShellScript "sync-to-lappy" ''
sudo mount /mnt/lappy-home sudo mount /mnt/lappy/home
${pkgs.sane-scripts.sync-music}/bin/sane-sync-music /mnt/servo-media/Music /mnt/lappy-home/Music ${pkgs.sane-scripts.sync-music}/bin/sane-sync-music --compress --compat /mnt/servo/media/Music /mnt/lappy/home/Music "$@"
'');
};
sync.moby = {
# copy music from servo to moby
# can run this from any device that has ssh access to moby and servo
type = "app";
program = builtins.toString (pkgs.writeShellScript "sync-to-moby" ''
sudo mount /mnt/moby/home
sudo mount /mnt/desko/home
${pkgs.rsync}/bin/rsync -arv --exclude servo-macros /mnt/moby/home/Pictures/ /mnt/desko/home/Pictures/moby/
# N.B.: limited by network/disk -> reduce job count to improve pause/resume behavior
${pkgs.sane-scripts.sync-music}/bin/sane-sync-music --compress --compat --jobs 4 /mnt/servo/media/Music /mnt/moby/home/Music "$@"
''); '');
}; };
@@ -405,12 +510,12 @@
program = builtins.toString (pkgs.writeShellScript "check-all" '' program = builtins.toString (pkgs.writeShellScript "check-all" ''
nix run '.#check.nur' nix run '.#check.nur'
RC0=$? RC0=$?
nix run '.#check.host-configs' nix run '.#check.hostConfigs'
RC1=$? RC1=$?
nix run '.#check.rescue' nix run '.#check.rescue'
RC2=$? RC2=$?
echo "nur: $RC0" echo "nur: $RC0"
echo "host-configs: $RC1" echo "hostConfigs: $RC1"
echo "rescue: $RC2" echo "rescue: $RC2"
exit $(($RC0 | $RC1 | $RC2)) exit $(($RC0 | $RC1 | $RC2))
''); '');
@@ -427,19 +532,19 @@
--option restrict-eval true \ --option restrict-eval true \
--option allow-import-from-derivation true \ --option allow-import-from-derivation true \
--drv-path --show-trace \ --drv-path --show-trace \
-I nixpkgs=$(nix-instantiate --find-file nixpkgs) \ -I nixpkgs=${nixpkgs-unpatched} \
-I ../../ \ -I ../../ \
| tee # tee to prevent interactive mode | tee # tee to prevent interactive mode
''); '');
}; };
check.host-configs = { check.hostConfigs = {
type = "app"; type = "app";
program = let program = let
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 ./result-${host} -j2 "$@"
RC_${shellHost}=$? RC_${shellHost}=$?
''; '';
in builtins.toString (pkgs.writeShellScript in builtins.toString (pkgs.writeShellScript
@@ -457,11 +562,29 @@
${checkHost "moby"} ${checkHost "moby"}
${checkHost "rescue"} ${checkHost "rescue"}
# still want to build the -light variants first so as to avoid multiple simultaneous webkitgtk builds
${checkHost "desko-light-next"}
${checkHost "moby-light-next"}
${checkHost "desko-next"}
${checkHost "lappy-next"}
${checkHost "servo-next"}
${checkHost "moby-next"}
${checkHost "rescue-next"}
echo "desko: $RC_desko" echo "desko: $RC_desko"
echo "lappy: $RC_lappy" echo "lappy: $RC_lappy"
echo "servo: $RC_servo" echo "servo: $RC_servo"
echo "moby: $RC_moby" echo "moby: $RC_moby"
echo "rescue: $RC_rescue" echo "rescue: $RC_rescue"
echo "desko-next: $RC_desko_next"
echo "lappy-next: $RC_lappy_next"
echo "servo-next: $RC_servo_next"
echo "moby-next: $RC_moby_next"
echo "rescue-next: $RC_rescue_next"
# i don't really care if the -next hosts fail. i build them mostly to keep the cache fresh/ready
exit $(($RC_desko | $RC_lappy | $RC_servo | $RC_moby | $RC_rescue)) exit $(($RC_desko | $RC_lappy | $RC_servo | $RC_moby | $RC_rescue))
'' ''
); );

View File

@@ -9,6 +9,9 @@
# services.distccd.enable = true; # services.distccd.enable = true;
# sane.programs.distcc.enableFor.user.guest = true; # sane.programs.distcc.enableFor.user.guest = true;
# TODO: remove emulation, but need to fix nixos-rebuild to moby for that.
# sane.roles.build-machine.emulation = true;
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;
sane.ports.openFirewall = true; # for e.g. nix-serve sane.ports.openFirewall = true; # for e.g. nix-serve
@@ -25,14 +28,14 @@
sane.nixcache.substituters.desko = false; sane.nixcache.substituters.desko = false;
sane.nixcache.remote-builders.desko = false; sane.nixcache.remote-builders.desko = false;
sane.gui.sway.enable = true; sane.programs.sway.enableFor.user.colin = true;
sane.programs.iphoneUtils.enableFor.user.colin = true; sane.programs.iphoneUtils.enableFor.user.colin = true;
sane.programs.steam.enableFor.user.colin = true; sane.programs.steam.enableFor.user.colin = true;
# sane.programs.devPkgs.enableFor.user.colin = true; # sane.programs.devPkgs.enableFor.user.colin = true;
sane.programs.signal-desktop.config.autostart = true;
sane.programs."gnome.geary".config.autostart = true; sane.programs."gnome.geary".config.autostart = true;
sane.programs.signal-desktop.config.autostart = true;
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 ];

View File

@@ -6,7 +6,6 @@
fileSystems."/tmp".options = [ "size=64G" ]; fileSystems."/tmp".options = [ "size=64G" ];
fileSystems."/nix" = { fileSystems."/nix" = {
# device = "/dev/disk/by-uuid/0ab0770b-7734-4167-88d9-6e4e20bb2a56";
device = "/dev/disk/by-uuid/845d85bf-761d-431b-a406-e6f20909154f"; device = "/dev/disk/by-uuid/845d85bf-761d-431b-a406-e6f20909154f";
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
@@ -16,7 +15,6 @@
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
# device = "/dev/disk/by-uuid/41B6-BAEF";
device = "/dev/disk/by-uuid/5049-9AFD"; device = "/dev/disk/by-uuid/5049-9AFD";
fsType = "vfat"; fsType = "vfat";
}; };

View File

@@ -12,10 +12,12 @@
sane.services.wg-home.ip = config.sane.hosts.by-name."lappy".wg-home.ip; sane.services.wg-home.ip = config.sane.hosts.by-name."lappy".wg-home.ip;
# sane.guest.enable = true; # sane.guest.enable = true;
sane.gui.sway.enable = true;
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.sway.enableFor.user.colin = true;
sane.programs."gnome.geary".config.autostart = true;
sane.programs.signal-desktop.config.autostart = true;
sane.programs.stepmania.enableFor.user.colin = true; sane.programs.stepmania.enableFor.user.colin = true;
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;

View File

@@ -14,24 +14,4 @@
device = "/dev/disk/by-uuid/BD79-D6BB"; device = "/dev/disk/by-uuid/BD79-D6BB";
fsType = "vfat"; fsType = "vfat";
}; };
# fileSystems."/nix" = {
# device = "/dev/disk/by-uuid/5a7fa69c-9394-8144-a74c-6726048b129f";
# fsType = "btrfs";
# };
# fileSystems."/boot" = {
# device = "/dev/disk/by-uuid/4302-1685";
# fsType = "vfat";
# };
# fileSystems."/" = {
# device = "none";
# fsType = "tmpfs";
# options = [
# "mode=755"
# "size=1G"
# "defaults"
# ];
# };
} }

View File

@@ -3,7 +3,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.gui.sxmo = { sane.gui.sxmo = {
greeter = "greetd-sway-gtkgreet";
noidle = true; #< power button requires 1s hold, which makes it impractical to be dealing with. noidle = true; #< power button requires 1s hold, which makes it impractical to be dealing with.
settings = { settings = {
# XXX: make sure the user is part of the `input` group! # XXX: make sure the user is part of the `input` group!
@@ -22,7 +21,6 @@
# the device type informs (at least): # the device type informs (at least):
# - SXMO_WIFI_MODULE # - SXMO_WIFI_MODULE
# - SXMO_RTW_SCAN_INTERVAL # - SXMO_RTW_SCAN_INTERVAL
# - SXMO_SYS_FILES
# - SXMO_TOUCHSCREEN_ID # - SXMO_TOUCHSCREEN_ID
# - SXMO_MONITOR # - SXMO_MONITOR
# - SXMO_ALSA_CONTROL_NAME # - SXMO_ALSA_CONTROL_NAME

View File

@@ -25,10 +25,14 @@
sane.services.wg-home.enable = true; sane.services.wg-home.enable = true;
sane.services.wg-home.ip = config.sane.hosts.by-name."moby".wg-home.ip; sane.services.wg-home.ip = config.sane.hosts.by-name."moby".wg-home.ip;
# for some reason desko -> moby deploys are super flaky when desko is also a nixcache (not true of desko -> lappy deploys, though!)
# > unable to download 'http://desko:5001/<hash>.narinfo': Server returned nothing (no headers, no data) (52)
sane.nixcache.substituters.desko = false;
# XXX colin: phosh doesn't work well with passwordless login, # XXX colin: phosh doesn't work well with passwordless login,
# so set this more reliable default password should anything go wrong # so set this more reliable default password should anything go wrong
users.users.colin.initialPassword = "147147"; users.users.colin.initialPassword = "147147";
services.getty.autologinUser = "root"; # allows for emergency maintenance? # services.getty.autologinUser = "root"; # allows for emergency maintenance?
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;
@@ -36,7 +40,6 @@
# sane.programs.consoleUtils.enableFor.user.colin = false; # sane.programs.consoleUtils.enableFor.user.colin = false;
# sane.programs.guiApps.enableFor.user.colin = false; # sane.programs.guiApps.enableFor.user.colin = false;
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.dialect.enableFor.user.colin = false; # drags in 700MB of x86 dependencies (e.g. gtk4)
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)
@@ -46,7 +49,7 @@
# sane.programs.ntfy-sh.config.autostart = true; # sane.programs.ntfy-sh.config.autostart = true;
sane.programs.dino.config.autostart = true; sane.programs.dino.config.autostart = true;
sane.programs.signal-desktop.config.autostart = true; # sane.programs.signal-desktop.config.autostart = 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.mpv.config.vo = "wlshm"; #< see hosts/common/programs/mpv.nix for details

View File

@@ -74,6 +74,7 @@ in
# without this some GUI apps fail: `DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory` # without this some GUI apps fail: `DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory`
# this is because they can't allocate enough video ram. # this is because they can't allocate enough video ram.
# see related nixpkgs issue: <https://github.com/NixOS/nixpkgs/issues/260222> # see related nixpkgs issue: <https://github.com/NixOS/nixpkgs/issues/260222>
# TODO(2023/12/03): remove once mesa 23.3.1 lands: <https://github.com/NixOS/nixpkgs/pull/265740>
# #
# the default CMA seems to be 32M. # the default CMA seems to be 32M.
# i was running fine with 256MB from 2022/07-ish through 2022/12-ish, but then the phone quit reliably coming back from sleep (phosh): maybe a memory leak? # i was running fine with 256MB from 2022/07-ish through 2022/12-ish, but then the phone quit reliably coming back from sleep (phosh): maybe a memory leak?

View File

@@ -15,9 +15,9 @@
}; };
sane.roles.build-machine.enable = true; sane.roles.build-machine.enable = true;
sane.roles.build-machine.emulation = false;
sane.zsh.showDeadlines = false; # ~/knowledge doesn't always exist sane.zsh.showDeadlines = false; # ~/knowledge doesn't always exist
sane.programs.consoleUtils.suggestedPrograms = [ sane.programs.consoleUtils.suggestedPrograms = [
"consoleMediaUtils" # notably, for go2tv / casting
"pcConsoleUtils" "pcConsoleUtils"
"sane-scripts.stop-all-servo" "sane-scripts.stop-all-servo"
]; ];

View File

@@ -1,6 +1,58 @@
# zfs docs:
# - <https://nixos.wiki/wiki/ZFS>
# - <repo:nixos/nixpkgs:nixos/modules/tasks/filesystems/zfs.nix>
#
# zfs check health: `zpool status`
#
# zfs pool creation (requires `boot.supportedFilesystems = [ "zfs" ];`
# - 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`
# - legacy documented: <https://superuser.com/questions/790036/what-is-a-zfs-legacy-mount-point>
#
# import pools: `zpool import pool`
# show zfs datasets: `zfs list` (will be empty if haven't imported)
# show zfs properties (e.g. compression): `zfs get all pool`
# set zfs properties: `zfs set compression=on pool`
{ ... }: { ... }:
{ {
# hostId: not used for anything except zfs guardrail?
# [hex(ord(x)) for x in 'serv']
networking.hostId = "73657276";
boot.supportedFilesystems = [ "zfs" ];
# boot.zfs.enabled = true;
boot.zfs.forceImportRoot = false;
# scrub all zfs pools weekly:
services.zfs.autoScrub.enable = true;
boot.extraModprobeConfig = ''
# 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
# see: <https://askubuntu.com/a/1290387>
# see: <https://serverfault.com/a/1119083>
# see: <https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Module%20Parameters.html#zfs-arc-max>
# for all tunables, see: `man 4 zfs`
# to update these parameters without rebooting:
# - `echo '4294967296' | sane-sudo-redirect /sys/module/zfs/parameters/zfs_arc_max`
options zfs zfs_arc_max=4294967296
'';
# 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.
# - `zfs set mountpoint=legacy pool`
# if done correctly, the pool can be mounted before this `fileSystems` entry is created:
# - `sudo mount -t zfs pool /mnt/persist/pool`
fileSystems."/mnt/pool" = {
device = "pool";
fsType = "zfs";
};
# services.zfs.zed = ... # TODO: zfs can send me emails when disks fail
sane.programs.sysadminUtils.suggestedPrograms = [ "zfs" ];
sane.persist.stores."ext" = {
origin = "/mnt/pool/persist";
storeDescription = "external HDD storage";
defaultMethod = "bind"; #< TODO: change to "symlink"?
};
# increase /tmp space (defaults to 50% of RAM) for building large nix things. # increase /tmp space (defaults to 50% of RAM) for building large nix things.
# even the stock `nixpkgs.linux` consumes > 16 GB of tmp # even the stock `nixpkgs.linux` consumes > 16 GB of tmp
fileSystems."/tmp".options = [ "size=32G" ]; fileSystems."/tmp".options = [ "size=32G" ];
@@ -20,7 +72,7 @@
}; };
# slow, external storage (for archiving, etc) # slow, external storage (for archiving, etc)
fileSystems."/mnt/persist/ext" = { fileSystems."/mnt/usb-hdd" = {
device = "/dev/disk/by-uuid/aa272cff-0fcc-498e-a4cb-0d95fb60631b"; device = "/dev/disk/by-uuid/aa272cff-0fcc-498e-a4cb-0d95fb60631b";
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
@@ -28,22 +80,18 @@
"defaults" "defaults"
]; ];
}; };
sane.fs."/mnt/usb-hdd".mount = {};
sane.persist.stores."ext" = {
origin = "/mnt/persist/ext/persist";
storeDescription = "external HDD storage";
};
sane.fs."/mnt/persist/ext".mount = {};
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
# TODO: this is overly broad; only need media and share directories to be persisted # TODO: this is overly broad; only need media and share directories to be persisted
{ user = "colin"; group = "users"; path = "/var/lib/uninsane"; } { user = "colin"; group = "users"; path = "/var/lib/uninsane"; method = "bind"; }
]; ];
# force some problematic directories to always get correct permissions: # force some problematic directories to always get correct permissions:
sane.fs."/var/lib/uninsane/media".dir.acl = { sane.fs."/var/lib/uninsane/media".dir.acl = {
user = "colin"; group = "media"; mode = "0775"; user = "colin"; group = "media"; mode = "0775";
}; };
sane.fs."/var/lib/uninsane/media/archive".dir = {}; sane.fs."/var/lib/uninsane/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)
sane.fs."/var/lib/uninsane/media/archive/README.md".file.text = '' sane.fs."/var/lib/uninsane/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.
@@ -62,6 +110,7 @@
sane.fs."/var/lib/uninsane/media/Videos/Film".dir = {}; sane.fs."/var/lib/uninsane/media/Videos/Film".dir = {};
sane.fs."/var/lib/uninsane/media/Videos/Shows".dir = {}; sane.fs."/var/lib/uninsane/media/Videos/Shows".dir = {};
sane.fs."/var/lib/uninsane/media/Videos/Talks".dir = {}; sane.fs."/var/lib/uninsane/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)
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.

View File

@@ -24,61 +24,12 @@ in
sane.ports.openFirewall = true; sane.ports.openFirewall = true;
sane.ports.openUpnp = true; sane.ports.openUpnp = true;
# view refused packets with: `sudo journalctl -k`
# networking.firewall.logRefusedPackets = true;
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.eth0.useDHCP = true;
# XXX colin: probably don't need this. wlan0 won't be populated unless i touch a value in networking.interfaces.wlan0
networking.wireless.enable = false;
# this is needed to forward packets from the VPN to the host
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
# unless we add interface-specific settings for each VPN, we have to define nameservers globally. # unless we add interface-specific settings for each VPN, we have to define nameservers globally.
# networking.nameservers = [ # networking.nameservers = [
# "1.1.1.1" # "1.1.1.1"
# "9.9.9.9" # "9.9.9.9"
# ]; # ];
# use systemd's stub resolver.
# /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
# in the 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?)
# there also seems to be some cache somewhere that's shared between the two namespaces.
# i think this is a libc thing. might need to leverage proper cgroups to _really_ kill it.
# - getent ahostsv4 www.google.com
# - try fix: <https://serverfault.com/questions/765989/connect-to-3rd-party-vpn-server-but-dont-use-it-as-the-default-route/766290#766290>
services.resolved.enable = true;
# without DNSSEC:
# - dig matrix.org => works
# - curl https://matrix.org => works
# with default DNSSEC:
# - dig matrix.org => works
# - curl https://matrix.org => fails
# i don't know why. this might somehow be interfering with the DNS run on this device (trust-dns)
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"
];
# nscd -- the Name Service Caching Daemon -- caches DNS query responses
# in a way that's unaware of my VPN routing, so routes are frequently poor against
# services which advertise different IPs based on geolocation.
# nscd claims to be usable without a cache, but in practice i can't get it to not cache!
# nsncd is the Name Service NON-Caching Daemon. it's a drop-in that doesn't cache;
# this is OK on the host -- because systemd-resolved caches. it's probably sub-optimal
# in the netns and we query upstream DNS more often than needed. hm.
# TODO: run a separate recursive resolver in each namespace.
services.nscd.enableNsncd = true;
# services.resolved.extraConfig = '' # services.resolved.extraConfig = ''
# # docs: `man resolved.conf` # # docs: `man resolved.conf`
# # DNS servers to use via the `wg-ovpns` interface. # # DNS servers to use via the `wg-ovpns` interface.

View File

@@ -13,7 +13,7 @@ in
lib.mkIf false lib.mkIf false
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ inherit user group; mode = "0700"; path = svc-dir; } { inherit user group; mode = "0700"; path = svc-dir; method = "bind"; }
]; ];
services.calibre-web.enable = true; services.calibre-web.enable = true;

View File

@@ -0,0 +1,83 @@
# as of 2023/12/02: complete blockchain is 530 GiB (on-disk size may be larger)
#
# ports:
# - 8333: for node-to-node communications
# - 8332: rpc (client-to-node)
#
# rpc setup:
# - generate a password
# - use: <https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py>
# (rpcauth.py is not included in the `'.#bitcoin'` package result)
# - `wget https://raw.githubusercontent.com/bitcoin/bitcoin/master/share/rpcauth/rpcauth.py`
# - `python ./rpcauth.py colin`
# - copy the hash here. it's SHA-256, so safe to be public.
# - add "rpcuser=colin" and "rpcpassword=<output>" to secrets/servo/bitcoin.conf (i.e. ~/.bitcoin/bitcoin.conf)
# - bitcoin.conf docs: <https://github.com/bitcoin/bitcoin/blob/master/doc/bitcoin-conf.md>
# - validate with `bitcoin-cli -netinfo`
{ config, lib, pkgs, sane-lib, ... }:
let
# wrapper to run bitcoind with the tor onion address as externalip (computed at runtime)
_bitcoindWithExternalIp = with pkgs; writeShellScriptBin "bitcoind" ''
externalip="$(cat /var/lib/tor/onion/bitcoind/hostname)"
exec ${bitcoind}/bin/bitcoind "-externalip=$externalip" "$@"
'';
# the package i provide to services.bitcoind ends up on system PATH, and used by other tools like clightning.
# therefore, even though services.bitcoind only needs `bitcoind` binary, provide all the other bitcoin-related binaries (notably `bitcoin-cli`) as well:
bitcoindWithExternalIp = with pkgs; symlinkJoin {
name = "bitcoind-with-external-ip";
paths = [ _bitcoindWithExternalIp bitcoind ];
};
in
{
sane.persist.sys.byStore.ext = [
{ user = "bitcoind-mainnet"; group = "bitcoind-mainnet"; path = "/var/lib/bitcoind-mainnet"; method = "bind"; }
];
# sane.ports.ports."8333" = {
# # this allows other nodes and clients to download blocks from me.
# protocol = [ "tcp" ];
# visibleTo.wan = true;
# description = "colin-bitcoin";
# };
services.tor.relay.onionServices.bitcoind = {
version = 3;
map = [{
# by default tor will route public tor port P to 127.0.0.1:P.
# so if this port is the same as clightning would natively use, then no further config is needed here.
# see: <https://2019.www.torproject.org/docs/tor-manual.html.en#HiddenServicePort>
port = 8333;
# target.port; target.addr; #< set if tor port != clightning port
}];
# allow "tor" group (i.e. bitcoind-mainnet) to read /var/lib/tor/onion/bitcoind/hostname
settings.HiddenServiceDirGroupReadable = true;
};
services.bitcoind.mainnet = {
enable = true;
package = bitcoindWithExternalIp;
rpc.users.colin = {
# see docs at top of file for how to generate this
passwordHMAC = "30002c05d82daa210550e17a182db3f3$6071444151281e1aa8a2729f75e3e2d224e9d7cac3974810dab60e7c28ffaae4";
};
extraConfig = ''
# don't load the wallet, and disable wallet RPC calls
disablewallet=1
# proxy all outbound traffic through Tor
proxy=127.0.0.1:9050
'';
};
users.users.bitcoind-mainnet.extraGroups = [ "tor" ];
systemd.services.bitcoind-mainnet.serviceConfig.RestartSec = "30s"; #< default is 0
sane.users.colin.fs.".bitcoin/bitcoin.conf" = sane-lib.fs.wantedSymlinkTo config.sops.secrets."bitcoin.conf".path;
sops.secrets."bitcoin.conf" = {
mode = "0600";
owner = "colin";
group = "users";
};
sane.programs.bitcoind.enableFor.user.colin = true; # for debugging/administration: `bitcoin-cli`
}

View File

@@ -0,0 +1,766 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.pyln-client ])"
# pyln-client docs: <https://github.com/ElementsProject/lightning/tree/master/contrib/pyln-client>
# terminology:
# - "scid": "Short Channel ID", e.g. 123456x7890x0
# from this id, we can locate the actual channel, its peers, and its parameters
import argparse
import logging
import math
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from enum import Enum
from pyln.client import LightningRpc, Millisatoshi, RpcError
logger = logging.getLogger(__name__)
RPC_FILE = "/var/lib/clightning/bitcoin/lightning-rpc"
# CLTV (HLTC delta) of the final hop
# set this too low and you might get inadvertent channel closures (?)
CLTV = 18
# for every sequentally failed transaction, delay this much before trying again.
# note that the initial route building process can involve 10-20 "transient" failures, as it discovers dead channels.
TX_FAIL_BACKOFF = 0.8
MAX_SEQUENTIAL_JOB_FAILURES = 200
class LoopError(Enum):
""" error when trying to loop sats, or when unable to calculate a route for the loop """
TRANSIENT = "TRANSIENT" # try again, we'll maybe find a different route
NO_ROUTE = "NO_ROUTE"
class RouteError(Enum):
""" error when calculated a route """
HAS_BASE_FEE = "HAS_BASE_FEE"
NO_ROUTE = "NO_ROUTE"
class Metrics:
looped_msat: int = 0
sendpay_fail: int = 0
sendpay_succeed: int = 0
own_bad_channel: int = 0
no_route: int = 0
in_ch_unsatisfiable: int = 0
def __repr__(self) -> str:
return f"looped:{self.looped_msat}, tx:{self.sendpay_succeed}, tx_fail:{self.sendpay_fail}, own_bad_ch:{self.own_bad_channel}, no_route:{self.no_route}, in_ch_restricted:{self.in_ch_unsatisfiable}"
@dataclass
class TxBounds:
max_msat: int
min_msat: int = 0
def __repr__(self) -> str:
return f"TxBounds({self.min_msat} <= msat <= {self.max_msat})"
def is_satisfiable(self) -> bool:
return self.min_msat <= self.max_msat
def raise_max_to_be_satisfiable(self) -> "Self":
if self.max_msat < self.min_msat:
logger.debug(f"raising max_msat to be consistent: {self.max_msat} -> {self.min_msat}")
return TxBounds(self.min_msat, self.min_msat)
return TxBounds(min_msat=self.min_msat, max_msat=self.max_msat)
def intersect(self, other: "TxBounds") -> "Self":
return TxBounds(
min_msat=max(self.min_msat, other.min_msat),
max_msat=min(self.max_msat, other.max_msat),
)
def restrict_to_htlc(self, ch: "LocalChannel", why: str = "") -> "Self":
"""
apply min/max HTLC size restrictions of the given channel.
"""
if ch:
why = why or ch.directed_scid_to_me
if why: why = f"{why}: "
new_min, new_max = self.min_msat, self.max_msat
if ch.htlc_minimum_to_me > self.min_msat:
new_min = ch.htlc_minimum_to_me
logger.debug(f"{why}raising min_msat due to HTLC requirements: {self.min_msat} -> {new_min}")
if ch.htlc_maximum_to_me < self.max_msat:
new_max = ch.htlc_maximum_to_me
logger.debug(f"{why}lowering max_msat due to HTLC requirements: {self.max_msat} -> {new_max}")
return TxBounds(min_msat=new_min, max_msat=new_max)
def restrict_to_zero_fees(self, ch: "LocalChannel"=None, base: int=0, ppm: int=0, why:str = "") -> "Self":
"""
restrict tx size such that PPM fees are zero.
if the channel has a base fee, then `max_msat` is forced to 0.
"""
if ch:
why = why or ch.directed_scid_to_me
self = self.restrict_to_zero_fees(base=ch.to_me["base_fee_millisatoshi"], ppm=ch.to_me["fee_per_millionth"], why=why)
if why: why = f"{why}: "
new_max = self.max_msat
ppm_max = math.ceil(1000000 / ppm) - 1 if ppm != 0 else new_max
if ppm_max < new_max:
logger.debug(f"{why}decreasing max_msat due to fee ppm: {new_max} -> {ppm_max}")
new_max = ppm_max
if base != 0:
logger.debug(f"{why}free route impossible: channel has base fees")
new_max = 0
return TxBounds(min_msat=self.min_msat, max_msat=new_max)
class LocalChannel:
def __init__(self, channels: list, rpc: "RpcHelper"):
assert 0 < len(channels) <= 2, f"unexpected: channel count: {channels}"
out = None
in_ = None
for c in channels:
if c["source"] == rpc.self_id:
assert out is None, f"unexpected: multiple channels from self: {channels}"
out = c
if c["destination"] == rpc.self_id:
assert in_ is None, f"unexpected: multiple channels to self: {channels}"
in_ = c
# assert out is not None, f"no channel from self: {channels}"
# assert in_ is not None, f"no channel to self: {channels}"
if out and in_:
assert out["destination"] == in_["source"], f"channel peers are asymmetric?! {channels}"
assert out["short_channel_id"] == in_["short_channel_id"], f"channel ids differ?! {channels}"
self.from_me = out
self.to_me = in_
self.remote_node = rpc.node(self.remote_peer)
self.peer_ch = rpc.peerchannel(self.scid, self.remote_peer)
self.forwards_from_me = rpc.rpc.listforwards(out_channel=self.scid, status="settled")["forwards"]
def __repr__(self) -> str:
return self.to_str(with_scid=True, with_bal_ratio=True, with_cost=False, with_ppm_theirs=False)
def to_str(
self,
with_peer_id:bool = False,
with_scid:bool = False,
with_bal_msat:bool = False,
with_bal_ratio:bool = False,
with_cost:bool = False,
with_ppm_theirs:bool = False,
with_ppm_mine:bool = False,
with_profits:bool = True,
with_payments:bool = False,
) -> str:
base_flag = "*" if not self.online or self.base_fee_to_me != 0 else ""
alias = f"({self.remote_alias}){base_flag}"
peerid = f" {self.remote_peer}" if with_peer_id else ""
scid = f" scid:{self.scid:>13}" if with_scid else ""
bal = f" S:{int(self.sendable):11}/R:{int(self.receivable):11}" if with_bal_msat else ""
ratio = f" MINE:{(100*self.send_ratio):>8.4f}%" if with_bal_ratio else ""
payments = f" OUT:{int(self.out_fulfilled_msat):>11}/IN:{int(self.in_fulfilled_msat):>11}" if with_payments else ""
profits = f" P$:{int(self.fees_lifetime_mine):>8}" if with_profits else ""
cost = f" COST:{self.opportunity_cost_lent:>8}" if with_cost else ""
ppm_theirs = self.ppm_to_me if self.to_me else "N/A"
ppm_theirs = f" PPM_THEIRS:{ppm_theirs:>6}" if with_ppm_theirs else ""
ppm_mine = self.ppm_from_me if self.from_me else "N/A"
ppm_mine = f" PPM_MINE:{ppm_mine:>6}" if with_ppm_mine else ""
return f"channel{alias:30}{peerid}{scid}{bal}{ratio}{payments}{profits}{cost}{ppm_theirs}{ppm_mine}"
@property
def online(self) -> bool:
return self.from_me and self.to_me
@property
def remote_peer(self) -> str:
if self.from_me:
return self.from_me["destination"]
else:
return self.to_me["source"]
@property
def remote_alias(self) -> str:
return self.remote_node["alias"]
@property
def scid(self) -> str:
if self.from_me:
return self.from_me["short_channel_id"]
else:
return self.to_me["short_channel_id"]
@property
def htlc_minimum_to_me(self) -> Millisatoshi:
return self.to_me["htlc_minimum_msat"]
@property
def htlc_minimum_from_me(self) -> Millisatoshi:
return self.from_me["htlc_minimum_msat"]
@property
def htlc_minimum(self) -> Millisatoshi:
return max(self.htlc_minimum_to_me, self.htlc_minimum_from_me)
@property
def htlc_maximum_to_me(self) -> Millisatoshi:
return self.to_me["htlc_maximum_msat"]
@property
def htlc_maximum_from_me(self) -> Millisatoshi:
return self.from_me["htlc_maximum_msat"]
@property
def htlc_maximum(self) -> Millisatoshi:
return min(self.htlc_maximum_to_me, self.htlc_maximum_from_me)
@property
def direction_to_me(self) -> int:
return self.to_me["direction"]
@property
def direction_from_me(self) -> int:
return self.from_me["direction"]
@property
def directed_scid_to_me(self) -> str:
return f"{self.scid}/{self.direction_to_me}"
@property
def directed_scid_from_me(self) -> str:
return f"{self.scid}/{self.direction_from_me}"
@property
def delay_them(self) -> str:
return self.to_me["delay"]
@property
def delay_me(self) -> str:
return self.from_me["delay"]
@property
def ppm_to_me(self) -> int:
return self.to_me["fee_per_millionth"]
@property
def ppm_from_me(self) -> int:
return self.from_me["fee_per_millionth"]
# return self.peer_ch["fee_proportional_millionths"]
@property
def base_fee_to_me(self) -> int:
return self.to_me["base_fee_millisatoshi"]
@property
def receivable(self) -> int:
return self.peer_ch["receivable_msat"]
@property
def sendable(self) -> int:
return self.peer_ch["spendable_msat"]
@property
def in_fulfilled_msat(self) -> Millisatoshi:
return self.peer_ch["in_fulfilled_msat"]
@property
def out_fulfilled_msat(self) -> Millisatoshi:
return self.peer_ch["out_fulfilled_msat"]
@property
def fees_lifetime_mine(self) -> Millisatoshi:
return sum(fwd["fee_msat"] for fwd in self.forwards_from_me)
@property
def send_ratio(self) -> float:
cap = self.receivable + self.sendable
return self.sendable / cap
@property
def opportunity_cost_lent(self) -> int:
""" how much msat did we gain by pushing their channel to its current balance? """
return int(self.receivable * self.ppm_from_me / 1000000)
class RpcHelper:
def __init__(self, rpc: LightningRpc):
self.rpc = rpc
self.self_id = rpc.getinfo()["id"]
def localchannel(self, scid: str) -> LocalChannel:
listchan = self.rpc.listchannels(scid)
# this assertion would probably indicate a typo in the scid
assert listchan and listchan.get("channels", []) != [], f"bad listchannels for {scid}: {listchan}"
return LocalChannel(listchan["channels"], self)
def node(self, id: str) -> dict:
nodes = self.rpc.listnodes(id)["nodes"]
assert len(nodes) == 1, f"unexpected: multiple nodes for {id}: {nodes}"
return nodes[0]
def peerchannel(self, scid: str, peer_id: str) -> dict:
peerchannels = self.rpc.listpeerchannels(peer_id)["channels"]
channels = [c for c in peerchannels if c["short_channel_id"] == scid]
assert len(channels) == 1, f"expected exactly 1 channel, got: {channels}"
return channels[0]
def try_getroute(self, *args, **kwargs) -> dict | None:
""" wrapper for getroute which returns None instead of error if no route exists """
try:
route = self.rpc.getroute(*args, **kwargs)
except RpcError as e:
logger.debug(f"rpc failed: {e}")
return None
else:
route = route["route"]
if route == []: return None
return route
class LoopRouter:
def __init__(self, rpc: RpcHelper, metrics: Metrics = None):
self.rpc = rpc
self.metrics = metrics or Metrics()
self.bad_channels = [] # list of directed scid
self.nonzero_base_channels = [] # list of directed scid
def drop_caches(self) -> None:
logger.info("LoopRouter.drop_caches()")
self.bad_channels = []
def _get_directed_scid(self, scid: str, direction: int) -> dict:
channels = self.rpc.rpc.listchannels(scid)["channels"]
channels = [c for c in channels if c["direction"] == direction]
assert len(channels) == 1, f"expected exactly 1 channel: {channels}"
return channels[0]
def loop_once(self, out_scid: str, in_scid: str, bounds: TxBounds) -> LoopError|int:
out_ch = self.rpc.localchannel(out_scid)
in_ch = self.rpc.localchannel(in_scid)
if out_ch.directed_scid_from_me in self.bad_channels or in_ch.directed_scid_to_me in self.bad_channels:
logger.info(f"loop {out_scid} -> {in_scid} failed in our own channel")
self.metrics.own_bad_channel += 1
return LoopError.TRANSIENT
# bounds = bounds.restrict_to_htlc(out_ch) # htlc bounds seem to be enforced only in the outward direction
bounds = bounds.restrict_to_htlc(in_ch)
bounds = bounds.restrict_to_zero_fees(in_ch)
if not bounds.is_satisfiable():
self.metrics.in_ch_unsatisfiable += 1
return LoopError.NO_ROUTE
logger.debug(f"route with bounds {bounds}")
route = self.route(out_ch, in_ch, bounds)
logger.debug(f"route: {route}")
if route == RouteError.NO_ROUTE:
self.metrics.no_route += 1
return LoopError.NO_ROUTE
elif route == RouteError.HAS_BASE_FEE:
# try again with a different route
return LoopError.TRANSIENT
amount_msat = route[0]["amount_msat"]
invoice_id = f"loop-{time.time():.6f}".replace(".", "_")
invoice_desc = f"bal {out_scid}:{in_scid}"
invoice = self.rpc.rpc.invoice("any", invoice_id, invoice_desc)
logger.debug(f"invoice: {invoice}")
payment = self.rpc.rpc.sendpay(route, invoice["payment_hash"], invoice_id, amount_msat, invoice["bolt11"], invoice["payment_secret"])
logger.debug(f"sent: {payment}")
try:
wait = self.rpc.rpc.waitsendpay(invoice["payment_hash"])
logger.debug(f"result: {wait}")
except RpcError as e:
self.metrics.sendpay_fail += 1
err_data = e.error["data"]
err_scid, err_dir = err_data["erring_channel"], err_data["erring_direction"]
err_directed_scid = f"{err_scid}/{err_dir}"
logger.debug(f"ch failed, adding to excludes: {err_directed_scid}; {e.error}")
self.bad_channels.append(err_directed_scid)
return LoopError.TRANSIENT
else:
self.metrics.sendpay_succeed += 1
self.metrics.looped_msat += int(amount_msat)
return int(amount_msat)
def route(self, out_ch: LocalChannel, in_ch: LocalChannel, bounds: TxBounds) -> list[dict] | RouteError:
exclude = [
# ensure the payment doesn't cross either channel in reverse.
# note that this doesn't preclude it from taking additional trips through self, with other peers.
# out_ch.directed_scid_to_me,
# in_ch.directed_scid_from_me,
# alternatively, never route through self. this avoids a class of logic error, like what to do with fees i charge "myself".
self.rpc.self_id
] + self.bad_channels + self.nonzero_base_channels
out_peer = out_ch.remote_peer
in_peer = in_ch.remote_peer
route_or_bounds = bounds
while isinstance(route_or_bounds, TxBounds):
old_bounds = route_or_bounds
route_or_bounds = self._find_partial_route(out_peer, in_peer, old_bounds, exclude=exclude)
if route_or_bounds == old_bounds:
return RouteError.NO_ROUTE
if isinstance(route_or_bounds, RouteError):
return route_or_bounds
route = self._add_route_endpoints(route_or_bounds, out_ch, in_ch)
return route
def _find_partial_route(self, out_peer: str, in_peer: str, bounds: TxBounds, exclude: list[str]=[]) -> list[dict] | RouteError | TxBounds:
route = self.rpc.try_getroute(in_peer, amount_msat=bounds.max_msat, riskfactor=0, fromid=out_peer, exclude=exclude, cltv=CLTV)
if route is None:
logger.debug(f"no route for {bounds.max_msat}msat {out_peer} -> {in_peer}")
return RouteError.NO_ROUTE
send_msat = route[0]["amount_msat"]
if send_msat != Millisatoshi(bounds.max_msat):
logger.debug(f"found route with non-zero fee: {send_msat} -> {bounds.max_msat}. {route}")
error = None
for hop in route:
hop_scid = hop["channel"]
hop_dir = hop["direction"]
directed_scid = f"{hop_scid}/{hop_dir}"
ch = self._get_directed_scid(hop_scid, hop_dir)
if ch["base_fee_millisatoshi"] != 0:
self.nonzero_base_channels.append(directed_scid)
error = RouteError.HAS_BASE_FEE
bounds = bounds.restrict_to_zero_fees(ppm=ch["fee_per_millionth"], why=directed_scid)
return bounds.raise_max_to_be_satisfiable() if error is None else error
return route
def _add_route_endpoints(self, route, out_ch: LocalChannel, in_ch: LocalChannel):
inbound_hop = dict(
id=self.rpc.self_id,
channel=in_ch.scid,
direction=in_ch.direction_to_me,
amount_msat=route[-1]["amount_msat"],
delay=route[-1]["delay"],
style="tlv",
)
route = self._add_route_delay(route, in_ch.delay_them) + [ inbound_hop ]
outbound_hop = dict(
id=out_ch.remote_peer,
channel=out_ch.scid,
direction=out_ch.direction_from_me,
amount_msat=route[0]["amount_msat"],
delay=route[0]["delay"] + out_ch.delay_them,
style="tlv",
)
route = [ outbound_hop ] + route
return route
def _add_route_delay(self, route: list[dict], delay: int) -> list[dict]:
return [ dict(hop, delay=hop["delay"] + delay) for hop in route ]
@dataclass
class LoopJob:
out: str # scid
in_: str # scid
amount: int
@dataclass
class LoopJobIdle:
sec: int = 10
class LoopJobDone(Enum):
COMPLETED = "COMPLETED"
ABORTED = "ABORTED"
class AbstractLoopRunner:
def __init__(self, looper: LoopRouter, bounds: TxBounds, parallelism: int):
self.looper = looper
self.bounds = bounds
self.parallelism = parallelism
self.bounds_map = {} # map (out:str, in_:str) -> TxBounds. it's a cache so we don't have to try 10 routes every time.
def pop_job(self) -> LoopJob | LoopJobIdle | LoopJobDone:
raise NotImplemented # abstract method
def finished_job(self, job: LoopJob, progress: int|LoopError) -> None:
raise NotImplemented # abstract method
def run_to_completion(self, exit_on_any_completed:bool = False) -> None:
self.exiting = False
self.exit_on_any_completed = exit_on_any_completed
if self.parallelism == 1:
# run inline to aid debugging
self._worker_thread()
else:
with ThreadPoolExecutor(max_workers=self.parallelism) as executor:
_ = list(executor.map(lambda _i: self._try_invoke(self._worker_thread), range(self.parallelism)))
def drop_caches(self) -> None:
logger.info("AbstractLoopRunner.drop_caches()")
self.looper.drop_caches()
self.bounds_map = {}
def _try_invoke(self, f, *args) -> None:
"""
try to invoke `f` with the provided `args`, and log if it fails.
this overcomes the issue that background tasks which fail via Exception otherwise do so silently.
"""
try:
f(*args)
except Exception as e:
logger.error(f"task failed: {e}")
def _worker_thread(self) -> None:
while not self.exiting:
job = self.pop_job()
logger.debug(f"popped job: {job}")
if isinstance(job, LoopJobDone):
return self._worker_finished(job)
if isinstance(job, LoopJobIdle):
logger.debug(f"idling for {job.sec}")
time.sleep(job.sec)
continue
result = self._execute_job(job)
logger.debug(f"finishing job {job} with {result}")
self.finished_job(job, result)
def _execute_job(self, job: LoopJob) -> LoopError|int:
bounds = self.bounds_map.get((job.out, job.in_), self.bounds)
bounds = bounds.intersect(TxBounds(max_msat=job.amount))
if not bounds.is_satisfiable():
logger.debug(f"TxBounds for job are unsatisfiable; skipping: {bounds} {job}")
return LoopError.NO_ROUTE
amt_looped = self.looper.loop_once(job.out, job.in_, bounds)
if amt_looped in (0, LoopError.NO_ROUTE, LoopError.TRANSIENT):
return amt_looped
logger.info(f"looped {amt_looped} from {job.out} -> {job.in_}")
bounds = bounds.intersect(TxBounds(max_msat=amt_looped))
self.bounds_map[(job.out, job.in_)] = bounds
return amt_looped
def _worker_finished(self, job: LoopJobDone) -> None:
if job == LoopJobDone.COMPLETED and self.exit_on_any_completed:
logger.debug(f"worker completed -> exiting pool")
self.exiting = True
class LoopPairState:
# TODO: use this in MultiLoopBalancer, or stop shoving state in here and put it on LoopBalancer instead.
def __init__(self, out: str, in_: str, amount: int):
self.out = out
self.in_ = in_
self.amount_target = amount
self.amount_looped = 0
self.amount_outstanding = 0
self.tx_fail_count = 0
self.route_fail_count = 0
self.last_job_start_time = None
self.failed_tx_throttler = 0 # increase by one every time we fail, decreases more gradually, when we succeed
class LoopBalancer(AbstractLoopRunner):
def __init__(self, out: str, in_: str, amount: int, looper: LoopRouter, bounds: TxBounds, parallelism: int=1):
super().__init__(looper, bounds, parallelism)
self.state = LoopPairState(out, in_, amount)
def pop_job(self) -> LoopJob | LoopJobIdle | LoopJobDone:
if self.state.tx_fail_count + 10*self.state.route_fail_count >= MAX_SEQUENTIAL_JOB_FAILURES:
logger.info(f"giving up ({self.state.out} -> {self.state.in_}): {self.state.tx_fail_count} tx failures, {self.state.route_fail_count} route failures")
return LoopJobDone.ABORTED
if self.state.tx_fail_count + self.state.route_fail_count > 0:
# N.B.: last_job_start_time is guaranteed to have been set by now
idle_until = self.state.last_job_start_time + TX_FAIL_BACKOFF*self.state.failed_tx_throttler
idle_for = idle_until - time.time()
if self.state.amount_outstanding != 0 or idle_for > 0:
# when we hit transient failures, restrict to just one job in flight at a time.
# this is aimed for the initial route building, where multiple jobs in flight is just useless,
# but it's not a bad idea for network blips, etc, either.
logger.info(f"throttling ({self.state.out} -> {self.state.in_}) for {idle_for:.0f}: {self.state.tx_fail_count} tx failures, {self.state.route_fail_count} route failures")
return LoopJobIdle(idle_for) if idle_for > 0 else LoopJobIdle()
amount_avail = self.state.amount_target - self.state.amount_looped - self.state.amount_outstanding
if amount_avail < self.bounds.min_msat:
if self.state.amount_outstanding == 0: return LoopJobDone.COMPLETED
return LoopJobIdle() # sending out another job would risk over-transferring
amount_this_job = min(amount_avail, self.bounds.max_msat)
self.state.amount_outstanding += amount_this_job
self.state.last_job_start_time = time.time()
return LoopJob(out=self.state.out, in_=self.state.in_, amount=amount_this_job)
def finished_job(self, job: LoopJob, progress: int) -> None:
self.state.amount_outstanding -= job.amount
if progress == LoopError.NO_ROUTE:
self.state.route_fail_count += 1
self.state.failed_tx_throttler += 10
elif progress == LoopError.TRANSIENT:
self.state.tx_fail_count += 1
self.state.failed_tx_throttler += 1
else:
self.state.amount_looped += progress
self.state.tx_fail_count = 0
self.state.route_fail_count = 0
self.state.failed_tx_throttler = max(0, self.state.failed_tx_throttler - 0.2)
logger.info(f"loop progressed ({job.out} -> {job.in_}) {progress}: {self.state.amount_looped} of {self.state.amount_target}")
class MultiLoopBalancer(AbstractLoopRunner):
"""
multiplexes jobs between multiple LoopBalancers.
note that the child LoopBalancers don't actually execute the jobs -- just produce them.
"""
def __init__(self, looper: LoopRouter, bounds: TxBounds, parallelism: int=1):
super().__init__(looper, bounds, parallelism)
self.loops = []
# job_index: increments on every job so we can grab jobs evenly from each LoopBalancer.
# in that event that producers are idling, it can actually increment more than once,
# so don't take this too literally
self.job_index = 0
def add_loop(self, out: LocalChannel, in_: LocalChannel, amount: int) -> None:
"""
start looping sats from out -> in_
"""
assert not any(l.state.out == out.scid and l.state.in_ == in_.scid for l in self.loops), f"tried to add duplicate loops from {out} -> {in_}"
logger.info(f"looping from ({out}) to ({in_})")
self.loops.append(LoopBalancer(out.scid, in_.scid, amount, self.looper, self.bounds, self.parallelism))
def pop_job(self) -> LoopJob | LoopJobIdle | LoopJobDone:
# N.B.: this can be called in parallel, so try to be consistent enough to not crash
idle_job = None
abort_job = None
for i, _ in enumerate(self.loops):
loop = self.loops[(self.job_index + i) % len(self.loops)]
self.job_index += 1
job = loop.pop_job()
if isinstance(job, LoopJob):
return job
if isinstance(job, LoopJobIdle):
idle_job = LoopJobIdle(min(job.sec, idle_job.sec)) if idle_job is not None else job
if job == LoopJobDone.ABORTED:
abort_job = job
# either there's a task to idle, or we have to terminate.
# if terminating, terminate ABORTED if any job aborted, else COMPLETED
if idle_job is not None: return idle_job
if abort_job is not None: return abort_job
return LoopJobDone.COMPLETED
def finished_job(self, job: LoopJob, progress: int) -> None:
# this assumes (enforced externally) that we have only one loop for a given out/in_ pair
for l in self.loops:
if l.state.out == job.out and l.state.in_ == job.in_:
l.finished_job(job, progress)
logger.info(f"total: {self.looper.metrics}")
def balance_loop(rpc: RpcHelper, out: str, in_: str, amount_msat: int, min_msat: int, max_msat: int, parallelism: int):
looper = LoopRouter(rpc)
bounds = TxBounds(min_msat=min_msat, max_msat=max_msat)
balancer = LoopBalancer(out, in_, amount_msat, looper, bounds, parallelism)
balancer.run_to_completion()
def autobalance_once(rpc: RpcHelper, metrics: Metrics, bounds: TxBounds, parallelism: int) -> bool:
"""
autobalances all channels.
returns True if channels are balanced (or as balanced as can be); False if in need of further balancing
"""
looper = LoopRouter(rpc, metrics)
balancer = MultiLoopBalancer(looper, bounds, parallelism)
channels = []
for peerch in rpc.rpc.listpeerchannels()["channels"]:
try:
channels.append(rpc.localchannel(peerch["short_channel_id"]))
except:
logger.info(f"NO CHANNELS for {peerch['peer_id']}")
channels = [ch for ch in channels if ch.online and ch.base_fee_to_me == 0]
give_to = [ ch for ch in channels if ch.send_ratio > 0.95 ]
take_from = [ ch for ch in channels if ch.send_ratio < 0.20 ]
if give_to == [] and take_from == []:
return True
for to in give_to:
for from_ in take_from:
balancer.add_loop(to, from_, 10000000)
balancer.run_to_completion(exit_on_any_completed=True)
return False
def autobalance(rpc: RpcHelper, min_msat: int, max_msat: int, parallelism: int):
bounds = TxBounds(min_msat=min_msat, max_msat=max_msat)
metrics = Metrics()
while not autobalance_once(rpc, metrics, bounds, parallelism):
pass
def show_status(rpc: RpcHelper, full: bool=False):
"""
show a table of channel balances between peers.
"""
for peerch in rpc.rpc.listpeerchannels()["channels"]:
try:
ch = rpc.localchannel(peerch["short_channel_id"])
except:
print(f"{peerch['peer_id']} scid:{peerch['short_channel_id']} state:{peerch['state']} NO CHANNELS")
else:
print(ch.to_str(with_scid=True, with_bal_ratio=True, with_payments=True, with_cost=full, with_ppm_theirs=True, with_ppm_mine=True, with_peer_id=full))
def main():
logging.basicConfig()
logger.setLevel(logging.INFO)
parser = argparse.ArgumentParser(description="rebalance lightning channel balances")
parser.add_argument("--verbose", action="store_true", help="more logging")
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("--jobs", default="1", help="how many HTLCs to keep in-flight at once")
subparsers = parser.add_subparsers(help="action")
status_parser = subparsers.add_parser("status")
status_parser.set_defaults(action="status")
status_parser.add_argument("--full", action="store_true", help="more info per channel")
loop_parser = subparsers.add_parser("loop")
loop_parser.set_defaults(action="loop")
loop_parser.add_argument("out", help="peer id to send tx through")
loop_parser.add_argument("in_", help="peer id to receive tx through")
loop_parser.add_argument("amount", help="total amount of msat to loop")
autobal_parser = subparsers.add_parser("autobalance")
autobal_parser.set_defaults(action="autobalance")
args = parser.parse_args()
if args.verbose:
logger.setLevel(logging.DEBUG)
rpc = RpcHelper(LightningRpc(RPC_FILE))
if args.action == "status":
show_status(rpc, full=args.full)
if args.action == "loop":
balance_loop(rpc, out=args.out, in_=args.in_, amount_msat=int(args.amount), min_msat=int(args.min_msat), max_msat=int(args.max_msat), parallelism=int(args.jobs))
if args.action == "autobalance":
autobalance(rpc, min_msat=int(args.min_msat), max_msat=int(args.max_msat), parallelism=int(args.jobs))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,135 @@
# clightning is an implementation of Bitcoin's Lightning Network.
# as such, this assumes that `services.bitcoin` is enabled.
# docs:
# - tor clightning config: <https://docs.corelightning.org/docs/tor>
# - `lightning-cli` and subcommands: <https://docs.corelightning.org/reference/lightning-cli>
# - `man lightningd-config`
#
# management/setup/use:
# - guide: <https://github.com/ElementsProject/lightning>
#
# debugging:
# - `lightning-cli getlog debug`
# - `lightning-cli listpays` -> show payments this node sent
# - `lightning-cli listinvoices` -> show payments this node received
#
# first, acquire peers:
# - `lightning-cli connect id@host`
# where `id` is the node's pubkey, and `host` is perhaps an ip:port tuple, or a hash.onion:port tuple.
# for testing, choose any node listed on <https://1ml.com>
# - `lightning-cli listpeers`
# should show the new peer, with `connected: true`
#
# then, fund the clightning wallet
# - `lightning-cli newaddr`
#
# then, open channels
# - `lightning-cli connect ...`
# - `lightning-cli fundchannel <node_id> <amount_in_satoshis>`
#
# who to federate with?
# - a lot of the larger nodes allow hands-free channel creation
# - either inbound or outbound, sometimes paid
# - find nodes on:
# - <https://terminal.lightning.engineering/>
# - <https://1ml.com>
# - tor nodes: <https://1ml.com/node?order=capacity&iponionservice=true>
# - <https://lightningnetwork.plus>
# - <https://mempool.space/lightning>
# - <https://amboss.space>
# - a few tor-capable nodes which allow channel creation:
# - <https://c-otto.de/>
# - <https://cyberdyne.sh/>
# - <https://yalls.org/about/>
# - <https://coincept.com/>
# - more resources: <https://www.lopp.net/lightning-information.html>
# - node routability: https://hashxp.org/lightning/node/<id>
# - especially, acquire inbound liquidity via lightningnetwork.plus's swap feature
# - most of the opportunities are gated behind a minimum connection or capacity requirement
#
# tune payment parameters
# - `lightning-cli setchannel <id> [feebase] [feeppm] [htlcmin] [htlcmax] [enforcedelay] [ignorefeelimits]`
# - e.g. `lightning-cli setchannel all 0 10`
# - it's suggested that feebase=0 simplifies routing.
#
# teardown:
# - `lightning-cli withdraw <bc1... dest addr> <amount in satoshis> [feerate]`
#
# sanity:
# - `lightning-cli listfunds`
#
# to receive a payment (do as `clightning` user):
# - `lightning-cli invoice <amount in millisatoshi> <label> <description>`
# - specify amount as `any` if undetermined
# - then give the resulting bolt11 URI to the payer
# to send a payment:
# - `lightning-cli pay <bolt11 URI>`
# - or `lightning-cli pay <bolt11 URI> [amount_msat] [label] [riskfactor] [maxfeepercent] ...`
# - amount_msat must be "null" if the bolt11 URI specifies a value
# - riskfactor defaults to 10
# - maxfeepercent defaults to 0.5
# - label is a human-friendly label for my records
{ config, pkgs, ... }:
{
sane.persist.sys.byStore.ext = [
{ user = "clightning"; group = "clightning"; mode = "0710"; path = "/var/lib/clightning"; method = "bind"; }
];
# `lightning-cli` finds its RPC file via `~/.lightning/bitcoin/lightning-rpc`, to message the daemon
sane.user.fs.".lightning".symlink.target = "/var/lib/clightning";
# see bitcoin.nix for how to generate this
services.bitcoind.mainnet.rpc.users.clightning.passwordHMAC =
"befcb82d9821049164db5217beb85439$2c31ac7db3124612e43893ae13b9527dbe464ab2d992e814602e7cb07dc28985";
sane.services.clightning.enable = true;
sane.services.clightning.proxy = "127.0.0.1:9050"; # proxy outgoing traffic through tor
# sane.services.clightning.publicAddress = "statictor:127.0.0.1:9051";
sane.services.clightning.getPublicAddressCmd = "cat /var/lib/tor/onion/clightning/hostname";
services.tor.relay.onionServices.clightning = {
version = 3;
map = [{
# by default tor will route public tor port P to 127.0.0.1:P.
# so if this port is the same as clightning would natively use, then no further config is needed here.
# see: <https://2019.www.torproject.org/docs/tor-manual.html.en#HiddenServicePort>
port = 9735;
# target.port; target.addr; #< set if tor port != clightning port
}];
# allow "tor" group (i.e. clightning) to read /var/lib/tor/onion/clightning/hostname
settings.HiddenServiceDirGroupReadable = true;
};
# must be in "tor" group to read /var/lib/tor/onion/*/hostname
users.users.clightning.extraGroups = [ "tor" ];
systemd.services.clightning.after = [ "tor.service" ];
# lightning-config contains fields from here:
# - <https://docs.corelightning.org/docs/configuration>
# secret config includes:
# - bitcoin-rpcpassword
# - alias=nodename
# - rgb=rrggbb
# - fee-base=<millisatoshi>
# - fee-per-satoshi=<ppm>
# - feature configs (i.e. experimental-xyz options)
sane.services.clightning.extraConfig = ''
log-level=debug:lightningd
# peerswap:
# - config example: <https://github.com/fort-nix/nix-bitcoin/pull/462/files#diff-b357d832705b8ce8df1f41934d613f79adb77c4cd5cd9e9eb12a163fca3e16c6>
# XXX: peerswap crashes clightning on launch. stacktrace is useless.
# plugin=${pkgs.peerswap}/bin/peerswap
# peerswap-db-path=/var/lib/clightning/peerswap/swaps
# peerswap-policy-path=...
'';
sane.services.clightning.extraConfigFiles = [ config.sops.secrets."lightning-config".path ];
sops.secrets."lightning-config" = {
mode = "0640";
owner = "clightning";
group = "clightning";
};
sane.programs.clightning.enableFor.user.colin = true; # for debugging/admin: `lightning-cli`
}

View File

@@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./bitcoin.nix
./clightning.nix
./i2p.nix
./monero.nix
./tor.nix
];
}

View File

@@ -0,0 +1,4 @@
{ ... }:
{
services.i2p.enable = true;
}

View File

@@ -3,7 +3,7 @@
{ {
sane.persist.sys.byStore.ext = [ sane.persist.sys.byStore.ext = [
# /var/lib/monero/lmdb is what consumes most of the space # /var/lib/monero/lmdb is what consumes most of the space
{ user = "monero"; group = "monero"; path = "/var/lib/monero"; } { user = "monero"; group = "monero"; path = "/var/lib/monero"; method = "bind"; }
]; ];
services.monero.enable = true; services.monero.enable = true;
@@ -20,12 +20,6 @@
tx-proxy=tor,127.0.0.1:9050 tx-proxy=tor,127.0.0.1:9050
''; '';
services.i2p.enable = true;
# tor: `tor.enable` doesn't start a relay, exit node, proxy, etc. it's minimal.
# tor.client.enable configures a torsocks proxy, accessible *only* to localhost.
services.tor.enable = true;
services.tor.client.enable = true;
# monero ports: <https://monero.stackexchange.com/questions/604/what-ports-does-monero-use-rpc-p2p-etc> # monero ports: <https://monero.stackexchange.com/questions/604/what-ports-does-monero-use-rpc-p2p-etc>
# - 18080 = "P2P" monero node <-> monero node connections # - 18080 = "P2P" monero node <-> monero node connections
# - 18081 = "RPC" monero client -> monero node connections # - 18081 = "RPC" monero client -> monero node connections

View File

@@ -0,0 +1,25 @@
# tor settings: <https://2019.www.torproject.org/docs/tor-manual.html.en>
{ lib, ... }:
{
# tor hidden service hostnames aren't deterministic, so persist.
# might be able to get away with just persisting /var/lib/tor/onion, not sure.
sane.persist.sys.byStore.plaintext = [
{ user = "tor"; group = "tor"; mode = "0710"; path = "/var/lib/tor"; method = "bind"; }
];
# tor: `tor.enable` doesn't start a relay, exit node, proxy, etc. it's minimal.
# tor.client.enable configures a torsocks proxy, accessible *only* to localhost.
# at 127.0.0.1:9050
services.tor.enable = true;
services.tor.client.enable = true;
# in order for services to read /var/lib/tor/onion/*/hostname, they must be able to traverse /var/lib/tor,
# and /var/lib/tor must have g+x.
# DataDirectoryGroupReadable causes tor to use g+rx, technically more than we need, but all the files are 600 so it's fine.
services.tor.settings.DataDirectoryGroupReadable = true;
# StateDirectoryMode defaults to 0700, and thereby prevents the onion hostnames from being group readable
systemd.services.tor.serviceConfig.StateDirectoryMode = lib.mkForce "0710";
users.users.tor.homeMode = "0710"; # home mode defaults to 0700, causing readability problems, enforced by nixos "users" activation script
services.tor.settings.SafeLogging = false; # show actual .onion names in the syslog, else debugging is impossible
}

View File

@@ -1,27 +0,0 @@
{ config, lib, pkgs, ... }:
# using manual ddns now
lib.mkIf false
{
systemd.services.ddns-afraid = {
description = "update dynamic DNS entries for freedns.afraid.org";
serviceConfig = {
EnvironmentFile = config.sops.secrets."ddns_afraid.env".path;
# TODO: ProtectSystem = "strict";
# TODO: ProtectHome = "full";
# TODO: PrivateTmp = true;
};
script = let
curl = "${pkgs.curl}/bin/curl -4";
in ''
${curl} "https://freedns.afraid.org/dynamic/update.php?$AFRAID_KEY"
'';
};
systemd.timers.ddns-afraid = {
wantedBy = [ "multi-user.target" ];
timerConfig = {
OnStartupSec = "2min";
OnUnitActiveSec = "10min";
};
};
}

View File

@@ -1,30 +0,0 @@
{ config, lib, pkgs, ... }:
# we use manual DDNS now
lib.mkIf false
{
systemd.services.ddns-he = {
description = "update dynamic DNS entries for HurricaneElectric";
serviceConfig = {
EnvironmentFile = config.sops.secrets."ddns_he.env".path;
# TODO: ProtectSystem = "strict";
# TODO: ProtectHome = "full";
# TODO: PrivateTmp = true;
};
# HE DDNS API is documented: https://dns.he.net/docs.html
script = let
crl = "${pkgs.curl}/bin/curl -4";
in ''
${crl} "https://he.uninsane.org:$HE_PASSPHRASE@dyn.dns.he.net/nic/update?hostname=he.uninsane.org"
${crl} "https://native.uninsane.org:$HE_PASSPHRASE@dyn.dns.he.net/nic/update?hostname=native.uninsane.org"
${crl} "https://uninsane.org:$HE_PASSPHRASE@dyn.dns.he.net/nic/update?hostname=uninsane.org"
'';
};
systemd.timers.ddns-he = {
wantedBy = [ "multi-user.target" ];
timerConfig = {
OnStartupSec = "2min";
OnUnitActiveSec = "10min";
};
};
}

View File

@@ -3,8 +3,7 @@
imports = [ imports = [
./calibre.nix ./calibre.nix
./coturn.nix ./coturn.nix
./ddns-afraid.nix ./cryptocurrencies
./ddns-he.nix
./email ./email
./ejabberd.nix ./ejabberd.nix
./freshrss.nix ./freshrss.nix
@@ -18,9 +17,9 @@
./komga.nix ./komga.nix
./lemmy.nix ./lemmy.nix
./matrix ./matrix
./monero.nix
./navidrome.nix ./navidrome.nix
./nginx.nix ./nginx.nix
./nixos-prebuild.nix
./nixserve.nix ./nixserve.nix
./ntfy ./ntfy
./pict-rs.nix ./pict-rs.nix

View File

@@ -45,7 +45,7 @@ in
lib.mkIf false lib.mkIf false
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "ejabberd"; group = "ejabberd"; path = "/var/lib/ejabberd"; } { user = "ejabberd"; group = "ejabberd"; path = "/var/lib/ejabberd"; method = "bind"; }
]; ];
sane.ports.ports = lib.mkMerge ([ sane.ports.ports = lib.mkMerge ([
{ {

View File

@@ -127,10 +127,11 @@
services.dovecot2.modules = [ services.dovecot2.modules = [
pkgs.dovecot_pigeonhole # enables sieve execution (?) pkgs.dovecot_pigeonhole # enables sieve execution (?)
]; ];
services.dovecot2.sieveScripts = { services.dovecot2.sieve = {
extensions = [ "fileinto" ];
# if any messages fail to pass (or lack) DKIM, move them to Junk # if any messages fail to pass (or lack) DKIM, move them to Junk
# XXX the key name ("after") is only used to order sieve execution/ordering # XXX the key name ("after") is only used to order sieve execution/ordering
after = builtins.toFile "ensuredkim.sieve" '' scripts.after = builtins.toFile "ensuredkim.sieve" ''
require "fileinto"; require "fileinto";
if not header :contains "Authentication-Results" "dkim=pass" { if not header :contains "Authentication-Results" "dkim=pass" {
@@ -139,4 +140,6 @@
} }
''; '';
}; };
systemd.services.dovecot2.serviceConfig.RestartSec = lib.mkForce "15s"; # nixos defaults this to 1s
} }

View File

@@ -20,9 +20,9 @@ in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
# TODO: mode? could be more granular # TODO: mode? could be more granular
{ user = "opendkim"; group = "opendkim"; path = "/var/lib/opendkim"; } { user = "opendkim"; group = "opendkim"; path = "/var/lib/opendkim"; method = "bind"; }
{ user = "root"; group = "root"; path = "/var/lib/postfix"; } { user = "root"; group = "root"; path = "/var/lib/postfix"; method = "bind"; }
{ user = "root"; group = "root"; path = "/var/spool/mail"; } { user = "root"; group = "root"; path = "/var/spool/mail"; method = "bind"; }
# *probably* don't need these dirs: # *probably* don't need these dirs:
# "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix # "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix
# "/var/lib/dovecot" # "/var/lib/dovecot"

View File

@@ -30,7 +30,7 @@
# to query the quota/status: # to query the quota/status:
# - `sudo btrfs qgroup show -re /var/export/playground` # - `sudo btrfs qgroup show -re /var/export/playground`
sane.persist.sys.byStore.ext = [ sane.persist.sys.byStore.ext = [
{ user = "root"; group = "export"; mode = "0775"; path = "/var/export/playground"; } { user = "root"; group = "export"; mode = "0775"; path = "/var/export/playground"; method = "bind"; }
]; ];
sane.fs."/var/export/README.md" = { sane.fs."/var/export/README.md" = {

View File

@@ -91,7 +91,7 @@ let
authFailJson = pkgs.writeText "sftp-auth-fail.json" (builtins.toJSON authResponseFail); authFailJson = pkgs.writeText "sftp-auth-fail.json" (builtins.toJSON authResponseFail);
unwrappedAuthProgram = pkgs.static-nix-shell.mkBash { unwrappedAuthProgram = pkgs.static-nix-shell.mkBash {
pname = "sftpgo_external_auth_hook"; pname = "sftpgo_external_auth_hook";
src = ./.; srcRoot = ./.;
pkgs = [ "coreutils" ]; pkgs = [ "coreutils" ];
}; };
authProgram = pkgs.writeShellScript "sftpgo-auth-hook" '' authProgram = pkgs.writeShellScript "sftpgo-auth-hook" ''
@@ -172,13 +172,15 @@ in
users.users.sftpgo.extraGroups = [ "export" ]; users.users.sftpgo.extraGroups = [ "export" ];
systemd.services.sftpgo.serviceConfig = { systemd.services.sftpgo = {
ReadOnlyPaths = [ "/var/export" ];
ReadWritePaths = [ "/var/export/playground" ];
after = [ "network-online.target" ]; after = [ "network-online.target" ];
wants = [ "network-online.target" ]; wants = [ "network-online.target" ];
serviceConfig = {
ReadOnlyPaths = [ "/var/export" ];
ReadWritePaths = [ "/var/export/playground" ];
Restart = "always"; Restart = "always";
RestartSec = "20s"; RestartSec = "20s";
};
}; };
} }

View File

@@ -16,7 +16,7 @@
mode = "0400"; mode = "0400";
}; };
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "freshrss"; group = "freshrss"; path = "/var/lib/freshrss"; } { user = "freshrss"; group = "freshrss"; path = "/var/lib/freshrss"; method = "bind"; }
]; ];
services.freshrss.enable = true; services.freshrss.enable = true;

View File

@@ -4,7 +4,7 @@
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
# TODO: mode? could be more granular # TODO: mode? could be more granular
{ user = "git"; group = "gitea"; path = "/var/lib/gitea"; } { user = "git"; group = "gitea"; path = "/var/lib/gitea"; method = "bind"; }
]; ];
services.gitea.enable = true; services.gitea.enable = true;
services.gitea.user = "git"; # default is 'gitea' services.gitea.user = "git"; # default is 'gitea'
@@ -100,6 +100,24 @@
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:3000"; proxyPass = "http://127.0.0.1:3000";
}; };
# gitea serves all `raw` files as content-type: plain, but i'd like to serve them as their actual content type.
# or at least, enough to make specific pages viewable (serving unoriginal content as arbitrary content type is dangerous).
locations."~ ^/colin/phone-case-cq/raw/.*.html" = {
proxyPass = "http://127.0.0.1:3000";
extraConfig = ''
proxy_hide_header Content-Type;
default_type text/html;
add_header Content-Type text/html;
'';
};
locations."~ ^/colin/phone-case-cq/raw/.*.js" = {
proxyPass = "http://127.0.0.1:3000";
extraConfig = ''
proxy_hide_header Content-Type;
default_type text/html;
add_header Content-Type text/javascript;
'';
};
}; };
sane.dns.zones."uninsane.org".inet.CNAME."git" = "native"; sane.dns.zones."uninsane.org".inet.CNAME."git" = "native";

View File

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

View File

@@ -3,7 +3,7 @@
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
# TODO: mode? we only need this to save Indexer creds ==> migrate to config? # TODO: mode? we only need this to save Indexer creds ==> migrate to config?
{ user = "root"; group = "root"; path = "/var/lib/jackett"; } { user = "root"; group = "root"; path = "/var/lib/jackett"; method = "bind"; }
]; ];
services.jackett.enable = true; services.jackett.enable = true;

View File

@@ -41,7 +41,7 @@
}; };
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "jellyfin"; group = "jellyfin"; mode = "0700"; path = "/var/lib/jellyfin"; } { user = "jellyfin"; group = "jellyfin"; mode = "0700"; path = "/var/lib/jellyfin"; method = "bind"; }
]; ];
sane.fs."/var/lib/jellyfin/config/logging.json" = { sane.fs."/var/lib/jellyfin/config/logging.json" = {
# "Emby.Dlna" logging: <https://jellyfin.org/docs/general/networking/dlna> # "Emby.Dlna" logging: <https://jellyfin.org/docs/general/networking/dlna>

View File

@@ -1,9 +1,19 @@
# how to update wikipedia snapshot:
# - browse for later snapshots:
# - <https://mirror.accum.se/mirror/wikimedia.org/other/kiwix/zim/wikipedia>
# - DL directly, or via rsync (resumable):
# - `rsync --progress --append-verify rsync://mirror.accum.se/mirror/wikimedia.org/other/kiwix/zim/wikipedia/wikipedia_en_all_maxi_2022-05.zim .`
{ ... }: { ... }:
{ {
sane.persist.sys.byStore.ext = [
{ user = "colin"; group = "users"; path = "/var/lib/kiwix"; method = "bind"; }
];
sane.services.kiwix-serve = { sane.services.kiwix-serve = {
enable = true; enable = true;
port = 8013; port = 8013;
zimPaths = [ "/var/lib/uninsane/www-archive/wikipedia_en_all_maxi_2022-05.zim" ]; zimPaths = [ "/var/lib/kiwix/wikipedia_en_all_maxi_2023-11.zim" ];
}; };
services.nginx.virtualHosts."w.uninsane.org" = { services.nginx.virtualHosts."w.uninsane.org" = {

View File

@@ -5,7 +5,7 @@ let
in in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ inherit user group; mode = "0700"; path = stateDir; } { inherit user group; mode = "0700"; path = stateDir; method = "bind"; }
]; ];
services.komga.enable = true; services.komga.enable = true;

View File

@@ -78,8 +78,8 @@ in {
# CLI args: <https://git.asonix.dog/asonix/pict-rs#user-content-running> # CLI args: <https://git.asonix.dog/asonix/pict-rs#user-content-running>
systemd.services.pict-rs.serviceConfig.ExecStart = lib.mkForce (lib.concatStringsSep " " [ systemd.services.pict-rs.serviceConfig.ExecStart = lib.mkForce (lib.concatStringsSep " " [
"${lib.getBin pict-rs}/bin/pict-rs run" "${lib.getBin pict-rs}/bin/pict-rs run"
"--media-max-frame-count" (builtins.toString (30*60*60)) "--media-video-max-frame-count" (builtins.toString (30*60*60))
"--media-process-timeout 120" "--media-process-timeout 120"
"--media-enable-full-video true" # allow audio "--media-video-allow-audio" # allow audio
]); ]);
} }

View File

@@ -21,7 +21,7 @@
]; ];
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/matrix-synapse"; } { user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/matrix-synapse"; method = "bind"; }
]; ];
services.matrix-synapse.enable = true; services.matrix-synapse.enable = true;
services.matrix-synapse.settings = { services.matrix-synapse.settings = {

View File

@@ -6,7 +6,7 @@
lib.mkIf false lib.mkIf false
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/mx-puppet-discord"; } { user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/mx-puppet-discord"; method = "bind"; }
]; ];
services.matrix-synapse.settings.app_service_config_files = [ services.matrix-synapse.settings.app_service_config_files = [

View File

@@ -103,7 +103,7 @@ in
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
# TODO: mode? # TODO: mode?
{ user = "matrix-appservice-irc"; group = "matrix-appservice-irc"; path = "/var/lib/matrix-appservice-irc"; } { user = "matrix-appservice-irc"; group = "matrix-appservice-irc"; path = "/var/lib/matrix-appservice-irc"; method = "bind"; }
]; ];
# XXX: matrix-appservice-irc PreStart tries to chgrp the registration.yml to matrix-synapse, # XXX: matrix-appservice-irc PreStart tries to chgrp the registration.yml to matrix-synapse,

View File

@@ -1,10 +1,12 @@
# config options: # config options:
# - <https://github.com/mautrix/signal/blob/master/mautrix_signal/example-config.yaml> # - <https://github.com/mautrix/signal/blob/master/mautrix_signal/example-config.yaml>
{ config, pkgs, ... }: { config, lib, pkgs, ... }:
lib.mkIf false # disabled 2024/01/11: i don't use it, and pkgs.mautrix-signal had some API changes
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "mautrix-signal"; group = "mautrix-signal"; path = "/var/lib/mautrix-signal"; } { user = "mautrix-signal"; group = "mautrix-signal"; path = "/var/lib/mautrix-signal"; method = "bind"; }
{ user = "signald"; group = "signald"; path = "/var/lib/signald"; } { user = "signald"; group = "signald"; path = "/var/lib/signald"; method = "bind"; }
]; ];
# allow synapse to read the registration file # allow synapse to read the registration file

View File

@@ -2,7 +2,7 @@
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "navidrome"; group = "navidrome"; path = "/var/lib/navidrome"; } { user = "navidrome"; group = "navidrome"; path = "/var/lib/navidrome"; method = "bind"; }
]; ];
services.navidrome.enable = true; services.navidrome.enable = true;
services.navidrome.settings = { services.navidrome.settings = {

View File

@@ -54,8 +54,10 @@ in
services.nginx.recommendedOptimisation = true; services.nginx.recommendedOptimisation = true;
# web blog/personal site # web blog/personal site
# 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/lib/uninsane/media/Books/Visual/HiroshiSeo/Ubunchu".dir = {};
services.nginx.virtualHosts."uninsane.org" = publog { services.nginx.virtualHosts."uninsane.org" = publog {
root = "${pkgs.uninsane-dot-org}/share/uninsane-dot-org";
# 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
# and things don't look right. so force SSL. # and things don't look right. so force SSL.
@@ -65,9 +67,28 @@ in
# for OCSP stapling # for OCSP stapling
sslTrustedCertificate = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; sslTrustedCertificate = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
# uninsane.org/share/foo => /var/lib/uninsane/root/share/foo. locations."/" = {
# yes, nginx does not strip the prefix when evaluating against the root. root = "${pkgs.uninsane-dot-org}/share/uninsane-dot-org";
locations."/share".root = "/var/lib/uninsane/root"; tryFiles = "$uri $uri/ @fallback";
};
# unversioned files
locations."@fallback" = {
root = "/var/www/sites/uninsane.org";
};
# uninsane.org/share/foo => /var/www/sites/uninsane.org/share/foo.
# special-cased to enable directory listings
locations."/share" = {
root = "/var/www/sites/uninsane.org";
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 =
@@ -108,6 +129,19 @@ in
# proxyPass = "http://127.0.0.1:4000"; # proxyPass = "http://127.0.0.1:4000";
# extraConfig = pleromaExtraConfig; # extraConfig = pleromaExtraConfig;
# }; # };
# redirect common feed URIs to the canonical feed
locations."= /atom".extraConfig = "return 301 /atom.xml;";
locations."= /feed".extraConfig = "return 301 /atom.xml;";
locations."= /feed.xml".extraConfig = "return 301 /atom.xml;";
locations."= /rss".extraConfig = "return 301 /atom.xml;";
locations."= /rss.xml".extraConfig = "return 301 /atom.xml;";
locations."= /blog/atom".extraConfig = "return 301 /atom.xml;";
locations."= /blog/atom.xml".extraConfig = "return 301 /atom.xml;";
locations."= /blog/feed".extraConfig = "return 301 /atom.xml;";
locations."= /blog/feed.xml".extraConfig = "return 301 /atom.xml;";
locations."= /blog/rss".extraConfig = "return 301 /atom.xml;";
locations."= /blog/rss.xml".extraConfig = "return 301 /atom.xml;";
}; };
@@ -135,9 +169,8 @@ in
security.acme.defaults.email = "admin.acme@uninsane.org"; security.acme.defaults.email = "admin.acme@uninsane.org";
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
# TODO: mode? { user = "acme"; group = "acme"; path = "/var/lib/acme"; method = "bind"; }
{ user = "acme"; group = "acme"; path = "/var/lib/acme"; } { user = "colin"; group = "users"; path = "/var/www/sites"; method = "bind"; }
{ user = "colin"; group = "users"; path = "/var/www/sites"; }
]; ];
# let's encrypt default chain looks like: # let's encrypt default chain looks like:

View File

@@ -0,0 +1,26 @@
{ lib, pkgs, ... }:
lib.optionalAttrs false # disabled until i can be sure it's not gonna OOM my server in the middle of the night
{
systemd.services.nixos-prebuild = {
description = "build a nixos image with all updated deps";
path = with pkgs; [ coreutils git nix ];
script = ''
working=$(mktemp -d /tmp/nixos-prebuild.XXXXXX)
pushd "$working"
git clone https://git.uninsane.org/colin/nix-files.git \
&& cd nix-files \
&& nix flake update \
|| true
RC=$(nix run "$working/nix-files#check" -- -j1 --cores 5 --builders "")
popd
rm -rf "$working"
exit "$RC"
'';
};
systemd.timers.nixos-prebuild = {
wantedBy = [ "multi-user.target" ];
timerConfig.OnCalendar = "11,23:00:00";
};
}

View File

@@ -34,7 +34,7 @@ in
# not 100% necessary to persist this, but ntfy does keep a 12hr (by default) cache # not 100% necessary to persist this, but ntfy does keep a 12hr (by default) cache
# for pushing notifications to users who become offline. # for pushing notifications to users who become offline.
# ACLs also live here. # ACLs also live here.
{ user = "ntfy-sh"; group ="ntfy-sh"; path = "/var/lib/ntfy-sh"; } { user = "ntfy-sh"; group ="ntfy-sh"; path = "/var/lib/ntfy-sh"; method = "bind"; }
]; ];
services.ntfy-sh.enable = true; services.ntfy-sh.enable = true;

View File

@@ -49,7 +49,7 @@ in
type = types.package; type = types.package;
default = pkgs.static-nix-shell.mkPython3Bin { default = pkgs.static-nix-shell.mkPython3Bin {
pname = "ntfy-waiter"; pname = "ntfy-waiter";
src = ./.; srcRoot = ./.;
pkgs = [ "ntfy-sh" ]; pkgs = [ "ntfy-sh" ];
}; };
description = '' description = ''
@@ -64,7 +64,7 @@ in
protocol = [ "tcp" ]; protocol = [ "tcp" ];
visibleTo.lan = true; visibleTo.lan = true;
visibleTo.wan = true; visibleTo.wan = true;
description = "colin-notification-waiter-${builtins.toString (port+1)}-of-${builtins.toString numPorts}"; description = "colin-notification-waiter-${builtins.toString (port - portLow + 1)}-of-${builtins.toString numPorts}";
}; };
})); }));
systemd.services = lib.mkMerge (builtins.map mkService portRange); systemd.services = lib.mkMerge (builtins.map mkService portRange);

View File

@@ -6,7 +6,7 @@ let
in in
{ {
sane.persist.sys.byStore.plaintext = lib.mkIf cfg.enable [ sane.persist.sys.byStore.plaintext = lib.mkIf cfg.enable [
{ user = "pict-rs"; group = "pict-rs"; path = cfg.dataDir; } { user = "pict-rs"; group = "pict-rs"; path = cfg.dataDir; method = "bind"; }
]; ];
systemd.services.pict-rs.serviceConfig = { systemd.services.pict-rs.serviceConfig = {

View File

@@ -15,7 +15,7 @@ let
in in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "pleroma"; group = "pleroma"; path = "/var/lib/pleroma"; } { user = "pleroma"; group = "pleroma"; path = "/var/lib/pleroma"; method = "bind"; }
]; ];
services.pleroma.enable = true; services.pleroma.enable = true;
services.pleroma.secretConfigFile = config.sops.secrets.pleroma_secrets.path; services.pleroma.secretConfigFile = config.sops.secrets.pleroma_secrets.path;

View File

@@ -8,7 +8,7 @@ in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
# TODO: mode? # TODO: mode?
{ user = "postgres"; group = "postgres"; path = "/var/lib/postgresql"; } { user = "postgres"; group = "postgres"; path = "/var/lib/postgresql"; method = "bind"; }
]; ];
services.postgresql.enable = true; services.postgresql.enable = true;

View File

@@ -57,7 +57,7 @@ let
in in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "prosody"; group = "prosody"; path = "/var/lib/prosody"; } { user = "prosody"; group = "prosody"; path = "/var/lib/prosody"; method = "bind"; }
]; ];
sane.ports.ports."5000" = { sane.ports.ports."5000" = {
protocol = [ "tcp" ]; protocol = [ "tcp" ];

View File

@@ -6,7 +6,7 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
{ user = "slskd"; group = "slskd"; path = "/var/lib/slskd"; } { user = "slskd"; group = "slskd"; 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;
@@ -57,7 +57,7 @@
# what unit is this? kbps?? # what unit is this? kbps??
global.upload.speed_limit = 32000; global.upload.speed_limit = 32000;
web.logging = true; web.logging = true;
debug = true; # debug = true;
flags.no_logo = true; # don't show logo at start flags.no_logo = true; # don't show logo at start
# 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
}; };
@@ -66,8 +66,8 @@
serviceConfig = { serviceConfig = {
# run this behind the OVPN static VPN # run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns"; NetworkNamespacePath = "/run/netns/ovpns";
Restart = "on-failure"; Restart = lib.mkForce "always"; # exits "success" when it fails to connect to soulseek server
RestartSec = "30s"; RestartSec = "60s";
Group = "media"; Group = "media";
}; };
}; };

View File

@@ -1,14 +1,37 @@
{ config, pkgs, ... }: { config, lib, pkgs, ... }:
let
# 2023/09/06: nixpkgs `transmission` defaults to old 3.00
# 2024/02/15: some torrent trackers whitelist clients; everyone is still on 3.00 for some reason :|
# some do this via peer-id (e.g. baka); others via user-agent (e.g. MAM).
# peer-id format is essentially the same between 3.00 and 4.x (just swap the MAJOR/MINOR/PATCH numbers).
# user-agent format has changed. `Transmission/3.00` (old) v.s. `TRANSMISSION/MAJ.MIN.PATCH` (new).
realTransmission = pkgs.transmission_4;
realVersion = {
major = lib.versions.major realTransmission.version;
minor = lib.versions.minor realTransmission.version;
patch = lib.versions.patch realTransmission.version;
};
package = realTransmission.overrideAttrs (upstream: {
# `cmakeFlags = [ "-DTR_VERSION_MAJOR=3" ]`, etc, doesn't seem to take effect.
postPatch = (upstream.postPatch or "") + ''
substituteInPlace CMakeLists.txt \
--replace-fail 'TR_VERSION_MAJOR "${realVersion.major}"' 'TR_VERSION_MAJOR "3"' \
--replace-fail 'TR_VERSION_MINOR "${realVersion.minor}"' 'TR_VERSION_MINOR "0"' \
--replace-fail 'TR_VERSION_PATCH "${realVersion.patch}"' 'TR_VERSION_PATCH "0"' \
--replace-fail 'set(TR_USER_AGENT_PREFIX "''${TR_SEMVER}")' 'set(TR_USER_AGENT_PREFIX "3.00")'
'';
});
in
{ {
sane.persist.sys.byStore.plaintext = [ sane.persist.sys.byStore.plaintext = [
# TODO: mode? we need this specifically for the stats tracking in .config/ # TODO: mode? we need this specifically for the stats tracking in .config/
{ user = "transmission"; group = config.users.users.transmission.group; path = "/var/lib/transmission"; } { user = "transmission"; group = config.users.users.transmission.group; path = "/var/lib/transmission"; method = "bind"; }
]; ];
users.users.transmission.extraGroups = [ "media" ]; users.users.transmission.extraGroups = [ "media" ];
services.transmission.enable = true; services.transmission.enable = true;
services.transmission.package = pkgs.transmission_4; #< 2023/09/06: nixpkgs `transmission` defaults to old 3.00 services.transmission.package = package;
#v setting `group` this way doesn't tell transmission to `chown` the files it creates #v setting `group` this way doesn't tell transmission to `chown` the files it creates
# it's a nixpkgs setting which just runs the transmission daemon as this group # it's a nixpkgs setting which just runs the transmission daemon as this group
services.transmission.group = "media"; services.transmission.group = "media";
@@ -16,10 +39,12 @@
# transmission will by default not allow the world to read its files. # transmission will by default not allow the world to read its files.
services.transmission.downloadDirPermissions = "775"; services.transmission.downloadDirPermissions = "775";
services.transmission.extraFlags = [ services.transmission.extraFlags = [
"--log-level=debug" # "--log-level=debug"
]; ];
services.transmission.settings = { services.transmission.settings = {
# 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 # 0.0.0.0 => allow rpc from any host: we gate it via firewall and auth requirement
rpc-bind-address = "0.0.0.0"; rpc-bind-address = "0.0.0.0";
@@ -39,9 +64,9 @@
encryption = 2; encryption = 2;
# units in kBps # units in kBps
speed-limit-down = 3000; speed-limit-down = 12000;
speed-limit-down-enabled = true; speed-limit-down-enabled = true;
speed-limit-up = 600; speed-limit-up = 800;
speed-limit-up-enabled = true; speed-limit-up-enabled = true;
# see: https://git.zknt.org/mirror/transmission/commit/cfce6e2e3a9b9d31a9dafedd0bdc8bf2cdb6e876?lang=bg-BG # see: https://git.zknt.org/mirror/transmission/commit/cfce6e2e3a9b9d31a9dafedd0bdc8bf2cdb6e876?lang=bg-BG

View File

@@ -1,22 +1,22 @@
{ lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
imports = [ imports = [
./feeds.nix ./feeds.nix
./fs.nix ./fs.nix
./hardware ./hardware
./home ./home
./hostnames.nix
./hosts.nix ./hosts.nix
./ids.nix ./ids.nix
./machine-id.nix ./machine-id.nix
./net.nix ./net
./nix-path ./nix
./persist.nix ./persist.nix
./polyunfill.nix
./programs ./programs
./secrets.nix ./secrets.nix
./ssh.nix ./ssh.nix
./systemd.nix
./users ./users
./vpn.nix
]; ];
sane.nixcache.enable-trusted-keys = true; sane.nixcache.enable-trusted-keys = true;
@@ -32,91 +32,28 @@
# time.timeZone = "America/Los_Angeles"; # time.timeZone = "America/Los_Angeles";
time.timeZone = "Etc/UTC"; # DST is too confusing for me => use a stable timezone time.timeZone = "Etc/UTC"; # DST is too confusing for me => use a stable timezone
nix.extraOptions = ''
# see: `man nix.conf`
# useful when a remote builder has a faster internet connection than me
builders-use-substitutes = true # default: false
# maximum seconds to wait when connecting to binary substituter
connect-timeout = 3 # default: 0
# download-attempts = 5 # default: 5
# allow `nix flake ...` command
experimental-features = nix-command flakes
# whether to build from source when binary substitution fails
fallback = true # default: false
# whether to keep building dependencies if any other one fails
keep-going = true # default: false
# whether to keep build-only dependencies of GC roots (e.g. C compiler) when doing GC
keep-outputs = true # default: false
# how many lines to show from failed build
log-lines = 30 # default: 10
# narinfo-cache-negative-ttl = 3600 # default: 3600
# whether to use ~/.local/state/nix/profile instead of ~/.nix-profile, etc
use-xdg-base-directories = true # default: false
# whether to warn if repository has uncommited changes
warn-dirty = false # default: true
'';
# hardlinks identical files in the nix store to save 25-35% disk space.
# unclear _when_ this occurs. it's not a service.
# does the daemon continually scan the nix store?
# does the builder use some content-addressed db to efficiently dedupe?
nix.settings.auto-optimise-store = true;
# TODO: see if i can remove this?
nix.settings.trusted-users = [ "root" ];
services.journald.extraConfig = ''
# docs: `man journald.conf`
# merged journald config is deployed to /etc/systemd/journald.conf
[Journal]
# disable journal compression because the underlying fs is compressed
Compress=no
'';
systemd.services.nix-daemon.serviceConfig = {
# the nix-daemon manages nix builders
# kill nix-daemon subprocesses when systemd-oomd detects an out-of-memory condition
# see:
# - nixos PR that enabled systemd-oomd: <https://github.com/NixOS/nixpkgs/pull/169613>
# - systemd's docs on these properties: <https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html#ManagedOOMSwap=auto%7Ckill>
#
# systemd's docs warn that without swap, systemd-oomd might not be able to react quick enough to save the system.
# see `man oomd.conf` for further tunables that may help.
#
# alternatively, apply this more broadly with `systemd.oomd.enableSystemSlice = true` or `enableRootSlice`
# TODO: also apply this to the guest user's slice (user-1100.slice)
# TODO: also apply this to distccd
ManagedOOMMemoryPressure = "kill";
ManagedOOMSwap = "kill";
};
system.activationScripts.nixClosureDiff = { system.activationScripts.nixClosureDiff = {
supportsDryActivation = true; supportsDryActivation = true;
text = '' text = ''
# show which packages changed versions or are new/removed in this upgrade # show which packages changed versions or are new/removed in this upgrade
# source: <https://github.com/luishfonseca/dotfiles/blob/32c10e775d9ec7cc55e44592a060c1c9aadf113e/modules/upgrade-diff.nix> # source: <https://github.com/luishfonseca/dotfiles/blob/32c10e775d9ec7cc55e44592a060c1c9aadf113e/modules/upgrade-diff.nix>
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig" # modified to not error on boot (when /run/current-system doesn't exist)
if [ -d /run/current-system ]; then
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
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
''; '';
}; };
# disable non-required packages like nano, perl, rsync, strace
environment.defaultPackages = [];
# dconf docs: <https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/desktop_migration_and_administration_guide/profiles>
# this lets programs temporarily write user-level dconf settings (aka gsettings).
# they're written to ~/.config/dconf/user, unless `DCONF_PROFILE` is set to something other than the default of /etc/dconf/profile/user
# find keys/values with `dconf dump /`
programs.dconf.enable = true;
programs.dconf.packages = [
(pkgs.writeTextFile {
name = "dconf-user-profile";
destination = "/etc/dconf/profile/user";
text = ''
user-db:user
system-db:site
'';
})
];
# sane.programs.glib.enableFor.user.colin = true; # for `gsettings`
# 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

@@ -1,4 +1,5 @@
# where to find good stuff? # where to find good stuff?
# - universal search/directory: <https://podcastindex.org>
# - podcasts w/ a community: <https://lemmyverse.net/communities?query=podcast> # - podcasts w/ a community: <https://lemmyverse.net/communities?query=podcast>
# - podcast rec thread: <https://lemmy.ml/post/1565858> # - podcast rec thread: <https://lemmy.ml/post/1565858>
# #
@@ -50,6 +51,8 @@ let
else else
"infrequent" "infrequent"
)); ));
} // lib.optionalAttrs (lib.hasPrefix "https://www.youtube.com/" raw.url) {
format = "video";
} // lib.optionalAttrs (raw.is_podcast or false) { } // lib.optionalAttrs (raw.is_podcast or false) {
format = "podcast"; format = "podcast";
} // lib.optionalAttrs (raw.title or "" != "") { } // lib.optionalAttrs (raw.title or "" != "") {
@@ -60,6 +63,7 @@ let
(fromDb "acquiredlpbonussecretsecret.libsyn.com" // tech) # ACQ2 - more "Acquired" episodes (fromDb "acquiredlpbonussecretsecret.libsyn.com" // tech) # ACQ2 - more "Acquired" episodes
(fromDb "allinchamathjason.libsyn.com" // pol) (fromDb "allinchamathjason.libsyn.com" // pol)
(fromDb "anchor.fm/s/34c7232c/podcast/rss" // tech) # Civboot -- https://anchor.fm/civboot (fromDb "anchor.fm/s/34c7232c/podcast/rss" // tech) # Civboot -- https://anchor.fm/civboot
(fromDb "anchor.fm/s/2da69154/podcast/rss" // tech) # POD OF JAKE -- https://podofjake.com/
(fromDb "cast.postmarketos.org" // tech) (fromDb "cast.postmarketos.org" // tech)
(fromDb "congressionaldish.libsyn.com" // pol) # Jennifer Briney (fromDb "congressionaldish.libsyn.com" // pol) # Jennifer Briney
(fromDb "craphound.com" // pol) # Cory Doctorow -- both podcast & text entries (fromDb "craphound.com" // pol) # Cory Doctorow -- both podcast & text entries
@@ -69,22 +73,21 @@ let
(fromDb "feeds.feedburner.com/80000HoursPodcast" // rat) (fromDb "feeds.feedburner.com/80000HoursPodcast" // rat)
(fromDb "feeds.feedburner.com/dancarlin/history" // rat) (fromDb "feeds.feedburner.com/dancarlin/history" // rat)
(fromDb "feeds.feedburner.com/radiolab" // pol) # Radiolab -- also available here, but ONLY OVER HTTP: <http://feeds.wnyc.org/radiolab> (fromDb "feeds.feedburner.com/radiolab" // pol) # Radiolab -- also available here, but ONLY OVER HTTP: <http://feeds.wnyc.org/radiolab>
(fromDb "feeds.libsyn.com/421877" // rat) # Less Wrong Curated
(fromDb "feeds.megaphone.fm/behindthebastards" // pol) # also Maggie Killjoy (fromDb "feeds.megaphone.fm/behindthebastards" // pol) # also Maggie Killjoy
(fromDb "feeds.megaphone.fm/hubermanlab" // uncat) # Daniel Huberman on sleep
(fromDb "feeds.megaphone.fm/recodedecode" // tech) # The Verge - Decoder (fromDb "feeds.megaphone.fm/recodedecode" // tech) # The Verge - Decoder
(fromDb "feeds.simplecast.com/54nAGcIl" // pol) # The Daily (fromDb "feeds.simplecast.com/54nAGcIl" // pol) # The Daily
(fromDb "feeds.simplecast.com/82FI35Px" // pol) # Ezra Klein Show (fromDb "feeds.simplecast.com/82FI35Px" // pol) # Ezra Klein Show
(fromDb "feeds.simplecast.com/wgl4xEgL" // rat) # Econ Talk (fromDb "feeds.simplecast.com/wgl4xEgL" // rat) # Econ Talk
(fromDb "feeds.simplecast.com/xKJ93w_w" // uncat) # Atlas Obscura (fromDb "feeds.simplecast.com/xKJ93w_w" // uncat) # Atlas Obscura
(fromDb "feeds.simplecast.com/l2i9YnTd" // tech // pol) # Hard Fork (NYtimes tech)
(fromDb "feeds.transistor.fm/acquired" // tech) (fromDb "feeds.transistor.fm/acquired" // tech)
(fromDb "fulltimenix.com" // 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 "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/the-dollop-with-dave-anthony-and-gareth-reynolds") # The Dollop history/comedy
(fromDb "originstories.libsyn.com" // uncat)
(fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol) (fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol)
(fromDb "podcast.thelinuxexp.com" // tech)
(fromDb "politicalorphanage.libsyn.com" // pol) (fromDb "politicalorphanage.libsyn.com" // pol)
(fromDb "reverseengineering.libsyn.com/rss" // tech) # UnNamed Reverse Engineering Podcast (fromDb "reverseengineering.libsyn.com/rss" // tech) # UnNamed Reverse Engineering Podcast
(fromDb "rss.acast.com/deconstructed") # The Intercept - Deconstructed (fromDb "rss.acast.com/deconstructed") # The Intercept - Deconstructed
@@ -93,17 +96,22 @@ let
(fromDb "rss.art19.com/60-minutes" // pol) (fromDb "rss.art19.com/60-minutes" // pol)
(fromDb "rss.art19.com/the-portal" // rat) # Eric Weinstein (fromDb "rss.art19.com/the-portal" // rat) # Eric Weinstein
(fromDb "seattlenice.buzzsprout.com" // pol) (fromDb "seattlenice.buzzsprout.com" // pol)
(fromDb "srslywrong.com" // pol)
(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 "techwontsave.us" // pol) # rec by Cory Doctorow (fromDb "techwontsave.us" // pol) # rec by Cory Doctorow
# (fromDb "trashfuturepodcast.podbean.com" // pol) # rec by Cory Doctorow, but way rambly
(fromDb "wakingup.libsyn.com" // pol) # Sam Harris (fromDb "wakingup.libsyn.com" // pol) # Sam Harris
(fromDb "werenotwrong.fireside.fm" // pol) (fromDb "werenotwrong.fireside.fm" // pol)
# (fromDb "feeds.libsyn.com/421877" // rat) # Less Wrong Curated
# (fromDb "feeds.megaphone.fm/hubermanlab" // uncat) # Daniel Huberman on sleep
# (fromDb "feeds.simplecast.com/l2i9YnTd" // tech // pol) # Hard Fork (NYtimes tech)
# (fromDb "podcast.thelinuxexp.com" // tech) # low-brow linux/foss PR announcements
# (fromDb "rss.art19.com/your-welcome" // pol) # Michael Malice - Your Welcome -- also available here: <https://origin.podcastone.com/podcast?categoryID2=2232> # (fromDb "rss.art19.com/your-welcome" // pol) # Michael Malice - Your Welcome -- also available here: <https://origin.podcastone.com/podcast?categoryID2=2232>
# (fromDb "rss.prod.firstlook.media/deconstructed/podcast.rss" // pol) #< possible URL rot # (fromDb "rss.prod.firstlook.media/deconstructed/podcast.rss" // pol) #< possible URL rot
# (fromDb "rss.prod.firstlook.media/intercepted/podcast.rss" // pol) #< possible URL rot # (fromDb "rss.prod.firstlook.media/intercepted/podcast.rss" // pol) #< possible URL rot
# (fromDb "trashfuturepodcast.podbean.com" // pol) # rec by Cory Doctorow, but way rambly
# (mkPod "https://anchor.fm/s/21bc734/podcast/rss" // pol // infrequent) # Emerge: making sense of what's next -- <https://www.whatisemerging.com/emergepodcast> # (mkPod "https://anchor.fm/s/21bc734/podcast/rss" // pol // infrequent) # Emerge: making sense of what's next -- <https://www.whatisemerging.com/emergepodcast>
# (mkPod "https://audioboom.com/channels/5097784.rss" // tech) # Lateral with Tom Scott # (mkPod "https://audioboom.com/channels/5097784.rss" // tech) # Lateral with Tom Scott
# (mkPod "https://feeds.megaphone.fm/RUNMED9919162779" // pol // infrequent) # The Witch Trials of J.K. Rowling: <https://www.thefp.com/witchtrials> # (mkPod "https://feeds.megaphone.fm/RUNMED9919162779" // pol // infrequent) # The Witch Trials of J.K. Rowling: <https://www.thefp.com/witchtrials>
@@ -111,137 +119,120 @@ let
]; ];
texts = [ texts = [
# AGGREGATORS (> 1 post/day) (fromDb "acoup.blog/feed") # history, states. author: <https://historians.social/@bretdevereaux/following>
(fromDb "lwn.net" // tech) (fromDb "amosbbatto.wordpress.com" // tech)
# (fromDb "lesswrong.com" // rat) (fromDb "applieddivinitystudies.com" // rat)
(fromDb "artemis.sh" // tech)
(fromDb "ascii.textfiles.com" // tech) # Jason Scott
(fromDb "austinvernon.site" // tech)
# (fromDb "balajis.com" // pol) # Balaji
(fromDb "ben-evans.com/benedictevans" // pol)
(fromDb "bitbashing.io" // tech)
(fromDb "bitsaboutmoney.com" // uncat)
(fromDb "blog.danieljanus.pl" // tech)
(fromDb "blog.dshr.org" // pol) # David Rosenthal
(fromDb "blog.jmp.chat" // tech)
(fromDb "blog.rust-lang.org" // tech)
(fromDb "blog.thalheim.io" // tech) # Mic92
(fromDb "bunniestudios.com" // tech) # Bunnie Juang
(fromDb "capitolhillseattle.com" // pol)
# (fromDb "drewdevault.com" // tech)
# (fromDb "econlib.org" // pol) # (fromDb "econlib.org" // pol)
(fromDb "edwardsnowden.substack.com" // pol // text)
# AGGREGATORS (< 1 post/day) (fromDb "fasterthanli.me" // tech)
(fromDb "gwern.net" // rat)
(fromDb "harihareswara.net" // tech // pol) # rec by Cory Doctorow
(fromDb "ianthehenry.com" // tech)
(fromDb "idiomdrottning.org" // uncat)
(fromDb "interconnected.org/home/feed" // rat) # Matt Webb -- engineering-ish, but dreamy
(fromDb "jeffgeerling.com" // tech)
(fromDb "jefftk.com" // tech)
(fromDb "kill-the-newsletter.com/feeds/joh91bv7am2pnznv.xml" // pol) # Matt Levine - Money Stuff
(fromDb "kosmosghost.github.io/index.xml" // tech)
# (fromDb "lesswrong.com" // rat)
(fromDb "linmob.net" // tech)
(fromDb "lwn.net" // tech)
(fromDb "lynalden.com" // pol)
(fromDb "mako.cc/copyrighteous" // tech // pol) # rec by Cory Doctorow
(fromDb "mg.lol" // tech)
(fromDb "mindingourway.com" // rat)
(fromDb "morningbrew.com/feed" // pol)
(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 "pomeroyb.com" // tech)
(fromDb "preposterousuniverse.com" // rat) # Sean Carroll
(fromDb "profectusmag.com" // uncat) (fromDb "profectusmag.com" // uncat)
(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 "richardcarrier.info" // rat)
(fromDb "rifters.com/crawl" // uncat) # No Moods, Ads or Cutesy Fucking Icons
(fromDb "righto.com" // tech) # Ken Shirriff
(fromDb "rootsofprogress.org" // rat) # Jason Crawford
(fromDb "sagacioussuricata.com" // tech) # ian (Sanctuary)
(fromDb "semiaccurate.com" // tech) (fromDb "semiaccurate.com" // tech)
(mkText "https://linuxphoneapps.org/blog/atom.xml" // tech // infrequent) (fromDb "sideways-view.com" // rat) # Paul Christiano
(fromDb "tuxphones.com" // tech) (fromDb "slimemoldtimemold.com" // rat)
(fromDb "spectrum.ieee.org" // tech) (fromDb "spectrum.ieee.org" // tech)
(fromDb "stpeter.im/atom.xml" // pol)
# (fromDb "theregister.com" // tech) # (fromDb "theregister.com" // tech)
(fromDb "thisweek.gnome.org" // tech) (fromDb "thisweek.gnome.org" // tech)
# more nixos stuff here, but unclear how to subscribe: <https://nixos.org/blog/categories.html> (fromDb "tuxphones.com" // tech)
(mkText "https://nixos.org/blog/announcements-rss.xml" // tech // infrequent)
(mkText "https://nixos.org/blog/stories-rss.xml" // tech // weekly)
## n.b.: 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)
## No Moods, Ads or Cutesy Fucking Icons
(fromDb "rifters.com/crawl" // uncat)
# DEVELOPERS
(fromDb "blog.jmp.chat" // tech)
(fromDb "uninsane.org" // tech) (fromDb "uninsane.org" // tech)
(fromDb "blog.thalheim.io" // tech) # Mic92 (fromDb "unintendedconsequenc.es" // rat)
(fromDb "ascii.textfiles.com" // tech) # Jason Scott # (fromDb "vitalik.ca" // tech) # moved to vitalik.eth.limo
(fromDb "vitalik.eth.limo" // tech) # Vitalik Buterin
(fromDb "webcurious.co.uk" // uncat)
(fromDb "xn--gckvb8fzb.com" // tech) (fromDb "xn--gckvb8fzb.com" // tech)
(fromDb "amosbbatto.wordpress.com" // tech) (mkSubstack "astralcodexten" // rat // daily) # Scott Alexander
(fromDb "fasterthanli.me" // tech)
(fromDb "jeffgeerling.com" // tech)
(fromDb "mg.lol" // tech)
# (fromDb "drewdevault.com" // tech)
## Ken Shirriff
(fromDb "righto.com" // tech)
## shared blog by a few NixOS devs, notably onny
(fromDb "project-insanity.org" // tech)
## Vitalik Buterin
(fromDb "vitalik.ca" // tech)
## ian (Sanctuary)
(fromDb "sagacioussuricata.com" // tech)
(fromDb "artemis.sh" // tech)
## Bunnie Juang
(fromDb "bunniestudios.com" // tech)
(fromDb "blog.danieljanus.pl" // tech)
(fromDb "ianthehenry.com" // tech)
(fromDb "bitbashing.io" // tech)
(fromDb "idiomdrottning.org" // uncat)
(mkText "http://boginjr.com/feed" // tech // infrequent)
(mkText "https://anish.lakhwara.com/home.html" // tech // weekly)
(fromDb "jefftk.com" // tech)
(fromDb "pomeroyb.com" // tech)
(fromDb "harihareswara.net" // tech // pol) # rec by Cory Doctorow
(fromDb "mako.cc/copyrighteous" // tech // pol) # rec by Cory Doctorow
# (mkText "https://til.simonwillison.net/tils/feed.atom" // tech // weekly)
# TECH PROJECTS
(fromDb "blog.rust-lang.org" // tech)
# (TECH; POL) COMMENTATORS
## Matt Webb -- engineering-ish, but dreamy
(fromDb "interconnected.org/home/feed" // rat)
(fromDb "edwardsnowden.substack.com" // pol // text)
## Julia Evans
(mkText "https://jvns.ca/atom.xml" // tech // weekly)
(mkText "http://benjaminrosshoffman.com/feed" // pol // weekly)
## Ben Thompson
(mkText "https://www.stratechery.com/rss" // pol // weekly)
## Balaji
(fromDb "balajis.com" // pol)
(fromDb "ben-evans.com/benedictevans" // pol)
(fromDb "lynalden.com" // pol)
(fromDb "austinvernon.site" // tech)
(mkSubstack "oversharing" // pol // daily)
(mkSubstack "byrnehobart" // pol // infrequent) (mkSubstack "byrnehobart" // pol // infrequent)
# (mkSubstack "doomberg" // tech // weekly) # articles are all pay-walled # (mkSubstack "doomberg" // tech // weekly) # articles are all pay-walled
## David Rosenthal
(fromDb "blog.dshr.org" // pol)
## Matt Levine
(mkText "https://www.bloomberg.com/opinion/authors/ARbTQlRLRjE/matthew-s-levine.rss" // pol // weekly)
(fromDb "stpeter.im/atom.xml" // pol)
## Peter Saint-Andre -- side project of stpeter.im
(fromDb "philosopher.coach" // rat)
(fromDb "morningbrew.com/feed" // pol)
# RATIONALITY/PHILOSOPHY/ETC
(mkSubstack "samkriss" // humor // infrequent)
(fromDb "unintendedconsequenc.es" // rat)
(fromDb "applieddivinitystudies.com" // rat)
(fromDb "slimemoldtimemold.com" // rat)
(fromDb "richardcarrier.info" // rat)
(fromDb "gwern.net" // rat)
## Jason Crawford
(fromDb "rootsofprogress.org" // rat)
## Robin Hanson
(fromDb "overcomingbias.com" // rat)
## Scott Alexander
(mkSubstack "astralcodexten" // rat // daily)
## Paul Christiano
(fromDb "sideways-view.com" // rat)
## Sean Carroll
(fromDb "preposterousuniverse.com" // rat)
(mkSubstack "eliqian" // rat // weekly) (mkSubstack "eliqian" // rat // weekly)
(mkText "https://acoup.blog/feed" // rat // weekly) (mkSubstack "oversharing" // pol // daily)
(fromDb "mindingourway.com" // rat) (mkSubstack "samkriss" // humor // infrequent)
(mkText "http://benjaminrosshoffman.com/feed" // pol // weekly)
## mostly dating topics. not advice, or humor, but looking through a social lens (mkText "http://boginjr.com/feed" // tech // infrequent)
(fromDb "putanumonit.com" // rat) (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/>
# LOCAL
(fromDb "capitolhillseattle.com" // pol)
# CODE
# (mkText "https://github.com/Kaiteki-Fedi/Kaiteki/commits/master.atom" // tech // infrequent) # (mkText "https://github.com/Kaiteki-Fedi/Kaiteki/commits/master.atom" // tech // infrequent)
(mkText "https://jvns.ca/atom.xml" // tech // weekly) # Julia Evans
(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/stories-rss.xml" // 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.stratechery.com/rss" // pol // weekly) # Ben Thompson
];
videos = [
(fromDb "youtube.com/@Channel5YouTube" // pol)
(fromDb "youtube.com/@ColdFusion")
(fromDb "youtube.com/@ContraPoints" // pol)
(fromDb "youtube.com/@Exurb1a")
(fromDb "youtube.com/@hbomberguy")
(fromDb "youtube.com/@JackStauber")
(fromDb "youtube.com/@PolyMatter")
# (fromDb "youtube.com/@rossmanngroup" // pol // tech) # Louis Rossmann
(fromDb "youtube.com/@TechnologyConnections" // tech)
(fromDb "youtube.com/@TheB1M")
(fromDb "youtube.com/@TomScottGo")
(fromDb "youtube.com/@Vihart")
(fromDb "youtube.com/@Vox")
(fromDb "youtube.com/@Vsauce")
]; ];
images = [ images = [
(fromDb "smbc-comics.com" // img // humor) (fromDb "catandgirl.com" // img // humor)
(fromDb "xkcd.com" // img // humor)
(fromDb "turnoff.us" // img // humor)
(fromDb "pbfcomics.com" // img // humor)
# (mkImg "http://dilbert.com/feed" // humor // daily)
(fromDb "poorlydrawnlines.com/feed" // img // humor)
# ART
(fromDb "miniature-calendar.com" // img // art // daily) (fromDb "miniature-calendar.com" // img // art // daily)
(fromDb "pbfcomics.com" // img // humor)
(fromDb "poorlydrawnlines.com/feed" // img // humor)
(fromDb "smbc-comics.com" // img // humor)
(fromDb "turnoff.us" // img // humor)
(fromDb "xkcd.com" // img // humor)
]; ];
in in
{ {
sane.feeds = texts ++ images ++ podcasts; sane.feeds = texts ++ images ++ podcasts ++ videos;
assertions = builtins.map assertions = builtins.map
(p: { (p: {

View File

@@ -1,5 +1,6 @@
# docs # docs
# - 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`
{ lib, pkgs, sane-lib, ... }: { lib, pkgs, sane-lib, ... }:
@@ -8,13 +9,22 @@ let
common = [ common = [
"_netdev" "_netdev"
"noatime" "noatime"
"user" # allow any user with access to the device to mount the fs # user: allow any user with access to the device to mount the fs.
# note that this requires a suid `mount` binary; see: <https://zameermanji.com/blog/2022/8/5/using-fuse-without-root-on-linux/>
"user"
"x-systemd.requires=network-online.target" "x-systemd.requires=network-online.target"
"x-systemd.after=network-online.target" "x-systemd.after=network-online.target"
"x-systemd.mount-timeout=10s" # how long to wait for mount **and** how long to wait for unmount "x-systemd.mount-timeout=10s" # how long to wait for mount **and** how long to wait for unmount
]; ];
auto = [ "x-systemd.automount" ]; # x-systemd.automount: mount the fs automatically *on first access*.
noauto = [ "noauto" ]; # don't mount as part of remote-fs.target # creates a `path-to-mount.automount` systemd unit.
automount = [ "x-systemd.automount" ];
# noauto: don't mount as part of remote-fs.target.
# N.B.: `remote-fs.target` is a dependency of multi-user.target, itself of graphical.target.
# hence, omitting `noauto` can slow down boots.
noauto = [ "noauto" ];
# lazyMount: defer mounting until first access from userspace
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"
@@ -22,19 +32,34 @@ let
ssh = common ++ [ ssh = common ++ [
"identityfile=/home/colin/.ssh/id_ed25519" "identityfile=/home/colin/.ssh/id_ed25519"
"allow_other" "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).
# N.B.: if both allow_root and allow_other are specified, then only allow_root takes effect.
# "allow_root"
# default_permissions: enforce local permissions check. CRUCIAL if using `allow_other`.
# w/o this, permissions mode of sshfs is like:
# - sshfs runs all remote commands as the remote user.
# - if a local user has local permissions to the sshfs mount, then their file ops are sent blindly across the tunnel.
# - `allow_other` allows *any* local user to access the mount, and hence any local user can now freely become the remote mapped user.
# 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 ++ [ sshColin = ssh ++ [
# 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.
# symlinks which point outside the mount ARE followed. so this is more capable than `transform_symlinks`
"follow_symlinks"
# 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.
"transform_symlinks" "transform_symlinks"
"idmap=user" "idmap=user"
"uid=1000" "uid=1000"
"gid=100" "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
"sftp_server=/run/wrappers/bin/sudo\\040/run/current-system/sw/libexec/sftp-server" # "sftp_server=/run/wrappers/bin/sudo\\040/run/current-system/sw/libexec/sftp-server"
]; # ];
# in the event of hunt NFS mounts, consider: # in the event of hunt NFS mounts, consider:
# - <https://unix.stackexchange.com/questions/31979/stop-broken-nfs-mounts-from-locking-a-directory> # - <https://unix.stackexchange.com/questions/31979/stop-broken-nfs-mounts-from-locking-a-directory>
@@ -57,13 +82,17 @@ let
]; ];
}; };
remoteHome = host: { remoteHome = host: {
fileSystems."/mnt/${host}-home" = { fileSystems."/mnt/${host}/home" = {
device = "colin@${host}:/home/colin"; device = "colin@${host}:/home/colin";
fsType = "fuse.sshfs"; fsType = "fuse.sshfs";
options = fsOpts.sshColin ++ fsOpts.noauto; options = fsOpts.sshColin ++ fsOpts.lazyMount;
noCheck = true; noCheck = true;
}; };
sane.fs."/mnt/${host}-home" = sane-lib.fs.wantedDir; sane.fs."/mnt/${host}/home" = sane-lib.fs.wanted {
dir.acl.user = "colin";
dir.acl.group = "users";
dir.acl.mode = "0700";
};
}; };
in in
lib.mkMerge [ lib.mkMerge [
@@ -103,34 +132,38 @@ lib.mkMerge [
# device = "servo-hn:/"; # device = "servo-hn:/";
# noCheck = true; # noCheck = true;
# fsType = "nfs"; # fsType = "nfs";
# options = fsOpts.nfs ++ fsOpts.auto ++ fsOpts.wg; # options = fsOpts.nfs ++ fsOpts.automount ++ fsOpts.wg;
# }; # };
fileSystems."/mnt/servo-nfs/media" = { fileSystems."/mnt/servo/media" = {
device = "servo-hn:/media"; device = "servo-hn:/media";
noCheck = true; noCheck = true;
fsType = "nfs"; fsType = "nfs";
options = fsOpts.nfs ++ fsOpts.auto ++ fsOpts.wg; options = fsOpts.nfs ++ fsOpts.lazyMount ++ fsOpts.wg;
}; };
fileSystems."/mnt/servo-nfs/playground" = { 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"; device = "servo-hn:/playground";
noCheck = true; noCheck = true;
fsType = "nfs"; fsType = "nfs";
options = fsOpts.nfs ++ fsOpts.auto ++ fsOpts.wg; 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";
}; };
# fileSystems."/mnt/servo-media-nfs" = {
# device = "servo-hn:/media";
# noCheck = true;
# fsType = "nfs";
# options = fsOpts.common ++ fsOpts.auto;
# };
sane.fs."/mnt/servo-media" = sane-lib.fs.wantedSymlinkTo "/mnt/servo-nfs/media";
environment.pathsToLink = [ # environment.pathsToLink = [
# needed to achieve superuser access for user-mounted filesystems (see optionsRoot 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
"/libexec" # "/libexec"
]; # ];
programs.fuse.userAllowOther = true; #< necessary for `allow_other` or `allow_root` options.
environment.systemPackages = [ environment.systemPackages = [
pkgs.sshfs-fuse pkgs.sshfs-fuse
]; ];

View File

@@ -1,4 +1,4 @@
{ lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
imports = [ imports = [
@@ -28,6 +28,13 @@
# "systemd.log_level=debug" # "systemd.log_level=debug"
# "systemd.log_target=console" # "systemd.log_target=console"
# moby has to run recent kernels (defined elsewhere).
# meanwhile, kernel variation plays some minor role in things like sandboxing (landlock) and capabilities.
# simpler to keep near the latest kernel on all devices,
# and also makes certain that any weird system-level bugs i see aren't likely to be stale kernel bugs.
# servo needs zfs though, which doesn't support every kernel.
boot.kernelPackages = lib.mkDefault pkgs.zfs.latestCompatibleLinuxPackages;
# hack in the `boot.shell_on_fail` arg since that doesn't always seem to work. # hack in the `boot.shell_on_fail` arg since that doesn't always seem to work.
boot.initrd.preFailCommands = "allowShell=1"; boot.initrd.preFailCommands = "allowShell=1";
@@ -40,6 +47,12 @@
# non-free firmware # non-free firmware
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
# default is 252274, which is too low particularly for servo.
# manifests as spurious "No space left on device" when trying to install watches,
# e.g. in dyn-dns by `systemctl start dyn-dns-watcher.path`.
# see: <https://askubuntu.com/questions/828779/failed-to-add-run-systemd-ask-password-to-directory-watch-no-space-left-on-dev>
boot.kernel.sysctl."fs.inotify.max_user_watches" = 1048576;
# powertop will default to putting USB devices -- including HID -- to sleep after TWO SECONDS # powertop will default to putting USB devices -- including HID -- to sleep after TWO SECONDS
powerManagement.powertop.enable = false; powerManagement.powertop.enable = false;
# linux CPU governor: <https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt> # linux CPU governor: <https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt>
@@ -58,10 +71,19 @@
powerManagement.cpuFreqGovernor = "ondemand"; powerManagement.cpuFreqGovernor = "ondemand";
services.logind.extraConfig = '' services.logind.extraConfig = ''
# dont shutdown when power button is short-pressed # see: `man logind.conf`
HandlePowerKey=ignore # dont shutdown when power button is short-pressed (commonly done an accident, or by cats).
# but do on long-press: useful to gracefully power-off server.
HandlePowerKey=lock
HandlePowerKeyLongPress=poweroff
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,7 +1,7 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./keyring ./fs.nix
./mime.nix ./mime.nix
./ssh.nix ./ssh.nix
./xdg-dirs.nix ./xdg-dirs.nix

42
hosts/common/home/fs.nix Normal file
View File

@@ -0,0 +1,42 @@
{ config, ... }:
{
sane.user.persist.byStore.plaintext = [
"archive"
"dev"
# TODO: records should be private
"records"
"ref"
"tmp"
"use"
"Books/local"
"Music"
"Pictures/albums"
"Pictures/cat"
"Pictures/from"
"Pictures/Screenshots" #< XXX: something is case-sensitive about this?
"Pictures/Photos"
"Videos/local"
# these are persisted simply to save on RAM.
# ~/.cache/nix can become several GB.
# mesa_shader_cache is < 10 MB.
# TODO: integrate with sane.programs.sandbox?
".cache/mesa_shader_cache"
".cache/nix"
];
sane.user.persist.byStore.private = [
"knowledge"
];
# convenience
sane.user.fs.".persist/private".symlink.target = config.sane.persist.stores.private.origin;
sane.user.fs.".persist/plaintext".symlink.target = config.sane.persist.stores.plaintext.origin;
sane.user.fs.".persist/ephemeral".symlink.target = config.sane.persist.stores.cryptClearOnBoot.origin;
sane.user.fs."nixos".symlink.target = "dev/nixos";
sane.user.fs."Books/servo".symlink.target = "/mnt/servo/media/Books";
sane.user.fs."Videos/servo".symlink.target = "/mnt/servo/media/Videos";
# sane.user.fs."Music/servo".symlink.target = "/mnt/servo/media/Music";
sane.user.fs."Pictures/servo-macros".symlink.target = "/mnt/servo/media/Pictures/macros";
}

View File

@@ -1,17 +0,0 @@
{ config, pkgs, sane-lib, ... }:
let
init-keyring = pkgs.static-nix-shell.mkBash {
pname = "init-keyring";
src = ./.;
};
in
{
sane.user.persist.byStore.private = [ ".local/share/keyrings" ];
sane.user.fs."private/.local/share/keyrings/default" = {
generated.command = [ "${init-keyring}/bin/init-keyring" ];
wantedBy = [ config.sane.fs."/home/colin/private".unit ];
wantedBeforeBy = [ ]; # don't created this as part of `multi-user.target`
};
}

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash
# initializes the default libsecret keyring (used by gnome-keyring) if not already initialized.
# this initializes it to be plaintext/unencrypted.
ringdir=/home/colin/private/.local/share/keyrings
if test -f "$ringdir/default"
then
echo 'keyring already initialized: not doing anything'
else
keyring="$ringdir/Default_keyring.keyring"
echo 'initializing default user keyring:' "$keyring.new"
echo '[keyring]' > "$keyring.new"
echo 'display-name=Default keyring' >> "$keyring.new"
echo 'lock-on-idle=false' >> "$keyring.new"
echo 'lock-after=false' >> "$keyring.new"
chown colin:users "$keyring.new"
# closest to an atomic update we can achieve
mv "$keyring.new" "$keyring" && echo -n "Default_keyring" > "$ringdir/default"
fi

View File

@@ -1,28 +1,94 @@
{ config, lib, ...}: # TODO: move into modules/users.nix
{ config, lib, pkgs, ...}:
let let
# ProgramConfig -> { "<mime-type>" = { priority, desktop }; } # [ ProgramConfig ]
weightedMimes = prog: builtins.mapAttrs (_key: desktop: { priority = prog.mime.priority; desktop = desktop; }) prog.mime.associations; enabledPrograms = builtins.filter
# [ { "<mime-type>" = { priority, desktop } ]; } ] -> { "<mime-type>" = [ { priority, desktop } ... ]; } (p: p.enabled)
mergeMimes = mimes: lib.foldAttrs (item: acc: [item] ++ acc) [] mimes; (builtins.attrValues config.sane.programs);
# [ { priority, desktop } ... ] -> Self
sortOneMimeType = associations: builtins.sort (l: r: assert l.priority != r.priority; l.priority < r.priority) associations;
sortMimes = mimes: builtins.mapAttrs (_k: sortOneMimeType) mimes;
removePriorities = mimes: builtins.mapAttrs (_k: associations: builtins.map (a: a.desktop) associations) mimes;
# [ ProgramConfig ] # [ ProgramConfig ]
enabledPrograms = builtins.filter (p: p.enabled) (builtins.attrValues config.sane.programs); enabledProgramsWithPackage = builtins.filter (p: p.package != null) enabledPrograms;
# [ { "<mime-type>" = { prority, desktop } ] # [ { "<mime-type>" = { prority, desktop } ]
enabledWeightedMimes = builtins.map weightedMimes enabledPrograms; enabledWeightedMimes = builtins.map weightedMimes enabledPrograms;
# ProgramConfig -> { "<mime-type>" = { priority, desktop }; }
weightedMimes = prog: builtins.mapAttrs
(_key: desktop: {
priority = prog.mime.priority; desktop = desktop;
})
prog.mime.associations;
# [ { "<mime-type>" = { priority, desktop } ]; } ] -> { "<mime-type>" = [ { priority, desktop } ... ]; }
mergeMimes = mimes: lib.foldAttrs (item: acc: [item] ++ acc) [] mimes;
# [ { priority, desktop } ... ] -> Self
sortOneMimeType = associations: builtins.sort
(l: r: lib.throwIf
(l.priority == r.priority)
"${l.desktop} and ${r.desktop} share a preferred mime type with identical priority ${builtins.toString l.priority} (and so the desired association is ambiguous)"
(l.priority < r.priority)
)
associations;
sortMimes = mimes: builtins.mapAttrs (_k: sortOneMimeType) mimes;
# { "<mime-type>"} = [ { priority, desktop } ... ]; } -> { "<mime-type>" = [ "<desktop>" ... ]; }
removePriorities = mimes: builtins.mapAttrs
(_k: associations: builtins.map (a: a.desktop) associations)
mimes;
# { "<mime-type>" = [ "<desktop>" ... ]; } -> { "<mime-type>" = "<desktop1>;<desktop2>;..."; }
formatDesktopLists = mimes: builtins.mapAttrs
(_k: desktops: lib.concatStringsSep ";" desktops)
mimes;
mimeappsListPkg = pkgs.writeTextDir "share/applications/mimeapps.list" (
lib.generators.toINI { } {
"Default Applications" = formatDesktopLists (removePriorities (sortMimes (mergeMimes enabledWeightedMimes)));
}
);
localShareApplicationsPkg = (pkgs.symlinkJoin {
name = "user-local-share-applications";
paths = builtins.map
(p: "${p.package}")
(enabledProgramsWithPackage ++ [ { package=mimeappsListPkg; } ]);
}).overrideAttrs (orig: {
# like normal symlinkJoin, but don't error if the path doesn't exist
buildCommand = ''
mkdir -p $out/share/applications
for i in $(cat $pathsPath); do
if [ -e "$i/share/applications" ]; then
${pkgs.buildPackages.xorg.lndir}/bin/lndir -silent $i/share/applications $out/share/applications
fi
done
runHook postBuild
'';
postBuild = ''
# rebuild `mimeinfo.cache`, used by file openers to show the list of *all* apps, not just the user's defaults.
${pkgs.buildPackages.desktop-file-utils}/bin/update-desktop-database $out/share/applications
'';
});
in in
{ {
# the xdg mime type for a file can be found with: # the xdg mime type for a file can be found with:
# - `xdg-mime query filetype path/to/thing.ext` # - `xdg-mime query filetype path/to/thing.ext`
# the default handler for a mime type can be found with: # the default handler for a mime type can be found with:
# - `xdg-mime query default <mimetype>` (e.g. x-scheme-handler/http) # - `xdg-mime query default <mimetype>` (e.g. x-scheme-handler/http)
# the nix-configured handler can be found `nix-repl > :lf . > hostConfigs.desko.xdg.mime.defaultApplications`
#
# glib/gio is queried via glib.bin output:
# - `gio mime x-scheme-handler/https`
# - `gio open <path_or_url>`
# - `gio launch </path/to/app.desktop>`
# #
# we can have single associations or a list of associations. # we can have single associations or a list of associations.
# there's also options to *remove* [non-default] associations from specific apps # there's also options to *remove* [non-default] associations from specific apps
xdg.mime.enable = true; # N.B.: don't use nixos' `xdg.mime` option becaue that caues `/share/applications` to be linked into the whole system,
xdg.mime.defaultApplications = removePriorities (sortMimes (mergeMimes enabledWeightedMimes)); # which limits what i can do around sandboxing. getting the default associations to live in ~/ makes it easier to expose
# the associations to apps selectively.
# xdg.mime.enable = true;
# xdg.mime.defaultApplications = removePriorities (sortMimes (mergeMimes enabledWeightedMimes));
sane.user.fs.".local/share/applications".symlink.target = "${localShareApplicationsPkg}/share/applications";
} }

View File

@@ -19,7 +19,7 @@
}; };
sane.hosts.by-name."moby" = { sane.hosts.by-name."moby" = {
ssh.authorized = lib.mkDefault false; # moby's too easy to hijack: don't let it ssh places # ssh.authorized = lib.mkDefault false; # moby's too easy to hijack: don't let it ssh places
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrR+gePnl0nV/vy7I5BzrGeyVL+9eOuXHU1yNE3uCwU"; ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrR+gePnl0nV/vy7I5BzrGeyVL+9eOuXHU1yNE3uCwU";
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1N/IT3nQYUD+dBlU1sTEEVMxfOyMkrrDeyHcYgnJvw"; ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1N/IT3nQYUD+dBlU1sTEEVMxfOyMkrrDeyHcYgnJvw";
wg-home.pubkey = "I7XIR1hm8bIzAtcAvbhWOwIAabGkuEvbWH/3kyIB1yA="; wg-home.pubkey = "I7XIR1hm8bIzAtcAvbhWOwIAabGkuEvbWH/3kyIB1yA=";
@@ -36,10 +36,4 @@
wg-home.endpoint = "uninsane.org:51820"; wg-home.endpoint = "uninsane.org:51820";
lan-ip = "10.78.79.51"; lan-ip = "10.78.79.51";
}; };
sane.hosts.by-name."supercap" = {
ssh.authorized = false;
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHf/mqqkX45EWAcquV04MC3SUljTApdclH1gjI19F+PA";
lan-ip = "10.78.79.232";
};
} }

View File

@@ -53,6 +53,12 @@
sane.ids.monero.gid = 2416; sane.ids.monero.gid = 2416;
sane.ids.slskd.uid = 2417; sane.ids.slskd.uid = 2417;
sane.ids.slskd.gid = 2417; sane.ids.slskd.gid = 2417;
sane.ids.bitcoind-mainnet.uid = 2418;
sane.ids.bitcoind-mainnet.gid = 2418;
sane.ids.clightning.uid = 2419;
sane.ids.clightning.gid = 2419;
sane.ids.nix-serve.uid = 2420;
sane.ids.nix-serve.gid = 2420;
sane.ids.colin.uid = 1000; sane.ids.colin.uid = 1000;
sane.ids.guest.uid = 1100; sane.ids.guest.uid = 1100;

View File

@@ -1,6 +1,30 @@
{ lib, ... }: { lib, ... }:
{ {
imports = [
./dns.nix
./hostnames.nix
./upnp.nix
./vpn.nix
];
systemd.network.enable = true;
networking.useNetworkd = true;
# view refused/dropped packets with: `sudo journalctl -k`
# networking.firewall.logRefusedPackets = true;
# networking.firewall.logRefusedUnicastsOnly = false;
networking.firewall.logReversePathDrops = true;
# linux will drop inbound packets if it thinks a reply to that packet wouldn't exit via the same interface (rpfilter).
# that heuristic fails for complicated VPN-style routing, especially with SNAT.
# networking.firewall.checkReversePath = false; # or "loose" to keep it partially.
# networking.firewall.enable = false; #< set false to debug
# this is needed to forward packets from the VPN to the host.
# this is required separately by servo and by any `sane-vpn` users,
# however Nix requires this be set centrally, in only one location (i.e. here)
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
# the default backend is "wpa_supplicant". # the default backend is "wpa_supplicant".
# wpa_supplicant reliably picks weak APs to connect to. # wpa_supplicant reliably picks weak APs to connect to.
# see: <https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/474> # see: <https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/474>
@@ -35,10 +59,6 @@
# e.g. openconnect drags in webkitgtk (for SSO)! # e.g. openconnect drags in webkitgtk (for SSO)!
networking.networkmanager.plugins = lib.mkForce []; networking.networkmanager.plugins = lib.mkForce [];
networking.firewall.allowedUDPPorts = [
1900 # to received UPnP advertisements. required by sane-ip-check-upnp
];
# keyfile.path = where networkmanager should look for connection credentials # keyfile.path = where networkmanager should look for connection credentials
networking.networkmanager.extraConfig = '' networking.networkmanager.extraConfig = ''
[keyfile] [keyfile]

67
hosts/common/net/dns.nix Normal file
View File

@@ -0,0 +1,67 @@
# things to consider when changing these parameters:
# - temporary VPN access (`sane-vpn up ...`)
# - servo `ovpns` namespace (it *relies* on /etc/resolv.conf mentioning 127.0.0.53)
# - jails: `firejail --net=br-ovpnd-us --noprofile --dns=46.227.67.134 ping 1.1.1.1`
#
# components:
# - /etc/nsswitch.conf:
# - glibc uses this to provide `getaddrinfo`, i.e. host -> ip address lookup
# call directly with `getent ahostsv4 www.google.com`
# - `nss` (a component of glibc) is modular: names mentioned in that file are `dlopen`'d (i think that's the mechanism)
# in NixOS, that means _they have to be on LDPATH_.
# - `nscd` is used by NixOS simply to proxy nss requests.
# here, /etc/nsswitch.conf consumers contact nscd via /var/run/nscd/socket.
# in this way, only `nscd` needs to have the nss modules on LDPATH.
# - /etc/resolv.conf
# - contains the DNS servers for a system.
# - historically, NetworkManager would update this file as you switch networks.
# - modern implementations hardcodes `127.0.0.53` and then systemd-resolved proxies everything (and caches).
#
# namespacing:
# - 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.
# - this is fixed by either `firejail --blacklist=/var/run/nscd/socket`, or disabling nscd altogether.
{ lib, ... }:
{
# use systemd's stub resolver.
# /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
# 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?)
# 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`.
# without DNSSEC:
# - dig matrix.org => works
# - curl https://matrix.org => works
# with default DNSSEC:
# - dig matrix.org => works
# - curl https://matrix.org => fails
# i don't know why. this might somehow be interfering with the DNS run on this device (trust-dns)
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"
];
# nscd -- the Name Service Caching Daemon -- caches DNS query responses
# in a way that's unaware of my VPN routing, so routes are frequently poor against
# services which advertise different IPs based on geolocation.
# nscd claims to be usable without a cache, but in practice i can't get it to not cache!
# nsncd is the Name Service NON-Caching Daemon. it's a drop-in that doesn't cache;
# this is OK on the host -- because systemd-resolved caches. it's probably sub-optimal
# in the netns and we query upstream DNS more often than needed. hm.
# services.nscd.enableNsncd = true;
# disabling nscd LOSES US SOME FUNCTIONALITY. in particular, only the glibc-builtin modules are accessible via /etc/resolv.conf.
# - dns: glibc-bultin
# - files: glibc-builtin
# - myhostname: systemd
# - mymachines: systemd
# - resolve: systemd
# in practice, i see no difference with nscd disabled.
# disabling nscd VASTLY simplifies netns and process isolation. see explainer at top of file.
services.nscd.enable = false;
system.nssModules = lib.mkForce [];
}

View File

@@ -1,4 +1,3 @@
# TODO: move to hosts/common/
{ config, lib, ... }: { config, lib, ... }:
{ {

20
hosts/common/net/upnp.nix Normal file
View File

@@ -0,0 +1,20 @@
{ pkgs, ... }:
{
networking.firewall.allowedUDPPorts = [
# to receive UPnP advertisements. required by sane-ip-check.
# N.B. sane-ip-check isn't query/response based. it needs to receive on port 1900 -- not receive responses FROM port 1900.
1900
];
networking.firewall.extraCommands = with pkgs; ''
# after an outgoing SSDP query to the multicast address, open FW for incoming responses.
# necessary for anything DLNA, especially go2tv
# source: <https://serverfault.com/a/911286>
# context: <https://github.com/alexballas/go2tv/issues/72>
# ipset -! means "don't fail if set already exists"
${ipset}/bin/ipset create -! upnp hash:ip,port timeout 10
${iptables}/bin/iptables -A OUTPUT -d 239.255.255.250/32 -p udp -m udp --dport 1900 -j SET --add-set upnp src,src --exist
${iptables}/bin/iptables -A INPUT -p udp -m set --match-set upnp dst,dst -j ACCEPT
'';
}

56
hosts/common/net/vpn.nix Normal file
View File

@@ -0,0 +1,56 @@
# to add a new OVPN VPN:
# - generate a privkey `wg genkey`
# - add this key to `sops secrets/universal.yaml`
# - upload pubkey to OVPN.com (`cat wg.priv | wg pubkey`)
# - generate config @ OVPN.com
# - copy the Address, PublicKey, Endpoint from OVPN's config
{ config, lib, pkgs, ... }:
let
def-ovpn = name: { endpoint, publicKey, addrV4, id }: {
sane.vpn."ovpnd-${name}" = {
inherit endpoint publicKey addrV4 id;
privateKeyFile = config.sops.secrets."wg/ovpnd_${name}_privkey".path;
dns = [
"46.227.67.134"
"192.165.9.158"
];
};
sops.secrets."wg/ovpnd_${name}_privkey" = {
# needs to be readable by systemd-network or else it says "Ignoring network device" and doesn't expose it to networkctl.
owner = "systemd-network";
};
};
in lib.mkMerge [
(def-ovpn "us" {
endpoint = "vpn31.prd.losangeles.ovpn.com:9929";
publicKey = "VW6bEWMOlOneta1bf6YFE25N/oMGh1E1UFBCfyggd0k=";
id = 1;
addrV4 = "172.27.237.218";
# addrV6 = "fd00:0000:1337:cafe:1111:1111:ab00:4c8f";
})
# TODO: us-atl disabled until i can give it a different link-local address and wireguard key than us-mi
# (def-ovpn "us-atl" {
# endpoint = "vpn18.prd.atlanta.ovpn.com:9929";
# publicKey = "Dpg/4v5s9u0YbrXukfrMpkA+XQqKIFpf8ZFgyw0IkE0=";
# address = [
# "172.21.182.178/32"
# "fd00:0000:1337:cafe:1111:1111:cfcb:27e3/128"
# ];
# })
(def-ovpn "us-mi" {
endpoint = "vpn34.prd.miami.ovpn.com:9929";
publicKey = "VtJz2irbu8mdkIQvzlsYhU+k9d55or9mx4A2a14t0V0=";
id = 2;
addrV4 = "172.21.182.178";
# addrV6 = "fd00:0000:1337:cafe:1111:1111:cfcb:27e3";
})
(def-ovpn "ukr" {
endpoint = "vpn96.prd.kyiv.ovpn.com:9929";
publicKey = "CjZcXDxaaKpW8b5As1EcNbI6+42A6BjWahwXDCwfVFg=";
id = 3;
addrV4 = "172.18.180.159";
# addrV6 = "fd00:0000:1337:cafe:1111:1111:ec5c:add3";
})
]

View File

@@ -1,16 +0,0 @@
{ pkgs, sane-lib, ... }:
{
# allow `nix-shell` (and probably nix-index?) to locate our patched and custom packages
nix.nixPath = [
"nixpkgs=${pkgs.path}"
# 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"
# as long as my system itself doesn't rely on NIXPKGS at runtime, we can point the overlays to git
# to avoid switching so much during development
"nixpkgs-overlays=/home/colin/dev/nixos/hosts/common/nix-path/overlay"
];
# ensure new deployments have a source of this repo with which they can bootstrap.
environment.etc."nixos".source = ../../..;
}

View File

@@ -0,0 +1,84 @@
{ config, lib, pkgs, ... }:
{
nix.settings = {
# see: `man nix.conf`
# useful when a remote builder has a faster internet connection than me.
# note that this also applies to `nix copy --to`, though.
# i think any time a remote machine wants a path, this means we ask them to try getting it themselves before we supply it.
builders-use-substitutes = true; # default: false
# maximum seconds to wait when connecting to binary substituter
connect-timeout = 3; # default: 0
# download-attempts = 5; # default: 5
# allow `nix flake ...` command
experimental-features = [ "nix-command" "flakes "];
# whether to build from source when binary substitution fails
fallback = true; # default: false
# whether to keep building dependencies if any other one fails
keep-going = true; # default: false
# whether to keep build-only dependencies of GC roots (e.g. C compiler) when doing GC
keep-outputs = true; # default: false
# how many lines to show from failed build
log-lines = 30; # default: 10
# how many substitution downloads to perform in parallel.
# i wonder if parallelism is causing moby's substitutions to fail?
max-substitution-jobs = 6; # default: 16
# narinfo-cache-negative-ttl = 3600 # default: 3600
# whether to use ~/.local/state/nix/profile instead of ~/.nix-profile, etc
use-xdg-base-directories = true; # default: false
# whether to warn if repository has uncommited changes
warn-dirty = false; # default: true
# hardlinks identical files in the nix store to save 25-35% disk space.
# unclear _when_ this occurs. it's not a service.
# does the daemon continually scan the nix store?
# does the builder use some content-addressed db to efficiently dedupe?
auto-optimise-store = true;
# allow #!nix-shell scripts to locate my patched nixpkgs & custom packages.
# this line might become unnecessary: see <https://github.com/NixOS/nixpkgs/pull/273170>
nix-path = config.nix.nixPath;
};
# 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`.
nix.nixPath = [
"nixpkgs=${pkgs.path}"
# 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"
# as long as my system itself doesn't rely on NIXPKGS at runtime, we can point the overlays to git
# to avoid switching so much during development
"nixpkgs-overlays=/home/colin/dev/nixos/hosts/common/nix/overlay"
];
# ensure new deployments have a source of this repo with which they can bootstrap.
environment.etc."nixos".source = ../../..;
systemd.services.nix-daemon.serviceConfig = {
# the nix-daemon manages nix builders
# kill nix-daemon subprocesses when systemd-oomd detects an out-of-memory condition
# see:
# - nixos PR that enabled systemd-oomd: <https://github.com/NixOS/nixpkgs/pull/169613>
# - systemd's docs on these properties: <https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html#ManagedOOMSwap=auto%7Ckill>
#
# systemd's docs warn that without swap, systemd-oomd might not be able to react quick enough to save the system.
# see `man oomd.conf` for further tunables that may help.
#
# alternatively, apply this more broadly with `systemd.oomd.enableSystemSlice = true` or `enableRootSlice`
# TODO: also apply this to the guest user's slice (user-1100.slice)
# TODO: also apply this to distccd
ManagedOOMMemoryPressure = "kill";
ManagedOOMSwap = "kill";
};
}

View File

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

View File

@@ -0,0 +1,45 @@
# strictly *decrease* the scope of the default nixos installation/config
{ lib, ... }:
{
# disable non-required packages like nano, perl, rsync, strace
environment.defaultPackages = [];
# remove all the non-existent default directories from XDG_DATA_DIRS, XDG_CONFIG_DIRS to simplify debugging.
# this is defaulted in <repo:nixos/nixpkgs:nixos/modules/programs/environment.nix>,
# without being gated by any higher config.
environment.profiles = lib.mkForce [
"/etc/profiles/per-user/$USER"
"/run/current-system/sw"
];
# NIXPKGS_CONFIG defaults to "/etc/nix/nixpkgs-config.nix", for idfk why.
# 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 "";
# XDG_CONFIG_DIRS defaults to "/etc/xdg", which doesn't exist.
# in practice, pam appends the values i want to XDG_CONFIG_DIRS, though this approach causes an extra leading `:`
environment.sessionVariables.XDG_CONFIG_DIRS = lib.mkForce [];
# XCURSOR_PATH: defaults to `[ "$HOME/.icons" "$HOME/.local/share/icons" ]`, neither of which i use, just adding noise.
# see: <repo:nixos/nixpkgs:nixos/modules/config/xdg/icons.nix>
environment.sessionVariables.XCURSOR_PATH = lib.mkForce [];
# disable nixos' portal module, otherwise /share/applications gets linked into the system and complicates things (sandboxing).
# instead, i manage portals myself via the sane.programs API (e.g. sane.programs.xdg-desktop-portal).
xdg.portal.enable = false;
xdg.menus.enable = false; #< links /share/applications, and a bunch of other empty (i.e. unused) dirs
# xdg.autostart.enable defaults to true, and links /etc/xdg/autostart into the environment, populated with .desktop files.
# see: <repo:nixos/nixpkgs:nixos/modules/config/xdg/autostart.nix>
# .desktop files are a questionable way to autostart things: i generally prefer a service manager for that.
xdg.autostart.enable = false;
# nix.channel.enable: populates `/nix/var/nix/profiles/per-user/root/channels`, `/root/.nix-channels`, `$HOME/.nix-defexpr/channels`
# <repo:nixos/nixpkgs:nixos/modules/config/nix-channel.nix>
# TODO: may want to recreate NIX_PATH, nix.settings.nix-path
nix.channel.enable = false;
# environment.stub-ld: populate /lib/ld-linux.so with an object that unconditionally errors on launch,
# 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.
environment.stub-ld.enable = false;
}

View File

@@ -10,26 +10,18 @@ in
type = types.submodule { type = types.submodule {
options.autostart = mkOption { options.autostart = mkOption {
type = types.bool; type = types.bool;
default = true; default = false;
}; };
}; };
}; };
package = pkgs.abaddon.overrideAttrs (upstream: { packageUnwrapped = pkgs.abaddon.overrideAttrs (upstream: {
patches = (upstream.patches or []) ++ [ patches = (upstream.patches or []) ++ [
(pkgs.fetchpatch { (pkgs.fetchpatch {
url = "https://git.uninsane.org/colin/abaddon/commit/eb551f188d34679f75adcbc83cb8d5beb4d19fd6.patch"; url = "https://git.uninsane.org/colin/abaddon/commit/eb551f188d34679f75adcbc83cb8d5beb4d19fd6.patch";
name = ''"view members" default to false''; name = ''"view members" default to false'';
hash = "sha256-9BX8iO86CU1lNrKS1G2BjDR+3IlV9bmhRNTsLrxChwQ="; hash = "sha256-9BX8iO86CU1lNrKS1G2BjDR+3IlV9bmhRNTsLrxChwQ=";
}) })
(pkgs.fetchpatch {
# this makes it so Abaddon reports its app_name in notifications.
# not 100% necessary; just a nice-to-have. maybe don't rely on it until it's merged upstream.
# upstream PR: <https://github.com/uowuo/abaddon/pull/247>
url = "https://git.uninsane.org/colin/abaddon/commit/18cd863fdbb5e6b1e9aaf9394dbd673d51839f30.patch";
name = "set glib application name";
hash = "sha256-IFYxf1D8hIsxgZehGd6hL3zJiBkPZfWGm+Faaa5ZFl4=";
})
]; ];
}); });
@@ -95,7 +87,7 @@ in
services.abaddon = { services.abaddon = {
description = "unofficial Discord chat client"; description = "unofficial Discord chat client";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/bin/abaddon"; ExecStart = "${cfg.package}/bin/abaddon";
Type = "simple"; Type = "simple";

View File

@@ -3,6 +3,9 @@
{ {
sane.programs.aerc = { sane.programs.aerc = {
sandbox.method = "bwrap";
sandbox.wrapperType = "inplace";
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

@@ -6,19 +6,36 @@
{ lib, ... }: { lib, ... }:
{ {
sane.programs.alacritty = { sane.programs.alacritty = {
sandbox.enable = false;
env.TERMINAL = lib.mkDefault "alacritty"; env.TERMINAL = lib.mkDefault "alacritty";
# note: alacritty will switch to .toml config in 13.0 release fs.".config/alacritty/alacritty.toml".symlink.text = ''
# - run `alacritty migrate` to convert the yaml to toml [font]
fs.".config/alacritty/alacritty.yml".symlink.text = '' size = 14
font:
size: 14
key_bindings: [[keyboard.bindings]]
- { key: N, mods: Control, action: CreateNewWindow } mods = "Control"
- { key: PageUp, mods: Control, action: ScrollPageUp } key = "N"
- { key: PageDown, mods: Control, action: ScrollPageDown } action = "CreateNewWindow"
- { key: PageUp, mods: Control|Shift, action: ScrollPageUp }
- { key: PageDown, mods: Control|Shift, action: ScrollPageDown } [[keyboard.bindings]]
mods = "Control"
key = "PageUp"
action = "ScrollPageUp"
[[keyboard.bindings]]
mods = "Control"
key = "PageDown"
action = "ScrollPageDown"
[[keyboard.bindings]]
mods = "Control|Shift"
key = "PageUp"
action = "ScrollPageUp"
[[keyboard.bindings]]
mods = "Control|Shift"
key = "PageDown"
action = "ScrollPageDown"
''; '';
}; };
} }

View File

@@ -1,10 +1,42 @@
{ ... }: # debug with:
# - `animatch --debug`
# - `gdb animatch`
# try:
# - `animatch --fullscreen`
# - `animatch --windowed`
# the other config options (e.g. verbose logging -- which doesn't seem to do anything) have to be configured via .ini file
# ```ini
# # ~/.config/Holy Pangolin/Animatch/SuperDerpy.ini
# [SuperDerpy]
# debug=1
# disableTouch=1
# [game]
# verbose=1
# ```
{ pkgs, ... }:
{ {
sane.programs.animatch = { sane.programs.animatch = {
packageUnwrapped = with pkgs; animatch.override {
# allegro has no native wayland support, and so by default crashes when run without Xwayland.
# enable the allegro SDL backend, and achieve Wayland support via SDL's Wayland support.
# TODO: see about upstreaming this to nixpkgs?
allegro5 = allegro5.overrideAttrs (upstream: {
buildInputs = upstream.buildInputs ++ [
SDL2
];
cmakeFlags = upstream.cmakeFlags ++ [
"-DALLEGRO_SDL=on"
];
});
};
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistWayland = true;
persist.byStore.plaintext = [ persist.byStore.plaintext = [
# game progress # ".config/Holy Pangolin/Animatch" #< used for SuperDerpy config (e.g. debug, disableTouch, fullscreen, enable sound, etc). SuperDerpy.ini
".config/Holy Pangolin/Animatch" ".local/share/Holy Pangolin/Animatch" #< used for game state (level clears). SuperDerpy.ini
".local/share/Holy Pangolin/Animatch" # i think this one might be wrong
]; ];
}; };
} }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
{ pkgs, ... }:
{
sane.programs.audacity = {
packageUnwrapped = pkgs.audacity.override {
# wxGTK32 uses webkitgtk-4.0.
# audacity doesn't actually need webkit though, so diable to reduce closure
wxGTK32 = pkgs.wxGTK32.override {
withWebKit = false;
};
};
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistAudio = true;
sandbox.whitelistWayland = true;
sandbox.autodetectCliPaths = true;
sandbox.extraHomePaths = [
# support media imports via file->open dir to some common media directories
"tmp"
"Music"
# audacity needs the entire config dir mounted if running in a sandbox
".config/audacity"
];
# disable first-run splash screen
fs.".config/audacity/audacity.cfg".file.text = ''
PrefsVersion=1.1.1r1
[GUI]
ShowSplashScreen=0
[Version]
Major=3
Minor=4
'';
};
}

View File

@@ -87,7 +87,14 @@ let
in in
{ {
sane.programs.bemenu = { sane.programs.bemenu = {
package = pkgs.bemenu.overrideAttrs (upstream: { sandbox.method = "bwrap"; # landlock works, but requires *all* of /run/user/$ID to be granted.
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
".cache/fontconfig" #< else it complains, and is *way* slower
];
packageUnwrapped = pkgs.bemenu.overrideAttrs (upstream: {
nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [ nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [
pkgs.makeWrapper pkgs.makeWrapper
]; ];

View File

@@ -1,7 +1,7 @@
# bonsai docs: <https://sr.ht/~stacyharper/bonsai/> # bonsai docs: <https://sr.ht/~stacyharper/bonsai/>
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sane.gui.sxmo.bonsaid; cfg = config.sane.programs.bonsai;
delayType = with lib; types.submodule { delayType = with lib; types.submodule {
options = { options = {
@@ -88,74 +88,43 @@ let
mergeOneOption loc defs mergeOneOption loc defs
; ;
}; };
# transitionType = with lib; types.submodule {
# options = {
# type = mkOption {
# type = types.enum [ "delay" "event" "exec" ];
# };
# delay_duration = mkOption {
# type = types.nullOr types.int;
# default = null;
# description = ''
# used for "delay" types only.
# nanoseconds until the event is finalized.
# '';
# };
# event_name = mkOption {
# type = types.nullOr types.str;
# default = null;
# description = ''
# name of event which this transition applies to.
# '';
# };
# transitions = mkOption {
# type = types.nullOr (types.listOf transitionType);
# default = null;
# description = ''
# list of transitions out of this state.
# '';
# };
# command = mkOption {
# type = types.nullOr (types.listOf types.str);
# default = null;
# description = ''
# used for "exec" types only.
# command to run when the event is triggered.
# '';
# };
# };
# };
in in
{ {
options = with lib; { sane.programs.bonsai = {
sane.gui.sxmo.bonsaid.package = mkOption { configOption = with lib; mkOption {
type = types.package; default = {};
default = pkgs.bonsai; type = types.submodule {
options = {
transitions = mkOption {
type = types.listOf transitionType;
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.
'';
};
};
};
}; };
sane.gui.sxmo.bonsaid.transitions = mkOption {
type = types.listOf transitionType; services.bonsaid = {
default = []; description = "bonsai: programmable input dispatcher";
}; after = [ "graphical-session.target" ];
sane.gui.sxmo.bonsaid.configFile = mkOption { wantedBy = [ "graphical-session.target" ];
type = types.path;
default = pkgs.writeText "bonsai_tree.json" (builtins.toJSON cfg.transitions);
description = ''
configuration file to pass to bonsai.
usually auto-generated from the sibling options; exposed mainly for debugging or convenience.
'';
};
};
config = lib.mkIf config.sane.gui.sxmo.enable {
sane.user.services.bonsaid = {
description = "programmable input dispatcher";
script = '' script = ''
${pkgs.coreutils}/bin/rm -f $XDG_RUNTIME_DIR/bonsai ${pkgs.coreutils}/bin/rm -f $XDG_RUNTIME_DIR/bonsai
exec ${cfg.package}/bin/bonsaid -t ${cfg.configFile} exec ${cfg.package}/bin/bonsaid -t ${cfg.config.configFile}
''; '';
serviceConfig.Type = "simple"; serviceConfig = {
serviceConfig.Restart = "always"; Type = "simple";
serviceConfig.RestartSec = "5s"; Restart = "always";
RestartSec = "5s";
};
}; };
}; };
} }

View File

@@ -1,6 +1,17 @@
{ ... }: { ... }:
{ {
sane.programs.brave = { sane.programs.brave = {
sandbox.method = "bwrap";
sandbox.wrapperType = "inplace"; # /opt/share/brave.com vendor-style packaging
sandbox.net = "all";
sandbox.extraHomePaths = [
"dev" # for developing anything web-related
"tmp"
];
sandbox.whitelistAudio = true;
sandbox.whitelistDri = true;
sandbox.whitelistWayland = true;
persist.byStore.cryptClearOnBoot = [ persist.byStore.cryptClearOnBoot = [
".cache/BraveSoftware" ".cache/BraveSoftware"
".config/BraveSoftware" ".config/BraveSoftware"

View File

@@ -0,0 +1,35 @@
{ pkgs, ... }:
{
sane.programs.bubblewrap = {
sandbox.enable = false; # don't sandbox the sandboxer :)
packageUnwrapped = pkgs.bubblewrap.overrideAttrs (base: {
# patches = (base.patches or []) ++ [
# (pkgs.fetchpatch {
# url = "https://git.uninsane.org/colin/bubblewrap/commit/9843f9b2b5f086563fd37250658d69350a2939be.patch";
# name = "enable debug logging and add a bunch more tracing";
# hash = "sha256-AlDsqddaBahhqGibZlCjgmChuK7mmxDt0aYHNgY05OI=";
# })
# ];
postPatch = (base.postPatch or "") + ''
# bwrap doesn't like to be invoked with any capabilities, which is troublesome if i
# want to do things like ship CAP_NET_ADMIN,CAP_NET_RAW in the ambient set for tools like Wireshark.
# but this limitation of bwrap is artificial and at first look is just a scenario the author probably
# never expected: patch out the guard check.
#
# see: <https://github.com/containers/bubblewrap/issues/397>
#
# 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
# never receive capabilities in their parent namespace.
substituteInPlace bubblewrap.c --replace \
'die ("Unexpected capabilities but not setuid, old file caps config?");' \
'// die ("Unexpected capabilities but not setuid, old file caps config?");'
# enable debug printing
# substituteInPlace utils.h --replace \
# '#define __debug__(x)' \
# '#define __debug__(x) printf x'
'';
});
};
}

View File

@@ -44,7 +44,7 @@ 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 [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
# add --verbose for more debugging # add --verbose for more debugging
ExecStart = "${cfg.package}/bin/gnome-calls --daemon"; ExecStart = "${cfg.package}/bin/gnome-calls --daemon";

View File

@@ -0,0 +1,29 @@
# use like:
# - catt -d lgtv_chrome cast ./path/to.mp4
#
# support matrix:
# - webm: audio only
# - mp4: audio + video
{ config, lib, ... }:
let
cfg = config.sane.programs.catt;
in
{
sane.programs.catt = {
fs.".config/catt/catt.cfg".symlink.text = ''
[options]
device = lgtv_chrome
[aliases]
lgtv_chrome = 10.78.79.106
'';
};
# necessary to cast local files
networking.firewall.allowedTCPPortRanges = lib.mkIf cfg.enabled [
{
from = 45000;
to = 47000;
}
];
}

View File

@@ -1,40 +1,8 @@
{ pkgs, ... }: { pkgs, ... }:
let
chattyNoOauth = pkgs.chatty.override {
# the OAuth feature (presumably used for web-based logins) pulls a full webkitgtk.
# especially when using the gtk3 version of evolution-data-server, it's an ancient webkitgtk_4_1.
# disable OAuth for a faster build & smaller closure
evolution-data-server = pkgs.evolution-data-server.override {
enableOAuth2 = false;
gnome-online-accounts = pkgs.gnome-online-accounts.override {
# disables the upstream "goabackend" feature -- presumably "Gnome Online Accounts Backend"
# frees us from webkit_4_1, in turn.
enableBackend = false;
gvfs = pkgs.gvfs.override {
# saves 20 minutes of build time, for unused feature
samba = null;
};
};
};
};
chatty-latest = pkgs.chatty-latest.override {
evolution-data-server-gtk4 = pkgs.evolution-data-server-gtk4.override {
gnome-online-accounts = pkgs.gnome-online-accounts.override {
# disables the upstream "goabackend" feature -- presumably "Gnome Online Accounts Backend"
# frees us from webkit_4_1, in turn.
enableBackend = false;
gvfs = pkgs.gvfs.override {
# saves 20 minutes of build time and cross issues, for unused feature
samba = null;
};
};
};
};
in
{ {
sane.programs.chatty = { sane.programs.chatty = {
# package = chattyNoOauth; # packageUnwrapped = chattyNoOauth;
package = chatty-latest; packageUnwrapped = pkgs.chatty-latest;
suggestedPrograms = [ "gnome-keyring" ]; suggestedPrograms = [ "gnome-keyring" ];
persist.byStore.private = [ persist.byStore.private = [
".local/share/chatty" # matrix avatars and files ".local/share/chatty" # matrix avatars and files

View File

@@ -1,52 +1,184 @@
#!/bin/sh
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash #!nix-shell -i bash
usage() {
echo "usage: battery_estimate [options...]"
echo
echo "pretty-prints a battery estimate (icon to indicate state, and a duration estimate)"
echo
echo "options:"
echo " --debug: output additional information, to stderr"
echo " --minute-suffix <string>: use the provided string as a minutes suffix"
echo " --hour-suffix <string>: use the provided string as an hours suffix"
echo " --icon-suffix <string>: use the provided string as an icon suffix"
echo " --percent-suffix <string>: use the provided string when displaying percents"
}
# these icons come from sxmo; they only render in nerdfonts # these icons come from sxmo; they only render in nerdfonts
bat_dis="󱊢" icon_bat_chg=("󰢟" "󱊤" "󱊥" "󰂅")
bat_chg="󱊥" icon_bat_dis=("󰂎" "󱊡" "󱊢" "󱊣")
suffix_icon="" # thin space
suffix_percent="%"
# suffix_icon=" "
# render time like: 2ʰ08ᵐ
# unicode sub/super-scripts: <https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts>
# symbol_hr="ʰ"
# symbol_min="ᵐ"
# render time like: 2ₕ08ₘ
# symbol_hr="ₕ"
# symbol_min="ₘ"
# render time like: 2h08m
# symbol_hr="h"
# symbol_min="m"
# render time like: 2:08
# symbol_hr=":"
# symbol_min=
# render time like: 208⧗
symbol_hr=""
symbol_min="⧗"
# variants:
# symbol_hr=":"
# symbol_min="⧖"
# symbol_min="⌛"
# render time like: 2'08"
# symbol_hr="'"
# symbol_min='"'
log() {
if [ "$BATTERY_ESTIMATE_DEBUG" = "1" ]; then
printf "$@" >&2
echo >&2
fi
}
render_icon() {
# args:
# 1: "chg" or "dis"
# 2: current battery percentage
level=$(($2 / 25))
level=$(($level > 3 ? 3 : $level))
level=$(($level < 0 ? 0 : $level))
log "icon: %s %d" "$1" "$level"
if [ "$1" = "dis" ]; then
printf "%s" "${icon_bat_dis[$level]}"
elif [ "$1" = "chg" ]; then
printf "%s" "${icon_bat_chg[$level]}"
fi
}
try_path() { try_path() {
# returns: # assigns output variables:
# - perc, perc_left (0-100) # - perc, perc_from_full (0-100)
# - full, rate (pos means charging) # - full, rate (pos means charging)
if [ -f "$1/capacity" ]; then if [ -f "$1/capacity" ]; then
log "perc, perc_from_full from %s" "$1/capacity"
perc=$(cat "$1/capacity") perc=$(cat "$1/capacity")
perc_left=$((100 - $perc)) perc_from_full=$((100 - $perc))
fi fi
if [ -f "$1/charge_full_design" ] && [ -f "$1/current_now" ]; then if [ -f "$1/charge_full_design" ] && [ -f "$1/current_now" ]; then
log "full, rate from %s and %s" "$1/charge_full_design" "$1/current_now"
# current is positive when charging # current is positive when charging
full=$(cat "$1/charge_full_design") full=$(cat "$1/charge_full_design")
rate=$(cat "$1/current_now") rate=$(cat "$1/current_now")
fi elif [ -f "$1/energy_full" ] && [ -f "$1/power_now" ]; then
if [ -f "$1/energy_full" ] && [ -f "$1/energy_now" ]; then log "full, rate from %s and %s" "$1/energy_full" "$1/power_now"
# energy is positive when discharging # power_now is positive when discharging
full=$(cat "$1/energy_full")
rate=-$(cat "$1/power_now")
elif [ -f "$1/energy_full" ] && [ -f "$1/energy_now" ]; then
log "full, rate from %s and %s" "$1/energy_full" "$1/energy_now"
log " this is a compatibility path for legacy Thinkpad batteries which do not populate the 'power_now' field, and incorrectly populate 'energy_now' with power info"
# energy_now is positive when discharging
full=$(cat "$1/energy_full") full=$(cat "$1/energy_full")
rate=-$(cat "$1/energy_now") rate=-$(cat "$1/energy_now")
fi fi
} }
try_path "/sys/class/power_supply/axp20x-battery" # Pinephone try_all_paths() {
try_path "/sys/class/power_supply/BAT0" # Thinkpad try_path "/sys/class/power_supply/axp20x-battery" # Pinephone
try_path "/sys/class/power_supply/BAT0" # Thinkpad
log "perc: %d, perc_from_full: %d" "$perc" "$perc_from_full"
log "full: %f, rate: %f" "$full" "$rate"
log " rate > 0 means charging, else discharging"
}
fmt_minutes() { fmt_minutes() {
# args:
# 1: icon to render
# 2: string to show if charge/discharge time is indefinite
# 3: minutes to stable state (i.e. to full charge or full discharge)
# - we work in minutes instead of hours for precision: bash math is integer-only
log "charge/discharge time: %f min" "$3"
# args: <battery symbol> <text if ludicrous estimate> <estimated minutes to full/empty> # args: <battery symbol> <text if ludicrous estimate> <estimated minutes to full/empty>
if [[ $3 -gt 1440 ]]; then if [ -n "$3" ] && [ "$3" -lt 1440 ]; then
printf "%s %s" "$1" "$2" # more than 1d
else
hr=$(($3 / 60)) hr=$(($3 / 60))
hr_in_min=$(($hr * 60)) hr_in_min=$(($hr * 60))
min=$(($3 - $hr_in_min)) min=$(($3 - $hr_in_min))
printf "%s %dh%02dm" "$1" "$hr" "$min" printf "%s%s%d%s%02d%s" "$1" "$suffix_icon" "$hr" "$symbol_hr" "$min" "$symbol_min"
else
log "charge/discharge duration > 1d"
printf "%s%s%s" "$1" "$suffix_icon" "$2" # more than 1d
fi fi
} }
if [[ $rate -lt 0 ]]; then pretty_output() {
# discharging if [ -n "$perc" ]; then
fmt_minutes "$bat_dis" '∞' "$(($full * 60 * $perc / (-100 * $rate)))" duration=""
elif [[ $rate -gt 0 ]]; then if [ "$rate" -gt 0 ]; then
# charging log "charging"
fmt_minutes "$bat_chg" '100%' "$(($full * 60 * $perc_left / (100 * $rate)))" icon="$(render_icon chg $perc)"
elif [[ "$perc" != "" ]]; then duration="$(($full * 60 * $perc_from_full / (100 * $rate)))"
echo "$bat_dis $perc%" else
fi log "discharging"
icon="$(render_icon dis $perc)"
if [ "$rate" -lt 0 ]; then
duration="$(($full * 60 * $perc / (-100 * $rate)))"
fi
fi
fmt_minutes "$icon" "$perc$suffix_percent" "$duration"
fi
}
while [ "$#" -gt 0 ]; do
case "$1" in
"--debug")
shift
BATTERY_ESTIMATE_DEBUG=1
;;
"--icon-suffix")
shift
suffix_icon="$1"
shift
;;
"--hour-suffix")
shift
symbol_hr="$1"
shift
;;
"--minute-suffix")
shift
symbol_min="$1"
shift
;;
"--percent-suffix")
shift
suffix_percent="$1"
shift
;;
*)
usage
exit 1
;;
esac
done
try_all_paths
pretty_output

View File

@@ -3,48 +3,80 @@
-- - can also use #rrggbb syntax -- - can also use #rrggbb syntax
-- example configs: <https://forum.manjaro.org/t/conky-showcase-2022/97123> -- example configs: <https://forum.manjaro.org/t/conky-showcase-2022/97123>
-- example configs: <https://www.reddit.com/r/Conkyporn/> -- example configs: <https://www.reddit.com/r/Conkyporn/>
--
-- exec options:
-- `exec <cmd>` => executes the command, synchronously, renders its output as text
-- `texeci <interval_sec> <cmd>` => executes the command periodically, async (to not block render), renders as text
-- `pexec <cmd>` => executes the command, synchronously, parses its output
conky.config = { conky.config = {
out_to_wayland = true, out_to_wayland = true,
update_interval = 10, update_interval = 10,
alignment = 'middle_middle', alignment = 'middle_middle',
own_window_type = 'desktop', own_window_type = 'desktop',
-- own_window_argb_value: opacity of the background (0-255) -- own_window_argb_value: opacity of the background (0-255)
own_window_argb_value = 0, own_window_argb_value = 0,
-- own_window_argb_value = 92, -- own_window_argb_value = 92,
-- own_window_colour = '#beebe5', -- beebe5 matches nixos flake bg color -- own_window_colour = '#beebe5', -- beebe5 matches nixos flake bg color
-- "border" pads the entire conky window -- "border" pads the entire conky window
-- this can be used to control the extent of the own_window background -- this can be used to control the extent of the own_window background
border_inner_margin = 8, border_inner_margin = 8,
-- optionally, actually draw borders -- optionally, actually draw borders
-- draw_borders = true, -- draw_borders = true,
-- shades are drop-shadows, outline is the centered version. both apply to text only -- shades are drop-shadows, outline is the centered version. both apply to text only
draw_shades = true, draw_shades = true,
draw_outline = false, draw_outline = false,
default_shade_color = '#beebe5', default_shade_color = '#beebe5',
default_outline_color = '#beebe5', default_outline_color = '#beebe5',
font = 'sans-serif:size=8', font = 'sans-serif:size=8',
use_xft = true, use_xft = true,
default_color = '#ffffff', default_color = '#ffffff',
color1 = '000000', color1 = '000000',
color2 = '404040', color2 = '404040',
} }
-- texeci <interval_sec> <cmd>: run the command periodically, _in a separate thread_ so as not to block rendering vars = {
-- kBps = 'K/s',
kBps = 'ᴷᐟˢ',
-- percent = '%',
-- percent = '﹪',
percent = '٪',
-- percent = '⁒',
-- percent = '',
icon_suffix = nil,
hour_suffix = nil,
minute_suffix = '${font sans-serif:size=14}${color2}⧗',
}
bat_args = ""
if vars.icon_suffix ~= nil then
bat_args = bat_args .. " --icon-suffix '" .. vars.icon_suffix .. "'"
end
if vars.hour_suffix ~= nil then
bat_args = bat_args .. " --hour-suffix '" .. vars.hour_suffix .. "'"
end
if vars.minute_suffix ~= nil then
bat_args = bat_args .. " --minute-suffix '" .. vars.minute_suffix .. "'"
end
if vars.percent ~= nil then
bat_args = bat_args .. " --percent-suffix '" .. vars.percent .. "'"
end
-- N.B.: `[[ <text> ]]` is Lua's multiline string literal
conky.text = [[ conky.text = [[
${color1}${shadecolor 707070}${font sans-serif:size=50:style=Bold}${alignc}${exec date +"%H:%M"}${font} ${color1}${shadecolor 707070}${font sans-serif:size=50:style=Bold}${alignc}${exec date +"%H:%M"}${font}
${color2}${shadecolor a4d7d0}${font sans-serif:size=20}${alignc}${exec date +"%a %d %b"}${font} ${color2}${shadecolor a4d7d0}${font sans-serif:size=20}${alignc}${exec date +"%a %d %b"}${font}
${color1}${shadecolor}${font sans-serif:size=22:style=Bold}${alignc}${exec @bat@ }${font} ${color1}${shadecolor}${font sans-serif:size=22:style=Bold}${alignc}${execp @bat@ ]] .. bat_args .. [[ }${font}
${color1}${shadecolor}${font sans-serif:size=20:style=Bold}${alignc}${texeci 600 @weather@ }${font} ${color1}${shadecolor}${font sans-serif:size=20:style=Bold}${alignc}${texeci 600 @weather@ }${font}
${color2}${shadecolor a4d7d0}${font sans-serif:size=16}${alignc}⇅ ${downspeedf wlan0}K/s${font} ${color2}${shadecolor a4d7d0}${font sans-serif:size=16}${alignc}⇅ ${downspeedf wlan0}]] .. vars.kBps .. [[${font}
${font sans-serif:size=16}${alignc}☵ $memperc%  $cpu%${font} ${font sans-serif:size=16}${alignc}☵ $memperc]] .. vars.percent .. [[  $cpu]] .. vars.percent .. [[${font}
]] ]]

View File

@@ -1,11 +1,22 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
sane.programs.conky = { sane.programs.conky = {
# TODO: non-sandboxed `conky` still ships via `sxmo-utils`, but unused
sandbox.method = "bwrap";
sandbox.net = "clearnet"; #< for the scripts it calls (weather)
sandbox.extraPaths = [
"/sys/class/power_supply"
"/sys/devices" # needed by battery_estimate
# "/sys/devices/cpu"
# "/sys/devices/system"
];
sandbox.whitelistWayland = true;
fs.".config/conky/conky.conf".symlink.target = fs.".config/conky/conky.conf".symlink.target =
let let
battery_estimate = pkgs.static-nix-shell.mkBash { battery_estimate = pkgs.static-nix-shell.mkBash {
pname = "battery_estimate"; pname = "battery_estimate";
src = ./.; srcRoot = ./.;
}; };
in pkgs.substituteAll { in pkgs.substituteAll {
src = ./conky.conf; src = ./conky.conf;
@@ -15,20 +26,14 @@
services.conky = { services.conky = {
description = "conky dynamic desktop background"; description = "conky dynamic desktop background";
wantedBy = [ "default.target" ]; after = [ "graphical-session.target" ];
# XXX: should be part of graphical-session.target, but whatever mix of greetd/sway # partOf = [ "graphical-session.target" ]; # propagate stop/restart signal from graphical-session to this unit
# i'm using means that target's never reached... wantedBy = [ "graphical-session.target" ];
# wantedBy = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky"; serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky";
serviceConfig.Type = "simple"; serviceConfig.Type = "simple";
serviceConfig.Restart = "on-failure"; serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s"; serviceConfig.RestartSec = "10s";
# serviceConfig.Slice = "session.slice";
# don't start conky until after sway
preStart = ''test -n "$SWAYSOCK"'';
}; };
}; };
} }

View File

@@ -2,6 +2,16 @@
{ {
sane.programs.cozy = { sane.programs.cozy = {
sandbox.method = "bwrap"; # landlock gives: _multiprocessing.SemLock: Permission Denied
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # mpris
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
"Books/local"
"Books/servo"
];
# cozy uses a sqlite db for its config and exposes no CLI options other than --help and --debug # cozy uses a sqlite db for its config and exposes no CLI options other than --help and --debug
persist.byStore.plaintext = [ persist.byStore.plaintext = [
".local/share/cozy" # sqlite db (config & index?) ".local/share/cozy" # sqlite db (config & index?)

View File

@@ -0,0 +1,33 @@
# dconf docs: <https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/desktop_migration_and_administration_guide/profiles>
# this lets programs temporarily write user-level dconf settings (aka gsettings).
# they're written to ~/.config/dconf/user, unless `DCONF_PROFILE` is set to something other than the default of /etc/dconf/profile/user
# find keys/values with `dconf dump /`
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.dconf;
in
{
sane.programs.dconf = {
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
persist.byStore.private = [
".config/dconf"
];
};
programs.dconf = lib.mkIf cfg.enabled {
# note that `programs.dconf` doesn't allow specifying the dconf package.
enable = true;
packages = [
(pkgs.writeTextFile {
name = "dconf-user-profile";
destination = "/etc/dconf/profile/user";
text = ''
user-db:user
system-db:site
'';
})
];
};
}

View File

@@ -7,13 +7,18 @@
./alacritty.nix ./alacritty.nix
./animatch.nix ./animatch.nix
./assorted.nix ./assorted.nix
./audacity.nix
./bemenu.nix ./bemenu.nix
./bonsai.nix
./brave.nix ./brave.nix
./bubblewrap.nix
./calls.nix ./calls.nix
./cantata.nix ./cantata.nix
./catt.nix
./chatty.nix ./chatty.nix
./conky ./conky
./cozy.nix ./cozy.nix
./dconf.nix
./dialect.nix ./dialect.nix
./dino.nix ./dino.nix
./element-desktop.nix ./element-desktop.nix
@@ -21,43 +26,62 @@
./evince.nix ./evince.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
./frozen-bubble.nix
./fwupd.nix ./fwupd.nix
./g4music.nix ./g4music.nix
./gajim.nix ./gajim.nix
./gdbus.nix
./geary.nix ./geary.nix
./git.nix ./git.nix
./gnome-feeds.nix ./gnome-feeds.nix
./gnome-keyring.nix ./gnome-keyring
./gnome-maps.nix
./gnome-weather.nix ./gnome-weather.nix
./go2tv.nix
./gpodder.nix ./gpodder.nix
./grimshot.nix
./gthumb.nix ./gthumb.nix
./gtkcord4.nix ./gtkcord4.nix
./handbrake.nix
./helix.nix ./helix.nix
./imagemagick.nix ./imagemagick.nix
./jellyfin-media-player.nix ./jellyfin-media-player.nix
./kdenlive.nix
./komikku.nix ./komikku.nix
./koreader ./koreader
./libreoffice.nix ./libreoffice.nix
./lemoa.nix ./lemoa.nix
./loupe.nix
./mako.nix ./mako.nix
./megapixels.nix ./megapixels.nix
./mepo.nix ./mepo.nix
./mimeo
./mopidy.nix ./mopidy.nix
./mpv.nix ./mpv.nix
./msmtp.nix ./msmtp.nix
./nautilus.nix
./neovim.nix ./neovim.nix
./newsflash.nix ./newsflash.nix
./nheko.nix ./nheko.nix
./nicotine-plus.nix
./nix-index.nix ./nix-index.nix
./notejot.nix
./ntfy-sh.nix ./ntfy-sh.nix
./obsidian.nix ./obsidian.nix
./offlineimap.nix ./offlineimap.nix
./open-in-mpv.nix
./pipewire.nix
./planify.nix
./portfolio-filemanager.nix
./playerctl.nix ./playerctl.nix
./rhythmbox.nix ./rhythmbox.nix
./ripgrep.nix ./ripgrep.nix
./rofi
./sane-scripts.nix
./sfeed.nix ./sfeed.nix
./signal-desktop.nix ./signal-desktop.nix
./splatmoji.nix ./splatmoji.nix
@@ -65,19 +89,32 @@
./spotify.nix ./spotify.nix
./steam.nix ./steam.nix
./stepmania.nix ./stepmania.nix
./strings.nix
./sublime-music.nix ./sublime-music.nix
./supertuxkart.nix ./supertuxkart.nix
./sway
./sway-autoscaler ./sway-autoscaler
./swaylock.nix
./swaynotificationcenter.nix ./swaynotificationcenter.nix
./tangram.nix ./tangram.nix
./tor-browser-bundle-bin.nix ./tor-browser.nix
./tuba.nix ./tuba.nix
./unl0kr
./vlc.nix ./vlc.nix
./waybar
./waylock.nix
./wike.nix ./wike.nix
./wine.nix ./wine.nix
./wireplumber.nix
./wireshark.nix ./wireshark.nix
./wob
./xarchiver.nix ./xarchiver.nix
./xdg-desktop-portal.nix
./xdg-desktop-portal-gtk.nix
./xdg-desktop-portal-wlr.nix
./xdg-utils.nix
./zeal.nix ./zeal.nix
./zecwallet-lite.nix
./zsh ./zsh
]; ];

View File

@@ -1,7 +1,13 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.dialect = { sane.programs.dialect = {
package = pkgs.dialect.overrideAttrs (upstream: { 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: {
# TODO: send upstream # TODO: send upstream
# TODO: figure out how to get audio working # TODO: figure out how to get audio working
# TODO: move to runtimeDependencies? # TODO: move to runtimeDependencies?

View File

@@ -40,16 +40,39 @@ in
type = types.submodule { type = types.submodule {
options.autostart = mkOption { options.autostart = mkOption {
type = types.bool; type = types.bool;
default = false; default = true;
}; };
}; };
}; };
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet";
sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications
sandbox.whitelistDri = true; #< not strictly necessary, but we need all the perf we can get on moby
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
"Music"
"Pictures/albums"
"Pictures/cat"
"Pictures/from"
"Pictures/Photos"
"Pictures/Screenshots"
"Pictures/servo-macros"
"Videos/local"
"Videos/servo"
"tmp"
];
persist.byStore.private = [ ".local/share/dino" ]; persist.byStore.private = [ ".local/share/dino" ];
services.dino = { services.dino = {
description = "dino XMPP client"; description = "dino XMPP client";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/bin/dino"; ExecStart = "${cfg.package}/bin/dino";
Type = "simple"; Type = "simple";

View File

@@ -7,14 +7,36 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.element-desktop = { sane.programs.element-desktop = {
package = 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-build electron because otherwise it takes 4 hrs to build from source.
electron = pkgs.electron-bin; electron = pkgs.electron-bin;
}; };
suggestedPrograms = [
"gnome-keyring"
"xwayland"
];
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "clearnet";
sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; # notifications
sandbox.whitelistDri = true;
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
"Music"
"Pictures/albums"
"Pictures/cat"
"Pictures/from"
"Pictures/Photos"
"Pictures/Screenshots"
"Pictures/servo-macros"
"Videos/local"
"Videos/servo"
"tmp"
];
# creds/session keys, etc # creds/session keys, etc
persist.byStore.private = [ ".config/Element" ]; persist.byStore.private = [ ".config/Element" ];
suggestedPrograms = [ "gnome-keyring" ];
}; };
} }

View File

@@ -8,6 +8,19 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.epiphany = { sane.programs.epiphany = {
sandbox.method = "bwrap";
sandbox.wrapperType = "inplace"; # /share/epiphany/default-bookmarks.rdf refers back to /share; dbus files to /libexec
sandbox.net = "clearnet";
sandbox.whitelistAudio = true;
# default sandboxing breaks rendering in weird ways. sites are super zoomed in / not scaled.
# enabling DRI/DRM (as below) seems to fix that.
sandbox.whitelistDri = true;
sandbox.whitelistWayland = true;
sandbox.extraHomePaths = [
".config/epiphany" #< else it gets angry at launch
"tmp"
];
# 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:
@@ -22,13 +35,14 @@
# #
# TODO: consider `WEBKIT_USE_SINGLE_WEB_PROCESS=1` for better perf # TODO: consider `WEBKIT_USE_SINGLE_WEB_PROCESS=1` for better perf
# - this runs all tabs in 1 process. which is fine, if i'm not a heavy multi-tabber # - this runs all tabs in 1 process. which is fine, if i'm not a heavy multi-tabber
package = pkgs.epiphany.overrideAttrs (upstream: { packageUnwrapped = pkgs.epiphany.overrideAttrs (upstream: {
preFixup = '' preFixup = ''
gappsWrapperArgs+=( gappsWrapperArgs+=(
--set WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS "1" --set WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS "1"
); );
'' + (upstream.preFixup or ""); '' + (upstream.preFixup or "");
}); });
suggestedPrograms = [ "dconf" ]; #< for persisting e.g. "Set as Default Browser" prompt question
persist.byStore.private = [ persist.byStore.private = [
".cache/epiphany" ".cache/epiphany"
".local/share/epiphany" ".local/share/epiphany"

View File

@@ -1,4 +1,10 @@
{ ... }: { ... }:
{ {
sane.programs.evince.mime.associations."application/pdf" = "org.gnome.Evince.desktop"; sane.programs.evince = {
sandbox.method = "bwrap";
sandbox.autodetectCliPaths = true;
sandbox.whitelistWayland = true;
mime.associations."application/pdf" = "org.gnome.Evince.desktop";
};
} }

View File

@@ -1,10 +1,13 @@
# test with e.g.
# - `fbcli --event proxied-message-new-instant`
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sane.programs.feedbackd; cfg = config.sane.programs.feedbackd;
in in
{ {
sane.programs.feedbackd = { sane.programs.feedbackd = {
package = pkgs.rmDbusServices pkgs.feedbackd; packageUnwrapped = pkgs.rmDbusServices pkgs.feedbackd;
configOption = with lib; mkOption { configOption = with lib; mkOption {
type = types.submodule { type = types.submodule {
@@ -21,6 +24,11 @@ in
default = {}; default = {};
}; };
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.whitelistDbus = [ "user" ];
sandbox.whitelistAudio = true;
# N.B.: feedbackd will load ~/.config/feedbackd/themes/default.json by default # N.B.: feedbackd will load ~/.config/feedbackd/themes/default.json by default
# - but using that would forbid `parent-theme = "default"` # - but using that would forbid `parent-theme = "default"`
# the default theme ships support for these events: # the default theme ships support for these events:
@@ -89,7 +97,7 @@ in
services.feedbackd = { services.feedbackd = {
description = "feedbackd audio/vibration/led controller"; description = "feedbackd audio/vibration/led controller";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ]; #< should technically be `sound.target`, but that doesn't seem to get auto-started?
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/libexec/feedbackd"; ExecStart = "${cfg.package}/libexec/feedbackd";
Type = "simple"; Type = "simple";

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