repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
_hardware-configuration.nixNix39 lines1.4 KiBraw download
# modules/hosts/generic/_hardware-configuration.nix — REPLACE THIS FILE with
# your machine's own, generated by the installer:
#
#   nixos-generate-config --root /mnt --show-hardware-configuration \
#     > modules/hosts/generic/_hardware-configuration.nix
#
# (on an already-installed NixOS: drop `--root /mnt`, or copy
# /etc/nixos/hardware-configuration.nix here.)
#
# What is below is only a placeholder so the flake evaluates before you have
# done that: it assumes the partitions are labelled `nixos` (root, ext4) and
# `boot` (the EFI system partition; BIOS installs have none), which is what
# docs/install.md creates. Follow that guide exactly and this file also works
# unchanged — but a generated one is always the safer choice.
{ lib, modulesPath, settings, ... }:
{
  imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

  boot.initrd.availableKernelModules = [
    # Bare metal: NVMe, SATA, USB. VMs: virtio, VMware, Hyper-V, VirtualBox.
    "nvme" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sr_mod"
    "virtio_pci" "virtio_blk" "virtio_scsi" "vmw_pvscsi" "hv_storvsc"
  ];

  fileSystems."/" = {
    device = "/dev/disk/by-label/nixos";
    fsType = "ext4";
  };

  fileSystems."/boot" = lib.mkIf (settings.boot == "efi") {
    device = "/dev/disk/by-label/boot";
    fsType = "vfat";
    options = [ "fmask=0077" "dmask=0077" ];
  };

  swapDevices = [ ];

  networking.useDHCP = lib.mkDefault true;
}