summaryrefslogtreecommitdiff
path: root/systems/turret/default.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-10-31 03:26:11 -0400
committerseth <[email protected]>2023-10-31 03:26:11 -0400
commit0a582b523fd1a53cb1f15b31d1b54a49e8d65f28 (patch)
tree73ecb01b0faa0861ad5d054d1d504c90a1f46b5b /systems/turret/default.nix
parent49021bd62a0e605c6d05518f428b6777ead61470 (diff)
turret: update config files & improve derivation
Diffstat (limited to 'systems/turret/default.nix')
-rw-r--r--systems/turret/default.nix24
1 files changed, 9 insertions, 15 deletions
diff --git a/systems/turret/default.nix b/systems/turret/default.nix
index faac3d2..90ec750 100644
--- a/systems/turret/default.nix
+++ b/systems/turret/default.nix
@@ -3,36 +3,30 @@
openwrt-imagebuilder,
...
}: let
- inherit (pkgs) runCommand;
- inherit (pkgs.stdenv) mkDerivation;
- inherit (openwrt-imagebuilder.lib) build profiles;
- wrtProfiles = profiles {
+ wrtProfiles = openwrt-imagebuilder.lib.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" {} ''
+ files = pkgs.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/
+
+ # copy custom files
+ cp -fr ${./files}/* $out/
+ chmod 0644 $out/etc/{config,dropbear}/*
'';
};
in
- build image
+ openwrt-imagebuilder.lib.build image