Compare commits
106 Commits
wip/moby-k
...
staging/li
Author | SHA1 | Date | |
---|---|---|---|
54cfde0e30 | |||
f3568462c2 | |||
ed9291a443 | |||
9eac7f7c02 | |||
f5eaa635a5 | |||
47db6f0dd4 | |||
bba7efc535 | |||
358b673344 | |||
d9c101689d | |||
ccbb573681 | |||
f5c270233f | |||
bf92bb48be | |||
2037b425d6 | |||
026746a76f | |||
de74c4e7d5 | |||
34a5f3f49b | |||
ee93141c07 | |||
f2d22231a3 | |||
d5334e65ad | |||
17cdfff286 | |||
8d4ff6d4e6 | |||
5d78bc6704 | |||
4da19a6d34 | |||
2f75925678 | |||
55a1856e87 | |||
2ee0f4efe2 | |||
b0c5a5907f | |||
9af157b294 | |||
c36fed8547 | |||
a653311f04 | |||
f4d6ecb1cf | |||
c2e5a0a2fc | |||
c316e51344 | |||
f4f0c1bdd6 | |||
6a2374e046 | |||
708cb841fe | |||
094b7223c7 | |||
f6dfc9cf29 | |||
7c2ab92302 | |||
7c18d77046 | |||
02f316f7f8 | |||
df848b3262 | |||
1e67b5c97e | |||
a3a7b6c563 | |||
e527beb9d0 | |||
2e942e2dd4 | |||
f46e3fdf01 | |||
038a9034d7 | |||
5a232eb832 | |||
9301b95dbb | |||
d13bcc49ab | |||
35e28041cd | |||
58a5a8b56d | |||
e6d4ff3c6a | |||
be29ad8bd8 | |||
0fb8e2c867 | |||
580c1b74cb | |||
f8595f1ed6 | |||
1deda148bb | |||
5bbef18130 | |||
6967c331e2 | |||
9202345beb | |||
17a8cabc09 | |||
bc190f90bd | |||
bb983a5328 | |||
0e8fc29b01 | |||
4e14f063fc | |||
10d69fb0a4 | |||
7aac965e32 | |||
98ae1a8513 | |||
72a2ab78f3 | |||
18c98feb34 | |||
487af9b492 | |||
472d25c056 | |||
9eafacad12 | |||
0eb46a3179 | |||
ddb184b5ff | |||
194a6b6cf4 | |||
016384aa2b | |||
b4e19c037e | |||
bd504f6c83 | |||
bdd309eb15 | |||
eedc1170ec | |||
5a586c6e3c | |||
371bcad650 | |||
926decbea5 | |||
c0f76ea8d8 | |||
40fc37930f | |||
30e7eb9ab6 | |||
2e03f47edc | |||
4d552e3f0f | |||
176a98879d | |||
fc70889c34 | |||
49b4c57826 | |||
5111d095ac | |||
fe15cdd705 | |||
638420ea0d | |||
d55dd5ace6 | |||
45695aed6b | |||
d6e79c4d07 | |||
380ceaf625 | |||
942c581107 | |||
b6d94c2e08 | |||
fd7acc8fc8 | |||
db670fc172 | |||
6438971c8c |
50
flake.lock
generated
50
flake.lock
generated
@@ -39,11 +39,11 @@
|
||||
"mobile-nixos": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1670131242,
|
||||
"narHash": "sha256-T/o1/3gffr010fsqgNshs1NJJjsnUYvQnUZgm6hilsY=",
|
||||
"lastModified": 1674593731,
|
||||
"narHash": "sha256-RHJOhxqPKLxbLLabbj1IEuUQqO76TOTtmpxYyTtfDmU=",
|
||||
"owner": "nixos",
|
||||
"repo": "mobile-nixos",
|
||||
"rev": "5ee45cc1f8e43f4af14ee17ccef9156b0db8cd77",
|
||||
"rev": "4d2093efa7efa00131d385fd9d11e54ce16bc57a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -60,37 +60,38 @@
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1,
|
||||
"narHash": "sha256-RM4ZprjMlUTMD0huOPQceF0ujXG2xk7LE1fGXfcg71g=",
|
||||
"path": "nixpatches",
|
||||
"narHash": "sha256-P5BXhRIaKF6ze3am7CY//NFOJ4ihoys9h0ka9S15VV4=",
|
||||
"path": "/nix/store/41f11k8hk1qjd440mavrybc7xgrcp9gj-source/nixpatches",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"path": "nixpatches",
|
||||
"path": "/nix/store/41f11k8hk1qjd440mavrybc7xgrcp9gj-source/nixpatches",
|
||||
"type": "path"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1673527292,
|
||||
"narHash": "sha256-903EpRSDCfUvic7Hsiqwy+h7zlMTLAUbCXkEGGriCfM=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1674407282,
|
||||
"narHash": "sha256-2qwc8mrPINSFdWffPK+ji6nQ9aGnnZyHSItVcYDZDlk=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6a3f9996408c970b99b8b992b11bb249d1455b62",
|
||||
"rev": "ab1254087f4cdf4af74b552d7fc95175d9bdbb49",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-22.11",
|
||||
"type": "indirect"
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable_2": {
|
||||
"locked": {
|
||||
"lastModified": 1673100377,
|
||||
"narHash": "sha256-mT76pTd0YFxT6CwtPhDgHJhuIgLY+ZLSMiQpBufwMG4=",
|
||||
"lastModified": 1674352297,
|
||||
"narHash": "sha256-OkAnJPrauEcUCrst4/3DKoQfUn2gXKuU6CFvhtMrLgg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9f11a2df77cb945c115ae2a65f53f38121597d73",
|
||||
"rev": "918b760070bb8f48cb511300fcd7e02e13058a2e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -102,17 +103,18 @@
|
||||
},
|
||||
"nixpkgs-unpatched": {
|
||||
"locked": {
|
||||
"lastModified": 1673450908,
|
||||
"narHash": "sha256-b8em+kwrNtnB7gR8SyVf6WuTyQ+6tHS6dzt9D9wgKF0=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1674459583,
|
||||
"narHash": "sha256-L0UZl/u2H3HGsrhN+by42c5kNYeKtdmJiPzIRvEVeiM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6c8644fc37b6e141cbfa6c7dc8d98846c4ff0c2e",
|
||||
"rev": "1b1f50645af2a70dc93eae18bfd88d330bfbcf7f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"type": "indirect"
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
@@ -134,11 +136,11 @@
|
||||
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1673481602,
|
||||
"narHash": "sha256-P80X38fOM2MtoYdgkyuksGOQPDhIhNJW2W2jMeMIZzE=",
|
||||
"lastModified": 1674546403,
|
||||
"narHash": "sha256-vkyNv0xzXuEnu9v52TUtRugNmQWIti8c2RhYnbLG71w=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "32187b33ac6ec9b628dcd08dd941a715e6241dda",
|
||||
"rev": "b6ab3c61e2ca5e07d1f4eb1b67304e2670ea230c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
39
flake.nix
39
flake.nix
@@ -1,24 +1,44 @@
|
||||
# docs:
|
||||
# - <https://nixos.wiki/wiki/Flakes>
|
||||
# FLAKE FEEDBACK:
|
||||
# - if flake inputs are meant to be human-readable, a human should be able to easily track them down given the URL.
|
||||
# - this is not the case with registry URLs, like `nixpkgs/nixos-22.11`.
|
||||
# - this is marginally the case with schemes like `github:nixos/nixpkgs`.
|
||||
# - given the *existing* `git+https://` scheme, i propose expressing github URLs similarly:
|
||||
# - `github+https://github.com/nixos/nixpkgs/tree/nixos-22.11`
|
||||
# - need some way to apply local patches to inputs.
|
||||
#
|
||||
#
|
||||
# DEVELOPMENT DOCS:
|
||||
# - Flake docs: <https://nixos.wiki/wiki/Flakes>
|
||||
# - Flake RFC: <https://github.com/tweag/rfcs/blob/flakes/rfcs/0049-flakes.md>
|
||||
# - Discussion: <https://github.com/NixOS/rfcs/pull/49>
|
||||
# - <https://serokell.io/blog/practical-nix-flakes>
|
||||
|
||||
{
|
||||
# XXX: use the `github:` scheme instead of the more readable git+https: because it's *way* more efficient
|
||||
# preferably, i would rewrite the human-readable https URLs to nix-specific github: URLs with a helper,
|
||||
# but `inputs` is required to be a strict attrset: not an expression.
|
||||
inputs = {
|
||||
nixpkgs-stable.url = "nixpkgs/nixos-22.11";
|
||||
nixpkgs-unpatched.url = "nixpkgs/nixos-unstable";
|
||||
# <https://github.com/nixos/nixpkgs/tree/nixos-22.11>
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs?ref=nixos-22.11";
|
||||
|
||||
# <https://github.com/nixos/nixpkgs/tree/nixos-unstable>
|
||||
nixpkgs-unpatched.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
nixpkgs = {
|
||||
url = "path:nixpatches";
|
||||
url = "./nixpatches";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unpatched";
|
||||
};
|
||||
mobile-nixos = {
|
||||
# <https://github.com/nixos/mobile-nixos>
|
||||
url = "github:nixos/mobile-nixos";
|
||||
flake = false;
|
||||
};
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-22.05";
|
||||
# <https://github.com/nix-community/home-manager/tree/release-22.05>
|
||||
url = "github:nix-community/home-manager?ref=release-22.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
sops-nix = {
|
||||
# <https://github.com/Mic92/sops-nix>
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
@@ -62,6 +82,7 @@
|
||||
nixpkgs.overlays = [
|
||||
self.overlays.default
|
||||
self.overlays.passthru
|
||||
self.overlays.pins
|
||||
];
|
||||
}
|
||||
];
|
||||
@@ -98,11 +119,12 @@
|
||||
|
||||
overlays = rec {
|
||||
default = pkgs;
|
||||
pkgs = import ./pkgs/overlay.nix;
|
||||
pkgs = import ./overlays/pkgs.nix;
|
||||
pins = import ./overlays/pins.nix; # TODO: move to `nixpatches/` input
|
||||
passthru =
|
||||
let
|
||||
stable = next: prev: {
|
||||
stable = nixpkgs-stable.legacyPackages."${prev.stdenv.hostPlatform}";
|
||||
stable = nixpkgs-stable.legacyPackages."${prev.stdenv.hostPlatform.system}";
|
||||
};
|
||||
mobile = (import "${mobile-nixos}/overlay/overlay.nix");
|
||||
uninsane = uninsane-dot-org.overlay;
|
||||
@@ -148,6 +170,7 @@
|
||||
};
|
||||
|
||||
init-feed = {
|
||||
# use like `nix run '.#init-feed' uninsane.org`
|
||||
type = "app";
|
||||
program = "${pkgs.feeds.passthru.initFeedScript}";
|
||||
};
|
||||
|
@@ -6,12 +6,16 @@
|
||||
|
||||
# sane.packages.enableDevPkgs = true;
|
||||
|
||||
sane.gui.sway.enable = true;
|
||||
sane.roles.client = true;
|
||||
sane.services.wg-home.enable = true;
|
||||
sane.services.wg-home.ip = config.sane.hosts.by-name."desko".wg-home.ip;
|
||||
sane.services.duplicity.enable = true;
|
||||
sane.services.nixserve.enable = true;
|
||||
sane.services.nixserve.sopsFile = ../../secrets/desko.yaml;
|
||||
sane.services.nixserve.sopsFile = ../../../secrets/desko.yaml;
|
||||
sane.persist.enable = true;
|
||||
|
||||
sane.gui.sway.enable = true;
|
||||
|
||||
boot.loader.efi.canTouchEfiVariables = false;
|
||||
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
||||
|
||||
@@ -19,7 +23,7 @@
|
||||
services.usbmuxd.enable = true;
|
||||
|
||||
sops.secrets.colin-passwd = {
|
||||
sopsFile = ../../secrets/desko.yaml;
|
||||
sopsFile = ../../../secrets/desko.yaml;
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
||||
@@ -41,7 +45,7 @@
|
||||
};
|
||||
|
||||
sops.secrets.duplicity_passphrase = {
|
||||
sopsFile = ../../secrets/desko.yaml;
|
||||
sopsFile = ../../../secrets/desko.yaml;
|
||||
};
|
||||
|
||||
programs.steam = {
|
@@ -1,9 +1,13 @@
|
||||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./fs.nix
|
||||
];
|
||||
|
||||
sane.roles.client = true;
|
||||
sane.services.wg-home.enable = true;
|
||||
sane.services.wg-home.ip = config.sane.hosts.by-name."lappy".wg-home.ip;
|
||||
|
||||
# sane.packages.enableDevPkgs = true;
|
||||
|
||||
# sane.users.guest.enable = true;
|
||||
@@ -14,7 +18,7 @@
|
||||
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
||||
|
||||
sops.secrets.colin-passwd = {
|
||||
sopsFile = ../../secrets/lappy.yaml;
|
||||
sopsFile = ../../../secrets/lappy.yaml;
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
@@ -6,6 +6,10 @@
|
||||
./kernel.nix
|
||||
];
|
||||
|
||||
sane.roles.client = true;
|
||||
sane.services.wg-home.enable = true;
|
||||
sane.services.wg-home.ip = config.sane.hosts.by-name."moby".wg-home.ip;
|
||||
|
||||
# cross-compiled documentation is *slow*.
|
||||
# no obvious way to natively compile docs (2022/09/29).
|
||||
# entrypoint is nixos/modules/misc/documentation.nix
|
||||
@@ -19,7 +23,7 @@
|
||||
services.getty.autologinUser = "root"; # allows for emergency maintenance?
|
||||
|
||||
sops.secrets.colin-passwd = {
|
||||
sopsFile = ../../secrets/moby.yaml;
|
||||
sopsFile = ../../../secrets/moby.yaml;
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
||||
@@ -54,9 +58,10 @@
|
||||
|
||||
# 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.
|
||||
# the default CMA seems to be 32M.
|
||||
# i was running fine with 256MB from 2022/07-ish through 2022/12-ish, but then the phone quit reliably coming back from sleep: maybe a memory leak?
|
||||
# `cat /proc/meminfo` to see CmaTotal/CmaFree if interested in tuning this.
|
||||
boot.kernelParams = [ "cma=256M" ];
|
||||
boot.kernelParams = [ "cma=384M" ];
|
||||
|
||||
# mobile-nixos' /lib/firmware includes:
|
||||
# rtl_bt (bluetooth)
|
@@ -1,29 +1,32 @@
|
||||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./fs.nix
|
||||
./net.nix
|
||||
./users.nix
|
||||
./secrets.nix
|
||||
./services
|
||||
];
|
||||
|
||||
sane.packages.extraUserPkgs = [
|
||||
sane.packages.extraUserPkgs = with pkgs; [
|
||||
# for administering services
|
||||
pkgs.matrix-synapse
|
||||
pkgs.freshrss
|
||||
freshrss
|
||||
matrix-synapse
|
||||
signaldctl
|
||||
];
|
||||
sane.persist.enable = true;
|
||||
sane.services.dyn-dns.enable = true;
|
||||
sane.services.wg-home.enable = true;
|
||||
sane.services.wg-home.ip = config.sane.hosts.by-name."servo".wg-home.ip;
|
||||
# sane.services.duplicity.enable = true; # TODO: re-enable after HW upgrade
|
||||
|
||||
# automatically log in at the virtual consoles.
|
||||
# using root here makes sure we always have an escape hatch
|
||||
services.getty.autologinUser = "root";
|
||||
|
||||
boot.loader.efi.canTouchEfiVariables = false;
|
||||
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
||||
|
||||
sops.secrets.duplicity_passphrase = {
|
||||
sopsFile = ../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
# both transmission and ipfs try to set different net defaults.
|
||||
# we just use the most aggressive of the two here:
|
||||
boot.kernel.sysctl = {
|
@@ -52,18 +52,18 @@
|
||||
|
||||
# services.resolved.extraConfig = ''
|
||||
# # docs: `man resolved.conf`
|
||||
# # DNS servers to use via the `wg0` interface.
|
||||
# # DNS servers to use via the `wg-ovpns` interface.
|
||||
# # i hope that from the root ns, these aren't visible.
|
||||
# DNS=46.227.67.134%wg0 192.165.9.158%wg0
|
||||
# DNS=46.227.67.134%wg-ovpns 192.165.9.158%wg-ovpns
|
||||
# FallbackDNS=1.1.1.1 9.9.9.9
|
||||
# '';
|
||||
|
||||
# OVPN CONFIG (https://www.ovpn.com):
|
||||
# DOCS: https://nixos.wiki/wiki/WireGuard
|
||||
# if you `systemctl restart wireguard-wg0`, make sure to also restart any other services in `NetworkNamespacePath = .../ovpns`.
|
||||
# if you `systemctl restart wireguard-wg-ovpns`, make sure to also restart any other services in `NetworkNamespacePath = .../ovpns`.
|
||||
# TODO: why not create the namespace as a seperate operation (nix config for that?)
|
||||
networking.wireguard.enable = true;
|
||||
networking.wireguard.interfaces.wg0 = let
|
||||
networking.wireguard.interfaces.wg-ovpns = let
|
||||
ip = "${pkgs.iproute2}/bin/ip";
|
||||
in-ns = "${ip} netns exec ovpns";
|
||||
iptables = "${pkgs.iptables}/bin/iptables";
|
||||
@@ -159,13 +159,10 @@
|
||||
# create a new routing table that we can use to proxy traffic out of the root namespace
|
||||
# through the ovpns namespace, and to the WAN via VPN.
|
||||
networking.iproute2.rttablesExtraConfig = ''
|
||||
5 ovpns
|
||||
5 ovpns
|
||||
'';
|
||||
networking.iproute2.enable = true;
|
||||
|
||||
sops.secrets."wg_ovpns_privkey" = {
|
||||
sopsFile = ../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
# HURRICANE ELECTRIC CONFIG:
|
||||
# networking.sits = {
|
41
hosts/by-name/servo/secrets.nix
Normal file
41
hosts/by-name/servo/secrets.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
sops.secrets."ddns_afraid" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
sops.secrets."ddns_he" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
sops.secrets."dovecot_passwd" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
sops.secrets."duplicity_passphrase" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
sops.secrets."freshrss_passwd" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
sops.secrets."matrix_synapse_secrets" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
sops.secrets."mautrix_signal_env" = {
|
||||
sopsFile = ../../../secrets/servo/mautrix_signal_env.bin;
|
||||
};
|
||||
|
||||
sops.secrets."mediawiki_pw" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
sops.secrets."pleroma_secrets" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
sops.secrets."wg_ovpns_privkey" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
}
|
@@ -24,8 +24,4 @@ lib.mkIf false
|
||||
OnUnitActiveSec = "10min";
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets."ddns_afraid" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
}
|
@@ -27,8 +27,4 @@ lib.mkIf false
|
||||
OnUnitActiveSec = "10min";
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets."ddns_he" = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
}
|
@@ -46,6 +46,8 @@
|
||||
}];
|
||||
|
||||
# provide access to certs
|
||||
# TODO: this should just be `acme`. then we also add nginx to the `acme` group.
|
||||
# why is /var/lib/acme/* owned by `nginx` group??
|
||||
users.users.ejabberd.extraGroups = [ "nginx" ];
|
||||
|
||||
security.acme.certs."uninsane.org".extraDomainNames = [
|
@@ -11,8 +11,7 @@
|
||||
|
||||
{ config, lib, pkgs, sane-lib, ... }:
|
||||
{
|
||||
sops.secrets.freshrss_passwd = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
sops.secrets."freshrss_passwd" = {
|
||||
owner = config.users.users.freshrss.name;
|
||||
mode = "0400";
|
||||
};
|
||||
@@ -42,7 +41,10 @@
|
||||
description = "import sane RSS feed list";
|
||||
after = [ "freshrss-config.service" ];
|
||||
script = ''
|
||||
${pkgs.freshrss}/cli/import-for-user.php --user admin --filename ${opml}
|
||||
# easiest way to preserve feeds: delete the user, recreate it, import feeds
|
||||
${pkgs.freshrss}/cli/delete-user.php --user colin || true
|
||||
${pkgs.freshrss}/cli/create-user.php --user colin --password "$(cat ${config.services.freshrss.passwordFile})" || true
|
||||
${pkgs.freshrss}/cli/import-for-user.php --user colin --filename ${opml}
|
||||
'';
|
||||
};
|
||||
|
@@ -15,6 +15,17 @@
|
||||
services.gitea.settings.session.COOKIE_SECURE = true;
|
||||
# services.gitea.disableRegistration = true;
|
||||
|
||||
# gitea doesn't create the git user
|
||||
users.users.git = {
|
||||
description = "Gitea Service";
|
||||
home = "/var/lib/gitea";
|
||||
useDefaultShell = true;
|
||||
group = "gitea";
|
||||
isSystemUser = true;
|
||||
# sendmail access (not 100% sure if this is necessary)
|
||||
extraGroups = [ "postdrop" ];
|
||||
};
|
||||
|
||||
services.gitea.settings = {
|
||||
server = {
|
||||
# options: "home", "explore", "organizations", "login" or URL fragment (or full URL)
|
@@ -7,8 +7,8 @@
|
||||
];
|
||||
services.jackett.enable = true;
|
||||
|
||||
systemd.services.jackett.after = [ "wireguard-wg0.service" ];
|
||||
systemd.services.jackett.partOf = [ "wireguard-wg0.service" ];
|
||||
systemd.services.jackett.after = [ "wireguard-wg-ovpns.service" ];
|
||||
systemd.services.jackett.partOf = [ "wireguard-wg-ovpns.service" ];
|
||||
systemd.services.jackett.serviceConfig = {
|
||||
# run this behind the OVPN static VPN
|
||||
NetworkNamespacePath = "/run/netns/ovpns";
|
@@ -6,12 +6,18 @@
|
||||
imports = [
|
||||
./discord-puppet.nix
|
||||
# ./irc.nix
|
||||
./signal.nix
|
||||
];
|
||||
|
||||
# allow synapse to read the registration files of its appservices
|
||||
users.users.matrix-synapse.extraGroups = [ "mautrix-signal" ];
|
||||
|
||||
sane.persist.sys.plaintext = [
|
||||
{ user = "matrix-synapse"; group = "matrix-synapse"; directory = "/var/lib/matrix-synapse"; }
|
||||
];
|
||||
services.matrix-synapse.enable = true;
|
||||
# this changes the default log level from INFO to WARN.
|
||||
# maybe there's an easier way?
|
||||
services.matrix-synapse.settings.log_config = ./synapse-log_level.yaml;
|
||||
services.matrix-synapse.settings.server_name = "uninsane.org";
|
||||
|
||||
@@ -127,8 +133,7 @@
|
||||
};
|
||||
|
||||
|
||||
sops.secrets.matrix_synapse_secrets = {
|
||||
sopsFile = ../../../../secrets/servo.yaml;
|
||||
sops.secrets."matrix_synapse_secrets" = {
|
||||
owner = config.users.users.matrix-synapse.name;
|
||||
};
|
||||
}
|
@@ -43,6 +43,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: should use a dedicated user
|
||||
systemd.services.mx-puppet-discord.serviceConfig = {
|
||||
# fix up to not use /var/lib/private, but just /var/lib
|
||||
DynamicUser = lib.mkForce false;
|
34
hosts/by-name/servo/services/matrix/signal.nix
Normal file
34
hosts/by-name/servo/services/matrix/signal.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
# config options:
|
||||
# - <https://github.com/mautrix/signal/blob/master/mautrix_signal/example-config.yaml>
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
services.signald.enable = true;
|
||||
services.mautrix-signal.enable = true;
|
||||
services.mautrix-signal.environmentFile =
|
||||
config.sops.secrets.mautrix_signal_env.path;
|
||||
|
||||
services.mautrix-signal.settings.signal.socket_path = "/run/signald/signald.sock";
|
||||
services.mautrix-signal.settings.homeserver.domain = "uninsane.org";
|
||||
services.mautrix-signal.settings.bridge.permissions."@colin:uninsane.org" = "admin";
|
||||
services.matrix-synapse.settings.app_service_config_files = [
|
||||
# auto-created by mautrix-signal service
|
||||
"/var/lib/mautrix-signal/signal-registration.yaml"
|
||||
];
|
||||
|
||||
systemd.services.mautrix-signal.serviceConfig = {
|
||||
# allow communication to signald
|
||||
SupplementaryGroups = [ "signald" ];
|
||||
ReadWritePaths = [ "/run/signald" ];
|
||||
};
|
||||
|
||||
sane.persist.sys.plaintext = [
|
||||
{ user = "mautrix-signal"; group = "mautrix-signal"; directory = "/var/lib/mautrix-signal"; }
|
||||
];
|
||||
|
||||
sops.secrets."mautrix_signal_env" = {
|
||||
format = "binary";
|
||||
mode = "0440";
|
||||
owner = config.users.users.mautrix-signal.name;
|
||||
group = config.users.users.matrix-synapse.name;
|
||||
};
|
||||
}
|
@@ -1,11 +1,8 @@
|
||||
{ ... }:
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
sane.persist.sys.plaintext = [
|
||||
# TODO: we don't have a static user allocated for navidrome!
|
||||
# the chown would happen too early for us to set static perms
|
||||
"/var/lib/private/navidrome"
|
||||
# { user = "navidrome"; group = "navidrome"; directory = "/var/lib/private/navidrome"; }
|
||||
{ user = "navidrome"; group = "navidrome"; directory = "/var/lib/navidrome"; }
|
||||
];
|
||||
services.navidrome.enable = true;
|
||||
services.navidrome.settings = {
|
||||
@@ -18,6 +15,20 @@
|
||||
ScanSchedule = "@every 1h";
|
||||
};
|
||||
|
||||
systemd.services.navidrome.serviceConfig = {
|
||||
# fix to use a normal user so we can configure perms correctly
|
||||
DynamicUser = lib.mkForce false;
|
||||
User = "navidrome";
|
||||
Group = "navidrome";
|
||||
};
|
||||
|
||||
users.groups.navidrome = {};
|
||||
|
||||
users.users.navidrome = {
|
||||
group = "navidrome";
|
||||
isSystemUser = true;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."music.uninsane.org" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
@@ -17,5 +17,5 @@
|
||||
sane.services.trust-dns.zones."uninsane.org".inet.CNAME."nixcache" = "native";
|
||||
|
||||
sane.services.nixserve.enable = true;
|
||||
sane.services.nixserve.sopsFile = ../../../secrets/servo.yaml;
|
||||
sane.services.nixserve.sopsFile = ../../../../secrets/servo.yaml;
|
||||
}
|
@@ -111,7 +111,7 @@
|
||||
''
|
||||
];
|
||||
|
||||
systemd.services.pleroma.path = [
|
||||
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
|
||||
# used by Pleroma to strip geo tags from uploads
|
||||
@@ -135,6 +135,11 @@
|
||||
# CapabilityBoundingSet = lib.mkForce "~";
|
||||
# };
|
||||
|
||||
# this is required to allow pleroma to send email.
|
||||
# raw `sendmail` works, but i think pleroma's passing it some funny flags or something, idk.
|
||||
# hack to fix that.
|
||||
users.users.pleroma.extraGroups = [ "postdrop" ];
|
||||
|
||||
# Pleroma server and web interface
|
||||
# TODO: enable publog?
|
||||
services.nginx.virtualHosts."fed.uninsane.org" = {
|
||||
@@ -179,8 +184,7 @@
|
||||
|
||||
sane.services.trust-dns.zones."uninsane.org".inet.CNAME."fed" = "native";
|
||||
|
||||
sops.secrets.pleroma_secrets = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
sops.secrets."pleroma_secrets" = {
|
||||
owner = config.users.users.pleroma.name;
|
||||
};
|
||||
}
|
@@ -110,8 +110,8 @@ in
|
||||
services.postfix.enableSubmissions = true;
|
||||
services.postfix.submissionsOptions = submissionOptions;
|
||||
|
||||
systemd.services.postfix.after = [ "wireguard-wg0.service" ];
|
||||
systemd.services.postfix.partOf = [ "wireguard-wg0.service" ];
|
||||
systemd.services.postfix.after = [ "wireguard-wg-ovpns.service" ];
|
||||
systemd.services.postfix.partOf = [ "wireguard-wg-ovpns.service" ];
|
||||
systemd.services.postfix.serviceConfig = {
|
||||
# run this behind the OVPN static VPN
|
||||
NetworkNamespacePath = "/run/netns/ovpns";
|
||||
@@ -132,8 +132,8 @@ in
|
||||
# keeping this the same as the hostname seems simplest
|
||||
services.opendkim.selector = "mx";
|
||||
|
||||
systemd.services.opendkim.after = [ "wireguard-wg0.service" ];
|
||||
systemd.services.opendkim.partOf = [ "wireguard-wg0.service" ];
|
||||
systemd.services.opendkim.after = [ "wireguard-wg-ovpns.service" ];
|
||||
systemd.services.opendkim.partOf = [ "wireguard-wg-ovpns.service" ];
|
||||
systemd.services.opendkim.serviceConfig = {
|
||||
# run this behind the OVPN static VPN
|
||||
NetworkNamespacePath = "/run/netns/ovpns";
|
||||
@@ -197,8 +197,7 @@ in
|
||||
# }
|
||||
];
|
||||
|
||||
sops.secrets.dovecot_passwd = {
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
sops.secrets."dovecot_passwd" = {
|
||||
owner = config.users.users.dovecot2.name;
|
||||
# TODO: debug why mail can't be sent without this being world-readable
|
||||
mode = "0444";
|
@@ -40,8 +40,8 @@
|
||||
# transmission will by default not allow the world to read its files.
|
||||
services.transmission.downloadDirPermissions = "775";
|
||||
|
||||
systemd.services.transmission.after = [ "wireguard-wg0.service" ];
|
||||
systemd.services.transmission.partOf = [ "wireguard-wg0.service" ];
|
||||
systemd.services.transmission.after = [ "wireguard-wg-ovpns.service" ];
|
||||
systemd.services.transmission.partOf = [ "wireguard-wg-ovpns.service" ];
|
||||
systemd.services.transmission.serviceConfig = {
|
||||
# run this behind the OVPN static VPN
|
||||
NetworkNamespacePath = "/run/netns/ovpns";
|
@@ -8,7 +8,6 @@ lib.mkIf false
|
||||
{
|
||||
sops.secrets."mediawiki_pw" = {
|
||||
owner = config.users.users.mediawiki.name;
|
||||
sopsFile = ../../../secrets/servo.yaml;
|
||||
};
|
||||
|
||||
services.mediawiki.enable = true;
|
@@ -1,16 +0,0 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# persist external pairings by default
|
||||
sane.persist.sys.plaintext = [ "/var/lib/bluetooth" ];
|
||||
|
||||
sane.fs."/var/lib/bluetooth".generated.acl.mode = "0700";
|
||||
sane.fs."/var/lib/bluetooth/.secrets.stamp" = {
|
||||
wantedBeforeBy = [ "bluetooth.service" ];
|
||||
# XXX: install-bluetooth uses sed, but that's part of the default systemd unit path, it seems
|
||||
generated.script.script = builtins.readFile ../../scripts/install-bluetooth + ''
|
||||
touch "/var/lib/bluetooth/.secrets.stamp"
|
||||
'';
|
||||
generated.script.scriptArgs = [ "/run/secrets/bt" ];
|
||||
};
|
||||
}
|
@@ -1,11 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./bluetooth.nix
|
||||
./cross.nix
|
||||
./feeds.nix
|
||||
./fs.nix
|
||||
./hardware
|
||||
./hardware.nix
|
||||
./i2p.nix
|
||||
./ids.nix
|
||||
./machine-id.nix
|
||||
@@ -30,6 +29,9 @@
|
||||
"/var/lib/machines" # maybe not needed, but would be painful to add a VM and forget.
|
||||
];
|
||||
|
||||
# some services which use private directories error if the parent (/var/lib/private) isn't 700.
|
||||
sane.fs."/var/lib/private".dir.acl.mode = "0700";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# time.timeZone = "America/Los_Angeles";
|
||||
@@ -39,6 +41,11 @@
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
# allow `nix-shell` (and probably nix-index?) to locate our patched and custom packages
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${pkgs.path}"
|
||||
"nixpkgs-overlays=${../..}/overlays"
|
||||
];
|
||||
|
||||
# TODO: move this into home-manager?
|
||||
fonts = {
|
||||
|
@@ -47,7 +47,6 @@ let
|
||||
|
||||
podcasts = [
|
||||
(fromDb "lexfridman.com/podcast" // rat)
|
||||
# (mkPod "https://lexfridman.com/feed/podcast/" // rat // weekly)
|
||||
## Astral Codex Ten
|
||||
(fromDb "sscpodcast.libsyn.com" // rat)
|
||||
## Econ Talk
|
||||
@@ -85,10 +84,14 @@ let
|
||||
(fromDb "feed.podbean.com/matrixlive/feed.xml" // tech)
|
||||
## Michael Malice - Your Welcome -- also available here: <https://origin.podcastone.com/podcast?categoryID2=2232>
|
||||
(fromDb "rss.art19.com/your-welcome" // pol)
|
||||
(fromDb "seattlenice.buzzsprout.com" // pol)
|
||||
## Sci-Fi? has Peter Watts; author of No Moods, Ads or Cutesy Fucking Icons (rifters.com)
|
||||
(fromDb "talesfromthebridge.buzzsprout.com" // tech)
|
||||
];
|
||||
|
||||
texts = [
|
||||
# AGGREGATORS (> 1 post/day)
|
||||
(fromDb "lwn.net" // tech)
|
||||
(fromDb "lesswrong.com" // rat)
|
||||
(fromDb "econlib.org" // pol)
|
||||
|
||||
@@ -105,8 +108,11 @@ let
|
||||
# DEVELOPERS
|
||||
(fromDb "uninsane.org" // tech)
|
||||
(fromDb "mg.lol" // tech)
|
||||
(fromDb "drewdevault.com" // tech)
|
||||
## Ken Shirriff
|
||||
(fromDb "righto.com" // tech)
|
||||
## shared blog by a few NixOS devs, notably onny
|
||||
(fromDb "project-insanity.org" // tech)
|
||||
## Vitalik Buterin
|
||||
(mkText "https://vitalik.ca/feed.xml" // tech // infrequent)
|
||||
## ian (Sanctuary)
|
||||
|
@@ -21,6 +21,12 @@
|
||||
sane.ids.freshrss.uid = 2401;
|
||||
sane.ids.freshrss.gid = 2401;
|
||||
sane.ids.mediawiki.uid = 2402;
|
||||
sane.ids.signald.uid = 2403;
|
||||
sane.ids.signald.gid = 2403;
|
||||
sane.ids.mautrix-signal.uid = 2404;
|
||||
sane.ids.mautrix-signal.gid = 2404;
|
||||
sane.ids.navidrome.uid = 2405;
|
||||
sane.ids.navidrome.gid = 2405;
|
||||
|
||||
sane.ids.colin.uid = 1000;
|
||||
sane.ids.guest.uid = 1100;
|
||||
|
@@ -1,16 +1,6 @@
|
||||
{ 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>
|
||||
@@ -30,14 +20,4 @@
|
||||
General.RoamThreshold = "-52"; # default -70
|
||||
General.RoamThreshold5G = "-52"; # default -76
|
||||
};
|
||||
|
||||
sane.fs."/var/lib/iwd/.secrets.psk.stamp" = {
|
||||
wantedBeforeBy = [ "iwd.service" ];
|
||||
generated.acl.mode = "0600";
|
||||
# XXX: install-iwd uses sed, but that's part of the default systemd unit path, it seems
|
||||
generated.script.script = builtins.readFile ../../scripts/install-iwd + ''
|
||||
touch "/var/lib/iwd/.secrets.psk.stamp"
|
||||
'';
|
||||
generated.script.scriptArgs = [ "/run/secrets/iwd" "/var/lib/iwd" ];
|
||||
};
|
||||
}
|
||||
|
@@ -1,24 +1,33 @@
|
||||
{ config, lib, sane-data, sane-lib, ... }:
|
||||
|
||||
let
|
||||
inherit (builtins) head map mapAttrs tail;
|
||||
inherit (lib) concatStringsSep mkMerge reverseList;
|
||||
in
|
||||
{
|
||||
sane.ssh.pubkeys =
|
||||
let
|
||||
# path is a DNS-style path like [ "org" "uninsane" "root" ]
|
||||
keyNameForPath = path:
|
||||
let
|
||||
rev = lib.reverseList path;
|
||||
name = builtins.head rev;
|
||||
host = lib.concatStringsSep "." (builtins.tail rev);
|
||||
rev = reverseList path;
|
||||
name = head rev;
|
||||
host = concatStringsSep "." (tail rev);
|
||||
in
|
||||
"${name}@${host}";
|
||||
|
||||
# [{ path :: [String], value :: String }] for the keys we want to install
|
||||
globalKeys = sane-lib.flattenAttrs sane-data.keys;
|
||||
localKeys = sane-lib.flattenAttrs sane-data.keys.org.uninsane.local;
|
||||
in lib.mkMerge (builtins.map
|
||||
domainKeys = sane-lib.flattenAttrs (
|
||||
mapAttrs (host: cfg: {
|
||||
colin = cfg.ssh.user_pubkey;
|
||||
root = cfg.ssh.host_pubkey;
|
||||
}) config.sane.hosts.by-name
|
||||
);
|
||||
in mkMerge (map
|
||||
({ path, value }: {
|
||||
"${keyNameForPath path}" = value;
|
||||
"${keyNameForPath path}" = lib.mkIf (value != null) value;
|
||||
})
|
||||
(globalKeys ++ localKeys)
|
||||
(globalKeys ++ domainKeys)
|
||||
);
|
||||
}
|
||||
|
@@ -86,6 +86,7 @@ in
|
||||
"Pictures"
|
||||
"Videos"
|
||||
|
||||
".cache/nix"
|
||||
".cargo"
|
||||
".rustup"
|
||||
];
|
||||
@@ -125,8 +126,8 @@ in
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
permitRootLogin = "no";
|
||||
passwordAuthentication = false;
|
||||
settings.PermitRootLogin = "no";
|
||||
settings.PasswordAuthentication = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -1,12 +1,16 @@
|
||||
# trampoline from flake.nix into the specific host definition, while doing a tiny bit of common setup
|
||||
|
||||
# args from flake-level `import`
|
||||
{ hostName, localSystem }:
|
||||
{ ... }:
|
||||
|
||||
# module args
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./${hostName}
|
||||
./by-name/${hostName}
|
||||
./common
|
||||
./modules
|
||||
];
|
||||
|
||||
networking.hostName = hostName;
|
||||
|
12
hosts/modules/default.nix
Normal file
12
hosts/modules/default.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./derived-secrets.nix
|
||||
./hardware
|
||||
./hostnames.nix
|
||||
./hosts.nix
|
||||
./roles
|
||||
./wg-home.nix
|
||||
];
|
||||
}
|
47
hosts/modules/derived-secrets.nix
Normal file
47
hosts/modules/derived-secrets.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (builtins) toString;
|
||||
inherit (lib) mapAttrs mkOption types;
|
||||
cfg = config.sane.derived-secrets;
|
||||
secret = types.submodule {
|
||||
options = {
|
||||
len = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
encoding = mkOption {
|
||||
type = types.enum [ "base64" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
sane.derived-secrets = mkOption {
|
||||
type = types.attrsOf secret;
|
||||
default = {};
|
||||
description = ''
|
||||
fs path => secret options.
|
||||
for each entry, we create an item at the given path whose value is deterministic,
|
||||
but also pseudo-random and not predictable by anyone without root access to the machine.
|
||||
as PRNG source we use the host ssh key, and derived secrets are salted based on the destination path.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
sane.fs = mapAttrs (path: c: {
|
||||
generated.script.script = ''
|
||||
echo "$1" | cat /dev/stdin /etc/ssh/host_keys/ssh_host_ed25519_key \
|
||||
| sha512sum \
|
||||
| cut -c 1-${toString (c.len * 2)} \
|
||||
| tr a-z A-Z \
|
||||
| basenc -d --base16 \
|
||||
| basenc --${c.encoding} \
|
||||
> "$1"
|
||||
'';
|
||||
generated.script.scriptArgs = [ path ];
|
||||
generated.acl.mode = "0600";
|
||||
}) cfg;
|
||||
};
|
||||
}
|
@@ -2,7 +2,6 @@
|
||||
|
||||
{
|
||||
imports = [
|
||||
./all.nix
|
||||
./x86_64.nix
|
||||
];
|
||||
}
|
@@ -1,8 +1,7 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
config = mkIf (pkgs.system == "x86_64-linux") {
|
||||
config = lib.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.
|
11
hosts/modules/hostnames.nix
Normal file
11
hosts/modules/hostnames.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
# 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 = lib.mapAttrs' (host: cfg: {
|
||||
name = cfg.lan-ip;
|
||||
value = [ host ];
|
||||
}) config.sane.hosts.by-name;
|
||||
}
|
100
hosts/modules/hosts.nix
Normal file
100
hosts/modules/hosts.nix
Normal file
@@ -0,0 +1,100 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) attrValues filterAttrs mkMerge mkOption types;
|
||||
cfg = config.sane.hosts;
|
||||
|
||||
host = types.submodule ({ config, ... }: {
|
||||
options = {
|
||||
ssh.user_pubkey = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
ssh pubkey that the primary user of this machine will use when connecting to other machines.
|
||||
e.g. "ssh-ed25519 AAAA<base64>".
|
||||
'';
|
||||
};
|
||||
ssh.host_pubkey = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
ssh pubkey which this host will present to connections initiated against it.
|
||||
e.g. "ssh-ed25519 AAAA<base64>".
|
||||
'';
|
||||
};
|
||||
wg-home.pubkey = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
wireguard public key for the wg-home VPN.
|
||||
e.g. "pWtnKW7f7sNIZQ2M83uJ7cHg3IL1tebE3IoVkCgjkXM=".
|
||||
'';
|
||||
};
|
||||
wg-home.ip = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
IP address to use on the wg-home VPN.
|
||||
e.g. "10.0.10.5";
|
||||
'';
|
||||
};
|
||||
wg-home.endpoint = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
lan-ip = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
ip address when on the lan.
|
||||
e.g. "192.168.0.5";
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
in
|
||||
{
|
||||
options = {
|
||||
sane.hosts.by-name = mkOption {
|
||||
type = types.attrsOf host;
|
||||
default = {};
|
||||
description = ''
|
||||
map of hostname => attrset of information specific to that host,
|
||||
like its ssh pubkey, etc.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# TODO: this should be populated per-host
|
||||
sane.hosts.by-name."desko" = {
|
||||
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPU5GlsSfbaarMvDA20bxpSZGWviEzXGD8gtrIowc1pX";
|
||||
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFw9NoRaYrM6LbDd3aFBc4yyBlxGQn8HjeHd/dZ3CfHk";
|
||||
wg-home.pubkey = "17PMZssYi0D4t2d0vbmhjBKe1sGsE8kT8/dod0Q2CXc=";
|
||||
wg-home.ip = "10.0.10.22";
|
||||
lan-ip = "192.168.0.22";
|
||||
};
|
||||
|
||||
sane.hosts.by-name."lappy" = {
|
||||
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDpmFdNSVPRol5hkbbCivRhyeENzb9HVyf9KutGLP2Zu";
|
||||
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSJnqmVl9/SYQ0btvGb0REwwWY8wkdkGXQZfn/1geEc";
|
||||
wg-home.pubkey = "FTUWGw2p4/cEcrrIE86PWVnqctbv8OYpw8Gt3+dC/lk=";
|
||||
wg-home.ip = "10.0.10.20";
|
||||
lan-ip = "192.168.0.20";
|
||||
};
|
||||
|
||||
sane.hosts.by-name."moby" = {
|
||||
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrR+gePnl0nV/vy7I5BzrGeyVL+9eOuXHU1yNE3uCwU";
|
||||
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1N/IT3nQYUD+dBlU1sTEEVMxfOyMkrrDeyHcYgnJvw";
|
||||
wg-home.pubkey = "I7XIR1hm8bIzAtcAvbhWOwIAabGkuEvbWH/3kyIB1yA=";
|
||||
wg-home.ip = "10.0.10.48";
|
||||
lan-ip = "192.168.0.48";
|
||||
};
|
||||
|
||||
sane.hosts.by-name."servo" = {
|
||||
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPS1qFzKurAdB9blkWomq8gI1g0T3sTs9LsmFOj5VtqX";
|
||||
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOfdSmFkrVT6DhpgvFeQKm3Fh9VKZ9DbLYOPOJWYQ0E8";
|
||||
wg-home.pubkey = "roAw+IUFVtdpCcqa4khB385Qcv9l5JAB//730tyK4Wk=";
|
||||
wg-home.ip = "10.0.10.5";
|
||||
wg-home.endpoint = "uninsane.org:51820";
|
||||
lan-ip = "192.168.0.5";
|
||||
};
|
||||
};
|
||||
}
|
18
hosts/modules/roles/client/bluetooth-pairings.nix
Normal file
18
hosts/modules/roles/client/bluetooth-pairings.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.sane.roles.client {
|
||||
# persist external pairings by default
|
||||
sane.persist.sys.plaintext = [ "/var/lib/bluetooth" ];
|
||||
|
||||
sane.fs."/var/lib/bluetooth".generated.acl.mode = "0700";
|
||||
sane.fs."/var/lib/bluetooth/.secrets.stamp" = {
|
||||
wantedBeforeBy = [ "bluetooth.service" ];
|
||||
# XXX: install-bluetooth uses sed, but that's part of the default systemd unit path, it seems
|
||||
generated.script.script = builtins.readFile ../../../../scripts/install-bluetooth + ''
|
||||
touch "/var/lib/bluetooth/.secrets.stamp"
|
||||
'';
|
||||
generated.script.scriptArgs = [ "/run/secrets/bt" ];
|
||||
};
|
||||
};
|
||||
}
|
17
hosts/modules/roles/client/default.nix
Normal file
17
hosts/modules/roles/client/default.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./bluetooth-pairings.nix
|
||||
./wifi-pairings.nix
|
||||
];
|
||||
|
||||
# option is consumed by the other imports in this dir
|
||||
options.sane.roles.client = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
}
|
15
hosts/modules/roles/client/wifi-pairings.nix
Normal file
15
hosts/modules/roles/client/wifi-pairings.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.sane.roles.client {
|
||||
sane.fs."/var/lib/iwd/.secrets.psk.stamp" = {
|
||||
wantedBeforeBy = [ "iwd.service" ];
|
||||
generated.acl.mode = "0600";
|
||||
# XXX: install-iwd uses sed, but that's part of the default systemd unit path, it seems
|
||||
generated.script.script = builtins.readFile ../../../../scripts/install-iwd + ''
|
||||
touch "/var/lib/iwd/.secrets.psk.stamp"
|
||||
'';
|
||||
generated.script.scriptArgs = [ "/run/secrets/iwd" "/var/lib/iwd" ];
|
||||
};
|
||||
};
|
||||
}
|
6
hosts/modules/roles/default.nix
Normal file
6
hosts/modules/roles/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./client
|
||||
];
|
||||
}
|
80
hosts/modules/wg-home.nix
Normal file
80
hosts/modules/wg-home.nix
Normal file
@@ -0,0 +1,80 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (builtins) filter map;
|
||||
inherit (lib) concatMap mapAttrsToList mkIf mkMerge mkOption optionalAttrs types;
|
||||
cfg = config.sane.services.wg-home;
|
||||
server-cfg = config.sane.hosts.by-name."servo".wg-home;
|
||||
mkPeer = { ips, pubkey, endpoint }: {
|
||||
publicKey = pubkey;
|
||||
allowedIPs = map (k: "${k}/32") ips;
|
||||
} // (optionalAttrs (endpoint != null) {
|
||||
inherit endpoint;
|
||||
# send keepalives every 25 seconds to keep NAT routes live.
|
||||
# only need to do this from client -> server though, i think.
|
||||
persistentKeepalive = 25;
|
||||
# allows wireguard to notice DNS/hostname changes, with this much effective TTL.
|
||||
dynamicEndpointRefreshSeconds = 600;
|
||||
});
|
||||
# make separate peers to route each given host
|
||||
mkClientPeers = hosts: map (p: mkPeer {
|
||||
inherit (p) pubkey endpoint;
|
||||
ips = [ p.ip ];
|
||||
}) hosts;
|
||||
# make a single peer which routes all the given hosts
|
||||
mkServerPeer = hosts: mkPeer {
|
||||
inherit (server-cfg) pubkey endpoint;
|
||||
ips = map (h: h.ip) hosts;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
sane.services.wg-home.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
sane.services.wg-home.ip = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# generate a (deterministic) wireguard private key
|
||||
sane.derived-secrets."/run/wg-home.priv" = {
|
||||
len = 32;
|
||||
encoding = "base64";
|
||||
};
|
||||
|
||||
# wireguard VPN which allows everything on my domain to speak to each other even when
|
||||
# not behind a shared LAN.
|
||||
# this config defines both the endpoint (server) and client configs
|
||||
|
||||
# for convenience, have both the server and client use the same port for their wireguard connections.
|
||||
networking.firewall.allowedUDPPorts = [ 51820 ];
|
||||
networking.wireguard.interfaces.wg-home = {
|
||||
listenPort = 51820;
|
||||
privateKeyFile = "/run/wg-home.priv";
|
||||
preSetup =
|
||||
let
|
||||
gen-key = config.sane.fs."/run/wg-home.priv".unit;
|
||||
in
|
||||
"${pkgs.systemd}/bin/systemctl start '${gen-key}'";
|
||||
|
||||
ips = [
|
||||
"${cfg.ip}/24"
|
||||
];
|
||||
|
||||
peers =
|
||||
let
|
||||
all-peers = mapAttrsToList (_: hostcfg: hostcfg.wg-home) config.sane.hosts.by-name;
|
||||
peer-list = filter (p: p.ip != null && p.ip != cfg.ip && p.pubkey != null) all-peers;
|
||||
in
|
||||
if cfg.ip == server-cfg.ip then
|
||||
# if we're the server, then we maintain the entire client list
|
||||
mkClientPeers peer-list
|
||||
else
|
||||
# but if we're a client, we maintain a single peer -- the server -- which does the actual routing
|
||||
[ (mkServerPeer peer-list) ];
|
||||
};
|
||||
};
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
{ config, ... }:
|
||||
|
||||
# installer docs: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/installation-device.nix
|
||||
{
|
||||
# automatically log in at the virtual consoles.
|
||||
# using root here makes sure we always have an escape hatch
|
||||
services.getty.autologinUser = "root";
|
||||
|
||||
# gitea doesn't create the git user
|
||||
users.users.git = {
|
||||
description = "Gitea Service";
|
||||
home = "/var/lib/gitea";
|
||||
useDefaultShell = true;
|
||||
group = "gitea";
|
||||
isSystemUser = true;
|
||||
# sendmail access (not 100% sure if this is necessary)
|
||||
extraGroups = [ "postdrop" ];
|
||||
};
|
||||
|
||||
# this is required to allow pleroma to send email.
|
||||
# raw `sendmail` works, but i think pleroma's passing it some funny flags or something, idk.
|
||||
# hack to fix that.
|
||||
users.users.pleroma.extraGroups = [ "postdrop" ];
|
||||
}
|
21
modules/data/feeds/sources/drewdevault.com/default.json
Normal file
21
modules/data/feeds/sources/drewdevault.com/default.json
Normal file
File diff suppressed because one or more lines are too long
21
modules/data/feeds/sources/lwn.net/default.json
Normal file
21
modules/data/feeds/sources/lwn.net/default.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"bozo": 0,
|
||||
"content_length": 14068,
|
||||
"content_type": "application/xml; charset=utf-8",
|
||||
"description": "LWN.net is a comprehensive source of news and opinions from\n and about the Linux community. This is the main LWN.net feed,\n listing all articles which are posted to the site front page.",
|
||||
"favicon": "https://static.lwn.net/images/favicon.png",
|
||||
"favicon_data_uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9oMHRALH2oogOQAAAdtSURBVFjDvZd7cFT1Fcc/v9+9d3N3N9nNxg3ZhCS8CYgpQnjYqaZQpaI1QMTxAbb2ga0dZ7T4oNOhY9FxHKtjp1Y7lo6tODqOtk5hSgdHBJwq1ALDIITwSgIhPEISNmRDdrP3+esfCxkYCE1G2t/MnfuY8zvne875nvM7F4a/JgKvAkeA7vP3PwAV/B/WNCANqAuXGQyqhx9brqqqq21g5nAVymHKvwSELv5gmiYBzWBEcYkBvAfk/a+814D+i70f5Fo8XKVDXWHgmSUPPsT462/g8P5G4vE4r61+m0hRjERlJS2HDgL0AX8fqlJ9qII/euGDqXF1mrr588hmLTZ9vJHNX+yl9WgLP37kcTZt2czmf6xH6sY4x+rnmgMYMarq7m9PqGbdhk/At3ngZ89jux6/fullZn7jZuoXP8j2A6fp6Tge2/7RO9ceQJ4RPLrm/b+pWyYrMSJ0homjjnFwdzMvrxhNe7KX/qzF1rWrSaeSwyKWGI7wfbUlmTUvRoIBQyC0SqAPIYt478NWbpkpqFzYCGDdf/8Px9bX181y3Uzr0qVLv7xmAF54aMK564oK8pc90I/v+rz5vuBcWjHteo1wvs57B2+nYmQZNdNr7IL8cMDzXP9sT8+WbqG+993589u/MoBJU6p7nr8nHD2b7sWxFWNHa3x9us2h4zNwJz5JqifJdfE4BxobaWs7Rn393QCcPHXqj7fPu+0nX7UR3blo8b3RW5dvJDFmJpPGhdHDU8i7aR+h6SuRQqFrGmv+/Cdc16WhoYFAIIBpmhRGo9OGTMINGzbkZbPecj1PnyZ8lcpY1sePPfrU5x0dLW+sfPoJ8vND3LzkNSzLpqgoyr7GRnRdZ+tn/6SpqYmOzg5mzZQkEgm6u7uJx+MoIdSQAKxa9anueNmPRlYk5oZDIRSQzdoPv/3Oaid5NmVc0FNYWIDjuOzZ0wD4rFu3llmzZrNj5w7C4TAliQR1dQtI9fTQfuokpeUVQyvDaTXZlWVlJXMjBQVIKfE8j7xIHoXRiFHuODTsO4AZDFJZMZJDTU3s27+fb9XW0tvbi5XNUlNTw8JF9TQ2NGBZ2RzJhGDbtn9FgFKg/aocKIrHRkQjEVzXxbIspJQIIVBKoUtJLBbF0DXajjTjWf3EzTZaPnuO9vac3u/cVYenFKZpEo8XM2HCRLZs+ZS33nqrqnRkxaP/NQLKsVfZtv19XddDAEqpAS8uvGuaxJIaBXkdzB77CVogQNms15FCIoRC+Yqx48blvBOCxsZGlK9ELB4vbT95/OpVUFtb2+U47l8uNujYNplMBt/3UUrh+z5SN4j1bkHhczDvdXRNglAIIdCkAKWQQuD7Pr999XdMqhrftX/P7meH1AfGTZrUKly3ctmyZaJuwUK6u7vxPI+CggjBoJkzomlomQ4ssxgJeJ6Hrml4/gWyK5RSCCmRCE53nN4755u1U4fUB0ZXjm3r7OoSe/fuxfc8zvWl6T3Xx8lTp+hLZwbkXNdH+j7K95FS4rhuzqjI+SV1PZc6IQgEAtkhT0SbN25YMLK8Yv+TT61ANwzKSkuIRiNomkY2m8X3fVzXJUOQsMzgK1AKpJRImQuoPJ+GHBSFrhvucE7Dnmd/9czXKs8stZOqXsqy+ygqLKSkuBiVIwYK8NBAOblc4yOFBAVSk/i+j57ezxj35yAVnzfXTRvWYZT9YqIfMEcJVIbDJ6L4E15BiJzigY1CI+h0kdaL8F2Xzs5Okskz3DD1RiSCUWfuwsyvAsB3jrJrl55qbmGO8DMnlrxy+MygEdi+uropECgUiBCIEOMTh2jrP0S/WYVhGKAUnu8jpcDL+qTOneXEieN4nneefwrfasIMhgcmPqmXM316S3RGjbFbKUFponr13KcbHrkkAsfWVjvxuKXrhsIwJwLGeYUWdn8zLbH1aEKi8AGBJiU4faS6kzSf6CISjVIcL+ZUZ5I5+Y8TKRwNBAeq4qL4cqDxtDVl6R7zkgiUlwtd6FXkaHxRZkSAgDmS0vZ6tBnbyWQypNNp+vv70aRJNBajJjGKolgM0wyxYdPvufNWHwgMkmmX0oQVuCwFrp/FEPIKtBAgo0QLujj2758yZt67ADiOQzLZTZ5ZSqwwCkBfX4Zx1hvoRslVBu4QBfmeGKQM1aBcFXqCsvydZFKnATAMg0SiZMB4Nmtxxx3zqb9NBxkaRI8LXs9Aa78EQO7Bu+j/4rKxFE1T7HrnDizLwbZtspZFT6qXD9euJxg02bVjG7oOKOcKhjuw+w/Tk+qkqSnkXJYCXymwm5BCIGQQRCG5SjiPUaWwHRAKTDNwRf8WzB6BbQmMQC9Ci+Qc8rvpS5/laGuIk23B1o6m1OQfrDmUvQzA5i35I8DbHApRZQYxCsIpES/uJBTKNRvbFhw/kc+BI9le4JfAGSAJ58sCxjS29dUebS1dWl6exgwexnOhvT1EU7PZmtnz5fh7/4o3rKH03Sem35Qf9d4MBf3JAiVSfcbWe57bXXu1PR/84sYVRYXei3lBIfrOkbGTeZMW/Wbn8cHk/wNEUBaFSM2AYgAAAABJRU5ErkJggg==",
|
||||
"hubs": [],
|
||||
"is_podcast": false,
|
||||
"is_push": false,
|
||||
"item_count": 15,
|
||||
"last_updated": "2023-01-22T15:53:01+00:00",
|
||||
"score": 18,
|
||||
"self_url": "",
|
||||
"site_name": "Welcome to LWN.net [LWN.net]",
|
||||
"site_url": "https://lwn.net",
|
||||
"title": "LWN.net",
|
||||
"url": "https://lwn.net/headlines/newrss",
|
||||
"velocity": 2.78,
|
||||
"version": "rss10"
|
||||
}
|
21
modules/data/feeds/sources/project-insanity.org/default.json
Normal file
21
modules/data/feeds/sources/project-insanity.org/default.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"bozo": 0,
|
||||
"content_length": 11426,
|
||||
"content_type": "application/rss+xml; charset=utf-8",
|
||||
"description": "Awesome hacking blog",
|
||||
"favicon": "",
|
||||
"favicon_data_uri": "",
|
||||
"hubs": [],
|
||||
"is_podcast": false,
|
||||
"is_push": false,
|
||||
"item_count": 10,
|
||||
"last_updated": "2023-01-01T22:57:33+00:00",
|
||||
"score": 12,
|
||||
"self_url": "https://blog.project-insanity.org/feed/",
|
||||
"site_name": "project-insanity.org",
|
||||
"site_url": "https://blog.project-insanity.org",
|
||||
"title": "project-insanity.org",
|
||||
"url": "https://blog.project-insanity.org/feed/",
|
||||
"velocity": 0.026,
|
||||
"version": "rss20"
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"bozo": 0,
|
||||
"content_length": 96380,
|
||||
"content_type": "text/xml; charset=utf-8",
|
||||
"description": "It\u2019s getting harder and harder to talk about politics, especially if you disagree. Well, screw that. Seattle Nice aims to be the most opinionated and smartest analysis of what\u2019s really happening in Seattle politics available in any medium. Each episode dives into contentious and sometimes ridiculous topics, exploring perspectives from across Seattle's political spectrum, from city council brawls to the ways the national political conversation filters through our unique political process. Even if you\u2019re not from Seattle, you need to listen to Seattle Nice. Because it\u2019s coming for you. Unlike the sun, politics rises in the West and sets in the East.",
|
||||
"favicon": "",
|
||||
"favicon_data_uri": "",
|
||||
"hubs": [
|
||||
"https://pubsubhubbub.appspot.com/"
|
||||
],
|
||||
"is_podcast": true,
|
||||
"is_push": true,
|
||||
"item_count": 43,
|
||||
"last_updated": "2023-01-20T21:00:00+00:00",
|
||||
"score": 12,
|
||||
"self_url": "https://feeds.buzzsprout.com/1897925.rss",
|
||||
"site_name": "",
|
||||
"site_url": "",
|
||||
"title": "Seattle Nice",
|
||||
"url": "https://feeds.buzzsprout.com/1897925.rss",
|
||||
"velocity": 0.104,
|
||||
"version": "rss20"
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"bozo": 0,
|
||||
"content_length": 357855,
|
||||
"content_type": "text/xml; charset=utf-8",
|
||||
"description": "Tales From the Bridge is a bi-weekly Science Fiction podcast. Join Tristan, Marty, Kevin, and Sam as they sit down with your favorite science fiction authors and filmmakers. We also discuss the best in sci-fi from books and graphic novels - to television and film. We cover cutting-edge concepts on our news segment; Science Fiction-Science Fact and throw in a bit of trivia for fun. Apple Podcasts; https://podcasts.apple.com/us/podcast/tales-from-the-bridge-all-things-sci-fi/id1570902818 Find out more on our website: https://talesfromthebridge.buzzsprout.com/",
|
||||
"favicon": "",
|
||||
"favicon_data_uri": "",
|
||||
"hubs": [
|
||||
"https://pubsubhubbub.appspot.com/"
|
||||
],
|
||||
"is_podcast": true,
|
||||
"is_push": true,
|
||||
"item_count": 64,
|
||||
"last_updated": "2023-01-18T23:00:00+00:00",
|
||||
"score": 12,
|
||||
"self_url": "https://feeds.buzzsprout.com/1795352.rss",
|
||||
"site_name": "",
|
||||
"site_url": "",
|
||||
"title": "Tales From The Bridge: All Things Sci-Fi",
|
||||
"url": "https://feeds.buzzsprout.com/1795352.rss",
|
||||
"velocity": 0.101,
|
||||
"version": "rss20"
|
||||
}
|
@@ -5,20 +5,11 @@
|
||||
org.uninsane = rec {
|
||||
root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOfdSmFkrVT6DhpgvFeQKm3Fh9VKZ9DbLYOPOJWYQ0E8";
|
||||
git.root = root;
|
||||
};
|
||||
|
||||
local = {
|
||||
# machine aliases i specify on my lan; not actually asserted as DNS
|
||||
desko.colin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPU5GlsSfbaarMvDA20bxpSZGWviEzXGD8gtrIowc1pX";
|
||||
desko.root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFw9NoRaYrM6LbDd3aFBc4yyBlxGQn8HjeHd/dZ3CfHk";
|
||||
|
||||
lappy.colin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDpmFdNSVPRol5hkbbCivRhyeENzb9HVyf9KutGLP2Zu";
|
||||
lappy.root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSJnqmVl9/SYQ0btvGb0REwwWY8wkdkGXQZfn/1geEc";
|
||||
|
||||
moby.colin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrR+gePnl0nV/vy7I5BzrGeyVL+9eOuXHU1yNE3uCwU";
|
||||
moby.root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1N/IT3nQYUD+dBlU1sTEEVMxfOyMkrrDeyHcYgnJvw";
|
||||
|
||||
servo.colin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPS1qFzKurAdB9blkWomq8gI1g0T3sTs9LsmFOj5VtqX";
|
||||
servo.root = root;
|
||||
};
|
||||
com.github = {
|
||||
# documented here: <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints>
|
||||
# Github actually uses multiple keys -- one per format
|
||||
root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
|
||||
};
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
https://search.nixos.org/options?channel=unstable&query=
|
||||
https://search.nixos.org/packages?channel=unstable&query=
|
||||
https://nixos.wiki/index.php?go=Go&search=
|
||||
https://nixos.org/manual/nix/stable/language/builtins.html
|
||||
https://github.com/nixos/nixpkgs/pulls?q=
|
||||
https://nur.nix-community.org/
|
||||
https://nix-community.github.io/home-manager/options.html
|
||||
|
@@ -140,5 +140,7 @@ in
|
||||
cfg.programs
|
||||
];
|
||||
};
|
||||
|
||||
sane.persist.home.plaintext = [ ".cache/nix-index" ];
|
||||
};
|
||||
}
|
||||
|
@@ -59,10 +59,10 @@ let
|
||||
# `wget ...xpi`; `unar ...xpi`; `cat */manifest.json | jq '.browser_specific_settings.gecko.id'`
|
||||
(addon "ublock-origin" "uBlock0@raymondhill.net" "sha256-a/ivUmY1P6teq9x0dt4CbgHt+3kBsEMMXlOfZ5Hx7cg=")
|
||||
(addon "sponsorblock" "sponsorBlocker@ajay.app" "sha256-d2K3ufvurWnYVzqLbyR//MgejybkY9exitAf9RdLNRo=")
|
||||
(addon "bypass-paywalls-clean" "{d133e097-46d9-4ecc-9903-fa6a722a6e0e}" "sha256-t6Q335Nq60mDILPmzem+DT5KflleAPVJL3bsaA+UL0g=")
|
||||
(addon "bypass-paywalls-clean" "{d133e097-46d9-4ecc-9903-fa6a722a6e0e}" "sha256-JOj5P7c2JTTReHCRZXm4BscaGr3i+9Y4Ey/y621x8PI=")
|
||||
(addon "sidebery" "{3c078156-979c-498b-8990-85f7987dd929}" "sha256-YONfK/rIjlsrTgRHIt3km07Q7KnpIW89Z9r92ZSCc6w=")
|
||||
(addon "ether-metamask" "webextension@metamask.io" "sha256-G+MwJDOcsaxYSUXjahHJmkWnjLeQ0Wven8DU/lGeMzA=")
|
||||
(addon "ublacklist" "@ublacklist" "sha256-vHe/7EYOzcKeAbTElmt0Rb4E2rX0f3JgXThJaUmaz+M=")
|
||||
(addon "ublacklist" "@ublacklist" "sha256-RqY5iHzbL2qizth7aguyOKWPyINXmrwOlf/OsfqAS48=")
|
||||
(addon "i2p-in-private-browsing" "i2ppb@eyedeekay.github.io" "sha256-dJcJ3jxeAeAkRvhODeIVrCflvX+S4E0wT/PyYzQBQWs=")
|
||||
# (addon "browserpass-ce" "browserpass@maximbaz.com" "sha256-sXgUBbRvMnRpeIW1MTkmTcoqtW/8RDXAkxAq1evFkpc=")
|
||||
(localAddon pkgs.browserpass-extension)
|
||||
|
@@ -102,7 +102,9 @@ let
|
||||
gnome.gnome-terminal # works on phosh
|
||||
gnome.gnome-weather
|
||||
|
||||
{ pkg = gpodder-configured; dir = [ "gPodder/Downloads" ]; }
|
||||
# XXX: we preserve the whole thing because if we only preserve gPodder/Downloads
|
||||
# then startup is SLOW during feed import, and we might end up with zombie eps in the dl dir.
|
||||
{ pkg = gpodder-configured; dir = [ "gPodder" ]; }
|
||||
|
||||
gthumb
|
||||
handbrake
|
||||
@@ -113,7 +115,6 @@ let
|
||||
krita
|
||||
libreoffice-fresh # XXX colin: maybe don't want this on mobile
|
||||
lollypop
|
||||
mesa-demos
|
||||
|
||||
{ pkg = mpv; dir = [ ".config/mpv/watch_later" ]; }
|
||||
|
||||
@@ -151,7 +152,9 @@ let
|
||||
# vlc remembers play position in ~/.config/vlc/vlc-qt-interface.conf
|
||||
{ pkg = vlc; dir = [ ".config/vlc" ]; }
|
||||
|
||||
whalebird # pleroma client. input is broken on phosh
|
||||
# pleroma client (Electron). input is broken on phosh.
|
||||
{ pkg = whalebird; private = [ ".config/Whalebird" ]; }
|
||||
|
||||
xdg-utils # for xdg-open
|
||||
xterm # broken on phosh
|
||||
]
|
||||
|
@@ -4,6 +4,7 @@
|
||||
./duplicity.nix
|
||||
./dyn-dns.nix
|
||||
./kiwix-serve.nix
|
||||
./mautrix-signal.nix
|
||||
./nixserve.nix
|
||||
./trust-dns.nix
|
||||
];
|
||||
|
174
modules/services/mautrix-signal.nix
Normal file
174
modules/services/mautrix-signal.nix
Normal file
@@ -0,0 +1,174 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
dataDir = "/var/lib/mautrix-signal";
|
||||
registrationFile = "${dataDir}/signal-registration.yaml";
|
||||
cfg = config.services.mautrix-signal;
|
||||
settingsFormat = pkgs.formats.json {};
|
||||
settingsFile =
|
||||
settingsFormat.generate "mautrix-signal-config.json" cfg.settings;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.mautrix-signal = {
|
||||
enable = mkEnableOption (lib.mdDoc "Mautrix-Signal, a Matrix-Signal puppeting bridge");
|
||||
|
||||
settings = mkOption rec {
|
||||
apply = recursiveUpdate default;
|
||||
inherit (settingsFormat) type;
|
||||
default = {
|
||||
# defaults based on this upstream example config:
|
||||
# - <https://github.com/mautrix/signal/blob/master/mautrix_signal/example-config.yaml>
|
||||
homeserver = {
|
||||
address = "http://localhost:8008";
|
||||
software = "standard";
|
||||
# domain = "SETME";
|
||||
};
|
||||
|
||||
appservice = rec {
|
||||
address = "http://${hostname}:${toString port}";
|
||||
hostname = "localhost";
|
||||
port = 29328;
|
||||
|
||||
database = "sqlite:///${dataDir}/mautrix-signal.db";
|
||||
database_opts = {};
|
||||
bot_username = "signalbot";
|
||||
};
|
||||
|
||||
bridge = {
|
||||
username_template = "signal_{userid}";
|
||||
permissions."*" = "relay";
|
||||
double_puppet_server_map = {};
|
||||
login_shared_secret_map = {};
|
||||
};
|
||||
|
||||
logging = {
|
||||
version = 1;
|
||||
|
||||
formatters.precise.format = "[%(levelname)s@%(name)s] %(message)s";
|
||||
|
||||
handlers.console = {
|
||||
class = "logging.StreamHandler";
|
||||
formatter = "precise";
|
||||
};
|
||||
|
||||
# log to console/systemd instead of file
|
||||
root = {
|
||||
level = "INFO";
|
||||
handlers = ["console"];
|
||||
};
|
||||
};
|
||||
};
|
||||
example = literalExpression ''
|
||||
{
|
||||
homeserver = {
|
||||
address = "http://localhost:8008";
|
||||
domain = "mydomain.example";
|
||||
};
|
||||
|
||||
bridge.permissions = {
|
||||
"@admin:mydomain.example" = "admin";
|
||||
"mydomain.example" = "user";
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = lib.mdDoc ''
|
||||
{file}`config.yaml` configuration as a Nix attribute set.
|
||||
Configuration options should match those described in
|
||||
[example-config.yaml](https://github.com/mautrix/signale/blob/master/mautrix_signal/example-config.yaml).
|
||||
'';
|
||||
};
|
||||
|
||||
environmentFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = lib.mdDoc ''
|
||||
File containing environment variables to be passed to the mautrix-signal service,
|
||||
in which secret tokens can be specified securely by defining values for e.g.
|
||||
`MAUTRIX_SIGNAL_APPSERVICE_AS_TOKEN`,
|
||||
`MAUTRIX_SIGNAL_APPSERVICE_HS_TOKEN`
|
||||
|
||||
These environment variables can also be used to set other options by
|
||||
replacing hierarchy levels by `.`, converting the name to uppercase
|
||||
and prepending `MAUTRIX_SIGNAL_`.
|
||||
For example, the first value above maps to
|
||||
{option}`settings.appservice.as_token`.
|
||||
|
||||
The environment variable values can be prefixed with `json::` to have
|
||||
them be parsed as JSON. For example, `login_shared_secret_map` can be
|
||||
set as follows:
|
||||
`MAUTRIX_SIGNAL_BRIDGE_LOGIN_SHARED_SECRET_MAP=json::{"example.com":"secret"}`.
|
||||
'';
|
||||
};
|
||||
|
||||
serviceDependencies = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = optional config.services.matrix-synapse.enable "matrix-synapse.service";
|
||||
defaultText = literalExpression ''
|
||||
optional config.services.matrix-synapse.enable "matrix-synapse.service"
|
||||
'';
|
||||
description = lib.mdDoc ''
|
||||
List of Systemd services to require and wait for when starting the application service.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
users.groups.mautrix-signal = {};
|
||||
|
||||
users.users.mautrix-signal = {
|
||||
group = "mautrix-signal";
|
||||
isSystemUser = true;
|
||||
};
|
||||
|
||||
systemd.services.mautrix-signal = {
|
||||
description = "Mautrix-Signal, a Matrix-Signal puppeting bridge.";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ] ++ cfg.serviceDependencies;
|
||||
after = [ "network-online.target" ] ++ cfg.serviceDependencies;
|
||||
path = [ pkgs.ffmpeg ]; # voice messages need `ffmpeg`
|
||||
|
||||
# environment.HOME = dataDir;
|
||||
|
||||
preStart = ''
|
||||
# generate the appservice's registration file if absent
|
||||
if [ ! -f '${registrationFile}' ]; then
|
||||
${pkgs.mautrix-signal}/bin/mautrix-signal \
|
||||
--generate-registration \
|
||||
--no-update \
|
||||
--base-config='${pkgs.mautrix-signal}/${pkgs.mautrix-signal.pythonModule.sitePackages}/mautrix_signal/example-config.yaml' \
|
||||
--config='${settingsFile}' \
|
||||
--registration='${registrationFile}'
|
||||
fi
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
|
||||
User = "mautrix-signal";
|
||||
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectControlGroups = true;
|
||||
|
||||
PrivateTmp = true;
|
||||
WorkingDirectory = pkgs.mautrix-signal;
|
||||
StateDirectory = baseNameOf dataDir;
|
||||
UMask = "0027";
|
||||
EnvironmentFile = cfg.environmentFile;
|
||||
|
||||
ExecStart = ''
|
||||
${pkgs.mautrix-signal}/bin/mautrix-signal \
|
||||
--config='${settingsFile}' \
|
||||
--no-update
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@@ -57,7 +57,7 @@ in
|
||||
options = {
|
||||
sane.ssh.pubkeys = mkOption {
|
||||
type = types.attrsOf coercedToKey;
|
||||
default = [];
|
||||
default = {};
|
||||
description = ''
|
||||
mapping from "user@host" to pubkey.
|
||||
'';
|
||||
|
@@ -1,15 +1,14 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-22.11";
|
||||
nixpkgs = {};
|
||||
};
|
||||
outputs = { self, nixpkgs }:
|
||||
outputs = { self, nixpkgs }@inputs:
|
||||
let
|
||||
patchedPkgsFor = system: nixpkgs.legacyPackages.${system}.applyPatches {
|
||||
name = "nixpkgs-patched-uninsane";
|
||||
src = nixpkgs;
|
||||
patches = import ./list.nix {
|
||||
inherit (nixpkgs.legacyPackages.${system}) fetchpatch;
|
||||
inherit (nixpkgs.lib) fakeHash;
|
||||
inherit (nixpkgs.legacyPackages.${system}) fetchpatch fetchurl;
|
||||
};
|
||||
};
|
||||
patchedFlakeFor = system: import "${patchedPkgsFor system}/flake.nix";
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{ fakeHash, fetchpatch }: [
|
||||
{ fetchpatch, fetchurl }: [
|
||||
# librewolf: build with `MOZ_REQUIRE_SIGNING=false`
|
||||
(fetchpatch {
|
||||
url = "https://github.com/NixOS/nixpkgs/pull/199134.diff";
|
||||
@@ -13,10 +13,18 @@
|
||||
sha256 = "sha256-t4sG+xLDaxbJ/mV5G18N4ag8EC3IXPgtN5FJGANh1Dc=";
|
||||
})
|
||||
|
||||
# kiwix-tools: init at 3.4.0
|
||||
# splatmoji: init at 1.2.0
|
||||
(fetchpatch {
|
||||
url = "https://github.com/NixOS/nixpkgs/pull/206254.diff";
|
||||
sha256 = "sha256-Cendm7a23qj/YRBj5qVM8jhl9oTpztaDEkXcSG4dJys=";
|
||||
# https://github.com/NixOS/nixpkgs/pull/211874
|
||||
url = "https://git.uninsane.org/colin/nixpkgs/commit/75149039b6eaf57d8a92164e90aab20eb5d89196.diff";
|
||||
hash = "sha256-IvsIcd2wPdz4b/7FMrDrcVlIZjFecCQ9uiL0Umprbx0=";
|
||||
})
|
||||
|
||||
# matrix-synapse,mautrix-facebook: fix runtime inclusion of python3 systemd #212391
|
||||
# merged 2023/01/24
|
||||
(fetchpatch {
|
||||
url = "https://github.com/NixOS/nixpkgs/pull/212391.diff";
|
||||
hash = "sha256-N9lzQLi8NN9cbd+d04yx2v5mI9tVnlSKVbl0+QGE1YQ=";
|
||||
})
|
||||
|
||||
./2022-12-19-i2p-aarch64.patch
|
||||
|
37
overlays/pins.nix
Normal file
37
overlays/pins.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
# when a `nixos-rebuild` fails after a nixpkgs update:
|
||||
# - take the failed package
|
||||
# - search it here: <https://hydra.nixos.org/search?query=pkgname>
|
||||
# - if it's broken by that upstream builder, then pin it: somebody will come along and fix the package.
|
||||
# - otherwise, search github issues/PRs for knowledge of it before pinning.
|
||||
# - if nobody's said anything about it yet, probably want to root cause it or hold off on updating.
|
||||
(next: prev: {
|
||||
# XXX: when invoked outside our flake (e.g. via NIX_PATH) there is no `next.stable`,
|
||||
# so just forward the unstable packages.
|
||||
inherit (next.stable or prev)
|
||||
# broken on 2023/01/14 via mtxclient dep, aarch64-only:
|
||||
# fixed on 2023/01/24?
|
||||
# error: builder for '/nix/store/gwidl0c9ksxjgx0dgwnjssix4ikq73v5-mtxclient-0.9.0.drv' failed with exit code 2;
|
||||
# last 10 log lines:
|
||||
# > make[2]: *** [CMakeFiles/matrix_client.dir/build.make:370: CMakeFiles/matrix_client.dir/lib/structs/events/encrypted.cpp.o] Error 1
|
||||
# > In file included from /build/source/include/mtxclient/crypto/client.hpp:17,
|
||||
# > from /build/source/lib/crypto/utils.cpp:17:
|
||||
# > /build/source/include/mtx/identifiers.hpp:12:10: fatal error: compare: No such file or directory
|
||||
# > 12 | #include <compare>
|
||||
# > | ^~~~~~~~~
|
||||
# > compilation terminated.
|
||||
# > make[2]: *** [CMakeFiles/matrix_client.dir/build.make:132: CMakeFiles/matrix_client.dir/lib/crypto/utils.cpp.o] Error 1
|
||||
# > make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/matrix_client.dir/all] Error 2
|
||||
# > make: *** [Makefile:136: all] Error 2
|
||||
# For full logs, run 'nix log /nix/store/gwidl0c9ksxjgx0dgwnjssix4ikq73v5-mtxclient-0.9.0.drv'.
|
||||
# error: 1 dependencies of derivation '/nix/store/4i2d1qdh4x6n23h1jbcbhm8q9q2hch9a-nheko-0.11.0.drv' failed to build
|
||||
# error: 1 dependencies of derivation '/nix/store/k4f7k7cvjp8rb7clhlfq3yxgs6lbfmk7-home-manager-path.drv' failed to build
|
||||
# error: 1 dependencies of derivation '/nix/store/67d9k554188lh4ddl4ar6j74mpc3r4sv-home-manager-generation.drv' failed to build
|
||||
# error: 1 dependencies of derivation '/nix/store/5qjxzhsw1jvh2d7jypbcam9409ivb472-user-environment.drv' failed to build
|
||||
# error: 1 dependencies of derivation '/nix/store/hrb3qpdbisqh0lzlyz1g9g4164khmqwn-etc.drv' failed to build
|
||||
# error: 1 dependencies of derivation '/nix/store/ny21xyicbgim5wy7ksg2hibd9gn7i01b-nixos-system-moby-23.05pre-git.drv' failed to build
|
||||
# nheko
|
||||
|
||||
# TODO(unpin): broken build on 2023/01/16. <https://hydra.nixos.org/build/205551450>
|
||||
handbrake
|
||||
;
|
||||
})
|
67
overlays/pkgs.nix
Normal file
67
overlays/pkgs.nix
Normal file
@@ -0,0 +1,67 @@
|
||||
(next: prev:
|
||||
let
|
||||
sane = rec {
|
||||
#### my own, non-upstreamable packages:
|
||||
sane-scripts = prev.callPackage ../pkgs/sane-scripts { };
|
||||
feeds = prev.callPackage ../pkgs/feeds { };
|
||||
tow-boot-pinephone = prev.callPackage ../pkgs/tow-boot-pinephone { };
|
||||
tow-boot-rpi4 = prev.callPackage ../pkgs/tow-boot-rpi4 { };
|
||||
bootpart-uefi-x86_64 = prev.callPackage ../pkgs/bootpart-uefi-x86_64 { };
|
||||
bootpart-tow-boot-rpi-aarch64 = prev.callPackage ../pkgs/bootpart-tow-boot-rpi-aarch64 {
|
||||
# not sure why i can't just do `next.callPackage` instead
|
||||
inherit tow-boot-rpi4;
|
||||
};
|
||||
bootpart-u-boot-rpi-aarch64 = prev.callPackage ../pkgs/bootpart-u-boot-rpi-aarch64 {
|
||||
# not sure why i can't just do `next.callPackage` instead
|
||||
inherit ubootRaspberryPi4_64bit;
|
||||
};
|
||||
rtl8723cs-firmware = prev.callPackage ../pkgs/rtl8723cs-firmware { };
|
||||
linux-megous = prev.callPackage ../pkgs/linux-megous {
|
||||
kernelPatches = [
|
||||
prev.kernelPatches.bridge_stp_helper
|
||||
prev.kernelPatches.request_key_helper
|
||||
];
|
||||
};
|
||||
|
||||
sublime-music-mobile = prev.callPackage ../pkgs/sublime-music-mobile { };
|
||||
|
||||
#### customized packages
|
||||
fluffychat-moby = prev.callPackage ../pkgs/fluffychat-moby { };
|
||||
gpodder-configured = prev.callPackage ../pkgs/gpodder-configured { };
|
||||
# nixos-unstable pleroma is too far out-of-date for our db
|
||||
# pleroma = prev.callPackage ../pkgs/pleroma { };
|
||||
# jackett doesn't allow customization of the bind address: this will probably always be here.
|
||||
jackett = prev.callPackage ../pkgs/jackett { inherit (prev) jackett; };
|
||||
# mozilla keeps nerfing itself and removing configuration options
|
||||
firefox-unwrapped = next.callPackage ../pkgs/firefox-unwrapped { inherit (prev) firefox-unwrapped; };
|
||||
|
||||
# patch rpi uboot with something that fixes USB HDD boot
|
||||
ubootRaspberryPi4_64bit = prev.callPackage ../pkgs/ubootRaspberryPi4_64bit { };
|
||||
|
||||
gocryptfs = prev.callPackage ../pkgs/gocryptfs { inherit (prev) gocryptfs; };
|
||||
|
||||
browserpass = prev.callPackage ../pkgs/browserpass { inherit (prev) browserpass; inherit sane-scripts; };
|
||||
|
||||
fractal-latest = prev.callPackage ../pkgs/fractal-latest { };
|
||||
|
||||
#### TEMPORARY: PACKAGES WAITING TO BE UPSTREAMED
|
||||
|
||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||
(py-final: py-prev: {
|
||||
feedsearch-crawler = py-final.callPackage ../pkgs/feedsearch-crawler { };
|
||||
})
|
||||
];
|
||||
|
||||
kaiteki = prev.callPackage ../pkgs/kaiteki { };
|
||||
lightdm-mobile-greeter = prev.callPackage ../pkgs/lightdm-mobile-greeter { };
|
||||
browserpass-extension = prev.callPackage ../pkgs/browserpass-extension { };
|
||||
gopass-native-messaging-host = prev.callPackage ../pkgs/gopass-native-messaging-host { };
|
||||
tokodon = prev.libsForQt5.callPackage ../pkgs/tokodon { };
|
||||
|
||||
# provided by nixpkgs patch or upstream preview
|
||||
# splatmoji = prev.callPackage ../pkgs/splatmoji { };
|
||||
# signaldctl = prev.callPackage ../pkgs/signaldctl { };
|
||||
};
|
||||
in sane // { inherit sane; }
|
||||
)
|
||||
|
@@ -1,14 +1,13 @@
|
||||
{ stdenv, tow-boot-rp4, raspberrypifw, raspberrypi-armstubs }:
|
||||
{ stdenv, tow-boot-rpi4, raspberrypifw, raspberrypi-armstubs }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "bootpart-tow-boot-rpi-aarch64";
|
||||
version = "1";
|
||||
|
||||
buildInputs = with [
|
||||
buildInputs = [
|
||||
tow-boot-rpi4 # for Tow-Boot.*.bin
|
||||
raspberrypifw # for bootcode.bin, *.dat, *.elf, *.dtb
|
||||
raspberrypi-armstubs # for armstub*
|
||||
|
||||
];
|
||||
|
||||
src = ./config.txt;
|
||||
|
@@ -35,7 +35,7 @@
|
||||
# but in a way where the least could go wrong.
|
||||
pushd "$sources_dir"; mkdir -p "$name"; popd
|
||||
|
||||
${./update.sh} "$url" "$json_path"
|
||||
${./update.py} "$url" "$json_path"
|
||||
cat "$json_path"
|
||||
'';
|
||||
}
|
||||
|
@@ -14,10 +14,7 @@ stdenv.mkDerivation {
|
||||
src = fetchurl {
|
||||
inherit url;
|
||||
};
|
||||
passthru.updateScript = [ ./update.sh url jsonPath ];
|
||||
# passthru.updateScript = callPackage ./update.nix {
|
||||
# inherit url jsonPath;
|
||||
# };
|
||||
passthru.updateScript = [ ./update.py url jsonPath ];
|
||||
meta = {
|
||||
description = "metadata about any feeds available at ${feedName}";
|
||||
homepage = feedName;
|
||||
|
@@ -1,18 +0,0 @@
|
||||
{ lib
|
||||
, curl
|
||||
, jq
|
||||
, runtimeShell
|
||||
, writeScript
|
||||
# feed-specific args
|
||||
, jsonPath
|
||||
, url
|
||||
}:
|
||||
|
||||
let
|
||||
apiQuery = "https://feedsearch.dev/api/v1/search?url=${url}";
|
||||
in
|
||||
writeScript "update-feed" ''
|
||||
#!${runtimeShell}
|
||||
PATH=${lib.makeBinPath [ curl jq ]}
|
||||
curl -X GET '${apiQuery}' | jq '.[-1]' > '${jsonPath}'
|
||||
''
|
24
pkgs/feeds/update.py
Executable file
24
pkgs/feeds/update.py
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.feedsearch-crawler ])"
|
||||
|
||||
from feedsearch_crawler import search, sort_urls
|
||||
from feedsearch_crawler.crawler import coerce_url
|
||||
|
||||
import json
|
||||
import sys
|
||||
url, jsonPath = sys.argv[1:]
|
||||
|
||||
url = coerce_url(url, default_scheme="https")
|
||||
items = search(url)
|
||||
items = sort_urls(items)
|
||||
|
||||
# print all results
|
||||
serialized = [item.serialize() for item in items]
|
||||
for item in serialized:
|
||||
print(json.dumps(item, sort_keys=True, indent=2))
|
||||
|
||||
# save the first result to disk
|
||||
keep = serialized[0] if serialized else {}
|
||||
results = json.dumps(keep, sort_keys=True, indent=2)
|
||||
with open(jsonPath, "w") as out:
|
||||
out.write(results)
|
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq
|
||||
|
||||
set -xeu -o pipefail
|
||||
|
||||
url="$1"
|
||||
jsonPath="$2"
|
||||
|
||||
apiQuery="https://feedsearch.dev/api/v1/search?url=$url"
|
||||
curl -X GET "$apiQuery" | jq '.[0]' > "$jsonPath"
|
65
pkgs/feedsearch-crawler/default.nix
Normal file
65
pkgs/feedsearch-crawler/default.nix
Normal file
@@ -0,0 +1,65 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
# nativeBuildInputs python packages
|
||||
, poetry-core
|
||||
# propagatedBuildInputs python packages
|
||||
, aiodns
|
||||
, aiohttp
|
||||
, beautifulsoup4
|
||||
, brotlipy
|
||||
, cchardet
|
||||
, feedparser
|
||||
, python-dateutil
|
||||
, uvloop
|
||||
, w3lib
|
||||
, yarl
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "feedsearch-crawler";
|
||||
version = "2022-05-28";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "DBeath";
|
||||
repo = "feedsearch-crawler";
|
||||
rev = "f49a6f5a07e796e359c4482fd29305b1a019f71f";
|
||||
hash = "sha256-pzvyeXzqdi8pRjk2+QjKhJfgtxbgVT6C08K9fhVFVmY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
poetry-core
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace 'w3lib = "^1.22.0"' 'w3lib = "*"' \
|
||||
--replace 'aiodns = "^2.0.0"' 'aiodns = "*"' \
|
||||
--replace 'uvloop = "^0.15.2"' 'uvloop = "*"'
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [
|
||||
aiodns
|
||||
aiohttp
|
||||
beautifulsoup4
|
||||
brotlipy
|
||||
cchardet
|
||||
feedparser
|
||||
python-dateutil
|
||||
uvloop
|
||||
w3lib
|
||||
yarl
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"feedsearch_crawler"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://feedsearch.dev";
|
||||
description = "Crawl sites for RSS, Atom, and JSON feeds";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ colinsane ];
|
||||
};
|
||||
}
|
@@ -1,22 +1,28 @@
|
||||
{ makeWrapper
|
||||
, gpodder
|
||||
, linkFarm
|
||||
, symlinkJoin
|
||||
, writeShellScript
|
||||
, config
|
||||
}:
|
||||
|
||||
let
|
||||
remove-extra = linkFarm "gpodder-remove-extra" [
|
||||
{ name = "bin/gpodder-remove-extra"; path = ./remove_extra.py; }
|
||||
];
|
||||
in
|
||||
# we use a symlinkJoin so that we can inherit the .desktop and icon files from the original gPodder
|
||||
(symlinkJoin {
|
||||
name = "gpodder-configured";
|
||||
paths = [ gpodder ];
|
||||
paths = [ gpodder remove-extra ];
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
# gpodder keeps all its feeds in a sqlite3 database.
|
||||
# we can configure the feeds externally by wrapping gpodder and just instructing it to import
|
||||
# a feedlist every time we run it.
|
||||
# repeat imports are deduplicated -- assuming network access (not sure how it behaves when disconnected).
|
||||
# repeat imports are deduplicated by url, even when offline.
|
||||
postBuild = ''
|
||||
makeWrapper $out/bin/gpodder $out/bin/gpodder-configured \
|
||||
--run "$out/bin/gpo import ~/.config/gpodderFeeds.opml"
|
||||
--run "$out/bin/gpodder-remove-extra ~/.config/gpodderFeeds.opml" \
|
||||
--run "$out/bin/gpo import ~/.config/gpodderFeeds.opml" \
|
||||
|
||||
# fix up the .desktop file to invoke our wrapped application
|
||||
orig_desktop=$(readlink $out/share/applications/gpodder.desktop)
|
||||
|
79
pkgs/gpodder-configured/remove_extra.py
Executable file
79
pkgs/gpodder-configured/remove_extra.py
Executable file
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [gnome-feeds.listparser])" -p gpodder
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
import listparser
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
@dataclass(repr=True)
|
||||
class Feed:
|
||||
url: str
|
||||
title: str # Optional
|
||||
def __init__(self, url: str, title: str):
|
||||
self.url = url
|
||||
self.title = title if title else None
|
||||
|
||||
def __eq__(self, other: 'Feed') -> bool:
|
||||
return self.url == other.url and \
|
||||
(self.title == other.title or None in [self.title, other.title])
|
||||
|
||||
@dataclass(init=True)
|
||||
class Partitioned:
|
||||
has_not_wanted: list[Feed] = field(default_factory=list)
|
||||
wanted_not_has: list[Feed] = field(default_factory=list)
|
||||
intersection: list[Feed] = field(default_factory=list)
|
||||
|
||||
|
||||
def wanted_feeds(opml_file: str):
|
||||
parsed = listparser.parse(open(opml_file).read())
|
||||
return [Feed(url=p['url'], title=p['title']) for p in parsed.feeds]
|
||||
|
||||
def has_feeds():
|
||||
listing = subprocess.check_output(["gpo", "list"]).decode()
|
||||
feeds = []
|
||||
|
||||
title = None
|
||||
for line in listing.split("\n"):
|
||||
if line.startswith("# "): # title
|
||||
title = line[2:].strip()
|
||||
elif line.startswith("http"): # feed URL:
|
||||
feeds.append(Feed(url=line, title=title))
|
||||
title = None
|
||||
|
||||
return feeds
|
||||
|
||||
def partition_feeds(wanted: list[Feed], has: list[Feed]) -> Partitioned:
|
||||
p = Partitioned()
|
||||
for f in wanted + has:
|
||||
w, h = f in wanted, f in has
|
||||
if h and not w:
|
||||
p.has_not_wanted.append(f)
|
||||
elif w and not h:
|
||||
p.wanted_not_has.append(f)
|
||||
else:
|
||||
assert w and h
|
||||
p.intersection.append(f)
|
||||
|
||||
return p
|
||||
|
||||
def remove_feed(feed: Feed):
|
||||
subprocess.check_output(['gpo', 'unsubscribe', feed.url])
|
||||
|
||||
def rationalize_feeds(opml_file: str):
|
||||
wanted = wanted_feeds(opml_file)
|
||||
has = has_feeds()
|
||||
partitioned = partition_feeds(wanted, has)
|
||||
|
||||
print("extra feeds:", "" if partitioned.has_not_wanted else "(none)")
|
||||
for f in partitioned.has_not_wanted:
|
||||
print(" ", f)
|
||||
print()
|
||||
|
||||
for f in partitioned.has_not_wanted:
|
||||
remove_feed(f)
|
||||
|
||||
if __name__ == "__main__":
|
||||
wanted_opml, = sys.argv[1:]
|
||||
rationalize_feeds(wanted_opml)
|
||||
|
@@ -3,9 +3,9 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
base = "6.1.0";
|
||||
base = "6.2.0";
|
||||
# set to empty if not a release candidate
|
||||
rc = "-rc8";
|
||||
rc = "-rc5";
|
||||
in buildLinux (args // rec {
|
||||
version = base + rc;
|
||||
|
||||
@@ -24,7 +24,7 @@ in buildLinux (args // rec {
|
||||
# - specific branches like `pp` (pinephone) are dev branches, and probably less stable.
|
||||
owner = "megous";
|
||||
repo = "linux";
|
||||
rev = "orange-pi-6.1-20221211-1046";
|
||||
hash = "sha256-TgFXH8bHWHs26rlf7a/zNO9zubFazC8Ie6J1gj4gLgw=";
|
||||
rev = "orange-pi-6.2-20230122-1624";
|
||||
hash = "sha256-Yma9LwlMEnP0QkUZpEl+UkTGvOWOMANBoDsmcTrPb1s=";
|
||||
};
|
||||
} // (args.argsOverride or { }))
|
||||
|
@@ -1,60 +0,0 @@
|
||||
(next: prev:
|
||||
let
|
||||
sane = rec {
|
||||
#### my own, non-upstreamable packages:
|
||||
sane-scripts = prev.callPackage ./sane-scripts { };
|
||||
feeds = prev.callPackage ./feeds { };
|
||||
tow-boot-pinephone = prev.callPackage ./tow-boot-pinephone { };
|
||||
tow-boot-rpi4 = prev.callPackage ./tow-boot-rpi4 { };
|
||||
bootpart-uefi-x86_64 = prev.callPackage ./bootpart-uefi-x86_64 { };
|
||||
bootpart-tow-boot-rpi-aarch64 = prev.callPackage ./bootpart-tow-boot-rpi-aarch64 {
|
||||
# not sure why i can't just do `next.callPackage` instead
|
||||
inherit tow-boot-rpi4;
|
||||
};
|
||||
bootpart-u-boot-rpi-aarch64 = prev.callPackage ./bootpart-u-boot-rpi-aarch64 {
|
||||
# not sure why i can't just do `next.callPackage` instead
|
||||
inherit ubootRaspberryPi4_64bit;
|
||||
};
|
||||
rtl8723cs-firmware = prev.callPackage ./rtl8723cs-firmware { };
|
||||
linux-megous = prev.callPackage ./linux-megous {
|
||||
kernelPatches = [
|
||||
prev.kernelPatches.bridge_stp_helper
|
||||
prev.kernelPatches.request_key_helper
|
||||
];
|
||||
};
|
||||
|
||||
sublime-music-mobile = prev.callPackage ./sublime-music-mobile { };
|
||||
|
||||
#### customized packages
|
||||
fluffychat-moby = prev.callPackage ./fluffychat-moby { };
|
||||
gpodder-configured = prev.callPackage ./gpodder-configured { };
|
||||
# nixos-unstable pleroma is too far out-of-date for our db
|
||||
pleroma = prev.callPackage ./pleroma { };
|
||||
# jackett doesn't allow customization of the bind address: this will probably always be here.
|
||||
jackett = prev.callPackage ./jackett { inherit (prev) jackett; };
|
||||
# mozilla keeps nerfing itself and removing configuration options
|
||||
firefox-unwrapped = prev.callPackage ./firefox-unwrapped { };
|
||||
|
||||
# patch rpi uboot with something that fixes USB HDD boot
|
||||
ubootRaspberryPi4_64bit = prev.callPackage ./ubootRaspberryPi4_64bit { };
|
||||
|
||||
gocryptfs = prev.callPackage ./gocryptfs { inherit (prev) gocryptfs; };
|
||||
|
||||
browserpass = prev.callPackage ./browserpass { inherit (prev) browserpass; inherit sane-scripts; };
|
||||
|
||||
fractal-latest = prev.callPackage ./fractal-latest { };
|
||||
|
||||
#### TEMPORARY: PACKAGES WAITING TO BE UPSTREAMED
|
||||
kaiteki = prev.callPackage ./kaiteki { };
|
||||
lightdm-mobile-greeter = prev.callPackage ./lightdm-mobile-greeter { };
|
||||
browserpass-extension = prev.callPackage ./browserpass-extension { };
|
||||
gopass-native-messaging-host = prev.callPackage ./gopass-native-messaging-host { };
|
||||
tokodon = prev.libsForQt5.callPackage ./tokodon { };
|
||||
signaldctl = prev.callPackage ./signaldctl { };
|
||||
splatmoji = prev.callPackage ./splatmoji { };
|
||||
# trust-dns = prev.callPackage ./trust-dns { };
|
||||
# kaiteki = prev.kaiteki;
|
||||
};
|
||||
in sane // { inherit sane; }
|
||||
)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.natsort ps.requests ])"
|
||||
"""
|
||||
usage: sane-bt-search <query_string>
|
||||
|
||||
@@ -22,21 +23,29 @@ ENDPOINTS = dict(
|
||||
class Torrent:
|
||||
seeders: int
|
||||
pub_date: datetime
|
||||
size: int
|
||||
tracker: str
|
||||
title: str
|
||||
magnet: str
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.seeders}[S]\t{self.pub_date}\t{self.title}\t{self.magnet}"
|
||||
return f"{self.seeders}[S]\t{self.pub_date}\t{self.mib}M\t{self.tracker}\t{self.title}\t{self.magnet}"
|
||||
|
||||
@property
|
||||
def mib(self) -> int:
|
||||
return int(round(self.size / 1024 / 1024))
|
||||
|
||||
@staticmethod
|
||||
def from_dict(d: dict) -> 'Torrent':
|
||||
seeders = d.get("Seeders")
|
||||
pub_date = d.get("PublishDate")
|
||||
size = d.get("Size")
|
||||
tracker = d.get("Tracker")
|
||||
title = d.get("Title")
|
||||
magnet = d.get("MagnetUri")
|
||||
if seeders is not None and pub_date is not None and title is not None and magnet is not None:
|
||||
pub_date = datetime.fromisoformat(pub_date)
|
||||
return Torrent(seeders, pub_date, title, magnet)
|
||||
pub_date = datetime.fromisoformat(pub_date).astimezone()
|
||||
return Torrent(seeders, pub_date, size, tracker, title, magnet)
|
||||
|
||||
class Client:
|
||||
def __init__(self):
|
||||
@@ -63,9 +72,35 @@ class Client:
|
||||
|
||||
return sorted(torrents, reverse=True)
|
||||
|
||||
q = " ".join(sys.argv[1:])
|
||||
def parse_args(args: list) -> dict:
|
||||
options = dict(
|
||||
full=False,
|
||||
query="",
|
||||
)
|
||||
while args:
|
||||
arg = args[0]
|
||||
del args[0]
|
||||
if arg.startswith('--'):
|
||||
opt = arg[2:]
|
||||
if "=" in opt:
|
||||
name, val = opt.split('=')
|
||||
else:
|
||||
name, val = opt, True
|
||||
options[name] = val
|
||||
else:
|
||||
options["query"] = options["query"] + " " + arg if options["query"] else arg
|
||||
|
||||
client = Client()
|
||||
res = client.query(q)
|
||||
for r in res[:5]:
|
||||
print(r)
|
||||
return options
|
||||
|
||||
def main(args: list):
|
||||
options = parse_args(args)
|
||||
query = options["query"]
|
||||
num_listings = 100 if options["full"] else 5
|
||||
client = Client()
|
||||
res = client.query(query)
|
||||
print(f"found {len(res)} result(s)")
|
||||
for r in res[:num_listings]:
|
||||
print(r)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
|
@@ -1,19 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
mnt=/mnt/servo-media-wan
|
||||
# if lan not mounted, then try to mount it
|
||||
if ! (test -d /mnt/servo-media-lan/Music)
|
||||
then
|
||||
sudo mount /mnt/servo-media-lan && mnt=/mnt/servo-media-lan
|
||||
sudo mount /mnt/servo-media-lan
|
||||
fi
|
||||
# not much reason not to mount the wan while we're here.
|
||||
if ! (test -d /mnt/servo-media-wan/Music)
|
||||
then
|
||||
sudo mount /mnt/servo-media-wan
|
||||
fi
|
||||
|
||||
# if the needed mount isn't mounted, mount it
|
||||
if ! (test -d $mnt/Music)
|
||||
then
|
||||
sudo mount $mnt
|
||||
fi
|
||||
mnt=/mnt/servo-media-wan
|
||||
# if the LAN is accessible, prefer that
|
||||
test -d /mnt/servo-media-wan/Music && mnt=/mnt/servo-media-lan
|
||||
|
||||
# symlink the fastest mount point into place
|
||||
# uncomment if i see the bug again: sudo unlink /mnt/servo-media # XXX ln gets confused if the destination is a symlink to a stale mount
|
||||
sudo ln -sf $mnt /mnt/servo-media
|
||||
sudo ln -sf --no-dereference $mnt /mnt/servo-media
|
||||
|
@@ -1,19 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
mnt=/mnt/servo-root-wan
|
||||
# if lan not mounted, then try to mount it
|
||||
if ! (test -d /mnt/servo-root-lan/nix)
|
||||
then
|
||||
sudo mount /mnt/servo-root-lan && mnt=/mnt/servo-root-lan
|
||||
sudo mount /mnt/servo-root-lan
|
||||
fi
|
||||
# not much reason not to mount the wan while we're here.
|
||||
if ! (test -d /mnt/servo-root-wan/nix)
|
||||
then
|
||||
sudo mount /mnt/servo-root-wan
|
||||
fi
|
||||
|
||||
# if the needed mount isn't mounted, mount it
|
||||
if ! (test -d $mnt/nix)
|
||||
then
|
||||
sudo mount $mnt
|
||||
fi
|
||||
mnt=/mnt/servo-root-wan
|
||||
# if the LAN is accessible, prefer that
|
||||
test -d /mnt/servo-root-wan/nix && mnt=/mnt/servo-root-lan
|
||||
|
||||
# symlink the fastest mount point into place
|
||||
# uncomment if i see the bug again: sudo unlink /mnt/servo-root # XXX ln gets confused if the destination is a symlink to a stale mount
|
||||
sudo ln -sf $mnt /mnt/servo-root
|
||||
sudo ln -sf --no-dereference $mnt /mnt/servo-root
|
||||
|
@@ -10,4 +10,4 @@ sudo systemctl stop postgresql
|
||||
sudo systemctl stop duplicity.timer
|
||||
sudo systemctl stop duplicity
|
||||
sudo systemctl stop trust-dns
|
||||
sudo systemctl stop wireguard-wg0
|
||||
sudo systemctl stop wireguard-wg-ovpns
|
||||
|
@@ -1,6 +1,11 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, bash
|
||||
, fetchFromGitHub
|
||||
, fpm
|
||||
, jq
|
||||
, pandoc
|
||||
, shunit2
|
||||
, stdenv
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -14,17 +19,31 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "sha256-fsZ8FhLP3vAalRJWUEi/0fe0DlwAz5zZeRZqAuwgv/U=";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
nativeBuildInputs = [
|
||||
bash
|
||||
fpm
|
||||
jq
|
||||
pandoc
|
||||
shunit2
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs ./build.sh
|
||||
patchShebangs ./test/unit_tests
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
./build.sh ${version} dir
|
||||
'';
|
||||
|
||||
# TODO: generate a wrapper so that bin/lib, bin/data aren't linked into the environment?
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp splatmoji $out/bin
|
||||
cp -R lib $out/bin/lib
|
||||
cp -R data $out/bin/data
|
||||
cp splatmoji.config $out/bin
|
||||
mkdir -p $out
|
||||
cp -R build/usr/* $out
|
||||
|
||||
patchShebangs $out/bin/splatmoji
|
||||
# splatmoji refers to its lib and data by absolute path
|
||||
sed -i "s:/usr/lib/splatmoji:$out/lib/splatmoji:g" $out/bin/splatmoji
|
||||
sed -i -r "s:/usr/share/+splatmoji:$out/share/splatmoji:g" $out/lib/splatmoji/functions
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
@@ -32,6 +51,6 @@ stdenv.mkDerivation rec {
|
||||
homepage = "https://github.com/cspeterson/splatmoji";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ colinsane ];
|
||||
platforms = with platforms; linux;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user