Compare commits
3 Commits
shared-ste
...
add-liveus
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b676203e7 | |||
| beeb7acefd | |||
| a512d9bc06 |
19
build-liveusb.sh
Executable file
19
build-liveusb.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Build Live USB ISO from flake configuration
|
||||||
|
# Creates an uncompressed ISO suitable for Ventoy and other USB boot tools
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Building Live USB ISO..."
|
||||||
|
nix build .#nixosConfigurations.live-usb.config.system.build.isoImage --show-trace
|
||||||
|
|
||||||
|
if [ -f "./result/iso/"*.iso ]; then
|
||||||
|
iso_file=$(ls ./result/iso/*.iso)
|
||||||
|
echo "✅ Build complete!"
|
||||||
|
echo "📁 ISO location: $iso_file"
|
||||||
|
echo "💾 Ready for Ventoy or dd to USB"
|
||||||
|
else
|
||||||
|
echo "❌ Build failed - no ISO file found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
12
flake.nix
12
flake.nix
@@ -74,6 +74,18 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Live USB ISO configuration
|
||||||
|
nixosConfigurations.live-usb = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = baseModules ++ [
|
||||||
|
./machines/live-usb/configuration.nix
|
||||||
|
{
|
||||||
|
home-manager.users.johno = import ./home/home.nix;
|
||||||
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
homeConfigurations."johno" = inputs.home-manager.lib.homeManagerConfiguration {
|
homeConfigurations."johno" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
|
pkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
|
|||||||
95
machines/live-usb/configuration.nix
Normal file
95
machines/live-usb/configuration.nix
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
# Live USB ISO configuration for recovery and installation
|
||||||
|
{ pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# Use minimal installation CD as base
|
||||||
|
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
# Use roles structure for consistent configuration
|
||||||
|
roles = {
|
||||||
|
audio.enable = true;
|
||||||
|
bluetooth.enable = true;
|
||||||
|
users = {
|
||||||
|
enable = true;
|
||||||
|
extraGroups = [ "video" "wheel" "networkmanager" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow unfree packages for broader hardware support
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
# Essential packages for system recovery and installation
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Text editors
|
||||||
|
neovim
|
||||||
|
nano
|
||||||
|
|
||||||
|
# System tools
|
||||||
|
git
|
||||||
|
curl
|
||||||
|
wget
|
||||||
|
htop
|
||||||
|
tree
|
||||||
|
lsof
|
||||||
|
strace
|
||||||
|
|
||||||
|
# Filesystem tools
|
||||||
|
btrfs-progs
|
||||||
|
e2fsprogs
|
||||||
|
xfsprogs
|
||||||
|
ntfs3g
|
||||||
|
dosfstools
|
||||||
|
|
||||||
|
# Network tools
|
||||||
|
networkmanager
|
||||||
|
wirelesstools
|
||||||
|
|
||||||
|
# Hardware tools
|
||||||
|
pciutils
|
||||||
|
usbutils
|
||||||
|
smartmontools
|
||||||
|
|
||||||
|
# Archive tools
|
||||||
|
unzip
|
||||||
|
p7zip
|
||||||
|
|
||||||
|
# Development tools (for quick fixes)
|
||||||
|
gcc
|
||||||
|
binutils
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enable NetworkManager for easy wifi setup
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Enable SSH daemon for remote access
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PermitRootLogin = "yes";
|
||||||
|
PasswordAuthentication = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Override default nixos user, set johno as the main user with password
|
||||||
|
users.users.nixos.enable = false;
|
||||||
|
users.users.johno = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "John Ogle";
|
||||||
|
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
|
||||||
|
password = "nixos"; # Simple password for live environment
|
||||||
|
};
|
||||||
|
|
||||||
|
# ISO customization
|
||||||
|
isoImage = {
|
||||||
|
volumeID = "NIXOS-LIVE";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable some useful services
|
||||||
|
services.udisks2.enable = true; # For mounting USB drives
|
||||||
|
|
||||||
|
# Hardware support
|
||||||
|
hardware.enableAllFirmware = true;
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user