Documentation

Nix Flake

File: flake.nix, flake.lock

flake.nix describes the inputs and outputs of the project. Inputs list any files or repositories that the project downloads. Outputs list the results of the project, such as NixOS configurations, Home-Manager configurations and development environments.

flake.lock stores the hashes of inputs, ensuring that the specific package version used is identified. This essentially locks dependencies. If input hashes are specified in flake.nix, the hash in flake.lock will be overridden.

NixOS Configurations

File: /hosts/system/[profile]/*.nix

Describes the state of the system, including hardware settings and system packages.

default.nix imports modules from modules/ folder and writes their configurations. packages.nix lists packages to be installed system wide and enables some system apps and services.

hardware-configuration.nix contains hardware configurations automatically generated by the system with nixos-generate-config and shouldn't need to be edited. When moving to a new machine, a new config can be generated and this file replaced.

Home-manager Configurations

File: hosts/home/[profile]/*.nix
Source: https://github.com/nix-community/home-manager

Describes the state of the user environment, with the use of Home-manager.

default.nix imports package configurations from packages/ folder and writes other home-manager configurations. packages.nix lists packages to be installed in the user environment.

Development Environments

File: dev-envs/*.nix

Creates shells for development purposes, such as installing the required packages and creating shell aliases and scripts.

Sops-nix

File: .sops.yaml, user/[profile]/secrets.yaml, modules/system.nix
Source: https://github.com/Mic92/sops-nix

Secret provisioning system that allows storing encrypted secrets in the repository.

.sops.yml configures the location of the public key and its owner. secret.yaml is where secrets are written and must be decrypted with the sops program and the secret key before editing. system.nix configures the location of the secrets.yaml source file, and the decrypting secret key.

GitHub Workflows

File: .github/workflows/*.yml

GitHub workflow configuration. Currently test.yml runs nix flake check --no-build each time the master branch recieves a commit, while the ci.yml deploys this GitHub Pages site.

MkDocs

File: mkdocs.yml, docs/*.md, dev-envs/mkdocs.nix
Source: https://github.com/mkdocs/mkdocs

Generates project documentation site with markdown.

mkdocs.yml configures the structure of the site. Markdown files in docs/ folder are the pages. mkdocs.nix is the development environment for working with mkdocs.

User Settings

File: user/[profile]/*

User settings are stored here under different profile names, such that new hostnames can be created for different users. Do not edit the files to change users. Add new folders and change the user_profile variable in nixosConfigurations and homeConfigurations.

default.nix stores user data. secrets.yaml stores encrypted secrets used by sops-nix. users.nix creates your user account user(or even multiple users).

Wallpapers

File: user/[profile]/default.nix, flake.nix
Source: https://github.com/Cryxtalix/Wallpapers

Automatically adds wallpapers to GNOME desktop environment from personal GitHub repo. default.nix stores the name of the wallpaper to be used(needs to present in the repo). flake.nix contains source url of the wallpaper repo, and could be changed to a different wallpaper source.

Bash Aliases

File: packages/bash.nix, dev-envs/*.nix

Convenient bash aliases to shorten long commands.

Aliases are in bash.nix shellAliases and initExtra sections will be always be active. Aliases in dev-envs/*.nix shellHook sections will only be active when the corresponding development environment is activated.

SSH Git Server

File: modules/git-daemon.nix, keys/*

Creates an SSH git server that accepts public keys from keys/ folder. Module has to be imported to a nixos configuration and enabled.

Read here for detailed instructions