Skip to content

gian-reto/nix-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❄️ My NixOS Configuration

built with nix state: experimental flakes: crunchy

NixOS and home-manager configurations for my personal machines.

Structure

I'm trying to keep the config as simple as possible. I don't want any crazy overlays or helpers and stuff (if possible; let's see how that goes) ─ I just want to toggle features on and off, depending on the respective host or user.

The smallest building blocks of my configuration are contained in features (e.g., support for audio). Each feature should be as self-contained as possible, and should be able to be enabled or disabled independently of the others. Features are then grouped into modules, which cover entire use-cases (e.g., a graphical desktop environment) a user or host might have. users and hosts may then enable these modules to build a complete configuration.

I'm using combined-manager to colocate home-manager and NixOS configurations that belong to the same feature in the same file.

hosts/
└── abc/
    └── ...
modules/
└── features/
    └── ...
pkgs/
└── ...
users/
└── abc/
    └── ...
flake.lock
flake.nix
...

modules may expose various settings, which need to be provided by the consumer when enabling a specific module.

features only expose a single setting, which is a boolean value indicating whether the feature should be enabled or not. However, these switches are controlled by the modules that import them, so there is no need to enable them manually when enabling modules for a user or host.

Lastly, pkgs contains custom packages that are not available in the official Nixpkgs repository.

Usage

  1. Clone this repository:
git clone https://github.com/gian-reto/nix-config.git ~/Code/gian-reto/nix-config
  1. Apply the configuration (remember to replace hostname with the hostname of the machine, see flake.nix for available hostnames):
sudo nixos-rebuild switch --flake ~/Code/gian-reto/nix-config#hostname

# or using `nh`:

nh os switch ~/Code/gian-reto/nix-config#hostname

# It's also possible to use remote builders (and disable local building), using e.g.:

nh os boot -u -- --max-jobs 0 --builders 'eu.nixbuild.net'

# Or deploy to a different machine using `nixos-anywhere` (e.g., `atlas`):
#
# Add `--generate-hardware-config nixos-generate-config ./hosts/atlas/hardware-configuration.nix`
# to generate the hardware configuration for the first time.
nix run github:nix-community/nixos-anywhere -- \
    --disk-encryption-keys /tmp/secret.key <(op read op://Development/3x3x7fbtnr74l65fjtakpznuui/password) \
    --flake .#atlas \
    --target-host root@atlas \
    --build-on-remote

Thanks

My config has been inspired by the many great configurations out there. Some of the most notable ones are:

...and special thanks to the maintainers of the amazing projects used in this configuration!

About

My NixOS Configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages