chore: add docs & CI

This commit is contained in:
technofab 2025-10-06 17:18:22 +02:00
parent 3363059b65
commit f8f5dbd535
No known key found for this signature in database
18 changed files with 407 additions and 26 deletions

View file

@ -1,37 +1,42 @@
{
config,
lib,
config,
options,
...
}: let
inherit (lib) mkOption mkOptionType types isAttrs hasAttr;
mkInputOption = description:
inherit (lib) mkOption mkOptionType types isAttrs hasAttr literalExpression;
mkInputOption = name: description:
mkOption {
type = mkOptionType {
name = "input";
description = "a flake input";
description = "flake input for ${name}";
check = x: (isAttrs x) && (hasAttr "sourceInfo" x);
};
description = ''
The flake input for ${description}.
Example:
ren.home-manager = inputs.home-manager;
'';
example = literalExpression "inputs.${name}";
};
in {
options.ren = {
system = mkOption {
type = types.str;
description = ''
The system architecture (e.g., 'x86_64-linux', 'aarch64-darwin').
The system architecture (e.g., `x86_64-linux`, `aarch64-darwin`).
'';
default =
if options.ren.pkgs.isDefined
then config.ren.pkgs.system
else "";
defaultText = literalExpression ''
if options.ren.pkgs.isDefined then config.ren.pkgs.system else "";
'';
default = config.ren.pkgs.system or "";
};
home-manager = mkInputOption "Home Manager";
disko = mkInputOption "Disko";
nixos-wsl = mkInputOption "NixOS-WSL";
nix-darwin = mkInputOption "nix-darwin";
home-manager = mkInputOption "home-manager" "Home Manager";
disko = mkInputOption "disko" "Disko";
nixos-wsl = mkInputOption "nixos-wsl" "NixOS-WSL";
nix-darwin = mkInputOption "nix-darwin" "nix-darwin";
pkgs = mkOption {
type = mkOptionType {
@ -42,6 +47,9 @@ in {
description = ''
An instantiated nixpkgs set. Used for general pkgs and to get NixOS systems' modules.
'';
example = literalExpression ''
import inputs.nixpkgs { system = "aarch64-linux"; };
'';
};
};
}