Restructure flake.nix for a simpler config for building different images off the same NixOS config.
This commit is contained in:
23
nix/configuration/formats/iso.nix
Normal file
23
nix/configuration/formats/iso.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/cd-dvd/iso-image.nix")
|
||||
];
|
||||
|
||||
config = {
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
|
||||
me.buildingPortable = true;
|
||||
me.mountPersistence = lib.mkForce false;
|
||||
me.optimizations.enable = lib.mkForce false;
|
||||
me.image_based_appliance.enable = true;
|
||||
|
||||
# TODO: image based appliance?
|
||||
};
|
||||
}
|
||||
32
nix/configuration/formats/sd.nix
Normal file
32
nix/configuration/formats/sd.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/sd-card/sd-image.nix")
|
||||
];
|
||||
|
||||
config = {
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
|
||||
boot.loader.grub.enable = false;
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
|
||||
# TODO: image based appliance?
|
||||
|
||||
# TODO: Maybe this?
|
||||
# fileSystems = {
|
||||
# "/" = {
|
||||
# device = "/dev/disk/by-label/NIXOS_SD";
|
||||
# fsType = "ext4";
|
||||
# options = [
|
||||
# "noatime"
|
||||
# "norelatime"
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
1
nix/configuration/formats/toplevel.nix
Normal file
1
nix/configuration/formats/toplevel.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ }
|
||||
21
nix/configuration/formats/vm_iso.nix
Normal file
21
nix/configuration/formats/vm_iso.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/cd-dvd/iso-image.nix")
|
||||
(modulesPath + "/profiles/qemu-guest.nix") # VirtIO kernel modules
|
||||
];
|
||||
|
||||
config = {
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
|
||||
networking.dhcpcd.enable = true;
|
||||
networking.useDHCP = true;
|
||||
|
||||
me.image_based_appliance.enable = true;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user