Compare commits

..

48 Commits

Author SHA1 Message Date
88ea191493 Added labels to patitions in install script
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 23s
2025-04-24 23:44:48 +01:00
905fe12714 Added mount point to install command
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 23s
2025-04-24 21:14:32 +01:00
1954beb8cc Corrected mkdir command
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 22s
2025-04-24 21:12:10 +01:00
3353717da7 Added missing mkdir in install script
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 22s
2025-04-24 21:09:26 +01:00
2559cba6ff Added missing ; at and of line
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 21s
2025-04-24 21:06:06 +01:00
bd3eca6f69 Renamed application file
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 22s
2025-04-24 21:05:17 +01:00
132f860713 Enabled ZSH
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 22s
2025-04-24 21:04:32 +01:00
82e18d878b Updated config and install script to hopefully work with encryption
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 23s
2025-04-24 21:01:21 +01:00
702a23d79e Updated install script to correct install procedure
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 23s
2025-04-24 20:32:52 +01:00
015518753e Updated the install script to remove disk encryption
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 22s
2025-04-24 20:02:39 +01:00
e9416202dd Removed encryption on root partition
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 23s
2025-04-24 19:53:21 +01:00
3106cd4b62 Update monitor confuig
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 23s
2025-04-24 19:49:16 +01:00
7a4a74a673 Added actions
Some checks failed
NixOS Configuration Check / nixos-check (push) Failing after 27s
2025-03-21 14:27:24 +00:00
729d5eaefe Adjusted configs 2025-03-21 14:21:58 +00:00
91d1c698cf Still trying to get LUKS to work 2025-03-21 14:01:31 +00:00
a8147c6f05 Removed unrequired flag 2025-03-21 13:52:44 +00:00
9392afbb1e removed unwanted , 2025-03-21 13:51:53 +00:00
0bd101e1a2 Trying to get LUKS to work 2025-03-21 13:46:45 +00:00
8c6cfa275a Added additional kernel params for LUKS 2025-03-21 12:55:01 +00:00
fdb5a0afc4 Enabled systemd 2025-03-21 11:43:38 +00:00
df84387d13 Removed duplicate luks mounting 2025-03-21 10:59:21 +00:00
151264c66f Changed boot parameters after install 2025-03-21 10:51:45 +00:00
d4e0c6daf0 Corrected encrypted device to be the main partition 2025-03-21 10:46:01 +00:00
5c02580724 Removed unrequired config items 2025-03-21 10:41:16 +00:00
99732d8d23 Added support for initialising encrypted disk 2025-03-21 10:37:48 +00:00
3df2dd0922 Attempt to mount the boot partition by number instead of by label 2025-03-21 10:24:05 +00:00
ad3ab51ffe Renamed boot partition to be upper case 2025-03-21 10:19:38 +00:00
6fe4177dae Add in fetch utility 2025-03-21 10:16:28 +00:00
033768feae Corrected root filesystem partition in host config files 2025-03-21 01:45:45 +00:00
6d43261a16 Removed additional root password set 2025-03-21 01:42:48 +00:00
01a9588b81 Changed boot partition number 2025-03-21 01:35:26 +00:00
930f93b68d Trying to figure why this won't work!!! 2025-03-21 01:32:22 +00:00
679757e6f9 Trying to setup the installer but I am severely sleep deprived 2025-03-21 01:29:46 +00:00
6aabc00703 Changed install... looks like it is working now :O 2025-03-21 01:10:50 +00:00
74eaf03572 Trying to get correct disk formats 2025-03-21 01:02:02 +00:00
c35583ca3a Trying different permutations to get isntallation to work 2025-03-21 00:58:21 +00:00
681a0706f1 Added Changes to EFi install process 2025-03-21 00:54:13 +00:00
47a4441639 Use systemdboot insted of GRUB 2025-03-21 00:26:52 +00:00
d3e792fb52 Updated install scripts 2025-03-21 00:25:07 +00:00
2e2ca7c41e Added password change at the end of the install 2025-03-21 00:02:29 +00:00
4c3fdff8a2 Updated order of encryption 2025-03-20 23:33:28 +00:00
6971d6d9f2 Moved the luks encryption to before boot is mounted 2025-03-20 23:24:51 +00:00
ad1b628bce Properly enabled EFI and re-added encryption to the disk 2025-03-20 23:20:11 +00:00
4d4dff45ee Changed isntall order of nix files 2025-03-20 22:42:37 +00:00
e3acff7193 Removed shebanggg 2025-03-20 22:38:11 +00:00
66d2fefc7a Added correct flake to the installation 2025-03-20 22:33:23 +00:00
a378e909a1 Updated default disk as /dev/sda 2025-03-20 22:28:13 +00:00
759dabef33 Updated install script 2025-03-20 17:53:24 +00:00
10 changed files with 129 additions and 67 deletions

