Skip to content

EdenEast/nyx

Repository files navigation

Nyx

Build NixOS 21.05 Licence

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 variable
    • windows/ - Scripts that are user to setup my windows machines
  • config/ - Contains .dotfiles for various applications. You can think of this as my $HOME directory
  • home/ - Configuration for my user. This is where home-manager configurations lives
    • hosts/ - The definition of a home user. If same name as a nixos/hosts will be used by it
    • modules/ - A defined set of home modules that can be enabled in a home/host
    • profiles/ - A collection of module configurations grouped together to be used by a home/host
    • secrets/ - A folder of secrets used by the user
  • lib/ - List of helper functions
  • nix/ - Nix package manager configurations
    • isos - Nix configuration that builds iso as output
    • overlays/ - Nix overlays
    • pkgs/ - Self packaged applications
  • system - Machine configuration for both nixos and macos
    • common - Configuration that is common between nixos and macos
      • modules - Common modules between the two operating systems
      • profiles - Common profiles between the two operating systems
    • darwin - MacOS machine configuration
      • hosts/ - The definition of a MacOS machine
      • modules/ - MacOS modules
      • profiles/ - A collection of module configurations
      • secrets/ - Secrets used for a machine host
    • nixos - Nixos machine configuration
      • hosts/ - The definition of a nixos machine
      • modules/ - Nixos modules
      • profiles/ - A collection of module configurations
      • secrets/ - 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

I agree with @hlissner. This is needed when nix drives you to drink.

References

TODO