diff --git a/examples/jumpdrive/README.md b/examples/jumpdrive/README.md new file mode 100644 index 00000000..b7ed13e1 --- /dev/null +++ b/examples/jumpdrive/README.md @@ -0,0 +1,15 @@ +[JumpDrive](https://github.com/dreemurrs-embedded/Jumpdrive), but with Mobile NixOS +=================================================================================== + +What's this? +------------ + +This is a system that allows you to present the internal storage of a device +over the USB connection using Linux USB gadget mode. + + +* * * + +With that said, while the project differs enough in implementation, I want +to acknowledge the obvious inspiration taken from the [JumpDrive](https://github.com/dreemurrs-embedded/Jumpdrive) +project. diff --git a/examples/jumpdrive/configuration.nix b/examples/jumpdrive/configuration.nix new file mode 100644 index 00000000..416a1e07 --- /dev/null +++ b/examples/jumpdrive/configuration.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +{ + # There is no mounting here. + fileSystems = lib.mkForce {}; + + mobile.boot.stage-1.usb = { + enable = true; + features = [ "mass_storage" ]; + }; + + system.build.rootfs = null; + + mobile.boot.stage-1.networking.enable = true; + mobile.boot.stage-1.ssh.enable = true; +} diff --git a/examples/jumpdrive/default.nix b/examples/jumpdrive/default.nix new file mode 100644 index 00000000..98772f30 --- /dev/null +++ b/examples/jumpdrive/default.nix @@ -0,0 +1,11 @@ +{ device }: + +let + system-build = import ../../. { + inherit device; + configuration = [ (import ./configuration.nix) ]; + }; +in +{ + inherit (system-build) build; +}