Compare commits

...

623 Commits

Author SHA1 Message Date
0253774622 add templates.python-data
for more info, see
<https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-init.html>
2022-11-30 00:48:27 +00:00
2f45c57310 nix flake update: nixpkgs 2022-11-21 -> 2022-11-27, others
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/af50806f7c6ab40df3e6b239099e8f8385f6c78b' (2022-11-21)
  → 'github:NixOS/nixpkgs/a115bb9bd56831941be3776c8a94005867f316a7' (2022-11-27)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a' (2022-11-20)
  → 'github:NixOS/nixpkgs/fecf05d4861f3985e8dee73f08bc82668ef75125' (2022-11-27)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/f72e050c3ef148b1131a0d2df55385c045e4166b' (2022-11-20)
  → 'github:Mic92/sops-nix/8295b8139ef7baadeb90c5cad7a40c4c9297ebf7' (2022-11-29)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/b68a6a27adb452879ab66c0eaac0c133e32823b2' (2022-11-20)
  → 'github:NixOS/nixpkgs/6649e08812f579581bfb4cada3ba01e30485c891' (2022-11-27)
```
2022-11-29 23:12:43 +00:00
5d1e8f5f60 servo: store media on external storage 2022-11-29 21:54:33 +00:00
ff9c26b03d servo: port to Ryzen/x86 machine 2022-11-29 02:20:18 +00:00
b9533d7ee3 packages: ship some tools useful for debugging boot/HW state 2022-11-29 02:18:56 +00:00
103f7b1b2c sane-stop-all-servo script: update for currently deployed services 2022-11-29 02:18:31 +00:00
16327fd323 nix patches: fix hashes 2022-11-29 02:18:05 +00:00
abcfa2dbea update phosh: phosh: 0.21.1 -> 0.22.0 2022-11-26 08:13:52 +00:00
27403fa36d zecwallet: move data to private dir 2022-11-24 17:47:34 +00:00
96b3ac26dd remove systemd HDD spindown patch
i haven't used this for several months. it doesn't seem to matter, and
maintaining custom systemd patches is very impractical.
2022-11-24 10:28:06 +00:00
1accf264cf browserpass-extension: update the PR which generalizes file extensions 2022-11-24 10:26:32 +00:00
3772a428da browserpass: apply PR feedback: <https://github.com/browserpass/browserpass-extension/pull/312> 2022-11-23 12:59:08 +00:00
a56f2008d3 fix 'nixserv' -> 'nixserve' typo 2022-11-23 04:09:58 +00:00
04ea55499a gocryptfs: don't cross build 2022-11-22 13:46:44 +00:00
59244fa50c flake update: nixpkgs 2022-11-09 -> 2022-11-21, others
```
• Updated input 'impermanence':
    'github:nix-community/impermanence/def994adbdfc28974e87b0e4c949e776207d5557' (2022-08-31)
  → 'github:nix-community/impermanence/5df9108b346f8a42021bf99e50de89c9caa251c3' (2022-11-17)
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/0b69b36c989d13f08c3bc563253f68c9d6ed7244' (2022-11-01)
  → 'github:nixos/mobile-nixos/25eec596116553112681d72ee4880107fc3957fa' (2022-11-19)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/872fceeed60ae6b7766cc0a4cd5bf5901b9098ec' (2022-11-09)
  → 'github:NixOS/nixpkgs/af50806f7c6ab40df3e6b239099e8f8385f6c78b' (2022-11-21)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/fa842715565307b7e05cdb187b08c05f16ed08f1' (2022-11-09)
  → 'github:NixOS/nixpkgs/cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a' (2022-11-20)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/4407353739ad74a3d9744cf2988ab10f3b83e288' (2022-11-06)
  → 'github:Mic92/sops-nix/f72e050c3ef148b1131a0d2df55385c045e4166b' (2022-11-20)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/6440d13df2327d2db13d3b17e419784020b71d22' (2022-10-30)
  → 'github:NixOS/nixpkgs/b68a6a27adb452879ab66c0eaac0c133e32823b2' (2022-11-20)
```
2022-11-22 12:03:33 +00:00
c2a2b27002 servo: disable duplicity 2022-11-22 12:01:55 +00:00
7bd6015a9f browserpass: start pushing gpg-agnostic support upstream 2022-11-22 11:50:07 +00:00
2a010f7882 readme: update contact info, explain modules/ dir 2022-11-22 05:34:11 +00:00
b566910da0 home-manager: hide behind an enable flag 2022-11-22 05:28:41 +00:00
ca43811c16 remove sane.home-manager.extraPackages
replaced by sane.packages.extraUserPkgs
2022-11-22 05:11:02 +00:00
7284452aa5 re-enable some environment stuff that got lost during refactors 2022-11-22 04:51:03 +00:00
f772300d88 move system-packages into the main packages.nix file 2022-11-22 04:40:24 +00:00
eccb5ff3d6 rename home-packages -> packages 2022-11-22 04:31:55 +00:00
0c6b949a72 lift some more files out of modules -> hosts 2022-11-22 04:29:17 +00:00
9a6c83776d vpn: move out of modules/ 2022-11-22 03:46:25 +00:00
e408e77026 move secrets.nix out of modules 2022-11-22 03:37:57 +00:00
e0612ccfa8 move allocations out of universal
it doesn't cause any changes to the system
2022-11-22 03:35:11 +00:00
a0e85ff31b nixserve: remove the default sops path
it might make more sense to make this a runtime path (/run/secrets/...)
2022-11-22 03:20:50 +00:00
1d448a4114 migrate common settings from hosts/{instantiate -> common/default}.nix 2022-11-22 03:10:19 +00:00
ed52b5f251 nixcache: modularize 2022-11-22 03:07:11 +00:00
dc21b0d68c modularize image.nix image building 2022-11-22 03:02:41 +00:00
18ec4f9b4d browserpass-extension: update to latest tip
my PR got merged
2022-11-22 02:59:25 +00:00
84a17f4599 move hardware out of modules into hosts/common
i want for `modules/` to behave like a more typical `modules` directory,
where functionality is opt-in.
2022-11-22 02:52:07 +00:00
43fa7fdd9f rename machines -> hosts
- shorter.
- congruent with `nixos-rebuild .` choosing what to build based on `hostname`.
- more widely used within other nix repos i've seen.
- more accurate in the case that i migrate a host to a different
machine (which i plan to do with servo).
2022-11-22 02:33:47 +00:00
8fc6b05c07 duplicity: add script to restore from backup 2022-11-21 11:47:07 +00:00
439c7d9ef2 duplicity: add utility to list backup files 2022-11-21 11:31:51 +00:00
9633c4f012 packages: add kdenlive 2022-11-21 10:39:58 +00:00
b869617b09 duplicity: refactor and update files list 2022-11-21 10:39:52 +00:00
ce323ffcf9 servo: ejabberd: enable starttls on server-to-server protocol 2022-11-15 12:55:45 +00:00
ac153aecd3 servo: ejabberd: enable 2022-11-15 12:52:45 +00:00
353d97b661 servo: ejabberd: provide access to certs 2022-11-15 12:47:50 +00:00
1150ee4b50 servo: prosody: disable 2022-11-15 12:45:23 +00:00
9e51eafff0 servo: add libraspberrypi 2022-11-15 12:28:49 +00:00
afaa6343ab update nixpkgs: 2022-11-05 -> 2022-11-09
```
• Updated input 'home-manager':
    'github:nix-community/home-manager/87d55517f6f36aa1afbd7a4a064869d5a1d405b8' (2022-11-05)
  → 'github:nix-community/home-manager/6639e3a837fc5deb6f99554072789724997bc8e5' (2022-11-08)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/3bacde6273b09a21a8ccfba15586fb165078fb62' (2022-11-05)
  → 'github:NixOS/nixpkgs/872fceeed60ae6b7766cc0a4cd5bf5901b9098ec' (2022-11-09)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/f09ad462c5a121d0239fde645aacb2221553a217' (2022-11-05)
  → 'github:NixOS/nixpkgs/fa842715565307b7e05cdb187b08c05f16ed08f1' (2022-11-09)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/486b4455da16272c1ed31bc82adcdbe7af829465' (2022-11-02)
  → 'github:Mic92/sops-nix/4407353739ad74a3d9744cf2988ab10f3b83e288' (2022-11-06)
```
2022-11-15 10:04:25 +00:00
67dff6069c sane-rcp: do incremental syncs (append mode) 2022-11-15 09:46:11 +00:00
dea7ca9474 new script to locate dotfiles easier 2022-11-13 01:05:06 +00:00
ad7ae94501 home: ship dino XMPP client 2022-11-12 10:18:13 +00:00
1a0bd16b44 servo: enable prosody XMPP server 2022-11-12 10:02:06 +00:00
56f89bb3f7 servo: ejabberd: configure, but then disable because broken 2022-11-12 01:43:14 +00:00
92a67253c3 servo: lay the skeleton files for a XMPP (jabber) server 2022-11-11 12:56:09 +00:00
8d0ded0ea1 postgresql: leave some notes about future optimization opportunities 2022-11-11 10:58:57 +00:00
de820e32b7 servo: pleroma: remove unneeded prepare: :named config
doing this should increase perf
2022-11-11 10:58:29 +00:00
be286cd190 servo: nginx: enable gzip and TLS optimizations 2022-11-11 10:57:57 +00:00
7cacbd9580 goaccess: optimization only refresh stats once per 30s 2022-11-11 10:56:54 +00:00
c84f10e060 freshrss: update feeds less frequently
Freshrss is throwing some error in the logs... but it still looks to
*kinda* work? ugh.
2022-11-11 08:48:48 +00:00
fd8f660ee0 feeds: add Jeff Kaufman 2022-11-11 07:50:42 +00:00
205b6a9afb nginx: forceSSL for git and fedi 2022-11-08 13:28:41 +00:00
6b7a544df3 lightdm-mobile-greeter: update button styling 2022-11-08 10:42:08 +00:00
c3eacf7126 unpin electrum, sequoia
they build now
2022-11-08 09:08:51 +00:00
3b6f638f98 lightdm-mobile-greeter: update interface.ui 2022-11-08 09:08:39 +00:00
6057a2e665 lightdm-mobile-greeter: update libhandy dependency 2022-11-07 23:36:18 -08:00
f45b032e48 home: add plasmatube (though it might not be working well) 2022-11-08 05:34:02 +00:00
1c810dc1b8 time: switch to UTC
Daylight Savings Time is too confusing for me.
2022-11-08 02:35:50 +00:00
fdd9833b01 lightdm-mobile-greeter: update upstream (minor description change) 2022-11-07 06:32:04 -08:00
25854d3135 lightdm-mobile-greeter: update upstream 2022-11-07 05:25:25 -08:00
45f8cc3894 browserpass-native: update enableOTP PR fix 2022-11-07 04:39:16 -08:00
fc4138327a home-packaged: add rsync 2022-11-06 20:53:22 -08:00
889c47e884 link debug symbols into /run/current-system/sw/lib/debug 2022-11-06 19:25:50 -08:00
f6f500c592 fs: hopefully fix /mnt/servo-root by linking sftp-server at the remote endpoint 2022-11-06 18:54:22 -08:00
6fa9fb740a servo: update rpi linux to fix build 2022-11-06 17:12:22 -08:00
10a665d11c add a servo-cross target
though it looks like rpi4 linux actually fails to cross-compile due to
some RMW page error
2022-11-06 06:04:54 -08:00
77baf03496 Revert "servo: don't ship custom linux kernel packages anymore"
This reverts commit 12b5e68b25.
2022-11-06 05:27:04 -08:00
26f920e119 disable default environment packages 2022-11-06 05:22:16 -08:00
88fba6f496 document --substituters nix options 2022-11-06 03:47:10 -08:00
9f43444f0c ipfs: migrate settings
did not explicitly test these
2022-11-06 03:32:35 -08:00
b68fd881e4 servo: import an element-web patch which allows configuring it without rebuilding 2022-11-06 03:32:35 -08:00
5cca6ede0d emote: fix persistence dir 2022-11-06 02:30:53 -08:00
3b4e394ce8 flake update nixpkgs: 2022-11-03 -> 2022-11-05, home-manager
```
• Updated input 'home-manager':
    'github:nix-community/home-manager/d78b3488a76d251701ab58a9b7f0dd092b806c1e' (2022-11-03)
  → 'github:nix-community/home-manager/87d55517f6f36aa1afbd7a4a064869d5a1d405b8' (2022-11-05)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/a2a777538d971c6b01c6e54af89ddd6567c055e8' (2022-11-03)
  → 'github:NixOS/nixpkgs/3bacde6273b09a21a8ccfba15586fb165078fb62' (2022-11-05)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/1404483f4531560aad73bdebae4096881c910ac0' (2022-11-04)
  → 'github:NixOS/nixpkgs/f09ad462c5a121d0239fde645aacb2221553a217' (2022-11-05)
```
2022-11-06 02:20:04 -08:00
d9b3fccdfa persist emote dir 2022-11-06 02:07:32 -08:00
94366d4bf6 browserpass: patch to support OTP codes better 2022-11-06 02:00:41 -08:00
12b5e68b25 servo: don't ship custom linux kernel packages anymore
it's probably not necessary. i confirmed the kernel provides rpi400 dtb
by default.
2022-11-05 22:29:20 -07:00
a0d332766a nixcache: always trust my own caches, even if not enabled by default 2022-11-05 20:13:17 -07:00
cdd9672654 libreoffice: disable first-run dialog 2022-11-05 17:24:19 -07:00
887a431956 podcasts: add The Verge - Decoder 2022-11-05 06:16:20 -07:00
502ebafb0a update: nixpkgs 2022-11-05 05:42:11 -07:00
57ada6af4f tokodon: fix segfault on launch
also persist the ~/.cache/KDE/tokodon directory.
since the login form isn't working yet (partially the fault of my
Pleroma install?), i can't tell if this is where tokens are stashed or
not.
2022-11-04 06:52:18 -07:00
d1d64b7376 import and update Tokodon package from <https://github.com/NixOS/nixpkgs/pull/170466>
this hangs and then segfaults at start. i suppose i should `gdb` it.
2022-11-03 22:23:14 -07:00
f2188be9f2 flake update: nixpkgs 2022-10-31 -> 2022-11-02, home-manager, sops, mobile-nixos
```
• Updated input 'home-manager':
    'github:nix-community/home-manager/f0ecd4b1db5e15103e955b18cb94bea4296e5c45' (2022-11-01)
  → 'github:nix-community/home-manager/d78b3488a76d251701ab58a9b7f0dd092b806c1e' (2022-11-03)
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/da56c338a2b00c868697b75bdbd388f60d50c820' (2022-10-30)
  → 'github:nixos/mobile-nixos/0b69b36c989d13f08c3bc563253f68c9d6ed7244' (2022-11-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/d40fea9aeb8840fea0d377baa4b38e39b9582458' (2022-10-31)
  → 'github:NixOS/nixpkgs/636051e353461f073ac55d5d42c1ed062a345046' (2022-11-02)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/1b4722674c315de0e191d0d79790b4eac51570a1' (2022-10-31)
  → 'github:NixOS/nixpkgs/b3a8f7ed267e0a7ed100eb7d716c9137ff120fe3' (2022-11-01)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/448ec3e7eb7c7e4563cc2471db748a71baaf9698' (2022-10-30)
  → 'github:Mic92/sops-nix/486b4455da16272c1ed31bc82adcdbe7af829465' (2022-11-02)
```
2022-11-03 17:31:47 -07:00
6d52c0e8ab new option: sane.gui.plasma.enable to enable desktop KDE plasma
this is useful for testing applications which are designed for KDE
first.
2022-11-03 03:09:14 -07:00
14b334ff55 new script: sane-reboot, to prevent me from rebooting the wrong machine when working with multiple hosts 2022-11-03 01:27:56 -07:00
730fa8ba4b moby: fix lightdm-mobile-greeter config to work again 2022-11-02 04:59:36 -07:00
8817f661ac browser: temporarily switch back to firefox
recompiling librewolf is not practical -- until the addon signing is
upstreamed
2022-11-02 04:21:55 -07:00
3b0f505864 moby: move lightdm-mobile-greeter stuff into nixpkgs 2022-11-02 04:14:00 -07:00
b559d334c3 librewolf: work toward upstreaming the MOZ_REQUIRE_SIGNING patch 2022-11-02 02:39:56 -07:00
f6e4c0058c add mercurial to dev packages 2022-11-01 22:20:05 -07:00
775fc979fc browser: fix Extensions.Uninstall + refactor nits 2022-11-01 19:29:33 -07:00
ad6daa4e5b librewolf: allow sideloading unsigned addons
still defaulting to firefox, because this requires a recompilation of
the browser -- particularly expensive for moby.
2022-11-01 19:17:49 -07:00
3ecfea158a browser: make more easily swappable between firefox and librewolf 2022-11-01 16:23:50 -07:00
5ff47b3719 remove unused rycee flake input
it was previously used for browser addons: i've since moved those
in-house for technical reasons.
2022-11-01 16:07:57 -07:00
03ea7e7fa5 flake update: nixpkgs 2022-10-30 -> 2022-10-31 and stable home-manager
```
• Updated input 'home-manager':
    'github:nix-community/home-manager/d8b233ad03dd3d82424561512b40971569b2e5d2' (2022-10-31)
  → 'github:nix-community/home-manager/f0ecd4b1db5e15103e955b18cb94bea4296e5c45' (2022-11-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/412b9917cea092f3d39f9cd5dead4effd5bc4053' (2022-10-30)
  → 'github:NixOS/nixpkgs/d40fea9aeb8840fea0d377baa4b38e39b9582458' (2022-10-31)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/26eb67abc9a7370a51fcb86ece18eaf19ae9207f' (2022-10-30)
  → 'github:NixOS/nixpkgs/1b4722674c315de0e191d0d79790b4eac51570a1' (2022-10-31)
```
2022-11-01 05:09:04 -07:00
ca93518dda browser: switch from librewolf to firefox-esr
librewolf doesn't allow unsigned addons. i believe this is a bug, as the
nixpkg build file looks like it *meant* to allow addons (and maybe at
some point did)
2022-11-01 04:58:45 -07:00
7f7041351b browserpass-extension: init at 3.7.2
bringing this in-tree instead of fetching it from the mozilla addons
webpage because i plan to develop on it.
2022-11-01 04:57:34 -07:00
1c62bcd50c lightdm-mobile-greeter: update git rev & remove the Cargo.lock patch
Raatty was kind enough to upstream the Cargo.lock fix.
2022-11-01 01:15:36 -07:00
bad4fe0e76 browserpass: add support for totp, and auto-unlock the secrets store on first run
note that one needs to manually enable the TOTP setting in the
browserpass settings for this to work -- TOTP parsing is disabled by
default
2022-10-31 23:57:47 -07:00
8b473ff88f neovim: fix python tree-sitter plugin
which was otherwise yielding parsing errors.
2022-10-31 23:05:27 -07:00
ad54b9c5fb flake update: rycee: 2022-10-29 -> 2022-11-01
```
• Updated input 'rycee':
    'gitlab:rycee/nur-expressions/5fb3c4733c00a7e7be69877d057f6760d85cecb8' (2022-10-29)
  → 'gitlab:rycee/nur-expressions/f4bf327807f86c85e85050101467835a65754b51' (2022-11-01)
```
2022-10-31 23:04:39 -07:00
b805a101ba flake update: nixpkgs 2022-10-29 -> 2022-10-30; home-manager
wouldn't ordinarily update so regularly, but on the lookout for that
openssl CVE...

```
• Updated input 'home-manager':
    'github:nix-community/home-manager/b81e128fc053ab3159d7b464d9b7dedc9d6a6891' (2022-10-17)
  → 'github:nix-community/home-manager/d8b233ad03dd3d82424561512b40971569b2e5d2' (2022-10-31)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/fdebb81f45a1ba2c4afca5fd9f526e1653ad0949' (2022-10-29)
  → 'github:NixOS/nixpkgs/412b9917cea092f3d39f9cd5dead4effd5bc4053' (2022-10-30)
```
2022-10-31 20:54:11 -07:00
69a3aaa086 new script: sane-private-lock
this is handy esp for `servo`, where i don't want my keys to be
accessible after i logout.

longterm, i suppose i could run this automatically on session close
(pam-umount or something i think exists for that?)
2022-10-31 04:21:25 -07:00
9acf2dfde1 gocryptfs: cross-compile for aarch64 2022-10-31 03:05:24 -07:00
4b5accac88 flake update: nixpkgs: 2022-10-22 -> 2022-10-29 and others
```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/1351091d2537040454fa232d8b94e745ab0eb5a3' (2022-10-24)
  → 'github:nixos/mobile-nixos/da56c338a2b00c868697b75bdbd388f60d50c820' (2022-10-30)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/95aeaf83c247b8f5aa561684317ecd860476fcd6' (2022-10-22)
  → 'github:NixOS/nixpkgs/fdebb81f45a1ba2c4afca5fd9f526e1653ad0949' (2022-10-29)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/3933d8bb9120573c0d8d49dc5e890cb211681490' (2022-10-22)
  → 'github:NixOS/nixpkgs/26eb67abc9a7370a51fcb86ece18eaf19ae9207f' (2022-10-30)
• Updated input 'rycee':
    'gitlab:rycee/nur-expressions/43d3a363c126968db46585b88b8eb97dd32634ad' (2022-10-27)
  → 'gitlab:rycee/nur-expressions/5fb3c4733c00a7e7be69877d057f6760d85cecb8' (2022-10-29)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/1b5f9512a265f0c9687dbff47893180f777f4809' (2022-10-23)
  → 'github:Mic92/sops-nix/448ec3e7eb7c7e4563cc2471db748a71baaf9698' (2022-10-30)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/f9115594149ebcb409a42e303bec4956814a8419' (2022-10-23)
  → 'github:NixOS/nixpkgs/6440d13df2327d2db13d3b17e419784020b71d22' (2022-10-30)
• Updated input 'uninsane':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs%2fheads%2fmaster&rev=4ad1801f6cecd678bbeae5dfe5933448dd7b3360' (2022-10-14)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs%2fheads%2fmaster&rev=80c6ec95bd430e29d231cf745f19279bb76fb382' (2022-10-27)
```
2022-10-30 23:47:29 -07:00
cb00ae4f92 update nautilus gtk4 patch SHA
it's been merged into nixpkgs; manual patch will likely go away after
next nixpkgs update
2022-10-30 21:33:58 -07:00
7c38c1dbe9 de-persist /etc/machine-id, and generate it from the ssh key instead
note that /etc/machine-id now contains a different value than before,
meaning `journalctl` will not show logs from before the time of this
change.
2022-10-30 21:02:41 -07:00
b3b45ec0f2 fix host ssh key persistence 2022-10-30 20:03:00 -07:00
34d77542e7 impermanence: ensure /etc/ssh is populated before we decode machine secrets during activation
the impermanence activation scripts don't appear to mount folders --
only files. rather, the impermanence module creates fstab entries for
each bind mount folder, and *something* (systemd?) mounts these *after*
/run/current-system/activate is run.

therefore, if we want access to a bind-mounted directory during
activateion, we have to manually mount it.
i.e. `mount /etc/ssh/host_keys`.
2022-10-30 05:59:55 -07:00
6236c14def vendor librewolf addons instead of fetching them on first run
this obviously speeds up startup, it's hopefully also less likely to
break surprisingly, and i hope it's the path to me shipping forks of
official extensions.
2022-10-27 03:20:29 -07:00
0c0f8c44bd Merge branch 'master' of git.uninsane.org:colin/nix-files 2022-10-26 07:18:41 -07:00
7f97786a88 librewolf: use browserpass password store
this is working -- forked to support sops as a backend --
without totp support yet. it's possible in theory: i might just need to
write some adapter logic.

upstream discussion about genericizing backend support:
- <https://github.com/browserpass/browserpass-native/issues/127>
2022-10-26 07:13:55 -07:00
db2e156f15 home: enable celluloid mpv frontend
i want to test this on mobile
2022-10-26 05:31:11 -07:00
43efec495e librewolf: integrate with gopass
it's able to list passwords, but not decrypt them:
i think i can solve this on the store side?
2022-10-26 00:10:54 -07:00
279f9ce614 lightdm-mobile-greeter: point directly to upstream, with a patch for their Cargo.lock 2022-10-25 22:05:49 -07:00
7d02652e08 servo: freshrss: fix ExecStart path 2022-10-25 06:31:18 -07:00
10e224be0d ssh: set known hosts via ~/.ssh/config
this prevents the ssh agent from updating the known_hosts file
and confusing home-manager.
2022-10-25 05:17:28 -07:00
e25c92794f refactor: split ssh settings out of home-manager/default.nix 2022-10-25 05:06:33 -07:00
a8d2b7196d statically populate ssh known_hosts 2022-10-25 05:01:32 -07:00
a6cbecbc74 Merge branch 'staging/pleroma-update' 2022-10-25 04:18:25 -07:00
518d2f60c0 pleroma: port ExifTool config
the old path is deprecated, if my syslog is to be believed.
2022-10-25 04:11:47 -07:00
70e5ccc968 upgrade pleroma, thereby fixing servo build 2022-10-25 03:44:45 -07:00
c44cad9c16 fractal: persist data in ~/private 2022-10-25 02:12:55 -07:00
e3bf585382 persist ssh host keys in a subdirectory 2022-10-25 02:09:27 -07:00
1fea9618ba zsh: remove rm and mv confirmations 2022-10-25 01:42:46 -07:00
8d89f828b6 new sane script: sane-rcp
i guess this could just be an alias? 🤷
2022-10-25 01:19:05 -07:00
e2985ef018 sane-scripts: new helper to redirect stdout to some permissioned file 2022-10-24 23:43:32 -07:00
d54b595e45 RSS: subscribe to Edward Snowden 2022-10-24 20:23:14 -07:00
ad75ed352c RSS: clean up the substack subs 2022-10-24 20:14:36 -07:00
306836042c RSS: add my own feed :-) 2022-10-24 19:52:39 -07:00
965181c8b0 moby: change password 2022-10-24 08:33:51 -07:00
b344c38bfb provide a script for changing the ~/private dir secrets
gocryptfs doesn't (i think?) ship a tool for changing the password: you
just create a new fs and rsync/mv the data
2022-10-24 08:21:53 -07:00
174bc539bc moby: enable a statically-assigned but encrypted password 2022-10-24 07:39:50 -07:00
9ef457c0dd secrets/servo: grant access to lappy 2022-10-24 06:56:16 -07:00
939278b970 home: migrate Element directory to private storage 2022-10-24 06:42:51 -07:00
3d0bd0fbf4 remove TODO file
some of these had been done. the ones not done are documented elsewhere
(either in this repo or in my own PKM).
2022-10-24 06:20:22 -07:00
36d8a711ac modules/services: abstract behind default.nix 2022-10-24 06:13:04 -07:00
4c4b73f693 refactor: helpers/set-hostname.nix becomes machines/instantiate.nix 2022-10-24 06:06:11 -07:00
9151f58b37 desko: set a password 2022-10-24 01:59:36 -07:00
b2c55ed98a sane-private-unlock: make ~/private if it doesn't exist 2022-10-24 01:53:41 -07:00
1721546410 store ssh keys in ~/private, where they're encrypted 2022-10-24 01:33:14 -07:00
c833c68d83 move ssh pubkeys into their own file for future reuse 2022-10-24 01:33:01 -07:00
9a4c2613c1 lappy: update passwd 2022-10-24 00:47:09 -07:00
8de5b0a79d iwd: switch APs more aggressively
unclear how much of a difference this makes yet: will hopefully
test/tune it over time.
2022-10-24 00:25:19 -07:00
ced64e63ef Merge remote-tracking branch 'remotes/origin/staging/nixpkgs-2022-10-22' 2022-10-24 00:22:41 -07:00
8dd267db30 servo: goaccess: anonymize IPs and hide the 'HOSTS' panel 2022-10-24 00:16:42 -07:00
10541698a7 flake update: nixpkgs 2022-10-19 -> 2022-10-22 & others
```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/2a4d4a71e1dfa6d9001249fd57229e949dac0908' (2022-10-21)
  → 'github:nixos/mobile-nixos/1351091d2537040454fa232d8b94e745ab0eb5a3' (2022-10-24)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/db25c4da285c5989b39e4ce13dea651a88b7a9d4' (2022-10-19)
  → 'github:NixOS/nixpkgs/95aeaf83c247b8f5aa561684317ecd860476fcd6' (2022-10-22)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/44fc3cb097324c9f9f93313dd3f103e78d722968' (2022-10-20)
  → 'github:NixOS/nixpkgs/3933d8bb9120573c0d8d49dc5e890cb211681490' (2022-10-22)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/8e470d4eac115aa793437e52e84e7f9abdce236b' (2022-10-18)
  → 'github:Mic92/sops-nix/1b5f9512a265f0c9687dbff47893180f777f4809' (2022-10-23)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/945a85cb7ee31f5f8c49432d77b610b777662d4f' (2022-10-15)
  → 'github:NixOS/nixpkgs/f9115594149ebcb409a42e303bec4956814a8419' (2022-10-23)
```
2022-10-23 21:47:03 -07:00
b658b93c64 lappy: store the hashed user passwd in git and decrypt it into /etc/passwd on boot
this approach lets me persist the password. persisting /etc/shadow
directly wasn't so feasible. populating /etc/shadow at activation time
is something nix already does and is easy to plug into.
so we store the passwd hash in this repo, but encrypt it to the
destination machine's ssh pubkey to add enough entropy that it's not
brute-forceable through the public git repo.
2022-10-23 06:53:06 -07:00
f68bc342e8 fix activationScript ordering to remove sops double-decrypt hack 2022-10-23 06:53:05 -07:00
e3221bf8b9 home: add handbrake program 2022-10-23 03:02:31 -07:00
3cfe236e90 sane-sync-from-iphone: handle the case where /mnt/iphone is hung 2022-10-22 23:35:00 -07:00
2b14648587 servo: persist the maildir
this way i don't lose my mail on every reboot...

wow i can't believe it took me this long to make the connection.
2022-10-22 07:00:56 -07:00
0753aa59e9 refactor: move default home impermanence dirs to modules/universal/users.nix 2022-10-22 06:09:53 -07:00
55cbce17c2 refactor: impermanence: remove duplicate function map-service-dirs 2022-10-22 06:03:04 -07:00
ebf3152ced refactor: purge impermanence.home-files option
persisting individual files doesn't work super well. we can do without
it and things are simpler.
2022-10-22 05:56:04 -07:00
8345375bc4 zsh: fix history path to be fully-qualified
it's implicitly a relative path to where the shell is initialized.
2022-10-22 05:52:05 -07:00
cc63cacf28 new script to unlock ~/private 2022-10-22 05:47:17 -07:00
8f61ba6085 zsh: move .zsh_history to ~/.local/share/zsh
this works better with impermanence (see code comment)
2022-10-22 04:08:37 -07:00
b43103a024 refactor: move .zsh_history impermanence definition into zsh.nix 2022-10-22 04:02:40 -07:00
187a52527b refactor: squash env directory 2022-10-22 03:56:50 -07:00
b26e826b3b sway: add a config option to disable the greeter (and auto-login instead)
i need this now as a way to keep gtk3 packages (in greetd) out of the
environment, so i can test the Nautilus gtk3-not-present bug.
2022-10-22 01:31:51 -07:00
3851136398 nginx/goaccess: opt-in *specific* hosts for public logs
the other hosts are by default private. mostly because they're just
internal services where i'm the primary user.
2022-10-21 22:38:38 -07:00
635fee1bda nginx: include hostname in log so goaccess can group on it 2022-10-21 22:00:49 -07:00
5048ee1ce5 servo: fix RSS feeds.nix invalid reference (fix build) 2022-10-21 21:59:17 -07:00
e787dc29c6 servo: enable goaccess for metrics/monitoring
TODO: change the nginx log format to include virtualhost and enable
goaccess to group by host
2022-10-21 09:55:49 -07:00
7cc44f9455 feeds: follow Anish Lakhwara
supposedly. we'll see if my RSS client actually understands that feed...
2022-10-21 09:30:54 -07:00
419ababe6f home-manager: split discord.nix out of default.nix 2022-10-21 09:27:04 -07:00
e4c0a0d468 home-manager: split aerc.nix out of default.nix 2022-10-21 09:15:08 -07:00
0e63cd4e11 home-manager: split sublime-music.nix out of default.nix 2022-10-21 09:10:55 -07:00
9328e5ff32 home: disable nb 2022-10-21 09:01:06 -07:00
87dda0ad11 home: nb: move package inclusion to nb.nix 2022-10-21 08:59:04 -07:00
46783cd0e2 home-manager: split nb out of default.nix 2022-10-21 08:53:08 -07:00
f7d3b8128e home-manager: split vlc config out of default.nix 2022-10-21 08:47:21 -07:00
9119f0b092 home-manager: split mpv config out of default.nix 2022-10-21 08:44:25 -07:00
17189b22e9 home-manager: split git config out of default.nix 2022-10-21 08:41:28 -07:00
7db3816511 home-manager: move librewolf out of default.nix 2022-10-21 08:38:20 -07:00
8c20017544 home-manager: split neovim out of default.nix 2022-10-21 08:30:35 -07:00
4c1f68f82f home-manager: split kitty out of default.nix 2022-10-21 08:24:07 -07:00
289745f41a split zsh config out of home-manager.nix monolith 2022-10-21 08:20:30 -07:00
d9caf70c6c home-manager: remove 'enable' option 2022-10-21 07:43:20 -07:00
cf95a6e321 env: alias to mkdir + pushd 2022-10-21 07:06:55 -07:00
155c095be8 moby: bump kernel 6.0.0 -> 6.0.2 2022-10-21 05:57:36 -07:00
bafe7aa3c7 Merge branch 'staging/nixpkgs-2022-10-20' 2022-10-21 02:08:33 -07:00
c9d57f2995 commit ensure-perms script for image post-processing
this was created weeks ago and not committed
2022-10-21 02:04:30 -07:00
a8227bbcbc nix flake update (nixpkgs 2022-10-14 -> 2022-10-19 and others)
```
• Updated input 'home-manager':
    'github:nix-community/home-manager/17208be516fc36e2ab0ceb064d931e90eb88b2a3' (2022-10-11)
  → 'github:nix-community/home-manager/b81e128fc053ab3159d7b464d9b7dedc9d6a6891' (2022-10-17)
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/e4b6f680b2a4f29f087a7c1299c11499d1a367b6' (2022-10-14)
  → 'github:nixos/mobile-nixos/2a4d4a71e1dfa6d9001249fd57229e949dac0908' (2022-10-21)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/4428e23312933a196724da2df7ab78eb5e67a88e' (2022-10-14)
  → 'github:NixOS/nixpkgs/db25c4da285c5989b39e4ce13dea651a88b7a9d4' (2022-10-19)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/e06bd4b64bbfda91d74f13cb5eca89485d47528f' (2022-10-12)
  → 'github:NixOS/nixpkgs/44fc3cb097324c9f9f93313dd3f103e78d722968' (2022-10-20)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/0ce0449e6404c4ff9d1b7bd657794ae5ca54deb3' (2022-10-09)
  → 'github:Mic92/sops-nix/8e470d4eac115aa793437e52e84e7f9abdce236b' (2022-10-18)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/b3783bcfb8ec54e0de26feccfc6cc36b8e202ed5' (2022-10-09)
  → 'github:NixOS/nixpkgs/945a85cb7ee31f5f8c49432d77b610b777662d4f' (2022-10-15)
```
2022-10-21 00:42:30 -07:00
1623367b13 commit ensure-perms script for image post-processing
this was created weeks ago and not committed
2022-10-21 00:03:57 -07:00
90b0535c56 env: add gdb to enableDevPkgs
this is especially useful for `coredumpctl`.
maybe useful enough that it should be in `environment.systemPackages`...
2022-10-20 23:55:50 -07:00
760d69efc0 Merge branch 'staging/phosh-lightdm' 2022-10-20 23:55:24 -07:00
f8157961c8 phosh: ensure the user we want to login as is available in AccountsService 2022-10-20 23:41:52 -07:00
25df2ebc28 phosh: lightdm: configure user-session so that the greeter properly launches phosh 2022-10-20 23:20:19 -07:00
33110dc1d9 phosh/lightdm: configure default xorg session 2022-10-20 21:16:38 -07:00
0fa602f1dd lightdm-mobile-greeter: update to 0.1.2
better logging/error handling
2022-10-20 19:59:03 -07:00
48ff8e9ca7 more feedbackd user definition to phosh 2022-10-20 19:59:03 -07:00
366e28e199 home-packages: create a new option to enable devPkgs 2022-10-20 19:59:03 -07:00
06dcd8883a home-packages: create a new option to enable devPkgs 2022-10-20 18:03:01 -07:00
ed03f7f929 lightdm-mobile-greeter: create passthru.xgreeters like other lightdm greeters do 2022-10-20 18:00:23 -07:00
f3bec7bf0a lightdm-mobile-greeter: include .desktop file in output 2022-10-20 07:19:49 -07:00
e6adfe95fa phosh: use lightdm-mobile-greeter
untested, so probably need to change the .desktop path
2022-10-20 05:03:30 -07:00
70d1e14cf8 package lightdm-mobile-greeter 2022-10-20 02:30:58 -07:00
4752371b43 phosh: disable the greeter
none of them work without a keyboard
2022-10-19 08:12:56 -07:00
3e7c112548 phosh: try using the lightdm greeter 2022-10-19 05:18:13 -07:00
a2856a3601 gnome: use deterministic uids/gids (fixes gnome gui build) 2022-10-19 03:56:52 -07:00
53d8bdc0ea sway: enable Alt+L to lock the screen 2022-10-18 23:34:41 -07:00
94a6ca82f3 sway: enable login prompt/greeter 2022-10-18 22:53:13 -07:00
10e9daa085 git: enable git difftool to use difftastic 2022-10-18 19:46:24 -07:00
e11f903aec create/deply ~/private: an encrypted filesystem
it uses gocryptfs -- a newer alternative to EncFS -- to encrypt
paths and data (but not metadata) onto an underlying backing filesystem
2022-10-18 05:29:36 -07:00
98c2ac21fe zsh: do not remember rm commands 2022-10-17 18:22:28 -07:00
52fe0c7523 enable programs to propagate zsh completions, as suggested by home-manager 2022-10-17 18:21:56 -07:00
825b3e4067 flake update: nixpkgs 2022-10-13 -> 2022-10-14
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/ba187fbdc5e35322c7dff556ef2c47bddfd6e8d7' (2022-10-13)
  → 'github:NixOS/nixpkgs/4428e23312933a196724da2df7ab78eb5e67a88e' (2022-10-14)
```
2022-10-15 07:07:23 -07:00
674f852393 freshrss shebang fix: point to upstream PR 2022-10-15 07:04:13 -07:00
fdb77ac588 matrix-appservice-discord: remove
i use mx-puppet now. it works better and requires no patching (at least
yet. maybe it will in the future to support threads).
2022-10-15 02:25:57 -07:00
05cb85fd9b freshrss: import my feeds on start
it's a little clunky in that it seems to need some refreshes
before it gets them, but it works.
2022-10-15 01:41:53 -07:00
8f0a270154 readme: document how to build nixpkgs and cross packages 2022-10-15 01:28:30 -07:00
fae87d3fbc servo: pleroma: switch logging from debug -> warn 2022-10-15 00:39:55 -07:00
75ae16aaab feeds: refactor 2022-10-14 22:37:02 -07:00
8a1ea79f1f feeds: simplify/abstract the OPML generation 2022-10-14 09:37:40 -07:00
b25f270f48 feeds: convert to ordinary nix expression instead of config/options
there's no real reason for it to be externally configurable at this
level.
2022-10-14 09:02:50 -07:00
e023f48c52 publish latest uninsane blog (nixos upstreaming) 2022-10-14 08:04:41 -07:00
3d7a63e4f9 nautilus: patch gtk4 settings schema bug via upstream PR 2022-10-14 07:10:35 -07:00
d296475e64 home: add cdrtools to rip CDs 2022-10-14 04:21:00 -07:00
f031e489a3 nautilus: look for the gtk4 FileChooser settings instead of the gtk4 one 2022-10-14 01:15:33 -07:00
699204c5f5 git: disable difftastic until i find how to make it more usable 2022-10-14 01:10:23 -07:00
b25528ecd7 Merge branch 'staging/nixpkgs-2022-10-14' 2022-10-13 22:16:06 -07:00
130dd3f895 freshrss: patch in correct shebangs 2022-10-13 22:15:30 -07:00
fcf60bae35 servo: persist the freshrss data 2022-10-13 21:49:54 -07:00
5b5187bd03 flake update: nixpkgs 2022-10-09 -> 2022-10-13, others
```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/0bf9b6da8c4d0ee31c3e988c99893de4da7df74a' (2022-10-10)
  → 'github:nixos/mobile-nixos/e4b6f680b2a4f29f087a7c1299c11499d1a367b6' (2022-10-14)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/34c5293a71ffdb2fe054eb5288adc1882c1eb0b1' (2022-10-09)
  → 'github:NixOS/nixpkgs/ba187fbdc5e35322c7dff556ef2c47bddfd6e8d7' (2022-10-13)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/e179d1e57ad07f1294dcc29ad5283b214a6ae21e' (2022-10-10)
  → 'github:NixOS/nixpkgs/e06bd4b64bbfda91d74f13cb5eca89485d47528f' (2022-10-12)
• Updated input 'uninsane':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs%2fheads%2fmaster&rev=25df079540cb669fb5e735631fe03a4d113d1c73' (2022-10-11)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs%2fheads%2fmaster&rev=70e7d8e94a6240a5ce976bbc514e0979b7178190' (2022-10-14)
```
2022-10-13 21:41:02 -07:00
43123e78cb servo: use user/group names instead of ids for service dir ownership 2022-10-13 18:00:59 -07:00
9305d44fde servo: add freshrss service 2022-10-13 17:52:43 -07:00
ac0d7cc1e5 flake update: nixpkgs: 2022-10-08; uninsane updated
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c5924154f000e6306030300592f4282949b2db6c' (2022-10-08)
  → 'github:NixOS/nixpkgs/34c5293a71ffdb2fe054eb5288adc1882c1eb0b1' (2022-10-09)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/9282141c8bc05568ec0e342eac39df72603aa9fa' (2022-10-09)
  → 'github:NixOS/nixpkgs/e179d1e57ad07f1294dcc29ad5283b214a6ae21e' (2022-10-10)
• Updated input 'uninsane':
    'git+https://git.uninsane.org/colin/uninsane?ref=refs%2fheads%2fmaster&rev=ea196acf408451150a86d4d41114be04529eaf41' (2022-10-11)
  → 'git+https://git.uninsane.org/colin/uninsane?ref=refs%2fheads%2fmaster&rev=25df079540cb669fb5e735631fe03a4d113d1c73' (2022-10-11)
```
2022-10-11 21:24:41 -07:00
711778a975 servo: nginx stateless deployment of the main blog
i.e. no need to run `make publish` when rebuilding the blog anymore.
instead, push blog changes, then `nix flake update; nixos-rebuild switch`
2022-10-11 05:27:51 -07:00
590c81c5db update uninsane-dot-org dependency 2022-10-11 05:16:20 -07:00
e858afea72 add uninsane.org sources as a flake input
one can build the site from here with:

```
nix build '.#uninsane.uninsane-dot-org'
```
2022-10-11 03:22:40 -07:00
4abac0162f remove impermanence nixpkgs override 2022-10-11 02:20:36 -07:00
8fa591229f env: RSS: simplify implementation 2022-10-11 02:05:27 -07:00
a118e17b32 home: RSS: specify feeds in a friendlier schema 2022-10-11 01:50:46 -07:00
8afe0c0be5 env: RSS populate a .opml file which can be manually imported into NewsFlash 2022-10-11 01:30:17 -07:00
aa6153aa56 newsflash: persist data dir 2022-10-11 01:30:10 -07:00
69a7e2fae1 home: add newsflash (RSS viewer)
it's configurable via OPML in the UI, maybe possible to hack in a CLI
if i code against the underlying library/API
2022-10-10 18:57:37 -07:00
eec4e288f3 gpodder: fix \n instead of actual newline in generated OPML 2022-10-10 18:35:27 -07:00
f84e451a9e home: switch back to vlc for audio 2022-10-10 17:30:29 -07:00
dacbfa0493 users: allow moby to ssh into any device 2022-10-10 17:27:01 -07:00
fbd8a70102 flake: plumb my nixpkgs through to dependencies 2022-10-10 17:19:57 -07:00
17b6dc56bd flake update: mobile-nixos: 2022-10-04 -> 2022-10-10
```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/ca872f1a617674c4045e880aab8a45037e73700b' (2022-10-04)
  → 'github:nixos/mobile-nixos/0bf9b6da8c4d0ee31c3e988c99893de4da7df74a' (2022-10-10)
```
2022-10-10 17:17:33 -07:00
f464a80541 net: rename iphone SSID 2022-10-10 04:54:02 -07:00
f663243ad4 net: nit: normalize the SSID_PLAINTEXT field 2022-10-09 23:28:52 -07:00
94d9348b73 net: fix missing [Security] section for iphone.psk 2022-10-09 23:28:31 -07:00
6a44432d3f home: configure mpv as default audio player 2022-10-09 18:37:19 -07:00
9047aec7e9 home: clean up xdg/mime-types definitions 2022-10-09 17:42:48 -07:00
b702031ddf home: remove unused packages rmlint and gnome-podcasts 2022-10-09 17:36:32 -07:00
d5686426bf remove old dart update patch 2022-10-09 17:02:23 -07:00
85e249913a update: nixpkgs 2022-10-06 -> 2022-10-08 2022-10-09 17:01:48 -07:00
d50b8c1315 env: split RSS feeds out of home-manager 2022-10-09 05:43:53 -07:00
336301258f enable difftastic git rendering 2022-10-09 04:43:39 -07:00
645ca3764b vim: disable mouse mode by default >.> 2022-10-08 23:17:26 -07:00
22602283c9 browser: gracefully handle OCSP outages 2022-10-08 21:54:00 -07:00
39b963e87b flake update: sops and its deps
```
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/912f9ff41fd9353dec1f783170793699789fe9aa' (2022-09-26)
  → 'github:Mic92/sops-nix/0ce0449e6404c4ff9d1b7bd657794ae5ca54deb3' (2022-10-09)
• Updated input 'sops-nix/nixpkgs':
    'github:NixOS/nixpkgs/ff9793cfd1a25145a7e591af604675b3d6f68987' (2022-09-26)
  → 'github:NixOS/nixpkgs/7b06206fa24198912cea58de690aa4943f238fbf' (2022-10-08)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/00f877f4927b6f7d7b75731b5a1e2ae7324eaf14' (2022-09-26)
  → 'github:NixOS/nixpkgs/b3783bcfb8ec54e0de26feccfc6cc36b8e202ed5' (2022-10-09)
```

the only change appears to be that sops updated its own reference to
nixpkgs.
2022-10-08 21:43:41 -07:00
1a5f1260e2 Merge branch 'staging/2022-10-08-flutter-update' 2022-10-08 21:39:37 -07:00
c18e8eddcc zsh: enable zmb builtin 2022-10-08 20:12:50 -07:00
874c352987 net: add psk for connecting to my mobile hotspot 2022-10-08 19:24:55 -07:00
0395c5b8ee update nixpkgs: 2022-10-06 and rebase Kaiteki 2022-10-08 18:21:38 -07:00
f64c44716e home: persist fractal IM data 2022-10-08 05:42:02 -07:00
b2b61d2889 net: hex-encode the home network names.
otherwise iwd doesn't seem to understand them?
2022-10-07 20:39:26 -07:00
4f05a00e4a RSS: add Doomberg 2022-10-07 20:13:26 -07:00
c71346e9b8 servo: matrix: enable mx-puppet-discord for better Discord bridging 2022-10-07 04:33:23 -07:00
f5576c3667 servo: matrix: rename discord.nix -> discord-appservice.nix
this is in contrast to e.g. mx-discord-puppet, which i'll be trying soon
2022-10-07 02:16:01 -07:00
b437ddacd9 servo: disable matrix irc bridge by just not importing the nix file 2022-10-07 02:04:25 -07:00
68bda8aea7 servo: migrate ipfs options (to kubo) 2022-10-06 23:47:16 -07:00
d840f947b3 Merge branch 'staging/nixpkgs-2022-10-05' 2022-10-06 18:25:22 -07:00
d4261c45e6 nixpkgs: 2022-10-02 -> 2022-10-05, plus mobile-nixos update
```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/efa5b5fae930370753d2e09361b38d10f0e0a00d' (2022-10-03)
  → 'github:nixos/mobile-nixos/ca872f1a617674c4045e880aab8a45037e73700b' (2022-10-04)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/59d2991d4256cdca1c0cda45d876c80a0fe45c31' (2022-10-02)
  → 'github:NixOS/nixpkgs/37bd39839acf99c5b738319f42478296f827f274' (2022-10-05)
• Updated input 'nixpkgs-stable':
    'github:NixOS/nixpkgs/9cac45850280978a21a3eb67b15a18f34cbffa2d' (2022-10-01)
  → 'github:NixOS/nixpkgs/fe76645aaf2fac3baaa2813fd0089930689c53b5' (2022-10-04)
```
2022-10-06 18:24:35 -07:00
6e01c59d08 default-initialize gnome keyrings, and persist them to disk 2022-10-06 17:29:10 -07:00
9052291b31 add script to initialize the gnome keyring 2022-10-06 17:21:59 -07:00
a95884d635 env: enable home-manager-help command; add libsecret to env 2022-10-06 15:56:37 -07:00
0e9993923d servo: matrix: move irc config to own file 2022-10-06 02:19:44 -07:00
cc12b87d0e servo: matrix: use username/groupname instead of uid/gid for impermanence 2022-10-06 01:55:25 -07:00
a5393c3c84 servo: matrix: break the discord bridge out of default.nix 2022-10-06 01:54:46 -07:00
e1cd1be48d Merge branch 'staging/discord' 2022-10-06 01:38:49 -07:00
37b931418d servo: matrix-appservice-discord: disable annoying quirks
like bad edits, bot replies, etc.
2022-10-06 01:35:00 -07:00
a3db626a00 servo: matrix-appservice-discord: hide keys in sops, and enable. 2022-10-05 22:38:20 -07:00
ca239ca3e6 matrix: set up Discord bridge
verified working after i fill in the Discord secrets, but i need to find
a way to provide those outside of the nix store.
2022-10-05 22:02:07 -07:00
6c38500e52 servo: patch matrix-appservice-discord to allow 100% puppeting 2022-10-05 19:29:40 -07:00
0c4dd28bc8 env: include sqlite to debug databases 2022-10-05 02:46:11 -07:00
47f378e7fc servo: consolidate service enumeration to services/default.nix 2022-10-04 23:08:03 -07:00
0648825765 moby: update kernel 6.0.0-rc4 -> 6.0.0 (release) 2022-10-04 15:57:15 -07:00
5f277f8653 moby: fix up CMA allocations so fractal (gui app) works
this probably enables other apps like Element; untested
2022-10-04 02:25:59 -07:00
5929286397 update nixpkgs: 2022-09-30 -> 2022-10-02
have to add nixpkgs stable to pin electrum to a buildable version

```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/42a30393b5eccaf7f73104fc39a71f0801340f5f' (2022-10-01)
  → 'github:nixos/mobile-nixos/efa5b5fae930370753d2e09361b38d10f0e0a00d' (2022-10-03)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/10ecda252ce1b3b1d6403caeadbcc8f30d5ab796' (2022-09-30)
  → 'github:NixOS/nixpkgs/59d2991d4256cdca1c0cda45d876c80a0fe45c31' (2022-10-02)
```
2022-10-03 13:49:01 -07:00
8847147a9d Revert "electrum: fix build using upstream patch instead of own"
the proposed fix doesn't work on x86_64

This reverts commit 5058694c5b.
2022-10-03 01:01:39 -07:00
5682a3e5f1 moby: remove some dead/commented-out code 2022-10-02 20:43:52 -07:00
6bc9337b3a phosh-mobile-settings: include all the needed buildInputs 2022-10-02 19:15:44 -07:00
5058694c5b electrum: fix build using upstream patch instead of own 2022-10-02 16:42:13 -07:00
94e03467ab Merge branch 'staging/nixpkgs-2022-09-30' 2022-10-02 04:42:31 -07:00
2ff9cc9d6c pkg: sane-mount-servo: comment/note a fix about a bug i saw in this script 2022-10-02 01:26:50 -07:00
a38d66073d env: add packages for tagging mp3s 2022-10-02 01:25:31 -07:00
f486fa9eda env: symlink servo media into Videos and Music 2022-10-02 01:24:42 -07:00
e3faabfad7 update nixpkgs: 2022-09-28 -> 2022-09-30
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/854fdc68881791812eddd33b2fed94b954979a8e' (2022-09-28)
  → 'github:NixOS/nixpkgs/10ecda252ce1b3b1d6403caeadbcc8f30d5ab796' (2022-09-30)
```
2022-10-02 01:20:50 -07:00
7d4a7df2dd replace deprecated runCommandNoCC with runCommand (fixes imgs.moby build) 2022-10-01 23:51:29 -07:00
93177fffb3 pkgs: install the Fractal matrix client
i'll try to deploy this to the Pinephone, because it looks very modern
and supports E2E
2022-10-01 02:53:28 -07:00
bc482a2621 nix flake update: mobile-nixos: 2022-09-30 -> 2022-10-01
```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/b082416ae3169e00552b8b0933c9f38ae50f181b' (2022-09-30)
  → 'github:nixos/mobile-nixos/42a30393b5eccaf7f73104fc39a71f0801340f5f' (2022-10-01)
```
2022-09-30 21:35:24 -07:00
381d41e3b4 phosh-mobile-settings: point to upstream PR 2022-09-30 21:29:37 -07:00
469aa50b64 phosh-mobile-settings: fix .desktop file to display in phosh 2022-09-30 20:58:48 -07:00
6dbd107a07 phosh-mobile-settings: remove unneeded gnome schema refs (for real this time) 2022-09-30 18:31:27 -07:00
ffcc1ab49a Merge branch 'staging/phosh-mobile-settings' into HEAD 2022-09-30 18:29:21 -07:00
f78b06bc88 phosh-mobile-settings: remove the unneeded gnome schema ref 2022-09-30 18:27:07 -07:00
b88a20b0f4 phosh-mobile-settings: link phosh plugins into the plugins dir 2022-09-30 18:21:12 -07:00
56f484f460 install phosh-mobile-settings 2022-09-30 18:21:12 -07:00
151fdad014 phosh-mobile-settings: init at 0.21.1 2022-09-30 18:21:12 -07:00
16371a37b9 upstream element electron update 2022-09-30 18:10:18 -07:00
034f29a897 phosh-mobile-settings: link phosh plugins into the plugins dir 2022-09-30 18:03:20 -07:00
ef2d58a5a2 install phosh-mobile-settings 2022-09-30 17:19:08 -07:00
b109bc5586 phosh-mobile-settings: init at 0.21.1 2022-09-30 17:00:05 -07:00
434b299eca element-desktop: upgrade electron 19 -> 20 2022-09-30 16:17:17 -07:00
40e7a12ea3 flake update: mobile-nixos: 2022-09-27 -> 2022-09-30
```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/1164f6bdedd68c633c1ac03bf64484bc586a709b' (2022-09-27)
  → 'github:nixos/mobile-nixos/b082416ae3169e00552b8b0933c9f38ae50f181b' (2022-09-30)
```
2022-09-30 14:51:51 -07:00
77579733c6 phosh-0.21.1: point to upstream PR 2022-09-30 05:40:41 -07:00
861defcc6e phosh: 0.21.0 -> 0.21.1 2022-09-30 05:17:48 -07:00
7d62212c24 moby: disable nixos documentation
it slows down the build too much to be worth it
2022-09-30 04:44:29 -07:00
120bb23f3c flutter: fix hash (again) 2022-09-30 03:55:42 -07:00
ccb442c875 flutter: update hash
hopefully it's not too instable...
2022-09-29 20:23:34 -07:00
aa5fc023a9 Merge branch 'update/nixpkgs-2022-09-28' 2022-09-29 18:14:44 -07:00
487dfd3378 sane-reclaim-disk-space: add --fast flag to skip rmlint check 2022-09-29 17:54:45 -07:00
2180361eaf update nixpkgs: 2022-09-26 -> 202-09-28
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/62228ccc672ed000f35b1e5c82e4183e46767e52' (2022-09-26)
  → 'github:NixOS/nixpkgs/854fdc68881791812eddd33b2fed94b954979a8e' (2022-09-28)
```
2022-09-29 17:16:17 -07:00
d6e34c6e98 net: rename encrypted .psk files -> .psk.bin 2022-09-29 06:12:51 -07:00
10c7a8d779 delete old network manager files 2022-09-29 06:10:35 -07:00
3184c6cfb6 net: switch to iwd for better experience
iwd, v.s. wpa_supplicant, has smarter metrics for choosing which
wireless networks to connect to when multiple are in range.
2022-09-29 06:08:33 -07:00
26c8d2d2d4 networking: replace env symlinks with sops native path feature 2022-09-29 03:33:48 -07:00
13531744d3 element-desktop: 1.11.5 -> 1.11.8
i'm trying to get an element build that works well on moby
2022-09-29 02:04:10 -07:00
4fd9650ee6 nixpatches: update outstanding sane PRs 2022-09-28 16:17:09 -07:00
529e47a5fa disable the pinephone proximity sensor
it's just bad UX.
2022-09-28 05:33:08 -07:00
83b27526cb Revert "update nixpkgs 2022-09-26 -> 2022-09-27"
although nixpkgs-unstable 2022-09-27 boots fine on lappy,
phosh reliably fails to start on moby.

This reverts commit ae8d708018.
2022-09-28 05:31:19 -07:00
570619b097 first stab at switching to iwd (it didn't work) 2022-09-28 05:25:34 -07:00
ae8d708018 update nixpkgs 2022-09-26 -> 2022-09-27
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/62228ccc672ed000f35b1e5c82e4183e46767e52' (2022-09-26)
  → 'github:NixOS/nixpkgs/7e52b35fe98481a279d89f9c145f8076d049d2b9' (2022-09-27)
```
2022-09-28 04:18:04 -07:00
b5cab38348 feeds: add Kaiteki commit log 2022-09-27 23:45:26 -07:00
bb7e2ee70a moby: enable hardware.driSupport
not extensively tested, but the basics seem to work.
2022-09-27 23:23:37 -07:00
ae220ab2e1 nixpatches: point whalebird update to upstream PR 2022-09-27 23:21:46 -07:00
050c8d15de whalebird: pin electron version 2022-09-27 21:42:56 -07:00
af5834c3fc whalebird: 4.6.0 -> 4.6.5 2022-09-27 21:24:39 -07:00
30ef2b651a zecwallet: 1.7.13 -> 1.8.8 2022-09-27 20:54:21 -07:00
8d185f1bbc update nixpkgs: 2022-09-25 -> 2022-09-26
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/79d3ca08920364759c63fd3eb562e99c0c17044a' (2022-09-25)
  → 'github:NixOS/nixpkgs/62228ccc672ed000f35b1e5c82e4183e46767e52' (2022-09-26)
```
2022-09-27 16:00:54 -07:00
b1a4fb9ccb pkgs: remove dead zecwallet-lite pkg code 2022-09-27 05:29:00 -07:00
8df4415218 kaiteki: build from github patch instead of my own source tree
this helps ensure the upstreaming goes ok
2022-09-27 05:27:41 -07:00
9a6e0b4451 kaiteki: fix vendorHash 2022-09-27 05:09:17 -07:00
90fb89390e pkg: kaiteki: fix up desktop and icon files 2022-09-27 04:52:34 -07:00
fbc747fc22 home: install gnome-weather 2022-09-27 04:35:16 -07:00
ad8da9dfa6 sane ssh mounts: enable noCheck to silence syslog warnings 2022-09-27 04:33:28 -07:00
32036ec45e flake update: mobile-nixos 2022-08-28 -> 2022-09-27
```
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/09e388c42298fa777caa7738cd8d8d2b6d1ac8db' (2022-08-28)
  → 'github:nixos/mobile-nixos/1164f6bdedd68c633c1ac03bf64484bc586a709b' (2022-09-27)
```
2022-09-27 01:14:06 -07:00
90107c024e kaiteki: update from 2022-08-31 -> 2022-09-03 2022-09-27 00:16:47 -07:00
d466c0b942 bump kaiteki: 2022-06-03 -> unstable-2022-08-31 2022-09-26 23:20:31 -07:00
8a6460e1b0 home: persist gPodder downloads
i checked `gpo set`: there doesn't appear to be a way to configure the
Downloads dir, so just let gpodder use its preferred dir.
2022-09-26 17:56:48 -07:00
370ae917b9 home: persist vlc state 2022-09-26 17:48:55 -07:00
b223a3a20e Merge branch 'update/nixpkgs-2022-09-25' 2022-09-26 17:16:15 -07:00
f70a62def5 home: configure app associations for .pdf and .md files 2022-09-26 17:02:14 -07:00
7863d12263 nix flake update. nixpkgs: 2022-09-{24 -> 25}; sops-nix: 2022-09-{25 -> 26}
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/fde244a8c7655bc28616864e2290ad9c95409c2c' (2022-09-24)
  → 'github:NixOS/nixpkgs/79d3ca08920364759c63fd3eb562e99c0c17044a' (2022-09-25)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/17f009daf09992d2342657f9bd7b44d877cd00e1' (2022-09-25)
  → 'github:Mic92/sops-nix/912f9ff41fd9353dec1f783170793699789fe9aa' (2022-09-26)
• Updated input 'sops-nix/nixpkgs':
    'github:NixOS/nixpkgs/72bdd03f0d5696412b25a93218acaad530570d30' (2022-09-24)
  → 'github:NixOS/nixpkgs/ff9793cfd1a25145a7e591af604675b3d6f68987' (2022-09-26)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/aee4db5b9eaccd3fb7f16c742685fef9dc355077' (2022-09-24)
  → 'github:NixOS/nixpkgs/00f877f4927b6f7d7b75731b5a1e2ae7324eaf14' (2022-09-26)
```
2022-09-26 15:41:14 -07:00
2703bda28c feeds: add some more podcasts 2022-09-26 03:46:45 -07:00
68982b7f2a env/home: associate audio/video mime types with good default apps 2022-09-26 02:21:09 -07:00
5ed7888710 moby: switch to manjaro alsa UCM files
the "internal speaker" is broken -- not sure if this minor change will
fix that or not
2022-09-26 01:42:31 -07:00
eb02b8aa23 Revert "moby: roll-back kernel from 6.0.0-rc4 to 5.19.8"
This reverts commit e381b1d2dd.
2022-09-26 01:27:09 -07:00
29d3a6f9b2 moby: ship alsa UCM2 files for pinephone
hopefully this will fix audio problems?
2022-09-26 00:46:38 -07:00
e381b1d2dd moby: roll-back kernel from 6.0.0-rc4 to 5.19.8
the 6.0.0 kernel wouldn't always boot to GUI, and power button would
instantly power-off the device instead of activating the display.

hopefully 5.19 works better.
2022-09-25 22:41:56 -07:00
592b96e436 moby: bump kernel to 6.0.0-rc4
i hope this will improve audio issues
2022-09-25 20:20:31 -07:00
beda2b5238 net: share connections between all devices by not specifying the adapter name 2022-09-25 18:03:23 -07:00
f40dfdee0c RSS: add Dilbert 2022-09-25 16:38:38 -07:00
7a153903b1 update nixpkgs 2022-09-22 -> 2022-09-24
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/ae1dc133ea5f1538d035af41e5ddbc2ebcb67b90' (2022-09-22)
  → 'github:NixOS/nixpkgs/fde244a8c7655bc28616864e2290ad9c95409c2c' (2022-09-24)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/bae718a9d1e31ec478ddfcb75149f66e9625a825' (2022-09-18)
  → 'github:Mic92/sops-nix/17f009daf09992d2342657f9bd7b44d877cd00e1' (2022-09-25)
• Updated input 'sops-nix/nixpkgs':
    'github:NixOS/nixpkgs/0cfb3c002b61807ca0bab3efe514476bdf2e5478' (2022-09-17)
  → 'github:NixOS/nixpkgs/72bdd03f0d5696412b25a93218acaad530570d30' (2022-09-24)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/17989edb05615c4f61803b9c427d80b84c289c6b' (2022-09-17)
  → 'github:NixOS/nixpkgs/aee4db5b9eaccd3fb7f16c742685fef9dc355077' (2022-09-24)
```
2022-09-25 04:13:42 -07:00
c5d2549ee4 servo: fix Pleroma
it would be nice if i could switch back to upstream Pleroma at some
point. that would require migrating the database.

alternatively, switching to a patch on top of upstream Pleroma might be
easier.
2022-09-24 15:09:11 -07:00
d8b2b73463 pleroma: enable debugging 2022-09-24 14:06:47 -07:00
0c304e18eb flake update: nixpkgs 2022-09-18 -> 2022-09-22
in particular, hoping this will fix pleroma start sequence

```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/f677051b8dc0b5e2a9348941c99eea8c4b0ff28f' (2022-09-18)
  → 'github:NixOS/nixpkgs/ae1dc133ea5f1538d035af41e5ddbc2ebcb67b90' (2022-09-22)
```
2022-09-23 23:45:36 -07:00
38f55661c2 sane: tame matrix and transmission log levels 2022-09-23 23:03:31 -07:00
863f6a8c7b gitea: decrease log level from info to warn 2022-09-23 15:48:29 -07:00
b3a4a95e28 servo: disable jellyfin to stop syslog spam
i also don't use it much anymore. mostly navidrome.
may be useful in future when i want DLNA support.
2022-09-23 15:29:33 -07:00
554bb5a84f gitea: port config to nixos-unstable 2022-09-23 06:23:35 -07:00
12308f00f1 servo: fix navidrome build 2022-09-23 05:33:17 -07:00
34b013f82a gpodder: auto-import feeds on launch 2022-09-23 04:14:46 -07:00
2456317004 RSS: add Sam Kriss 2022-09-23 02:25:26 -07:00
2316b4a3ce NetworkManager: store (and deploy) wifi connections to all devices
i haven't saved the hard-wired connection on desko/servo, but i think
that's alright: they should be DHCP'd.
2022-09-22 18:28:03 -07:00
5558da55d5 readme: document how to build custom sane packages 2022-09-22 17:44:57 -07:00
09e8510d0e fluffychat: fix .desktop file to reference the wrapped version 2022-09-22 17:44:42 -07:00
4b3b71bb84 fluffychat: mention TODO for desktop files 2022-09-22 05:25:18 -07:00
bee4fb4ea3 env: persist fluffychat directory 2022-09-22 05:24:06 -07:00
20872d3733 fluffychat: use software rendering to fix for moby 2022-09-22 05:06:32 -07:00
7be0a33522 Merge branch 'wip.fluffychat.2022.09.20' into nixos-unstable 2022-09-21 16:52:21 -07:00
5f8268cecd fluffychat: fix arm hashes so it builds 2022-09-21 16:48:45 -07:00
00c22c1ca7 fix flutter build (x86-64; arm is untested) 2022-09-21 04:29:44 -07:00
8e63857794 home-packages: ship xdg-open on GUI systems
this is needed by gpodder, but useful generally
2022-09-21 04:22:17 -07:00
cdbfa2d177 moby: limit boot entries to 10 2022-09-21 03:25:23 -07:00
e66692eecd enable fluffychat -- though reproducibility may suffer
i've applied this patch, but modified the sha:
- <https://github.com/NixOS/nixpkgs/pull/186839>
2022-09-21 02:58:35 -07:00
18ca147b67 pkgs: add gpodder podcast player
the maintainer says it's CLI configurable, so long-term i should be able
to find a way to configure it with nix.
2022-09-21 01:59:40 -07:00
8f231cde33 update nixpkgs: 2022-09-16 -> 2022-09-18 (and sops)
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/da6a05816e7fa5226c3f61e285ef8d9dfc868f3c' (2022-09-16)
  → 'github:NixOS/nixpkgs/f677051b8dc0b5e2a9348941c99eea8c4b0ff28f' (2022-09-18)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/20929e1c5722a6db2f2dbe4cd36d4af0de0a9df0' (2022-09-11)
  → 'github:Mic92/sops-nix/bae718a9d1e31ec478ddfcb75149f66e9625a825' (2022-09-18)
• Updated input 'sops-nix/nixpkgs':
    'github:NixOS/nixpkgs/a25f0b9bbdfedee45305da5d1e1410c5bcbd48f6' (2022-09-10)
  → 'github:NixOS/nixpkgs/0cfb3c002b61807ca0bab3efe514476bdf2e5478' (2022-09-17)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/e6f053b6079c16e7df97531e3e0524ace1304d4d' (2022-09-11)
  → 'github:NixOS/nixpkgs/17989edb05615c4f61803b9c427d80b84c289c6b' (2022-09-17)
```
2022-09-20 22:31:49 -07:00
f9c8563506 switch to nixos-unstable. some notes:
- fluffychat doesn't build, so disabled (that's a known issue with the
  active flutter work).
- everything else builds, lappy boots OOTB fine.
        - brower works
        - vim works
        - Element starts
        - Sublime Music works
        - Discord works (verrry slow to load -- maybe just a first update thing)
2022-09-20 22:31:47 -07:00
3669a05db5 env: add krita to desktops 2022-09-20 21:02:41 -07:00
618b7b934e home: allow old Discord clients to start 2022-09-20 04:39:28 -07:00
fe2c0b47bc nix flake update (nixpkgs: 2022-09-17 -> 2022-09-19, plus sops)
but Discord is still out of date :'(

```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/f21492b413295ab60f538d5e1812ab908e3e3292' (2022-09-17)
  → 'github:NixOS/nixpkgs/20dc478985d6545df53f0153f4af125eb014083d' (2022-09-19)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/20929e1c5722a6db2f2dbe4cd36d4af0de0a9df0' (2022-09-11)
  → 'github:Mic92/sops-nix/bae718a9d1e31ec478ddfcb75149f66e9625a825' (2022-09-18)
• Updated input 'sops-nix/nixpkgs':
    'github:NixOS/nixpkgs/a25f0b9bbdfedee45305da5d1e1410c5bcbd48f6' (2022-09-10)
  → 'github:NixOS/nixpkgs/0cfb3c002b61807ca0bab3efe514476bdf2e5478' (2022-09-17)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/e6f053b6079c16e7df97531e3e0524ace1304d4d' (2022-09-11)
  → 'github:NixOS/nixpkgs/17989edb05615c4f61803b9c427d80b84c289c6b' (2022-09-17)
```
2022-09-20 04:22:42 -07:00
3b02fb5f48 RSS: add 60 minutes 2022-09-20 01:16:28 -07:00
355a982cf0 rmlint: don't output a json file 2022-09-18 02:34:32 -07:00
8ff7e22ac8 lappy: enable the LAN nix cache
might want to be smarter about this, but for now it lets us reuse large
packages built on desko instead of rebuilding them locally.
2022-09-18 02:07:34 -07:00
cb0c122080 rmlint: run as sudo 2022-09-18 02:04:50 -07:00
d84600cfcf update nixpkgs 2022-09-18 00:49:57 -07:00
dc44d8098e fix flutter build for aarch64 2022-09-16 04:49:15 -07:00
58c6c1dd7d try to get fluffychat building against nixpkgs master
it fails
```
$ nix log /nix/store/2hzd4bjscfxarzdq73nhiqxmqimbwkzd-fluffychat-1.2.0.drv
...
../tmp.lqD0WQYq9a/.pub-cache/hosted/pub.dartlang.org/flutter_typeahead-3.2.4/lib/src/flutter_typeahead.dart:936:9: Error: No named parameter with the name 'maxLengthEnforced'.
```
2022-09-16 01:58:56 -07:00
933996d34e ship fluffychat (Matrix client)
this works on lappy and is fairly responsive.
want to try it on moby.
2022-09-15 20:29:27 -07:00
2a1932d602 replace the local makemkv patch with upstream instead 2022-09-15 20:24:07 -07:00
a6fd6a0a6d firefox: uBlock: enable the GDPR cookie prompt blocker 2022-09-15 18:49:16 -07:00
b42b6e7ce2 browser: remove "i don't care about cookies" extension
the maintainer announced that it's aqcuired by Avast.
clear conflict of interest; i don't trust Avast.
2022-09-15 16:12:57 -07:00
e9da458179 nix-serve: open firewall port (for desko) 2022-09-14 18:19:56 -07:00
ee3793ad46 nixcache: use desko as a substituter 2022-09-14 14:45:33 -07:00
b8ab7c1fa9 desko: enable nix-serve 2022-09-14 14:45:07 -07:00
cdbde672d8 lift nix-serve out of servo
i'm going to enable it on desktop
2022-09-14 14:32:31 -07:00
08bd619ef9 update nixpkgs 2022-09-11 -> 2022-09-13
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/dd1f4d982445a7d1b1869baa42f8f0f9bc606714' (2022-09-11)
  → 'github:NixOS/nixpkgs/d86a4619b7e80bddb6c01bc01a954f368c56d1df' (2022-09-13)
```
2022-09-14 00:43:51 -07:00
c91948c565 nix flake update: nixpkgs 2022-09-09 -> 2022-09-11
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/45b56b5321aed52d4464dc9af94dc1b20d477ac5' (2022-09-09)
  → 'github:NixOS/nixpkgs/dd1f4d982445a7d1b1869baa42f8f0f9bc606714' (2022-09-11)
```
2022-09-12 19:35:49 -07:00
f3ba1d488d nix flake update: nixpkgs 2022-09-02 -> 2022-09-09 (and sops update)
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/67e45078141102f45eff1589a831aeaa3182b41e' (2022-09-02)
  → 'github:NixOS/nixpkgs/45b56b5321aed52d4464dc9af94dc1b20d477ac5' (2022-09-09)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/044ccfe24b349859cd9efc943e4465cc993ac84e' (2022-09-05)
  → 'github:Mic92/sops-nix/20929e1c5722a6db2f2dbe4cd36d4af0de0a9df0' (2022-09-11)
• Updated input 'sops-nix/nixpkgs':
    'github:NixOS/nixpkgs/21de2b973f9fee595a7a1ac4693efff791245c34' (2022-09-02)
  → 'github:NixOS/nixpkgs/a25f0b9bbdfedee45305da5d1e1410c5bcbd48f6' (2022-09-10)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/013e8d86d9a3f33074c903c8ffcab0d34087b1ed' (2022-09-03)
  → 'github:NixOS/nixpkgs/e6f053b6079c16e7df97531e3e0524ace1304d4d' (2022-09-11)
```
2022-09-11 00:22:56 -07:00
11a2dbd684 sway: add gnome-control-center 2022-09-10 03:49:36 -07:00
2fb4bae804 servo: tune ipfs resource use 2022-09-09 17:51:26 -07:00
61ce0e62e9 sway: configure displays for lappy, too. 2022-09-08 14:57:44 -07:00
315d9b8703 sway: enforce screen positioning 2022-09-06 23:16:42 -07:00
c5a69a401f sway: hide window borders if only window on workspace 2022-09-06 23:07:41 -07:00
b8e42a0ada programs: add speedtest-cli 2022-09-06 19:49:49 -07:00
1fa7724b35 sane-scripts: fix missing file input 2022-09-06 19:46:07 -07:00
10c6801ccd sane-which: only cat text-based files 2022-09-06 18:08:44 -07:00
8d051d319f flake: update (nixpkgs: 2022-08-25 -> 2022-09-02)
```
• Updated input 'impermanence':
    'github:nix-community/impermanence/e7c6fbbe9076109263175ef992ca6edc1050973c' (2022-08-22)
  → 'github:nix-community/impermanence/def994adbdfc28974e87b0e4c949e776207d5557' (2022-08-31)
• Updated input 'mobile-nixos':
    'github:nixos/mobile-nixos/87e579471c42def38f719028ad6c5d746f26027b' (2022-07-31)
  → 'github:nixos/mobile-nixos/09e388c42298fa777caa7738cd8d8d2b6d1ac8db' (2022-08-28)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/058de3818577db19d1965c21e2479916a3eaaf95' (2022-08-25)
  → 'github:NixOS/nixpkgs/67e45078141102f45eff1589a831aeaa3182b41e' (2022-09-02)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/6068774a8e85fea4b0177efcc90afb3c3b74430b' (2022-08-21)
  → 'github:Mic92/sops-nix/044ccfe24b349859cd9efc943e4465cc993ac84e' (2022-09-05)
• Updated input 'sops-nix/nixpkgs':
    'github:NixOS/nixpkgs/0cc6444e74cd21e8da8d81ef4cd778492e10f843' (2022-08-20)
  → 'github:NixOS/nixpkgs/21de2b973f9fee595a7a1ac4693efff791245c34' (2022-09-02)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/9a91318fffec81ad009b73fd3b640d2541d87909' (2022-08-20)
  → 'github:NixOS/nixpkgs/013e8d86d9a3f33074c903c8ffcab0d34087b1ed' (2022-09-03)
```
2022-09-06 15:48:18 -07:00
c0a41def22 impermanence: don't persist authorized_keys.d 2022-08-31 17:25:57 -07:00
f0334db736 secrets: update for moby keys 2022-08-31 17:25:21 -07:00
cd89ea884b secrets: update moby keys 2022-08-31 17:01:41 -07:00
13b937fbb7 fix up /mnt/desko-root to be usable as a remote /nix store 2022-08-30 22:25:22 -07:00
877870a522 net: hardcode the host/IPs for desko/servo/lappy 2022-08-30 21:56:04 -07:00
956545a795 move universal/env/users.nix -> universal/users.nix 2022-08-30 21:48:19 -07:00
cb98ac2a91 fs: add desko-root 2022-08-30 21:14:12 -07:00
85add7c531 add a script to mount servo root 2022-08-30 19:55:15 -07:00
df379a2a38 packages: only deploy makemkv to x86 machines 2022-08-26 22:20:21 -07:00
d49ac8c175 update nixpkgs 2022-08-12 -> 2022-08-25; impermanence, sops
```
• Updated input 'impermanence':
    'github:nix-community/impermanence/2f39baeb7d039fda5fc8225111bb79474138e6f4' (2022-03-01)
  → 'github:nix-community/impermanence/e7c6fbbe9076109263175ef992ca6edc1050973c' (2022-08-22)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5c211b47aeadcc178c5320afd4e74c7eed5c389f' (2022-08-12)
  → 'github:NixOS/nixpkgs/058de3818577db19d1965c21e2479916a3eaaf95' (2022-08-25)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/34ee98b8c2ca153a23a63c1841a0a067313856d5' (2022-08-02)
  → 'github:Mic92/sops-nix/6068774a8e85fea4b0177efcc90afb3c3b74430b' (2022-08-21)
• Updated input 'sops-nix/nixpkgs':
    'github:NixOS/nixpkgs/a3fddd46a7f3418d7e3940ded94701aba569161d' (2022-07-30)
  → 'github:NixOS/nixpkgs/0cc6444e74cd21e8da8d81ef4cd778492e10f843' (2022-08-20)
• Updated input 'sops-nix/nixpkgs-22_05':
    'github:NixOS/nixpkgs/a26a6f4529878fbfe5f1f287dcdff4a287c58def' (2022-07-31)
  → 'github:NixOS/nixpkgs/9a91318fffec81ad009b73fd3b640d2541d87909' (2022-08-20)
```
2022-08-26 18:20:14 -07:00
5a4dd3b38d nixpatches: remove custom zecwallet-lite patch and point upstream instead 2022-08-25 19:12:31 -07:00
ed98b1702a packages: add MakeMKV (along with an update to 1.17.1)
MakeMKV doesn't allow old versions to run unregistered.

PR which updates MakeMKV in nixpkgs:
<https://github.com/NixOS/nixpkgs/pull/188342>
2022-08-25 19:09:06 -07:00
5b5103f660 packages: add gnome-system-monitor to gui systems 2022-08-25 16:03:07 -07:00
91d37f2532 vim: show tabs and expand them to spaces 2022-08-25 15:57:48 -07:00
66d79329d9 vim: set conceallevel=2 by default
and show pretty fractions in tex-conceal-vim
2022-08-25 00:59:13 -07:00
c6485a5e42 vim: highlight markdown-style code fences
e.g.
```tex
did you know $\frac29 == \frac4{18}$ ?
```
2022-08-25 00:17:33 -07:00
e54af3f571 RSS: add miniature-calendar.com 2022-08-24 19:46:23 -07:00
c39170be23 formatting nits 2022-08-24 19:46:10 -07:00
a532825761 add nabla vim plugin, but deactivate it. 2022-08-24 19:44:32 -07:00
4faa6d5d5f home: switch from youtube-dl -> yt-dlp
it's more actively maintained, or something.
2022-08-22 02:39:56 -07:00
fe09b08be2 gnome-feeds: reduce refresh threads 6 -> 3
this should make it less demanding on the pinephone
2022-08-20 12:49:35 -07:00
9e53053526 RSS: add Ian Henry 2022-08-20 12:49:09 -07:00
56036b13c3 sane-scripts: sane-dev-cargo-loop: add tput reset between runs 2022-08-19 02:26:59 -07:00
9ed4a13a6f sane-scripts: move src/bin/ -> src/ 2022-08-19 02:11:46 -07:00
1446f5e8ca new script: sane-dev-cargo-loop for running a build command on fs change 2022-08-19 02:01:27 -07:00
118007075f sane-scripts: package using resholve
this makes it easier to propagate paths in and such.
it does more sanity checking than e.g. `wrapProgram`,
plus it doesn't do any indirection -- rather, substitution.
2022-08-19 01:51:04 -07:00
25c75b10bf new script: sane-which: traces PATH lookups 2022-08-19 00:13:16 -07:00
56637bb649 RSS: add Daniel Janus 2022-08-18 19:47:58 -07:00
62d6c4d688 packages: add soundconverter 2022-08-18 04:00:12 -07:00
b05c256809 apps: add foliate, an epub viewer 2022-08-15 02:21:31 -07:00
a30d6fd51f servo: bump /tmp space from 16 GB -> 40 GB
this is necessary because kernel builds (for moby) are *huge*
2022-08-13 17:57:46 -07:00
da3070479f update nixpkgs: 2022-08-11 -> 2022-08-12
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/45c9736ed69800a6ff2164fb4538c9e40dad25d6' (2022-08-11)
  → 'github:NixOS/nixpkgs/5c211b47aeadcc178c5320afd4e74c7eed5c389f' (2022-08-12)
```
2022-08-13 14:27:21 -07:00
287547d46c gui packages: add pavucontrol 2022-08-11 17:14:39 -07:00
2f0bbef76b RSS: add SMBC, XKCD 2022-08-11 17:09:51 -07:00
2ba1678cd8 remove nixpkgs input from modules/ or machines/ 2022-08-11 17:05:10 -07:00
c162225789 moby: rework the cross-compiling situation
we build the `pkgs.cross` kernel, which can be emulated or
cross-compiled based on the specific target (`moby` v.s. `moby-cross`).
2022-08-11 17:02:41 -07:00
f052e2226d nit: home-manager: fix indentation 2022-08-11 15:47:40 -07:00
48774c8940 RSS: add IEEE spectrum 2022-08-11 15:45:35 -07:00
7a7e4c9df7 update flake: nixpkgs 2022-08-10 -> 2022-08-11
hoping there's a Discord update in here :-)

```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/e4c9d950a3c54a0760b127d406f6528eb625eed8' (2022-08-10)
  → 'github:NixOS/nixpkgs/45c9736ed69800a6ff2164fb4538c9e40dad25d6' (2022-08-11)
```
2022-08-11 15:36:40 -07:00
de2bb05a04 update flake deps: nixpkgs 2022-08-07 -> 2022-08-10
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/92fe622fdfe477a85662bb77678e39fa70373f13' (2022-08-07)
  → 'github:NixOS/nixpkgs/e4c9d950a3c54a0760b127d406f6528eb625eed8' (2022-08-10)
```
2022-08-10 16:48:29 -07:00
65a4aa4135 pkgs: add emote emoji picker 2022-08-10 16:47:39 -07:00
0e611ba3d4 sublime: disable song notifications 2022-08-09 23:12:51 -07:00
c5b132b8c8 persist sublime music config
we encode the whole config as a secret. that's because it contains the
auth info. not *that* much else is of interest in it. it doesn't appear
to be stateful, thankfully: the state is in
~/.local/share/sublime-music.
2022-08-09 23:10:21 -07:00
8d2c8d44f3 disable kaiteki: its packaging is non-deterministic and i can't get a stable hash for which it builds 2022-08-09 19:49:09 -07:00
7b311eaf2d flake update: nixpkgs 2022-08-03 -> 2022-08-07
```
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/478f3cbc8448b5852539d785fbfe9a53304133be' (2022-08-03)
  → 'github:NixOS/nixpkgs/92fe622fdfe477a85662bb77678e39fa70373f13' (2022-08-07)
```
2022-08-09 18:03:48 -07:00
eecf51d344 moby: use megous linux kernel 2022-08-09 18:01:48 -07:00
eaef2f2325 desko: bump /tmp size to 64G
we need just shy of 30G to build a kernel: better to have too much /tmp
space than not enough
2022-08-09 17:58:35 -07:00
fc629082e6 moby: lift the kernel definition out into its own file 2022-08-09 15:26:41 -07:00
bbb384c70a pkg megi's kernel
this won't likely build cleanly: it uses floats in places, which isn't
supported in kernel build well.
2022-08-09 14:39:42 -07:00
e2f6977244 moby: package/ship the rtl8723cs bluetooth driver
with this, bluetooth works immediately after boot (well, maybe only
after the second boot after a deploy... logs are weird when NTP
activates).
2022-08-08 22:13:17 -07:00
05ab747650 moby: fix kernel config (remove CONFIG_ prefixes) 2022-08-08 20:36:39 -07:00
913c9e5fdf moby: cross-compile the kernel 2022-08-08 20:36:35 -07:00
f0b772d688 moby: research more RTL BT kernel config (from manjaro) 2022-08-08 16:43:27 -07:00
f328043966 moby: research some more RTL BT kernel configs 2022-08-08 16:37:39 -07:00
6758440ce3 moby: add the RTL8723CS wifi driver
it works! bluetooth still needs debugging.
2022-08-08 16:03:58 -07:00
9e4bfc2fce moby: switch from linux latest to linux 5.18
doesn't fix my WiFi issue, but will be easier to build on
2022-08-08 16:03:58 -07:00
d3193bc051 moby: bump to latest kernel (5.19) 2022-08-08 16:03:58 -07:00
c0b6d46575 moby: try building with mainline linux 2022-08-08 16:03:58 -07:00
808153f939 new package: lshw (list hardware) 2022-08-08 15:45:46 -07:00
78dfb03c2b x86: remove the useless kernelModules = []
i believe this is a relic from the original `nixos-generate-config` run,
which doesn't understand that this statement is useless
2022-08-06 19:37:52 -07:00
b1ae5b0f9c RSS: add blog: blog.dshr.org 2022-08-05 16:45:30 -07:00
7a6bb04e86 update nixpkgs: 2022-08-01 -> 2022-08-03 2022-08-05 15:49:35 -07:00
3565e96dc5 moby/phosh: try to enable bluetooth (doesn't seem to find adapter) 2022-08-05 15:47:53 -07:00
54754de6fa moby: enable mobile-nixos' firmware (notably: bluetooth) 2022-08-05 14:42:08 -07:00
281be29b90 home: move podcasts from gfeeds to vlc 2022-08-05 00:46:17 -07:00
465478271a new package: sublime-music music player 2022-08-04 23:49:53 -07:00
7003f7407e servo: add navidrome music streaming service 2022-08-04 23:33:34 -07:00
890e1b17e2 RSS: add some podcasts 2022-08-04 19:16:15 -07:00
34af63fab0 RSS: tag with content type (tech, rat, pol, uncat) 2022-08-04 16:43:36 -07:00
8e8a326dce RSS: add frequency tags to each feed 2022-08-04 16:35:04 -07:00
da3c25eff6 RSS: add more feeds 2022-08-04 16:17:51 -07:00
43782ae734 gnome-feeds: tune config 2022-08-04 14:20:21 -07:00
2204a54456 add a base config for gnome feeds
just copied what it stored in .config, and will tune this later
2022-08-04 14:16:37 -07:00
e80e37ae29 moby: persist the whole .librewolf dir 2022-08-04 14:05:24 -07:00
505a5f8b47 packages: add ffmpeg 2022-08-04 03:52:08 -07:00
216282a345 kitty: enable for even non-gui platforms
i don't get it entirely, but otherwise things start breaking
2022-08-04 03:33:42 -07:00
6f88302430 packages: lossless-cut: only deploy to x86 2022-08-03 18:39:03 -07:00
228f8c0a68 packages: add losslesscut video editor 2022-08-03 16:35:25 -07:00
a3111d250f moby: ship without mobile-nixos' stage-1
the stage-1 fails to handle impermanence
2022-08-03 16:23:36 -07:00
9976c82946 impermanence: don't persist _all_ of /etc/ssh -- just the important parts 2022-08-03 14:54:36 -07:00
42951a1382 home-packages: provide a way for the user to disable common gui packages -- without disabling the entire shell 2022-08-03 02:07:34 -07:00
e5ff11d14b packages: minor refactoring 2022-08-03 02:03:17 -07:00
95e7d86cc7 packages: address a TODO by moving extra stuff into home-manager 2022-08-03 01:51:15 -07:00
21c9ce21cc servo: packages: clarify why we include matrix-synapse explicitly 2022-08-03 01:42:56 -07:00
65bcaa939e make some shared boot/hardware settings universal 2022-08-03 01:39:19 -07:00
38cd3bdb96 home-manager: only enable kitty on GUI systems 2022-08-03 01:23:23 -07:00
8059477edd dhcpcd: automatically enable the user, if detected.
not sure this is the *best* place for it, but then, what is?
2022-08-03 00:41:59 -07:00
46a0e949f9 update nixpkgs 2022-07-31 -> 2022-08-01 2022-08-02 23:34:12 -07:00
f86c6390a5 image building instructions: no need to manually create /persist dirs anymore 2022-08-02 17:10:32 -07:00
b60a7ed7d5 image: fix issue that persist/ paths aren't created 2022-08-02 17:08:26 -07:00
d29e69e18a packages: add nmon
it's like htop, but does better for disk and network
2022-08-02 16:04:03 -07:00
042bd9340b image building: fix comment for relPath 2022-08-02 16:03:32 -07:00
c6fbbbab66 moby: fix missing / as tmpfs 2022-08-02 16:02:14 -07:00
b1205e964b moby: migrate the user definitions to phosh.nix 2022-08-02 16:00:37 -07:00
7d39a761cf flake: fix docs about root:nixbld ownership 2022-08-02 15:59:28 -07:00
8a0da17f05 duplicity: add TODO about impermanence support 2022-08-02 15:58:56 -07:00
de8f658dcd new package: unar
use as `unar path/to/archive`. can do gzip, cpio, etc.
2022-08-02 14:01:16 -07:00
5c2f33a550 add missing 'toString' in image builder 2022-08-01 23:11:16 -07:00
0ec48a9145 kitty: explore some color themes 2022-08-01 17:12:36 -07:00
408e817c39 rename modules/{nix -> nixcache}.nix 2022-08-01 15:10:40 -07:00
ba6d0b7e3d machines: moby: enable impermanence (experimental)
last time i tried to rebuild nixos on the pinephone it didn't switch,
IIRC. i don't know why, but i expect it'll be easier to manage my
machines if i keep more of the setup consistent across them.

likely i'll tune this to be more leniant on moby (e.g. persist all of
.librewolf).
2022-08-01 14:38:40 -07:00
4d7d96f4a4 machines: moby: remove w3m: it's already included in the common config 2022-08-01 14:38:10 -07:00
1a9dfe22ba image builder: integrate impermanence so that we create such things as /var/log
untested
2022-08-01 14:37:19 -07:00
8ae0d77938 image: document the config options 2022-08-01 14:01:46 -07:00
b53d2f945d impermanence: remove /srv
this is for "service directories": public, protocol-based fs access.
e.g. /srv/ftp might be a share which is exposed over FTP.
/srv/www might be a share which is exposed over www (or webdav).
2022-08-01 13:36:42 -07:00
f67ca0bd24 nixpatches: remove dead jackett, Discord patches 2022-08-01 13:30:47 -07:00
d196ce29ac pkgs: move logseq to x86-only package section 2022-08-01 13:25:57 -07:00
f03238daac update mobile-nixos: 2022-06-27 -> 2022-07-31; nixpkgs 2022-07-30 -> 2022-07-31 2022-08-01 13:19:12 -07:00
f9ab3b7cf1 sway: wifi: show signal strength
i'd prefer to show the essid instead of the interface name,
but there's no way to truncate that to just N characters,
so we overflow if we do that.
2022-08-01 00:50:57 -07:00
40bc4098ad lappy: disable guest account 2022-08-01 00:25:08 -07:00
451816f623 rename config.{colinsane -> sane} 2022-08-01 00:23:49 -07:00
9dea707eea kitty: ctrl+n opens a new OS terminal in the CWD 2022-07-31 23:42:13 -07:00
0875d5cb52 TODO: fix formatting 2022-07-31 18:11:02 -07:00
0de0749fb4 nixpatches: link to Discord opensar patches
maybe i'll remove this later, but i want them at least in the git
history :-)
2022-07-31 18:09:58 -07:00
ac772e72b8 document how to make Electron apps use wayland natively 2022-07-31 18:09:28 -07:00
d44db610cb switch vim => nvim
also install some plugins, like vim-surround and fzf
2022-07-31 18:09:01 -07:00
79b3bfc9e7 discord: fix urls to open in correct web-browser 2022-07-31 16:14:56 -07:00
6608e2bf6d vim: store swap files under ~/.cache/vim-swap
untested
2022-07-31 12:00:06 -07:00
19e0bd4780 update: nixpkgs: 2022-07-28 -> 2022-07-30
sops: 2022-07-24 -> 2022-07-31
2022-07-31 11:55:56 -07:00
18bb89ded0 lappy: enable guest account 2022-07-31 11:35:15 -07:00
4aa3e6cf24 update: nixpkgs: 2022-07-28 -> 2022-07-28 (same date version) 2022-07-30 14:22:38 -07:00
ee621cd132 pkgs: add visidata 2022-07-29 23:51:11 -07:00
641b32b8d0 fix jackett build (by disabling the check phase. manually verified: still works) 2022-07-29 20:08:35 -07:00
d69db1df37 update: nixpkgs: 2022-07-27 -> 2022-07-28 2022-07-29 13:57:43 -07:00
6d44c93b5a update: nixpkgs: 2022-07-26 -> 2022-07-27 2022-07-28 12:40:48 -07:00
32be025ec6 update: nixpkgs: 2022-07-25 -> 2022-07-26 2022-07-27 12:35:09 -07:00
ce5bfc68f5 update nixpkgs: 2022-07-24 -> 2022-07-25 2022-07-26 13:08:50 -07:00
b1773a9b54 update nixpkgs: 2022-07-22 -> 2022-07-24 2022-07-25 12:25:53 -07:00
3fe67e744f sway: fix waybar styling
apparently setting any `style` attribute clears all the defaults,
so if i want to set the font via the style then i need to include
all the defaults as well.
2022-07-25 00:00:11 -07:00
ea61d22764 Sway: add additional shortcuts for managing volume 2022-07-24 18:09:15 -07:00
d92994bcd2 sway: fixed-width network area 2022-07-24 13:50:06 -07:00
a5d14a643e obsidian: persist the .config/obsidian directory 2022-07-24 13:49:54 -07:00
4c1bc06441 update sops-nix 2022-07-24 13:18:34 -07:00
730b4f9d9b update nixpkgs: 2022-07-21 -> 2022-07-22 2022-07-23 02:20:36 -07:00
59f8191830 add nb personal knowledge manager, and its optional dep: w3m 2022-07-23 02:00:38 -07:00
af4e70c4c5 update nixpkgs: 2022-07-21 -> 2022-07-21
yes, two releases on the same day :o
2022-07-22 16:54:38 -07:00
5595da2c56 packages: add logseq (markdown/personal knowledge manager) 2022-07-22 14:12:27 -07:00
e52e2c8faa update nixpkgs 2022-07-16 -> 2022-07-21 2022-07-22 03:00:26 -07:00
7563090dd5 update nixpkgs 2022-07-14 -> 2022-07-16 2022-07-19 02:20:42 -07:00
bd44bd4434 home: packages: add Lollypop music player 2022-07-19 02:18:50 -07:00
430e594285 update nixpkgs 2022-07-13 -> 2022-07-14 2022-07-17 00:11:24 -07:00
8f88085eb5 desko: add steam 2022-07-16 03:10:57 -07:00
7375a55d4c home: add cheese webcam viewer 2022-07-15 23:15:58 -07:00
878f9fbe49 ssh: remove dead keys; update moby key 2022-07-15 14:23:33 -07:00
5ec0ee4524 add TODO: remove some dangling hardcoded uid numbers 2022-07-15 01:01:41 -07:00
2f3eda1800 uids/gids: resolve conflicts (prefer servo rules) 2022-07-15 00:15:37 -07:00
8c9c9ca6c9 migrate the rest of the uids/gids to 'allocations' system, but don't fix conflicts 2022-07-15 00:12:13 -07:00
42117f375b introduce an 'allocations' systems for things like uids/gids 2022-07-14 23:58:27 -07:00
ede10dd1c8 impermanence: don't persist /var/lib/nixos 2022-07-14 22:06:19 -07:00
a380e300bc desko: eliminate the non-determinism in /var/lib/nixos/auto-subuid-map 2022-07-14 22:00:53 -07:00
3773aebac0 desko: freeze uids/gids
this will allow (eventually) removing the /var/lib/nixos persisted
state.
2022-07-14 21:53:28 -07:00
8a61be18e1 update nixpkgs 2022-07-10 -> 2022-07-13 2022-07-14 19:15:43 -07:00
c07c106a68 machines: rescue: remove incorrect comment about tmpfs 2022-07-14 16:25:13 -07:00
1a159c8340 Merge branch 'master' of git.uninsane.org:colin/nix-files 2022-07-14 16:24:02 -07:00
6faed74958 home: packages: add gnome-disk-utility 2022-07-14 16:22:21 -07:00
d4d345ca12 machines: add a rescue machine for live-booting 2022-07-14 16:21:59 -07:00
a5b3677adc deps: update nixpkgs 2022-07-08 -> 2022-07-10 2022-07-12 15:08:34 -07:00
97374fdcf4 pks: add gthumb image viewer 2022-07-12 02:51:15 -07:00
1062a610c9 image building notes: mkdir /var/log, /var/lib 2022-07-12 02:51:15 -07:00
8f37edb402 transmission: specify download-dir and incomplete-dir instead of bind-mounting them
this appears to fix the permissions issue
2022-07-11 01:54:02 -07:00
99d55167f6 impermanence: only persist service directories if those services are enabled. 2022-07-10 17:58:16 -07:00
e2d7d63ebe impermanence: move application-level impermanence to their package definition 2022-07-10 17:43:57 -07:00
d0b903d50e home-packages: switch to a module.
this will allow for better configuration of packages in future.
2022-07-10 17:14:20 -07:00
9d71041530 impermanence: move the base persisted home-dirs into home-manager, alongside XDG dirs 2022-07-10 15:25:04 -07:00
31e404b04f impermanence: abstract the creation of service directories
better would be to not directly call out user/group, but force them to
be looked up.
2022-07-10 15:15:34 -07:00
01a47932f7 impermanence: abstract the creation of root-owned system directories 2022-07-10 15:07:56 -07:00
5c6f616c97 impermanence: abstract the creation of ~/ sub-dirs 2022-07-10 14:42:33 -07:00
89447d9fe9 update sops-nix: 2022-07-06 -> 2022-07-10 2022-07-10 14:19:50 -07:00
80ac5496be pkgs: ship zecwallet-lite as a patch instead of a custom pkg
this allows me to more easily upstream it.
2022-07-10 02:57:40 -07:00
ce46b3490a home packages: remove zola/gnumake; the repo for uninsane.org configures these now 2022-07-09 14:27:05 -07:00
678958f5cf update: nixpkgs 2022-07-06 -> 2022-07-08 2022-07-09 01:42:25 -07:00
292aa042f2 web browser: remove all bookmarks (migrated elsewhere)
see e.g. https://uninsane.org/links
2022-07-09 01:30:15 -07:00
b2bd8d5f89 persist: zcash directory 2022-07-09 01:00:17 -07:00
06989c613f pkgs: add zecwallet-lite to the home env 2022-07-09 00:55:36 -07:00
c6fbe3574d vpn: rename ovpnd -> ovpnd-us
this is needed to disambiguate it against the other regions.
2022-07-09 00:52:05 -07:00
f790147fb0 add ukraine VPN 2022-07-09 00:48:09 -07:00
dca68a019b pkgs: tor-browser: only enable on x86 2022-07-09 00:00:46 -07:00
fffeb95153 define new package: zecwallet-lite
it seems to work. still waiting for it to sync
2022-07-09 00:00:18 -07:00
461398143c add monero (as package and as persisted directory) 2022-07-08 21:56:49 -07:00
89aabda1a6 home packages: fix tor crash 2022-07-08 01:42:14 -07:00
54f6e86e20 home packages: add gnupg, sequoia 2022-07-08 00:43:56 -07:00
39ba149aab update nixpkgs 2022-07-05 -> 2022-07-06 2022-07-07 17:16:36 -07:00
01ce23130a new package: tor 2022-07-07 16:56:47 -07:00
dc6472f39f electrum: put on all GUI systems 2022-07-07 04:10:57 -07:00
db6dc8e08c persist Signal 2022-07-06 15:14:36 -07:00
3b0d10f05e TODO: remove video drivers item
it seems to be working
2022-07-06 14:47:22 -07:00
978017b4e7 sane-scripts: TODO: don't rely on the user's env 2022-07-06 14:43:59 -07:00
1dd3cab02b split web-browser out of toplevel home-manager.nix file 2022-07-06 14:41:19 -07:00
8fd42f49c2 home packages: remove gcc, rustup 2022-07-06 14:38:39 -07:00
7ec1879f90 home-manager: import from flake.nix, not env/home-manager.nix 2022-07-06 14:36:14 -07:00
c851f44a40 split home packages out of home manager 2022-07-06 14:35:01 -07:00
bcfd2cbdb1 split packages out into home v.s. system packages 2022-07-06 14:31:51 -07:00
c58df098d2 split "environment"-related settings into modules/universal/env 2022-07-06 14:23:49 -07:00
dfd1536d19 update sops-nix: 2022-07-03 -> 2022-07-06 2022-07-06 14:20:21 -07:00
3e774241af users.colin: explicitly set group to "users" 2022-07-06 14:19:43 -07:00
a100100e79 impermanence: move import into flake.nix 2022-07-06 14:17:29 -07:00
24fa857ee0 split nix --flake enabling out of modules/nix.nix into universal 2022-07-06 14:16:09 -07:00
6aa79e9e55 x86: remove empty swapDevices 2022-07-06 14:13:49 -07:00
0fa7cdaa76 remove dead reference to telegram 2022-07-06 14:03:45 -07:00
c673e1db92 remove unused nurpkgs 2022-07-06 14:03:28 -07:00
4d3caf6fde bump all deps 2022-07-06 02:50:47 -07:00
2ceb2637d8 remove unnecessary kernelModules
i can't notice any difference with these removed
2022-07-06 02:01:16 -07:00
eb8cfc682f remove opengl modules
they don't seem to be necessary:
- still able to run spirv/vulkan-accelerated stuff at the same rate.
- still able to watch videos at the same CPU load.

i think mesa packages solid drivers that make this part mostly
irrelevant.
2022-07-06 02:00:12 -07:00
171 changed files with 5774 additions and 1836 deletions

View File

@@ -2,11 +2,11 @@ keys:
- &user_desko_colin age1tnl4jfgacwkargzeqnhzernw29xx8mkv73xh6ufdyde6q7859slsnzf24x
- &user_lappy_colin age1j2pqnl8j0krdzk6npe93s4nnqrzwx978qrc0u570gzlamqpnje9sc8le2g
- &user_servo_colin age1z8fauff34cdecr6sjkre260luzxcca05kpcwvhx988d306tpcejsp63znu
- &user_moby_colin age1lt739n2tq7dmpglvntjr9j2r7426md7rat7x9w930gagtx4jyvnqwts2al
- &user_moby_colin age1zsrsvd7j6l62fjxpfd2qnhqlk8wk4p8r0dtxpe4sdgnh2474095qdu7xj9
- &host_desko age1vnw7lnfpdpjn62l3u5nyv5xt2c965k96p98kc43mcnyzpetrts9q54mc9v
- &host_lappy age1w7mectcjku6x3sd8plm8wkn2qfrhv9n6zhzlf329e2r2uycgke8qkf9dyn
- &host_servo age1tzlyex2z6t88tg9h82943e39shxhmqeyr7ywhlwpdjmyqsndv3qq27x0rf
- &host_moby age1t957gf0z865gya0khgc9x59wy76hzps3sgejjqtwcngn2xl273msxsmpe6
- &host_moby age18vq5ktwgeaysucvw9t67drqmg5zd5c5k3le34yqxckkfj7wqdqgsd4ejmt
creation_rules:
- path_regex: secrets/universal*
key_groups:
@@ -19,10 +19,11 @@ creation_rules:
- *host_lappy
- *host_servo
- *host_moby
- path_regex: secrets/servo.yaml$
- path_regex: secrets/servo*
key_groups:
- age:
- *user_desko_colin
- *user_lappy_colin
- *user_servo_colin
- *host_servo
- path_regex: secrets/desko.yaml$
@@ -31,3 +32,16 @@ creation_rules:
- *user_desko_colin
- *user_lappy_colin
- *host_desko
- path_regex: secrets/lappy.yaml$
key_groups:
- age:
- *user_lappy_colin
- *user_desko_colin
- *host_lappy
- path_regex: secrets/moby.yaml$
key_groups:
- age:
- *user_desko_colin
- *user_lappy_colin
- *user_moby_colin
- *host_moby

12
TODO.md
View File

@@ -1,12 +0,0 @@
# features/tweaks
- iron out video drivers
- emoji picker application
- find a Masto/Pleroma app which works on mobile
# speed up cross compiling
https://nixos.wiki/wiki/Cross_Compiling
https://nixos.wiki/wiki/NixOS_on_ARM
overlays = [{ ... }: {
nixpkgs.crossSystem.system = "aarch64-linux";
}];

130
flake.lock generated
View File

@@ -1,5 +1,20 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -7,11 +22,11 @@
]
},
"locked": {
"lastModified": 1656169755,
"narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=",
"lastModified": 1667907331,
"narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4a3d01fb53f52ac83194081272795aa4612c2381",
"rev": "6639e3a837fc5deb6f99554072789724997bc8e5",
"type": "github"
},
"original": {
@@ -23,11 +38,11 @@
},
"impermanence": {
"locked": {
"lastModified": 1646131459,
"narHash": "sha256-GPmgxvUFvQ1GmsGfWHy9+rcxWrczeDhS9XnAIPHi9XQ=",
"lastModified": 1668668915,
"narHash": "sha256-QjY4ZZbs9shwO4LaLpvlU2bO9J1juYhO9NtV3nrbnYQ=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "2f39baeb7d039fda5fc8225111bb79474138e6f4",
"rev": "5df9108b346f8a42021bf99e50de89c9caa251c3",
"type": "github"
},
"original": {
@@ -39,11 +54,11 @@
"mobile-nixos": {
"flake": false,
"locked": {
"lastModified": 1656299939,
"narHash": "sha256-gODt71CCv0gnMNeU4GYdSBJkxsfmBy0uNv8owQC1oPs=",
"lastModified": 1668897543,
"narHash": "sha256-1bjvy5zi/6KDzhN3ihOUEA6y5FFEOf5xvIbf65RWIh0=",
"owner": "nixos",
"repo": "mobile-nixos",
"rev": "de9a88a70f0ae5fc0839ff94bf29e8a30af399f8",
"rev": "25eec596116553112681d72ee4880107fc3957fa",
"type": "github"
},
"original": {
@@ -54,42 +69,26 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1656679828,
"narHash": "sha256-akGA97pR1BAQew1FrVTCME3p8qvYxJXB2X3a13aBphs=",
"lastModified": 1669542132,
"narHash": "sha256-DRlg++NJAwPh8io3ExBJdNW7Djs3plVI5jgYQ+iXAZQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "915f5a5b3cc4f8ba206afd0b70e52ba4c6a2796b",
"rev": "a115bb9bd56831941be3776c8a94005867f316a7",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-22.05",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs-21_11": {
"locked": {
"lastModified": 1656198488,
"narHash": "sha256-xe81o3Kin6a0jXA3mTxcR+jeA1jLKw3TCar5LUo/B5c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "46af3303651699dc58cfc251d9b18c0f59d857da",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-22_05": {
"locked": {
"lastModified": 1656199498,
"narHash": "sha256-/BCpM7j7y1G4het6Z3idlnv9A87/s0O1glVmH7fnWvk=",
"lastModified": 1669513802,
"narHash": "sha256-AmTRNi8bHgJlmaNe3r5k+IMFbbXERM/KarqveMAZmsY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "72a1f167077060a1a7b6e0104863245d0483fa7f",
"rev": "6649e08812f579581bfb4cada3ba01e30485c891",
"type": "github"
},
"original": {
@@ -99,35 +98,19 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs-stable": {
"locked": {
"lastModified": 1656130826,
"narHash": "sha256-g5Wo75ddDQmWnL70rJCMm+JJlvHbzPFUePUpuMNn5qk=",
"lastModified": 1669546925,
"narHash": "sha256-Gvtk9agz88tBgqmCdHl5U7gYttTkiuEd8/Rq1Im0pTg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "72d1b0d0fac131df1ea254b65413c85609bdd2ee",
"rev": "fecf05d4861f3985e8dee73f08bc82668ef75125",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nurpkgs": {
"locked": {
"lastModified": 1656786319,
"narHash": "sha256-MpdBL2+csFfnMu+2eUNkkACkrPt7UhUdpvXnhrLim0E=",
"owner": "nix-community",
"repo": "NUR",
"rev": "433704dc83b1491725e616bbb898ccd17fbe3d0e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
"id": "nixpkgs",
"ref": "nixos-22.05",
"type": "indirect"
}
},
"root": {
@@ -136,22 +119,24 @@
"impermanence": "impermanence",
"mobile-nixos": "mobile-nixos",
"nixpkgs": "nixpkgs",
"nurpkgs": "nurpkgs",
"sops-nix": "sops-nix"
"nixpkgs-stable": "nixpkgs-stable",
"sops-nix": "sops-nix",
"uninsane": "uninsane"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": "nixpkgs_2",
"nixpkgs-21_11": "nixpkgs-21_11",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-22_05": "nixpkgs-22_05"
},
"locked": {
"lastModified": 1656399028,
"narHash": "sha256-re66+rVHGR3y+0QsaDAwoAHCfoi3BlGV24t2EqRZsAE=",
"lastModified": 1669714206,
"narHash": "sha256-9aiMbzRL8REsyi9U0eZ+lT4s7HaILA1gh9n2apKzLxU=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "d26947f2d6252e2aae5ffddfe9b38b7c4b94e8f9",
"rev": "8295b8139ef7baadeb90c5cad7a40c4c9297ebf7",
"type": "github"
},
"original": {
@@ -159,6 +144,27 @@
"repo": "sops-nix",
"type": "github"
}
},
"uninsane": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1666870107,
"narHash": "sha256-b9eXZxSwhzdJI5uQgfrMhu4SY2POrPkinUg7F5gQVYo=",
"ref": "refs/heads/master",
"rev": "80c6ec95bd430e29d231cf745f19279bb76fb382",
"revCount": 164,
"type": "git",
"url": "https://git.uninsane.org/colin/uninsane"
},
"original": {
"type": "git",
"url": "https://git.uninsane.org/colin/uninsane"
}
}
},
"root": "root",

114
flake.nix
View File

@@ -1,11 +1,11 @@
# docs:
# https://nixos.wiki/wiki/Flakes
# https://serokell.io/blog/practical-nix-flakes
# - <https://nixos.wiki/wiki/Flakes>
# - <https://serokell.io/blog/practical-nix-flakes>
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-22.05";
# pkgs-telegram.url = "nixpkgs/33775ec9a2173a08e46edf9f46c9febadbf743e8";# 2022/04/18; telegram 3.7.3. fails: nix log /nix/store/y5kv47hnv55qknb6cnmpcyraicay79fx-telegram-desktop-3.7.3.drv: g++: fatal error: cannot execute '/nix/store/njk5sbd21305bhr7gwibxbbvgbx5lxvn-gcc-9.3.0/libexec/gcc/aarch64-unknown-linux-gnu/9.3.0/cc1plus': execv: No such file or directory
nixpkgs-stable.url = "nixpkgs/nixos-22.05";
nixpkgs.url = "nixpkgs/nixos-unstable";
mobile-nixos = {
url = "github:nixos/mobile-nixos";
flake = false;
@@ -14,70 +14,118 @@
url = "github:nix-community/home-manager/release-22.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nurpkgs.url = "github:nix-community/NUR";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
uninsane = {
url = "git+https://git.uninsane.org/colin/uninsane";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, mobile-nixos, home-manager, nurpkgs, sops-nix, impermanence }:
let
outputs = {
self,
nixpkgs,
nixpkgs-stable,
mobile-nixos,
home-manager,
sops-nix,
impermanence,
uninsane
}: let
patchedPkgs = system: nixpkgs.legacyPackages.${system}.applyPatches {
name = "nixpkgs-patched-uninsane";
src = nixpkgs;
patches = import ./nixpatches/list.nix nixpkgs.legacyPackages.${system}.fetchpatch;
};
# return something which behaves like `pkgs`, for the provided system
nixpkgsFor = system: import (patchedPkgs system) { inherit system; };
# `local` = architecture of builder. `target` = architecture of the system beying deployed to
nixpkgsFor = local: target: import (patchedPkgs target) { crossSystem = target; localSystem = local; };
# evaluate ONLY our overlay, for the provided system
customPackagesFor = system: import ./pkgs/overlay.nix (nixpkgsFor system) (nixpkgsFor system);
decl-machine = { name, system }:
customPackagesFor = local: target: import ./pkgs/overlay.nix (nixpkgsFor local target) (nixpkgsFor local target);
decl-host = { name, local, target }:
let
nixosSystem = import ((patchedPkgs system) + "/nixos/lib/eval-config.nix");
nixosSystem = import ((patchedPkgs target) + "/nixos/lib/eval-config.nix");
in (nixosSystem {
inherit system;
specialArgs = { inherit nixpkgs mobile-nixos home-manager nurpkgs impermanence; };
# by default the local system is the same as the target, employing emulation when they differ
system = target;
specialArgs = { inherit mobile-nixos home-manager impermanence; };
modules = [
./modules
./machines/${name}
(import ./helpers/set-hostname.nix name)
(import ./hosts/instantiate.nix name)
home-manager.nixosModule
impermanence.nixosModule
sops-nix.nixosModules.sops
{
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
nurpkgs.overlay
(import "${mobile-nixos}/overlay/overlay.nix")
uninsane.overlay
(import ./pkgs/overlay.nix)
(next: prev: rec {
# non-emulated packages build *from* local *for* target.
# for large packages like the linux kernel which are expensive to build under emulation,
# the config can explicitly pull such packages from `pkgs.cross` to do more efficient cross-compilation.
cross = (nixpkgsFor local target) // (customPackagesFor local target);
stable = import nixpkgs-stable { system = target; };
# cross-compatible packages
# gocryptfs = cross.gocryptfs;
})
];
}
];
});
decl-bootable-machine = { name, system }: rec {
nixosConfiguration = decl-machine { inherit name system; };
decl-bootable-host = { name, local, target }: rec {
nixosConfiguration = decl-host { inherit name local target; };
# this produces a EFI-bootable .img file (GPT with a /boot partition and a system (/ or /nix) partition).
# after building this:
# - flash it to a bootable medium (SD card, flash drive, HDD)
# - resize the root partition (use cfdisk)
# - mount the part
# chown root:nixblkd <part>/nix/store
# chmod 775 <part>/nix/store
# chown root:root -R <part>/nix/store/*
# populate any important things (persist/, home/colin/.ssh, etc)
# - chown root:nixbld <part>/nix/store
# - chown root:root -R <part>/nix/store/*
# - chown root:root -R <part>/persist # if using impermanence
# - populate any important things (persist/, home/colin/.ssh, etc)
# - boot
# - if fs wasn't resized automatically, then `sudo btrfs filesystem resize max /`
# - checkout this flake into /etc/nixos AND UPDATE THE FS UUIDS.
# - `nixos-rebuild --flake './#<machine>' switch`
# - `nixos-rebuild --flake './#<host>' switch`
img = nixosConfiguration.config.system.build.img;
};
machines.servo = decl-bootable-machine { name = "servo"; system = "aarch64-linux"; };
machines.desko = decl-bootable-machine { name = "desko"; system = "x86_64-linux"; };
machines.lappy = decl-bootable-machine { name = "lappy"; system = "x86_64-linux"; };
machines.moby = decl-bootable-machine { name = "moby"; system = "aarch64-linux"; };
hosts.servo = decl-bootable-host { name = "servo"; local = "x86_64-linux"; target = "x86_64-linux"; };
hosts.desko = decl-bootable-host { name = "desko"; local = "x86_64-linux"; target = "x86_64-linux"; };
hosts.lappy = decl-bootable-host { name = "lappy"; local = "x86_64-linux"; target = "x86_64-linux"; };
hosts.moby = decl-bootable-host { name = "moby"; local = "aarch64-linux"; target = "aarch64-linux"; };
# special cross-compiled variant, to speed up deploys from an x86 box to the arm target
# note that these *do* produce different store paths, because the closure for the tools used to cross compile
# v.s. emulate differ.
# so deploying foo-cross and then foo incurs some rebuilding.
hosts.moby-cross = decl-bootable-host { name = "moby"; local = "x86_64-linux"; target = "aarch64-linux"; };
hosts.rescue = decl-bootable-host { name = "rescue"; local = "x86_64-linux"; target = "x86_64-linux"; };
in {
nixosConfigurations = builtins.mapAttrs (name: value: value.nixosConfiguration) machines;
imgs = builtins.mapAttrs (name: value: value.img) machines;
packages.x86_64-linux = customPackagesFor "x86_64-linux";
packages.aarch64-linux = customPackagesFor "aarch64-linux";
nixosConfigurations = builtins.mapAttrs (name: value: value.nixosConfiguration) hosts;
imgs = builtins.mapAttrs (name: value: value.img) hosts;
packages = let
allPkgsFor = sys: (customPackagesFor sys sys) // {
nixpkgs = nixpkgsFor sys sys;
uninsane = uninsane.packages."${sys}";
};
in {
x86_64-linux = allPkgsFor "x86_64-linux";
aarch64-linux = allPkgsFor "aarch64-linux";
};
templates = {
python-data = {
# initialize with:
# - `nix flake init -t '/home/colin/dev/nixos/#python-data'`
# then enter with:
# - `nix develop`
path = ./templates/python-data;
description = "python environment for data processing";
};
};
};
}

View File

@@ -1,4 +0,0 @@
hostName: { ... }:
{
networking.hostName = hostName;
}

74
hosts/common/default.nix Normal file
View File

@@ -0,0 +1,74 @@
{ pkgs, ... }:
{
imports = [
./fs.nix
./hardware
./machine-id.nix
./net.nix
./secrets.nix
./ssh.nix
./users.nix
./vpn.nix
];
sane.home-manager.enable = true;
sane.nixcache.enable-trusted-keys = true;
sane.packages.enableConsolePkgs = true;
sane.packages.enableSystemPkgs = true;
nixpkgs.config.allowUnfree = true;
# time.timeZone = "America/Los_Angeles";
time.timeZone = "Etc/UTC"; # DST is too confusing for me => use a stable timezone
# allow `nix flake ...` command
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
# TODO: move this into home-manager?
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [ font-awesome twitter-color-emoji hack-font ];
fontconfig.enable = true;
fontconfig.defaultFonts = {
emoji = [ "Font Awesome 6 Free" "Twitter Color Emoji" ];
monospace = [ "Hack" ];
serif = [ "DejaVu Serif" ];
sansSerif = [ "DejaVu Sans" ];
};
};
# disable non-required packages like nano, perl, rsync, strace
environment.defaultPackages = [];
# programs.vim.defaultEditor = true;
environment.variables = {
EDITOR = "vim";
# git claims it should use EDITOR, but it doesn't!
GIT_EDITOR = "vim";
# TODO: these should be moved to `home.sessionVariables` (home-manager)
# Electron apps should use native wayland backend:
# https://nixos.wiki/wiki/Slack#Wayland
# Discord under sway crashes with this.
# NIXOS_OZONE_WL = "1";
# LIBGL_ALWAYS_SOFTWARE = "1";
};
# enable zsh completions
environment.pathsToLink = [ "/share/zsh" ];
environment.systemPackages = with pkgs; [
# required for pam_mount
gocryptfs
];
# link debug symbols into /run/current-system/sw/lib/debug
# hopefully picked up by gdb automatically?
environment.enableDebugInfo = true;
security.pam.mount.enable = true;
# security.pam.mount.debugLevel = 1;
# security.pam.enableSSHAgentAuth = true; # ??
# needed for `allow_other` in e.g. gocryptfs mounts
# or i guess going through mount.fuse sets suid so that's not necessary?
# programs.fuse.userAllowOther = true;
}

74
hosts/common/fs.nix Normal file
View File

@@ -0,0 +1,74 @@
{ pkgs, ... }:
let sshOpts = rec {
fsType = "fuse.sshfs";
optionsBase = [
"x-systemd.automount"
"_netdev"
"user"
"identityfile=/home/colin/.ssh/id_ed25519"
"allow_other"
"default_permissions"
];
optionsColin = optionsBase ++ [
"transform_symlinks"
"idmap=user"
"uid=1000"
"gid=100"
];
optionsRoot = optionsBase ++ [
# 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"
];
};
in
{
environment.pathsToLink = [
# needed to achieve superuser access for user-mounted filesystems (see optionsRoot above)
# we can only link whole directories here, even though we're only interested in pkgs.openssh
"/libexec"
];
fileSystems."/mnt/servo-media-wan" = {
device = "colin@uninsane.org:/var/lib/uninsane/media";
inherit (sshOpts) fsType;
options = sshOpts.optionsColin;
noCheck = true;
};
fileSystems."/mnt/servo-media-lan" = {
device = "colin@servo:/var/lib/uninsane/media";
inherit (sshOpts) fsType;
options = sshOpts.optionsColin;
noCheck = true;
};
fileSystems."/mnt/servo-root-wan" = {
device = "colin@uninsane.org:/";
inherit (sshOpts) fsType;
options = sshOpts.optionsRoot;
noCheck = true;
};
fileSystems."/mnt/servo-root-lan" = {
device = "colin@servo:/";
inherit (sshOpts) fsType;
options = sshOpts.optionsRoot;
noCheck = true;
};
fileSystems."/mnt/desko-home" = {
device = "colin@desko:/home/colin";
inherit (sshOpts) fsType;
options = sshOpts.optionsColin;
noCheck = true;
};
fileSystems."/mnt/desko-root" = {
device = "colin@desko:/";
inherit (sshOpts) fsType;
options = sshOpts.optionsRoot;
noCheck = true;
};
environment.systemPackages = [
pkgs.sshfs-fuse
];
}

View File

@@ -0,0 +1,40 @@
{ lib, pkgs, ... }:
{
boot.initrd.supportedFilesystems = [ "ext4" "btrfs" "ext2" "ext3" "vfat" ];
# useful emergency utils
boot.initrd.extraUtilsCommands = ''
copy_bin_and_libs ${pkgs.btrfs-progs}/bin/btrfstune
'';
boot.kernelParams = [ "boot.shell_on_fail" ];
# other kernelParams:
# "boot.trace"
# "systemd.log_level=debug"
# "systemd.log_target=console"
# hack in the `boot.shell_on_fail` arg since that doesn't always seem to work.
boot.initrd.preFailCommands = "allowShell=1";
# default: 4 (warn). 7 is debug
boot.consoleLogLevel = 7;
boot.loader.grub.enable = lib.mkDefault false;
boot.loader.generic-extlinux-compatible.enable = lib.mkDefault true;
# non-free firmware
hardware.enableRedistributableFirmware = true;
services.fwupd.enable = true;
# powertop will default to putting USB devices -- including HID -- to sleep after TWO SECONDS
powerManagement.powertop.enable = false;
# services.snapper.configs = {
# root = {
# subvolume = "/";
# extraConfig = {
# ALLOW_USERS = "colin";
# };
# };
# };
# services.snapper.snapshotInterval = "daily";
}

View File

@@ -2,6 +2,7 @@
{
imports = [
./all.nix
./x86_64.nix
];
}

View File

@@ -0,0 +1,26 @@
{ lib, pkgs, ... }:
with lib;
{
config = mkIf (pkgs.system == "x86_64-linux") {
boot.initrd.availableKernelModules = [
"xhci_pci" "ahci" "sd_mod" "sdhci_pci" # nixos-generate-config defaults
"usb_storage" # rpi needed this to boot from usb storage, i think.
"nvme" # to boot from nvme devices
# efi_pstore evivars
];
# enable cross compilation
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# nixpkgs.config.allowUnsupportedSystem = true;
# nixpkgs.crossSystem.system = "aarch64-linux";
powerManagement.cpuFreqGovernor = "powersave";
hardware.cpu.amd.updateMicrocode = true; # desktop
hardware.cpu.intel.updateMicrocode = true; # laptop
hardware.opengl.driSupport = true;
# For 32 bit applications
hardware.opengl.driSupport32Bit = true;
};
}

View File

@@ -0,0 +1,11 @@
{ ... }:
{
# we wan't an /etc/machine-id which is consistent across boot so that `journalctl` will actually show us
# logs from previous boots.
# maybe there's a config option for this (since persistent machine-id is bad for reasons listed in impermanence.nix),
# but for now generate it from ssh keys.
system.activationScripts.machine-id = {
deps = [ "persist-ssh-host-keys" ];
text = "sha256sum /etc/ssh/host_keys/ssh_host_ed25519_key | cut -c 1-32 > /etc/machine-id";
};
}

79
hosts/common/net.nix Normal file
View File

@@ -0,0 +1,79 @@
{ config, lib, pkgs, ... }:
{
# if using router's DNS, these mappings will already exist.
# if using a different DNS provider (which servo does), then we need to explicity provide them.
# ugly hack. would be better to get servo to somehow use the router's DNS
networking.hosts = {
"192.168.0.5" = [ "servo" ];
"192.168.0.20" = [ "lappy" ];
"192.168.0.22" = [ "desko" ];
"192.168.0.48" = [ "moby" ];
};
# the default backend is "wpa_supplicant".
# wpa_supplicant reliably picks weak APs to connect to.
# see: <https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/474>
# iwd is an alternative that shouldn't have this problem
# docs:
# - <https://nixos.wiki/wiki/Iwd>
# - <https://iwd.wiki.kernel.org/networkmanager>
# - `man iwd.config` for global config
# - `man iwd.network` for per-SSID config
# use `iwctl` to control
networking.networkmanager.wifi.backend = "iwd";
networking.wireless.iwd.enable = true;
networking.wireless.iwd.settings = {
# auto-connect to a stronger network if signal drops below this value
# bedroom -> bedroom connection is -35 to -40 dBm
# bedroom -> living room connection is -60 dBm
General.RoamThreshold = "-52"; # default -70
General.RoamThreshold5G = "-52"; # default -76
};
# TODO: don't need to depend on binsh if we were to use a nix-style shebang
system.activationScripts.linkIwdKeys = let
unwrapped = ../../scripts/install-iwd;
install-iwd = pkgs.writeShellApplication {
name = "install-iwd";
runtimeInputs = with pkgs; [ coreutils gnused ];
text = ''${unwrapped} "$@"'';
};
in (lib.stringAfter
[ "setupSecrets" "binsh" ]
''
mkdir -p /var/lib/iwd
${install-iwd}/bin/install-iwd /run/secrets/iwd /var/lib/iwd
''
);
# TODO: use a glob, or a list, or something?
sops.secrets."iwd/community-university.psk" = {
sopsFile = ../../secrets/universal/net/community-university.psk.bin;
format = "binary";
};
sops.secrets."iwd/friend-libertarian-dod.psk" = {
sopsFile = ../../secrets/universal/net/friend-libertarian-dod.psk.bin;
format = "binary";
};
sops.secrets."iwd/friend-rationalist-empathist.psk" = {
sopsFile = ../../secrets/universal/net/friend-rationalist-empathist.psk.bin;
format = "binary";
};
sops.secrets."iwd/home-bedroom.psk" = {
sopsFile = ../../secrets/universal/net/home-bedroom.psk.bin;
format = "binary";
};
sops.secrets."iwd/home-shared-24G.psk" = {
sopsFile = ../../secrets/universal/net/home-shared-24G.psk.bin;
format = "binary";
};
sops.secrets."iwd/home-shared.psk" = {
sopsFile = ../../secrets/universal/net/home-shared.psk.bin;
format = "binary";
};
sops.secrets."iwd/iphone" = {
sopsFile = ../../secrets/universal/net/iphone.psk.bin;
format = "binary";
};
}

View File

@@ -16,7 +16,7 @@
# add the result to .sops.yaml
# since we specify ssh pubkeys in the nix config, you can just grep for `ssh-ed25519` here and use those instead
#
# for each machine you want to decrypt secrets:
# for each host you want to decrypt secrets:
# $ cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age
# add the result to .sops.yaml
# $ sops updatekeys secrets/example.yaml
@@ -29,15 +29,15 @@
# $ cat /run/secrets/example_key
# sops.age.sshKeyPaths = [ "/home/colin/.ssh/id_ed25519_dec" ];
# This will add secrets.yml to the nix store
# This will add secrets.yaml to the nix store
# You can avoid this by adding a string to the full path instead, i.e.
# sops.defaultSopsFile = "/root/.sops/secrets/example.yaml";
sops.defaultSopsFile = ./../../secrets/universal.yaml;
sops.defaultSopsFile = ../../secrets/universal.yaml;
# This will automatically import SSH keys as age keys
sops.age.sshKeyPaths = [
"/etc/ssh/ssh_host_ed25519_key"
# "/home/colin/.ssh/id_ed25519_dec"
"/etc/ssh/host_keys/ssh_host_ed25519_key"
];
sops.gnupg.sshKeyPaths = []; # disable RSA key import
# This is using an age key that is expected to already be in the filesystem
# sops.age.keyFile = "/home/colin/.ssh/age.pub";
# sops.age.keyFile = "/var/lib/sops-nix/key.txt";

21
hosts/common/ssh.nix Normal file
View File

@@ -0,0 +1,21 @@
{ ... }:
{
# we place the host keys (which we want to be persisted) into their own directory so that we can
# bind mount that whole directory instead of doing it per-file.
# otherwise, this is identical to nixos defaults
sane.impermanence.service-dirs = [ "/etc/ssh/host_keys" ];
# we can't naively `mount /etc/ssh/host_keys` directly,
# as /etc/fstab may not be populated yet (since that file depends on e.g. activationScripts.users)
# we can't even depend on impermanence's `createPersistentStorageDirs` to create the source/target directories
# since that also depends on `users`.
system.activationScripts.persist-ssh-host-keys.text = ''
mkdir -p /etc/ssh/host_keys
mount --bind /nix/persist/etc/ssh/host_keys /etc/ssh/host_keys
'';
services.openssh.hostKeys = [
{ type = "rsa"; bits = 4096; path = "/etc/ssh/host_keys/ssh_host_rsa_key"; }
{ type = "ed25519"; path = "/etc/ssh/host_keys/ssh_host_ed25519_key"; }
];
}

138
hosts/common/users.nix Normal file
View File

@@ -0,0 +1,138 @@
{ config, pkgs, lib, ... }:
# installer docs: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/installation-device.nix
with lib;
let
cfg = config.sane.users;
# see nixpkgs/nixos/modules/services/networking/dhcpcd.nix
hasDHCP = config.networking.dhcpcd.enable &&
(config.networking.useDHCP || any (i: i.useDHCP == true) (attrValues config.networking.interfaces));
in
{
options = {
sane.users.guest.enable = mkOption {
default = false;
type = types.bool;
};
};
config = {
# Users are exactly these specified here;
# old ones will be deleted (from /etc/passwd, etc) upon upgrade.
users.mutableUsers = false;
# docs: https://nixpkgs-manual-sphinx-markedown-example.netlify.app/generated/options-db.xml.html#users-users
users.users.colin = {
# sets group to "users" (?)
isNormalUser = true;
home = "/home/colin";
uid = config.sane.allocations.colin-uid;
# i don't get exactly what this is, but nixos defaults to this non-deterministically
# in /var/lib/nixos/auto-subuid-map and i don't want that.
subUidRanges = [
{ startUid=100000; count=1; }
];
group = "users";
extraGroups = [
"wheel"
"nixbuild"
"networkmanager"
# phosh/mobile. XXX colin: unsure if necessary
"video"
"feedbackd"
"dialout" # required for modem access
];
# initial password is empty, in case anything goes wrong.
# if `colin-passwd` (a password hash) is successfully found/decrypted, that becomes the password at boot.
initialPassword = lib.mkDefault "";
passwordFile = lib.mkIf (config.sops.secrets ? "colin-passwd") config.sops.secrets.colin-passwd.path;
shell = pkgs.zsh;
openssh.authorizedKeys.keys = builtins.attrValues (import ../../modules/pubkeys.nix).users;
pamMount = {
# mount encrypted stuff at login
# requires that login password == fs encryption password
# fstype = "fuse";
# path = "${pkgs.gocryptfs}/bin/gocryptfs#/nix/persist/home/colin/private";
fstype = "fuse.gocryptfs";
path = "/nix/persist/home/colin/private";
mountpoint = "/home/colin/private";
options="nodev,nosuid,quiet,allow_other";
};
};
sane.impermanence.home-dirs = [
# cache is probably too big to fit on the tmpfs
# TODO: we could bind-mount it to something which gets cleared per boot, though.
".cache"
".cargo"
".rustup"
".local/share/keyrings"
];
sane.impermanence.service-dirs = mkIf cfg.guest.enable [
{ user = "guest"; group = "users"; directory = "/home/guest"; }
];
users.users.guest = mkIf cfg.guest.enable {
isNormalUser = true;
home = "/home/guest";
uid = config.sane.allocations.guest-uid;
subUidRanges = [
{ startUid=200000; count=1; }
];
group = "users";
initialPassword = lib.mkDefault "";
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
# TODO: insert pubkeys that should be allowed in
];
};
users.users.dhcpcd = mkIf hasDHCP {
uid = config.sane.allocations.dhcpcd-uid;
};
users.groups.dhcpcd = mkIf hasDHCP {
gid = config.sane.allocations.dhcpcd-gid;
};
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
services.openssh = {
enable = true;
permitRootLogin = "no";
passwordAuthentication = false;
};
# affix some UIDs which were historically auto-generated
users.users.sshd.uid = config.sane.allocations.sshd-uid;
users.groups.polkituser.gid = config.sane.allocations.polkituser-gid;
users.groups.sshd.gid = config.sane.allocations.sshd-gid;
users.groups.systemd-coredump.gid = config.sane.allocations.systemd-coredump-gid;
users.users.nscd.uid = config.sane.allocations.nscd-uid;
users.groups.nscd.gid = config.sane.allocations.nscd-gid;
users.users.systemd-oom.uid = config.sane.allocations.systemd-oom-uid;
users.groups.systemd-oom.gid = config.sane.allocations.systemd-oom-gid;
# guarantee determinism in uid/gid generation for users:
assertions = let
uidAssertions = builtins.attrValues (builtins.mapAttrs (name: user: {
assertion = user.uid != null;
message = "non-deterministic uid detected for: ${name}";
}) config.users.users);
gidAssertions = builtins.attrValues (builtins.mapAttrs (name: group: {
assertion = group.gid != null;
message = "non-deterministic gid detected for: ${name}";
}) config.users.groups);
autoSubAssertions = builtins.attrValues (builtins.mapAttrs (name: user: {
assertion = !user.autoSubUidGidRange;
message = "non-deterministic subUids/Guids detected for: ${name}";
}) config.users.users);
in uidAssertions ++ gidAssertions ++ autoSubAssertions;
};
}

58
hosts/common/vpn.nix Normal file
View File

@@ -0,0 +1,58 @@
{ config, ... }:
{
networking.wg-quick.interfaces.ovpnd-us = {
address = [
"172.27.237.218/32"
"fd00:0000:1337:cafe:1111:1111:ab00:4c8f/128"
];
dns = [
"46.227.67.134"
"192.165.9.158"
];
peers = [
{
allowedIPs = [
"0.0.0.0/0"
"::/0"
];
endpoint = "vpn31.prd.losangeles.ovpn.com:9929";
publicKey = "VW6bEWMOlOneta1bf6YFE25N/oMGh1E1UFBCfyggd0k=";
}
];
privateKeyFile = config.sops.secrets.wg_ovpnd_us_privkey.path;
# to start: `systemctl start wg-quick-ovpnd-us`
autostart = false;
};
networking.wg-quick.interfaces.ovpnd-ukr = {
address = [
"172.18.180.159/32"
"fd00:0000:1337:cafe:1111:1111:ec5c:add3/128"
];
dns = [
"46.227.67.134"
"192.165.9.158"
];
peers = [
{
allowedIPs = [
"0.0.0.0/0"
"::/0"
];
endpoint = "vpn96.prd.kyiv.ovpn.com:9929";
publicKey = "CjZcXDxaaKpW8b5As1EcNbI6+42A6BjWahwXDCwfVFg=";
}
];
privateKeyFile = config.sops.secrets.wg_ovpnd_ukr_privkey.path;
# to start: `systemctl start wg-quick-ovpnd-ukr`
autostart = false;
};
sops.secrets."wg_ovpnd_us_privkey" = {
sopsFile = ../../secrets/universal.yaml;
};
sops.secrets."wg_ovpnd_ukr_privkey" = {
sopsFile = ../../secrets/universal.yaml;
};
}

View File

@@ -1,28 +1,29 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
imports = [
./fs.nix
];
colinsane.home-manager.extraPackages = [
pkgs.electrum
];
colinsane.gui.sway.enable = true;
colinsane.services.duplicity.enable = true;
colinsane.impermanence.enable = true;
# sane.packages.enableDevPkgs = true;
sane.gui.sway.enable = true;
sane.services.duplicity.enable = true;
sane.services.nixserve.enable = true;
sane.services.nixserve.sopsFile = ../../secrets/desko.yaml;
sane.impermanence.enable = true;
boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
colinsane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
hardware.opengl.extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
amdvlk
];
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
# needed to use libimobiledevice/ifuse, for iphone sync
services.usbmuxd.enable = true;
users.users.usbmux.uid = config.sane.allocations.usbmux-uid;
users.groups.usbmux.gid = config.sane.allocations.usbmux-gid;
sops.secrets.colin-passwd = {
sopsFile = ../../secrets/desko.yaml;
neededForUsers = true;
};
# default config: https://man.archlinux.org/man/snapper-configs.5
# defaults to something like:
@@ -42,6 +43,17 @@
sopsFile = ../../secrets/desko.yaml;
};
programs.steam = {
enable = true;
# not sure if needed: stole this whole snippet from the wiki
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
sane.impermanence.home-dirs = [
".steam"
".local/share/Steam"
];
# docs: https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion
system.stateVersion = "21.05";
}

View File

@@ -11,12 +11,14 @@
"defaults"
];
};
# we need a /tmp of default size (half RAM) for building large nix things
# we need a /tmp for building large nix things.
# a cross-compiled kernel, particularly, will easily use 30+GB of tmp
fileSystems."/tmp" = {
device = "none";
fsType = "tmpfs";
options = [
"mode=777"
"size=64G"
"defaults"
];
};

10
hosts/instantiate.nix Normal file
View File

@@ -0,0 +1,10 @@
# trampoline from flake.nix into the specific host definition, while doing a tiny bit of common setup
hostName: { ... }: {
imports = [
./${hostName}
./common
];
networking.hostName = hostName;
}

View File

@@ -4,18 +4,19 @@
./fs.nix
];
colinsane.gui.sway.enable = true;
colinsane.impermanence.enable = true;
boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
colinsane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
# sane.packages.enableDevPkgs = true;
hardware.opengl.extraPackages = with pkgs; [
intel-compute-runtime
intel-media-driver # new
libvdpau-va-gl # new
vaapiIntel
];
# sane.users.guest.enable = true;
sane.gui.sway.enable = true;
sane.impermanence.enable = true;
sane.nixcache.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
sops.secrets.colin-passwd = {
sopsFile = ../../secrets/lappy.yaml;
neededForUsers = true;
};
# default config: https://man.archlinux.org/man/snapper-configs.5
# defaults to something like:

85
hosts/moby/default.nix Normal file
View File

@@ -0,0 +1,85 @@
{ config, pkgs, lib, mobile-nixos, ... }:
{
imports = [
./firmware.nix
./fs.nix
./kernel.nix
];
# cross-compiled documentation is *slow*.
# no obvious way to natively compile docs (2022/09/29).
# entrypoint is nixos/modules/misc/documentation.nix
# doc building happens in nixos/doc/manual/default.nix
# TODO: we could *maybe* inject pkgs.buildPackages.xyz = cross.buildPackages.xyz?
documentation.nixos.enable = false;
# XXX colin: phosh doesn't work well with passwordless login,
# so set this more reliable default password should anything go wrong
users.users.colin.initialPassword = "147147";
services.getty.autologinUser = "root"; # allows for emergency maintenance?
sops.secrets.colin-passwd = {
sopsFile = ../../secrets/moby.yaml;
neededForUsers = true;
};
# usability compromises
sane.impermanence.home-dirs = [
config.sane.web-browser.dotDir
];
# sane.packages.enableGuiPkgs = false; # XXX faster builds/imaging for debugging
sane.packages.extraUserPkgs = [
pkgs.plasma5Packages.konsole # terminal
];
sane.nixcache.enable = true;
sane.impermanence.enable = true;
sane.gui.phosh.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
# /boot space is at a premium. default was 20.
boot.loader.generic-extlinux-compatible.configurationLimit = 10;
# mobile.bootloader.enable = false;
# mobile.boot.stage-1.enable = false;
# boot.initrd.systemd.enable = false;
# boot.initrd.services.swraid.enable = false; # attempt to fix dm_mod stuff
# disable proximity sensor.
# the filtering/calibration is bad that it causes the screen to go fully dark at times.
boot.blacklistedKernelModules = [ "stk3310" ];
# 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.
# the default CMA seems to be 32M. we could probably get by with as little as 64M, and safely with 128M.
# `cat /proc/meminfo` to see CmaTotal/CmaFree if interested in tuning this.
boot.kernelParams = [ "cma=256M" ];
# mobile-nixos' /lib/firmware includes:
# rtl_bt (bluetooth)
# anx7688-fw.bin (USB-C -> HDMI bridge)
# ov5640_af.bin (camera module)
# hardware.firmware = [ config.mobile.device.firmware ];
hardware.firmware = [ pkgs.rtl8723cs-firmware ];
system.stateVersion = "21.11";
# defined: https://www.freedesktop.org/software/systemd/man/machine-info.html
# XXX colin: not sure which, if any, software makes use of this
environment.etc."machine-info".text = ''
CHASSIS="handset"
'';
# enable rotation sensor
hardware.sensor.iio.enable = true;
# from https://gitlab.manjaro.org/manjaro-arm/packages/community/phosh/alsa-ucm-pinephone
# mobile-nixos does this same thing, with *slightly different settings*.
# i trust manjaro more because the guy maintaining that is actively trying to upstream into alsa-ucm-conf.
# an alternative may be to build a custom alsa with the PinePhone config patch applied:
# - <https://github.com/alsa-project/alsa-ucm-conf/pull/134>
# that would make this be not device-specific
environment.variables.ALSA_CONFIG_UCM2 = "${./ucm2}";
systemd.services.pulseaudio.environment.ALSA_CONFIG_UCM2 = "${./ucm2}";
hardware.opengl.driSupport = true;
}

View File

@@ -2,9 +2,9 @@
{
# we need space in the GPT header to place tow-boot.
# only actually need 1 MB, but better to over-allocate than under-allocate
colinsane.image.extraGPTPadding = 16 * 1024 * 1024;
colinsane.image.firstPartGap = 0;
system.build.img = pkgs.runCommandNoCC "nixos_full-disk-image.img" {} ''
sane.image.extraGPTPadding = 16 * 1024 * 1024;
sane.image.firstPartGap = 0;
system.build.img = pkgs.runCommand "nixos_full-disk-image.img" {} ''
cp -v ${config.system.build.img-without-firmware}/nixos.img $out
chmod +w $out
dd if=${pkgs.tow-boot-pinephone}/Tow-Boot.noenv.bin of=$out bs=1024 seek=8 conv=notrunc

View File

@@ -1,7 +1,18 @@
{ ... }:
{
# root is a tmpfs so that we have an ephemeral system ("impermanence" handles the state)
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [
"mode=755"
"size=1G"
"defaults"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/1f1271f8-53ce-4081-8a29-60a4a6b5d6f9";
fsType = "btrfs";
options = [

143
hosts/moby/kernel.nix Normal file
View File

@@ -0,0 +1,143 @@
{ lib, pkgs, ... }:
let
# use the last commit on the 5.18 branch (5.18.14)
# manjaro's changes between kernel patch versions tend to be minimal if any.
manjaroBase = "https://gitlab.manjaro.org/manjaro-arm/packages/core/linux/-/raw/25bd828cd47b1c6e09fcbcf394a649b89d2876dd";
manjaroPatch = name: sha256: {
inherit name;
patch = pkgs.fetchpatch {
inherit name;
url = "${manjaroBase}/${name}?inline=false";
inherit sha256;
};
};
# the idea for patching off Manjaro's kernel comes from jakewaksbaum:
# - https://git.sr.ht/~jakewaksbaum/pi/tree/af20aae5653545d6e67a459b59ee3e1ca8a680b0/item/kernel/default.nix
# - he later abandoned this, i think because he's using the Pinephone Pro which received mainline support.
manjaroPatches = [
(manjaroPatch
"1001-arm64-dts-allwinner-add-hdmi-sound-to-pine-devices.patch"
"sha256-DApd791A+AxB28Ven/MVAyuyVphdo8KQDx8O7oxVPnc="
)
# these patches below are critical to enable wifi (RTL8723CS)
# - the alternative is a wholly forked kernel by megi/megous:
# - https://xnux.eu/howtos/build-pinephone-kernel.html#toc-how-to-build-megi-s-pinehpone-kernel
# - i don't know if these patches are based on megi's or original
(manjaroPatch
"2001-Bluetooth-Add-new-quirk-for-broken-local-ext-features.patch"
"sha256-CExhJuUWivegxPdnzKINEsKrMFx/m/1kOZFmlZ2SEOc="
)
(manjaroPatch
"2002-Bluetooth-btrtl-add-support-for-the-RTL8723CS.patch"
"sha256-dDdvOphTcP/Aog93HyH+L9m55laTgtjndPSE4/rnzUA="
)
(manjaroPatch
"2004-arm64-dts-allwinner-enable-bluetooth-pinetab-pinepho.patch"
"sha256-o43P3WzXyHK1PF+Kdter4asuyGAEKO6wf5ixcco2kCQ="
)
# XXX: this one has a Makefile, which hardcodes /sbin/depmod:
# - drivers/staging/rtl8723cs/Makefile
# - not sure if this is problematic?
(manjaroPatch
"2005-staging-add-rtl8723cs-driver.patch"
"sha256-6ywm3dQQ5JYl60CLKarxlSUukwi4QzqctCj3tVgzFbo="
)
];
# pinephone uses the linux dtb at arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
# - this includes sun50i-a64.dtsi
# - and sun50i-a64-cpu-opp.dtsi
# - no need to touch the allwinner-h6 stuff: that's the SBC pine product
# - i think it's safe to ignore sun9i stuff, but i don't know what it is
kernelConfig = with lib.kernel; {
# NB: nix adds the CONFIG_ prefix to each of these.
# if you add the prefix yourself nix will IGNORE YOUR CONFIG.
RTL8723CS = module;
BT_HCIUART_3WIRE = yes;
BT_HCIUART_RTL = yes;
RTL8XXXU_UNTESTED = yes;
BT_BNEP_MC_FILTER = yes;
BT_BNEP_PROTO_FILTER = yes;
BT_HS = yes;
BT_LE = yes;
# relevant configs inherited from nixos defaults (or above additions):
# CONFIG_BT=m
# CONFIG_BT_BREDR=y
# CONFIG_BT_RFCOMM=m
# CONFIG_BT_RFCOMM_TTY=y
# CONFIG_BT_BNEP=m
# CONFIG_BT_HIDP=m
# CONFIG_BT_RTL=m
# CONFIG_BT_HCIBTUSB=m
# CONFIG_BT_HCIBTUSB_BCM=y
# CONFIG_BT_HCIBTUSB_RTL=y
# CONFIG_BT_HCIUART=m
# CONFIG_BT_HCIUART_SERDEV=y
# CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_LL=y
# CONFIG_RTL_CARDS=m
# CONFIG_RTLWIFI=m
# CONFIG_RTLWIFI_PCI=m
# CONFIG_RTLWIFI_USB=m
# CONFIG_RTLWIFI_DEBUG=y
# CONFIG_RTL8723_COMMON=m
# CONFIG_RTLBTCOEXIST=m
# CONFIG_RTL8XXXU=m
# CONFIG_RTLLIB=m
# consider adding (from mobile-nixos):
# maybe: CONFIG_BT_HCIUART_3WIRE=y
# maybe: CONFIG_BT_HCIUART_RTL=y
# maybe: CONFIG_RTL8XXXU_UNTESTED=y
# consider adding (from manjaro):
# CONFIG_BT_6LOWPAN=m (not listed as option in nixos kernel)
# these are referenced in the rtl8723 source, but not known to config (and not in mobile-nixos config
# maybe: CONFIG_RTL_ODM_WLAN_DRIVER
# maybe: CONFIG_RTL_TRIBAND_SUPPORT
# maybe: CONFIG_SDIO_HCI
# maybe: CONFIG_USB_HCI
};
# create a kernelPatch which overrides nixos' defconfig with extra options
patchDefconfig = config: {
# defconfig options. this method comes from here:
# - https://discourse.nixos.org/t/the-correct-way-to-override-the-latest-kernel-config/533/9
name = "sane-moby-defconfig";
patch = null;
extraStructuredConfig = config;
};
in
{
# use Megi's kernel:
# even with the Manjaro patches, stock 5.18 has a few issues on Pinephone:
# - no battery charging
# - phone rotation sensor is off by 90 degrees
# - ambient light sensor causes screen brightness to be shakey
# - phosh greeter may not appear after wake from sleep
boot.kernelPackages = pkgs.cross.linuxPackagesFor pkgs.cross.linux-megous;
boot.kernelPatches = [
(patchDefconfig (kernelConfig //
(with lib.kernel; {
# disabling the sun5i_eink driver avoids this compilation error:
# CC [M] drivers/video/fbdev/sun5i-eink-neon.o
# aarch64-unknown-linux-gnu-gcc: error: unrecognized command line option '-mfloat-abi=softfp'
# aarch64-unknown-linux-gnu-gcc: error: unrecognized command line option '-mfpu=neon'
# make[3]: *** [../scripts/Makefile.build:289: drivers/video/fbdev/sun5i-eink-neon.o] Error 1
FB_SUN5I_EINK = no;
})
))
];
# alternatively, use nixos' kernel and add the stuff we want:
# # cross-compilation optimization:
# boot.kernelPackages =
# let p = (import nixpkgs { localSystem = "x86_64-linux"; });
# in p.pkgsCross.aarch64-multiplatform.linuxPackages_5_18;
# # non-cross:
# # boot.kernelPackages = pkgs.linuxPackages_5_18;
# boot.kernelPatches = manjaroPatches ++ [
# (patchDefconfig kernelConfig)
# ];
}

View File

@@ -0,0 +1,148 @@
SectionVerb {
EnableSequence [
cset "name='Headphone Playback Switch' off"
cset "name='Headphone Source Playback Route' DAC"
cset "name='Line In Playback Switch' off"
cset "name='Line Out Playback Switch' off"
cset "name='Line Out Source Playback Route' Mono Differential"
cset "name='Mic1 Playback Switch' off"
cset "name='Mic2 Playback Switch' off"
cset "name='AIF1 DA0 Playback Volume' 160"
cset "name='AIF3 ADC Source Capture Route' None"
cset "name='AIF2 DAC Source Playback Route' AIF2"
cset "name='DAC Playback Switch' on"
cset "name='DAC Playback Volume' 160"
cset "name='ADC Digital DAC Playback Switch' off"
cset "name='AIF1 Slot 0 Digital DAC Playback Switch' on"
cset "name='AIF2 Digital DAC Playback Switch' off"
cset "name='DAC Reversed Playback Switch' off"
cset "name='Earpiece Playback Switch' off"
cset "name='Earpiece Source Playback Route' DACL"
cset "name='Line In Capture Switch' off"
cset "name='Mic1 Capture Switch' off"
cset "name='Mic1 Boost Volume' 7"
cset "name='Mic2 Capture Switch' off"
cset "name='Mic2 Boost Volume' 7"
cset "name='Mixer Capture Switch' off"
cset "name='Mixer Reversed Capture Switch' off"
cset "name='ADC Capture Volume' 160"
cset "name='ADC Gain Capture Volume' 7"
cset "name='AIF1 AD0 Capture Volume' 160"
cset "name='AIF1 Data Digital ADC Capture Switch' on"
cset "name='AIF2 ADC Mixer ADC Capture Switch' off"
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
cset "name='AIF2 ADC Mixer AIF2 DAC Rev Capture Switch' off"
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
]
DisableSequence [
]
Value {
}
}
SectionDevice."Speaker" {
Comment "Internal speaker"
EnableSequence [
cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
cset "name='Line Out Playback Switch' on"
cset "name='Line Out Playback Volume' 100%"
]
DisableSequence [
cset "name='Line Out Playback Switch' off"
]
Value {
PlaybackVolume "Line Out Playback Volume"
PlaybackSwitch "Line Out Playback Switch"
PlaybackChannels 2
PlaybackPriority 300
PlaybackPCM "hw:${CardId},0"
}
}
SectionDevice."Earpiece" {
Comment "Internal Earpiece"
EnableSequence [
cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
cset "name='Earpiece Playback Switch' on"
cset "name='Earpiece Playback Volume' 100%"
]
DisableSequence [
cset "name='Earpiece Playback Switch' off"
]
Value {
PlaybackVolume "Earpiece Playback Volume"
PlaybackSwitch "Earpiece Playback Switch"
PlaybackChannels 2
PlaybackPriority 200
PlaybackPCM "hw:${CardId},0"
}
}
SectionDevice."Mic" {
Comment "Internal Microphone"
ConflictingDevice [
"Headset"
]
EnableSequence [
cset "name='Mic1 Capture Switch' on"
]
DisableSequence [
cset "name='Mic1 Capture Switch' off"
]
Value {
CapturePriority 100
CapturePCM "hw:${CardId},0"
CaptureChannels 2
CaptureMixerElem "ADC"
CaptureVolume "ADC Capture Volume"
CaptureSwitch "Mic1 Capture Switch"
}
}
SectionDevice."Headset" {
Comment "Headset Microphone"
ConflictingDevice [
"Mic"
]
EnableSequence [
cset "name='Mic2 Capture Switch' on"
]
DisableSequence [
cset "name='Mic2 Capture Switch' off"
]
Value {
CapturePriority 500
CapturePCM "hw:${CardId},0"
CaptureChannels 2
CaptureMixerElem "ADC"
CaptureVolume "ADC Capture Volume"
CaptureSwitch "Mic2 Capture Switch"
JackControl "Headset Microphone Jack"
}
}
SectionDevice."Headphones" {
Comment "Headphones"
EnableSequence [
cset "name='AIF1 DA0 Stereo Playback Route' Stereo"
cset "name='Headphone Playback Switch' on"
cset "name='Headphone Playback Volume' 70%"
]
DisableSequence [
cset "name='Headphone Playback Switch' off"
]
Value {
PlaybackVolume "Headphone Playback Volume"
PlaybackSwitch "Headphone Playback Switch"
PlaybackChannels 2
PlaybackPriority 500
PlaybackPCM "hw:${CardId},0"
JackControl "Headphone Jack"
}
}

View File

@@ -0,0 +1,11 @@
Syntax 2
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Default"
}
SectionUseCase."Voice Call" {
File "VoiceCall.conf"
Comment "Phone call"
}

View File

@@ -0,0 +1,153 @@
SectionVerb {
EnableSequence [
cset "name='Headphone Playback Switch' off"
cset "name='Headphone Source Playback Route' DAC"
cset "name='Line In Playback Switch' off"
cset "name='Line Out Playback Switch' off"
cset "name='Line Out Source Playback Route' Mono Differential"
cset "name='Mic1 Playback Switch' off"
cset "name='Mic2 Playback Switch' off"
cset "name='AIF1 DA0 Playback Volume' 160"
cset "name='AIF2 DAC Playback Volume' 160"
cset "name='AIF3 ADC Source Capture Route' None"
cset "name='AIF2 DAC Source Playback Route' AIF2"
cset "name='DAC Playback Switch' on"
cset "name='DAC Playback Volume' 160"
cset "name='ADC Digital DAC Playback Switch' off"
cset "name='AIF1 Slot 0 Digital DAC Playback Switch' on"
cset "name='AIF2 Digital DAC Playback Switch' on"
cset "name='DAC Reversed Playback Switch' off"
cset "name='Earpiece Playback Switch' off"
cset "name='Earpiece Source Playback Route' DACL"
cset "name='Line In Capture Switch' off"
cset "name='Mic1 Capture Switch' off"
cset "name='Mic1 Boost Volume' 0"
cset "name='Mic1 Playback Volume' 7"
cset "name='Mic2 Capture Switch' off"
cset "name='Mic2 Boost Volume' 0"
cset "name='Mic2 Playback Volume' 7"
cset "name='Mixer Capture Switch' off"
cset "name='Mixer Reversed Capture Switch' off"
cset "name='ADC Capture Volume' 160"
cset "name='ADC Gain Capture Volume' 7"
cset "name='AIF1 AD0 Capture Volume' 160"
cset "name='AIF1 Data Digital ADC Capture Switch' on"
cset "name='AIF2 ADC Capture Volume' 160"
cset "name='AIF2 ADC Mixer ADC Capture Switch' on"
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
cset "name='AIF2 ADC Mixer AIF2 DAC Rev Capture Switch' off"
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
]
DisableSequence [
]
Value {
PlaybackRate 8000
}
}
SectionDevice."Speaker" {
Comment "Internal speaker"
EnableSequence [
cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
cset "name='Line Out Playback Switch' on"
cset "name='Line Out Playback Volume' 100%"
]
DisableSequence [
cset "name='Line Out Playback Switch' off"
]
Value {
PlaybackVolume "Line Out Playback Volume"
PlaybackSwitch "Line Out Playback Switch"
PlaybackChannels 2
PlaybackPriority 300
PlaybackPCM "hw:${CardId},0"
}
}
SectionDevice."Earpiece" {
Comment "Internal Earpiece"
EnableSequence [
cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
cset "name='Earpiece Playback Switch' on"
cset "name='Earpiece Playback Volume' 100%"
]
DisableSequence [
cset "name='Earpiece Playback Switch' off"
]
Value {
PlaybackVolume "Earpiece Playback Volume"
PlaybackSwitch "Earpiece Playback Switch"
PlaybackChannels 2
PlaybackPriority 500
PlaybackPCM "hw:${CardId},0"
}
}
SectionDevice."Mic" {
Comment "Internal Microphone"
ConflictingDevice [
"Headset"
]
EnableSequence [
cset "name='Mic1 Capture Switch' on"
]
DisableSequence [
cset "name='Mic1 Capture Switch' off"
]
Value {
CapturePriority 200
CapturePCM "hw:${CardId},0"
CaptureMixerElem "ADC"
CaptureVolume "ADC Capture Volume"
CaptureSwitch "Mic1 Capture Switch"
CaptureChannels 2
}
}
SectionDevice."Headset" {
Comment "Headset Microphone"
ConflictingDevice [
"Mic"
]
EnableSequence [
cset "name='Mic2 Capture Switch' on"
]
DisableSequence [
cset "name='Mic2 Capture Switch' off"
]
Value {
CapturePriority 500
CapturePCM "hw:${CardId},0"
CaptureChannels 2
CaptureMixerElem "ADC"
CaptureVolume "ADC Capture Volume"
CaptureSwitch "Mic2 Capture Switch"
JackControl "Headset Microphone Jack"
}
}
SectionDevice."Headphones" {
Comment "Headphones"
EnableSequence [
cset "name='AIF1 DA0 Stereo Playback Route' Stereo"
cset "name='Headphone Playback Switch' on"
cset "name='Headphone Playback Volume' 100%"
]
DisableSequence [
cset "name='Headphone Playback Switch' off"
]
Value {
PlaybackVolume "Headphone Playback Volume"
PlaybackSwitch "Headphone Playback Switch"
PlaybackChannels 2
PlaybackPriority 500
PlaybackPCM "hw:${CardId},0"
JackControl "Headphone Jack"
}
}

8
hosts/moby/ucm2/ucm.conf Normal file
View File

@@ -0,0 +1,8 @@
Syntax 3
UseCasePath {
legacy {
Directory "PinePhone"
File "PinePhone.conf"
}
}

16
hosts/rescue/default.nix Normal file
View File

@@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
imports = [
./fs.nix
];
boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
users.users.dhcpcd.uid = config.sane.allocations.dhcpcd-uid;
users.groups.dhcpcd.gid = config.sane.allocations.dhcpcd-gid;
# docs: https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion
system.stateVersion = "21.05";
}

12
hosts/rescue/fs.nix Normal file
View File

@@ -0,0 +1,12 @@
{ ... }:
{
fileSystems."/" = {
device = "/dev/disk/by-uuid/44445555-6666-7777-8888-999900001111";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/2222-3333";
fsType = "vfat";
};
}

View File

@@ -3,35 +3,23 @@
{
imports = [
./fs.nix
./hardware.nix
./net.nix
./users.nix
./services/ddns-he.nix
./services/gitea.nix
./services/ipfs.nix
./services/jackett.nix
./services/jellyfin.nix
./services/matrix.nix
./services/nginx.nix
./services/nix-serve.nix
./services/pleroma.nix
./services/postfix.nix
./services/postgres.nix
./services/transmission.nix
./services
];
colinsane.home-manager.enable = true;
colinsane.home-manager.extraPackages = [
sane.packages.extraUserPkgs = [
# for administering services
pkgs.matrix-synapse
pkgs.freshrss
];
colinsane.impermanence.enable = true;
colinsane.services.duplicity.enable = true;
sane.impermanence.enable = true;
# sane.services.duplicity.enable = true; # TODO: re-enable after HW upgrade
sane.services.nixserve.enable = true;
sane.services.nixserve.sopsFile = ../../secrets/servo.yaml;
# TODO: validate this
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
colinsane.image.extraBootFiles = [ pkgs.bootpart-u-boot-rpi-aarch64 ];
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
sops.secrets.duplicity_passphrase = {
sopsFile = ../../secrets/servo.yaml;
@@ -40,7 +28,7 @@
# both transmission and ipfs try to set different net defaults.
# we just use the most aggressive of the two here:
boot.kernel.sysctl = {
"net.core.rmem_max" = "4194304"; # 4MB
"net.core.rmem_max" = 4194304; # 4MB
};
# This value determines the NixOS release from which the default
@@ -49,6 +37,6 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
system.stateVersion = "21.11";
}

98
hosts/servo/fs.nix Normal file
View File

@@ -0,0 +1,98 @@
{ ... }:
{
# root is a tmpfs so that we have an ephemeral system ("impermanence" handles the state)
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [
"mode=755"
"size=1G"
"defaults"
];
};
# we need a /tmp for building large nix things
fileSystems."/tmp" = {
device = "none";
fsType = "tmpfs";
options = [
"mode=777"
"defaults"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/cc81cca0-3cc7-4d82-a00c-6243af3e7776";
fsType = "btrfs";
options = [
"compress=zstd"
"defaults"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6EE3-4171";
fsType = "vfat";
};
# slow, external storage (for archiving, etc)
fileSystems."/nix/persist/ext" = {
device = "/dev/disk/by-uuid/aa272cff-0fcc-498e-a4cb-0d95fb60631b";
fsType = "btrfs";
options = [
"compress=zstd"
"defaults"
];
};
sane.impermanence.service-dirs = [
# TODO: this is overly broad; only need media and share directories to be persisted
{ user = "colin"; group = "users"; directory = "/var/lib/uninsane"; }
];
# direct these media directories to external storage
environment.persistence."/nix/persist/ext/persist" = {
directories = [
({
user = "colin";
group = "users";
mode = "0777";
directory = "/var/lib/uninsane/media/Videos";
})
({
user = "colin";
group = "users";
mode = "0777";
directory = "/var/lib/uninsane/media/freeleech";
})
];
};
# in-memory compressed RAM (seems to be dynamically sized)
# zramSwap = {
# enable = true;
# };
# btrfs doesn't easily support swapfiles
# swapDevices = [
# { device = "/nix/persist/swapfile"; size = 4096; }
# ];
# this can be a partition. create with:
# fdisk <dev>
# n
# <default partno>
# <start>
# <end>
# t
# <partno>
# 19 # set part type to Linux swap
# w # write changes
# mkswap -L swap <part>
# swapDevices = [
# {
# label = "swap";
# # TODO: randomEncryption.enable = true;
# }
# ];
}

View File

@@ -13,6 +13,7 @@
# networking.firewall.enable = false;
networking.firewall.enable = true;
# TODO: split these into the submodules
networking.firewall.allowedTCPPorts = [
25 # SMTP
80 # HTTP

View File

@@ -0,0 +1,21 @@
{ ... }:
{
imports = [
./ddns-he.nix
./ejabberd.nix
./freshrss.nix
./gitea.nix
./goaccess.nix
./ipfs.nix
./jackett.nix
./jellyfin.nix
./matrix
./navidrome.nix
./nginx.nix
./pleroma.nix
./postfix.nix
./postgres.nix
./prosody.nix
./transmission.nix
];
}

View File

@@ -0,0 +1,48 @@
# docs:
# - <https://docs.ejabberd.im/admin/configuration/basic>
{ lib, ... }:
# XXX disabled: fails to start because of `mnesia_tm` dependency
# lib.mkIf false
{
sane.impermanence.service-dirs = [
{ user = "ejabberd"; group = "ejabberd"; directory = "/var/lib/ejabberd"; }
];
networking.firewall.allowedTCPPorts = [
5222 # XMPP client -> server
5269 # XMPP server -> server
];
# provide access to certs
users.users.ejabberd.extraGroups = [ "nginx" ];
# TODO: allocate UIDs/GIDs ?
services.ejabberd.enable = true;
services.ejabberd.configFile = builtins.toFile "ejabberd.yaml" ''
hosts:
- uninsane.org
# none | emergency | alert | critical | error | warning | notice | info | debug
loglevel: debug
acme:
auto: false
certfiles:
- /var/lib/acme/uninsane.org/fullchain.pem
- /var/lib/acme/uninsane.org/key.pem
pam_userinfotype: jid
# see: <https://docs.ejabberd.im/admin/configuration/listen/>
# TODO: host web admin panel
listen:
-
port: 5222
module: ejabberd_c2s
starttls: true
-
port: 5269
module: ejabberd_s2s_in
starttls: true
'';
}

View File

@@ -0,0 +1,52 @@
# import feeds with e.g.
# ```console
# $ nix build '.#nixpkgs.freshrss'
# $ sudo -u freshrss -g freshrss FRESHRSS_DATA_PATH=/var/lib/freshrss ./result/cli/import-for-user.php --user admin --filename /home/colin/.config/newsflashFeeds.opml
# ```
#
# export feeds with
# ```console
# $ sudo -u freshrss -g freshrss FRESHRSS_DATA_PATH=/var/lib/freshrss ./result/cli/export-opml-for-user.php --user admin
# ```
{ config, lib, pkgs, ... }:
{
sops.secrets.freshrss_passwd = {
sopsFile = ../../../secrets/servo.yaml;
owner = config.users.users.freshrss.name;
mode = "400";
};
sane.impermanence.service-dirs = [
{ user = "freshrss"; group = "freshrss"; directory = "/var/lib/freshrss"; }
];
users.users.freshrss.uid = config.sane.allocations.freshrss-uid;
users.groups.freshrss.gid = config.sane.allocations.freshrss-gid;
services.freshrss.enable = true;
services.freshrss.baseUrl = "https://rss.uninsane.org";
services.freshrss.virtualHost = "rss.uninsane.org";
services.freshrss.passwordFile = config.sops.secrets.freshrss_passwd.path;
systemd.services.freshrss-import-feeds =
let
fresh = config.systemd.services.freshrss-config;
feeds = import ../../../modules/home-manager/feeds.nix { inherit lib; };
opml = pkgs.writeText "sane-freshrss.opml" (feeds.feedsToOpml feeds.all);
in {
inherit (fresh) wantedBy environment;
serviceConfig = {
inherit (fresh.serviceConfig) Type User Group StateDirectory WorkingDirectory
# hardening options
CapabilityBoundingSet DeviceAllow LockPersonality NoNewPrivileges PrivateDevices PrivateTmp PrivateUsers ProcSubset ProtectClock ProtectControlGroups ProtectHome ProtectHostname ProtectKernelLogs ProtectKernelModules ProtectKernelTunables ProtectProc ProtectSystem RemoveIPC RestrictNamespaces RestrictRealtime RestrictSUIDSGID SystemCallArchitectures SystemCallFilter UMask;
};
description = "import sane RSS feed list";
after = [ "freshrss-config.service" ];
script = ''
${pkgs.freshrss}/cli/import-for-user.php --user admin --filename ${opml}
'';
};
# the default ("*:0/5") is to run every 5 minutes.
# `systemctl list-timers` to show
systemd.services.freshrss-updater.startAt = lib.mkForce "*:3/30";
}

View File

@@ -1,6 +1,11 @@
{ pkgs, lib, ... }:
{ config, pkgs, lib, ... }:
{
sane.impermanence.service-dirs = [
# TODO: mode? could be more granular
{ user = "git"; group = "gitea"; directory = "/var/lib/gitea"; }
];
users.groups.gitea.gid = config.sane.allocations.gitea-gid;
services.gitea.enable = true;
services.gitea.user = "git"; # default is 'gitea'
services.gitea.database.type = "postgres";
@@ -8,7 +13,7 @@
services.gitea.appName = "Perfectly Sane Git";
services.gitea.domain = "git.uninsane.org";
services.gitea.rootUrl = "https://git.uninsane.org/";
services.gitea.cookieSecure = true;
services.gitea.settings.session.COOKIE_SECURE = true;
# services.gitea.disableRegistration = true;
services.gitea.settings = {
@@ -55,7 +60,7 @@
};
};
# options: "Trace", "Debug", "Info", "Warn", "Error", "Critical"
services.gitea.log.level = "Info";
services.gitea.settings.log.LEVEL = "Warn";
systemd.services.gitea.serviceConfig = {
# nix default is AF_UNIX AF_INET AF_INET6.

View File

@@ -0,0 +1,45 @@
{ pkgs, ... }:
{
# based on <https://bytes.fyi/real-time-goaccess-reports-with-nginx/>
# log-format setting can be derived with this tool if custom:
# - <https://github.com/stockrt/nginx2goaccess>
# config options:
# - <https://github.com/allinurl/goaccess/blob/master/config/goaccess.conf>
systemd.services.goaccess = {
description = "GoAccess server monitoring";
serviceConfig = {
ExecStart = ''
${pkgs.goaccess}/bin/goaccess \
-f /var/log/nginx/public.log \
--log-format=VCOMBINED \
--real-time-html \
--html-refresh=30 \
--no-query-string \
--anonymize-ip \
--ignore-panel=HOSTS \
--ws-url=wss://sink.uninsane.org:443/ws \
--port=7890 \
-o /var/lib/uninsane/sink/index.html
'';
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Type = "simple";
Restart = "on-failure";
# hardening
WorkingDirectory = "/tmp";
NoNewPrivileges = true;
PrivateTmp = true;
ProtectHome = "read-only";
ProtectSystem = "strict";
SystemCallFilter = "~@clock @cpu-emulation @debug @keyring @memlock @module @mount @obsolete @privileged @reboot @resources @setuid @swap @raw-io";
ReadOnlyPaths = "/";
ReadWritePaths = [ "/proc/self" "/var/lib/uninsane/sink" ];
PrivateDevices = "yes";
ProtectKernelModules = "yes";
ProtectKernelTunables = "yes";
};
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
};
}

View File

@@ -0,0 +1,69 @@
# admin:
# - view stats:
# - sudo -u ipfs -g ipfs ipfs -c /var/lib/ipfs/ stats bw
# - sudo -u ipfs -g ipfs ipfs -c /var/lib/ipfs/ stats dht
# - sudo -u ipfs -g ipfs ipfs -c /var/lib/ipfs/ bitswap stat
# - number of open peer connections:
# - sudo -u ipfs -g ipfs ipfs -c /var/lib/ipfs/ swarm peers | wc -l
{ ... }:
{
sane.impermanence.service-dirs = [
# TODO: mode? could be more granular
{ user = "261"; group = "261"; directory = "/var/lib/ipfs"; }
];
# services.ipfs.enable = true;
services.kubo.localDiscovery = true;
services.kubo.settings = {
Addresses = {
Announce = [
# "/dns4/ipfs.uninsane.org/tcp/4001"
"/dns4/ipfs.uninsane.org/udp/4001/quic"
];
Swarm = [
# "/dns4/ipfs.uninsane.org/tcp/4001"
# "/ip4/0.0.0.0/tcp/4001"
"/dns4/ipfs.uninsane.org/udp/4001/quic"
"/ip4/0.0.0.0/udp/4001/quic"
];
};
Gateway = {
# the gateway can only be used to serve content already replicated on this host
NoFetch = true;
};
Swarm = {
ConnMgr = {
# maintain between LowWater and HighWater peer connections
# taken from: https://github.com/ipfs/ipfs-desktop/pull/2055
# defaults are 600-900: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmconnmgr
LowWater = 20;
HighWater = 40;
# default is 20s. i guess more grace period = less churn
GracePeriod = "1m";
};
ResourceMgr = {
# docs: https://github.com/libp2p/go-libp2p-resource-manager#resource-scopes
Enabled = true;
Limits = {
System = {
Conns = 196;
ConnsInbound = 128;
ConnsOutbound = 128;
FD = 512;
Memory = 1073741824; # 1GiB
Streams = 1536;
StreamsInbound = 1024;
StreamsOutbound = 1024;
};
};
};
Transports = {
Network = {
# disable TCP, force QUIC, for lighter resources
TCP = false;
QUIC = true;
};
};
};
};
}

View File

@@ -1,6 +1,10 @@
{ ... }:
{
sane.impermanence.service-dirs = [
# TODO: mode? we only need this to save Indexer creds ==> migrate to config?
{ user = "root"; group = "root"; directory = "/var/lib/jackett"; }
];
services.jackett.enable = true;
systemd.services.jackett.after = ["wg0veth.service"];

View File

@@ -0,0 +1,14 @@
{ config, ... }:
{
sane.impermanence.service-dirs = [
# TODO: mode? could be more granular
{ user = "jellyfin"; group = "jellyfin"; directory = "/var/lib/jellyfin"; }
];
# users.users.jellyfin.uid = config.sane.allocations.jellyfin-uid;
# users.groups.jellyfin.gid = config.sane.allocations.jellyfin-gid;
# TODO: re-enable after migrating media dir to /var/lib/uninsane/media
# else it's too spammy
# services.jellyfin.enable = true;
}

View File

@@ -0,0 +1,85 @@
# docs: https://nixos.wiki/wiki/Matrix
# docs: https://nixos.org/manual/nixos/stable/index.html#module-services-matrix-synapse
{ config, lib, ... }:
{
imports = [
./discord-puppet.nix
# ./irc.nix
];
sane.impermanence.service-dirs = [
{ user = "matrix-synapse"; group = "matrix-synapse"; directory = "/var/lib/matrix-synapse"; }
];
services.matrix-synapse.enable = true;
services.matrix-synapse.settings.log_config = ./synapse-log_level.yaml;
services.matrix-synapse.settings.server_name = "uninsane.org";
# services.matrix-synapse.enable_registration_captcha = true;
# services.matrix-synapse.enable_registration_without_verification = true;
services.matrix-synapse.settings.enable_registration = true;
# services.matrix-synapse.registration_shared_secret = "<shared key goes here>";
# default for listeners is port = 8448, tls = true, x_forwarded = false.
# we change this because the server is situated behind nginx.
services.matrix-synapse.settings.listeners = [
{
port = 8008;
bind_addresses = [ "127.0.0.1" ];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = [ "client" "federation" ];
compress = false;
}
];
}
];
services.matrix-synapse.settings.admin_contact = "admin.matrix@uninsane.org";
services.matrix-synapse.settings.registrations_require_3pid = [ "email" ];
services.matrix-synapse.extraConfigFiles = [
config.sops.secrets.matrix_synapse_secrets.path
];
# services.matrix-synapse.extraConfigFiles = [builtins.toFile "matrix-synapse-extra-config" ''
# admin_contact: "admin.matrix@uninsane.org"
# registrations_require_3pid:
# - email
# email:
# smtp_host: "mx.uninsane.org"
# smtp_port: 587
# smtp_user: "matrix-synapse"
# smtp_pass: "${secrets.matrix-synapse.smtp_pass}"
# require_transport_security: true
# enable_tls: true
# notif_from: "%(app)s <notify.matrix@uninsane.org>"
# app_name: "Uninsane Matrix"
# enable_notifs: true
# validation_token_lifetime: 96h
# invite_client_location: "https://web.matrix.uninsane.org"
# subjects:
# email_validation: "[%(server_name)s] Validate your email"
# ''];
# new users may be registered on the CLI:
# register_new_matrix_user -c /nix/store/8n6kcka37jhmi4qpd2r03aj71pkyh21s-homeserver.yaml http://localhost:8008
#
# or provide an registration token then can use to register through the client.
# docs: https://github.com/matrix-org/synapse/blob/develop/docs/usage/administration/admin_api/registration_tokens.md
# first, grab your own user's access token (Help & About section in Element). then:
# curl --header "Authorization: Bearer <my_token>" localhost:8008/_synapse/admin/v1/registration_tokens
# create a token with unlimited uses:
# curl -d '{}' --header "Authorization: Bearer <my_token>" localhost:8008/_synapse/admin/v1/registration_tokens/new
# create a token with limited uses:
# curl -d '{ "uses_allowed": 1 }' --header "Authorization: Bearer <my_token>" localhost:8008/_synapse/admin/v1/registration_tokens/new
sops.secrets.matrix_synapse_secrets = {
sopsFile = ../../../../secrets/servo.yaml;
owner = config.users.users.matrix-synapse.name;
};
}

View File

@@ -0,0 +1,52 @@
{ lib, ... }:
{
sane.impermanence.service-dirs = [
{ user = "matrix-synapse"; group = "matrix-synapse"; directory = "/var/lib/mx-puppet-discord"; }
];
services.matrix-synapse.settings.app_service_config_files = [
# auto-created by mx-puppet-discord service
"/var/lib/mx-puppet-discord/discord-registration.yaml"
];
services.mx-puppet-discord.enable = true;
# schema/example: <https://gitlab.com/mx-puppet/discord/mx-puppet-discord/-/blob/main/sample.config.yaml>
services.mx-puppet-discord.settings = {
bridge = {
# port = 8434
bindAddress = "127.0.0.1";
domain = "uninsane.org";
homeserverUrl = "http://127.0.0.1:8008";
# displayName = "mx-discord-puppet"; # matrix name for the bot
# matrix "groups" were an earlier version of spaces.
# maybe the puppet understands this, maybe not?
enableGroupSync = false;
};
presence = {
enabled = false;
interval = 30000;
};
provisioning = {
# allow these users to control the puppet
whitelist = [ "@colin:uninsane\\.org" ];
};
relay = {
whitelist = [ "@colin:uninsane\\.org" ];
};
selfService = {
# who's allowed to use plumbed rooms (idk what that means)
whitelist = [ "@colin:uninsane\\.org" ];
};
logging = {
# silly, debug, verbose, info, warn, error
console = "debug";
};
};
systemd.services.mx-puppet-discord.serviceConfig = {
# fix up to not use /var/lib/private, but just /var/lib
DynamicUser = lib.mkForce false;
User = "matrix-synapse";
Group = "matrix-synapse";
};
}

View File

@@ -1,80 +1,19 @@
# docs: https://nixos.wiki/wiki/Matrix
# docs: https://nixos.org/manual/nixos/stable/index.html#module-services-matrix-synapse
{ config, ... }:
{ config, lib, ... }:
{
services.matrix-synapse.enable = true;
services.matrix-synapse.settings.server_name = "uninsane.org";
# services.matrix-synapse.enable_registration_captcha = true;
# services.matrix-synapse.enable_registration_without_verification = true;
services.matrix-synapse.settings.enable_registration = true;
# services.matrix-synapse.registration_shared_secret = "<shared key goes here>";
# default for listeners is port = 8448, tls = true, x_forwarded = false.
# we change this because the server is situated behind nginx.
services.matrix-synapse.settings.listeners = [
{
port = 8008;
bind_addresses = [ "127.0.0.1" ];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = [ "client" "federation" ];
compress = false;
}
];
}
sane.impermanence.service-dirs = [
# TODO: mode?
# user and group are both "matrix-appservice-irc"
{ user = "993"; group = "992"; directory = "/var/lib/matrix-appservice-irc"; }
];
services.matrix-synapse.settings.admin_contact = "admin.matrix@uninsane.org";
services.matrix-synapse.settings.registrations_require_3pid = [ "email" ];
services.matrix-synapse.extraConfigFiles = [
config.sops.secrets.matrix_synapse_secrets.path
];
# services.matrix-synapse.extraConfigFiles = [builtins.toFile "matrix-synapse-extra-config" ''
# admin_contact: "admin.matrix@uninsane.org"
# registrations_require_3pid:
# - email
# email:
# smtp_host: "mx.uninsane.org"
# smtp_port: 587
# smtp_user: "matrix-synapse"
# smtp_pass: "${secrets.matrix-synapse.smtp_pass}"
# require_transport_security: true
# enable_tls: true
# notif_from: "%(app)s <notify.matrix@uninsane.org>"
# app_name: "Uninsane Matrix"
# enable_notifs: true
# validation_token_lifetime: 96h
# invite_client_location: "https://web.matrix.uninsane.org"
# subjects:
# email_validation: "[%(server_name)s] Validate your email"
# ''];
services.matrix-synapse.settings.app_service_config_files = [
"/var/lib/matrix-appservice-irc/registration.yml" # auto-created by irc appservice
];
# new users may be registered on the CLI:
# register_new_matrix_user -c /nix/store/8n6kcka37jhmi4qpd2r03aj71pkyh21s-homeserver.yaml http://localhost:8008
#
# or provide an registration token then can use to register through the client.
# docs: https://github.com/matrix-org/synapse/blob/develop/docs/usage/administration/admin_api/registration_tokens.md
# first, grab your own user's access token (Help & About section in Element). then:
# curl --header "Authorization: Bearer <my_token>" localhost:8008/_synapse/admin/v1/registration_tokens
# create a token with unlimited uses:
# curl -d '{}' --header "Authorization: Bearer <my_token>" localhost:8008/_synapse/admin/v1/registration_tokens/new
# create a token with limited uses:
# curl -d '{ "uses_allowed": 1 }' --header "Authorization: Bearer <my_token>" localhost:8008/_synapse/admin/v1/registration_tokens/new
# IRC bridging
# note: Rizon allows only FOUR simultaneous IRC connections per IP: https://wiki.rizon.net/index.php?title=Connection/Session_Limit_Exemptions
# Rizon supports CertFP for auth: https://wiki.rizon.net/index.php?title=CertFP
# services.matrix-appservice-irc.enable = true;
services.matrix-appservice-irc.enable = true;
services.matrix-appservice-irc.registrationUrl = "http://127.0.0.1:8009";
# settings documented here: https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml
services.matrix-appservice-irc.settings = {
@@ -155,9 +94,4 @@
};
};
};
sops.secrets.matrix_synapse_secrets = {
sopsFile = ../../../secrets/servo.yaml;
owner = config.users.users.matrix-synapse.name;
};
}

View File

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

View File

@@ -0,0 +1,17 @@
{ ... }:
{
sane.impermanence.service-dirs = [
{ user = "navidrome"; group = "navidrome"; directory = "/var/lib/private/navidrome"; }
];
services.navidrome.enable = true;
services.navidrome.settings = {
# docs: https://www.navidrome.org/docs/usage/configuration-options/
Address = "127.0.0.1";
Port = 4533;
MusicFolder = "/var/lib/uninsane/media/Music";
CovertArtPriority = "*.jpg, *.JPG, *.png, *.PNG, embedded";
AutoImportPlaylists = false;
ScanSchedule = "@every 1h";
};
}

View File

@@ -1,17 +1,54 @@
# docs: https://nixos.wiki/wiki/Nginx
{ config, pkgs, ... }:
let
# make the logs for this host "public" so that they show up in e.g. metrics
publog = vhost: vhost // {
extraConfig = (vhost.extraConfig or "") + ''
access_log /var/log/nginx/public.log vcombined;
'';
};
kTLS = true; # in-kernel TLS for better perf
in
{
services.nginx.enable = true;
services.nginx.appendConfig = ''
# use 1 process per core.
# may want to increase worker_connections too, but `ulimit -n` must be increased first.
worker_processes auto;
'';
# this is the standard `combined` log format, with the addition of $host
# so that we have the virtualHost in the log.
# KEEP IN SYNC WITH GOACCESS
# goaccess calls this VCOMBINED:
# - <https://gist.github.com/jyap808/10570005>
services.nginx.commonHttpConfig = ''
log_format vcombined '$host:$server_port $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referrer" "$http_user_agent"';
access_log /var/log/nginx/private.log vcombined;
'';
# sets gzip_comp_level = 5
services.nginx.recommendedGzipSettings = true;
# enables OCSP stapling (so clients don't need contact the OCSP server -- i do instead)
# caches TLS sessions for 10m
services.nginx.recommendedTlsSettings = true;
# enables sendfile, tcp_nopush, tcp_nodelay, keepalive_timeout 65
services.nginx.recommendedOptimisation = true;
# web blog/personal site
services.nginx.virtualHosts."uninsane.org" = {
root = "/var/lib/uninsane/root";
services.nginx.virtualHosts."uninsane.org" = publog {
root = "${pkgs.uninsane-dot-org}/share/uninsane-dot-org";
# a lot of places hardcode https://uninsane.org,
# and then when we mix http + non-https, we get CORS violations
# and things don't look right. so force SSL.
forceSSL = true;
enableACME = true;
inherit kTLS;
# uninsane.org/share/foo => /var/lib/uninsane/root/share/foo.
# yes, nginx does not strip the prefix when evaluating against the root.
locations."/share".root = "/var/lib/uninsane/root";
# allow matrix users to discover that @user:uninsane.org is reachable via matrix.uninsane.org
locations."= /.well-known/matrix/server".extraConfig =
@@ -53,10 +90,32 @@
# };
};
# Pleroma server and web interface
services.nginx.virtualHosts."fed.uninsane.org" = {
# server statistics
services.nginx.virtualHosts."sink.uninsane.org" = {
addSSL = true;
enableACME = true;
inherit kTLS;
root = "/var/lib/uninsane/sink";
locations."/ws" = {
proxyPass = "http://127.0.0.1:7890";
# XXX not sure how much of this is necessary
extraConfig = ''
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
proxy_read_timeout 7d;
'';
};
};
# Pleroma server and web interface
services.nginx.virtualHosts."fed.uninsane.org" = publog {
forceSSL = true; # pleroma redirects to https anyway
enableACME = true;
inherit kTLS;
locations."/" = {
proxyPass = "http://127.0.0.1:4000";
# documented: https://git.pleroma.social/pleroma/pleroma/-/blob/develop/installation/pleroma.nginx
@@ -98,6 +157,7 @@
# basicAuth is literally cleartext user/pw, so FORCE this to happen over SSL
forceSSL = true;
enableACME = true;
inherit kTLS;
locations."/" = {
# proxyPass = "http://ovpns.uninsane.org:9091";
proxyPass = "http://10.0.1.6:9091";
@@ -108,6 +168,7 @@
services.nginx.virtualHosts."jackett.uninsane.org" = {
forceSSL = true;
enableACME = true;
inherit kTLS;
locations."/" = {
# proxyPass = "http://ovpns.uninsane.org:9117";
proxyPass = "http://10.0.1.6:9117";
@@ -115,9 +176,10 @@
};
# matrix chat server
services.nginx.virtualHosts."matrix.uninsane.org" = {
services.nginx.virtualHosts."matrix.uninsane.org" = publog {
addSSL = true;
enableACME = true;
inherit kTLS;
# TODO colin: replace this with something helpful to the viewer
# locations."/".extraConfig = ''
@@ -144,6 +206,7 @@
services.nginx.virtualHosts."web.matrix.uninsane.org" = {
forceSSL = true;
enableACME = true;
inherit kTLS;
root = pkgs.element-web.override {
conf = {
@@ -156,9 +219,10 @@
};
# hosted git (web view and for `git <cmd>` use
services.nginx.virtualHosts."git.uninsane.org" = {
addSSL = true;
services.nginx.virtualHosts."git.uninsane.org" = publog {
forceSSL = true; # gitea complains if served over a different protocol than its config file says
enableACME = true;
inherit kTLS;
locations."/" = {
proxyPass = "http://127.0.0.1:3000";
@@ -170,6 +234,7 @@
services.nginx.virtualHosts."jelly.uninsane.org" = {
addSSL = true;
enableACME = true;
inherit kTLS;
locations."/" = {
proxyPass = "http://127.0.0.1:8096";
@@ -213,11 +278,26 @@
};
};
services.nginx.virtualHosts."music.uninsane.org" = {
forceSSL = true;
enableACME = true;
inherit kTLS;
locations."/".proxyPass = "http://127.0.0.1:4533";
};
services.nginx.virtualHosts."rss.uninsane.org" = {
addSSL = true;
enableACME = true;
inherit kTLS;
# the routing is handled by freshrss.nix
};
services.nginx.virtualHosts."ipfs.uninsane.org" = {
# don't default to ssl upgrades, since this may be dnslink'd from a different domain.
# ideally we'd disable ssl entirely, but some places assume it?
addSSL = true;
enableACME = true;
inherit kTLS;
default = true;
@@ -243,6 +323,7 @@
services.nginx.virtualHosts."nixcache.uninsane.org" = {
addSSL = true;
enableACME = true;
inherit kTLS;
# serverAliases = [ "nixcache" ];
locations."/".extraConfig = ''
proxy_pass http://localhost:${toString config.services.nix-serve.port};
@@ -254,4 +335,11 @@
security.acme.acceptTerms = true;
security.acme.defaults.email = "admin.acme@uninsane.org";
users.users.acme.uid = config.sane.allocations.acme-uid;
users.groups.acme.gid = config.sane.allocations.acme-gid;
sane.impermanence.service-dirs = [
# TODO: mode?
{ user = "acme"; group = "acme"; directory = "/var/lib/acme"; }
];
}

View File

@@ -1,21 +1,29 @@
# docs: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/pleroma.nix
# docs:
# - https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/pleroma.nix
# - https://docs.pleroma.social/backend/configuration/cheatsheet/
#
# to run it in a oci-container: https://github.com/barrucadu/nixfiles/blob/master/services/pleroma.nix
{ config, pkgs, ... }:
{
sane.impermanence.service-dirs = [
# TODO: mode? could be more granular
{ user = "pleroma"; group = "pleroma"; directory = "/var/lib/pleroma"; }
];
users.users.pleroma.uid = config.sane.allocations.pleroma-uid;
users.groups.pleroma.gid = config.sane.allocations.pleroma-gid;
services.pleroma.enable = true;
services.pleroma.secretConfigFile = config.sops.secrets.pleroma_secrets.path;
services.pleroma.configs = [
''
import Config
config :pleroma, Pleroma.Web.Endpoint,
url: [host: "fed.uninsane.org", scheme: "https", port: 443],
http: [ip: {127, 0, 0, 1}, port: 4000]
# secret_key_base: "{secrets.pleroma.secret_key_base}",
# signing_salt: "{secrets.pleroma.signing_salt}"
config :pleroma, :instance,
name: "Perfectly Sane",
description: "Single-user Pleroma instance",
@@ -41,17 +49,20 @@
enabled: false,
redirect_on_failure: true
#base_url: "https://cache.pleroma.social"
# see for reference:
# - `force_custom_plan`: <https://docs.pleroma.social/backend/configuration/postgresql/#disable-generic-query-plans>
config :pleroma, Pleroma.Repo,
adapter: Ecto.Adapters.Postgres,
username: "pleroma",
database: "pleroma",
hostname: "localhost",
pool_size: 10,
prepare: :named,
parameters: [
plan_cache_mode: "force_custom_plan"
]
# XXX: prepare: :named is needed only for PG <= 12
# prepare: :named,
# password: "{secrets.pleroma.db_password}",
# Configure web push notifications
@@ -61,16 +72,17 @@
# private_key: "{secrets.pleroma.vapid_private_key}"
# config :joken, default_signer: "{secrets.pleroma.joken_default_signer}"
config :pleroma, :database, rum_enabled: false
config :pleroma, :instance, static_dir: "/var/lib/pleroma/instance/static"
config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads"
config :pleroma, configurable_from_database: false
# strip metadata from uploaded images
config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.Exiftool]
config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.Exiftool.StripLocation]
# TODO: GET /api/pleroma/captcha is broken
# there was a nixpkgs PR to fix this around 2022/10 though.
config :pleroma, Pleroma.Captcha,
enabled: false,
method: Pleroma.Captcha.Native
@@ -80,11 +92,11 @@
# Enable Strict-Transport-Security once SSL is working:
config :pleroma, :http_security,
sts: true
# docs: https://docs.pleroma.social/backend/configuration/cheatsheet/#logger
config :logger,
backends: [{ExSyslogger, :ex_syslogger}]
config :logger, :ex_syslogger,
level: :warn
# level: :debug
@@ -103,9 +115,9 @@
systemd.services.pleroma.path = [
# something inside pleroma invokes `sh` w/o specifying it by path, so this is needed to allow pleroma to start
pkgs.bash
pkgs.bash
# used by Pleroma to strip geo tags from uploads
pkgs.exiftool
pkgs.exiftool
# i saw some errors when pleroma was shutting down about it not being able to find `awk`. probably not critical
pkgs.gawk
# needed for email operations like password reset

View File

@@ -16,6 +16,15 @@ let
};
in
{
sane.impermanence.service-dirs = [
# TODO: mode? could be more granular
{ user = "opendkim"; group = "opendkim"; directory = "/var/lib/opendkim"; }
{ user = "root"; group = "root"; directory = "/var/lib/postfix"; }
{ user = "root"; group = "root"; directory = "/var/spool/mail"; }
# *probably* don't need these dirs:
# "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix
# "/var/lib/dovecot"
];
services.postfix.enable = true;
services.postfix.hostname = "mx.uninsane.org";
services.postfix.origin = "uninsane.org";

View File

@@ -1,6 +1,10 @@
{ ... }:
{
sane.impermanence.service-dirs = [
# TODO: mode?
{ user = "postgres"; group = "postgres"; directory = "/var/lib/postgresql"; }
];
services.postgresql.enable = true;
# services.postgresql.dataDir = "/opt/postgresql/13";
# XXX colin: for a proper deploy, we'd want to include something for Pleroma here too.
@@ -13,6 +17,11 @@
# LC_CTYPE = "C";
# '';
# TODO: perf tuning
# - for recommended values see: <https://pgtune.leopard.in.ua/>
# - for official docs (sparse), see: <https://www.postgresql.org/docs/11/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
# services.postgresql.settings = { ... }
# daily backups to /var/backup
services.postgresqlBackup.enable = true;

View File

@@ -0,0 +1,62 @@
# create users with:
# - `sudo -u prosody prosodyctl adduser colin@uninsane.org`
{ lib, ... }:
# XXX disabled: doesn't send messages to nixnet.social (only receives them).
# nixnet runs ejabberd, so revisiting that.
lib.mkIf false
{
sane.impermanence.service-dirs = [
{ user = "prosody"; group = "prosody"; directory = "/var/lib/prosody"; }
];
networking.firewall.allowedTCPPorts = [
5222 # XMPP client -> server
5269 # XMPP server -> server
5280 # Prosody HTTP port (necessary?)
5281 # Prosody HTTPS port (necessary?)
];
# provide access to certs
users.users.prosody.extraGroups = [ "nginx" ];
security.acme.certs."uninsane.org".extraDomainNames = [
"conference.xmpp.uninsane.org"
"upload.xmpp.uninsane.org"
];
services.prosody = {
enable = true;
admins = [ "colin@uninsane.org" ];
# allowRegistration = false;
# extraConfig = ''
# s2s_require_encryption = true
# c2s_require_encryption = true
# '';
# extraModules = [ "private" "vcard" "privacy" "compression" "component" "muc" "pep" "adhoc" "lastactivity" "admin_adhoc" "blocklist"];
ssl.cert = "/var/lib/acme/uninsane.org/fullchain.pem";
ssl.key = "/var/lib/acme/uninsane.org/key.pem";
muc = [
{
domain = "conference.xmpp.uninsane.org";
}
];
uploadHttp.domain = "upload.xmpp.uninsane.org";
virtualHosts = {
localhost = {
domain = "localhost";
enabled = true;
};
"uninsane.org" = {
domain = "uninsane.org";
enabled = true;
ssl.cert = "/var/lib/acme/uninsane.org/fullchain.pem";
ssl.key = "/var/lib/acme/uninsane.org/key.pem";
};
};
};
}

View File

@@ -1,6 +1,10 @@
{ ... }:
{
sane.impermanence.service-dirs = [
# TODO: mode? we need this specifically for the stats tracking in .config/
{ user = "transmission"; group = "transmission"; directory = "/var/lib/transmission"; }
];
services.transmission.enable = true;
services.transmission.settings = {
rpc-bind-address = "0.0.0.0";
@@ -29,6 +33,9 @@
# see: https://git.zknt.org/mirror/transmission/commit/cfce6e2e3a9b9d31a9dafedd0bdc8bf2cdb6e876?lang=bg-BG
anti-brute-force-enabled = false;
download-dir = "/var/lib/uninsane/media";
incomplete-dir = "/var/lib/uninsane/media/incomplete";
};
# transmission will by default not allow the world to read its files.
services.transmission.downloadDirPermissions = "775";
@@ -37,6 +44,7 @@
systemd.services.transmission.serviceConfig = {
# run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns";
LogLevelMax = "warning";
};
}

View File

@@ -1,4 +1,4 @@
{ ... }:
{ config, ... }:
# installer docs: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/installation-device.nix
{
@@ -12,6 +12,7 @@
home = "/var/lib/gitea";
useDefaultShell = true;
group = "gitea";
uid = config.sane.allocations.git-uid;
isSystemUser = true;
# sendmail access (not 100% sure if this is necessary)
extraGroups = [ "postdrop" ];

View File

@@ -1,57 +0,0 @@
{ pkgs, mobile-nixos, ... }:
{
imports = [
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
./firmware.nix
./fs.nix
];
# XXX colin: phosh doesn't work well with passwordless login
users.users.colin.initialPassword = "147147";
colinsane.home-manager.extraPackages = [
# for web browsers see: https://forum.pine64.org/showthread.php?tid=13669
pkgs.angelfish # plasma mobile web browser; broken on phosh (poor wayland support)
# pkgs.plasma5Packages.index # file browser
pkgs.plasma5Packages.konsole # terminal
# pkgs.plasma5Packages.pix # picture viewer
pkgs.plasma5Packages.kalk # calculator; broken on phosh
# pkgs.plasma5Packages.buho # (plasma mobile?) note application
pkgs.plasma5Packages.kasts # podcast app; works on phosh after setting QT envar
pkgs.plasma5Packages.koko # image gallery; broken on phosh
pkgs.plasma5Packages.kwave # media player.
# pkgs.plasma5Packages.neochat # matrix client. needs qcoro => no aarch64 support
# pkgs.plasma5Packages.plasma-dialer # phone dialer
# pkgs.plasma5Packages.plasma-mobile # the whole shebang?
# pkgs.plasma5Packages.plasma-settings
pkgs.plasma5Packages.bomber # arcade game; broken on phosh
pkgs.plasma5Packages.kapman # pacman
pkgs.w3m # text-based web browser; works!
pkgs.st # suckless terminal; broken on phosh
# pkgs.alacritty # terminal; crashes phosh
];
colinsane.nixcache.enable = true;
colinsane.gui.phosh.enable = true;
boot.loader.grub.enable = false;
mobile.bootloader.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
# defined: https://www.freedesktop.org/software/systemd/man/machine-info.html
# XXX colin: not sure which, if any, software makes use of this
environment.etc."machine-info".text = ''
CHASSIS="handset"
'';
# enable rotation sensor
hardware.sensor.iio.enable = true;
}

View File

@@ -1,79 +0,0 @@
{ ... }:
{
# root is a tmpfs so that we have an ephemeral system ("impermanence" handles the state)
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [
"mode=755"
"size=1G"
"defaults"
];
};
# we need a /tmp for building large nix things
fileSystems."/tmp" = {
device = "none";
fsType = "tmpfs";
options = [
"size=16G"
"mode=777"
"defaults"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/aa272cff-0fcc-498e-a4cb-0d95fb60631b";
fsType = "btrfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/31D3-40CB";
fsType = "vfat";
};
# fileSystems."/var/lib/pleroma" = {
# device = "/opt/pleroma";
# options = [ "bind" ];
# };
# TODO: does transmission handle symlinks?
fileSystems."/var/lib/transmission/Downloads" = {
device = "/var/lib/uninsane/media";
options = [ "bind" ];
};
fileSystems."/var/lib/transmission/.incomplete" = {
device = "/var/lib/uninsane/media/incomplete";
options = [ "bind" ];
};
# in-memory compressed RAM (seems to be dynamically sized)
zramSwap = {
enable = true;
};
# btrfs doesn't easily support swapfiles
# swapDevices = [
# { device = "/nix/persist/swapfile"; size = 4096; }
# ];
# this can be a partition. create with:
# fdisk <dev>
# n
# <default partno>
# <start>
# <end>
# t
# <partno>
# 19 # set part type to Linux swap
# w # write changes
# mkswap -L swap <part>
swapDevices = [
{
label = "swap";
# TODO: randomEncryption.enable = true;
}
];
}

View File

@@ -1,88 +0,0 @@
# this file originates from nixos-generate-config
# but has been heavily modified
{ pkgs, ... }:
{
# enables non-free firmware
hardware.enableRedistributableFirmware = true;
# i changed this becuse linux 5.10 didn't have rpi-400 device tree blob.
# nixos-22.05 linux 5.15 DOES have these now.
# it should be possible to remove this if desired, but i'm not sure how the rpi-specific kernel differs.
# see: https://github.com/raspberrypi/linux
boot.kernelPackages = pkgs.linuxPackages_rpi4;
# raspberryPi boot loader creates extlinux.conf.
# otherwise, enable the generic-extlinux-compatible loader below.
# note: THESE ARE MUTUALLY EXCLUSIVE. generic-extlinux-compatible causes uboot to not be built
boot.initrd.availableKernelModules = [
"bcm2711_thermal"
"bcm_phy_lib"
"brcmfmac"
"brcmutil"
"broadcom"
"clk_raspberrypi"
"drm" # Direct Render Manager
"enclosure" # SCSI ?
"fuse"
"mdio_bcm_unimac"
"pcie_brcmstb"
"raspberrypi_cpufreq"
"raspberrypi_hwmon"
"ses" # SCSI Enclosure Services
"uas" # USB attached storage
"uio" # userspace IO
"uio_pdrv_genirq"
"xhci_pci"
"xhci_pci_renesas"
];
# boot.initrd.compressor = "gzip"; # defaults to zstd
# hack in the `boot.shell_on_fail` arg since it doesn't seem to work otherwise
boot.initrd.preFailCommands = "allowShell=1";
# default: 4 (warn). 7 is debug
boot.consoleLogLevel = 7;
# boot.kernelParams = [
# "boot.shell_on_fail"
# # "boot.trace"
# # "systemd.log_level=debug"
# # "systemd.log_target=console"
# ];
# ondemand power scaling keeps the cpu at low frequency when idle, and sets to max frequency
# when load is detected. (v.s. the "performance" default, which always uses the max frequency)
powerManagement.cpuFreqGovernor = "ondemand";
# XXX colin: this allows one to `systemctl halt` and then not remove power until the HDD has spun down.
# however, it doesn't work with reboot because systemd will spin the drive up again to read its reboot bin.
# a better solution would be to put the drive behind a powered USB hub (or get a SSD).
# systemd.services.diskguard = {
# description = "Safely power off spinning media";
# before = [ "shutdown.target" ];
# wantedBy = [ "sysinit.target" ];
# # old (creates dep loop, but works)
# # before = [ "systemd-remount-fs.service" "shutdown.target" ];
# # wantedBy = [ "systemd-remount-fs.service" ];
# serviceConfig = {
# Type = "oneshot";
# RemainAfterExit = true;
# ExecStart = "${pkgs.coreutils}/bin/true";
# ExecStop = with pkgs; writeScript "diskguard" ''
# #!${bash}/bin/bash
# if ${procps}/bin/pgrep nixos-rebuild ;
# then
# exit 0 # don't halt drives unless we're actually shutting down. maybe better way to do this (check script args?)
# fi
# # ${coreutils}/bin/sync
# # ${util-linux}/bin/mount -o remount,ro /nix/store
# # ${util-linux}/bin/mount -o remount,ro /
# # -S 1 retracts the spindle after 5 seconds of idle
# # -B 1 spins down the drive after <vendor specific duration>
# ${hdparm}/sbin/hdparm -S 1 -B 1 /dev/sda
# # TODO: monitor smartmonctl until disk is idle? or try hdparm -Y
# # ${coreutils}/bin/sleep 20
# # exec ${util-linux}/bin/umount --all -t ext4,vfat,ext2
# '';
# };
# };
}

View File

@@ -1,23 +0,0 @@
{ ... }:
{
services.ipfs.enable = true;
services.ipfs.localDiscovery = true;
services.ipfs.swarmAddress = [
"/dns4/ipfs.uninsane.org/tcp/4001"
"/ip4/0.0.0.0/tcp/4001"
"/dns4/ipfs.uninsane.org/udp/4001/quic"
"/ip4/0.0.0.0/udp/4001/quic"
];
services.ipfs.extraConfig = {
Addresses = {
Announce = [
"/dns4/ipfs.uninsane.org/tcp/4001"
"/dns4/ipfs.uninsane.org/udp/4001/quic"
];
};
Gateway = {
# the gateway can only be used to serve content already replicated on this host
NoFetch = true;
};
};
}

View File

@@ -1,5 +0,0 @@
{ ... }:
{
services.jellyfin.enable = true;
}

View File

@@ -1,15 +0,0 @@
# docs: https://nixos.wiki/wiki/Binary_Cache
# to copy something to this machine's nix cache, do:
# nix copy --to ssh://nixcache.uninsane.org PACKAGE
{ config, ... }:
{
services.nix-serve = {
enable = true;
secretKeyFile = config.sops.secrets.nix_serve_privkey.path;
};
sops.secrets.nix_serve_privkey = {
sopsFile = ../../../secrets/servo.yaml;
};
}

61
modules/allocations.nix Normal file
View File

@@ -0,0 +1,61 @@
{ lib, ... }:
with lib;
let
mkId = id: mkOption {
default = id;
type = types.int;
};
in
{
options = {
# legacy servo users, some are inconvenient to migrate
sane.allocations.dhcpcd-gid = mkId 991;
sane.allocations.dhcpcd-uid = mkId 992;
sane.allocations.gitea-gid = mkId 993;
sane.allocations.git-uid = mkId 994;
sane.allocations.jellyfin-gid = mkId 994;
sane.allocations.pleroma-gid = mkId 995;
sane.allocations.jellyfin-uid = mkId 996;
sane.allocations.acme-gid = mkId 996;
sane.allocations.pleroma-uid = mkId 997;
sane.allocations.acme-uid = mkId 998;
sane.allocations.greeter-uid = mkId 999;
sane.allocations.greeter-gid = mkId 999;
sane.allocations.freshrss-uid = mkId 2401;
sane.allocations.freshrss-gid = mkId 2401;
sane.allocations.colin-uid = mkId 1000;
sane.allocations.guest-uid = mkId 1100;
# found on all hosts
sane.allocations.sshd-uid = mkId 2001; # 997
sane.allocations.sshd-gid = mkId 2001; # 997
sane.allocations.polkituser-gid = mkId 2002; # 998
sane.allocations.systemd-coredump-gid = mkId 2003; # 996
sane.allocations.nscd-uid = mkId 2004;
sane.allocations.nscd-gid = mkId 2004;
sane.allocations.systemd-oom-uid = mkId 2005;
sane.allocations.systemd-oom-gid = mkId 2005;
# found on graphical hosts
sane.allocations.nm-iodine-uid = mkId 2101; # desko/moby/lappy
# found on desko host
sane.allocations.usbmux-uid = mkId 2204;
sane.allocations.usbmux-gid = mkId 2204;
# originally found on moby host
sane.allocations.avahi-uid = mkId 2304;
sane.allocations.avahi-gid = mkId 2304;
sane.allocations.colord-uid = mkId 2305;
sane.allocations.colord-gid = mkId 2305;
sane.allocations.geoclue-uid = mkId 2306;
sane.allocations.geoclue-gid = mkId 2306;
sane.allocations.rtkit-uid = mkId 2307;
sane.allocations.rtkit-gid = mkId 2307;
sane.allocations.feedbackd-gid = mkId 2308;
};
}

View File

@@ -2,12 +2,13 @@
{
imports = [
./allocations.nix
./gui
./hardware
./home-manager
./packages.nix
./image.nix
./impermanence.nix
./nix.nix
./services/duplicity.nix
./universal
./nixcache.nix
./services
];
}

View File

@@ -2,25 +2,28 @@
with lib;
let
cfg = config.colinsane.gui;
cfg = config.sane.gui;
in
{
imports = [
./gnome.nix
./phosh.nix
./plasma.nix
./plasma-mobile.nix
./sway.nix
];
options = {
# doesn't directly create outputs. consumed by e.g. home-manager.nix module
colinsane.gui.enable = mkOption {
sane.gui.enable = mkOption {
default = false;
type = types.bool;
};
};
config = lib.mkIf cfg.enable {
colinsane.home-manager.enable = true;
sane.packages.enableGuiPkgs = lib.mkDefault true;
# all GUIs use network manager?
users.users.nm-iodine.uid = config.sane.allocations.nm-iodine-uid;
};
}

View File

@@ -2,18 +2,28 @@
with lib;
let
cfg = config.colinsane.gui.gnome;
cfg = config.sane.gui.gnome;
in
{
options = {
colinsane.gui.gnome.enable = mkOption {
sane.gui.gnome.enable = mkOption {
default = false;
type = types.bool;
};
};
config = mkIf cfg.enable {
colinsane.gui.enable = true;
sane.gui.enable = true;
users.users.avahi.uid = config.sane.allocations.avahi-uid;
users.groups.avahi.gid = config.sane.allocations.avahi-gid;
users.users.colord.uid = config.sane.allocations.colord-uid;
users.groups.colord.gid = config.sane.allocations.colord-gid;
users.users.geoclue.uid = config.sane.allocations.geoclue-uid;
users.groups.geoclue.gid = config.sane.allocations.geoclue-gid;
users.users.rtkit.uid = config.sane.allocations.rtkit-uid;
users.groups.rtkit.gid = config.sane.allocations.rtkit-gid;
# start gnome/gdm on boot
services.xserver.enable = true;
services.xserver.desktopManager.gnome.enable = true;

View File

@@ -1,43 +1,106 @@
{ lib, config, ... }:
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.colinsane.gui.phosh;
cfg = config.sane.gui.phosh;
in
{
options = {
colinsane.gui.phosh.enable = mkOption {
sane.gui.phosh.enable = mkOption {
default = false;
type = types.bool;
};
sane.gui.phosh.useGreeter = mkOption {
description = ''
launch phosh via a greeter (like lightdm-mobile-greeter).
phosh is usable without a greeter, but skipping the greeter means no PAM session.
'';
default = true;
type = types.bool;
};
};
config = mkIf cfg.enable {
colinsane.gui.enable = true;
# docs: https://github.com/NixOS/nixpkgs/blob/nixos-22.05/nixos/modules/services/x11/desktop-managers/phosh.nix
services.xserver.desktopManager.phosh = {
enable = true;
user = "colin";
group = "users";
phocConfig = {
# xwayland = "true";
# find default outputs by catting /etc/phosh/phoc.ini
outputs.DSI-1 = {
scale = 1.5;
config = mkIf cfg.enable (mkMerge [
{
sane.gui.enable = true;
users.users.avahi.uid = config.sane.allocations.avahi-uid;
users.users.colord.uid = config.sane.allocations.colord-uid;
users.users.geoclue.uid = config.sane.allocations.geoclue-uid;
users.users.rtkit.uid = config.sane.allocations.rtkit-uid;
users.groups.avahi.gid = config.sane.allocations.avahi-gid;
users.groups.colord.gid = config.sane.allocations.colord-gid;
users.groups.feedbackd.gid = config.sane.allocations.feedbackd-gid;
users.groups.geoclue.gid = config.sane.allocations.geoclue-gid;
users.groups.rtkit.gid = config.sane.allocations.rtkit-gid;
# docs: https://github.com/NixOS/nixpkgs/blob/nixos-22.05/nixos/modules/services/x11/desktop-managers/phosh.nix
services.xserver.desktopManager.phosh = {
enable = true;
user = "colin";
group = "users";
phocConfig = {
# xwayland = "true";
# find default outputs by catting /etc/phosh/phoc.ini
outputs.DSI-1 = {
scale = 1.5;
};
};
};
};
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
# XXX: phosh enables networkmanager by default; can probably disable these lines
networking.useDHCP = false;
networking.networkmanager.enable = true;
networking.wireless.enable = lib.mkForce false;
environment.variables = {
# Qt apps won't always start unless this env var is set
QT_QPA_PLATFORM = "wayland";
# electron apps (e.g. Element) should use the wayland backend
# toggle this to have electron apps (e.g. Element) use the wayland backend.
# phocConfig.xwayland should be disabled if you do this
NIXOS_OZONE_WL = "1";
};
};
# XXX: not clear if these are actually needed?
hardware.bluetooth.enable = true;
services.blueman.enable = true;
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
environment.variables = {
# Qt apps won't always start unless this env var is set
QT_QPA_PLATFORM = "wayland";
# electron apps (e.g. Element) should use the wayland backend
# toggle this to have electron apps (e.g. Element) use the wayland backend.
# phocConfig.xwayland should be disabled if you do this
NIXOS_OZONE_WL = "1";
};
sane.packages.extraUserPkgs = with pkgs; [
phosh-mobile-settings
# TODO: see about removing this if the in-built gnome-settings bluetooth manager can work
gnome.gnome-bluetooth
];
}
(mkIf cfg.useGreeter {
services.xserver.enable = true;
# NB: setting defaultSession has the critical side-effect that it lets org.freedesktop.AccountsService
# know that our user exists. this ensures lightdm succeeds when calling /org/freedesktop/AccountsServices ListCachedUsers
# lightdm greeters get the login users from lightdm which gets it from org.freedesktop.Accounts.ListCachedUsers.
# this requires the user we want to login as to be cached.
services.xserver.displayManager.job.preStart = ''
${pkgs.systemd}/bin/busctl call org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts CacheUser s colin
'';
# services.xserver.displayManager.defaultSession = "sm.puri.Phosh"; # XXX: not sure why this doesn't propagate correctly.
services.xserver.displayManager.lightdm.extraSeatDefaults = ''
user-session = phosh
'';
# services.xserver.displayManager.lightdm.greeters.gtk.enable = false; # gtk greeter overrides our own?
# services.xserver.displayManager.lightdm.greeter = {
# enable = true;
# package = pkgs.lightdm-mobile-greeter.xgreeters;
# name = "lightdm-mobile-greeter";
# };
# # services.xserver.displayManager.lightdm.enable = true;
services.xserver.displayManager.lightdm.enable = true;
services.xserver.displayManager.lightdm.greeters.mobile.enable = true;
systemd.services.phosh.wantedBy = lib.mkForce []; # disable auto-start
})
]);
}

View File

@@ -2,18 +2,18 @@
with lib;
let
cfg = config.colinsane.gui.plasma-mobile;
cfg = config.sane.gui.plasma-mobile;
in
{
options = {
colinsane.gui.plasma-mobile.enable = mkOption {
sane.gui.plasma-mobile.enable = mkOption {
default = false;
type = types.bool;
};
};
config = mkIf cfg.enable {
colinsane.gui.enable = true;
sane.gui.enable = true;
# start plasma-mobile on boot
services.xserver.enable = true;
services.xserver.desktopManager.plasma5.mobile.enable = true;

28
modules/gui/plasma.nix Normal file
View File

@@ -0,0 +1,28 @@
{ lib, config, ... }:
with lib;
let
cfg = config.sane.gui.plasma;
in
{
options = {
sane.gui.plasma.enable = mkOption {
default = false;
type = types.bool;
};
};
config = mkIf cfg.enable {
sane.gui.enable = true;
# start plasma on boot
services.xserver.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
services.xserver.displayManager.sddm.enable = true;
# gnome does networking stuff with networkmanager
networking.useDHCP = false;
networking.networkmanager.enable = true;
networking.wireless.enable = lib.mkForce false;
};
}

View File

@@ -3,34 +3,65 @@
# docs: https://nixos.wiki/wiki/Sway
with lib;
let
cfg = config.colinsane.gui.sway;
cfg = config.sane.gui.sway;
in
{
options = {
colinsane.gui.sway.enable = mkOption {
sane.gui.sway.enable = mkOption {
default = false;
type = types.bool;
};
sane.gui.sway.useGreeter = mkOption {
description = ''
launch sway via a greeter (like greetd's gtkgreet).
sway is usable without a greeter, but skipping the greeter means no PAM session.
'';
default = true;
type = types.bool;
};
};
config = mkIf cfg.enable {
colinsane.gui.enable = true;
sane.gui.enable = true;
users.users.greeter.uid = config.sane.allocations.greeter-uid;
users.groups.greeter.gid = config.sane.allocations.greeter-gid;
programs.sway = {
# we configure sway with home-manager, but this enable gets us e.g. opengl and fonts
enable = true;
};
# TODO: should be able to use SDDM to get interactive login
services.greetd = {
enable = true;
settings = rec {
initial_session = {
# alternatively, could use SDDM
services.greetd = let
swayConfig-greeter = pkgs.writeText "greetd-sway-config" ''
# `-l` activates layer-shell mode.
exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway"
'';
default_session = {
"01" = {
# greeter session config
command = "${pkgs.sway}/bin/sway --config ${swayConfig-greeter}";
# alternatives:
# - TTY: `command = "${pkgs.greetd.greetd}/bin/agreety --cmd ${pkgs.sway}/bin/sway";`
# - autologin: `command = "${pkgs.sway}/bin/sway"; user = "colin";`
# - Dumb Login (doesn't work)": `command = "${pkgs.greetd.dlm}/bin/dlm";`
};
"0" = {
# no greeter
command = "${pkgs.sway}/bin/sway";
user = "colin";
};
default_session = initial_session;
};
in {
# greetd source/docs:
# - <https://git.sr.ht/~kennylevinsen/greetd>
enable = true;
settings = {
default_session = default_session."0${builtins.toString cfg.useGreeter}";
};
};
# some programs (e.g. fractal) **require** a "Secret Service Provider"
services.gnome.gnome-keyring.enable = true;
# unlike other DEs, sway configures no audio stack
# administer with pw-cli, pw-mon, pw-top commands
services.pipewire = {
@@ -47,12 +78,26 @@ in
networking.networkmanager.enable = true;
networking.wireless.enable = lib.mkForce false;
colinsane.home-manager.windowManager.sway = {
sane.home-manager.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
config = rec {
terminal = "${pkgs.kitty}/bin/kitty";
window.border = 3; # pixel boundary between windows
window = {
border = 3; # pixel boundary between windows
hideEdgeBorders = "smart"; # don't show border if only window on workspace
};
output = {
### DESKTOP
"Samsung Electric Company S22C300 0x00007F35" = { pos = "0,0"; res = "1920x1080"; };
"Goldstar Company Ltd LG ULTRAWIDE 0x00004E94" = { pos = "1920,0"; res = "3440x1440"; };
### LAPTOP
# shen TV
"Pioneer Electronic Corporation VSX-524 0x00000101" = { pos = "0,0"; res = "1920x1080"; };
# internal display
"Unknown 0x0637 0x00000000" = { pos = "1920,0"; res = "1920x1080"; };
};
# defaults; required for keybindings decl.
modifier = "Mod1";
@@ -64,25 +109,27 @@ in
down = "j";
up = "k";
right = "l";
# XKB key names: https://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap
keybindings = {
"${modifier}+Return" = "exec ${terminal}";
"${modifier}+Shift+q" = "kill";
"${modifier}+d" = "exec ${menu}";
"${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock --indicator-idle-visible --indicator-radius 100 --indicator-thickness 30";
"${modifier}+${left}" = "focus left";
"${modifier}+${down}" = "focus down";
"${modifier}+${up}" = "focus up";
"${modifier}+${right}" = "focus right";
# "${modifier}+${left}" = "focus left";
# "${modifier}+${down}" = "focus down";
# "${modifier}+${up}" = "focus up";
# "${modifier}+${right}" = "focus right";
"${modifier}+Left" = "focus left";
"${modifier}+Down" = "focus down";
"${modifier}+Up" = "focus up";
"${modifier}+Right" = "focus right";
"${modifier}+Shift+${left}" = "move left";
"${modifier}+Shift+${down}" = "move down";
"${modifier}+Shift+${up}" = "move up";
"${modifier}+Shift+${right}" = "move right";
# "${modifier}+Shift+${left}" = "move left";
# "${modifier}+Shift+${down}" = "move down";
# "${modifier}+Shift+${up}" = "move up";
# "${modifier}+Shift+${right}" = "move right";
"${modifier}+Shift+Left" = "move left";
"${modifier}+Shift+Down" = "move down";
@@ -147,6 +194,9 @@ in
XF86AudioLowerVolume = "exec '${pkgs.pulsemixer}/bin/pulsemixer --change-volume -5'";
XF86AudioMute = "exec '${pkgs.pulsemixer}/bin/pulsemixer --toggle-mute'";
"${modifier}+Page_Up" = "exec '${pkgs.pulsemixer}/bin/pulsemixer --change-volume +5'";
"${modifier}+Page_Down" = "exec '${pkgs.pulsemixer}/bin/pulsemixer --change-volume -5'";
"${modifier}+Print" = "exec '${pkgs.sway-contrib.grimshot}/bin/grimshot copy area'";
};
@@ -163,7 +213,8 @@ in
# names = [ "monospace" "Noto Color Emoji" ];
# size = 8.0;
# names = [ "Font Awesome 6 Free" "DejaVu Sans" "Hack" ];
names = with config.fonts.fontconfig.defaultFonts; (emoji ++ monospace ++ serif ++ sansSerif);
# names = with config.fonts.fontconfig.defaultFonts; (emoji ++ monospace ++ serif ++ sansSerif);
names = with config.fonts.fontconfig.defaultFonts; (monospace ++ emoji);
size = 24.0;
};
trayOutput = "primary";
@@ -201,9 +252,10 @@ in
};
};
colinsane.home-manager.programs.waybar = {
sane.home-manager.programs.waybar = {
enable = true;
# docs: https://github.com/Alexays/Waybar/wiki/Configuration
# format specifiers: https://fmt.dev/latest/syntax.html#syntax
settings = {
mainBar = {
layer = "top";
@@ -232,11 +284,20 @@ in
on-scroll-down = "${pkgs.playerctl}/bin/playerctl previous";
};
network = {
interval = 1;
format-ethernet = "{ifname}: {ipaddr}/{cidr} up: {bandwidthUpBits} down: {bandwidthDownBits}";
# docs: https://github.com/Alexays/Waybar/blob/master/man/waybar-network.5.scd
interval = 2;
max-length = 40;
# custom :> format specifier explained here: https://github.com/Alexays/Waybar/pull/472
format-ethernet = " {bandwidthUpBits:>} {bandwidthDownBits:>}";
tooltip-format-ethernet = "{ifname} {bandwidthUpBits:>} {bandwidthDownBits:>}";
format-wifi = "{ifname} ({signalStrength}%) {bandwidthUpBits:>} {bandwidthDownBits:>}";
tooltip-format-wifi = "{essid} ({signalStrength}%) {bandwidthUpBits:>} {bandwidthDownBits:>}";
format-disconnected = "";
};
cpu = {
format = "{usage}% ";
format = " {usage:2}%";
tooltip = false;
};
battery = {
@@ -259,6 +320,262 @@ in
};
};
};
# style docs: https://github.com/Alexays/Waybar/wiki/Styling
style = ''
* {
font-family: monospace;
}
/* defaults below: https://github.com/Alexays/Waybar/blob/master/resources/style.css */
window#waybar {
background-color: rgba(43, 48, 59, 0.5);
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
color: #ffffff;
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
/*
window#waybar.empty {
background-color: transparent;
}
window#waybar.solo {
background-color: #FFFFFF;
}
*/
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: #ffffff;
/* Use box-shadow instead of border so the text isn't offset */
box-shadow: inset 0 -3px transparent;
/* Avoid rounded borders under each workspace name */
border: none;
border-radius: 0;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button:hover {
background: rgba(0, 0, 0, 0.2);
box-shadow: inset 0 -3px #ffffff;
}
#workspaces button.focused {
background-color: #64727D;
box-shadow: inset 0 -3px #ffffff;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#mode {
background-color: #64727D;
border-bottom: 3px solid #ffffff;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#mpd {
padding: 0 10px;
color: #ffffff;
}
#window,
#workspaces {
margin: 0 4px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
#clock {
background-color: #64727D;
}
#battery {
background-color: #ffffff;
color: #000000;
}
#battery.charging, #battery.plugged {
color: #ffffff;
background-color: #26A65B;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#cpu {
background-color: #2ecc71;
color: #000000;
}
#memory {
background-color: #9b59b6;
}
#disk {
background-color: #964B00;
}
#backlight {
background-color: #90b1b1;
}
#network {
background-color: #2980b9;
}
#network.disconnected {
background-color: #f53c3c;
}
#pulseaudio {
background-color: #f1c40f;
color: #000000;
}
#pulseaudio.muted {
background-color: #90b1b1;
color: #2a5c45;
}
#custom-media {
background-color: #66cc99;
color: #2a5c45;
min-width: 100px;
}
#custom-media.custom-spotify {
background-color: #66cc99;
}
#custom-media.custom-vlc {
background-color: #ffa000;
}
#temperature {
background-color: #f0932b;
}
#temperature.critical {
background-color: #eb4d4b;
}
#tray {
background-color: #2980b9;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}
#idle_inhibitor {
background-color: #2d3436;
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
}
#mpd {
background-color: #66cc99;
color: #2a5c45;
}
#mpd.disconnected {
background-color: #f53c3c;
}
#mpd.stopped {
background-color: #90b1b1;
}
#mpd.paused {
background-color: #51a37a;
}
#language {
background: #00b093;
color: #740864;
padding: 0 5px;
margin: 0 5px;
min-width: 16px;
}
#keyboard-state {
background: #97e1ad;
color: #000000;
padding: 0 0px;
margin: 0 5px;
min-width: 16px;
}
#keyboard-state > label {
padding: 0 5px;
}
#keyboard-state > label.locked {
background: rgba(0, 0, 0, 0.2);
}
'';
# style = ''
# * {
# border: none;
@@ -280,9 +597,9 @@ in
# }
# '';
};
colinsane.home-manager.extraPackages = with pkgs; [
sane.packages.extraUserPkgs = with pkgs; [
swaylock
swayidle
swayidle # (unused)
wl-clipboard
mako # notification daemon
xdg-utils # for xdg-open
@@ -290,6 +607,7 @@ in
# pavucontrol
sway-contrib.grimshot
gnome.gnome-bluetooth
gnome.gnome-control-center
];
};
}

View File

@@ -1,60 +0,0 @@
{ lib, pkgs, config, ... }:
with lib;
{
config = mkIf (pkgs.system == "x86_64-linux") {
boot.initrd.availableKernelModules = [
"xhci_pci" "ahci" "sd_mod" "sdhci_pci" # nixos-generate-config defaults
"usb_storage" # rpi needed this to boot from usb storage, i think.
"nvme" # to boot from nvme devices
# efi_pstore evivars
];
boot.initrd.kernelModules = [ ];
boot.initrd.supportedFilesystems = [ "ext4" "btrfs" "ext2" "ext3" "vfat" ];
# useful emergency utils
boot.initrd.extraUtilsCommands = ''
copy_bin_and_libs ${pkgs.btrfs-progs}/bin/btrfstune
'';
boot.kernelModules = [
"coretemp"
"kvm-intel"
"kvm-amd" # desktop
"amdgpu" # desktop
];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "boot.shell_on_fail" ];
boot.consoleLogLevel = 7;
boot.loader.grub.enable = false;
# boot.loader.generic-extlinux-compatible.enable = true;
# enable cross compilation
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# nixpkgs.crossSystem.system = "aarch64-linux";
powerManagement.cpuFreqGovernor = "powersave";
hardware.enableRedistributableFirmware = true;
hardware.cpu.amd.updateMicrocode = true; # desktop
hardware.cpu.intel.updateMicrocode = true; # laptop
services.fwupd.enable = true;
# powertop will default to putting USB devices -- including HID -- to sleep after TWO SECONDS
powerManagement.powertop.enable = false;
hardware.opengl.driSupport = true;
# For 32 bit applications
hardware.opengl.driSupport32Bit = true;
# TODO colin: does this *do* anything?
swapDevices = [ ];
# services.snapper.configs = {
# root = {
# subvolume = "/";
# extraConfig = {
# ALLOW_USERS = "colin";
# };
# };
# };
# services.snapper.snapshotInterval = "daily";
};
}

View File

@@ -0,0 +1,16 @@
# Terminal UI mail client
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
sops.secrets."aerc_accounts" = {
owner = config.users.users.colin.name;
sopsFile = ../../secrets/universal/aerc_accounts.conf;
format = "binary";
};
home-manager.users.colin = let sysconfig = config; in { config, ... }: {
# aerc TUI mail client
xdg.configFile."aerc/accounts.conf".source =
config.lib.file.mkOutOfStoreSymlink sysconfig.sops.secrets.aerc_accounts.path;
};
}

View File

@@ -0,0 +1,226 @@
# docs:
# https://rycee.gitlab.io/home-manager/
# https://rycee.gitlab.io/home-manager/options.html
# man home-configuration.nix
#
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.sane.home-manager;
# extract package from `sane.packages.enabledUserPkgs`
pkg-list = pkgspec: builtins.map (e: e.pkg or e) pkgspec;
# extract `dir` from `sane.packages.enabledUserPkgs`
dir-list = pkgspec: builtins.concatLists (builtins.map (e: if e ? "dir" then [ e.dir ] else []) pkgspec);
private-list = pkgspec: builtins.concatLists (builtins.map (e: if e ? "private" then [ e.private ] else []) pkgspec);
feeds = import ./feeds.nix { inherit lib; };
in
{
imports = [
./aerc.nix
./discord.nix
./firefox.nix
./git.nix
./kitty.nix
./mpv.nix
./nb.nix
./neovim.nix
./ssh.nix
./sublime-music.nix
./vlc.nix
./zsh.nix
];
options = {
sane.home-manager.enable = mkOption {
default = false;
type = types.bool;
};
# attributes to copy directly to home-manager's `wayland.windowManager` option
sane.home-manager.windowManager = mkOption {
default = {};
type = types.attrs;
};
# extra attributes to include in home-manager's `programs` option
sane.home-manager.programs = mkOption {
default = {};
type = types.attrs;
};
};
config = lib.mkIf cfg.enable {
sane.impermanence.home-dirs = [
"archive"
"dev"
"records"
"ref"
"tmp"
"use"
"Music"
"Pictures"
"Videos"
] ++ (dir-list config.sane.packages.enabledUserPkgs);
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# XXX this weird rename + closure is to get home-manager's `config.lib.file` to exist.
# see: https://github.com/nix-community/home-manager/issues/589#issuecomment-950474105
home-manager.users.colin = let sysconfig = config; in { config, ... }: {
# run `home-manager-help` to access manpages
# or `man home-configuration.nix`
manual.html.enable = false; # TODO: set to true later (build failure)
manual.manpages.enable = false; # TODO: enable after https://github.com/nix-community/home-manager/issues/3344
home.packages = pkg-list sysconfig.sane.packages.enabledUserPkgs;
wayland.windowManager = cfg.windowManager;
home.stateVersion = "21.11";
home.username = "colin";
home.homeDirectory = "/home/colin";
home.activation = {
initKeyring = {
after = ["writeBoundary"];
before = [];
data = "${../../scripts/init-keyring}";
};
};
home.file = let
privates = builtins.listToAttrs (
builtins.map (path: {
name = path;
value = { source = config.lib.file.mkOutOfStoreSymlink "/home/colin/private/${path}"; };
})
(private-list sysconfig.sane.packages.enabledUserPkgs)
);
in {
# convenience
"knowledge".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/knowledge";
"nixos".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/nixos";
"Videos/servo".source = config.lib.file.mkOutOfStoreSymlink "/mnt/servo-media/Videos";
"Videos/servo-incomplete".source = config.lib.file.mkOutOfStoreSymlink "/mnt/servo-media/incomplete";
"Music/servo".source = config.lib.file.mkOutOfStoreSymlink "/mnt/servo-media/Music";
# used by password managers, e.g. unix `pass`
".password-store".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/knowledge/secrets/accounts";
} // privates;
# XDG defines things like ~/Desktop, ~/Downloads, etc.
# these clutter the home, so i mostly don't use them.
xdg.userDirs = {
enable = true;
createDirectories = false; # on headless systems, most xdg dirs are noise
desktop = "$HOME/.xdg/Desktop";
documents = "$HOME/dev";
download = "$HOME/tmp";
music = "$HOME/Music";
pictures = "$HOME/Pictures";
publicShare = "$HOME/.xdg/Public";
templates = "$HOME/.xdg/Templates";
videos = "$HOME/Videos";
};
# the xdg mime type for a file can be found with:
# - `xdg-mime query filetype path/to/thing.ext`
xdg.mimeApps.enable = true;
xdg.mimeApps.defaultApplications = let
www = sysconfig.sane.web-browser.desktop;
pdf = "org.gnome.Evince.desktop";
md = "obsidian.desktop";
thumb = "org.gnome.gThumb.desktop";
video = "vlc.desktop";
# audio = "mpv.desktop";
audio = "vlc.desktop";
in {
# HTML
"text/html" = [ www ];
"x-scheme-handler/http" = [ www ];
"x-scheme-handler/https" = [ www ];
"x-scheme-handler/about" = [ www ];
"x-scheme-handler/unknown" = [ www ];
# RICH-TEXT DOCUMENTS
"application/pdf" = [ pdf ];
"text/markdown" = [ md ];
# IMAGES
"image/heif" = [ thumb ]; # apple codec
"image/png" = [ thumb ];
"image/jpeg" = [ thumb ];
# VIDEO
"video/mp4" = [ video ];
"video/quicktime" = [ video ];
"video/x-matroska" = [ video ];
# AUDIO
"audio/flac" = [ audio ];
"audio/mpeg" = [ audio ];
"audio/x-vorbis+ogg" = [ audio ];
};
# libreoffice: disable first-run stuff
xdg.configFile."libreoffice/4/user/registrymodifications.xcu".text = ''
<?xml version="1.0" encoding="UTF-8"?>
<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="FirstRun" oor:op="fuse"><value>false</value></prop></item>
<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="ShowTipOfTheDay" oor:op="fuse"><value>false</value></prop></item>
</oor:items>
'';
# <item oor:path="/org.openoffice.Setup/Product"><prop oor:name="LastTimeDonateShown" oor:op="fuse"><value>1667693880</value></prop></item>
# <item oor:path="/org.openoffice.Setup/Product"><prop oor:name="LastTimeGetInvolvedShown" oor:op="fuse"><value>1667693880</value></prop></item>
xdg.configFile."gpodderFeeds.opml".text = with feeds;
feedsToOpml feeds.podcasts;
# news-flash RSS viewer
xdg.configFile."newsflashFeeds.opml".text = with feeds;
feedsToOpml (feeds.texts ++ feeds.images);
# gnome feeds RSS viewer
xdg.configFile."org.gabmus.gfeeds.json".text =
let
myFeeds = feeds.texts ++ feeds.images;
in builtins.toJSON {
# feed format is a map from URL to a dict,
# with dict["tags"] a list of string tags.
feeds = builtins.foldl' (acc: feed: acc // {
"${feed.url}".tags = [ feed.cat feed.freq ];
}) {} myFeeds;
dark_reader = false;
new_first = true;
# windowsize = {
# width = 350;
# height = 650;
# };
max_article_age_days = 90;
enable_js = false;
max_refresh_threads = 3;
# saved_items = {};
# read_items = [];
show_read_items = true;
full_article_title = true;
# views: "webview", "reader", "rsscont"
default_view = "rsscont";
open_links_externally = true;
full_feed_name = false;
refresh_on_startup = true;
tags = lib.lists.unique (
(builtins.catAttrs "cat" myFeeds) ++ (builtins.catAttrs "freq" myFeeds)
);
open_youtube_externally = false;
media_player = "vlc"; # default: mpv
};
programs = {
home-manager.enable = true; # this lets home-manager manage dot-files in user dirs, i think
# "command not found" will cause the command to be searched in nixpkgs
nix-index.enable = true;
} // cfg.programs;
};
};
}

View File

@@ -0,0 +1,12 @@
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
# TODO: this should only be enabled on gui devices
# make Discord usable even when client is "outdated"
home-manager.users.colin.xdg.configFile."discord/settings.json".text = ''
{
"SKIP_HOST_UPDATE": true
}
'';
}

View File

@@ -0,0 +1,185 @@
{ lib }:
let
hourly = { freq = "hourly"; };
daily = { freq = "daily"; };
weekly = { freq = "weekly"; };
infrequent = { freq = "infrequent"; };
art = { cat = "art"; };
humor = { cat = "humor"; };
pol = { cat = "pol"; }; # or maybe just "social"
rat = { cat = "rat"; };
tech = { cat = "tech"; };
uncat = { cat = "uncat"; };
text = { format = "text"; };
image = { format = "image"; };
podcast = { format = "podcast"; };
mkRss = format: url: { inherit url format; } // uncat // infrequent;
# format-specific helpers
mkText = mkRss text;
mkImg = mkRss image;
mkPod = mkRss podcast;
# host-specific helpers
mkSubstack = subdomain: mkText "https://${subdomain}.substack.com/feed";
# merge the attrs `new` into each value of the attrs `addTo`
addAttrs = new: addTo: builtins.mapAttrs (k: v: v // new) addTo;
# for each value in `attrs`, add a value to the child attrs which holds its key within the parent attrs.
withInverseMapping = key: attrs: builtins.mapAttrs (k: v: v // { "${key}" = k; }) attrs;
in rec {
podcasts = [
(mkPod "https://lexfridman.com/feed/podcast/" // rat // weekly)
## Astral Codex Ten
(mkPod "http://feeds.libsyn.com/108018/rss" // rat // daily)
## Econ Talk
(mkPod "https://feeds.simplecast.com/wgl4xEgL" // rat // daily)
## Cory Doctorow
(mkPod "https://feeds.feedburner.com/doctorow_podcast" // pol // infrequent)
(mkPod "https://congressionaldish.libsyn.com/rss" // pol // infrequent)
## Civboot
(mkPod "https://anchor.fm/s/34c7232c/podcast/rss" // tech // infrequent)
(mkPod "https://feeds.feedburner.com/80000HoursPodcast" // rat // weekly)
(mkPod "https://allinchamathjason.libsyn.com/rss" // pol // weekly)
(mkPod "https://acquired.libsyn.com/rss" // tech // infrequent)
(mkPod "https://rss.acast.com/deconstructed" // pol // infrequent)
## The Daily
(mkPod "https://feeds.simplecast.com/54nAGcIl" // pol // daily)
(mkPod "https://rss.acast.com/intercepted-with-jeremy-scahill" // pol // weekly)
(mkPod "https://podcast.posttv.com/itunes/post-reports.xml" // pol // weekly)
## Eric Weinstein
(mkPod "https://rss.art19.com/the-portal" // rat // infrequent)
(mkPod "https://feeds.megaphone.fm/darknetdiaries" // tech // infrequent)
(mkPod "http://feeds.wnyc.org/radiolab" // pol // infrequent)
(mkPod "https://wakingup.libsyn.com/rss" // pol // infrequent)
## 99% Invisible
(mkPod "https://feeds.simplecast.com/BqbsxVfO" // pol // infrequent)
(mkPod "https://rss.acast.com/ft-tech-tonic" // tech // infrequent)
(mkPod "https://feeds.feedburner.com/dancarlin/history?format=xml" // rat // infrequent)
## 60 minutes (NB: this features more than *just* audio?)
(mkPod "https://www.cbsnews.com/latest/rss/60-minutes" // pol // infrequent)
## The Verge - Decoder
(mkPod "https://feeds.megaphone.fm/recodedecode" // tech // weekly)
];
texts = [
# AGGREGATORS (> 1 post/day)
(mkText "https://www.lesswrong.com/feed.xml" // rat // hourly)
(mkText "http://www.econlib.org/index.xml" // pol // hourly)
# AGGREGATORS (< 1 post/day)
(mkText "https://palladiummag.com/feed" // uncat // weekly)
(mkText "https://profectusmag.com/feed" // uncat // weekly)
(mkText "https://semiaccurate.com/feed" // tech // weekly)
(mkText "https://linuxphoneapps.org/blog/atom.xml" // tech // infrequent)
(mkText "https://spectrum.ieee.org/rss" // tech // weekly)
## No Moods, Ads or Cutesy Fucking Icons
(mkText "https://www.rifters.com/crawl/?feed=rss2" // uncat // weekly)
# DEVELOPERS
(mkText "https://uninsane.org/atom.xml" // infrequent // tech)
(mkText "https://mg.lol/blog/rss/" // infrequent // tech)
## Ken Shirriff
(mkText "https://www.righto.com/feeds/posts/default" // tech // infrequent)
## Vitalik Buterin
(mkText "https://vitalik.ca/feed.xml" // tech // infrequent)
## ian (Sanctuary)
(mkText "https://sagacioussuricata.com/feed.xml" // tech // infrequent)
## Bunnie Juang
(mkText "https://www.bunniestudios.com/blog/?feed=rss2" // tech // infrequent)
(mkText "https://blog.danieljanus.pl/atom.xml" // tech // infrequent)
(mkText "https://ianthehenry.com/feed.xml" // tech // infrequent)
(mkText "https://bitbashing.io/feed.xml" // tech // infrequent)
(mkText "https://idiomdrottning.org/feed.xml" // uncat // daily)
(mkText "https://anish.lakhwara.com/home.html" // tech // weekly)
(mkText "https://www.jefftk.com/news.rss" // tech // daily)
# (TECH; POL) COMMENTATORS
(mkSubstack "edwardsnowden" // pol // infrequent)
(mkText "http://benjaminrosshoffman.com/feed" // pol // weekly)
## Ben Thompson
(mkText "https://www.stratechery.com/rss" // pol // weekly)
## Balaji
(mkText "https://balajis.com/rss" // pol // weekly)
(mkText "https://www.ben-evans.com/benedictevans/rss.xml" // pol // weekly)
(mkText "https://www.lynalden.com/feed" // pol // infrequent)
(mkText "https://austinvernon.site/rss.xml" // tech // infrequent)
(mkSubstack "oversharing" // pol // daily)
(mkSubstack "doomberg" // tech // weekly)
## David Rosenthal
(mkText "https://blog.dshr.org/rss.xml" // pol // weekly)
## Matt Levine
(mkText "https://www.bloomberg.com/opinion/authors/ARbTQlRLRjE/matthew-s-levine.rss" // pol // weekly)
# RATIONALITY/PHILOSOPHY/ETC
(mkSubstack "samkriss" // humor // infrequent)
(mkText "https://unintendedconsequenc.es/feed" // rat // infrequent)
(mkText "https://applieddivinitystudies.com/atom.xml" // rat // weekly)
(mkText "https://slimemoldtimemold.com/feed.xml" // rat // weekly)
(mkText "https://www.richardcarrier.info/feed" // rat // weekly)
(mkText "https://www.gwern.net/feed.xml" // uncat // infrequent)
## Jason Crawford
(mkText "https://rootsofprogress.org/feed.xml" // rat // weekly)
## Robin Hanson
(mkText "https://www.overcomingbias.com/feed" // rat // daily)
## Scott Alexander
(mkSubstack "astralcodexten" // rat // daily)
## Paul Christiano
(mkText "https://sideways-view.com/feed" // rat // infrequent)
## Sean Carroll
(mkText "https://www.preposterousuniverse.com/rss" // rat // infrequent)
# CODE
(mkText "https://github.com/Kaiteki-Fedi/Kaiteki/commits/master.atom" // tech // infrequent)
];
images = [
(mkImg "https://www.smbc-comics.com/comic/rss" // humor // daily)
(mkImg "https://xkcd.com/atom.xml" // humor // daily)
(mkImg "http://dilbert.com/feed" // humor // daily)
# ART
(mkImg "https://miniature-calendar.com/feed" // art // daily)
];
all = texts ++ images ++ podcasts;
# return only the feed items which match this category (e.g. "tech")
filterCat = cat: feeds: builtins.filter (item: item.cat == cat) feeds;
# return only the feed items which match this format (e.g. "podcast")
filterFormat = format: feeds: builtins.filter (item: item.format == format) feeds;
# transform a list of feeds into an attrs mapping cat => [ feed0 feed1 ... ]
partitionByCat = feeds: builtins.groupBy (f: f.cat) feeds;
# represents a single RSS feed.
opmlTerminal = feed: ''<outline xmlUrl="${feed.url}" type="rss"/>'';
# a list of RSS feeds.
opmlTerminals = feeds: lib.strings.concatStringsSep "\n" (builtins.map opmlTerminal feeds);
# one node which packages some flat grouping of terminals.
opmlGroup = title: feeds: ''
<outline text="${title}" title="${title}">
${opmlTerminals feeds}
</outline>
'';
# a list of groups (`groupMap` is an attrs mapping groupName => [ feed0 feed1 ... ]).
opmlGroups = groupMap: lib.strings.concatStringsSep "\n" (
builtins.attrValues (builtins.mapAttrs opmlGroup groupMap)
);
# top-level OPML file which could be consumed by something else.
opmlTopLevel = body: ''
<?xml version="1.0" encoding="utf-8"?>
<opml version="2.0">
<body>
${body}
</body>
</opml>
'';
# **primary API**: generate a OPML file from the provided feeds
feedsToOpml = feeds: opmlTopLevel (opmlGroups (partitionByCat feeds));
}

View File

@@ -0,0 +1,139 @@
# common settings to toggle (at runtime, in about:config):
# > security.ssl.require_safe_negotiation
# librewolf is a forked firefox which patches firefox to allow more things
# (like default search engines) to be configurable at runtime.
# many of the settings below won't have effect without those patches.
# see: https://gitlab.com/librewolf-community/settings/-/blob/master/distribution/policies.json
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.sane.web-browser;
# allow easy switching between firefox and librewolf with `defaultSettings`, below
librewolfSettings = {
browser = pkgs.librewolf-unwrapped;
# browser = pkgs.librewolf-unwrapped.overrideAttrs (drv: {
# # this allows side-loading unsigned addons
# MOZ_REQUIRE_SIGNING = false;
# });
libName = "librewolf";
dotDir = ".librewolf";
desktop = "librewolf.desktop";
};
firefoxSettings = {
browser = pkgs.firefox-esr-unwrapped;
libName = "firefox";
dotDir = ".mozilla/firefox";
desktop = "firefox.desktop";
};
defaultSettings = firefoxSettings;
# defaultSettings = librewolfSettings;
package = pkgs.wrapFirefox cfg.browser {
# inherit the default librewolf.cfg
# it can be further customized via ~/.librewolf/librewolf.overrides.cfg
inherit (pkgs.librewolf-unwrapped) extraPrefsFiles;
inherit (cfg) libName;
extraNativeMessagingHosts = [ pkgs.browserpass ];
# extraNativeMessagingHosts = [ pkgs.gopass-native-messaging-host ];
nixExtensions = let
addon = name: extid: hash: pkgs.fetchFirefoxAddon {
inherit name hash;
url = "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi";
fixedExtid = extid;
};
localAddon = pkg: pkgs.fetchFirefoxAddon {
inherit (pkg) name;
src = "${pkg}/share/mozilla/extensions/\\{ec8030f7-c20a-464f-9b0e-13a3a9e97384\\}/${pkg.extid}.xpi";
fixedExtid = pkg.extid;
};
in [
(addon "ublock-origin" "uBlock0@raymondhill.net" "sha256-C+VQyaJ8BA0ErXGVTdnppJZ6J9SP+izf6RFxdS4VJoU=")
(addon "sponsorblock" "sponsorBlocker@ajay.app" "sha256-au5GGn22n4i6VrdOKqNMOrWdMoVCcpLdjO2wwRvyx7E=")
(addon "bypass-paywalls-clean" "{d133e097-46d9-4ecc-9903-fa6a722a6e0e}" "sha256-m14onUlnpLDPHezA/soKygcc76tF1fLG52tM/LkbAXQ=")
(addon "sidebery" "{3c078156-979c-498b-8990-85f7987dd929}" "sha256-YONfK/rIjlsrTgRHIt3km07Q7KnpIW89Z9r92ZSCc6w=")
(addon "ether-metamask" "webextension@metamask.io" "sha256-dnpwKpNF0KgHMAlz5btkkZySjMsnrXECS35ClkD2XHc=")
# (addon "browserpass-ce" "browserpass@maximbaz.com" "sha256-sXgUBbRvMnRpeIW1MTkmTcoqtW/8RDXAkxAq1evFkpc=")
(localAddon pkgs.browserpass-extension)
];
extraPolicies = {
NoDefaultBookmarks = true;
SearchEngines = {
Default = "DuckDuckGo";
};
AppUpdateURL = "https://localhost";
DisableAppUpdate = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DisableSystemAddonUpdate = true;
DisableFirefoxStudies = true;
DisableTelemetry = true;
DisableFeedbackCommands = true;
DisablePocket = true;
DisableSetDesktopBackground = false;
# remove many default search providers
# XXX this seems to prevent the `nixExtensions` from taking effect
# Extensions.Uninstall = [
# "google@search.mozilla.org"
# "bing@search.mozilla.org"
# "amazondotcom@search.mozilla.org"
# "ebay@search.mozilla.org"
# "twitter@search.mozilla.org"
# ];
# XXX doesn't seem to have any effect...
# docs: https://github.com/mozilla/policy-templates#homepage
# Homepage = {
# HomepageURL = "https://uninsane.org/";
# StartPage = "homepage";
# };
# NewTabPage = true;
};
};
in
{
options = {
sane.web-browser = mkOption {
default = defaultSettings;
type = types.attrs;
};
};
config = lib.mkIf config.sane.home-manager.enable {
# XXX: although home-manager calls this option `firefox`, we can use other browsers and it still mostly works.
home-manager.users.colin = lib.mkIf (config.sane.gui.enable) {
programs.firefox = {
enable = true;
inherit package;
};
# uBlock filter list configuration.
# specifically, enable the GDPR cookie prompt blocker.
# data.toOverwrite.filterLists is additive (i.e. it supplements the default filters)
# this configuration method is documented here:
# - <https://github.com/gorhill/uBlock/issues/2986#issuecomment-364035002>
# the specific attribute path is found via scraping ublock code here:
# - <https://github.com/gorhill/uBlock/blob/master/src/js/storage.js>
# - <https://github.com/gorhill/uBlock/blob/master/assets/assets.json>
home.file."${cfg.dotDir}/managed-storage/uBlock0@raymondhill.net.json".text = ''
{
"name": "uBlock0@raymondhill.net",
"description": "ignored",
"type": "storage",
"data": {
"toOverwrite": "{\"filterLists\": [\"fanboy-cookiemonster\"]}"
}
}
'';
home.file."${cfg.dotDir}/${cfg.libName}.overrides.cfg".text = ''
// if we can't query the revocation status of a SSL cert because the issuer is offline,
// treat it as unrevoked.
// see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do>
defaultPref("security.OCSP.require", false);
'';
};
};
}

View File

@@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin.programs.git = {
enable = true;
userName = "colin";
userEmail = "colin@uninsane.org";
aliases = { co = "checkout"; };
extraConfig = {
# difftastic docs:
# - <https://difftastic.wilfred.me.uk/git.html>
diff.tool = "difftastic";
difftool.prompt = false;
"difftool \"difftastic\"".cmd = ''${pkgs.difftastic}/bin/difft "$LOCAL" "$REMOTE"'';
# now run `git difftool` to use difftastic git
};
};
}

View File

@@ -0,0 +1,71 @@
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin.programs.kitty = {
enable = true;
# docs: https://sw.kovidgoyal.net/kitty/conf/
settings = {
# disable terminal bell (when e.g. you backspace too many times)
enable_audio_bell = false;
};
keybindings = {
"ctrl+n" = "new_os_window_with_cwd";
};
# docs: https://github.com/kovidgoyal/kitty-themes
# theme = "1984 Light"; # dislike: awful, harsh blues/teals
# theme = "Adventure Time"; # dislike: harsh (dark)
# theme = "Atom One Light"; # GOOD: light theme. all color combos readable. not a huge fan of the blue.
# theme = "Belafonte Day"; # dislike: too low contrast for text colors
# theme = "Belafonte Night"; # better: dark theme that's easy on the eyes. all combos readable. low contrast.
# theme = "Catppuccin"; # dislike: a bit pale/low-contrast (dark)
# theme = "Desert"; # mediocre: colors are harsh
# theme = "Earthsong"; # BEST: dark theme. readable, good contrast. unique, but decent colors.
# theme = "Espresso Libre"; # better: dark theme. readable, but meh colors
# theme = "Forest Night"; # decent: very pastel. it's workable, but unconventional and muted/flat.
# theme = "Gruvbox Material Light Hard"; # mediocre light theme.
# theme = "kanagawabones"; # better: dark theme. colors are too background-y
# theme = "Kaolin Dark"; # dislike: too dark
# theme = "Kaolin Breeze"; # mediocre: not-too-harsh light theme, but some parts are poor contrast
# theme = "Later This Evening"; # mediocre: not-too-harsh dark theme, but cursor is poor contrast
# theme = "Material"; # decent: light theme, few colors.
# theme = "Mayukai"; # decent: not-too-harsh dark theme. the teal is a bit straining
# theme = "Nord"; # mediocre: pale background, low contrast
# theme = "One Half Light"; # better: not-too-harsh light theme. contrast could be better
theme = "PaperColor Dark"; # BEST: dark theme, very readable still the colors are background-y
# theme = "Parasio Dark"; # dislike: too low contrast
# theme = "Pencil Light"; # better: not-too-harsh light theme. decent contrast.
# theme = "Pnevma"; # dislike: too low contrast
# theme = "Piatto Light"; # better: readable light theme. pleasing colors. powerline prompt is hard to read.
# theme = "Rosé Pine Dawn"; # GOOD: light theme. all color combinations are readable. it is very mild -- may need to manually tweak contrast. tasteful colors
# theme = "Rosé Pine Moon"; # GOOD: dark theme. tasteful colors. but background is a bit intense
# theme = "Sea Shells"; # mediocre. not all color combos are readable
# theme = "Solarized Light"; # mediocre: not-too-harsh light theme; GREAT background; but some colors are low contrast
# theme = "Solarized Dark Higher Contrast"; # better: dark theme, decent colors
# theme = "Sourcerer"; # mediocre: ugly colors
# theme = "Space Gray"; # mediocre: too muted
# theme = "Space Gray Eighties"; # better: all readable, decent colors
# theme = "Spacemacs"; # mediocre: too muted
# theme = "Spring"; # mediocre: readable light theme, but the teal is ugly.
# theme = "Srcery"; # better: highly readable. colors are ehhh
# theme = "Substrata"; # decent: nice colors, but a bit flat.
# theme = "Sundried"; # mediocre: the solar text makes me squint
# theme = "Symfonic"; # mediocre: the dark purple has low contrast to the black bg.
# theme = "Tango Light"; # dislike: teal is too grating
# theme = "Tokyo Night Day"; # medicore: too muted
# theme = "Tokyo Night"; # better: tasteful. a bit flat
# theme = "Tomorrow"; # GOOD: all color combinations are readable. contrast is slightly better than Rose. on the blander side
# theme = "Treehouse"; # dislike: the orange is harsh on my eyes.
# theme = "Urple"; # dislike: weird palette
# theme = "Warm Neon"; # decent: not-too-harsh dark theme. the green is a bit unattractive
# theme = "Wild Cherry"; # GOOD: dark theme: nice colors. a bit flat
# theme = "Xcodedark"; # dislike: bad palette
# theme = "citylights"; # decent: dark theme. some parts have just a bit low contrast
# theme = "neobones_light"; # better light theme. the background is maybe too muted
# theme = "vimbones";
# theme = "zenbones_dark"; # mediocre: readable, but meh colors
# theme = "zenbones_light"; # decent: light theme. all colors are readable. contrast is passable but not excellent. highlight color is BAD
# theme = "zenwritten_dark"; # mediocre: looks same as zenbones_dark
# extraConfig = "";
};
}

View File

@@ -0,0 +1,13 @@
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin.programs.mpv = {
enable = true;
config = {
save-position-on-quit = true;
keep-open = "yes";
};
};
}

View File

@@ -0,0 +1,27 @@
# nb is a CLI-drive Personal Knowledge Manager
# - <https://xwmx.github.io/nb/>
#
# it's pretty opinionated:
# - autocommits (to git) excessively (disable-able)
# - inserts its own index files to give deterministic names to files
#
# it offers a primitive web-server
# and it offers some CLI query tools
{ config, lib, pkgs, ... }:
# lib.mkIf config.sane.home-manager.enable
lib.mkIf false # XXX disabled!
{
sane.packages.extraUserPkgs = [ pkgs.nb ];
home-manager.users.colin = { config, ... }: {
# nb markdown/personal knowledge manager
home.file.".nb/knowledge".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/knowledge";
home.file.".nb/.current".text = "knowledge";
home.file.".nbrc".text = ''
# manage with `nb settings`
export NB_AUTO_SYNC=0
'';
};
}

View File

@@ -0,0 +1,117 @@
{ config, lib, pkgs, ... }:
lib.mkIf config.sane.home-manager.enable
{
sane.impermanence.home-dirs = [ ".cache/vim-swap" ];
home-manager.users.colin.programs.neovim = {
# neovim: https://github.com/neovim/neovim
enable = true;
viAlias = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
# docs: surround-nvim: https://github.com/ur4ltz/surround.nvim/
# docs: vim-surround: https://github.com/tpope/vim-surround
vim-surround
# docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim
fzf-vim
# docs: https://github.com/KeitaNakamura/tex-conceal.vim/
({
plugin = tex-conceal-vim;
type = "viml";
config = ''
" present prettier fractions
let g:tex_conceal_frac=1
'';
})
({
plugin = vim-SyntaxRange;
type = "viml";
config = ''
" enable markdown-style codeblock highlighting for tex code
autocmd BufEnter * call SyntaxRange#Include('```tex', '```', 'tex', 'NonText')
" autocmd Syntax tex set conceallevel=2
'';
})
# nabla renders inline math in any document, but it's buggy.
# https://github.com/jbyuki/nabla.nvim
# ({
# plugin = pkgs.nabla;
# type = "lua";
# config = ''
# require'nabla'.enable_virt()
# '';
# })
# treesitter syntax highlighting: https://nixos.wiki/wiki/Tree_sitters
# docs: https://github.com/nvim-treesitter/nvim-treesitter
# config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix
# this is required for tree-sitter to even highlight
({
plugin = nvim-treesitter.withAllGrammars;
type = "lua";
config = ''
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
-- disable treesitter on Rust so that we can use SyntaxRange
-- and leverage TeX rendering in rust projects
disable = { "rust", "tex", "latex" },
-- disable = { "tex", "latex" },
-- true to also use builtin vim syntax highlighting when treesitter fails
additional_vim_regex_highlighting = false
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
mcope_incremental = "grc",
node_decremental = "grm"
}
},
indent = {
enable = true,
disable = {}
}
}
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
'';
})
];
extraConfig = ''
" let the terminal handle mouse events, that way i get OS-level ctrl+shift+c/etc
" this used to be default, until <https://github.com/neovim/neovim/pull/19290>
set mouse=
" copy/paste to system clipboard
set clipboard=unnamedplus
" screw tabs; always expand them into spaces
set expandtab
" at least don't open files with sections folded by default
set nofoldenable
" allow text substitutions for certain glyphs.
" higher number = more aggressive substitution (0, 1, 2, 3)
" i only make use of this for tex, but it's unclear how to
" apply that *just* to tex and retain the SyntaxRange stuff.
set conceallevel=2
" horizontal rule under the active line
" set cursorline
" highlight trailing space & related syntax errors (doesn't seem to work??)
" let c_space_errors=1
" let python_space_errors=1
" enable highlighting of leading/trailing spaces,
" and especially tabs
" source: https://www.reddit.com/r/neovim/comments/chlmfk/highlight_trailing_whitespaces_in_neovim/
set list
set listchars=tab:\·,trail:·,extends:,precedes:,nbsp:
'';
};
}

View File

@@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin = let
host = config.networking.hostName;
user_pubkey = (import ../pubkeys.nix).users."${host}";
known_hosts_text = builtins.concatStringsSep
"\n"
(builtins.attrValues (import ../pubkeys.nix).hosts);
in { config, ...}: {
# ssh key is stored in private storage
home.file.".ssh/id_ed25519".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/private/.ssh/id_ed25519";
home.file.".ssh/id_ed25519.pub".text = user_pubkey;
programs.ssh.enable = true;
# this optionally accepts multiple known_hosts paths, separated by space.
programs.ssh.userKnownHostsFile = builtins.toString (pkgs.writeText "known_hosts" known_hosts_text);
};
}

View File

@@ -0,0 +1,16 @@
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
# TODO: this should only be shipped on gui platforms
sops.secrets."sublime_music_config" = {
owner = config.users.users.colin.name;
sopsFile = ../../secrets/universal/sublime_music_config.json.bin;
format = "binary";
};
home-manager.users.colin = let sysconfig = config; in { config, ... }: {
# sublime music player
xdg.configFile."sublime-music/config.json".source =
config.lib.file.mkOutOfStoreSymlink sysconfig.sops.secrets.sublime_music_config.path;
};
}

View File

@@ -0,0 +1,19 @@
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin.xdg.configFile."vlc/vlcrc".text =
let
feeds = import ./feeds.nix { inherit lib; };
podcastUrls = lib.strings.concatStringsSep "|" (
builtins.map (feed: feed.url) feeds.podcasts
);
in ''
[podcast]
podcast-urls=${podcastUrls}
[core]
metadata-network-access=0
[qt]
qt-privacy-ask=0
'';
}

View File

@@ -0,0 +1,63 @@
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
# we don't need to full zsh dir -- just the history file --
# but zsh will sometimes backup the history file and we get fewer errors if we do proper mounts instead of symlinks.
sane.impermanence.home-dirs = [ ".local/share/zsh" ];
home-manager.users.colin.programs.zsh = {
enable = true;
enableSyntaxHighlighting = true;
enableVteIntegration = true;
history.ignorePatterns = [ "rm *" ];
dotDir = ".config/zsh";
history.path = "/home/colin/.local/share/zsh/history";
initExtraBeforeCompInit = ''
# p10k instant prompt
# run p10k configure to configure, but it can't write out its file :-(
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
'';
initExtra = ''
# zmv is a way to do rich moves/renames, with pattern matching/substitution.
# see for an example: <https://filipe.kiss.ink/zmv-zsh-rename/>
autoload -Uz zmv
# disable `rm *` confirmations
setopt rmstarsilent
function nd() {
mkdir -p "$1";
pushd "$1";
}
'';
# prezto = oh-my-zsh fork; controls prompt, auto-completion, etc.
# see: https://github.com/sorin-ionescu/prezto
prezto = {
enable = true;
pmodules = [
"environment"
"terminal"
"editor"
"history"
"directory"
"spectrum"
"utility"
"completion"
"prompt"
"git"
];
prompt.theme = "powerlevel10k";
utility.safeOps = false; # disable `mv` confirmation (and supposedly `rm`, too)
};
};
home-manager.users.colin.home.shellAliases = {
":q" = "exit";
# common typos
"cd.." = "cd ..";
"cd../" = "cd ../";
};
}

View File

@@ -2,15 +2,34 @@
with lib;
let
cfg = config.colinsane.image;
cfg = config.sane.image;
in
{
options = {
colinsane.image.extraBootFiles = mkOption {
sane.image.enable = mkOption {
default = true;
type = types.bool;
description = "whether to enable image targets. this doesn't mean they'll be built unless you specifically reference the target.";
};
# packages whose contents should be copied directly into the /boot partition.
# e.g. EFI loaders, u-boot bootloader, etc.
sane.image.extraBootFiles = mkOption {
default = [];
type = types.listOf types.package;
};
colinsane.image.extraGPTPadding = mkOption {
# extra (empty) directories to create in the rootfs.
# for example, /var/log might be required by the boot process, so ensure it exists.
sane.image.extraDirectories = mkOption {
default = [];
type = types.listOf types.str;
};
# the GPT header is fixed to Logical Block Address 1,
# but we can actually put the partition entries anywhere.
# this option reserves so many bytes after LBA 1 but *before* the partition entries.
# this is not universally supported, but is an easy hack to claim space near the start
# of the disk for other purposes (e.g. firmware blobs)
sane.image.extraGPTPadding = mkOption {
default = 0;
# NB: rpi doesn't like non-zero values for this.
# at the same time, spinning disks REALLY need partitions to be aligned to 4KiB boundaries.
@@ -18,7 +37,8 @@ in
# default = 2014 * 512; # standard is to start part0 at sector 2048 (versus 34 if no padding)
type = types.int;
};
colinsane.image.firstPartGap = mkOption {
# optional space (in bytes) to leave unallocated after the GPT structure and before the first partition.
sane.image.firstPartGap = mkOption {
# align the first part to 16 MiB.
# do this by inserting a gap of 16 MiB - gptHeaderSize
# and then multiply by 1MiB and subtract 1 because mobile-nixos
@@ -26,7 +46,7 @@ in
default = (16 * 1024 * 1024 - 34 * 512) * 1024 * 1024 - 1;
type = types.nullOr types.int;
};
colinsane.image.bootPartSize = mkOption {
sane.image.bootPartSize = mkOption {
default = 512 * 1024 * 1024;
type = types.int;
};
@@ -37,6 +57,7 @@ in
(builtins.substring 0 (builtins.stringLength sub) super) == sub
);
# return the (string) path to get from `stem` to `path`
# or errors if not a sub-path
relPath = stem: path: (
builtins.head (builtins.match "^${stem}(.+)" path)
);
@@ -47,14 +68,6 @@ in
# resolves to e.g. "nix/store", "/store" or ""
storeRelPath = relPath nixFs.mountPoint "/nix/store";
# return a list of all the `device` values -- one for each fileSystems."$x"
devices = builtins.attrValues (builtins.mapAttrs (mount: entry: entry.device) fileSystems);
# filter the devices to just those which sit under nixFs
subNixMounts = builtins.filter (a: startsWith (builtins.toString a) nixFs.mountPoint) devices;
# e.g. ["/nix/persist/var"] -> ["/persist/var"] if nixFs sits at /nix
subNixRelMounts = builtins.map (m: relPath nixFs.mountPoint m) subNixMounts;
makeSubNixMounts = builtins.toString (builtins.map (m: "mkdir -p ./${m};") subNixRelMounts);
uuidFromFs = fs: builtins.head (builtins.match "/dev/disk/by-uuid/(.+)" fs.device);
vfatUuidFromFs = fs: builtins.replaceStrings ["-"] [""] (uuidFromFs fs);
@@ -104,11 +117,10 @@ in
populateCommands =
let
closureInfo = buildPackages.closureInfo { rootPaths = config.system.build.toplevel; };
extraRelPaths = builtins.toString (builtins.map (p: "./" + builtins.toString(relPath nixFs.mountPoint p)) cfg.extraDirectories);
in
''
mkdir -p ./${storeRelPath}
# TODO: we should create the dirs required for boot (/var/log?). the rest are populated automatically.
# $(makeSubNixMounts)
mkdir -p ./${storeRelPath} ${extraRelPaths}
echo "Copying system closure..."
while IFS= read -r path; do
echo " Copying $path"

View File

@@ -6,69 +6,62 @@
with lib;
let
cfg = config.colinsane.impermanence;
cfg = config.sane.impermanence;
# taken from sops-nix code: checks if any secrets are needed to create /etc/shadow
secretsForUsers = (lib.filterAttrs (_: v: v.neededForUsers) config.sops.secrets) != {};
in
{
imports = [
# TODO: move to flake.nix?
impermanence.nixosModule
];
options = {
colinsane.impermanence.enable = mkOption {
sane.impermanence.enable = mkOption {
default = false;
type = types.bool;
};
sane.impermanence.home-dirs = mkOption {
default = [];
type = types.listOf (types.either types.str (types.attrsOf types.str));
};
sane.impermanence.service-dirs = mkOption {
default = [];
type = types.listOf (types.either types.str (types.attrsOf types.str));
};
};
config = mkIf cfg.enable {
config = let
map-dir = defaults: dir: if isString dir then
map-dir defaults { directory = "${defaults.directory}${dir}"; }
else
defaults // dir
;
map-dirs = defaults: dirs: builtins.map (map-dir defaults) dirs;
map-home-dirs = map-dirs { user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/"; };
map-sys-dirs = map-dirs { user = "root"; group = "root"; mode = "0755"; directory = ""; };
in mkIf cfg.enable {
sane.image.extraDirectories = [ "/nix/persist/var/log" ];
environment.persistence."/nix/persist" = {
directories = [
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/archive"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/dev"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/records"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/ref"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/tmp"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/use"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/Music"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/Pictures"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/Videos"; }
# cache is probably too big to fit on the tmpfs
# TODO: we could bind-mount it to something which gets cleared per boot, though.
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/.cache"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/.cargo"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/.rustup"; }
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/.ssh"; }
# intentionally omitted:
# "/home/colin/.config" # managed by home-manager
# "/home/colin/.local" # nothing useful in here
# "/home/colin/.mozilla" # managed by home-manager
# creds. TODO: can i manage this with home-manager?
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/.config/spotify"; }
# creds, but also 200 MB of node modules, etc
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/.config/discord"; }
# creds/session keys, etc
{ user = "colin"; group = "users"; mode = "0755"; directory = "/home/colin/.config/Element"; }
{ user = "root"; group = "root"; mode = "0700"; directory = "/etc/NetworkManager/system-connections"; }
directories = (map-home-dirs cfg.home-dirs) ++ (map-sys-dirs [
# NB: this `0700` here clobbers the perms for /persist/etc, breaking boot on freshly-deployed devices
# { mode = "0700"; directory = "/etc/NetworkManager/system-connections"; }
# "/etc/nixos"
{ user = "root"; group = "root"; mode = "0755"; directory = "/etc/ssh"; }
# "/etc/ssh" # persist only the specific files we want, instead
"/var/log"
"/var/backup" # for e.g. postgres dumps
# "/var/lib/AccountsService" # not sure what this is, but it's empty
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/lib/alsa"; } # preserve output levels, default devices
"/var/lib/alsa" # preserve output levels, default devices
# "/var/lib/blueman" # files aren't human readable
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/lib/bluetooth"; } # preserve bluetooth handshakes
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/lib/colord"; } # preserve color calibrations (?)
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/lib/duplicity"; } # we need this mostly because of the size of duplicity's cache
"/var/lib/bluetooth" # preserve bluetooth handshakes
"/var/lib/colord" # preserve color calibrations (?)
# "/var/lib/dhclient" # empty on lappy; dunno about desko
# "/var/lib/fwupd" # not sure why this would need persistent state
# "/var/lib/geoclue" # empty on lappy
# "/var/lib/lockdown" # empty on desko; might store secrets after iOS handshake?
# "/var/lib/logrotate.status" # seems redundant with what's in /var/log?
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/lib/machines"; } # maybe not needed, but would be painful to add a VM and forget.
"/var/lib/machines" # maybe not needed, but would be painful to add a VM and forget.
# "/var/lib/misc" # empty on lappy
# "/var/lib/NetworkManager" # looks to be mostly impermanent state?
# "/var/lib/NetworkManager-fortisslvpn" # empty on lappy
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/lib/nixos"; } # has some uid/gid maps; not sure what happens if we lose this.
# "/var/lib/nixos" # has some uid/gid maps, but we enforce these to be deterministic.
# "/var/lib/PackageKit" # wtf is this?
# "/var/lib/power-profiles-daemon" # redundant with nixos declarations
# "/var/lib/private" # empty on lappy
@@ -77,45 +70,25 @@ in
# "/var/lib/upower" # historic charge data. unnecessary, but maybe used somewhere?
#
# servo additions:
{ user = "998"; group = "996"; mode = "0755"; directory = "/var/lib/acme"; } # TODO: mode?
# "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix
# "/var/lib/dovecot"
# "/var/lib/duplicity"
{ user = "994"; group = "993"; mode = "0755"; directory = "/var/lib/gitea"; } # TODO: mode? could be more granular
{ user = "261"; group = "261"; mode = "0755"; directory = "/var/lib/ipfs"; } # TODO: mode? could be more granular
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/lib/jackett"; } # TODO: mode? we only need this to save Indexer creds ==> migrate to config?
{ user = "996"; group = "994"; mode = "0755"; directory = "/var/lib/jellyfin"; } # TODO: mode? could be more granular
{ user = "993"; group = "992"; mode = "0755"; directory = "/var/lib/matrix-appservice-irc"; } # TODO: mode?
{ user = "224"; group = "224"; mode = "0755"; directory = "/var/lib/matrix-synapse"; } # TODO: mode?
{ user = "221"; group = "221"; mode = "0755"; directory = "/var/lib/opendkim"; } # TODO: mode? move this to the nix config (SOPS)
{ user = "997"; group = "995"; mode = "0755"; directory = "/var/lib/pleroma"; } # TODO: mode? could be more granular
{ user = "71"; group = "71"; mode = "0755"; directory = "/var/lib/postgresql"; } # TODO: mode?
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/lib/postfix"; } # TODO: mode? could be more granular
{ user = "70"; group = "70"; mode = "0755"; directory = "/var/lib/transmission"; } # TODO: mode? we need this specifically for the stats tracking in .config/
{ user = "colin"; group = "users"; mode = "0755"; directory = "/var/lib/uninsane"; }
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/log"; }
{ user = "root"; group = "root"; mode = "0755"; directory = "/var/backup"; } # for e.g. postgres dumps
# TODO: what even GOES in /srv?
{ user = "root"; group = "root"; mode = "0755"; directory = "/srv"; }
];
files = [
"/etc/machine-id"
# "/home/colin/knowledge"
"/home/colin/.zsh_history"
# # XXX these only need persistence because i have mutableUsers = true, i think
# "/etc/group"
# "/etc/passwd"
# "/etc/shadow"
# { file = "/home/test2"; persistentStoragePath = "/nix/persist"; }
];
] ++ cfg.service-dirs);
# /etc/machine-id is a globally unique identifier used for:
# - systemd-networkd: DHCP lease renewal (instead of keying by the MAC address)
# - systemd-journald: to filter logs by host
# - chromium (potentially to track re-installations)
# - gdbus; system services that might upgrade to AF_LOCAL if both services can confirm they're on the same machine
# of these, systemd-networkd is the only legitimate case to persist the machine-id.
# depersisting it should be "safe"; edge-cases like systemd-networkd can be directed to use some other ID if necessary.
# nixos-impermanence shows binding the host ssh priv key to this; i could probably hash the host key into /etc/machine-id if necessary.
# files = [ "/etc/machine-id" ];
};
systemd.services.sane-sops = {
description = "sops relies on /etc/ssh being available, so re-run its activation AFTER fs-local";
script = config.system.activationScripts.setupSecrets.text;
after = [ "fs-local.target" ];
wantedBy = [ "multi-user.target" ];
# secret decoding depends on /etc/ssh keys, which may be persisted
system.activationScripts.setupSecrets.deps = [ "persist-ssh-host-keys" ];
system.activationScripts.setupSecretsForUsers = lib.mkIf secretsForUsers {
deps = [ "persist-ssh-host-keys" ];
};
# populated by ssh.nix, which persists /etc/ssh/host_keys
system.activationScripts.persist-ssh-host-keys.text = lib.mkDefault "";
};
}

View File

@@ -1,34 +0,0 @@
{ lib, config, ... }:
with lib;
let
cfg = config.colinsane.nixcache;
in
{
options = {
colinsane.nixcache.enable = mkOption {
default = false;
type = types.bool;
};
};
config = {
# use our own binary cache
nix.settings = mkIf cfg.enable {
substituters = [
"https://nixcache.uninsane.org"
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nixcache.uninsane.org:r3WILM6+QrkmsLgqVQcEdibFD7Q/4gyzD9dGT33GP70="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
# allow `nix flake ...` command
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
};
}

47
modules/nixcache.nix Normal file
View File

@@ -0,0 +1,47 @@
# speed up builds from e.g. moby or lappy by having them query desko and servo first.
# if one of these hosts is offline, instead manually specify just cachix:
# - `nixos-rebuild --option substituters https://cache.nixos.org/`
#
# future improvements:
# - apply for community arm build box:
# - <https://github.com/nix-community/aarch64-build-box>
# - don't require all substituters to be online:
# - <https://github.com/NixOS/nix/pull/7188>
{ lib, config, ... }:
with lib;
let
cfg = config.sane.nixcache;
in
{
options = {
sane.nixcache.enable = mkOption {
default = false;
type = types.bool;
};
sane.nixcache.enable-trusted-keys = mkOption {
default = config.sane.nixcache.enable;
type = types.bool;
};
};
config = {
# use our own binary cache
# to explicitly build from a specific cache (in case others are down):
# - `nixos-rebuild ... --option substituters https://cache.nixos.org`
# - `nix build ... --substituters http://desko:5000`
nix.settings.substituters = mkIf cfg.enable [
"https://nixcache.uninsane.org"
"http://desko:5000"
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
# always trust our keys (so one can explicitly use a substituter even if it's not the default
nix.settings.trusted-public-keys = mkIf cfg.enable-trusted-keys [
"nixcache.uninsane.org:r3WILM6+QrkmsLgqVQcEdibFD7Q/4gyzD9dGT33GP70="
"desko:Q7mjjqoBMgNQ5P0e63sLur65A+D4f3Sv4QiycDIKxiI="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}

272
modules/packages.nix Normal file
View File

@@ -0,0 +1,272 @@
{ config, lib, pkgs, ... }:
with lib;
with pkgs;
let
cfg = config.sane.packages;
consolePkgs = [
backblaze-b2
cdrtools
dmidecode
duplicity
efivar
flashrom
fwupd
gnupg
gocryptfs
gopass
gopass-jsonapi
ifuse
ipfs
libimobiledevice
libsecret # for managing user keyrings
lm_sensors # for sensors-detect
lshw
ffmpeg
memtester
networkmanager
nixpkgs-review
# nixos-generators
# nettools
nmon
oathToolkit # for oathtool
# ponymix
pulsemixer
python3
rsync
# python3Packages.eyeD3 # music tagging
sane-scripts
sequoia
snapper
sops
speedtest-cli
sqlite # to debug sqlite3 databases
ssh-to-age
sudo
# tageditor # music tagging
unar
visidata
w3m
wireguard-tools
# youtube-dl
yt-dlp
];
guiPkgs = [
# GUI only
aerc # email client
audacity
celluloid # mpv frontend
chromium
clinfo
{ pkg = dino; private = ".local/share/dino"; }
electrum
# creds/session keys, etc
{ pkg = element-desktop; private = ".config/Element"; }
# `emote` will show a first-run dialog based on what's in this directory.
# mostly, it just keeps a LRU of previously-used emotes to optimize display order.
# TODO: package [smile](https://github.com/mijorus/smile) for probably a better mobile experience.
{ pkg = emote; dir = ".local/share/Emote"; }
evince # works on phosh
# { pkg = fluffychat-moby; dir = ".local/share/chat.fluffy.fluffychat"; } # TODO: ship normal fluffychat on non-moby?
foliate
font-manager
# XXX by default fractal stores its state in ~/.local/share/<UUID>.
# after logging in, manually change ~/.local/share/keyrings/... to point it to some predictable subdir.
# then reboot (so that libsecret daemon re-loads the keyring...?)
{ pkg = fractal-next; private = ".local/share/fractal"; }
gimp # broken on phosh
gnome.cheese
gnome.dconf-editor
gnome-feeds # RSS reader (with claimed mobile support)
gnome.file-roller
gnome.gnome-disk-utility
gnome.gnome-maps # works on phosh
gnome.nautilus
# gnome-podcasts
gnome.gnome-system-monitor
gnome.gnome-terminal # works on phosh
gnome.gnome-weather
{ pkg = gpodder-configured; dir = "gPodder/Downloads"; }
gthumb
handbrake
inkscape
kdenlive
kid3 # audio tagging
krita
libreoffice-fresh # XXX colin: maybe don't want this on mobile
lollypop
mesa-demos
{ pkg = mpv; dir = ".config/mpv/watch_later"; }
networkmanagerapplet
# not strictly necessary, but allows caching articles; offline use, etc.
{ pkg = newsflash; dir = ".local/share/news-flash"; }
# settings (electron app). TODO: can i manage these settings with home-manager?
{ pkg = obsidian; dir = ".config/obsidian"; }
pavucontrol
# picard # music tagging
playerctl
libsForQt5.plasmatube # Youtube player
soundconverter
# sublime music persists any downloaded albums here.
# it doesn't obey a conventional ~/Music/{Artist}/{Album}/{Track} notation, so no symlinking
# config (e.g. server connection details) is persisted in ~/.config/sublime-music/config.json
# possible to pass config as a CLI arg (sublime-music -c config.json)
{ pkg = sublime-music; dir = ".local/share/sublime-music"; }
tdesktop # broken on phosh
{ pkg = tokodon; dir = ".cache/KDE/tokodon"; }
# vlc remembers play position in ~/.config/vlc/vlc-qt-interface.conf
{ pkg = vlc; dir = ".config/vlc"; }
whalebird # pleroma client. input is broken on phosh
xdg-utils # for xdg-open
xterm # broken on phosh
]
++ (if pkgs.system == "x86_64-linux" then
[
# x86_64 only
# creds, but also 200 MB of node modules, etc
(let discord = (pkgs.discord.override {
# XXX 2022-07-31: fix to allow links to open in default web-browser:
# https://github.com/NixOS/nixpkgs/issues/78961
nss = pkgs.nss_latest;
}); in { pkg = discord; dir = ".config/discord"; })
# kaiteki # Pleroma client
# gnome.zenity # for kaiteki (it will use qarma, kdialog, or zenity)
logseq
losslesscut-bin
makemkv
# actual monero blockchain (not wallet/etc; safe to delete, just slow to regenerate)
{ pkg = monero-gui; dir = ".bitmonero"; }
# creds, media
{ pkg = signal-desktop; dir = ".config/Signal"; }
# creds. TODO: can i manage this with home-manager?
{ pkg = spotify; dir = ".config/spotify"; }
# hardenedMalloc solves a crash at startup
(tor-browser-bundle-bin.override { useHardenedMalloc = false; })
# zcash coins. safe to delete, just slow to regenerate (10-60 minutes)
{ pkg = zecwallet-lite; private = ".zcash"; }
] else []);
# general-purpose utilities that we want any user to be able to access
# (specifically: root, in case of rescue)
systemPkgs = [
btrfs-progs
cryptsetup
dig
efibootmgr
fatresize
fd
file
gptfdisk
hdparm
htop
iftop
inetutils # for telnet
iotop
iptables
jq
killall
lsof
netcat
nethogs
nmap
openssl
parted
pciutils
powertop
ripgrep
screen
smartmontools
socat
usbutils
wget
];
# useful devtools:
devPkgs = [
bison
dtc
flex
gcc
gdb
# gcc-arm-embedded
# gcc_multi
gnumake
mercurial
mix2nix
rustup
swig
];
in
{
options = {
# packages to deploy to the user's home
sane.packages.extraUserPkgs = mkOption {
default = [ ];
# each entry can be either a package, or attrs:
# { pkg = package; dir = optional string; private = optional string };
type = types.listOf (types.either types.package types.attrs);
};
sane.packages.enableConsolePkgs = mkOption {
default = false;
type = types.bool;
};
sane.packages.enableGuiPkgs = mkOption {
default = false;
type = types.bool;
};
sane.packages.enableDevPkgs = mkOption {
description = ''
enable packages that are useful for building other software by hand.
you should prefer to keep this disabled except when prototyping, e.g. packaging new software.
'';
default = false;
type = types.bool;
};
sane.packages.enableSystemPkgs = mkOption {
default = false;
type = types.bool;
description = "enable system-wide packages";
};
sane.packages.enabledUserPkgs = mkOption {
default = cfg.extraUserPkgs
++ (if cfg.enableConsolePkgs then consolePkgs else [])
++ (if cfg.enableGuiPkgs then guiPkgs else [])
++ (if cfg.enableDevPkgs then devPkgs else [])
;
type = types.listOf (types.either types.package types.attrs);
description = "generated from other config options";
};
};
config = {
environment.systemPackages = mkIf cfg.enableSystemPkgs systemPkgs;
};
}

34
modules/pubkeys.nix Normal file
View File

@@ -0,0 +1,34 @@
# create ssh key by running:
# - `ssh-keygen -t ed25519`
let
withHost = host: key: "${host} ${key}";
withUser = user: key: "${key} ${user}";
keys = rec {
lappy = {
host = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSJnqmVl9/SYQ0btvGb0REwwWY8wkdkGXQZfn/1geEc";
users.colin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDpmFdNSVPRol5hkbbCivRhyeENzb9HVyf9KutGLP2Zu";
};
desko = {
host = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFw9NoRaYrM6LbDd3aFBc4yyBlxGQn8HjeHd/dZ3CfHk";
users.colin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPU5GlsSfbaarMvDA20bxpSZGWviEzXGD8gtrIowc1pX";
};
servo = {
host = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOfdSmFkrVT6DhpgvFeQKm3Fh9VKZ9DbLYOPOJWYQ0E8";
users.colin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPS1qFzKurAdB9blkWomq8gI1g0T3sTs9LsmFOj5VtqX";
};
moby = {
host = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1N/IT3nQYUD+dBlU1sTEEVMxfOyMkrrDeyHcYgnJvw";
users.colin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrR+gePnl0nV/vy7I5BzrGeyVL+9eOuXHU1yNE3uCwU";
};
"uninsane.org" = servo;
"git.uninsane.org" = servo;
};
in {
# map hostname -> something suitable for known_keys
hosts = builtins.mapAttrs (host: keys: withHost host keys.host) keys;
# map hostname -> something suitable for authorized_keys to allow access to colin@<hostname>
users = builtins.mapAttrs (host: keys: withUser "colin@${host}" keys.users.colin) keys;
}

View File

@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./duplicity.nix
./nixserve.nix
];
}

View File

@@ -1,22 +1,24 @@
# docs: https://search.nixos.org/options?channel=21.11&query=duplicity
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.colinsane.services.duplicity;
cfg = config.sane.services.duplicity;
in
{
options = {
colinsane.services.duplicity.enable = mkOption {
sane.services.duplicity.enable = mkOption {
default = false;
type = types.bool;
};
};
config = mkIf cfg.enable {
# we need this mostly because of the size of duplicity's cache
sane.impermanence.service-dirs = [ "/var/lib/duplicity" ];
services.duplicity.enable = true;
services.duplicity.targetUrl = ''"$DUPLICITY_URL"'';
services.duplicity.escapeUrl = false;
services.duplicity.targetUrl = "$DUPLICITY_URL";
# format: PASSPHRASE=<cleartext> \n DUPLICITY_URL=b2://...
# two sisters
# PASSPHRASE: remote backups will be encrypted using this passphrase (using gpg)
@@ -29,28 +31,28 @@ in
services.duplicity.secretFile = config.sops.secrets.duplicity_passphrase.path;
# NB: manually trigger with `systemctl start duplicity`
services.duplicity.frequency = "daily";
services.duplicity.exclude = [
# impermanent/inconsequential data:
"/dev"
"/proc"
"/run"
"/sys"
"/tmp"
# bind mounted (dupes):
"/var/lib"
# other mounts
"/mnt"
# data that's not worth the cost to backup:
"/nix/persist/var/lib/uninsane/media"
"/nix/persist/home/colin/tmp"
"/nix/persist/home/colin/Videos"
"/home/colin/tmp"
"/home/colin/Videos"
];
services.duplicity.extraFlags = [
# without --allow-source-mismatch, duplicity will abort if you change the hostname between backups
"--allow-source-mismatch"
# includes/exclude ordering matters, so we explicitly control it here.
# the first match decides a file's treatment. so here:
# - /nix/persist/home/colin/tmp is excluded
# - *other* /nix/persist/ files are included by default
# - anything else under `/` are excluded by default
"--exclude" "/nix/persist/home/colin/dev/home-logic/coremem/out" # this can reach > 1 TB
"--exclude" "/nix/persist/home/colin/use/iso" # might want to re-enable... but not critical
"--exclude" "/nix/persist/home/colin/.local/share/sublime-music" # music cache. better to just keep the HQ sources
"--exclude" "/nix/persist/home/colin/.local/share/Steam" # can just re-download games
"--exclude" "/nix/persist/home/colin/.bitmonero/lmdb" # monero blockchain
"--exclude" "/nix/persist/home/colin/.rustup"
"--exclude" "/nix/persist/home/colin/ref" # publicly available data: no point in duplicating it
"--exclude" "/nix/persist/home/colin/tmp"
"--exclude" "/nix/persist/home/colin/Videos"
"--exclude" "/nix/persist/var/lib/duplicity" # don't back up our own backup state!
"--include" "/nix/persist"
"--exclude" "/"
];
# set this for the FIRST backup, then remove it to enable incremental backups
@@ -66,5 +68,26 @@ in
"/dev/mmc0 5M"
];
};
# based on <nixpkgs:nixos/modules/services/backup/duplicity.nix> with changes:
# - remove the cleanup step: API key doesn't have delete perms
# - don't escape the targetUrl: it comes from an env var set in the secret file
systemd.services.duplicity.script = let
cfg = config.services.duplicity;
target = cfg.targetUrl;
extra = escapeShellArgs ([ "--archive-dir" "/var/lib/duplicity" ] ++ cfg.extraFlags);
dup = "${pkgs.duplicity}/bin/duplicity";
in lib.mkForce ''
set -x
# ${dup} cleanup ${target} --force ${extra}
# ${lib.optionalString (cfg.cleanup.maxAge != null) "${dup} remove-older-than ${lib.escapeShellArg cfg.cleanup.maxAge} ${target} --force ${extra}"}
# ${lib.optionalString (cfg.cleanup.maxFull != null) "${dup} remove-all-but-n-full ${builtins.toString cfg.cleanup.maxFull} ${target} --force ${extra}"}
# ${lib.optionalString (cfg.cleanup.maxIncr != null) "${dup} remove-all-inc-of-but-n-full ${toString cfg.cleanup.maxIncr} ${target} --force ${extra}"}
exec ${dup} ${if cfg.fullIfOlderThan == "always" then "full" else "incr"} ${lib.escapeShellArg cfg.root} ${target} ${lib.escapeShellArgs ([]
++ concatMap (p: [ "--include" p ]) cfg.include
++ concatMap (p: [ "--exclude" p ]) cfg.exclude
++ (lib.optionals (cfg.fullIfOlderThan != "never" && cfg.fullIfOlderThan != "always") [ "--full-if-older-than" cfg.fullIfOlderThan ])
)} ${extra}
'';
};
}

View File

@@ -0,0 +1,33 @@
# docs: https://nixos.wiki/wiki/Binary_Cache
# to copy something to this machine's nix cache, do:
# nix copy --to ssh://nixcache.uninsane.org PACKAGE
{ config, lib, ... }:
with lib;
let
cfg = config.sane.services.nixserve;
in
{
options = {
sane.services.nixserve.enable = mkOption {
default = false;
type = types.bool;
};
sane.services.nixserve.sopsFile = mkOption {
type = types.path;
description = "path to file that contains the nix_serv_privkey secret (can be in VCS)";
};
};
config = mkIf cfg.enable {
services.nix-serve = {
enable = true;
secretKeyFile = config.sops.secrets.nix_serve_privkey.path;
openFirewall = true; # not needed for servo; only desko
};
sops.secrets.nix_serve_privkey = {
sopsFile = cfg.sopsFile;
};
};
}

View File

@@ -1,33 +0,0 @@
{ pkgs, ... }:
{
imports = [
./fs.nix
./home-manager.nix
./secrets.nix
./users.nix
./vpn.nix
];
time.timeZone = "America/Los_Angeles";
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [ font-awesome twitter-color-emoji hack-font ];
fontconfig.enable = true;
fontconfig.defaultFonts = {
emoji = [ "Font Awesome 6 Free" "Twitter Color Emoji" ];
monospace = [ "Hack" ];
serif = [ "DejaVu Serif" ];
sansSerif = [ "DejaVu Sans" ];
};
};
# programs.vim.defaultEditor = true;
environment.variables = {
EDITOR = "vim";
# git claims it should use EDITOR, but it doesn't!
GIT_EDITOR = "vim";
};
}

View File

@@ -1,37 +0,0 @@
{ pkgs, ... }:
let sshOpts = {
fsType = "fuse.sshfs";
options = [
"x-systemd.automount"
"_netdev"
"user"
"idmap=user"
"transform_symlinks"
"identityfile=/home/colin/.ssh/id_ed25519"
"allow_other"
"default_permissions"
"uid=1000"
"gid=100"
];
};
in
{
fileSystems."/mnt/servo-media-wan" = {
device = "colin@uninsane.org:/var/lib/uninsane/media";
inherit (sshOpts) fsType options;
};
fileSystems."/mnt/servo-media-lan" = {
device = "colin@servo:/var/lib/uninsane/media";
inherit (sshOpts) fsType options;
};
fileSystems."/mnt/desko-home" = {
device = "colin@desko:/home/colin";
inherit (sshOpts) fsType options;
};
environment.systemPackages = [
pkgs.sshfs-fuse
];
}

View File

@@ -1,365 +0,0 @@
# docs:
# https://rycee.gitlab.io/home-manager/
# https://rycee.gitlab.io/home-manager/options.html
# man home-configuration.nix
#
{ home-manager, lib, config, pkgs, ... }:
with lib;
let
cfg = config.colinsane.home-manager;
in
{
imports = [
home-manager.nixosModule
];
options = {
colinsane.home-manager.enable = mkOption {
default = false;
type = types.bool;
};
colinsane.home-manager.extraPackages = mkOption {
default = [ ];
type = types.listOf types.package;
};
colinsane.home-manager.windowManager = mkOption {
default = {};
type = types.attrs;
};
colinsane.home-manager.programs = mkOption {
default = {};
type = types.attrs;
};
};
config = lib.mkIf cfg.enable {
sops.secrets."aerc_accounts" = {
owner = config.users.users.colin.name;
sopsFile = ../../secrets/universal/aerc_accounts.conf;
format = "binary";
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# XXX this weird rename + closure is to get home-manager's `config.lib.file` to exist.
# see: https://github.com/nix-community/home-manager/issues/589#issuecomment-950474105
home-manager.users.colin = let sysconfig = config; in { config, ... }: {
home.stateVersion = "21.11";
home.username = "colin";
home.homeDirectory = "/home/colin";
# XDG defines things like ~/Desktop, ~/Downloads, etc.
# these clutter the home, so i mostly don't use them.
xdg.userDirs = {
enable = true;
createDirectories = false; # on headless systems, most xdg dirs are noise
desktop = "$HOME/.xdg/Desktop";
documents = "$HOME/dev";
download = "$HOME/tmp";
music = "$HOME/Music";
pictures = "$HOME/Pictures";
publicShare = "$HOME/.xdg/Public";
templates = "$HOME/.xdg/Templates";
videos = "$HOME/Videos";
};
xdg.mimeApps.enable = true;
xdg.mimeApps.defaultApplications = {
"text/html" = [ "librewolf.desktop" ];
"x-scheme-handler/http" = [ "librewolf.desktop" ];
"x-scheme-handler/https" = [ "librewolf.desktop" ];
"x-scheme-handler/about" = [ "librewolf.desktop" ];
"x-scheme-handler/unknown" = [ "librewolf.desktop" ];
};
# convenience
home.file."knowledge".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/knowledge";
home.file."nixos".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/nixos";
xdg.configFile."aerc/accounts.conf".source =
config.lib.file.mkOutOfStoreSymlink sysconfig.sops.secrets.aerc_accounts.path;
programs = {
home-manager.enable = true; # this lets home-manager manage dot-files in user dirs, i think
zsh = {
enable = true;
enableSyntaxHighlighting = true;
enableVteIntegration = true;
dotDir = ".config/zsh";
initExtraBeforeCompInit = ''
# p10k instant prompt
# run p10k configure to configure, but it can't write out its file :-(
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
'';
# prezto = oh-my-zsh fork; controls prompt, auto-completion, etc.
# see: https://github.com/sorin-ionescu/prezto
prezto = {
enable = true;
pmodules = [
"environment"
"terminal"
"editor"
"history"
"directory"
"spectrum"
"utility"
"completion"
"prompt"
"git"
];
prompt = {
theme = "powerlevel10k";
};
};
};
kitty = {
enable = true;
settings.enable_audio_bell = false;
};
git = {
enable = true;
userName = "colin";
userEmail = "colin@uninsane.org";
};
vim = {
enable = true;
extraConfig = ''
" wtf vim project: NOBODY LIKES MOUSE FOR VISUAL MODE
set mouse-=a
" copy/paste to system clipboard
set clipboard=unnamedplus
" <tab> completion menu settings
set wildmenu
set wildmode=longest,list,full
" highlight all matching searches (using / and ?)
set hlsearch
" allow backspace to delete empty lines in insert mode
set backspace=indent,eol,start
" built-in syntax highlighting
syntax enable
" show line/col number in bottom right
set ruler
" highlight trailing space & related syntax errors (does this work?)
let c_space_errors=1
let python_space_errors=1
'';
};
firefox = lib.mkIf (sysconfig.colinsane.gui.enable) {
# common settings to toggle (at runtime, in about:config):
# > security.ssl.require_safe_negotiation
enable = true;
# librewolf is a forked firefox which patches firefox to allow more things
# (like default search engines) to be configurable at runtime.
# many of the settings below won't have effect without those patches.
# see: https://gitlab.com/librewolf-community/settings/-/blob/master/distribution/policies.json
package = pkgs.wrapFirefox pkgs.librewolf-unwrapped {
# inherit the default librewolf.cfg
# it can be further customized via ~/.librewolf/librewolf.overrides.cfg
inherit (pkgs.librewolf-unwrapped) extraPrefsFiles;
libName = "librewolf";
extraPolicies = {
NoDefaultBookmarks = true;
SearchEngines = {
Default = "DuckDuckGo";
};
AppUpdateURL = "https://localhost";
DisableAppUpdate = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DisableSystemAddonUpdate = true;
DisableFirefoxStudies = true;
DisableTelemetry = true;
DisableFeedbackCommands = true;
DisablePocket = true;
DisableSetDesktopBackground = false;
Extensions = {
Install = [
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
"https://addons.mozilla.org/firefox/downloads/latest/i-dont-care-about-cookies/latest.xpi"
"https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi"
"https://addons.mozilla.org/firefox/downloads/latest/bypass-paywalls-clean/latest.xpi"
"https://addons.mozilla.org/firefox/downloads/latest/sidebery/latest.xpi"
"https://addons.mozilla.org/firefox/downloads/latest/ether-metamask/latest.xpi"
];
# remove many default search providers
Uninstall = [
"google@search.mozilla.org"
"bing@search.mozilla.org"
"amazondotcom@search.mozilla.org"
"ebay@search.mozilla.org"
"twitter@search.mozilla.org"
];
};
# XXX doesn't seem to have any effect...
# docs: https://github.com/mozilla/policy-templates#homepage
# Homepage = {
# HomepageURL = "https://uninsane.org/";
# StartPage = "homepage";
# };
# NewTabPage = true;
# docs: https://chromeenterprise.google/policies/?policy=ManagedBookmarks
# docs: https://github.com/mozilla/policy-templates#managedbookmarks
ManagedBookmarks = [
{
toplevel_name = "bookmarks";
}
{
name = "Pleroma";
url = "https://fed.uninsane.org/";
}
{
name = "Home Manager Config";
url = "https://nix-community.github.io/home-manager/options.html";
}
{
name = "Delightful Apps";
url = "https://delightful.club/";
}
{
name = "Linux Phone Apps";
url = "https://linuxphoneapps.org/mobile-compatibility/5/";
}
{
name = "Crowdsupply";
url = "https://www.crowdsupply.com/";
}
{
name = "Mempool";
url = "https://jochen-hoenicke.de/queue";
}
];
};
};
};
# "command not found" will cause the command to be searched in nixpkgs
nix-index.enable = true;
} // cfg.programs;
home.shellAliases = {
":q" = "exit";
# common typos
"cd.." = "cd ..";
"cd../" = "cd ../";
};
wayland.windowManager = cfg.windowManager;
# devtools:
# bison
# dtc
# flex
# gcc-arm-embedded
# gcc_multi
# swig
home.packages = with pkgs; [
backblaze-b2
btrfs-progs
cryptsetup
dig
duplicity
efibootmgr
fatresize
fd
file
gcc
gnumake
gptfdisk
hdparm
htop
iftop
ifuse
inetutils # for telnet
iotop
ipfs
iptables
jq
killall
libimobiledevice
lm_sensors # for sensors-detect
lsof
mix2nix
netcat
nethogs
networkmanager
nixpkgs-review
# nixos-generators
# nettools
nmap
oathToolkit # for oathtool
openssl
parted
pciutils
# ponymix
powertop
pulsemixer
python3
ripgrep
rmlint
rustup
sane-scripts
screen
smartmontools
snapper
socat
sops
ssh-to-age
sudo
usbutils
wget
wireguard-tools
youtube-dl
zola
]
++ (if sysconfig.colinsane.gui.enable then
with pkgs;
[
# GUI only
aerc # email client
audacity
chromium
clinfo
element-desktop # broken on phosh
evince # works on phosh
font-manager
gimp # broken on phosh
gnome.dconf-editor
gnome-feeds # RSS reader (with claimed mobile support)
gnome.file-roller
gnome.gnome-maps # works on phosh
gnome.nautilus
gnome-podcasts
gnome.gnome-terminal # works on phosh
inkscape
libreoffice-fresh # XXX colin: maybe don't want this on mobile
mesa-demos
networkmanagerapplet
obsidian
playerctl
tdesktop # broken on phosh
vlc # works on phosh
whalebird # pleroma client. input is broken on phosh
xterm # broken on phosh
] else [])
++ (if sysconfig.colinsane.gui.enable && pkgs.system == "x86_64-linux" then
with pkgs;
[
# x86_64 only
discord
kaiteki # Pleroma client
gnome.zenity # for kaiteki (it will use qarma, kdialog, or zenity)
signal-desktop
spotify
] else [])
++ cfg.extraPackages;
};
};
}

View File

@@ -1,52 +0,0 @@
{ pkgs, lib, ... }:
# installer docs: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/installation-device.nix
{
# Users are exactly these specified here;
# old ones will be deleted (from /etc/passwd, etc) upon upgrade.
users.mutableUsers = false;
# docs: https://nixpkgs-manual-sphinx-markedown-example.netlify.app/generated/options-db.xml.html#users-users
users.users.colin = {
# sets group to "users" (?)
isNormalUser = true;
home = "/home/colin";
uid = 1000;
# XXX colin: this is what the installer has, but is it necessary?
# group = "users";
extraGroups = [
"wheel"
"nixbuild"
"networkmanager"
# phosh/mobile. XXX colin: unsure if necessary
"video"
"feedbackd"
"dialout" # required for modem access
];
initialPassword = lib.mkDefault "";
shell = pkgs.zsh;
# shell = pkgs.bashInteractive;
# XXX colin: create ssh key for THIS user by logging in and running:
# ssh-keygen -t ed25519
openssh.authorizedKeys.keys = [
# TODO: is this key dead?
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGSDe/y0e9PSeUwYlMPjzhW0UhNsGAGsW3lCG3apxrD5 colin@colin.desktop"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDpmFdNSVPRol5hkbbCivRhyeENzb9HVyf9KutGLP2Zu colin@lappy"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPU5GlsSfbaarMvDA20bxpSZGWviEzXGD8gtrIowc1pX colin@desko"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPS1qFzKurAdB9blkWomq8gI1g0T3sTs9LsmFOj5VtqX colin@servo"
# TODO: should probably only let this authenticate to my server
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGCLCA9KbjXaXNNMJJvqbPO5KQQ64JCdG8sg88AfdKzi colin@moby"
];
};
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
services.openssh = {
enable = true;
permitRootLogin = "no";
passwordAuthentication = false;
};
}

View File

@@ -1,31 +0,0 @@
{ config, ... }:
{
networking.wg-quick.interfaces.ovpnd = {
address = [
"172.27.237.218/32"
"fd00:0000:1337:cafe:1111:1111:ab00:4c8f/128"
];
dns = [
"46.227.67.134"
"192.165.9.158"
];
peers = [
{
allowedIPs = [
"0.0.0.0/0"
"::/0"
];
endpoint = "vpn31.prd.losangeles.ovpn.com:9929";
publicKey = "VW6bEWMOlOneta1bf6YFE25N/oMGh1E1UFBCfyggd0k=";
}
];
privateKeyFile = config.sops.secrets.wg_ovpnd_privkey.path;
# to start: `systemctl start wg-quick-ovpnd`
autostart = false;
};
sops.secrets."wg_ovpnd_privkey" = {
sopsFile = ../../secrets/universal.yaml;
};
}

View File

@@ -1,302 +0,0 @@
diff --git a/pkgs/development/compilers/flutter/default.nix b/pkgs/development/compilers/flutter/default.nix
index 9eba6773448..f51aeb8b624 100644
--- a/pkgs/development/compilers/flutter/default.nix
+++ b/pkgs/development/compilers/flutter/default.nix
@@ -4,20 +4,20 @@ let
getPatches = dir:
let files = builtins.attrNames (builtins.readDir dir);
in map (f: dir + ("/" + f)) files;
- version = "2.10.1";
+ version = "3.0.0";
channel = "stable";
filename = "flutter_linux_${version}-${channel}.tar.xz";
# Decouples flutter derivation from dart derivation,
# use specific dart version to not need to bump dart derivation when bumping flutter.
- dartVersion = "2.16.1";
+ dartVersion = "2.17.0";
dartSourceBase = "https://storage.googleapis.com/dart-archive/channels";
dartForFlutter = dart.override {
version = dartVersion;
sources = {
"${dartVersion}-x86_64-linux" = fetchurl {
url = "${dartSourceBase}/stable/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip";
- sha256 = "sha256-PMY6DCFQC8XrlnFzOEPcwgBAs5/cAvNd78969Z+I1Fk=";
+ sha256 = "57b8fd964e47c81d467aeb95b099a670ab7e8f54a1cd74d45bcd1fdc77913d86";
};
};
};
@@ -29,7 +29,7 @@ in {
pname = "flutter";
src = fetchurl {
url = "https://storage.googleapis.com/flutter_infra_release/releases/${channel}/linux/${filename}";
- sha256 = "sha256-rSfwcglDV2rvJl10j7FByAWmghd2FYxrlkgYnvRO54Y=";
+ sha256 = "e96d75ec8e7dc2a46bc8dad5a9e01c391ab9310ad01c4e3940c963dd263788a0";
};
patches = getPatches ./patches;
};
diff --git a/pkgs/development/compilers/flutter/flutter.nix b/pkgs/development/compilers/flutter/flutter.nix
index 43538ede339..ece25c14b55 100644
--- a/pkgs/development/compilers/flutter/flutter.nix
+++ b/pkgs/development/compilers/flutter/flutter.nix
@@ -56,12 +56,15 @@ let
export STAMP_PATH="$FLUTTER_ROOT/bin/cache/flutter_tools.stamp"
export DART_SDK_PATH="${dart}"
+ export DART="${dart}/bin/dart"
HOME=../.. # required for pub upgrade --offline, ~/.pub-cache
# path is relative otherwise it's replaced by /build/flutter
+ # mkdir -p "$HOME/.cache"
+ # ln -sf "$FLUTTER_ROOT" "$HOME/.cache/flutter"
pushd "$FLUTTER_TOOLS_DIR"
- ${dart}/bin/pub get --offline
+ ${dart}/bin/dart pub get --offline
popd
local revision="$(cd "$FLUTTER_ROOT"; git rev-parse HEAD)"
diff --git a/pkgs/development/compilers/flutter/patches/git-dir.patch b/pkgs/development/compilers/flutter/patches/git-dir.patch
new file mode 100644
index 00000000000..0c736f945ea
--- /dev/null
+++ b/pkgs/development/compilers/flutter/patches/git-dir.patch
@@ -0,0 +1,102 @@
+diff --git a/dev/bots/prepare_package.dart b/dev/bots/prepare_package.dart
+index 468a91a954..5def6897ce 100644
+--- a/dev/bots/prepare_package.dart
++++ b/dev/bots/prepare_package.dart
+@@ -525,7 +525,7 @@ class ArchiveCreator {
+
+ Future<String> _runGit(List<String> args, {Directory? workingDirectory}) {
+ return _processRunner.runProcess(
+- <String>['git', ...args],
++ <String>['git', '--git-dir', '.git', ...args],
+ workingDirectory: workingDirectory ?? flutterRoot,
+ );
+ }
+diff --git a/packages/flutter_tools/lib/src/commands/downgrade.dart b/packages/flutter_tools/lib/src/commands/downgrade.dart
+index bb0eb428a9..4a2a48bb5e 100644
+--- a/packages/flutter_tools/lib/src/commands/downgrade.dart
++++ b/packages/flutter_tools/lib/src/commands/downgrade.dart
+@@ -118,7 +118,7 @@ class DowngradeCommand extends FlutterCommand {
+ // Detect unknown versions.
+ final ProcessUtils processUtils = _processUtils!;
+ final RunResult parseResult = await processUtils.run(<String>[
+- 'git', 'describe', '--tags', lastFlutterVersion,
++ 'git', '--git-dir', '.git', 'describe', '--tags', lastFlutterVersion,
+ ], workingDirectory: workingDirectory);
+ if (parseResult.exitCode != 0) {
+ throwToolExit('Failed to parse version for downgrade:\n${parseResult.stderr}');
+@@ -191,7 +191,7 @@ class DowngradeCommand extends FlutterCommand {
+ continue;
+ }
+ final RunResult parseResult = await _processUtils!.run(<String>[
+- 'git', 'describe', '--tags', sha,
++ 'git', '--git-dir', '.git', 'describe', '--tags', sha,
+ ], workingDirectory: workingDirectory);
+ if (parseResult.exitCode == 0) {
+ buffer.writeln('Channel "${getNameForChannel(channel)}" was previously on: ${parseResult.stdout}.');
+diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart
+index f2068a6ca2..99b161689e 100644
+--- a/packages/flutter_tools/lib/src/version.dart
++++ b/packages/flutter_tools/lib/src/version.dart
+@@ -106,7 +106,7 @@ class FlutterVersion {
+ String? channel = _channel;
+ if (channel == null) {
+ final String gitChannel = _runGit(
+- 'git rev-parse --abbrev-ref --symbolic @{u}',
++ 'git --git-dir .git rev-parse --abbrev-ref --symbolic @{u}',
+ globals.processUtils,
+ _workingDirectory,
+ );
+@@ -114,7 +114,7 @@ class FlutterVersion {
+ if (slash != -1) {
+ final String remote = gitChannel.substring(0, slash);
+ _repositoryUrl = _runGit(
+- 'git ls-remote --get-url $remote',
++ 'git --git-dir .git ls-remote --get-url $remote',
+ globals.processUtils,
+ _workingDirectory,
+ );
+@@ -326,7 +326,7 @@ class FlutterVersion {
+ /// the branch name will be returned as `'[user-branch]'`.
+ String getBranchName({ bool redactUnknownBranches = false }) {
+ _branch ??= () {
+- final String branch = _runGit('git rev-parse --abbrev-ref HEAD', globals.processUtils);
++ final String branch = _runGit('git --git-dir .git rev-parse --abbrev-ref HEAD', globals.processUtils);
+ return branch == 'HEAD' ? channel : branch;
+ }();
+ if (redactUnknownBranches || _branch!.isEmpty) {
+@@ -359,7 +359,7 @@ class FlutterVersion {
+ /// wrapper that does that.
+ @visibleForTesting
+ static List<String> gitLog(List<String> args) {
+- return <String>['git', '-c', 'log.showSignature=false', 'log'] + args;
++ return <String>['git', '-c', 'log.showSignature=false', '--git-dir', '.git', 'log'] + args;
+ }
+
+ /// Gets the release date of the latest available Flutter version.
+@@ -730,7 +730,7 @@ class GitTagVersion {
+
+ static GitTagVersion determine(ProcessUtils processUtils, {String? workingDirectory, bool fetchTags = false, String gitRef = 'HEAD'}) {
+ if (fetchTags) {
+- final String channel = _runGit('git rev-parse --abbrev-ref HEAD', processUtils, workingDirectory);
++ final String channel = _runGit('git --git-dir .git rev-parse --abbrev-ref HEAD', processUtils, workingDirectory);
+ if (channel == 'dev' || channel == 'beta' || channel == 'stable') {
+ globals.printTrace('Skipping request to fetchTags - on well known channel $channel.');
+ } else {
+@@ -739,7 +739,7 @@ class GitTagVersion {
+ }
+ // find all tags attached to the given [gitRef]
+ final List<String> tags = _runGit(
+- 'git tag --points-at $gitRef', processUtils, workingDirectory).trim().split('\n');
++ 'git --git-dir .git tag --points-at $gitRef', processUtils, workingDirectory).trim().split('\n');
+
+ // Check first for a stable tag
+ final RegExp stableTagPattern = RegExp(r'^\d+\.\d+\.\d+$');
+@@ -760,7 +760,7 @@ class GitTagVersion {
+ // recent tag and number of commits past.
+ return parse(
+ _runGit(
+- 'git describe --match *.*.* --long --tags $gitRef',
++ 'git --git-dir .git describe --match *.*.* --long --tags $gitRef',
+ processUtils,
+ workingDirectory,
+ )
diff --git a/pkgs/development/compilers/flutter/patches/revert-frontend_server_cache.patch b/pkgs/development/compilers/flutter/patches/revert-frontend_server_cache.patch
new file mode 100644
index 00000000000..f68029eb7a1
--- /dev/null
+++ b/pkgs/development/compilers/flutter/patches/revert-frontend_server_cache.patch
@@ -0,0 +1,130 @@
+diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart
+index 2aac9686e8..32c4b98b88 100644
+--- a/packages/flutter_tools/lib/src/artifacts.dart
++++ b/packages/flutter_tools/lib/src/artifacts.dart
+@@ -346,10 +346,10 @@ class CachedArtifacts implements Artifacts {
+ ) {
+ switch (artifact) {
+ case HostArtifact.engineDartSdkPath:
+- final String path = _dartSdkPath(_cache);
++ final String path = _dartSdkPath(_fileSystem);
+ return _fileSystem.directory(path);
+ case HostArtifact.engineDartBinary:
+- final String path = _fileSystem.path.join(_dartSdkPath(_cache), 'bin', _hostArtifactToFileName(artifact, _platform.isWindows));
++ final String path = _fileSystem.path.join(_dartSdkPath(_fileSystem), 'bin', _hostArtifactToFileName(artifact, _platform.isWindows));
+ return _fileSystem.file(path);
+ case HostArtifact.flutterWebSdk:
+ final String path = _getFlutterWebSdkPath();
+@@ -398,7 +398,7 @@ class CachedArtifacts implements Artifacts {
+ case HostArtifact.dart2jsSnapshot:
+ case HostArtifact.dartdevcSnapshot:
+ case HostArtifact.kernelWorkerSnapshot:
+- final String path = _fileSystem.path.join(_dartSdkPath(_cache), 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
++ final String path = _fileSystem.path.join(_dartSdkPath(_fileSystem), 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
+ return _fileSystem.file(path);
+ case HostArtifact.iosDeploy:
+ final String artifactFileName = _hostArtifactToFileName(artifact, _platform.isWindows);
+@@ -461,11 +461,13 @@ class CachedArtifacts implements Artifacts {
+ String _getAndroidArtifactPath(Artifact artifact, TargetPlatform platform, BuildMode mode) {
+ final String engineDir = _getEngineArtifactsPath(platform, mode)!;
+ switch (artifact) {
++ case Artifact.frontendServerSnapshotForEngineDartSdk:
++ assert(mode != BuildMode.debug, 'Artifact $artifact only available in non-debug mode.');
++ return _fileSystem.path.join(engineDir, _artifactToFileName(artifact));
+ case Artifact.genSnapshot:
+ assert(mode != BuildMode.debug, 'Artifact $artifact only available in non-debug mode.');
+ final String hostPlatform = getNameForHostPlatform(getCurrentHostPlatform());
+ return _fileSystem.path.join(engineDir, hostPlatform, _artifactToFileName(artifact));
+- case Artifact.frontendServerSnapshotForEngineDartSdk:
+ case Artifact.constFinder:
+ case Artifact.flutterFramework:
+ case Artifact.flutterMacOSFramework:
+@@ -497,13 +499,13 @@ class CachedArtifacts implements Artifacts {
+ switch (artifact) {
+ case Artifact.genSnapshot:
+ case Artifact.flutterXcframework:
++ case Artifact.frontendServerSnapshotForEngineDartSdk:
+ final String artifactFileName = _artifactToFileName(artifact)!;
+ final String engineDir = _getEngineArtifactsPath(platform, mode)!;
+ return _fileSystem.path.join(engineDir, artifactFileName);
+ case Artifact.flutterFramework:
+ final String engineDir = _getEngineArtifactsPath(platform, mode)!;
+ return _getIosEngineArtifactPath(engineDir, environmentType, _fileSystem);
+- case Artifact.frontendServerSnapshotForEngineDartSdk:
+ case Artifact.constFinder:
+ case Artifact.flutterMacOSFramework:
+ case Artifact.flutterMacOSPodspec:
+@@ -594,14 +596,10 @@ class CachedArtifacts implements Artifacts {
+ // For script snapshots any gen_snapshot binary will do. Returning gen_snapshot for
+ // android_arm in profile mode because it is available on all supported host platforms.
+ return _getAndroidArtifactPath(artifact, TargetPlatform.android_arm, BuildMode.profile);
+- case Artifact.frontendServerSnapshotForEngineDartSdk:
+- return _fileSystem.path.join(
+- _dartSdkPath(_cache), 'bin', 'snapshots',
+- _artifactToFileName(artifact),
+- );
+ case Artifact.flutterTester:
+ case Artifact.vmSnapshotData:
+ case Artifact.isolateSnapshotData:
++ case Artifact.frontendServerSnapshotForEngineDartSdk:
+ case Artifact.icuData:
+ final String engineArtifactsPath = _cache.getArtifactDirectory('engine').path;
+ final String platformDirName = _enginePlatformDirectoryName(platform);
+@@ -797,7 +795,7 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
+ final String path = _fileSystem.path.join(_hostEngineOutPath, 'dart-sdk', 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
+ return _fileSystem.file(path);
+ case HostArtifact.dartdevcSnapshot:
+- final String path = _fileSystem.path.join(_dartSdkPath(_cache), 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
++ final String path = _fileSystem.path.join(_dartSdkPath(_fileSystem), 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
+ return _fileSystem.file(path);
+ case HostArtifact.kernelWorkerSnapshot:
+ final String path = _fileSystem.path.join(_hostEngineOutPath, 'dart-sdk', 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
+@@ -922,9 +920,7 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
+ case Artifact.windowsUwpCppClientWrapper:
+ return _fileSystem.path.join(_hostEngineOutPath, artifactFileName);
+ case Artifact.frontendServerSnapshotForEngineDartSdk:
+- return _fileSystem.path.join(
+- _hostEngineOutPath, 'dart-sdk', 'bin', 'snapshots', artifactFileName,
+- );
++ return _fileSystem.path.join(_hostEngineOutPath, 'gen', artifactFileName);
+ case Artifact.uwptool:
+ return _fileSystem.path.join(_hostEngineOutPath, artifactFileName);
+ }
+@@ -1034,8 +1030,8 @@ class OverrideArtifacts implements Artifacts {
+ }
+
+ /// Locate the Dart SDK.
+-String _dartSdkPath(Cache cache) {
+- return cache.getRoot().childDirectory('dart-sdk').path;
++String _dartSdkPath(FileSystem fileSystem) {
++ return fileSystem.path.join(Cache.flutterRoot!, 'bin', 'cache', 'dart-sdk');
+ }
+
+ class _TestArtifacts implements Artifacts {
+diff --git a/packages/flutter_tools/test/general.shard/artifacts_test.dart b/packages/flutter_tools/test/general.shard/artifacts_test.dart
+index d906511a15..adfdd4bb42 100644
+--- a/packages/flutter_tools/test/general.shard/artifacts_test.dart
++++ b/packages/flutter_tools/test/general.shard/artifacts_test.dart
+@@ -153,10 +153,6 @@ void main() {
+ artifacts.getArtifactPath(Artifact.windowsUwpDesktopPath, platform: TargetPlatform.windows_uwp_x64, mode: BuildMode.release),
+ fileSystem.path.join('root', 'bin', 'cache', 'artifacts', 'engine', 'windows-uwp-x64-release'),
+ );
+- expect(
+- artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk),
+- fileSystem.path.join('root', 'bin', 'cache', 'dart-sdk', 'bin', 'snapshots', 'frontend_server.dart.snapshot')
+- );
+ });
+
+ testWithoutContext('precompiled web artifact paths are correct', () {
+@@ -322,11 +318,6 @@ void main() {
+ artifacts.getHostArtifact(HostArtifact.engineDartSdkPath).path,
+ fileSystem.path.join('/out', 'host_debug_unopt', 'dart-sdk'),
+ );
+- expect(
+- artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk),
+- fileSystem.path.join('/out', 'host_debug_unopt', 'dart-sdk', 'bin',
+- 'snapshots', 'frontend_server.dart.snapshot')
+- );
+ });
+
+ testWithoutContext('getEngineType', () {

View File

@@ -0,0 +1,40 @@
diff --git a/pkgs/applications/networking/instant-messengers/fluffychat/default.nix b/pkgs/applications/networking/instant-messengers/fluffychat/default.nix
index 565c44f72e9..f20a3d4e9be 100644
--- a/pkgs/applications/networking/instant-messengers/fluffychat/default.nix
+++ b/pkgs/applications/networking/instant-messengers/fluffychat/default.nix
@@ -4,13 +4,19 @@
, olm
, imagemagick
, makeDesktopItem
+, stdenv
}:
+let vendorHashes = {
+ x86_64-linux = "sha256-p5EJP2zSvWyRV1uyTHw0EpFsEwAGtX5B9WVjpLmnVew=";
+ aarch64-linux = "sha256-Ps0HmDI6BFxHrLRq3KWNk4hw0qneq5hqB/Mp99f+hO4=";
+};
+in
flutter.mkFlutterApp rec {
pname = "fluffychat";
version = "1.6.1";
- vendorHash = "sha256-SelMRETFYZgTStV90gRoKhazu1NPbcSMO9mYebSQskQ=";
+ vendorHash = vendorHashes."${stdenv.hostPlatform.system}" or (throw "unsupported system: ${stdenv.hostPlatform.system}");
src = fetchFromGitLab {
owner = "famedly";
diff --git a/pkgs/development/compilers/flutter/default.nix b/pkgs/development/compilers/flutter/default.nix
index 9eba6773448..e9d352169b2 100644
--- a/pkgs/development/compilers/flutter/default.nix
+++ b/pkgs/development/compilers/flutter/default.nix
@@ -19,6 +19,10 @@ let
url = "${dartSourceBase}/stable/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip";
sha256 = "sha256-PMY6DCFQC8XrlnFzOEPcwgBAs5/cAvNd78969Z+I1Fk=";
};
+ "${dartVersion}-aarch64-linux" = fetchurl {
+ url = "${dartSourceBase}/stable/release/${dartVersion}/sdk/dartsdk-linux-arm64-release.zip";
+ sha256 = "sha256-BIK6kUx+m+/GfR/wBXv8rjVNbP6w1HFvH/RGIwiaJog=";
+ };
};
};
in {

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