initial commit
This commit is contained in:
commit
c094b5770c
113 changed files with 6879 additions and 0 deletions
45
hosts/nuc8/README.md
Normal file
45
hosts/nuc8/README.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# Windows 10 installation
|
||||
|
||||
> Important: Install Windows 10 *before* NixOS
|
||||
|
||||
Before setup, press `SHIFT+F10`. Then, enter the following commands in the terminal window:
|
||||
|
||||
```
|
||||
diskpart
|
||||
```
|
||||
|
||||
Get your drive number with:
|
||||
|
||||
```
|
||||
list disk
|
||||
```
|
||||
|
||||
> most likely `0`
|
||||
|
||||
```
|
||||
select disk 0
|
||||
clean
|
||||
convert gpt
|
||||
|
||||
create partition efi size=1024
|
||||
format quick fs=fat32 label="System"
|
||||
|
||||
create partition msr size=16
|
||||
|
||||
create partition primary
|
||||
shrink minimum=1024
|
||||
format quick fs=ntfs label="Windows"
|
||||
|
||||
create partition primary
|
||||
format quick fs=ntfs label="Recovery"
|
||||
|
||||
exit
|
||||
```
|
||||
|
||||
Close the terminal and proceed as usual.
|
||||
|
||||
After booting into your finished Windows installation, resize the C drive to make some space for your Linux root and swap partitions.
|
||||
|
||||
# NixOS config
|
||||
|
||||
See [*Autodetection with systemd-boot*](https://nixos.wiki/wiki/Dual_Booting_NixOS_and_Windows).
|
||||
7
hosts/nuc8/boot.nix
Normal file
7
hosts/nuc8/boot.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
boot.loader.systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 10;
|
||||
};
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
}
|
||||
46
hosts/nuc8/default.nix
Normal file
46
hosts/nuc8/default.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ inputs, outputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./hardware.nix
|
||||
./packages.nix
|
||||
|
||||
../../users/sid
|
||||
|
||||
inputs.synix.nixosModules.bluetooth
|
||||
inputs.synix.nixosModules.common
|
||||
inputs.synix.nixosModules.device.desktop
|
||||
inputs.synix.nixosModules.hyprland
|
||||
inputs.synix.nixosModules.openssh
|
||||
inputs.synix.nixosModules.virtualisation
|
||||
|
||||
outputs.nixosModules.common
|
||||
outputs.nixosModules.docs
|
||||
];
|
||||
|
||||
networking.hostName = "nuc8";
|
||||
|
||||
services = {
|
||||
openssh.enable = true;
|
||||
pipewire.enable = true;
|
||||
};
|
||||
|
||||
normalUsers = {
|
||||
sid = {
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"floppy"
|
||||
"input"
|
||||
"libvirtd"
|
||||
"lp"
|
||||
"networkmanager"
|
||||
"video"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
time.hardwareClockInLocalTime = true; # Windows compatibility
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
}
|
||||
49
hosts/nuc8/disks.sh
Normal file
49
hosts/nuc8/disks.sh
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SSD='/dev/disk/by-id/nvme-Micron_MTFDHBA512TDV_21212F5AAB85'
|
||||
MNT='/mnt'
|
||||
SWAP_GB=16
|
||||
|
||||
# Helper function to wait for devices
|
||||
wait_for_device() {
|
||||
local device=$1
|
||||
echo "Waiting for device: $device ..."
|
||||
while [[ ! -e $device ]]; do
|
||||
sleep 1
|
||||
done
|
||||
echo "Device $device is ready."
|
||||
}
|
||||
|
||||
if ! command -v sgdisk &> /dev/null; then
|
||||
nix-env -iA nixos.gptfdisk
|
||||
fi
|
||||
|
||||
swapoff --all
|
||||
udevadm settle
|
||||
|
||||
wait_for_device $SSD
|
||||
|
||||
echo "Partitioning $SSD..."
|
||||
sgdisk -n5:0:+"$SWAP_GB"G -t5:8200 -c5:SWAP $SSD
|
||||
sgdisk -n6:0:0 -t6:8304 -c6:ROOT $SSD
|
||||
partprobe -s $SSD
|
||||
udevadm settle
|
||||
|
||||
wait_for_device ${SSD}-part1 # Windows ESP
|
||||
wait_for_device ${SSD}-part5
|
||||
wait_for_device ${SSD}-part6
|
||||
|
||||
echo "Formatting partitions..."
|
||||
mkswap -L SWAP "${SSD}-part5"
|
||||
mkfs.ext4 -L ROOT "${SSD}-part6"
|
||||
|
||||
echo "Mounting partitions..."
|
||||
mount -o X-mount.mkdir "${SSD}-part6" "$MNT"
|
||||
mkdir -p "$MNT/boot"
|
||||
mount "${SSD}-part1" "$MNT/boot"
|
||||
|
||||
echo "Enabling swap..."
|
||||
swapon "${SSD}-part5"
|
||||
|
||||
echo "Partitioning and setup complete:"
|
||||
lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
|
||||
49
hosts/nuc8/hardware.nix
Normal file
49
hosts/nuc8/hardware.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"rtsx_pci_sdmmc"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/ROOT";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/SYSTEM";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-label/SWAP"; }
|
||||
];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
8
hosts/nuc8/packages.nix
Normal file
8
hosts/nuc8/packages.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue