17 Commits

Author SHA1 Message Date
f53a2aceee chore(flake): update flake lock to the latest version 2026-03-04 17:10:18 +01:00
d64f10ad3f Merge pull request 'add docker to the system' (#23) from feature/docker into main
Reviewed-on: #23
2026-02-22 18:14:40 +01:00
cc44e68a2e feature(users): add docker group to the main user 2026-02-21 21:17:19 +01:00
b97d6cc47d feature(neon): add docker to neon 2026-02-21 21:16:42 +01:00
0d495039ee feature(docker): add docker daemon config for nixos 2026-02-21 21:16:17 +01:00
64b76ad7fd Merge pull request 'feature(ssh): add more security to the ssh config' (#22) from feature/openssh into main
Reviewed-on: #22
2026-02-21 18:09:31 +01:00
aea7ba5c97 feature(ssh): add more security to the ssh config 2026-02-21 18:04:47 +01:00
135f2bdac9 Merge pull request 'refactor(installguide): unify device naming, add notes and correct typos' (#21) from feature/installguide into main
Reviewed-on: #21
2026-02-21 17:56:00 +01:00
d288f6828f refactor(installguide): unify device naming, add notes and correct typos 2026-02-21 17:55:32 +01:00
159cd6f2f2 Merge pull request 'feature(update): update flake' (#20) from feature/update into main
Reviewed-on: #20
2026-02-19 21:01:57 +01:00
763a69bf09 feature(update): update flake 2026-02-19 20:53:18 +01:00
9b6ed91d37 Merge pull request 'feature(update): update flake' (#19) from feature/update into main
Reviewed-on: #19
2026-02-14 13:20:12 +00:00
39f7658a34 feature(update): update flake 2026-02-14 14:18:32 +01:00
50b2aaae60 Merge pull request 'refactor(readme): separate installation doc from main readme' (#18) from feature/documentation into main
Reviewed-on: #18
2026-02-08 10:17:27 +00:00
920b128ed7 refactor(readme): separate installation doc from main readme 2026-02-08 11:16:13 +01:00
978bd0e12b Merge pull request 'feature(update): update flake' (#17) from feature/update into main
Reviewed-on: #17
2026-02-08 10:01:27 +00:00
2ab6ccb7a0 feature(update): update flake 2026-02-08 11:00:01 +01:00
7 changed files with 211 additions and 140 deletions

118
INSTALLATION.md Normal file
View File

@@ -0,0 +1,118 @@
# basic system installation
- The installations presented in this repository are always luks encrypted
- For simplicity I'm using device labels rather than uuids
1. the partitioning layout should look somewhat like this after the installation
```bash
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 2G 0 part /boot
└─nvme0n1p2 259:2 0 474.9G 0 part
└─cryptroot 254:0 0 474.9G 0 crypt
├─lvmroot-swap 254:1 0 20G 0 lvm [SWAP]
├─lvmroot-home 254:2 0 250G 0 lvm /home
└─lvmroot-root 254:3 0 204.9G 0 lvm /
```
> Note: `lsblk` may additionally show `/nix/store` as a mountpoint on `lvmroot-root`. This is not a separate partition. NixOS mounts the root device a second time at `/nix/store` with `ro,nosuid,nodev` flags to enforce store immutability at runtime.
2. prepare the installation
```bash
# format the boot partition
mkfs.fat -F 32 /dev/nvme0n1p1 -n "nixboot"
# create an encrypted partition
cryptsetup luksFormat -y --label="nixcrypt" /dev/nvme0n1p2
# open the encrypted partition and map it to /dev/mapper/cryptroot
cryptsetup luksOpen /dev/nvme0n1p2 cryptroot
# create the physical volume
pvcreate /dev/mapper/cryptroot
# create a volume group inside
vgcreate lvmroot /dev/mapper/cryptroot
# create the swap volume
lvcreate --size 8G lvmroot --name swap
# if you desire, create a home volume
lvcreate --size 150G lvmroot --name home
# create the root volume
lvcreate -l 100%FREE lvmroot --name root
# format as usual for root partition
mkfs.ext4 -L "nixroot" /dev/mapper/lvmroot-root
# if you previously made the home partition, do it too
mkfs.ext4 -L "nixhome" /dev/mapper/lvmroot-home
# format the swap partition
mkswap -L "nixswap" /dev/mapper/lvmroot-swap
# mount root
mount /dev/disk/by-label/nixroot /mnt
# mount boot
mount --mkdir /dev/nvme0n1p1 /mnt/boot
# again, if you did the home volume
mount --mkdir /dev/disk/by-label/nixhome /mnt/home
# turn on swap
swapon /dev/disk/by-label/nixswap
```
3. prepare nixos
```bash
# generate templates and update the hardware-configuration.nix
nixos-generate-config --root /mnt
# add dm-crypt and dm-mod to the kernelModules
boot.initrd.kernelModules = [ "dm-crypt" "dm-mod" ];
# add file systems using labels
fileSystems."/" =
{ device = "/dev/disk/by-label/nixroot";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/nixboot";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-label/nixhome";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-label/nixswap"; }
];
# point the bootloader to the luks device
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt";
```
4. install nixos
```bash
nixos-install
```
## how to deploy the initial config
- Don't forget to install the bootloader, if you changed it since `nixos-install`
```bash
$ sudo nixos-rebuild --install-bootloader switch --flake .#host_name
```
## how to upgrade the system
```bash
$ cd /path/to/repo
$ nix flake update
$ sudo nixos-rebuild switch --flake .#host_name
$ sudo nix-collect-garbage
```
## how to use nix-helper
The tool nix-helper is installed by this configuration. It simplifies administrating nixos and adds more output to the rebuild command. It also features a diff after a successful build. The command uses the `NH_FLAKE` environment variable to be able to run from whatever directory.
Basic commands with a set `NH_FLAKE` variable are:
```bash
$ nh os switch
$ nh os build
$ nh os test
$ nh clean all --keep 5
```
There is also the option to interface with home-manager by using `nh home switch` but this isn't necessary since home-manager is imported as a module in this config.

143
README.md
View File

@@ -1,133 +1,30 @@
# 0x29a nixos config
# NixOS config
My personal nixos configuration files for different environments.
My personal NixOS configurations.
## basic system installation
- The installations presented in this repository are always luks encrypted
- For simplicity I'm using device labels rather than uuids
1. the partitioning layout should look somewhat like this after the installation
## config structure
```bash
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 2G 0 part /boot
└─nvme0n1p2 259:2 0 474.9G 0 part
└─cryptroot 254:0 0 474.9G 0 crypt
├─lvmroot-swap 254:1 0 20G 0 lvm [SWAP]
├─lvmroot-home 254:2 0 250G 0 lvm /home
└─lvmroot-root 254:3 0 204.9G 0 lvm /nix/store
.
├── flake.lock
├── flake.nix # flake definition
├── hosts
│   └── neon
│   ├── configuration.nix # import nix-modules for specific host
│   └── hardware-configuration.nix # hardware configs for specific host
├── modules
│   ├── home-manager
│   │   ├── xyz_module.nix
│   └── nixos
│   └── xyz_module.nix
└── users
└── aaron
└── home.nix # import home-manager modules for specific user
```
2. prepare the installation
## installation
```bash
# format the boot partition
mkfs.fat -F 32 /dev/sda1 -n "nixboot"
# create an encrypted partition
cryptsetup luksFormat -y --label="nixcrypt" /dev/sda2
# open the encrypted partition and map it to /dev/mapper/cryptroot
cryptsetup luksOpen /dev/sda2 cryptroot
# create the physical volume
pvcreate /dev/mapper/cryptroot
# create a volume group inside
vgcreate lvmroot /dev/mapper/cryptroot
# create the swap volume
lvcreate --size 8G lvmroot --name nwap
# if you desire, create a home volume
lvcreate --size 150G lvmroot --name home
# create the root volume
lvcreate -l 100%FREE lvmroot --name root
# format as usual for root partition
mkfs.ext4 -L "nixroot" /dev/mapper/lvmroot-root
# if you previously made the home partition, do it too
mkfs.ext4 -L "nixhome" /dev/mapper/lvmroot-home
# format the swap partition
mkswap -L "nixswap" /dev/mapper/lvmroot-swap
# mount root
mount /dev/disk/by-label/nixroot /mnt
# mount boot
mount --mkdir /dev/sda1 /mnt/boot
# again, if you did the home volume
mount --mkdir /dev/disk/by-label/nixhome /mnt/home
# turn on swap
swapon /dev/disk/by-label/nixswap
```
3. prepare nixos
```bash
# generate templates and update the hardware-configuration.nix
sudo nixos-generate-config --root /mnt
# add cryptd to the kernelModules
boot.initrd.kernelModules = [ "dm-snapshot" "cryptd" ];
# add file systems using labels
fileSystems."/" =
{ device = "/dev/disk/by-label/nixroot";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/nixboot";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-label/nixhome";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-label/nixswap"; }
];
# point the bootloader to the luks device
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt";
```
4. install nixos
```bash
cd /mnt
sudo nixos-install
```
## how to deploy the inital config
- Don't forget to install the bootloader, if you changed it since `nixos-install`
```bash
$ sudo nixos-rebuild --install-bootloader switch --flake .#host_name
```
## how to upgrade the system
```bash
$ cd /path/to/repo
$ sudo nix flake update
$ sudo nixos-rebuild switch --flake .#host_name
$ sudo nix-collect-garbage
```
## how to use nix-helper
The tool nix-helper is installed by this configuration. It simplifies administrating nixos and adds more output to the rebuild command. It also features a diff after a successful build. The command uses the `NH_FLAKE` environment variable to be able to run from whatever directory.
Basic commands with a set `NH_FLAKE` variable are:
```bash
$ nh os switch
$ nh os build
$ nh os test
$ nh clean all --keep 5
```
There is also the option to interface with home-manager by using `nh home switch`but this isn't necessary since home-manager is imported as a module in this config.
For more details about the installation procedure see: [INSTALLATION.md](INSTALLATION.md)
## author

54
flake.lock generated
View File

@@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"lastModified": 1769996383,
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
"type": "github"
},
"original": {
@@ -28,11 +28,11 @@
]
},
"locked": {
"lastModified": 1769872935,
"narHash": "sha256-07HMIGQ/WJeAQJooA7Kkg1SDKxhAiV6eodvOwTX6WKI=",
"lastModified": 1772633327,
"narHash": "sha256-jl+DJB2DUx7EbWLRng+6HNWW/1/VQOnf0NsQB4PlA7I=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f4ad5068ee8e89e4a7c2e963e10dd35cd77b37b7",
"rev": "5a75730e6f21ee624cbf86f4915c6e7489c74acc",
"type": "github"
},
"original": {
@@ -43,11 +43,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1769789167,
"narHash": "sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8=",
"lastModified": 1772542754,
"narHash": "sha256-WGV2hy+VIeQsYXpsLjdr4GvHv5eECMISX1zKLTedhdg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "62c8382960464ceb98ea593cb8321a2cf8f9e3e5",
"rev": "8c809a146a140c5c8806f13399592dbcb1bb5dc4",
"type": "github"
},
"original": {
@@ -66,11 +66,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1769644746,
"narHash": "sha256-1X9o0GjCzku03magX4pM+1OZXA0aUTN7KvEReZ9t3OU=",
"lastModified": 1772402258,
"narHash": "sha256-3DmCFOdmbkFML1/G9gj8Wb+rCCZFPOQtNoMCpqOF8SA=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "3c27e1b35ca0fee6a89bfc20840654361ffe888d",
"rev": "21ae25e13b01d3b4cdc750b5f9e7bad68b150c10",
"type": "github"
},
"original": {
@@ -83,14 +83,15 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
]
],
"noctalia-qs": "noctalia-qs"
},
"locked": {
"lastModified": 1769946076,
"narHash": "sha256-Iek7AHXTMzWi3U5EeCM1pygtvyANKY1Ax8WGn4FXh+Y=",
"lastModified": 1772639853,
"narHash": "sha256-u8/61CqpmQprdEiVYHnzZe1Ujv98+MRPJdFuAaOmp4c=",
"owner": "noctalia-dev",
"repo": "noctalia-shell",
"rev": "348763cc9645fb53bebde40fae9ec4122ee51b60",
"rev": "13dad396520b05691bf1fea1af11f94d3ce4142d",
"type": "github"
},
"original": {
@@ -99,6 +100,27 @@
"type": "github"
}
},
"noctalia-qs": {
"inputs": {
"nixpkgs": [
"noctalia",
"nixpkgs"
]
},
"locked": {
"lastModified": 1772227064,
"narHash": "sha256-f821ZSoGpa/aXrWq0gPpea9qBnX8KDyavGKkptz2Mog=",
"owner": "noctalia-dev",
"repo": "noctalia-qs",
"rev": "0741d27d2f7db567270f139c5d1684614ecf9863",
"type": "github"
},
"original": {
"owner": "noctalia-dev",
"repo": "noctalia-qs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",

View File

@@ -5,6 +5,7 @@
../../modules/nixos/audio.nix
../../modules/nixos/bootloader.nix
../../modules/nixos/certificates.nix
../../modules/nixos/docker.nix
../../modules/nixos/gnupg.nix
../../modules/nixos/locales.nix
../../modules/nixos/networking.nix

23
modules/nixos/docker.nix Normal file
View File

@@ -0,0 +1,23 @@
{ config, lib, pkgs, ...}:
{
virtualisation.docker = {
enable = true;
# Customize Docker daemon settings
daemon.settings = {
dns = [ "1.1.1.1" "8.8.8.8" ];
log-driver = "journald";
registry-mirrors = [ "https://mirror.gcr.io" ];
storage-driver = "overlay2";
};
# Use the rootless mode
rootless = {
enable = true;
setSocketVariable = true;
};
# Install docker-compose
extraPackages = with pkgs; [
docker-compose
];
};
}

View File

@@ -5,5 +5,15 @@
services.openssh = {
enable = true;
openFirewall = true;
ports = [ 666 ];
settings = {
AuthenticationMethods = "publickey";
KbdInteractiveAuthentication = false;
MaxAuthTries = 5;
PasswordAuthentication = false;
PermitRootLogin = "no";
X11Forwarding = false;
};
};
}

View File

@@ -5,7 +5,7 @@
users.users.aaron = {
isNormalUser = true;
group = "users";
extraGroups = [ "wheel" "networkmanager" ];
extraGroups = [ "wheel" "networkmanager" "docker" ];
shell = pkgs.zsh;
};