Create custom ISO to simplify bootstrapping new installs

This commit is contained in:
Vili Sinervä 2024-08-05 17:17:33 +03:00
parent 4d9fcfed6c
commit f94f7321a2
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
3 changed files with 29 additions and 2 deletions

10
machine-confs/generic.nix Normal file
View file

@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
networking.hostName = "nixos";
imports = [ ../base.nix ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
}

17
misc/custom-iso.nix Normal file
View file

@ -0,0 +1,17 @@
{ config, pkgs, ... }:
let
fetch-config-template = pkgs.writeScriptBin "fetch-config-template" ''
mv configuration.nix configuration.nix.old
${pkgs.curl}/bin/curl https://raw.githubusercontent.com/VSinerva/nixos-conf/main/misc/template-configuration.nix -o configuration.nix
'';
in
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
../base.nix
];
networking.networkmanager.enable = pkgs.lib.mkForce false;
environment.systemPackages = [ fetch-config-template ];
}

View file

@ -1,7 +1,7 @@
{ config, pkgs, ... }:
let
host = "???";
stateVersion = "???";
host = "generic";
stateVersion = "24.05";
repo = builtins.fetchGit {
url = "https://github.com/VSinerva/nixos-conf.git";