Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.

berbiche/metacortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metacortex

NixOps definition of my homelab!

I'm learning NixOps so the code quality (code reuse, layout strategy, etc.) is mediocre.

Structure

  • deployments - Includes all NixOPS deployments definitions.
  • host - Definition of an host within the network. A host can have multiples roles. A host still has configurable variables that must be configured within a deployment.
  • nix - NixOS package source managed using Niv
  • roles - Contains definitions of specific roles a host can have

Commands

Usage of the provided shell.nix using either nix-shell or lorri is recommended.

The NIX_PATH environment variable is modified to add a custom root path for use with imports.

Deploy

TODO

Things to Learn

My roadmap to making a good use out of NixOps

HOWTOs

  • Define a directory structure

    • Per-host?
    • Per-functionality (akin to a role in Ansible)?
  • Reuse code as much as possible

  • Define a new host easily

  • Keep track of the host inventory

    NixOps has the nixops export command. NixOps preserves the deployment state in $HOME/.nixops/deployments.nixops by default.

  • Document the infrastructure

    • Using a custom structure that exposes a comment = types.str; alongside preprocessing to remove the comments
    • Dynamically generate the documentation
    • ???

Helpful commands

  • Debug systemd-networkd links/networks configuration: SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/${DEVICE}

Links

About

Old nixops playground (archived)

Topics

Resources

Stars

Watchers

Forks