Go to file
2024-01-14 12:53:55 +08:00
.github ci: bump actions/upload-pages-artifact from 2 to 3 (#15) 2024-01-08 04:47:40 +00:00
apps/run-workflow-with-vm apps/run-workflow-with-vm: add extraModules optional argument 2024-01-12 19:27:28 +08:00
docs docs/site: make it more readable 2024-01-06 19:15:55 +08:00
hosts hosts/ni: update backup config 2024-01-07 10:43:44 +08:00
lib lib/extras/images: add custom modulesPath for each environment 2024-01-07 18:22:09 +08:00
modules programs/gnome-session: refactor parts of config 2024-01-10 16:27:41 +08:00
overlays config: remove fxcast-bridge as part of Firefox addons 2023-12-20 11:25:28 +08:00
pkgs niri: fix the installation files and its metadata 2024-01-10 22:25:07 +08:00
setups hosts/winnowing: update default modules 2024-01-10 15:41:57 +08:00
shells config: migrate from Terraform CLI to OpenTofu CLI 2023-10-13 14:24:10 +08:00
templates templates/local-ruby-nix: update devshell and flake 2023-11-17 22:10:21 +08:00
users users/foo-dogsquared: update Tridactyl config 2024-01-12 19:28:12 +08:00
.editorconfig editorconfig: add formatting config for TOML files 2023-08-01 17:30:50 +08:00
.envrc config: add dotenv for production 2023-06-27 15:24:43 +08:00
.gitattributes git: remove linguist attributes 2023-06-22 18:07:44 +08:00
.gitignore config: add dotenv for production 2023-06-27 15:24:43 +08:00
.sops.yaml secrets: update SOPS creation path 2023-12-23 20:41:23 +08:00
default.nix default.nix: use the correct flake-compat input 2024-01-14 12:53:55 +08:00
flake.lock default.nix: use the correct flake-compat input 2024-01-14 12:53:55 +08:00
flake.nix default.nix: use the correct flake-compat input 2024-01-14 12:53:55 +08:00
LICENSE LICENSE: update year 2024-01-06 13:20:24 +08:00
Makefile Makefile: add deploy step 2023-09-28 18:29:51 +08:00
README.adoc docs: fix links in project README 2023-12-25 20:06:44 +08:00
shell.nix shell.nix: add home-manager tool 2023-12-13 12:53:55 +08:00
treefmt.toml config: replace terraform with tofu as formatter 2023-12-13 11:29:19 +08:00

This is my NixOS config as a Nix flake eventually containing my (almost) complete setup from a desktop, to a server, to a personalized installer, almost everything. This configuration setup can be described with a list of features:

  • Deploy the same NixOS configuration for more than one system. This is configured with the ./images.toml where not only you can deploy them with deploy-rs but build them as generated by nixos-generators. You can even configure what nixpkgs branch (and home-manager branch) it will use.

  • Similarly, deploy the same home-manager configuration for more than one system. This time, it is configured with the ./users.toml file which you can configure what nixpkgs branch it will use.

  • Unify home-manager and NixOS configuration (and maybe other environments such as nix-darwin and system-manager in case I have use cases for those) into one flake.

  • Take full advantage of Nix module system with the cluster-wide custom modules [1]. This design bleeds into configuring the NixOS systems and home-manager users by designing host-specific modules and user-specific modules, respectively.

  • It has its own website. Which means that its cool (or over-the-top, whichever you prefer).

Its basically my personal version of nixpkgs: a monorepo of everything I need for Nix-related things (unless it sprung into life as its own project).

Anyways, this project also has a dedicated website at https://foo-dogsquared.github.io/nixos-config which I recommend to take a gander on how this project structures its configuration (and much of the information is not covered in this README anyways). If you want the local documentation and has angst against online documentation, you can view the source code of the book at ./docs/.

Getting started

This is an overencumbered set of NixOS configurations for different systems. For this section though, well assume youre only interested in installing the desktop configuration.

To start, youll have to download a NixOS installer image. While you can download the latest revisions from the official website, you can get my personalized installer from the releases page of this project. Next, boot into the installer image. Then as root, install the desktop with the following commands.

bash $(nix build --no-link --print-out-paths github:foo-dogsquared/nixos-config#nixosConfigurations.ni.config.system.build.diskoScript)
nixos-install --flake github:foo-dogsquared/nixos-config#ni

The above command will automate everything for you including the partitioning steps.

Voila! You should have my desktop configuration installed.

However, it should also be barely usable since there are a couple of missing components that are needed such as the private keys for the desktop which is required for certain tasks such as backup task with Borg among other things. There are also some additional prerequisites such as partitioning which is already handled with disko.

Using the flake

If you want to use the flake as part of the flake inputs, you can simply include it in flake.nix.

{
    inputs.foodogsquared-flake.url = "github:foo-dogsquared/nixos-config";
}

For a better experience, I recommend using FlakeHub (with available instructions in the linked page). The FlakeHub flake follows a rolling release model so all of the releases are under 0.x.

Stability promise

If youre one of the unfortunate users for whatever reason, sorry but theres no stability promise here. Not every commit successfully builds because of the way how the project is managed (which is very very badly):

  • All of the included changes are pushed in one fell swoop over time instead of carefully testing each of them.

  • NixOS and home-manager configurations are able to be deployed in pure evaluation mode and suddenly its not (most of the time, it isnt).

  • Module interfaces change all the time.

  • Packages can be left unmaintained and vanish at any time. [2]

This is my personal NixOS configuration, after all. It serves more of a platform to experiment with the Nix ecosystem rather than something that its meant to be used by others. There are some parts of the configuration that eventually sprung as its own project such as the Guix overlay (which eventually upstreamed into nixpkgs, hoorah!). Hopefully, more of them can be like that in the future (provided I still use Nix and have some time for it).

TODO

In order of priority:

  • ✓ Create custom modules.

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

  • ✓ Create a good workflow for creating ISOs.

  • ✓ Create development shells.

  • ✓ Manage secrets with agenix.

  • ❏ Create a good workflow for tests.

  • ✓ 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:

  • Set most program configurations with Nix. This is especially applicable to programs I always use such as my text editor configs.

    • The reason: managing them can be chaotic when applied with Nix. The potential for it is pretty nice especially when seen with similar implementations such as Guix home environment. However, I dont want to rebuild it every time I change it.

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

  • To be a configuration framework. This is my personal configuration which means experimentation will always be here. Sudden changes can happen at any point.

This project is licensed under MIT license. I just chose it to make it easier to upstream parts of this project to nixpkgs and to make it easier to copy it without much problems (just dont forget to add attribution as indicated from the license). Please see ./LICENSE for the full text.


1. Most of them are patterned similarly from nixpkgs which made easy to be upstreamed just in case.
2. The ones I actively maintain are in nixpkgs anyways.