hosts/{bootstrap,graphical-installer}: refactor for nixos-generators

This commit is contained in:
Gabriel Arazas 2024-02-17 14:58:53 +08:00
parent 8bd3ac5061
commit 03c57d73d3
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 57 additions and 45 deletions

View File

@ -6,25 +6,31 @@
# #
# This means, there will be a "nixos" user among other things. # This means, there will be a "nixos" user among other things.
{ {
isoImage = { config = lib.mkMerge [
isoBaseName = config.networking.hostName; {
boot.kernelPackages = pkgs.linuxPackages_6_6;
# Store the source code in a easy-to-locate path. # Assume that this will be used for remote installations.
contents = [{ services.openssh = {
source = ../../..; enable = true;
target = "/etc/nixos/"; allowSFTP = true;
}]; };
squashfsCompression = "zstd -Xcompression-level 11"; system.stateVersion = "23.11";
}; }
boot.kernelPackages = pkgs.linuxPackages_6_6; (lib.mkIf config.formatAttr == "install-iso" {
isoImage = {
isoBaseName = config.networking.hostName;
# Assume that this will be used for remote installations. # Store the source code in a easy-to-locate path.
services.openssh = { contents = [{
enable = true; source = ../../..;
allowSFTP = true; target = "/etc/nixos/";
}; }];
system.stateVersion = "23.11"; squashfsCompression = "zstd -Xcompression-level 11";
};
})
];
} }

View File

@ -8,40 +8,46 @@
"${modulesPath}/installer/cd-dvd/installation-cd-graphical-base.nix" "${modulesPath}/installer/cd-dvd/installation-cd-graphical-base.nix"
]; ];
isoImage = { config = lib.mkMerge [
isoBaseName = config.networking.hostName; {
boot.kernelPackages = pkgs.linuxPackages_6_6;
# Put the source code somewhere easy to see. # Use my desktop environment configuration without the apps just to make the
contents = [{ # closure size smaller.
source = ../../..; workflows.workflows.a-happy-gnome = {
target = "/etc/nixos"; enable = true;
}]; extraApps = [ ];
};
squashfsCompression = "zstd -Xcompression-level 12"; # Some niceties.
}; suites.desktop.enable = true;
boot.kernelPackages = pkgs.linuxPackages_6_6; services.xserver.displayManager = {
gdm = {
enable = true;
autoSuspend = false;
};
autoLogin = {
enable = true;
user = "nixos";
};
};
# Use my desktop environment configuration without the apps just to make the system.stateVersion = "23.11";
# closure size smaller. }
workflows.workflows.a-happy-gnome = {
enable = true;
extraApps = [ ];
};
# Some niceties. (lib.mkIf (config.formatAttr == "install-iso") {
suites.desktop.enable = true; isoImage = {
isoBaseName = config.networking.hostName;
services.xserver.displayManager = { # Put the source code somewhere easy to see.
gdm = { contents = [{
enable = true; source = ../../..;
autoSuspend = false; target = "/etc/nixos";
}; }];
autoLogin = {
enable = true;
user = "nixos";
};
};
system.stateVersion = "23.11"; squashfsCompression = "zstd -Xcompression-level 12";
};
})
];
} }