Skip to content

Commit

Permalink
hosts/{bootstrap,graphical-installer}: refactor for nixos-generators
Browse files Browse the repository at this point in the history
  • Loading branch information
foo-dogsquared committed Feb 17, 2024
1 parent 8bd3ac5 commit 03c57d7
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 52 deletions.
38 changes: 22 additions & 16 deletions configs/nixos/bootstrap/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,31 @@
#
# This means, there will be a "nixos" user among other things.
{
isoImage = {
isoBaseName = config.networking.hostName;
config = lib.mkMerge [
{
boot.kernelPackages = pkgs.linuxPackages_6_6;

# Store the source code in a easy-to-locate path.
contents = [{
source = ../../..;
target = "/etc/nixos/";
}];
# Assume that this will be used for remote installations.
services.openssh = {
enable = true;
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.
services.openssh = {
enable = true;
allowSFTP = true;
};
# Store the source code in a easy-to-locate path.
contents = [{
source = ../../..;
target = "/etc/nixos/";
}];

system.stateVersion = "23.11";
squashfsCompression = "zstd -Xcompression-level 11";
};
})
];
}
78 changes: 42 additions & 36 deletions configs/nixos/graphical-installer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,46 @@
"${modulesPath}/installer/cd-dvd/installation-cd-graphical-base.nix"
];

isoImage = {
isoBaseName = config.networking.hostName;

# Put the source code somewhere easy to see.
contents = [{
source = ../../..;
target = "/etc/nixos";
}];

squashfsCompression = "zstd -Xcompression-level 12";
};

boot.kernelPackages = pkgs.linuxPackages_6_6;

# Use my desktop environment configuration without the apps just to make the
# closure size smaller.
workflows.workflows.a-happy-gnome = {
enable = true;
extraApps = [ ];
};

# Some niceties.
suites.desktop.enable = true;

services.xserver.displayManager = {
gdm = {
enable = true;
autoSuspend = false;
};
autoLogin = {
enable = true;
user = "nixos";
};
};

system.stateVersion = "23.11";
config = lib.mkMerge [
{
boot.kernelPackages = pkgs.linuxPackages_6_6;

# Use my desktop environment configuration without the apps just to make the
# closure size smaller.
workflows.workflows.a-happy-gnome = {
enable = true;
extraApps = [ ];
};

# Some niceties.
suites.desktop.enable = true;

services.xserver.displayManager = {
gdm = {
enable = true;
autoSuspend = false;
};
autoLogin = {
enable = true;
user = "nixos";
};
};

system.stateVersion = "23.11";
}

(lib.mkIf (config.formatAttr == "install-iso") {
isoImage = {
isoBaseName = config.networking.hostName;

# Put the source code somewhere easy to see.
contents = [{
source = ../../..;
target = "/etc/nixos";
}];

squashfsCompression = "zstd -Xcompression-level 12";
};
})
];
}

0 comments on commit 03c57d7

Please sign in to comment.