From ca01abceb835038e7739a35ba7fa0f9c4f51bd2c Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 23 Sep 2021 19:34:09 +0200 Subject: [PATCH] flake.nix: add ${host}-sdImage package --- flake.nix | 16 +++++++++++++--- hosts/pulsebert/default.nix | 1 - hosts/radiobert/default.nix | 7 +++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 4ce15137..e2f2cd17 100644 --- a/flake.nix +++ b/flake.nix @@ -160,7 +160,13 @@ nix-copy-closure --to ${target} ${profile} exec ssh -t ${target} "${profile}/bin/switch-to-configuration $@" ''; - }) {} (builtins.attrNames flakifiedHosts) + }) {} (builtins.attrNames flakifiedHosts) // + + builtins.foldl' (result: host: result // { + "${host}-sdImage" = self.nixosConfigurations.${host}.config.system.build.sdImage; + }) {} (builtins.attrNames (nixpkgs.lib.filterAttrs (host: nixosConfiguration: + nixosConfiguration.config.system.build ? sdImage + ) self.nixosConfigurations)) ); nixosConfigurations = let @@ -169,7 +175,7 @@ { nixpkgs ? inputs.nixpkgs, extraArgs ? {}, ... }@args: nixpkgs.lib.nixosSystem (nixpkgs.lib.filterAttrs (n: _: n != "nixpkgs") args // { extraArgs = extraArgs // { - inherit hostRegistry; + inherit hostRegistry inputs; }; extraModules = [ self.nixosModules.c3d2 @@ -207,12 +213,16 @@ }; pulsebert = nixosSystem' { - modules = [ ./hosts/pulsebert ]; + modules = [ + "${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" + ./hosts/pulsebert + ]; system = "aarch64-linux"; }; radiobert = nixosSystem' { modules = [ + "${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" ./hosts/radiobert ]; system = "aarch64-linux"; diff --git a/hosts/pulsebert/default.nix b/hosts/pulsebert/default.nix index 292b4e87..9c44b1ce 100644 --- a/hosts/pulsebert/default.nix +++ b/hosts/pulsebert/default.nix @@ -16,7 +16,6 @@ in boot = { loader = { grub.enable = false; - generic-extlinux-compatible.enable = false; raspberryPi = { enable = true; version = 3; diff --git a/hosts/radiobert/default.nix b/hosts/radiobert/default.nix index d4321906..fe7d6357 100644 --- a/hosts/radiobert/default.nix +++ b/hosts/radiobert/default.nix @@ -22,11 +22,9 @@ #networking.wireless.enable = true; powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; - boot = { loader = { grub.enable = false; - generic-extlinux-compatible.enable = false; raspberryPi = { enable = true; version = 3; @@ -43,6 +41,11 @@ tmpOnTmpfs = true; }; + sdImage = { + compressImage = false; + imageBaseName = config.networking.hostName; + firmwareSize = 512; + }; c3d2 = { isInHq = true;