flake: create generator for aarch64 sdcard image

This commit is contained in:
LavaDesu 2022-08-08 18:18:18 +07:00
parent a4294aefbc
commit 2c733de3b3
Signed by: cilly
GPG key ID: 6500251E087653C9
6 changed files with 133 additions and 20 deletions

View file

@ -1,4 +1,4 @@
{ config, ... }:
{ config, lib, ... }:
let
bind = src: {
depends = [ "/persist" ];
@ -9,16 +9,31 @@ let
};
in {
fileSystems = {
"/" = {
"/" = lib.mkForce {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=2G" "mode=755" ];
options = [ "defaults" "size=1G" "mode=755" ];
};
"/nix" = {
# "/nix" = {
# device = "overlayfs";
# fsType = "overlay";
# options = [
# "lowerdir=/mnt/image/nix"
# "upperdir=/persist/nix-overlay"
# "workdir=/persist/.overlaytmp"
# ];
# noCheck = true;
# depends = [ "/mnt/image" "/persist" ];
# };
"/nix" = (bind "/mnt/image/nix") // { depends = [ "/mnt/image" ]; };
"/mnt/image" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "defaults" "noatime" ];
neededForBoot = true;
};
"/persist" = {
@ -31,6 +46,6 @@ in {
"/var/persist" = bind "/persist";
"/var/lib/acme" = bind "/persist/acme";
"/var/log/journal" = bind "/persist/journal";
"/boot" = (bind "/nix/persist/boot") // { depends = [ "/nix" ]; };
"/boot" = (bind "/mnt/image/boot") // { depends = [ "/mnt/image" ]; };
};
}