summaryrefslogtreecommitdiff
path: root/hosts/turret/default.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-03-21 22:57:19 -0400
committerseth <[email protected]>2023-03-21 22:57:19 -0400
commitf5681326f3c01e52cbf6cbc625224c1a95f8fe17 (patch)
tree5045cd9178eb789a6549118585828a350353d5a0 /hosts/turret/default.nix
parenta97b232e631242e8fa951c8c862270dc6a57f5cd (diff)
add config for turret (openwrt router)
Diffstat (limited to 'hosts/turret/default.nix')
-rw-r--r--hosts/turret/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/hosts/turret/default.nix b/hosts/turret/default.nix
new file mode 100644
index 0000000..faac3d2
--- /dev/null
+++ b/hosts/turret/default.nix
@@ -0,0 +1,38 @@
+{
+ pkgs,
+ openwrt-imagebuilder,
+ ...
+}: let
+ inherit (pkgs) runCommand;
+ inherit (pkgs.stdenv) mkDerivation;
+ inherit (openwrt-imagebuilder.lib) build profiles;
+ wrtProfiles = profiles {
+ inherit pkgs;
+ release = "22.03.3";
+ };
+ config = mkDerivation {
+ name = "openwrt-config-files";
+ src = ./files;
+ installPhase = ''
+ mkdir -p $out
+ cp -r * $out/
+ '';
+ };
+ image =
+ wrtProfiles.identifyProfile "netgear_wac104"
+ // {
+ packages = ["https-dns-proxy"];
+
+ files = runCommand "image-files" {} ''
+ mkdir -p $out/etc/uci-defaults
+ cat > $out/etc/uci-defaults/99-custom <<EOF
+ uci -q batch << EOI
+ set system.@system[0].hostname='turret'
+ commit
+ EOI
+ EOF
+ cp -fr ${config}/etc/* $out/etc/
+ '';
+ };
+in
+ build image