Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation, Libreoffice testing #49

Merged
merged 9 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 78 additions & 44 deletions docs/minimal-install.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,78 @@
## NixOS Minimal Install (Mini Guide)
You've loaded NixOS on a live USB to do a minimal install because the GUI is no fun, what now?

### 1. Connect to the Internet

a. Discover your wireless interface if you're not using ethernet.

```bash
ip link show
```

b. Initialise your `wpa_supplicant` with one of the following, run these commands with sudo privileges:

```bash
wpa_supplicant -B -i (your-interface-name) -c <(wpa_passphrase "SSID" "password")
```

OR - in the default NixOS installation home directory

```bash
wpa_passphrase "SSID" "password" > temp_wpa.conf

wpa_supplicant -B -i (your-interface-name) -c ~/temp_wpa.conf
```

`pkill wpa_supplicant` between any failed attempts to connect to the internet. Remember to `rm temp_wpa.conf` after successfully connecting.

### 2. Generate Your Hardware Specific .nix

a. Generate a basic configuration.nix and hardware-configuration.nix

```bash
nixos-generate-config
```

b. Edit your configuration.nix with nano or wget a configuration.nix from the internet *at your own risk*.

- Make sure to include a user and an internet connection method.
- Add your preferred text editor to the pkgs list.
- (Optionally) Add any programs and services you know you will need from the get go. There is no need to incrementally build your system but it's easier to figure out what's going wrong if you go slow.
- Save your changes.

### 3. `nixos-rebuild boot` To Launch NixOS for the First time

# NixOS Minimal Install - From Live ISO

The official NixOS.org site has very good documentation. This is a condensed version for myself.

https://nixos.org/manual/nixos/stable/#sec-booting-from-usb

## Create Installation Media
1. Flash the minimal image to a USB device from Linux
`sudo dd if=<nixos-minimal-image.iso> of=/path/to/usb bs=4M conf=fsync`
2. Boot from the USB on the target device
## Wireless Networking
1. Start wpa_supplicant > `sudo systemctl start wpa_supplicant`
2. Enable a wireless network > `wpa_cli`
```
add_network 0
set_network 0 ssid "SSID"
set_netwwork 0 psk "PSK"
set_network 0 key_mgmt WPA-PSK
enable_network 0
```
## Partition
1. `lsblk` - to identify connected drives
2. Format the disk > `sudo fdisk /dev/path-to-target`

3. Create a new GPT partition table > `g`
4. Create a new partition > `n`
5. Create the following structure at minimum
```
|-/dev/sda1 efi > t > 1
|-/dev/sda2 linux-filesystem
|-/dev/sda3 (optional)swap t > 19
```
6. Write changes to disk > `w`
## Format
1. For EFI > `sudo mkfs.fat -F 32 /dev/sda1`
2. For Primary > `sudo mkfs.ext4 /dev/sda2`
3. For swap > `sudo mkswap -L swap /dev/sda3` > `sudo swapon`
## Encrypted Primary
1. Format with LUKS > `cryptsetup luksFormat /dev/sda2`
2. Open with LUKS > `cryptsetup luksOpen /dev/sda2 cryptroot`
3. Format mapped cryptroot > `sudo mkfs.ext4 -L nixos /dev/mapper/cryptroot`
## Mounting
1. Mount the primary partition to `/mnt` > `sudo mount /dev/disk/by-label/nixos /mnt`
2. Make boot dir > `sudo mkdir -p /mnt/boot`
3. Mount boot > `sudo mount /dev/sda1 /mnt/boot`
## Generate configuration
1. Generate > `sudo nixos-generate-config --root /mnt`
2. Edit `configuration.nix` > `sudo nano /mnt/etc/nixos/configuration.nix`

## Minimal Configuration for wireless networking with wpa_supplicant
```
{ config, pkgs, ... }:
{
imports = [ ./hardware-configuration.nix ]

boot.loader.systemd-boot.enalbe = true;
boot.loader.efi.canTouchEfiVariables = true;

networking.wireless.enable = true;
networking.wireless.interface = [ "interface" ];
networking.wireless.userControlled.enable = true;

users.users.user = {
isNormalUser = true;
extraGroups = [ "wheel" ];
initialPassword = "temp123";
};
system.stateVersion = "23.05";
}
```
## Enable swap in hardware-configuration.nix
```
swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
```
## Install and reboot
1. Install > `sudo nixos-install`
2. You will be prompted for a root password afterwards.
3. Reboot > `sudo reboot`
1 change: 1 addition & 0 deletions modules/apps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
imports = [
./1password
./libreoffice
./browsing
./vscode
];
Expand Down
9 changes: 9 additions & 0 deletions modules/apps/libreoffice/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
libreoffice-qt
hunspell
hunspellDicts.en_CA
hunspellDicts.en_US
];
}
4 changes: 1 addition & 3 deletions modules/core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ in
{
imports = [
./boot/systemd
./terminal
./security
./terminal
];

home-manager.users.${username} = { pkgs, ... }: {
Expand All @@ -20,8 +20,6 @@ in
# Allow unfree packages
nixpkgs.config.allowUnfree = true;



environment.systemPackages = corePackages ++ devPackages;

# Dont change.
Expand Down
2 changes: 2 additions & 0 deletions modules/core/pkgs/dev/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ with pkgs; [
gnumake
go
nim
nix-melt
nix-prefetch-git
nodejs_20
powershell
postgresql_15
python312
thokr
zig
]

Loading