Skip to content
/ nixcfg Public

Nix configurations for various home laptops, desktops, and servers

License

Notifications You must be signed in to change notification settings

tcarrio/nixcfg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tom's [Nix] Configurations

This repository contains a Nix Flake for configuring my computers and home environment. These are the computers this configuration currently manages:

Hostname OEM Model OS Role Status
sktc0 Apple Apple M1 Pro macOS Laptop Done
glass DIY AMD Ryzen 9 3900X NixOS Desktop Done
kuroi Dell Dell Latitute E5470 NixOS Laptop Done
nuc0 Intel Pentium N3700 NixOS Server TBD
nuc1 Intel Pentium N3700 NixOS Server TBD
nuc2 Intel Pentium N3700 NixOS Server TBD
nuc3 Intel Pentium N3700 NixOS Server TBD
nuc4 Intel Pentium N3700 NixOS Server TBD
nuc5 Intel Pentium N3700 NixOS Server TBD
nuc6 Intel Pentium N3700 NixOS Server TBD
nuc7 Intel Pentium N3700 NixOS Server TBD
nuc8 Intel Pentium N3700 NixOS Server TBD
nuc9 Intel Pentium N3700 NixOS Server TBD
rpi2 Raspberry Pi Raspberry Pi 2 NixOS Server WIP
shiroi DIY Celeron G1610T NixOS Server TBD
tegra0 Nvidia Tegra K1 NixOS Server TBD
tegra1 Nvidia Tegra K1 NixOS Server TBD
tegra2 Nvidia Tegra K1 NixOS Server TBD
tegra3 Nvidia Tegra K1 NixOS Server TBD
tegra4 Nvidia Tegra K1 NixOS Server TBD
t510 Lenovo Thinkpad T510 NixOS Laptop Done

Respects

This project was forked from Wimpy's nixcfg repository, which you can find here. There is plenty of documentation to update so you will see plenty that is out of date here.

Structure

The nixos/mixins and home-manager/mixins are a collection of composited configurations based on the arguments defined in flake.nix.

Installing πŸ’Ύ

  • Boot off a .iso image created by this flake using rebuild-iso-desktop or rebuild-iso-console (see below)
  • Put the .iso image on a USB drive
  • Boot the target computer from the USB drive
  • Two installation options are available:
    1. Use the graphical Calamares installer to install an adhoc system
    2. Run install-system <hostname> <username> from a terminal
      • The install script uses Disko to automatically partition and format the disks, then uses my flake via nixos-install to complete a full-system installation
      • This flake is copied to the target user's home directory as ~/0xc/nixcfg
  • Make a cuppa πŸ«–
  • Reboot
  • Login and run rebuild-home (see below) from a terminal to complete the Home Manager configuration.

If the target system is booted from something other than the .iso image created by this flake, you can still install the system using the following:

curl -sL https://raw.githubusercontent.com/tcarrio/nixcfg/main/scripts/install.sh | bash -s <hostname> <username> <type>

Installing Raspberry Pi 2 (WIP)

TBD.

For now, build the image with:

nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./sdcard/rpi2.nix
# outputs to ${REPO_DIR}/result
zstdcat ./result/sd-image/nixos-sd-image-*-aarch64-linux.img.zst | dd bs=1M iflag=fullblock of=/dev/sde status=progress

Installing macOS (WIP)

The nix-darwin project provides support for managing macOS systems with Nix in a similar fashion to NixOS. With this, we can ensure that the system has everything we need available and that we can reproduce a working development environment with minimal overhead.

Applying Changes ✨

I clone this repo to ~/0xc/nixcfg. NixOS and Home Manager changes are applied separately because I have some non-NixOS hosts.

git clone git@github:tcarrio/nixcfg ~/0xc/nixcfg

NixOS ❄️

A rebuild-host alias is provided that does the following:

sudo nixos-rebuild switch --flake $HOME/0xc/nixcfg

Home Manager 🏠️

A rebuild-home alias is provided that does the following:

home-manager switch -b backup --flake $HOME/0xc/nixcfg

ISO πŸ“€

Aliases for rebuild-iso-desktop (desktop) and rebuild-iso-console (console only) are provided that create .iso images from this flake. They do the following:

pushd $HOME/0xc/nixcfg
nix build .#nixosConfigurations.iso.config.system.build.isoImage
popd

A live image will be left in ~/$HOME/0xc/nixcfg/result/iso/. These .iso images are also periodically built and published via GitHub Actions and available in this project's Releases.

What's in the box? 🎁

Nix is configured with flake support and the unified CLI enabled.

Structure

Here is the directory structure I'm using.

