2 Commits

Author SHA1 Message Date
f3e25e7837 mob next [ci-skip] [ci skip] [skip ci]
lastFile:flake.nix
2026-03-16 17:06:56 +07:00
c96f8d999a mob next [ci-skip] [ci skip] [skip ci]
lastFile:flake.lock
2026-03-16 15:49:49 +07:00
2 changed files with 72 additions and 0 deletions

40
flake.lock generated
View File

@@ -221,6 +221,30 @@
"type": "github" "type": "github"
} }
}, },
"openwrt-imagebuilder": {
"inputs": {
"flake-parts": [
"flake-parts"
],
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_2"
},
"locked": {
"lastModified": 1773564448,
"narHash": "sha256-RdhwMI7cAMa0bHkBIG2j1GVTYMEiZOqHWNpNV5nWgdo=",
"owner": "astro",
"repo": "nix-openwrt-imagebuilder",
"rev": "e7c0890d1c740dfd0c0bb2d1dc1703acde60a25f",
"type": "github"
},
"original": {
"owner": "astro",
"repo": "nix-openwrt-imagebuilder",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"clan-core": "clan-core", "clan-core": "clan-core",
@@ -230,6 +254,7 @@
"import-tree": "import-tree", "import-tree": "import-tree",
"liminix": "liminix", "liminix": "liminix",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"openwrt-imagebuilder": "openwrt-imagebuilder",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
} }
}, },
@@ -269,6 +294,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"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": [

View File

@@ -21,6 +21,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";
@@ -67,6 +72,33 @@
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;
}; };
flake.packages.x86_64-linux.myrouter =
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" ];
disabledServices = [ "dnsmasq" ];
# include files in the images.
# to set UCI configuration, create a uci-defauts scripts as per
# official OpenWRT ImageBuilder recommendation.
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='testap'
commit
EOI
EOF
'';
};
in
inputs.openwrt-imagebuilder.lib.build config;
} }
); );
} }