Compare commits
82 Commits
wip/feeds2
...
wip/hosts
Author | SHA1 | Date | |
---|---|---|---|
9af157b294 | |||
c36fed8547 | |||
a653311f04 | |||
f4d6ecb1cf | |||
c2e5a0a2fc | |||
c316e51344 | |||
f4f0c1bdd6 | |||
6a2374e046 | |||
708cb841fe | |||
094b7223c7 | |||
f6dfc9cf29 | |||
7c2ab92302 | |||
7c18d77046 | |||
02f316f7f8 | |||
df848b3262 | |||
a3a7b6c563 | |||
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 | |||
e439d398b6 | |||
0f25cba331 | |||
39959e912d | |||
62e649743d | |||
b1741a18e1 | |||
a829a8e027 | |||
d742ae83bd |
44
flake.lock
generated
44
flake.lock
generated
@@ -60,37 +60,38 @@
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1,
|
||||
"narHash": "sha256-5eJxyBRYQCoRt92ZFUOdT237Z0VscuNRd0pktDYWJYE=",
|
||||
"path": "nixpatches",
|
||||
"narHash": "sha256-5zCxdHGOS0OOP7vbgTA1iwv9GVr5JSiths7QmgUsU84=",
|
||||
"path": "/nix/store/9a5k9pfawxzz1sng17si26sc9af39jr1-source/nixpatches",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"path": "nixpatches",
|
||||
"path": "/nix/store/9a5k9pfawxzz1sng17si26sc9af39jr1-source/nixpatches",
|
||||
"type": "path"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1673163619,
|
||||
"narHash": "sha256-B33PFBL64ZgTWgMnhFL3jgheAN/DjHPsZ1Ih3z0VE5I=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1673800717,
|
||||
"narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8c54d842d9544361aac5f5b212ba04e4089e8efe",
|
||||
"rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f",
|
||||
"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": 1673740915,
|
||||
"narHash": "sha256-MMH8zONfqahgHly3K8/A++X34800rajA/XgZ2DzNL/M=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9f11a2df77cb945c115ae2a65f53f38121597d73",
|
||||
"rev": "7c65528c3f8462b902e09d1ccca23bb9034665c2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -102,17 +103,18 @@
|
||||
},
|
||||
"nixpkgs-unpatched": {
|
||||
"locked": {
|
||||
"lastModified": 1673226411,
|
||||
"narHash": "sha256-b6cGb5Ln7Zy80YO66+cbTyGdjZKtkoqB/iIIhDX9gRA=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1673796341,
|
||||
"narHash": "sha256-1kZi9OkukpNmOaPY7S5/+SlCDOuYnP3HkXHvNDyLQcc=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "aa1d74709f5dac623adb4d48fdfb27cc2c92a4d4",
|
||||
"rev": "6dccdc458512abce8d19f74195bb20fdb067df50",
|
||||
"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": 1673147300,
|
||||
"narHash": "sha256-gR9OEfTzWfL6vG0qkbn1TlBAOlg4LuW8xK/u0V41Ihc=",
|
||||
"lastModified": 1673752321,
|
||||
"narHash": "sha256-EFfXY1ZHJq4FNaNQA9x0djtu/jiOhBbT0Xi+BT06cJw=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "2253120d2a6147e57bafb5c689e086221df8032f",
|
||||
"rev": "e18eefd2b133a58309475298052c341c08470717",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
44
flake.nix
44
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";
|
||||
};
|
||||
@@ -43,10 +63,12 @@
|
||||
|
||||
evalHost = { name, local, target }:
|
||||
let
|
||||
# XXX: we'd prefer to use `nixosSystem = (nixpkgsCompiledBy local).nixos`
|
||||
# XXX: we'd prefer to use `nixosSystem = (nixpkgsCompiledBy target).nixos`
|
||||
# but it doesn't propagate config to the underlying pkgs, meaning it doesn't let you use
|
||||
# non-free packages even after setting nixpkgs.allowUnfree.
|
||||
nixosSystem = import ((nixpkgsCompiledBy local).path + "/nixos/lib/eval-config.nix");
|
||||
# XXX: patch using the target -- not local -- otherwise the target will
|
||||
# need to emulate the host in order to rebuild!
|
||||
nixosSystem = import ((nixpkgsCompiledBy target).path + "/nixos/lib/eval-config.nix");
|
||||
in
|
||||
(nixosSystem {
|
||||
# we use pkgs built for and *by* the target, i.e. emulation, by default.
|
||||
@@ -60,6 +82,7 @@
|
||||
nixpkgs.overlays = [
|
||||
self.overlays.default
|
||||
self.overlays.passthru
|
||||
self.overlays.pins
|
||||
];
|
||||
}
|
||||
];
|
||||
@@ -96,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;
|
||||
|
@@ -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,11 @@
|
||||
./kernel.nix
|
||||
];
|
||||
|
||||
sane.roles.client = true;
|
||||
# TODO
|
||||
# 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 +24,7 @@
|
||||
services.getty.autologinUser = "root"; # allows for emergency maintenance?
|
||||
|
||||
sops.secrets.colin-passwd = {
|
||||
sopsFile = ../../secrets/moby.yaml;
|
||||
sopsFile = ../../../secrets/moby.yaml;
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
@@ -125,6 +125,9 @@ in
|
||||
# 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;
|
||||
# used by the pinephone pro, but fails to compile with:
|
||||
# ../drivers/media/i2c/ov8858.c:1834:27: error: implicit declaration of function 'compat_ptr'
|
||||
VIDEO_OV8858 = no;
|
||||
})
|
||||
))
|
||||
];
|
@@ -1,29 +1,29 @@
|
||||
{ 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
|
||||
|
||||
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";
|
||||
@@ -163,9 +163,6 @@
|
||||
'';
|
||||
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";
|
||||
};
|
@@ -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,8 +6,12 @@
|
||||
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"; }
|
||||
];
|
||||
@@ -127,8 +131,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;
|
||||
};
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -179,8 +179,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,5 +1,12 @@
|
||||
{ ... }:
|
||||
{ config, ... }:
|
||||
|
||||
let
|
||||
mkCrossFrom = localSystem: pkgs: import pkgs.path {
|
||||
inherit localSystem;
|
||||
crossSystem = pkgs.stdenv.hostPlatform.system;
|
||||
inherit (config.nixpkgs) config overlays;
|
||||
};
|
||||
in
|
||||
{
|
||||
# the configuration of which specific package set `pkgs.cross` refers to happens elsewhere;
|
||||
# here we just define them all.
|
||||
@@ -8,8 +15,8 @@
|
||||
# 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.
|
||||
crossFrom."x86_64-linux" = (prev.forceSystem "x86_64-linux" null).appendOverlays next.overlays;
|
||||
crossFrom."aarch64-linux" = (prev.forceSystem "aarch64-linux" null).appendOverlays next.overlays;
|
||||
crossFrom."x86_64-linux" = mkCrossFrom "x86_64-linux" next;
|
||||
crossFrom."aarch64-linux" = mkCrossFrom "aarch64-linux" next;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
@@ -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 = {
|
||||
|
@@ -41,6 +41,8 @@ let
|
||||
);
|
||||
} // lib.optionalAttrs (raw.is_podcast or false) {
|
||||
format = "podcast";
|
||||
} // lib.optionalAttrs (raw.title or "" != "") {
|
||||
title = lib.mkDefault raw.title;
|
||||
};
|
||||
|
||||
podcasts = [
|
||||
|
@@ -21,6 +21,10 @@
|
||||
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.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"
|
||||
];
|
||||
|
@@ -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;
|
||||
}
|
98
hosts/modules/hosts.nix
Normal file
98
hosts/modules/hosts.nix
Normal file
@@ -0,0 +1,98 @@
|
||||
{ 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";
|
||||
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) ];
|
||||
};
|
||||
};
|
||||
}
|
@@ -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";
|
||||
};
|
||||
}
|
||||
|
@@ -16,6 +16,10 @@ let
|
||||
type = types.enum [ "text" "image" "podcast" ];
|
||||
default = "text";
|
||||
};
|
||||
title = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
url = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
|
@@ -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)
|
||||
|
@@ -12,8 +12,24 @@ rec {
|
||||
# transform a list of feeds into an attrs mapping cat => [ feed0 feed1 ... ]
|
||||
partitionByCat = feeds: builtins.groupBy (f: f.cat) feeds;
|
||||
|
||||
xmlTag = tag: close: attrs:
|
||||
let
|
||||
fmt-attrs = builtins.concatStringsSep
|
||||
" "
|
||||
(lib.mapAttrsToList (name: value: ''${lib.escapeXML name}="${lib.escapeXML value}"'') attrs);
|
||||
fmt-close = if close then "/" else "";
|
||||
in
|
||||
''<${tag} ${fmt-attrs} ${fmt-close}>'';
|
||||
|
||||
# represents a single RSS feed.
|
||||
opmlTerminal = feed: ''<outline xmlUrl="${feed.url}" type="rss"/>'';
|
||||
opmlTerminal = feed: xmlTag "outline" true (
|
||||
{
|
||||
xmlUrl = feed.url;
|
||||
type = "rss";
|
||||
} // lib.optionalAttrs (feed.title != null) {
|
||||
title = feed.title;
|
||||
}
|
||||
);
|
||||
# a list of RSS feeds.
|
||||
opmlTerminals = feeds: lib.concatStringsSep "\n" (builtins.map opmlTerminal feeds);
|
||||
# one node which packages some flat grouping of terminals.
|
||||
|
@@ -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
|
||||
]
|
||||
|
@@ -103,7 +103,7 @@ let
|
||||
(orig: lib.recursiveUpdate
|
||||
(builtins.removeAttrs orig ["user" "group" "mode" ])
|
||||
{
|
||||
acl = sane-lib.filterByName ["user" "group" "mode"] (orig.acl or {});
|
||||
acl = sane-lib.filterByName ["user" "group" "mode"] orig;
|
||||
}
|
||||
)
|
||||
to;
|
||||
|
@@ -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,23 @@
|
||||
sha256 = "sha256-t4sG+xLDaxbJ/mV5G18N4ag8EC3IXPgtN5FJGANh1Dc=";
|
||||
})
|
||||
|
||||
# kiwix-tools: init at 3.4.0
|
||||
# whalebird: 4.6.5 -> 4.7.4
|
||||
(fetchpatch {
|
||||
url = "https://github.com/NixOS/nixpkgs/pull/206254.diff";
|
||||
sha256 = "sha256-Z4V9mOv4HYg3kDnWoYcxz3ch03I/1USrLjzlq4X9YqI=";
|
||||
# url = "https://git.uninsane.org/colin/nixpkgs/compare/master...pr.whalebird-4.7.4.diff";
|
||||
url = "https://git.uninsane.org/colin/nixpkgs/commit/f5c7c70dde720e990fa7e0748d1dc4764d6e4406.diff";
|
||||
sha256 = "sha256-L9Ie80loaP6yl5ZFnJ1b5WMDpvO1QFE8tbrW5HBauko=";
|
||||
})
|
||||
|
||||
# nixos/mx-puppet-discord: move to matrix category
|
||||
(fetchurl {
|
||||
url = "https://git.uninsane.org/colin/nixpkgs/commit/87c877fff84717478a96d1b0c65bd2febd350dea.diff";
|
||||
sha256 = "sha256-E5TonCj3f8j7kxApBq/suNT5mB7z8uD00NzI34Qh2SE=";
|
||||
})
|
||||
|
||||
# signaldctl: init at 0.6.1
|
||||
(fetchurl {
|
||||
url = "https://git.uninsane.org/colin/nixpkgs/commit/f3c4303231537422267ca32eb97b37f0a9a11d19.diff";
|
||||
hash = "sha256-9fIAie0x2VxbHDg9iC8/dxaXIrWi8LzHSoDk9cwAZG0=";
|
||||
})
|
||||
|
||||
./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: {
|
||||
inherit (next.stable)
|
||||
# TODO(unpin): broken on 2023/01/14 via mtxclient dep, aarch64-only:
|
||||
# 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, all platforms: <https://github.com/NixOS/nixpkgs/pull/208251>
|
||||
# fix in PR: <https://github.com/NixOS/nixpkgs/pull/211135>
|
||||
kitty
|
||||
# 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 = prev.callPackage ../pkgs/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 { };
|
||||
splatmoji = prev.callPackage ../pkgs/splatmoji { };
|
||||
|
||||
# provided by nixpkgs patch or upstream preview
|
||||
# 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)
|
||||
|
@@ -5,7 +5,7 @@ with lib;
|
||||
let
|
||||
base = "6.1.0";
|
||||
# set to empty if not a release candidate
|
||||
rc = "-rc7";
|
||||
rc = "-rc8";
|
||||
in buildLinux (args // rec {
|
||||
version = base + rc;
|
||||
|
||||
@@ -16,9 +16,15 @@ in buildLinux (args // rec {
|
||||
extraMeta.branch = versions.majorMinor version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
# HOW TO UPDATE:
|
||||
# - `git fetch` from megous' github.
|
||||
# - there should be some new tag, like `orange-pi-6.1-blah`. use that.
|
||||
# - megi publishes release notes as the most recent commit on any stable branch, so just `git log`.
|
||||
# - orange-pi is listed as the "main integration branch".
|
||||
# - specific branches like `pp` (pinephone) are dev branches, and probably less stable.
|
||||
owner = "megous";
|
||||
repo = "linux";
|
||||
rev = "orange-pi-6.1-20221128-1027";
|
||||
hash = "sha256-kEujs4v5rPHPYy4YLyEWHa1Bu0sxoXLgSvmOH9QPWos=";
|
||||
rev = "orange-pi-6.1-20221211-1046";
|
||||
hash = "sha256-TgFXH8bHWHs26rlf7a/zNO9zubFazC8Ie6J1gj4gLgw=";
|
||||
};
|
||||
} // (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>
|
||||
|
||||
@@ -67,5 +68,6 @@ q = " ".join(sys.argv[1:])
|
||||
|
||||
client = Client()
|
||||
res = client.query(q)
|
||||
print(f"found {len(res)} result(s)")
|
||||
for r in res[:5]:
|
||||
print(r)
|
||||
|
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -127,10 +127,10 @@ python3Packages.buildPythonApplication rec {
|
||||
dataclasses-json
|
||||
deepdiff
|
||||
fuzzywuzzy
|
||||
levenshtein
|
||||
mpv
|
||||
peewee
|
||||
pygobject3
|
||||
python-Levenshtein
|
||||
python-dateutil
|
||||
requests
|
||||
semver
|
||||
@@ -144,7 +144,8 @@ python3Packages.buildPythonApplication rec {
|
||||
sed -i "/--cov/d" setup.cfg
|
||||
sed -i "/--no-cov-on-fail/d" setup.cfg
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace 'deepdiff = "^5.8.1"' 'deepdiff = ">=5.8.1"'
|
||||
--replace 'deepdiff = "^5.8.1"' 'deepdiff = ">=5.8.1"' \
|
||||
--replace 'python-Levenshtein = "^0.12.0"' 'levenshtein = ">=0.12.0"'
|
||||
'';
|
||||
|
||||
# hook for gobject-introspection doesn't like strictDeps
|
||||
|
@@ -1,33 +0,0 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, openssl
|
||||
, pkg-config
|
||||
, rustPlatform
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "trust-dns";
|
||||
version = "0.22.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bluejekyll";
|
||||
repo = "trust-dns";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-b9tK1JbTwB3ZuRPh0wb3cOFj9dMW7URXIaFzUq0Yipw=";
|
||||
};
|
||||
cargoHash = "sha256-mpobdeTRWJzIEmhwtcM6UE66qRD5ot/0yLeQM6Tec+0=";
|
||||
|
||||
buildInputs = [ openssl ];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
# tests expect internet connectivity to query real nameservers like 8.8.8.8
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A Rust based DNS client, server, and resolver";
|
||||
homepage = "https://trust-dns.org/";
|
||||
maintainers = with maintainers; [ colinsane ];
|
||||
platforms = platforms.linux;
|
||||
license = with licenses; [ asl20 mit ];
|
||||
};
|
||||
}
|
@@ -60,8 +60,8 @@ sops:
|
||||
cWplOHBNWjlJdGI3ZWtJc0t4Mk9URG8KE+9IPGYZsIs2PaDJ2AUE4gB4QEj5zo6P
|
||||
aZVbubu6Tbg+tD/98RkfWAkNvoVeDYuLNPDNgqOL0UgCQiTrPPaTjw==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2022-12-15T09:12:44Z"
|
||||
mac: ENC[AES256_GCM,data:QQiTsQogs6MP9X0lrpf2FeSia6SeQP5/9dtUrWQOd2Vh/s0fBJfIGUdLeLgt5itvaD5QywY6lN9Rsx++BUN0rrwUu/uF42KOMC7wjHdSv07CYuDfvlFZItuIo5eWlfcEq9+p6/VwUXY0TU3M6Ex+mABT5XK67tnLuh/SoHUl+DA=,iv:12sa+wFdO5T7pZrLM3mnEwoJ0WmXZZLKpucEgMYQHMI=,tag:zZEz6+vTma6KDMwXi/fNZA==,type:str]
|
||||
lastmodified: "2023-01-20T07:08:51Z"
|
||||
mac: ENC[AES256_GCM,data:EqVTjLmDLjAxMWvJKIqDjpUKj7oVArFSQzygVZVCYHQTp0v+EGxpn1cP8x+6frQHx8EZts090iqCpcSicwGefAe6VBVvdf408YgB9+qm6QawUMaqDypoM1q4RdOjJEKxyZ408RYorQP6OA/3yctOk39P8RbMUUBlnLvqn38mFeY=,iv:wpDcFZKRGhhoHLno1IvppCz4HUAZb4atX1mUvYZbjg4=,tag:X4BdSfGE1kWFjs4T8YZR0A==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.7.3
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user