Go to file
Gabriel Arazas 3a022a374a Restructure the modules
I think this is better for separating modules explicitly. This is also
considered as there are similar objects between modules (e.g., NixOS
and home-manager modules and users).

Revert users module to old position
2021-12-06 17:03:39 +08:00
hosts Restructure the modules 2021-12-06 17:03:39 +08:00
lib Update library and custom modules 2021-12-02 21:45:49 +08:00
modules Restructure the modules 2021-12-06 17:03:39 +08:00
pkgs Revert installing keylist entries from pop-shell 2021-12-04 23:28:22 +08:00
users Restructure the modules 2021-12-06 17:03:39 +08:00
.editorconfig Update package set and documentation 2021-11-29 18:27:56 +08:00
.gitignore Rewrite as a flake 2021-11-25 19:55:30 +08:00
.gitmodules Restructure the modules 2021-12-06 17:03:39 +08:00
flake.lock Restructure the modules 2021-12-06 17:03:39 +08:00
flake.nix Restructure the modules 2021-12-06 17:03:39 +08:00
Makefile Update our host and user config 2021-12-02 22:02:29 +08:00
README.adoc Restructure the modules 2021-12-06 17:03:39 +08:00
shell.nix Restructure the modules 2021-12-06 17:03:39 +08:00

This is my NixOS config as a Nix flake.

I finally have some time trying to grok flakes and redo my NixOS config from scratch after leaving NixOs (because I have work and have to quickly set things up without me trying to debug how NixOS works). Here is the result.

Installation

This primarily uses Nix flakes so you can have a preview of whats available in my config.

nix flake show github:foo-dogsquared/nixos-config

It should export my NixOS configurations of my different hosts (of only one so far excluding VMs and VPSs ;p) among other things. To install it, run the nixos-install --flake github:foo-dogsquared/nixos-config#ni. (Please see the respective appropriate host README for more information.)

Project structure

My NixOS config should look like the following:

nixos-config
├── hosts/
├── lib/
├── modules/
├── pkgs/
├── users/
├── flake.lock
├── flake.nix
└── README.adoc
  • ./hosts/ contain machine-specific configuration. This usually configures like the hardware setup, timezone, and users. Host configurations are also exported in the flakes in outputs.nixosConfigurations.

  • ./modules/ contain my custom modules including for NixOS and home-manager. For more information, see the related documentation. It is also exported from the flake in outputs.nixosModules.

  • ./pkgs/ contains my custom packages. It is exported in the flakes at outputs.packages compiled through various systems (but only x86_64-linux is mainly tested).

  • ./users/ contains my home-manager configurations and modules. It is exported in the flakes at outputs.homeConfigurations. For more information, see the related documentation.

TODO

In order of priority:

  • ✓ Create custom modules.

  • ✓ Create a themes system similar to this NixOS config.

  • ✓ Manage secrets with agenix.

  • ❏ Create devshells.

  • ✓ Automate backups with NixOS config.

  • ✓ Create custom packages and export it to flakes. (Maybe consider making it to upstream)

  • ✓ Create cluser-wide configs.

  • ✓ Create host-wide configs.

  • ✓ Create user-specific configs with home-manager.

  • Steal Get some ideas from this overengineered template.

  • ✓ Make use of other established utilities such as digga, flake-utils-plus, and home-manager once Im familiar to create my own Nix programs.

Out of scope:

  • Text editor configurations. They are often updated. I dont want to rebuild it every time I change it.

  • Migration of my dotfiles. I still use it on other non-NixOS systems.

Frequently asked questions (FAQ)

  1. Hello! Im new to Nix and NixOS, where should I start?

    Oh no, youve seen the multiple configurations from other systems, didnt you? I hope youre ready for some time understanding because the learning curve is steeper than the Troll Wall. Ive written a blog post regarding my experience with Nix with a bunch of links for getting started. (Un)Fortunately, it is mostly the same experience now that Ive revisited it.

  2. Any requirements for this setup?

    You only need Nix 2.4 installed with the experimental features for Nix command and flakes enabled (i.e., experimental-features = nix-command flakes).