I’m trying to create an iso image that mounts the repository contents in a folder for the user, so that the user has read/write access to it. I came up with the following:
{ pkgs, config, nix-filter, modulesPath, lib, ... }:
with lib;
{
imports =
[ "${modulesPath}/installer/cd-dvd/installation-cd-graphical-gnome.nix" ];
# use the latest Linux kernel
boot.kernelPackages = pkgs.linuxPackages_latest;
# Needed for https://github.com/NixOS/nixpkgs/issues/58959
boot.supportedFilesystems =
lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ];
lib.isoFileSystems = {
"/home/nixos/foo" = mkImageMediaOverride {
device = "/iso/foo";
fsType = "none";
options = [ "bind" "defaults" ];
};
};
# copy repository contents to iso
isoImage.contents = [{
source = ./.;
target = "/foo";
}];
}
However, this doesn’t start the x session properly anymore, just shows a black screen. It is because of the lib.isoFileSystems
attribute I added, leaving this out properly starts the user session and mounts the repository contents at /iso/foo. Does anybody know how to do this properly?