From 47a11f736c5c9727928a607f89bc214d4dd53493 Mon Sep 17 00:00:00 2001 From: Florian Agbuya Date: Thu, 21 Dec 2023 17:12:45 +0800 Subject: [PATCH] zynq: add sd image support --- base.nix | 5 +++++ stage-1.nix | 4 +++- zynq_image.nix | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/base.nix b/base.nix index 7eaee32..f767d5e 100644 --- a/base.nix +++ b/base.nix @@ -27,6 +27,11 @@ with lib; description = "enable rngd"; default = false; }; + not-os.sd = mkOption { + type = types.bool; + default = false; + description = "enable sd image support"; + }; not-os.simpleStaticIp = mkOption { type = types.bool; default = false; diff --git a/stage-1.nix b/stage-1.nix index 4a02e61..85fda30 100644 --- a/stage-1.nix +++ b/stage-1.nix @@ -164,7 +164,9 @@ let mkdir -p /mnt/nix/store/ - ${if config.not-os.nix then '' + ${if config.not-os.sd && config.not-os.nix then '' + mount $root /mnt + '' else if config.not-os.nix then '' # make the store writeable mkdir -p /mnt/nix/.ro-store /mnt/nix/.overlay-store /mnt/nix/store mount $root /mnt/nix/.ro-store -t squashfs diff --git a/zynq_image.nix b/zynq_image.nix index 01eb725..484a063 100644 --- a/zynq_image.nix +++ b/zynq_image.nix @@ -32,6 +32,7 @@ in { boot.kernelPackages = customKernelPackages; nixpkgs.system = "armv7l-linux"; networking.hostName = "zynq"; + not-os.sd = true; system.build.zynq_image = pkgs.runCommand "zynq_image" { preferLocalBuild = true; } ''