Compare commits
1 Commits
bead/nixos
...
bead/nixos
| Author | SHA1 | Date | |
|---|---|---|---|
| 513f6cb8b4 |
4
scripts/bootstrap.sh → bootstrap.sh
Normal file → Executable file
4
scripts/bootstrap.sh → bootstrap.sh
Normal file → Executable file
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# bootstrap.sh
|
||||
# Usage: nix run .#bootstrap -- <hostname>
|
||||
# Or: sudo ./scripts/bootstrap.sh <hostname>
|
||||
# Usage: sudo ./bootstrap.sh <hostname>
|
||||
set -euo pipefail
|
||||
|
||||
NEW_HOSTNAME="${1:?missing hostname}"
|
||||
@@ -9,3 +8,4 @@ FLAKE_URI="git+https://git.johnogle.info/johno/nixos-configs.git#${NEW_HOSTNAME}
|
||||
|
||||
export NIX_CONFIG="experimental-features = nix-command flakes"
|
||||
nixos-rebuild switch --flake "$FLAKE_URI"
|
||||
|
||||
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
|
||||
18
flake.nix
18
flake.nix
@@ -275,16 +275,6 @@
|
||||
export PATH="${pkgs.lib.makeBinPath commonDeps}:$PATH"
|
||||
${builtins.readFile ./scripts/upgrade.sh}
|
||||
'';
|
||||
|
||||
bootstrap = pkgs.writeShellScriptBin "bootstrap" ''
|
||||
export PATH="${pkgs.lib.makeBinPath commonDeps}:$PATH"
|
||||
${builtins.readFile ./scripts/bootstrap.sh}
|
||||
'';
|
||||
|
||||
build-liveusb = pkgs.writeShellScriptBin "build-liveusb" ''
|
||||
export PATH="${pkgs.lib.makeBinPath commonDeps}:$PATH"
|
||||
${builtins.readFile ./scripts/build-liveusb.sh}
|
||||
'';
|
||||
in {
|
||||
update-doomemacs = {
|
||||
type = "app";
|
||||
@@ -302,14 +292,6 @@
|
||||
type = "app";
|
||||
program = "${upgrade}/bin/upgrade";
|
||||
};
|
||||
bootstrap = {
|
||||
type = "app";
|
||||
program = "${bootstrap}/bin/bootstrap";
|
||||
};
|
||||
build-liveusb = {
|
||||
type = "app";
|
||||
program = "${build-liveusb}/bin/build-liveusb";
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,6 +8,21 @@ in
|
||||
{
|
||||
options.roles.nfs-mounts = {
|
||||
enable = mkEnableOption "Enable default NFS mounts";
|
||||
server = mkOption {
|
||||
type = types.str;
|
||||
default = "10.0.0.43";
|
||||
description = "IP address or hostname of the NFS server";
|
||||
};
|
||||
remotePath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media";
|
||||
description = "Remote path to mount from the NFS server";
|
||||
};
|
||||
mountPoint = mkOption {
|
||||
type = types.str;
|
||||
default = "/media";
|
||||
description = "Local mount point for the NFS share";
|
||||
};
|
||||
# TODO: implement requireMount
|
||||
requireMount = mkOption {
|
||||
type = types.bool;
|
||||
@@ -18,8 +33,8 @@ in
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
fileSystems."/media" = {
|
||||
device = "10.0.0.43:/media";
|
||||
fileSystems.${cfg.mountPoint} = {
|
||||
device = "${cfg.server}:${cfg.remotePath}";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"defaults"
|
||||
|
||||
@@ -8,6 +8,21 @@ in
|
||||
{
|
||||
options.roles.printing = {
|
||||
enable = mkEnableOption "Enable default printing setup";
|
||||
printerName = mkOption {
|
||||
type = types.str;
|
||||
default = "MFC-L8900CDW_series";
|
||||
description = "Name for the default printer";
|
||||
};
|
||||
printerUri = mkOption {
|
||||
type = types.str;
|
||||
default = "ipp://brother.oglehome/ipp/print";
|
||||
description = "Device URI for the default printer (e.g., ipp://hostname/ipp/print)";
|
||||
};
|
||||
printerModel = mkOption {
|
||||
type = types.str;
|
||||
default = "everywhere";
|
||||
description = "PPD model for the printer (use 'everywhere' for driverless IPP)";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
@@ -21,11 +36,11 @@ in
|
||||
};
|
||||
|
||||
hardware.printers.ensurePrinters = [{
|
||||
name = "MFC-L8900CDW_series";
|
||||
deviceUri = "ipp://brother.oglehome/ipp/print";
|
||||
model = "everywhere";
|
||||
name = cfg.printerName;
|
||||
deviceUri = cfg.printerUri;
|
||||
model = cfg.printerModel;
|
||||
}];
|
||||
hardware.printers.ensureDefaultPrinter = "MFC-L8900CDW_series";
|
||||
hardware.printers.ensureDefaultPrinter = cfg.printerName;
|
||||
|
||||
# Fix ensure-printers service to wait for network availability
|
||||
systemd.services.ensure-printers = {
|
||||
|
||||
@@ -8,6 +8,11 @@ in
|
||||
{
|
||||
options.roles.virtualisation = {
|
||||
enable = mkEnableOption "Enable virtualisation";
|
||||
dockerUsers = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "johno" ];
|
||||
description = "List of users to add to the docker group";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
@@ -15,6 +20,6 @@ in
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
virtualisation.docker.enable = true;
|
||||
users.extraGroups.docker.members = [ "johno" ];
|
||||
users.extraGroups.docker.members = cfg.dockerUsers;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build Live USB ISO from flake configuration
|
||||
# Creates an uncompressed ISO suitable for Ventoy and other USB boot tools
|
||||
# Usage: nix run .#build-liveusb
|
||||
# Or: ./scripts/build-liveusb.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="${REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
|
||||
|
||||
echo "Building Live USB ISO..."
|
||||
nix build "${REPO_ROOT}#nixosConfigurations.live-usb.config.system.build.isoImage" --show-trace
|
||||
|
||||
if ls "${REPO_ROOT}/result/iso/"*.iso 1> /dev/null 2>&1; then
|
||||
iso_file=$(ls "${REPO_ROOT}/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
|
||||
Reference in New Issue
Block a user