From 39788d0c8311d85b5370b78ffca4e3cc0b64e846 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 28 Jul 2020 18:25:05 -0400 Subject: [PATCH] hastily move configs around --- configuration.nix | 19 ------------------- nixos/sd-image.nix | 4 ++-- sd-image.nix | 25 +++++++++++++++++++++++++ system.nix | 15 ++++++++++----- 4 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 sd-image.nix diff --git a/configuration.nix b/configuration.nix index f91837d..2a15229 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,24 +1,5 @@ -{ config, pkgs, lib, ... }: - -let - uboot = pkgs.uBootPinebookPro; -in { imports = [ - - - - ./nixos/sd-image-aarch64.nix ./pinebook_pro.nix ]; - - sdImage = { - manipulateImageCommands = '' - (PS4=" $ "; set -x - dd if=${uboot}/idbloader.img of=$img bs=512 seek=64 conv=notrunc - dd if=${uboot}/u-boot.itb of=$img bs=512 seek=16384 conv=notrunc - ) - ''; - compressImage = lib.mkForce false; - }; } diff --git a/nixos/sd-image.nix b/nixos/sd-image.nix index 32633ca..82f046f 100644 --- a/nixos/sd-image.nix +++ b/nixos/sd-image.nix @@ -7,7 +7,7 @@ let inherit (config.sdImage) storePaths; #compressImage = false; populateImageCommands = config.sdImage.populateRootCommands; - volumeLabel = "NIXOS_SD"; + volumeLabel = "NIXOS_RECOVERY"; } // optionalAttrs (config.sdImage.rootPartitionUUID != null) { uuid = config.sdImage.rootPartitionUUID; }); @@ -87,7 +87,7 @@ in config = { fileSystems = { "/" = { - device = "/dev/disk/by-label/NIXOS_SD"; + device = "/dev/disk/by-label/NIXOS_RECOVERY"; fsType = "ext4"; }; }; diff --git a/sd-image.nix b/sd-image.nix new file mode 100644 index 0000000..ff95a1d --- /dev/null +++ b/sd-image.nix @@ -0,0 +1,25 @@ +{ config, pkgs, lib, ... }: + +let + uboot = pkgs.uBootPinebookProExternalFirst; +in +{ + imports = [ + + + + ./nixos/sd-image-aarch64.nix + + ./pinebook_pro.nix + ]; + + sdImage = { + manipulateImageCommands = '' + (PS4=" $ "; set -x + dd if=${uboot}/idbloader.img of=$img bs=512 seek=64 conv=notrunc + dd if=${uboot}/u-boot.itb of=$img bs=512 seek=16384 conv=notrunc + ) + ''; + compressImage = lib.mkForce false; + }; +} diff --git a/system.nix b/system.nix index 975a7b2..7d38d3c 100644 --- a/system.nix +++ b/system.nix @@ -1,7 +1,12 @@ import { - configuration = - if builtins.currentSystem == "aarch64-linux" - then builtins.toPath (./. + "/configuration.nix") - else builtins.toPath (./. + "/with-cross.nix") - ; + configuration = { + imports = [ + ( + if builtins.currentSystem == "aarch64-linux" + then builtins.toPath (./. + "/configuration.nix") + else builtins.toPath (./. + "/with-cross.nix") + ) + ./sd-image.nix + ]; + }; }