Nyx
This repository contains configuration for all my unix systems (NixOS, Linux and MacOS) written in nix
.
This repository also contains my dotfiles which are used on all the systems liked above as well as windows. On systems
that support nix
my dotfiles are managed by home-manager.
Structure
bin/
- Contains scripts that will be added to the$PATH
variablewindows/
- Scripts that are user to setup my windows machines
config/
- Contains.dotfiles
for various applications. You can think of this as my$HOME
directoryhome/
- Configuration for my user. This is where home-manager configurations liveshosts/
- The definition of a home user. If same name as anixos/hosts
will be used by itmodules/
- A defined set of home modules that can be enabled in ahome/host
profiles/
- A collection of module configurations grouped together to be used by ahome/host
secrets/
- A folder of secrets used by the user
lib/
- List of helper functionsnix/
- Nix package manager configurationsisos
- Nix configuration that buildsiso
as outputoverlays/
- Nix overlayspkgs/
- Self packaged applications
system
- Machine configuration for bothnixos
andmacos
common
- Configuration that is common betweennixos
andmacos
modules
- Common modules between the two operating systemsprofiles
- Common profiles between the two operating systems
darwin
- MacOS machine configurationhosts/
- The definition of a MacOS machinemodules/
- MacOS modulesprofiles/
- A collection of module configurationssecrets/
- Secrets used for a machine host
nixos
- Nixos machine configurationhosts/
- The definition of a nixos machinemodules/
- Nixos modulesprofiles/
- A collection of module configurationssecrets/
- Secrets used for a machine host
user
- Configuration values linked to a specific user
Dotfiles
My .dotfiles
can be found under config/
. On systems managed by nix and this flake repository
they are managed by home-manager
. I home-manager
to use the config/
folder as the source for
my configurations. This helps when I am on a machine that is not managed by nix (cough windows
cough). On these machines I symlink the files in the config/
folder into their respective
locations. Some configurations of note:
Hosts
Configuration | Type | Description |
---|---|---|
sloth | System | An old lenovo T530 Laptop |
eden | Home | Generic home config for non nixos machines (wsl) |
pride | System | Asus UX331U notebook laptop |
Ci/Cd
I have github action workflows setup to continuously build my configurations and deploy the results to a binary cache server (cachix). Every week I have a workflow that creates a pull request with an updated flake lock file. The pr action will diff the changing packages between the current and updated lockfile changes. It will then also run a security issues with vulnix. A report is generated in the pr and I can accept the changes.
Resources
Manuals
- Nix - The expression language and package manager
- Nixpkgs - The repository of packages
- NixOS - The operating system built on top of nix
- Home Manager - Manage user environments
Learning
- Awesome Nix - A curated list of the best resources in the Nix community.
- Learn - Home page for learning the nix eco-system
- NixOS Wiki - Community maintained wiki
- Nix Pills - A learn nix by example understanding how it works step by step
- nix.dev - An opinionated guide for developers getting things done using the Nix ecosystem
- [NixOS Guide][nixos-guide] - A collection of resources about different topics for nixos
Flakes
- Nix Flakes Series by Eelco Dolstra. Great introduction to flakes
- Flake wiki - Wiki page on flakes
I agree with @hlissner. This is needed when nix drives you to drink.
References
- @davidwco veritas
- @hlissner dotfiles
- @LEXUGE nixos
- @utdemir dotfiles
- @cole-mickens nixcfg
- @pinpox nixos
- @MayNiklas nixos
- @yurrriq dotfiles
TODO
- handle wsl now that wsl-ssh-pageant is archived. Resources here
here or switch to nixos-wsl
- (An idea is to use nixos-wsl and build my-own install iso with usb kernal passthough)
- Create wsl options, check this commit
- Some sort of backup solution like borgmatic borgbackup