configuration of all my nix based infrastructure
Find a file
2025-12-04 19:01:11 +01:00
.forgejo/workflows forgjo-actions: comment out for now 2025-11-30 03:27:20 +01:00
assets chore: update readme 2025-12-02 18:16:18 +01:00
modules nixberry: update flake and activate HA 2025-12-04 17:03:20 +01:00
secrets sops: workaround for hashedPassword Mic92/sops-nix#627 2025-12-04 11:46:27 +01:00
.gitattributes hydra: disable lfs until NixOs/hydra#1355 or similar is merged 2025-05-06 10:47:46 +02:00
.gitignore add .gitignore and switch to rebase strategy 2025-05-06 10:36:02 +02:00
.sops.yaml sops: workaround for hashedPassword Mic92/sops-nix#627 2025-12-04 11:46:27 +01:00
flake.lock chore: update flake 2025-12-04 19:01:11 +01:00
flake.nix nixberry: update flake and activate HA 2025-12-04 17:03:20 +01:00
LICENSE LICENCE: update 2025-10-28 10:02:38 +01:00
README.md README: restyle badges 2025-12-02 18:23:49 +01:00

Nix Flakes Ready nixpkgs license

Welcome to my infrastructure configuration

My configuration is based on Dendritic Nix and was heavily inspired by github:drupol/infra including taking some parts ad-verbatim.

Warning

Do not just use this repo out of the box since it will not work for your setup (you will not be able to use my secrets) Feel free to copy any parts you find interesting or useful, but I would recommend building your flake up from scratch as it will allow for easier bughunting.

hyprlock_screenshot

How does it work?

The two main aspects that define this approach are github:vic/import-tree and flake-parts

outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);

This lets us define our starting point in another file (or across multiple). In my case this would be the host-machines file.

There are many different approaches to this, but I found the approach drupol used, parsing the module name, interesting so I wanted to use it as well. I extended mine by filtering my raspberry-pi configurations to be a bit different.

defining hosts

Now to define the host machine, you will want to import other flake-part modules and maybe set some settings unique to this machine

    flake.modules.nixos."hosts/yggdrasil" = { inputs, ... }: {
      ...

      # here comes the fun part:
      imports = with topLevel.config.flake.modules.nixos; [
        # this is where you add your self named modules that you want to use for this host
        # e.g
        base
        cholli
      ];
      # this will now evaluate thos modules and enable everything set up in them
    };

defining modules

What I quite like is that there is no needed structure in your modules folder. You can reorganize all you want, all that matters is that your modules are name exactly how you import them.

  # There are two types of modules you probably want to choose from
  flake.modules.nixos."<your name here>" # nixos base configuration

  flake.modules.home-manager."<your name here>" # home-manager configuration

  # additionally what I like to do is in your home modules make sure that the appropriate system module is enabled before you do something
  home.file = lib.mkIf osConfig.programs."<program name>".enable { ... };

Window Manager of choice

A friend of mine introduced me to Niri and I really like it configuration of that can be found under niri.nix I still use hyprpaper, and hyprlock because I was previously using hyprland and the still work perfectly fine. My bar of choice is waybar it is very minimalistic, and my current runner is fuzzel with I just use with a catppuccin theme.