From 68e845da879f2064886794da330b652d60a47796 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 19 Dec 2022 14:15:40 +0100 Subject: tv alacritty: don't expect $HOME/ref to exists --- tv/5pkgs/simple/alacritty-tv.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tv') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 466ff27c5..d80c46cbb 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -70,8 +70,7 @@ pkgs.symlinkJoin { # Install stored configuration if it has changed. # This allows for both declarative updates and runtime modifications. ${pkgs.coreutils}/bin/mkdir -p "$HOME" - ref=$(${pkgs.coreutils}/bin/cat "$HOME"/ref) - if test "$ref" != ${config-file}; then + if test "$(${pkgs.coreutils}/bin/cat "$HOME"/ref)" != ${config-file}; then echo ${config-file} > "$HOME"/ref ${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml fi -- cgit v1.2.3 From b3c5492b696e02468604fbe00abdc36cb02eb22b Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 29 Dec 2022 13:44:45 +0100 Subject: krebs.systemd.restartIfCredentialsChange: default = false --- tv/3modules/ejabberd/default.nix | 2 +- tv/3modules/x0vncserver.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tv') diff --git a/tv/3modules/ejabberd/default.nix b/tv/3modules/ejabberd/default.nix index e3a41a57b..71a1a597a 100644 --- a/tv/3modules/ejabberd/default.nix +++ b/tv/3modules/ejabberd/default.nix @@ -127,7 +127,7 @@ in { }) ]; - krebs.systemd.services.ejabberd = {}; + krebs.systemd.services.ejabberd.restartIfCredentialsChange = true; systemd.services.ejabberd = { wantedBy = [ "multi-user.target" ]; diff --git a/tv/3modules/x0vncserver.nix b/tv/3modules/x0vncserver.nix index f19bfebcc..eb9b1ae4e 100644 --- a/tv/3modules/x0vncserver.nix +++ b/tv/3modules/x0vncserver.nix @@ -26,7 +26,7 @@ in { }; }; config = mkIf cfg.enable { - krebs.systemd.services.x0vncserver = {}; + krebs.systemd.services.x0vncserver.restartIfCredentialsChange = true; systemd.services.x0vncserver = { after = [ "graphical.target" ]; requires = [ "graphical.target" ]; -- cgit v1.2.3 From 4a1bec5d9b6d2730a60ed332214159a86a27f319 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Dec 2022 17:38:23 +0100 Subject: tv autotether: init --- tv/2configs/autotether.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tv/2configs/autotether.nix (limited to 'tv') diff --git a/tv/2configs/autotether.nix b/tv/2configs/autotether.nix new file mode 100644 index 000000000..43b5575c8 --- /dev/null +++ b/tv/2configs/autotether.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: let + cfg.serial = "17e064850405"; +in { + systemd.services.usb_tether.serviceConfig = { + SyslogIdentifier = "usb_tether"; + ExecStartPre = "${pkgs.android-tools}/bin/adb -s ${cfg.serial} wait-for-device"; + ExecStart = "${pkgs.android-tools}/bin/adb -s ${cfg.serial} shell svc usb setFunctions rndis"; + }; + services.udev.extraRules = /* sh */ '' + ACTION=="add", SUBSYSTEM=="net", KERNEL=="usb*", NAME="android" + + ACTION=="add", SUBSYSTEM=="usb", ATTR{serial}=="${cfg.serial}", \ + TAG+="systemd", ENV{SYSTEMD_WANTS}="usb_tether.service" + ''; + systemd.network.networks.android = { + matchConfig.Name = "android"; + DHCP = "yes"; + }; +} -- cgit v1.2.3 From 63090019f62960b3b07a230c129ae6d9c5d31a08 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Dec 2022 20:13:59 +0100 Subject: tv retiolum: use networkd --- tv/2configs/retiolum.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tv') diff --git a/tv/2configs/retiolum.nix b/tv/2configs/retiolum.nix index de77de381..1b176e0b9 100644 --- a/tv/2configs/retiolum.nix +++ b/tv/2configs/retiolum.nix @@ -11,6 +11,16 @@ with import ./lib; LocalDiscovery = yes ''; tincPackage = pkgs.tinc_pre; + tincUp = lib.mkIf config.systemd.network.enable ""; + }; + systemd.network.networks.retiolum = { + matchConfig.Name = "retiolum"; + address = let + inherit (config.krebs.build.host.nets.retiolum) ip4 ip6; + in [ + "${ip4.addr}/${toString ip4.prefixLength}" + "${ip6.addr}/${toString ip6.prefixLength}" + ]; }; tv.iptables.input-internet-accept-tcp = singleton "tinc"; tv.iptables.input-internet-accept-udp = singleton "tinc"; -- cgit v1.2.3 From 42f604cd1b45e73422277a7c0431eab97165a910 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Dec 2022 17:40:00 +0100 Subject: tv xu: use autotether --- tv/1systems/xu/config.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'tv') diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index 6ca62ac0d..b83d01f02 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -4,6 +4,7 @@ with import ./lib; imports = [ + ../../2configs/autotether.nix -- cgit v1.2.3