summaryrefslogtreecommitdiff
path: root/systems/nixos-anywhere
diff options
context:
space:
mode:
Diffstat (limited to 'systems/nixos-anywhere')
-rw-r--r--systems/nixos-anywhere/configuration.nix22
-rw-r--r--systems/nixos-anywhere/disk-config.nix57
-rw-r--r--systems/nixos-anywhere/hardware-configuration.nix1
3 files changed, 80 insertions, 0 deletions
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`?"