From 16143e4821cbadcf6f3076ece71940eeb85b800e Mon Sep 17 00:00:00 2001 From: Leonardo Date: Tue, 17 Mar 2026 10:38:53 +0100 Subject: nixos-anywhere config --- systems/nixos-anywhere/configuration.nix | 22 +++++++++ systems/nixos-anywhere/disk-config.nix | 57 +++++++++++++++++++++++ systems/nixos-anywhere/hardware-configuration.nix | 1 + 3 files changed, 80 insertions(+) create mode 100644 systems/nixos-anywhere/configuration.nix create mode 100644 systems/nixos-anywhere/disk-config.nix create mode 100644 systems/nixos-anywhere/hardware-configuration.nix (limited to 'systems') diff --git a/systems/nixos-anywhere/configuration.nix b/systems/nixos-anywhere/configuration.nix new file mode 100644 index 0000000..46aedb8 --- /dev/null +++ b/systems/nixos-anywhere/configuration.nix @@ -0,0 +1,22 @@ +{modulesPath, pkgs, ...} @ args: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + (modulesPath + "/profiles/qemu-guest.nix") + ./disk-config.nix + ]; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + }; + + services.openssh.enable = true; + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMjRcsulH/b/fVyj+YQi3YchW6wLiWvpgiM+iz4tokSD leo@hermes" + ] ++ (args.extraPublicKeys or []); + + environment.systemPackages = with pkgs; [ curl gitMinimal ]; + + system.stateVersion = "25.05"; +} diff --git a/systems/nixos-anywhere/disk-config.nix b/systems/nixos-anywhere/disk-config.nix new file mode 100644 index 0000000..fd6371c --- /dev/null +++ b/systems/nixos-anywhere/disk-config.nix @@ -0,0 +1,57 @@ +{ lib, ... }: { + disko.devices = { + disk.disk1 = { + device = lib.mkDefault "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + + esp = { + name = "ESP"; + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + + root = { + name = "root"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + }; + }; + }; + + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/systems/nixos-anywhere/hardware-configuration.nix b/systems/nixos-anywhere/hardware-configuration.nix new file mode 100644 index 0000000..a40df93 --- /dev/null +++ b/systems/nixos-anywhere/hardware-configuration.nix @@ -0,0 +1 @@ +throw "Have you forgotten to run nixos-anywhere with `--generate-hardware-config nixos-generate-config ./hardware-configuration.nix`?" -- cgit v1.3