From f94f7321a21ec2375dbc6c0bf3db5569b89578c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vili=20Sinerv=C3=A4?= Date: Mon, 5 Aug 2024 17:17:33 +0300 Subject: [PATCH] Create custom ISO to simplify bootstrapping new installs --- machine-confs/generic.nix | 10 ++++++++++ misc/custom-iso.nix | 17 +++++++++++++++++ misc/template-configuration.nix | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 machine-confs/generic.nix create mode 100644 misc/custom-iso.nix diff --git a/machine-confs/generic.nix b/machine-confs/generic.nix new file mode 100644 index 0000000..25f4bf5 --- /dev/null +++ b/machine-confs/generic.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: +{ + networking.hostName = "nixos"; + + imports = [ ../base.nix ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/misc/custom-iso.nix b/misc/custom-iso.nix new file mode 100644 index 0000000..7b99aca --- /dev/null +++ b/misc/custom-iso.nix @@ -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 = [ + + + ../base.nix + ]; + + networking.networkmanager.enable = pkgs.lib.mkForce false; + environment.systemPackages = [ fetch-config-template ]; +} diff --git a/misc/template-configuration.nix b/misc/template-configuration.nix index e2e2ca2..e7969cb 100644 --- a/misc/template-configuration.nix +++ b/misc/template-configuration.nix @@ -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";