From b0a0fdcfccca3f582ab2cac45ba49ef55cc70316 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 16 May 2023 20:13:46 +0100 Subject: [PATCH] add "standard" module, which includes flashimage kexec & jffs2 most systems need most of these, so it makes writing the docs a lot easier --- doc/user.rst | 7 ++++--- examples/arhcive.nix | 4 +--- examples/extneder.nix | 3 +-- examples/rotuer.nix | 4 +--- modules/standard.nix | 11 +++++++++++ tests/min-copy-closure/configuration.nix | 2 -- vanilla-configuration.nix | 2 +- 7 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 modules/standard.nix diff --git a/doc/user.rst b/doc/user.rst index bd6241d..2bf0ea0 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -12,13 +12,14 @@ and the services that you want to run on it. Start by copying ``vanilla-configuration.nix`` and adjusting it, or look in the `examples` directory for some pre-written configurations. -If you want to create a configuration that can be installed on -a hardware device, be sure to include the "flashimage" module. +Your configuration may include modules and probably _should_ +include the ``standard`` module unless you understand what it +does and what happens if you leave it out. .. code-block: nix imports = [ - ./modules/flashimage.nix + ./modules/standard.nix ] diff --git a/examples/arhcive.nix b/examples/arhcive.nix index 375b676..1adc8b1 100644 --- a/examples/arhcive.nix +++ b/examples/arhcive.nix @@ -31,10 +31,8 @@ in rec { }; imports = [ - ../modules/tftpboot.nix + ../modules/standard.nix ../modules/wlan.nix - ../modules/flashimage.nix - ../modules/kexecboot.nix ]; hostname = "arhcive"; diff --git a/examples/extneder.nix b/examples/extneder.nix index e2187f8..a2af61c 100644 --- a/examples/extneder.nix +++ b/examples/extneder.nix @@ -34,8 +34,7 @@ in rec { imports = [ ../modules/wlan.nix - ../modules/tftpboot.nix - ../modules/flashimage.nix + ../modules/standard.nix ]; hostname = "extneder"; diff --git a/examples/rotuer.nix b/examples/rotuer.nix index 42140f5..a7f40c5 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -33,9 +33,7 @@ in rec { imports = [ ../modules/wlan.nix - ../modules/tftpboot.nix - ../modules/flashimage.nix - ../modules/jffs2.nix + ../modules/standard.nix ]; rootfsType = "jffs2"; diff --git a/modules/standard.nix b/modules/standard.nix new file mode 100644 index 0000000..cb9b8ee --- /dev/null +++ b/modules/standard.nix @@ -0,0 +1,11 @@ +{ + # "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 + ./flashimage.nix + ./jffs2.nix + ]; +} diff --git a/tests/min-copy-closure/configuration.nix b/tests/min-copy-closure/configuration.nix index b637e74..5c838d9 100644 --- a/tests/min-copy-closure/configuration.nix +++ b/tests/min-copy-closure/configuration.nix @@ -13,8 +13,6 @@ let in { imports = [ ../../vanilla-configuration.nix - ../../modules/squashfs.nix - ../../modules/jffs2.nix ]; config = { services.sshd = longrun { diff --git a/vanilla-configuration.nix b/vanilla-configuration.nix index 6db1f17..3a19ea8 100644 --- a/vanilla-configuration.nix +++ b/vanilla-configuration.nix @@ -4,7 +4,7 @@ let inherit (pkgs.liminix.services) oneshot longrun bundle target; in rec { imports = [ - ./modules/tftpboot.nix + ./modules/standard.nix ./modules/wlan.nix ]; services.loopback = config.hardware.networkInterfaces.lo;