View File

@ -0,0 +1,29 @@
name: NixOS Configuration Check
on:
push:
branches:
- main
pull_request:
jobs:
nixos-check:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v22
- name: Show Nix version
run: nix --version
- name: Run nix flake check
run: nix flake check
- name: Attempt to build configuration (optional)
run: |
nix build .#nixosConfigurations.desktop.config.system.build.toplevel
nix build .#nixosConfigurations.laptop.config.system.build.toplevel
nix build .#nixosConfigurations.vm.config.system.build.toplevel

View File

@ -17,7 +17,7 @@
modules = [
./hosts/laptop.nix
./modules/common.nix
./modules/hyprland.nix
./modules/applications.nix
./modules/networking.nix
./modules/user.nix
];
@ -27,7 +27,7 @@
modules = [
./hosts/desktop.nix
./modules/common.nix
./modules/hyprland.nix
./modules/applications.nix
./modules/networking.nix
./modules/user.nix
];
@ -37,7 +37,7 @@
modules = [
./hosts/vm.nix
./modules/common.nix
./modules/hyprland.nix
./modules/applications.nix
./modules/networking.nix
./modules/user.nix
];

View File

@ -12,17 +12,10 @@
nvidiaSettings = true;
};
boot.initrd.luks.devices = {
root = {
device = "/dev/sda2";
preLVM = true;
};
};
# Dual display configuration
services.xserver = {
screenSection = ''
Option "metamodes" "HDMI-0: 1920x1080 +0+0, DP-0: 1920x1080 +1920+0"
Option "metamodes" "HDMI-0: 1920x1080 +0+1080, DP-0: 1920x1080 +1920+1080, DP-1: 2560x1440 +3840+0"
'';
};
}

View File

@ -6,19 +6,11 @@
# Intel VA-API for GPU acceleration
hardware.opengl = {
enable = true;
driSupport = true;
extraPackages = with pkgs; [
intel-media-driver
libva-utils
];
};
boot.initrd.luks.devices = {
root = {
device = "/dev/sda2";
preLVM = true;
};
};
services.xserver.videoDrivers = [ "intel" ];
}

View File

@ -6,14 +6,6 @@
# Use DHCP for networking
networking.useDHCP = true;
# Disk encryption setup
boot.initrd.luks.devices = {
root = {
device = "/dev/sda2";
preLVM = true;
};
};
# Hyprland setup without GPU acceleration
services.xserver.enable = true;
services.xserver.videoDrivers = [ ];

View File

