2023-05-07 23:31:22 +08:00
|
|
|
# NixOS & Home-Manager Configuration
|
|
|
|
|
|
|
|
My [NixOS](https://nixos.org/) and [Home-Manager](https://github.com/nix-community/home-manager) config files.
|
|
|
|
Based upon [Misterio77's starter configs](https://github.com/Misterio77/nix-starter-configs).
|
|
|
|
|
|
|
|
> This repo is often neglected and doesn't necesarrily follow best practices.
|
|
|
|
> I recommend only using this repo for inspiration and instead use this
|
|
|
|
> [boilerplate](https://github.com/Misterio77/nix-starter-configs/tree/main/standard)
|
|
|
|
|
2024-08-05 09:21:40 +08:00
|
|
|
## Preview
|
2024-01-18 22:54:39 +08:00
|
|
|
![screenshot](assets/2024-01-18-224416_4480x1440_scrot.png)
|
|
|
|
|
2024-08-05 09:21:40 +08:00
|
|
|
## Features
|
|
|
|
* __Opt-in persistance with ephermeral btrfs.__
|
|
|
|
* __Secrets managed with agenix and rekeyed with yubikey.__
|
|
|
|
* __Standalone nixvim configuration for neovim.__
|
|
|
|
* __Custom haskell packages for xmonad & xmobar.__
|
|
|
|
* __Declarative minecraft server with nix-minecraft.__
|
|
|
|
* __Borgbackup of mutable service/container data.__
|
|
|
|
* __Media server with typical *arr stack.__
|
|
|
|
* __FQDN with private DNS for all internal services.__
|
|
|
|
* __Crowdsecurity for all public services.__
|
|
|
|
|
2023-05-07 23:31:22 +08:00
|
|
|
## Installation
|
2024-01-20 15:28:41 +08:00
|
|
|
```sh
|
|
|
|
# Prepare disks, create an EFI System partition and Linux Filesystem partition
|
|
|
|
fdisk /dev/nvme0n1
|
2023-05-07 23:31:22 +08:00
|
|
|
|
2024-01-20 15:28:41 +08:00
|
|
|
# Create our filesystems
|
|
|
|
mkfs.fat -F32 -n ESP /dev/nvme0n1p1
|
|
|
|
mkfs.btrfs -L ${hostname} /dev/nvme0n1p2
|
2024-01-18 22:28:36 +08:00
|
|
|
|
2024-01-20 15:28:41 +08:00
|
|
|
# Create our subvolumes
|
|
|
|
mount /dev/nvme0n1p2 /mnt/btrfs
|
|
|
|
btrfs subvolume create /mnt/btrfs/{root,nix,persist,swap}
|
|
|
|
umount /mnt/btrfs
|
2024-01-18 22:28:36 +08:00
|
|
|
|
2024-01-20 15:28:41 +08:00
|
|
|
# Prepare for installation
|
|
|
|
mount -o compress=zstd,subvol={root,nix,persist,swap} /dev/nvme0n1p2 /mnt/{nix,persist,swap}
|
|
|
|
mount /dev/nvme0n1p1 /mnt/boot
|
2024-01-18 22:28:36 +08:00
|
|
|
|
2024-01-20 15:28:41 +08:00
|
|
|
# Clone the configuration files and enter repo
|
|
|
|
git clone https://github.com/sajenim/dotfiles.nix.git && cd dotfiles.nix
|
2024-01-18 22:28:36 +08:00
|
|
|
|
2024-01-20 15:28:41 +08:00
|
|
|
# Install our system configuration
|
|
|
|
nixos-install --flake .#hostname
|
|
|
|
```
|
2023-05-07 23:31:22 +08:00
|
|
|
|
|
|
|
## FAQ
|
|
|
|
* **What is nix?**
|
|
|
|
Nix is a tool that takes a unique approach to package management and system configuration.
|
|
|
|
* **Nix benefits**
|
|
|
|
Nix is reproducible, declarative and reliable.
|
|
|
|
* **Why flakes?**
|
|
|
|
Flakes allow you to specify your code's dependencies (e.g. remote Git repositories) in a declarative way,
|
|
|
|
simply by listing them inside a flake.nix file.
|
|
|
|
|
|
|
|
## Credit
|
|
|
|
### Boilerplate
|
|
|
|
* [Misterio77/nix-starter-configs](https://github.com/Misterio77/nix-starter-configs)
|
|
|
|
### Other Configs
|
|
|
|
* [fortuneteller2k/nix-config](https://github.com/fortuneteller2k/nix-config)
|
2023-07-07 22:44:36 +08:00
|
|
|
* [javacafe01/nix-config](https://github.com/javacafe01/nix-config)
|