From 714259545b868d643056e6372f91fa8f122119d7 Mon Sep 17 00:00:00 2001 From: twoneis Date: Sat, 29 Mar 2025 21:55:27 +0100 Subject: [PATCH] bootable usb: init --- devices/hufuf/default.nix | 21 +++++++++++++++++++++ devices/hufuf/options.nix | 8 ++++++++ flake.nix | 5 +++++ outputs.nix | 13 +++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 devices/hufuf/default.nix create mode 100644 devices/hufuf/options.nix diff --git a/devices/hufuf/default.nix b/devices/hufuf/default.nix new file mode 100644 index 0000000..ff518a7 --- /dev/null +++ b/devices/hufuf/default.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: { + imports = [ + ./options.nix + ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + + networking = { + hostName = "hufuf"; + }; + + boot = { + initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod"]; + kernelPackages = pkgs.linuxPackages_latest; + loader = { + systemd-boot = { + enable = true; + }; + }; + }; +} diff --git a/devices/hufuf/options.nix b/devices/hufuf/options.nix new file mode 100644 index 0000000..a1fe792 --- /dev/null +++ b/devices/hufuf/options.nix @@ -0,0 +1,8 @@ +{...}: { + conf = { + host = "laptop"; + + stateVersion = "24.11"; + hmStateVersion = "24.11"; + }; +} diff --git a/flake.nix b/flake.nix index 7d803b0..e4924d5 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,11 @@ url = "github:nixos/nixos-hardware"; }; + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + disko = { url = "github:nix-community/disko/latest"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/outputs.nix b/outputs.nix index b1255d8..aca7bf3 100644 --- a/outputs.nix +++ b/outputs.nix @@ -2,6 +2,7 @@ nixpkgs, home-manager, nixos-hardware, + nixos-generators, disko, niri, lanzaboote, @@ -47,4 +48,16 @@ in { ++ modules; }; }; + packages.x86_64-linux = { + live = nixos-generators.nixosGenerate { + system = "x86_64-linux"; + format = "iso"; + + modules = + [ + ./devices/hufuf + ] + ++ modules; + }; + }; }