.
β”œβ”€β”€ darwin
β”‚  β”œβ”€β”€ mixins -> ../nixos/mixins/
β”‚  β”œβ”€β”€ default.nix
β”‚  └── sktc0
β”œβ”€β”€ home-manager
β”‚  β”œβ”€β”€ mixins
β”‚  β”‚  β”œβ”€β”€ console
β”‚  β”‚  β”œβ”€β”€ desktop
β”‚  β”‚  β”œβ”€β”€ services
β”‚  β”‚  └── users
β”‚  └── default.nix
β”œβ”€β”€ lib
β”‚  β”œβ”€β”€ default.nix
β”‚  β”œβ”€β”€ helpers.nix
β”‚  └── ssh-matrix.nix
β”œβ”€β”€ LICENSE
β”œβ”€β”€ nixos
β”‚  β”œβ”€β”€ mixins
β”‚  β”‚  β”œβ”€β”€ av
β”‚  β”‚  β”œβ”€β”€ console
β”‚  β”‚  β”œβ”€β”€ desktop
β”‚  β”‚  β”œβ”€β”€ hardware
β”‚  β”‚  β”œβ”€β”€ services
β”‚  β”‚  β”œβ”€β”€ users
β”‚  β”‚  └── virt
β”‚  β”œβ”€β”€ default.nix
β”‚  β”œβ”€β”€ iso
β”‚  β”‚  β”œβ”€β”€ iso-console
β”‚  β”‚  β”œβ”€β”€ iso-desktop
β”‚  β”‚  β”œβ”€β”€ iso-gpd-dsi
β”‚  β”‚  β”œβ”€β”€ iso-gpd-edp
β”‚  β”‚  β”œβ”€β”€ iso-nuc
β”‚  β”‚  β”œβ”€β”€ iso-tk1
β”‚  β”‚  └── iso-win-max
β”‚  β”œβ”€β”€ server
β”‚  β”‚  β”œβ”€β”€ brix
β”‚  β”‚  β”œβ”€β”€ NUC.md
β”‚  β”‚  β”œβ”€β”€ nuc0
β”‚  β”‚  β”œβ”€β”€ pxe-server
β”‚  β”‚  β”œβ”€β”€ skull
β”‚  β”‚  └── tk1
β”‚  └── workstation
β”‚     β”œβ”€β”€ glass
β”‚     β”œβ”€β”€ kuroi
β”‚     β”œβ”€β”€ t510
β”‚     └── vm
β”œβ”€β”€ overlays
β”œβ”€β”€ pkgs
β”œβ”€β”€ scripts
β”œβ”€β”€ sdcard
β”œβ”€β”€ secrets
└── shells

The Shell 🐚

Fish shell with powerline-go and a collection of tools that deliver a somewhat "Modern Unix" experience. The base system has a firewall enabled and also includes OpenSSH, ZeroTier, Podman & Distrobox and, of course, a delightfully configured micro. (Fight me! πŸ₯Š)

neofetch on Designare

The Desktop πŸ–₯️

MATE Desktop πŸ§‰ and Pantheon πŸ›οΈ are the two desktop options available. The font configuration is common with both desktops using Work Sans and Fira Code. The usual creature comforts you'd expect to find in a Linux Desktop are integrated such as Pipewire, Bluetooth, Avahi, CUPS, SANE and NetworkManager.

Desktop System Configuration Theme
MATE MATE Install MATE Configuration Yaru Magenta (Dark)
Pantheon Pantheon Install Pantheon Configuration elementary Bubble Gum (Dark)

Eye Candy πŸ‘€πŸ¬

GNOME on Glass

TODO πŸ—’οΈ

Hardware

  • Add all computers to the table
  • Implement Disko partitioning
  • Integrate .iso building
  • Integrate OpenRGB
  • Integrate OpenRazer
  • Integrate StreamDeck
  • Integrate Xone
  • Migrate (maybe) to ZFS, with backups via zrepl
  • Fix Magewell mwprocapture driver: nixpkgs#221209
  • Support Raspberry Pi installer
    • With Nix flakes
  • Support macOS with nix-darwin
  • Support Roccat tools with group-based access control for hidraw

Applications

  • Integrate an Emoji picker
  • Integrate AppCenter and Flathub
  • Integrate Steam
  • Add Ferdium, Rambox or Wavebox
  • Add Password Managers
    • Add Bitwarden
    • Add 1Password

Services

  • Integrate Borg Backups
  • Integrate cockpit (server)
  • Integrate notify
  • Integrate Plex (skull)
  • Integrate homepage
  • Integrate fwupd
  • Integrate Keybase
  • Integrate Syncthing
  • Integrate sshguard

Configuration

  • Embed install script in the ISO
  • Integrate agenix or sops-nix
  • Integrate capabilities from nix-starter-configs
  • Integrate wallpapers
  • Integrate faces
  • Include Serif fonts
  • Include fallback fonts for Work Sans, Fira Code and Joypixels
  • Create common user settings and discrete user settings
  • Move application defaults out of the desktop defaults
  • Create standard directories in /home/tcarrio using systemd.user.tmpfiles.rules.
  • Create .envrc files in /home/tcarrio.
  • Bind Syncthing GUI to ZeroTier.
  • Configure Plank.
  • Fix Unfree in Home Manager)

Game Development

  • Defold
  • Godot
  • PICO-8

Shell

  • emacs
  • fzf
  • tmate or tmux
  • micro
  • neovim
  • nnn or broot or felix or ranger

Inspirations πŸ§‘β€πŸ«

Before preparing my NixOS and Home Manager configurations I took a look at what other Nix users are doing. My colleagues shared their configs and tips which included nome from Luc Perkins, nixos-config from Cole Helbling, flake from Ana Hoverbear and her Declarative GNOME configuration with NixOS blog post. A couple of friends also shared their configurations and here's Jon Seager's nixos-config and Aaron Honeycutt's nix-configs.

While learning Nix I watched some talks/interviews with Matthew Croughan and Will Taylor's Nix tutorials on Youtube. Will Taylor's dotfiles are worth a look, as are his videos, and Matthew Croughan's nixcfg is also a useful reference. After I created my initial flake I found nix-starter-configs by Gabriel Fontes which is an excellent starting point. I'll be incorporating many of the techniques it demonstrates in my nixcfg.

I like the directory hierarchy in Jon Seager's nixos-config and the mixin pattern used in Matthew Croughan's nixcfg, so my initial Nix configuration is heavily influenced by both of those. Ana's excellent Declarative GNOME configuration with NixOS blog post was essential to get a personalised desktop. That said, there's plenty to learn from browsing other people's Nix configurations, not least for discovering cool software. I recommend a search of GitHub nixos configuration from time to time to see what interesting techniques you pick up and new tools you might discover.

The Disko implementation and automated installation is chasing the ideas outlined in these blog posts:

About

Nix configurations for various home laptops, desktops, and servers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •