From c81e7c4d35c82a1189efc7209d3ad6f172c5b4d5 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 10 Dec 2023 15:23:12 +0000 Subject: [PATCH] move all output modules to subdirectory, trash standard.nix standard.nix isn't, is the essence here. Not all devices support flashimage as it is currently defined - some have diskimage, some have neither --- examples/arhcive.nix | 7 ++++++- examples/demo.nix | 6 +++++- examples/extneder.nix | 6 +++++- examples/rotuer.nix | 6 +++++- modules/all-modules.nix | 1 - modules/{ => outputs}/initramfs.nix | 0 modules/{ => outputs}/jffs2.nix | 0 modules/{ => outputs}/kexecboot.nix | 2 +- modules/{ => outputs}/tftpboot.nix | 2 +- modules/{ => outputs}/ubifs.nix | 0 modules/standard.nix | 12 ------------ vanilla-configuration-hw.nix | 6 +++++- 12 files changed, 28 insertions(+), 20 deletions(-) rename modules/{ => outputs}/initramfs.nix (100%) rename modules/{ => outputs}/jffs2.nix (100%) rename modules/{ => outputs}/kexecboot.nix (98%) rename modules/{ => outputs}/tftpboot.nix (99%) rename modules/{ => outputs}/ubifs.nix (100%) delete mode 100644 modules/standard.nix diff --git a/examples/arhcive.nix b/examples/arhcive.nix index 1281f74..53c4202 100644 --- a/examples/arhcive.nix +++ b/examples/arhcive.nix @@ -24,13 +24,18 @@ in rec { }; imports = [ - ../modules/standard.nix ../modules/wlan.nix ../modules/network ../modules/vlan ../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"; diff --git a/examples/demo.nix b/examples/demo.nix index f242056..305056e 100644 --- a/examples/demo.nix +++ b/examples/demo.nix @@ -33,7 +33,11 @@ in rec { ../modules/ntp ../modules/ppp ../modules/ssh - ../modules/standard.nix + ../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 28697bd..5cd0bfc 100644 --- a/examples/extneder.nix +++ b/examples/extneder.nix @@ -30,7 +30,11 @@ in rec { ../modules/hostapd ../modules/bridge ../modules/ssh - ../modules/standard.nix + ../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/rotuer.nix b/examples/rotuer.nix index fc5d106..395f1b2 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -34,7 +34,6 @@ in rec { imports = [ ../modules/wlan.nix - ../modules/standard.nix ../modules/network ../modules/ppp ../modules/dnsmasq @@ -44,6 +43,11 @@ 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 e160113..1718de7 100644 --- a/modules/all-modules.nix +++ b/modules/all-modules.nix @@ -29,7 +29,6 @@ ./ramdisk.nix ./squashfs.nix ./ssh - ./standard.nix ./tftpboot.nix ./ubifs.nix ./users.nix diff --git a/modules/initramfs.nix b/modules/outputs/initramfs.nix similarity index 100% rename from modules/initramfs.nix rename to modules/outputs/initramfs.nix diff --git a/modules/jffs2.nix b/modules/outputs/jffs2.nix similarity index 100% rename from modules/jffs2.nix rename to modules/outputs/jffs2.nix diff --git a/modules/kexecboot.nix b/modules/outputs/kexecboot.nix similarity index 98% rename from modules/kexecboot.nix rename to modules/outputs/kexecboot.nix index e99ff9e..053644e 100644 --- a/modules/kexecboot.nix +++ b/modules/outputs/kexecboot.nix @@ -7,7 +7,7 @@ let inherit (lib) mkOption mkForce types concatStringsSep; in { - imports = [ ./ramdisk.nix ]; + imports = [ ../ramdisk.nix ]; options.system.outputs = { kexecboot = mkOption { type = types.package; diff --git a/modules/tftpboot.nix b/modules/outputs/tftpboot.nix similarity index 99% rename from modules/tftpboot.nix rename to modules/outputs/tftpboot.nix index 2e7a685..222af45 100644 --- a/modules/tftpboot.nix +++ b/modules/outputs/tftpboot.nix @@ -8,7 +8,7 @@ let inherit (lib) mkOption types concatStringsSep; cfg = config.boot.tftp; in { - imports = [ ./ramdisk.nix ]; + imports = [ ../ramdisk.nix ]; options.boot.tftp.freeSpaceBytes = mkOption { type = types.int; default = 0; diff --git a/modules/ubifs.nix b/modules/outputs/ubifs.nix similarity index 100% rename from modules/ubifs.nix rename to modules/outputs/ubifs.nix diff --git a/modules/standard.nix b/modules/standard.nix deleted file mode 100644 index 4c6b37d..0000000 --- a/modules/standard.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - # "standard" modules that aren't fundamentally required, - # but are probably useful in most common workflows and - # you should have to opt out of instead of into - imports = [ - ./tftpboot.nix - ./kexecboot.nix - ./outputs/flashimage.nix - ./jffs2.nix - ./ubifs.nix - ]; -} diff --git a/vanilla-configuration-hw.nix b/vanilla-configuration-hw.nix index 45c5e80..94e433f 100644 --- a/vanilla-configuration-hw.nix +++ b/vanilla-configuration-hw.nix @@ -2,6 +2,10 @@ { imports = [ ./vanilla-configuration.nix - ./modules/standard.nix + ./modules/outputs/tftpboot.nix + ./modules/outputs/kexecboot.nix + ./modules/outputs/flashimage.nix + ./modules/outputs/jffs2.nix + ./modules/outputs/ubifs.nix ]; }