diff --git a/README.md b/README.md index de73c7e..fb3781f 100644 --- a/README.md +++ b/README.md @@ -1,90 +1,8 @@ # About -`nosh` (or `nixos-hosts`) is a library to facilitate complex multi-host NixOS -configurations. It functions by recursively importing the modules in a path with a new -module structure which defines the criteria for a module to be imported. - -# Installation -## Flakes -Please note that I don't use flakes so this information could be outdated/wrong. - -1. Add `nosh` to your inputs -```nix -{ - inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable"; - nosh = { - url = "git+https://codeberg.org/poacher/nosh.git"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; -} -``` -2. Create your NixOS configurations with `mkSystem` -```nix -{ - outputs = {nixpkgs, nosh, ...}: { - nixosConfigurations = { - foo = nosh.lib.mkSystem pkgs { - # ... - }; - bar = nosh.lib.mkSystem pkgs { - # ... - }; - }; - }; -} -``` - -# Usage -## mkSystem -`mkSystem` is a function which creates a NixOS configuration based on the -following arguments: -1. `paths ? []` module paths to be automatically imported and parsed. -2. `conditions ? module: true` optionally defines extra conditions for a module's -config to be evaluated. -3. `modules ? []` modules to be imported alongside the automatically imported -paths. -4. `specialArgs ? {}` optionally defines the `specialArgs` attr of `nixosSystem`. -5. `nixosSystem ? ` optionally defines the `nixosSystem` -function to be called. - -### Example -```nix -nixosConfigurations = mkSystem pkgs { - conditions = conditions.hasHost "laptop"; - paths = [./modules]; -} -``` - -## Modules -Modules are now defined as attrSets with the following attrs: -1. `enabled ? true` optionally defines if the module should be used. -2. `config` defines the configuration to be used for a host. When this is -undefined the module will be ignored. - -### Example -```nix -{ - enabled = true; - hosts = ["laptop"]; # Requires the `hasHost` condition. - config = { - # ... - }; -} -``` - -## Conditions -Conditions determine whether or not to evaluate a module's `config` based on -arbitrary requirements. `nosh` features some builtin conditions which live at -`nosh.lib.conditions`: - -### hasHost -Adds the `hosts ? []` argument to modules and only evaluates a module's -`config` if `hostname` is found in `hosts`. - -# Living Examples -`nosh` is used in the following configs: -1. [mine](https://codeberg.org/poacher/nix-dotfiles) -2. [zushi](https://codeberg.org/zushi/nixos-config) - -If you would like your config added here then please open an issue or PR. +This is a fork of [nosh](https://codeberg.org/poacher/nosh/) with my own preferred setup constrictions +# Differences +- doesn't pass pkgs to hosts. Made it so I could use `nixpkgs.config` inside of individual hosts. Has a drawback of evaluating 2 instances of nixpkgs, instead of one. So my evaluation times will be slower than a typical(2 other user lol) nosh setup +- rename `enabled` condition to `enable` because who the fuck though enabled should exist as a word +- delete unused by me code +# Credits +thanks [@poacher](https://codeberg.org/poacher), your lib is truly fucking awesome. I'd kiss you for creation of this, no homo