Skip to content

p3t33/nixos_flake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,013 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Desktop & Homelab Configurations Based on NixOS and Home-Manager Flake

Personal NixOS configurations utilizing home-manager both as an integrated OS module and standalone for generic GNU/Linux systems, structured using a flake. This repository contains configuration files tailored specifically to manage my desktop environments and dedicated homelab infrastructure(nas, xmr miner, virtual machines, and home assistant). It aims to simplify and automate deployment and maintenance, streamlining operations across my desktops and homelab.

Important

Since I'm employing sops-nix for secret management (such as user password) within this repository, complete deployment is not feasible without the necessary encryption key. Consequently, you won"t be able to build machines in this repository without some changes.

You will ether have to replace my secrets with yours, or remove the parts that uses secrets, or do some mix of both. I strongly recommend reading my post Keeping Nix Secrets with Sops: Integration and Applications to get a better understanding how secrets are integrated into the configurations.

You can always use this repository as a blueprint for setting up your own system. be it for design and stricture or individual configuration files (such as tmux, neovim, etc.) can serve as a reference.

Overall Design Philosophy

  • Multiple machines are defined with emphasis on shared code between them in order to achieve consistency and to avoid code repeat where possible. With each machine having its own separate responsibility.
  • Import all and enable pattern has been implemented for scaling the number of machines a simple task.
  • Work flow is heavily skewed towards the use of the keyboard and the terminal. Some keyboard bindings may look strange but they are effected by the fact that I am using a programmable keyboard(configurations in my Adv360-Pro-ZMK repo).
  • Lacking functionality is extended by scripts(such as buku bookmarks for rofi).
  • Effort has been made to define everything using nix, including the $HOME dotfiles to the possible extent.

Highlights

  • Multiple machine configurations using home-manager as a NixOS module, allowing for shared configurations across systems, with an option for standalone home-manager configurations to be used on generic Linux machines, such as Ubuntu.
  • Configurations wrapped inside an enable options, and aggregated into profiles, allowing fast and easy way to build assemble machines.
  • Secrets deployment using sops-nix. Handling secrets on OS level and on home-manger level.
  • Extensively configured xorg and terminal environment.
  • Virtualization configurations for KVM, VirtualBox, and docker.
  • Integration of disko to partition hard drives during NixOS installing and to create /etc/fstab.
  • Some of the machines use zfs.
  • Much effort was put into making all of my services preconfigured, so once a fresh installation is made everything will "just work".

My Desktops

My i3 Desktops

Daily Driver Software

  • Desktop: xorg with i3 and polybar.
  • Launcher: Rofi.
  • Shell: zsh + starship with fzf, zoxide and atuin integration.
  • Editor: neovim.
  • Terminal: alacritty(with tmux).
  • Second brain: emacs(org-roam).

Some of the Daemons I Use

  • ssh-agnet(via gpg-agnet): For all my ssh needs.
  • emacs daemon: for quick load time.
  • clipmenu: a clipboard history via rofi.
  • redshift: Adjusts the color temperature of your screen according to your surroundings.
  • dnust: notification daemon.
  • sxhkd: A simple X hotkey daemon.
  • syncthing: sync files between all of my machines.
  • tmux: Used to start tmux on boot and with the resurrect and continuum plugins my entire terminal environment is always ready for me.
  • watchman: Used to watch a directory and on any change in it to trigger actions. I used it to rsync files I changed locally to a remote automatically.
  • moolticuted: a daemon used to interact with mooltipass the hardware password manager.

Homelab

NAS

nas Storing all my data and media on a zfs mirror(set on two hard drives) is just the tip of the responsibility of this server,

  • syncthing: acts as the main node for all my synchronization needs.
  • nginx: provides secure access to all the services running on the machine.
  • adguard home: acts as the DNS service for my entire home network, and ad blocker.
  • jellyfin: acts as my home media center along with services such as sonarr, raddar, deglue torrent service, and sabnzbd usenet client.
  • gatus: responsible for notifying me(via telegram) about services and websites(like my website kobimedrish) going down.
  • samba: provides a folder that is accessible over the network.
  • calibre-web: manages self hosted books collection.
  • paperless-ngx: manages digitized documents.
  • immich: manages self hosted images.
  • n8n: automation.
  • restic: responsible for periodically backing up all of my important data in an incremental way, creating local and remote backups.
  • homepage-dashboard: web gui with all the important services on the machine and network, with green dot for status and widget for extra information.

home-assistant

Responsible to host the home-assistant and to mange all my smart home devices over zigbee protocol.

  • home-assistant: is a home automation platform.
  • zigbee2mqtt: acts as a bridge between zigbee devices and MQTT messages.
  • mosquitto: enables communication between zigbee devices and home-assistant.

sisyphus-miner

Is fully declared to to mine xmr once installed on a new machine.

  • monero: is the service responsible for communication with the monero block chain.
  • p2pool: is the pool that provides the miner work to do.
  • xmrig: is the miner responsible for doing the actual computational work.

kvm-nixos-server

A headless virtual machine for to play with to use for development purposes.

Repo Structure

  • flake.nix: The entry point for machines and home configurations.
  • machines: The machines that can be configured using this repository. With each machine having its high level .nix configuration that define machine specific settings and include code that can be shared with other machines.
  • modules: Divided into modules to be used by home-manger(including user scripts) to mange user configuration and into nixos modules which are mostly configurations I found in /etc/nixos/configuration.nix and refactored into responsibilities that can then be including by the various machines to achieve code reuse.
  • wallpaper: self explanatory :)

ToDo

  • look into declaring home-assistant machine as much as possible.
  • Finish making sure that all the important data is being backed up with restic and that it can be restored automatically from a remote backup on a fresh installation.
  • Look into automating home-manger installation as a stand alone on generic Linux using Ansible.
  • I am not sure that emacs systemd unit can communicate with ssh-agnet, this is a very low priority.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors