server10: build isos for host
This commit is contained in:
parent
ea272005ec
commit
e9a4c3de11
|
@ -715,6 +715,13 @@
|
|||
nixosModules = {
|
||||
c3d2 = {
|
||||
imports = [
|
||||
# adds config.system.build.isoImage which can be used to build an iso for any system
|
||||
# which is very useful to get its networking configuration
|
||||
({ config, modulesPath, ... }: {
|
||||
imports = lib.singleton "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix";
|
||||
isoImage.edition = lib.mkForce config.networking.hostName;
|
||||
})
|
||||
|
||||
c3d2-user-module.nixosModule
|
||||
disko.nixosModules.disko
|
||||
nixos-modules.nixosModule
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, options, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
@ -13,7 +13,7 @@
|
|||
};
|
||||
|
||||
boot = {
|
||||
loader.grub = {
|
||||
loader.grub = lib.mkIf (!options?isoImage) {
|
||||
enable = true;
|
||||
device = "/dev/sda";
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ self, config, lib, pkgs, ... }:
|
||||
{ self, config, lib, options, pkgs, ... }:
|
||||
{
|
||||
options = with lib; {
|
||||
c3d2.deployment.microvmBaseZfsDataset = mkOption {
|
||||
|
@ -21,6 +21,9 @@
|
|||
builtins.filter (name:
|
||||
(self.nixosConfigurations.${name}.config.c3d2.deployment.server or null) == config.networking.hostName
|
||||
) (builtins.attrNames self.nixosConfigurations);
|
||||
|
||||
# don't enable microvm host options in live iso's
|
||||
host.enable = if (options?isoImage) then false else true;
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
|
|
Loading…
Reference in New Issue