Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 059319237f | |||
| f3a5392841 | |||
| 54b77af40a | |||
| 2173b4e9c0 | |||
| 522dbf3456 | |||
| 6ea98549aa | |||
| a0aee6cd5a | |||
| 1fd7995ecf |
Generated
+45
-5
@@ -581,6 +581,30 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"openwrt-imagebuilder": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": [
|
||||||
|
"flake-parts"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"systems": "systems_4"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1777544882,
|
||||||
|
"narHash": "sha256-QqrZLvCSg4w2jmLGXs/4KJVXZeogxIeuX0Hw4o5qWwU=",
|
||||||
|
"owner": "astro",
|
||||||
|
"repo": "nix-openwrt-imagebuilder",
|
||||||
|
"rev": "149d0e41bc9ed257290c87a8fdb18c4071e37e07",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "astro",
|
||||||
|
"repo": "nix-openwrt-imagebuilder",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"paisano": {
|
"paisano": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"call-flake": "call-flake",
|
"call-flake": "call-flake",
|
||||||
@@ -661,6 +685,7 @@
|
|||||||
"import-tree": "import-tree",
|
"import-tree": "import-tree",
|
||||||
"liminix": "liminix",
|
"liminix": "liminix",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"openwrt-imagebuilder": "openwrt-imagebuilder",
|
||||||
"plasma-manager": "plasma-manager",
|
"plasma-manager": "plasma-manager",
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
@@ -779,16 +804,16 @@
|
|||||||
},
|
},
|
||||||
"systems_2": {
|
"systems_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1680978846,
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
|
||||||
"owner": "nix-systems",
|
"owner": "nix-systems",
|
||||||
"repo": "default",
|
"repo": "x86_64-linux",
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
"rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-systems",
|
"owner": "nix-systems",
|
||||||
"repo": "default",
|
"repo": "x86_64-linux",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -807,6 +832,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_4": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1680978846,
|
||||||
|
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "x86_64-linux",
|
||||||
|
"rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "x86_64-linux",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"treefmt-nix": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|||||||
@@ -26,6 +26,11 @@
|
|||||||
};
|
};
|
||||||
import-tree.url = "github:vic/import-tree";
|
import-tree.url = "github:vic/import-tree";
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
openwrt-imagebuilder = {
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.flake-parts.follows = "flake-parts";
|
||||||
|
url = "github:astro/nix-openwrt-imagebuilder";
|
||||||
|
};
|
||||||
treefmt-nix = {
|
treefmt-nix = {
|
||||||
url = "github:numtide/treefmt-nix";
|
url = "github:numtide/treefmt-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -79,6 +84,7 @@
|
|||||||
packages.think-be = pkgs.think-backend-gtcm;
|
packages.think-be = pkgs.think-backend-gtcm;
|
||||||
packages.file-uploader = pkgs.gtcm-file-uploader;
|
packages.file-uploader = pkgs.gtcm-file-uploader;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+106
-1
@@ -1,4 +1,4 @@
|
|||||||
{ inputs, ... }:
|
{ inputs, lib, ... }:
|
||||||
{
|
{
|
||||||
flake.legacyPackages = {
|
flake.legacyPackages = {
|
||||||
whitehouse-router = import "${inputs.liminix}/default.nix" {
|
whitehouse-router = import "${inputs.liminix}/default.nix" {
|
||||||
@@ -9,5 +9,110 @@
|
|||||||
device = (import "${inputs.liminix}/devices/gl-ar750");
|
device = (import "${inputs.liminix}/devices/gl-ar750");
|
||||||
liminix-config = import ./white-house-2/configuration.nix { inherit inputs; };
|
liminix-config = import ./white-house-2/configuration.nix { inherit inputs; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
flint-repeater =
|
||||||
|
let
|
||||||
|
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||||
|
profiles = inputs.openwrt-imagebuilder.lib.profiles { inherit pkgs; };
|
||||||
|
config = profiles.identifyProfile "glinet_gl-mt6000" // {
|
||||||
|
# add package to include in the image, ie. packages that you don't
|
||||||
|
# want to install manually later
|
||||||
|
packages = [
|
||||||
|
"tcpdump"
|
||||||
|
"relayd"
|
||||||
|
"luci-proto-relay"
|
||||||
|
];
|
||||||
|
|
||||||
|
disabledServices = [ ];
|
||||||
|
|
||||||
|
# include files in the images.
|
||||||
|
# to set UCI configuration, create a uci-defauts scripts as per
|
||||||
|
# official OpenWRT ImageBuilder recommendation.
|
||||||
|
files =
|
||||||
|
let
|
||||||
|
router-config = {
|
||||||
|
ssh-keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAB/raxJR8gASmquP63weHelbi+da2WBJR1DgzHPNz/f"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDuhpzDHBPvn8nv8RH1MRomDOaXyP4GziQm7r3MZ1Syk"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAmgyEGuY/r7SDlJgrzYmQqpcWS5W+fCzRi3OS59ne4W openpgp:0xFF687387"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEcZ/p1Ofa9liwIzPWzNtONhJ7+FUWd2lCz33r81t8+w kurogeek@kurogeek"
|
||||||
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIOJDRQfb1+7VK5tOe8W40iryfBWYRO6Uf1r2viDjmsJtAAAABHNzaDo="
|
||||||
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIDgsWq+G/tcr6eUQYT7+sJeBtRmOMabgFiIgIV44XNc6AAAABHNzaDo="
|
||||||
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIJMi3TAuwDtIeO4MsORlBZ31HzaV5bji1fFBPcC9/tWuAAAABHNzaDo="
|
||||||
|
];
|
||||||
|
upstream-wifi = {
|
||||||
|
ssid = "Glom";
|
||||||
|
password = "";
|
||||||
|
};
|
||||||
|
wifi = {
|
||||||
|
ssid = "GL-AR750";
|
||||||
|
password = "qwer1234";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
dropbear-path = "/etc/dropbear";
|
||||||
|
in
|
||||||
|
pkgs.runCommand "image-files" { } ''
|
||||||
|
mkdir -p $out/${dropbear-path}
|
||||||
|
cat > $out/${dropbear-path}/authorized_keys <<EOF
|
||||||
|
${lib.concatStringsSep "\n" router-config.ssh-keys}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
mkdir -p $out/etc/uci-defaults
|
||||||
|
cat > $out/etc/uci-defaults/99-custom <<EOF
|
||||||
|
uci -q batch << EOI
|
||||||
|
set system.@system[0].hostname='flint'
|
||||||
|
commit
|
||||||
|
EOI
|
||||||
|
|
||||||
|
uci set dropbear.@dropbear[0].RootLogin='1'
|
||||||
|
uci set dropbear.@dropbear[0].PasswordAuth='off'
|
||||||
|
uci set dropbear.@dropbear[0].RootPasswordAuth='off'
|
||||||
|
uci commit dropbear
|
||||||
|
service dropbear restart
|
||||||
|
|
||||||
|
# Add a new wifi-iface for the upstream network (station mode)
|
||||||
|
uci set wireless.wwan=wifi-iface
|
||||||
|
uci set wireless.wwan.device='radio0' # radio1 for 5GHz
|
||||||
|
uci set wireless.wwan.mode='sta'
|
||||||
|
uci set wireless.wwan.network='wwan'
|
||||||
|
uci set wireless.wwan.ssid='${router-config.upstream-wifi.ssid}'
|
||||||
|
uci set wireless.wwan.encryption='psk2'
|
||||||
|
uci set wireless.wwan.key='${router-config.upstream-wifi.password}'
|
||||||
|
uci commit wireless
|
||||||
|
|
||||||
|
uci set network.wwan=interface
|
||||||
|
uci set network.wwan.proto='dhcp'
|
||||||
|
uci commit network
|
||||||
|
|
||||||
|
uci set network.relay=interface
|
||||||
|
uci set network.relay.proto='relay'
|
||||||
|
uci set network.relay.network='lan wwan'
|
||||||
|
uci commit network
|
||||||
|
|
||||||
|
# Edit the existing AP or add a new one:
|
||||||
|
uci set wireless.default_radio0.ssid='${router-config.wifi.ssid}'
|
||||||
|
uci set wireless.default_radio0.encryption='psk2'
|
||||||
|
uci set wireless.default_radio0.key='${router-config.wifi.password}'
|
||||||
|
uci set wireless.default_radio0.disabled='0'
|
||||||
|
uci commit wireless
|
||||||
|
|
||||||
|
uci set dhcp.lan.ignore='1'
|
||||||
|
uci commit dhcp
|
||||||
|
|
||||||
|
uci set firewall.@zone[1].network='wan wan6 wwan'
|
||||||
|
uci commit firewall
|
||||||
|
|
||||||
|
/etc/init.d/relayd enable
|
||||||
|
/etc/init.d/relayd start
|
||||||
|
/etc/init.d/network restart
|
||||||
|
|
||||||
|
/etc/init.d/firewall restart
|
||||||
|
wifi
|
||||||
|
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
inputs.openwrt-imagebuilder.lib.build config;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user