Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Example modules

Nixpkgs

{ adios }:
let
  inherit (adios) types;
in
{
  options = {
    pkgs = {
      type = types.attrs;
      default = import <nixpkgs> { };
    };
  };
}

Hello world

{ adios }:
let
  inherit (adios) types;
in
{
  options = {
    enable = {
      type = types.bool;
      default = false;
    };

    package = {
      type = types.derivation;
      defaultFunc = { inputs }: inputs."nixpkgs".pkgs.hello;
    };
  };

  inputs = {
    nixpkgs = {
      path = "/nixpkgs";
    };
  };

  impl =
    {
      options,
      inputs,
    }:
    let
      inherit (inputs.nixpkgs.pkgs) lib;
    in
    lib.optionalAttrs options.enable {
      packages = [
        options.package
      ];
    };
}