diff options
Diffstat (limited to 'modules/flake/openwrt.nix')
| -rw-r--r-- | modules/flake/openwrt.nix | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/modules/flake/openwrt.nix b/modules/flake/openwrt.nix deleted file mode 100644 index bdf4235..0000000 --- a/modules/flake/openwrt.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ - config, - lib, - withSystem, - inputs, - ... -}: let - namespace = "openWrtImages"; - cfg = config.${namespace}; - - inherit - (lib) - literalExpression - mdDoc - mkOption - types - ; - - openWrtSubmodule = { - freeformType = types.attrsOf types.anything; - options = { - profile = mkOption { - type = types.str; - example = literalExpression "netgear_wac104"; - description = mdDoc '' - Device profile to build images for. - ''; - }; - - release = mkOption { - type = types.str; - default = "23.05.0"; - example = literalExpression "23.05.2"; - description = mdDoc '' - OpenWRT release to base image off of - ''; - }; - }; - }; -in { - options.${namespace} = mkOption { - type = types.attrsOf (types.submodule openWrtSubmodule); - default = {}; - description = mdDoc '' - Generated OpenWRT images - ''; - }; - - config.flake.legacyPackages.x86_64-linux = { - ${namespace} = withSystem "x86_64-linux" ( - {pkgs, ...}: let - profileFromRelease = release: - (inputs.openwrt-imagebuilder.lib.profiles { - inherit pkgs release; - }) - .identifyProfile; - - mkImage = {profile, ...} @ args: - inputs.openwrt-imagebuilder.lib.build ( - profileFromRelease args.release profile - // builtins.removeAttrs args ["profile" "release"] - ); - in - lib.mapAttrs (lib.const mkImage) cfg - ); - }; -} |