@ -1,32 +1,53 @@
# Assuming /dev/sda is the target disk
parted /dev/sda -- mklabel gpt
#!/usr/bin/env bash
parted /dev/sda -- mkpart ESP fat32 1MiB 513MiB
parted /dev/sda -- set 1 boot on
set -euo pipefail
parted /dev/sda -- mkpart primary ext4 513MiB 100%
# Replace with your actual repo
REPO_URL="https://git.luke-else.co.uk/luke-else/nixos-config.git"
HOSTNAME="vm" # Change to desktop/laptop/vm if needed
TARGET_DISK="/dev/sda"
MOUNT_POINT="/mnt"
mkfs.fat -F32 -n BOOT /dev/sda1
mkfs.ext4 /dev/sda2
# Confirm before wiping the disk
echo "WARNING: This will erase ALL data on ${TARGET_DISK}!"
read -p "Type YES to continue: " confirm
[[ "$confirm" == "YES" ]] || { echo "Aborting."; exit 1; }
mount /dev/sda2 /mnt
cryptsetup luksFormat /dev/sda2
cryptsetup open /dev/sda2 root
mkfs.ext4 /dev/mapper/root
mount /dev/mapper/root /mnt
# 1. Wipe the disk and create new GPT partition table
wipefs -a "$TARGET_DISK"
parted -s "$TARGET_DISK" mklabel gpt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot
# 2. Create partitions
# - EFI (512M)
# - Root (rest of the disk)
parted -s "$TARGET_DISK" mkpart primary fat32 1MiB 513MiB
parted -s "$TARGET_DISK" set 1 esp on
parted -s "$TARGET_DISK" mkpart primary ext4 513MiB 100%
mkdir -p /mnt/etc/nixos
git clone https://git.luke-else.co.uk/luke-else/nixos-config.git /mnt/etc/nixos
EFI_PART="${TARGET_DISK}1"
CRYPT_PART="${TARGET_DISK}2"
nixos-generate-config --root /mnt
# 3. Format the EFI partition
mkfs.fat -F32 -n EFI "$EFI_PART"
nixos-install --flake /mnt/etc/nixos#vm
# 4. Set up LUKS encryption for root
echo "Setting up LUKS encryption on ${CRYPT_PART}"
cryptsetup luksFormat "$CRYPT_PART"
cryptsetup open "$CRYPT_PART" cryptroot
passwd
# 5. Format root and mount
mkfs.ext4 -L cryptroot /dev/mapper/cryptroot
mount /dev/mapper/cryptroot "$MOUNT_POINT"
reboot
# 6. Create and mount boot directory
mkdir -p "$MOUNT_POINT/boot"
mount "$EFI_PART" "$MOUNT_POINT/boot"
# sudo nixos-rebuild switch --flake ~/nixos-config#vm
# 7. Clone your NixOS config
mkdir -p "$MOUNT_POINT/etc/nixos"
git clone "$REPO_URL" "$MOUNT_POINT/etc/nixos"
# 8. Install NixOS
nixos-install --flake "$MOUNT_POINT/etc/nixos#${HOSTNAME}" --no-root-passwd
echo "✅ NixOS installation complete! You may now reboot."

View File

@ -1,11 +1,15 @@
{ config, pkgs, ... }:
{
programs.hyprland = {
enable = true;
xwayland.enable = true;
programs = {
zsh.enable = true;
ssh.startAgent = true;
hyprland = {
enable = true;
xwayland.enable = true;
};
};
services.displayManager = {
enable = true;
defaultSession = "hyprland";
@ -21,5 +25,11 @@
discordo
spotify-player
bitwarden
freshfetch # Fetch utility
git
cryptsetup
parted
vim
htop
];
}

View File

@ -1,30 +1,39 @@
{ config, pkgs, ... }:
{
# Bootloader
boot.loader.grub = {
enable = true;
device = "nodev";
efiSupport = true;
# Bootloader: systemd-boot with EFI support
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Use systemd-boot instead of GRUB
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
boot.initrd = {
supportedFilesystems = [ "ext4" ];
luks.devices."cryptroot".device = "/dev/disk/by-partlabel/cryptroot";
};
fileSystems."/" = {
device = "/dev/mapper/root";
device = "/dev/mapper/cryptroot";
fsType = "ext4";
};
swapDevices = [{ device = "/swapfile"; size = 4096; }];
fileSystems."/boot" = {
device = "/dev/disk/by-partlabel/ESP";
fsType = "vfat";
};
# Locales and timezone
swapDevices = [{
device = "/swapfile";
size = 4096;
}];
# Locale and timezone
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_GB.UTF-8";
# UFW Firewall
networking.firewall = {
enable = true;
allowedTCPPorts = [ 22 ]; # Allow SSH
};
# Enable SSH
services.openssh = {
enable = true;
@ -33,4 +42,16 @@
PasswordAuthentication = false;
};
};
# Enable Docker
virtualisation.docker.enable = true;
# PipeWire for audio
services.pipewire = {
enable = true;
pulse.enable = true;
};
# Bluetooth
services.blueman.enable = true;
}

View File

@ -10,6 +10,10 @@
};
};
};
firewall = {
enable = true;
allowedTCPPorts = [ 22 ]; # Allow SSH
};
useDHCP = true;
};
}

View File

@ -4,7 +4,7 @@
users.users."luke-else" = {
isNormalUser = true;
home = "/home/luke-else";
shell = pkgs.bash;
shell = pkgs.zsh;
extraGroups = [ "wheel" "networkmanager" "docker" ];
};