From 4eab62fe3be42ba8bc6509cd0191a60398e691a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Thu, 7 Mar 2024 20:19:06 +0100 Subject: [PATCH] feat(openwrt): update config --- hosts/doctr.nix | 8 +++++++- hosts/penguin.nix | 2 +- lib/openwrt.nix | 9 ++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/hosts/doctr.nix b/hosts/doctr.nix index 104afad..1349c99 100644 --- a/hosts/doctr.nix +++ b/hosts/doctr.nix @@ -1,10 +1,16 @@ -{ self, inputs, ... }: { +{ self, ... }: { perSystem = { self', pkgs, lib, ... }: { packages.doctr = self.lib.mkOpenwrtImage { inherit pkgs; hostname = "doctr"; timezone = "Europe/Berlin"; ipaddr = "192.168.1.1"; + packages = [ + "tang" # for automatic LUKS decryption with clevis + ]; + uci = '' + uci set tang.config.enabled='1' + ''; }; }; } diff --git a/hosts/penguin.nix b/hosts/penguin.nix index 7055c80..adf8588 100644 --- a/hosts/penguin.nix +++ b/hosts/penguin.nix @@ -1,4 +1,4 @@ -{ self, inputs, ... }: { +{ self, ... }: { perSystem = { self', pkgs, lib, ... }: { packages.penguin = self.lib.mkOpenwrtImage { inherit pkgs; diff --git a/lib/openwrt.nix b/lib/openwrt.nix index 823bebe..692bd34 100644 --- a/lib/openwrt.nix +++ b/lib/openwrt.nix @@ -6,19 +6,21 @@ let release = "snapshot"; }; in { - flake.lib.mkOpenwrtImage = { pkgs, hostname, timezone, ipaddr }: + flake.lib.mkOpenwrtImage = + { pkgs, hostname, timezone, ipaddr, packages ? [ ], uci ? "" }: inputs.openwrt-imagebuilder.lib.build ((getProfiles pkgs).identifyProfile "glinet_gl-mt6000" // { packages = [ # TODO does this include everything that the web firmware builder includes? "auc" - "bridger" "dawn" "luci-app-attendedsysupgrade" "luci-app-dawn" + "luci-app-nextdns" "luci-ssl" + "nextdns" "tailscale" - ]; + ] ++ packages; files = pkgs.runCommand "image-files" { } '' mkdir -p $out/etc/uci-defaults @@ -32,6 +34,7 @@ in { uci set system.@system[0].timezone="$timezone" uci set network.lan.ipaddr="$ipaddr" uci set uhttpd.main.redirect_https='1' + ${uci} uci commit /etc/init.d/system reload