Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gytis-ivaskevicius/nixfiles
My kick-ass NixOS systems configurations!!
https://github.com/gytis-ivaskevicius/nixfiles
nix nix-dotfiles nixos sway zfs
Last synced: 7 days ago
JSON representation
My kick-ass NixOS systems configurations!!
- Host: GitHub
- URL: https://github.com/gytis-ivaskevicius/nixfiles
- Owner: gytis-ivaskevicius
- License: mit
- Created: 2020-04-05T17:03:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T11:08:35.000Z (6 months ago)
- Last Synced: 2024-08-03T13:06:25.456Z (3 months ago)
- Topics: nix, nix-dotfiles, nixos, sway, zfs
- Language: Nix
- Homepage:
- Size: 9.14 MB
- Stars: 136
- Watchers: 7
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A highly awesome system configuration
[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)### File structure
1. `config` - Main system configuration. `base-desktop.nix` contains lots of useful defaults.
2. `home-manager` - Holds most of the desktop configuration.
3. `modules` - A couple of custom options.
4. `overlays` - Contains riced and custom packages. Riced packages have the name prefix `g-`.
5. `hosts` - Contains host specific configuration.
6. `flake.nix` - Kickass flake config ;)# ZFS Cheatsheet
## Create pool
```bash
zpool create -o ashift=12 -o autotrim=on -O compression=zstd -O acltype=posixacl -O xattr=sa -O atime=off -O mountpoint=legacy zroot sdx2# with two mirrored drives
zpool create -o ashift=12 -o autotrim=on -O compression=zstd -O acltype=posixacl -O xattr=sa -O atime=off -O mountpoint=legacy zroot mirror sdx2 sdy2
```- `autotrim` - Should be omitted for non-SSD storage.
- `ashift` - Requires research. this setting is device-specific, and many drives will lie.## Setup partitions
```bash
mkfs.vfat -n BOOT -F32 /dev/sdx1
parted /dev/sdx set 1 boot onmkdir /mnt/{home,boot,nix}
zfs create -o encryption=on -o keyformat=passphrase zroot/locker
zfs create zroot/locker/home
zfs create zroot/locker/nix
zfs create zroot/locker/osmount -t zfs zroot/locker/os /mnt
mount -t zfs zroot/locker/home /mnt/home
mount -t zfs zroot/locker/nix /mnt/nix
mount /dev/sdx1 /mnt/boot
```## NixOS config
```nix
{
# needed for zfs. 4 random bytes (in hex)
networking.hostId = "12345678";# or nicer implementation
networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);# nixos documentation recommends setting these to false
boot = {
zfs.forceImportAll = false;
zfs.forceImportRoot = false;
};
}
```## unmount and export all zfs stuff before leaving the live installer!!!
```bash
zpool export zroot
```