mirror of
https://gitlab.com/ahoneybun/nyxi-installer.git
synced 2025-05-12 11:04:02 -06:00
add Plasma config
This commit is contained in:
commit
0191e13168
5 changed files with 179 additions and 28 deletions
|
@ -4,6 +4,8 @@ This installer does the following at it's core:
|
||||||
|
|
||||||
- Partition the drive of your choice
|
- Partition the drive of your choice
|
||||||
- Installs a base of NixOS
|
- Installs a base of NixOS
|
||||||
|
- Installs Plasma
|
||||||
|
- Installs needed packages
|
||||||
|
|
||||||
Tested on the following drives:
|
Tested on the following drives:
|
||||||
- SATA
|
- SATA
|
||||||
|
@ -32,8 +34,9 @@ The following will happen:
|
||||||
- Clear partition table for `/dev/***`.
|
- Clear partition table for `/dev/***`.
|
||||||
- Creates a GPT partition table for `/dev/***`.
|
- Creates a GPT partition table for `/dev/***`.
|
||||||
- Create a +512M EFI partiton at `/dev/***1`.
|
- Create a +512M EFI partiton at `/dev/***1`.
|
||||||
- Create a encrypted root partition at `/dev/***2`.
|
- Create a encrypted LVM at `/dev/***2`.
|
||||||
- Create a swap partition at `/dev/***3` with the choice to set it as the same size as the RAM.
|
- Create a swap partition in the LVM with the choice to set it as the same size as the RAM.
|
||||||
|
- Create a root partition in the LVM.
|
||||||
- Install systemd-boot.
|
- Install systemd-boot.
|
||||||
|
|
||||||
## After Installation ...
|
## After Installation ...
|
||||||
|
|
|
@ -13,8 +13,18 @@
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.initrd.luks.devices = {
|
||||||
|
crypt-root = {
|
||||||
|
device = "/dev/disk/by-label/luks";
|
||||||
|
preLVM = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable 32 Bit libraries for applications like Steam
|
||||||
|
hardware.opengl.driSupport32Bit = true;
|
||||||
|
|
||||||
# Name your host machine
|
# Name your host machine
|
||||||
networking.hostName = "NixOS-VM";
|
networking.hostName = "NixOS";
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "America/Denver";
|
time.timeZone = "America/Denver";
|
||||||
|
@ -22,6 +32,15 @@
|
||||||
# Enter keyboard layout
|
# Enter keyboard layout
|
||||||
services.xserver.layout = "us";
|
services.xserver.layout = "us";
|
||||||
|
|
||||||
|
# Enable flatpak
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
|
||||||
|
# Enable PackageKit for Discover
|
||||||
|
services.packagekit.enable = true;
|
||||||
|
|
||||||
|
# Enable fwupd
|
||||||
|
services.fwupd.enable = true;
|
||||||
|
|
||||||
# Define user accounts
|
# Define user accounts
|
||||||
users.extraUsers =
|
users.extraUsers =
|
||||||
{
|
{
|
||||||
|
@ -37,15 +56,26 @@
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
thunderbird
|
|
||||||
firefox
|
firefox
|
||||||
fish
|
fish
|
||||||
|
flatpak
|
||||||
|
git
|
||||||
|
thunderbird
|
||||||
tilix
|
tilix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable the OpenSSH daemon
|
# Enable the OpenSSH daemon
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Enable Pipewire
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# GNOME
|
# GNOME
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
services.xserver.displayManager.gdm.enable = true;
|
services.xserver.displayManager.gdm.enable = true;
|
||||||
|
|
86
config-plasma.nix
Normal file
86
config-plasma.nix
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Import other configuration modules
|
||||||
|
# (hardware-configuration.nix is autogenerated upon installation)
|
||||||
|
# paths in nix expressions are always relative the file which defines them
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd.luks.devices = {
|
||||||
|
crypt-root = {
|
||||||
|
device = "/dev/disk/by-label/luks";
|
||||||
|
preLVM = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable 32 Bit libraries for applications like Steam
|
||||||
|
hardware.opengl.driSupport32Bit = true;
|
||||||
|
|
||||||
|
# Name your host machine
|
||||||
|
networking.hostName = "NixOS";
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "America/Denver";
|
||||||
|
|
||||||
|
# Enter keyboard layout
|
||||||
|
services.xserver.layout = "us";
|
||||||
|
|
||||||
|
# Enable flatpak
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
|
||||||
|
# Enable PackageKit for Discover
|
||||||
|
services.packagekit.enable = true;
|
||||||
|
|
||||||
|
# Enable fwupd
|
||||||
|
services.fwupd.enable = true;
|
||||||
|
|
||||||
|
# Define user accounts
|
||||||
|
users.extraUsers =
|
||||||
|
{
|
||||||
|
aaronh =
|
||||||
|
{
|
||||||
|
home = "/home/aaronh";
|
||||||
|
extraGroups = [ "wheel" "networkmanager" ];
|
||||||
|
isNormalUser = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Install some packages
|
||||||
|
environment.systemPackages =
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
|
firefox
|
||||||
|
fish
|
||||||
|
flatpak
|
||||||
|
git
|
||||||
|
thunderbird
|
||||||
|
tilix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Enable Pipewire
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable CUPS
|
||||||
|
services.printing.enable = true;
|
||||||
|
|
||||||
|
# System
|
||||||
|
system.autoUpgrade.enable = true;
|
||||||
|
system.autoUpgrade.allowReboot = true;
|
||||||
|
|
||||||
|
}
|
67
install.sh
67
install.sh
|
@ -21,8 +21,6 @@ echo +512M # Set +512M as last sector.
|
||||||
echo n # Create new partition (for root).
|
echo n # Create new partition (for root).
|
||||||
echo # Set default partition number.
|
echo # Set default partition number.
|
||||||
echo # Set default first sector.
|
echo # Set default first sector.
|
||||||
echo "-$ramTotal"G # Set Max RAM as last sector.
|
|
||||||
# echo -4096M # Set -4096 as last sector.
|
|
||||||
echo n # Create new partition (for swap).
|
echo n # Create new partition (for swap).
|
||||||
echo # Set default partition number.
|
echo # Set default partition number.
|
||||||
echo # Set default first sector.
|
echo # Set default first sector.
|
||||||
|
@ -30,9 +28,6 @@ echo # Set default last sector (rest of the disk).
|
||||||
echo t # Change partition type.
|
echo t # Change partition type.
|
||||||
echo 1 # Pick first partition.
|
echo 1 # Pick first partition.
|
||||||
echo 1 # Change first partition to EFI system.
|
echo 1 # Change first partition to EFI system.
|
||||||
echo t # Change partition type.
|
|
||||||
echo 3 # Pick third partition.
|
|
||||||
echo 19 # Change third partition to Linux swap.
|
|
||||||
echo w # write changes.
|
echo w # write changes.
|
||||||
) | sudo fdisk $driveName -w always -W always
|
) | sudo fdisk $driveName -w always -W always
|
||||||
|
|
||||||
|
@ -49,9 +44,8 @@ echo ""
|
||||||
echo "Which is the root partition?"
|
echo "Which is the root partition?"
|
||||||
read rootName
|
read rootName
|
||||||
|
|
||||||
echo ""
|
# Create EFI partition
|
||||||
echo "Which is the swap partition?"
|
sudo mkfs.fat -F32 -n EFI $efiName
|
||||||
read swapName
|
|
||||||
|
|
||||||
# Encrypt the root partition
|
# Encrypt the root partition
|
||||||
sudo cryptsetup luksFormat -v -s 512 -h sha512 $rootName
|
sudo cryptsetup luksFormat -v -s 512 -h sha512 $rootName
|
||||||
|
@ -59,34 +53,59 @@ sudo cryptsetup luksFormat -v -s 512 -h sha512 $rootName
|
||||||
# Open the encrypted root partition
|
# Open the encrypted root partition
|
||||||
sudo cryptsetup luksOpen $rootName crypt-root
|
sudo cryptsetup luksOpen $rootName crypt-root
|
||||||
|
|
||||||
sudo mkfs.fat -F32 -n EFI $efiName # EFI partition
|
sudo pvcreate /dev/mapper/crypt-root
|
||||||
sudo mkfs.ext4 -L root /dev/mapper/crypt-root # / partition
|
sudo vgcreate lvm /dev/mapper/crypt-root
|
||||||
sudo mkswap -L swap $swapName # swap partition
|
|
||||||
|
sudo lvcreate --size "$ramTotal"G --name swap lvm
|
||||||
|
sudo lvcreate --extents 100%FREE --name root lvm
|
||||||
|
|
||||||
|
sudo cryptsetup config $rootName --label luks
|
||||||
|
|
||||||
|
sudo mkswap /dev/lvm/swap # swap partition
|
||||||
|
sudo mkfs.btrfs -L root /dev/lvm/root # /root partition
|
||||||
|
|
||||||
# 0. Mount the filesystems.
|
# 0. Mount the filesystems.
|
||||||
sudo mount /dev/disk/by-label/root /mnt
|
sudo swapon /dev/lvm/swap
|
||||||
sudo swapon $swapName
|
sudo mount /dev/lvm/root /mnt
|
||||||
|
|
||||||
# 1. Create directory to mount EFI partition.
|
# Create Subvolumes
|
||||||
|
sudo btrfs subvolume create /mnt/@
|
||||||
|
sudo btrfs subvolume create /mnt/@home
|
||||||
|
|
||||||
|
# Unmount root
|
||||||
|
sudo umount /mnt
|
||||||
|
|
||||||
|
# Mount the subvolumes.
|
||||||
|
sudo mount -o noatime,commit=120,compress=zstd:10,space_cache,subvol=@ /dev/lvm/root /mnt
|
||||||
|
|
||||||
|
sudo mkdir /mnt/home/
|
||||||
|
sudo mount -o noatime,commit=120,compress=zstd:10,space_cache,subvol=@home /dev/lvm/root /mnt/home
|
||||||
|
|
||||||
|
# Mount the EFI partition.
|
||||||
sudo mkdir /mnt/boot/
|
sudo mkdir /mnt/boot/
|
||||||
|
|
||||||
# 2.Mount the EFI partition.
|
|
||||||
sudo mount $efiName /mnt/boot
|
sudo mount $efiName /mnt/boot
|
||||||
|
|
||||||
# Generate Nix configuration
|
# Generate Nix configuration
|
||||||
sudo nixos-generate-config --root /mnt
|
sudo nixos-generate-config --root /mnt
|
||||||
|
|
||||||
curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/main/config-gnome.nix > configuration.nix; sudo mv -f configuration.nix /mnt/etc/nixos/
|
curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/main/config-plasma.nix > configuration.nix; sudo mv -f configuration.nix /mnt/etc/nixos/
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
sudo nixos-install
|
sudo nixos-install
|
||||||
|
|
||||||
# Enter into installed OS
|
# Start Setup section
|
||||||
# sudo mount -o bind /dev /mnt/dev
|
# sudo -i
|
||||||
# sudo mount -o bind /proc /mnt/proc
|
# curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/main/setup.sh > /mnt/setup.sh
|
||||||
# sudo mount -o bind /sys /mnt/sys
|
|
||||||
# sudo chroot /mnt /nix/var/nix/profiles/system/activate
|
|
||||||
# sudo chroot /mnt /run/current-system/sw/bin/bash
|
|
||||||
|
|
||||||
# Removed downloaded script.
|
# Enter into installed OS
|
||||||
|
sudo mount -o bind /dev /mnt/dev
|
||||||
|
sudo mount -o bind /proc /mnt/proc
|
||||||
|
sudo mount -o bind /sys /mnt/sys
|
||||||
|
sudo chroot /mnt /nix/var/nix/profiles/system/activate
|
||||||
|
sudo chroot /mnt /run/current-system/sw/bin/sh setup.sh
|
||||||
|
|
||||||
|
# Removed install script.
|
||||||
rm install.sh
|
rm install.sh
|
||||||
|
|
||||||
|
# Remove setup script
|
||||||
|
rm setup.sh
|
||||||
|
|
13
setup.sh
Normal file
13
setup.sh
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# Set user password
|
||||||
|
echo "----------"
|
||||||
|
echo ""
|
||||||
|
echo "Which is the username?"
|
||||||
|
read userName
|
||||||
|
|
||||||
|
sudo passwd $userName
|
||||||
|
|
||||||
|
# Create Directories
|
||||||
|
mkdir /home/$userName/Projects
|
||||||
|
chmod $userName:$userName /home/aaronh/Projects
|
||||||
|
|
||||||
|
exit
|
Loading…
Add table
Add a link
Reference in a new issue