From 5eeb2775643b8a997392d538e069905708714d8e Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 10 Dec 2023 16:38:53 +0000 Subject: [PATCH] move output module imports example -> device The outputs available are a characteristic of the device, not the example. --- devices/belkin-rt3200/default.nix | 9 +++++++-- devices/families/qemu.nix | 3 +++ devices/gl-ar750/default.nix | 3 +++ devices/gl-mt300a/default.nix | 7 ++++++- devices/gl-mt300n-v2/default.nix | 7 ++++++- devices/turris-omnia/default.nix | 12 +++++++----- examples/arhcive.nix | 7 ------- examples/demo.nix | 5 ----- examples/extneder.nix | 5 ----- examples/hello-from-mt300.nix | 1 - examples/rotuer.nix | 5 ----- modules/all-modules.nix | 4 ++-- modules/{ => outputs}/ext4fs.nix | 0 tests/ext4/configuration.nix | 20 ++++++++++---------- vanilla-configuration-hw.nix | 5 ----- vanilla-configuration.nix | 1 - 16 files changed, 44 insertions(+), 50 deletions(-) rename modules/{ => outputs}/ext4fs.nix (100%) diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix index 72a0b0d0..252aef94 100644 --- a/devices/belkin-rt3200/default.nix +++ b/devices/belkin-rt3200/default.nix @@ -48,7 +48,12 @@ ''; }; in { - imports = [ ../../modules/arch/aarch64.nix ]; + imports = [ + ../../modules/arch/aarch64.nix + ../../modules/outputs/tftpboot.nix + ../../modules/outputs/ubifs.nix + ]; + config = { kernel = { src = pkgs.pkgsBuildBuild.fetchurl { name = "linux.tar.gz"; @@ -220,6 +225,6 @@ }; }; }; - + }; }; } diff --git a/devices/families/qemu.nix b/devices/families/qemu.nix index 2ebb9865..7f383602 100644 --- a/devices/families/qemu.nix +++ b/devices/families/qemu.nix @@ -1,5 +1,8 @@ { config, pkgs, ... }: { + imports = [ + ../../modules/outputs/jffs2.nix + ]; config = { kernel = { src = pkgs.pkgsBuildBuild.fetchurl { diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix index 2d1ab232..226c5c8c 100644 --- a/devices/gl-ar750/default.nix +++ b/devices/gl-ar750/default.nix @@ -96,6 +96,9 @@ imports = [ ../../modules/network ../../modules/arch/mipseb.nix + ../../modules/outputs/tftpboot.nix + ../../modules/outputs/flashimage.nix + ../../modules/outputs/jffs2.nix ]; programs.busybox.options = { diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix index 3fa9c383..4026d89e 100644 --- a/devices/gl-mt300a/default.nix +++ b/devices/gl-mt300a/default.nix @@ -52,7 +52,12 @@ klibBuild = config.system.outputs.kernel.modulesupport; }; in { - imports = [ ../../modules/arch/mipsel.nix ]; + imports = [ + ../../modules/arch/mipsel.nix + ../../modules/outputs/tftpboot.nix + ../../modules/outputs/flashimage.nix + ../../modules/outputs/jffs2.nix + ]; hardware = { defaultOutput = "flashimage"; loadAddress = lim.parseInt "0x80000000"; diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix index c1dea494..3d5d94d1 100644 --- a/devices/gl-mt300n-v2/default.nix +++ b/devices/gl-mt300n-v2/default.nix @@ -52,7 +52,12 @@ hash = "sha256:1dkhfznmdz6s50kwc841x3wj0h6zg6icg5g2bim9pvg66as2vmh9"; }; in { - imports = [ ../../modules/arch/mipsel.nix ]; + imports = [ + ../../modules/arch/mipsel.nix + ../../modules/outputs/tftpboot.nix + ../../modules/outputs/flashimage.nix + ../../modules/outputs/jffs2.nix + ]; filesystem = dir { lib = dir { firmware = dir { diff --git a/devices/turris-omnia/default.nix b/devices/turris-omnia/default.nix index 070cd8ff..66f6c340 100644 --- a/devices/turris-omnia/default.nix +++ b/devices/turris-omnia/default.nix @@ -12,7 +12,13 @@ module = {pkgs, config, lib, lim, ... }: let openwrt = pkgs.openwrt; in { - imports = [ ../../modules/arch/arm.nix ]; + imports = [ + ../../modules/arch/arm.nix + ../modules/outputs/tftpboot.nix + ../modules/outputs/diskimage.nix + ../modules/outputs/extlinux.nix + ../modules/outputs/ext4fs.nix + ]; kernel = { src = pkgs.pkgsBuildBuild.fetchurl { name = "linux.tar.gz"; @@ -46,10 +52,6 @@ # WARNING: unmet direct dependencies detected for ARCH_WANT_LIBATA_LEDS ATA = "y"; - # switch is DSA - # CONFIG_NET_DSA_MV88E6060=y - # CONFIG_NET_DSA_MV88E6XXX=y - # CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y # CONFIG_REGMAP=y # CONFIG_REGMAP_I2C=y diff --git a/examples/arhcive.nix b/examples/arhcive.nix index 53c42028..360e8e84 100644 --- a/examples/arhcive.nix +++ b/examples/arhcive.nix @@ -30,14 +30,7 @@ in rec { ../modules/ssh ../modules/watchdog ../modules/mount - - ../modules/outputs/tftpboot.nix - ../modules/outputs/kexecboot.nix - ../modules/outputs/flashimage.nix - ../modules/outputs/jffs2.nix - ../modules/outputs/ubifs.nix ]; - hostname = "arhcive"; kernel = { diff --git a/examples/demo.nix b/examples/demo.nix index 305056e8..e807c2b2 100644 --- a/examples/demo.nix +++ b/examples/demo.nix @@ -33,11 +33,6 @@ in rec { ../modules/ntp ../modules/ppp ../modules/ssh - ../modules/outputs/tftpboot.nix - ../modules/outputs/kexecboot.nix - ../modules/outputs/flashimage.nix - ../modules/outputs/jffs2.nix - ../modules/outputs/ubifs.nix ../modules/vlan ../modules/wlan.nix ]; diff --git a/examples/extneder.nix b/examples/extneder.nix index 5cd0bfc2..f640f0ed 100644 --- a/examples/extneder.nix +++ b/examples/extneder.nix @@ -30,11 +30,6 @@ in rec { ../modules/hostapd ../modules/bridge ../modules/ssh - ../modules/outputs/tftpboot.nix - ../modules/outputs/kexecboot.nix - ../modules/outputs/flashimage.nix - ../modules/outputs/jffs2.nix - ../modules/outputs/ubifs.nix ]; hostname = "extneder"; diff --git a/examples/hello-from-mt300.nix b/examples/hello-from-mt300.nix index 2c1c2f2c..a7f3eb17 100644 --- a/examples/hello-from-mt300.nix +++ b/examples/hello-from-mt300.nix @@ -8,7 +8,6 @@ in rec { ../modules/network ../modules/ssh ../modules/vlan - ../modules/outputs/flashimage.nix ]; boot.tftp = { diff --git a/examples/rotuer.nix b/examples/rotuer.nix index 395f1b28..8dc1eba8 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -43,11 +43,6 @@ in rec { ../modules/bridge ../modules/ntp ../modules/ssh - ../modules/outputs/tftpboot.nix - ../modules/outputs/kexecboot.nix - ../modules/outputs/flashimage.nix - ../modules/outputs/jffs2.nix - ../modules/outputs/ubifs.nix ]; rootfsType = "jffs2"; hostname = "rotuer"; diff --git a/modules/all-modules.nix b/modules/all-modules.nix index 1718de72..a4fe59d8 100644 --- a/modules/all-modules.nix +++ b/modules/all-modules.nix @@ -29,8 +29,8 @@ ./ramdisk.nix ./squashfs.nix ./ssh - ./tftpboot.nix - ./ubifs.nix + ./outputs/tftpboot.nix + ./outputs/ubifs.nix ./users.nix ./vlan ./watchdog diff --git a/modules/ext4fs.nix b/modules/outputs/ext4fs.nix similarity index 100% rename from modules/ext4fs.nix rename to modules/outputs/ext4fs.nix diff --git a/tests/ext4/configuration.nix b/tests/ext4/configuration.nix index 258e2b37..c4d18389 100644 --- a/tests/ext4/configuration.nix +++ b/tests/ext4/configuration.nix @@ -3,17 +3,17 @@ let inherit (pkgs.pseudofile) dir symlink; in { imports = [ - ../../vanilla-configuration.nix - ../../modules/squashfs.nix - ../../modules/ext4fs.nix + ../../modules/outputs/ext4fs.nix ]; - config.rootfsType = "ext4"; - config.filesystem = dir { - hello = { - type = "f"; - uid = 7; - gid = 24; - file = "hello world"; + config = { + rootfsType = "ext4"; + filesystem = dir { + hello = { + type = "f"; + uid = 7; + gid = 24; + file = "hello world"; + }; }; }; } diff --git a/vanilla-configuration-hw.nix b/vanilla-configuration-hw.nix index 94e433f1..9c51598d 100644 --- a/vanilla-configuration-hw.nix +++ b/vanilla-configuration-hw.nix @@ -2,10 +2,5 @@ { imports = [ ./vanilla-configuration.nix - ./modules/outputs/tftpboot.nix - ./modules/outputs/kexecboot.nix - ./modules/outputs/flashimage.nix - ./modules/outputs/jffs2.nix - ./modules/outputs/ubifs.nix ]; } diff --git a/vanilla-configuration.nix b/vanilla-configuration.nix index d72e1a10..f4ef2ab3 100644 --- a/vanilla-configuration.nix +++ b/vanilla-configuration.nix @@ -5,7 +5,6 @@ let svc = config.system.service; in rec { imports = [ - ./modules/tftpboot.nix ./modules/wlan.nix ./modules/network ./modules/ntp