Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .envrc

This file was deleted.

54 changes: 35 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,45 @@ name: ci

on:
push:
pull_request:
branches:
- master
workflow_dispatch:

permissions:
id-token: write
pages: write
contents: write

jobs:
deploy:
docs-build:
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write
environment:
name: github-pages

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Install Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Check
run: nix flake check -L

- name: Show
run: nix flake show
- name: 📦 Install Nix
uses: cachix/install-nix-action@master
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable

- name: 🏗️ Build
run: nix build -f ./docs -L

- name: 📤 Upload artifacts
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./result

docs-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: docs-build
steps:
- name: 🚀 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
50 changes: 0 additions & 50 deletions .github/workflows/doc.yaml

This file was deleted.

41 changes: 27 additions & 14 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
{lib}: let
eval = {
pkgs,
modules ? [],
specialArgs ? {},
}:
let
eval =
{
pkgs,
lib ? pkgs.lib,
modules ? [ ],
specialArgs ? { },
}:
lib.evalModules {
modules =
[
./modules
]
++ modules;
specialArgs = {inherit pkgs;} // specialArgs;
modules = [
./modules/many-wrappers.nix
] ++ modules;
specialArgs = {
inherit pkgs;
} // specialArgs;
};
in {
in
{
lib = {
inherit eval;
__functor = _: eval;
build = args: (eval args).config.build.toplevel;
wrapWith =
pkgs: module:
(pkgs.lib.evalModules {
modules = [
./modules/wrapper.nix
module
];
specialArgs = {
inherit pkgs;
};
}).config.wrapped;
};
}
1 change: 1 addition & 0 deletions docs/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
7 changes: 6 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ import { data } from "./wm.data.js";
import { RenderDocs } from "easy-nix-documentation";
</script>

## Main API

<RenderDocs :options="data" :exclude="[/^_module\.args$/, /^build\.*/]" />
<RenderDocs :options="data" :exclude="[/^_module\.args$/, /^build\.*/, /programs/]" />

## Program configuration

<RenderDocs :options="data" :include="[/programs/]" />

## Outputs

Expand Down
1 change: 1 addition & 0 deletions docs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(import <nixpkgs> { }).callPackage ./package.nix { }
46 changes: 46 additions & 0 deletions docs/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
buildNpmPackage,
importNpmLock,
nixosOptionsDoc,
lib,
pkgs,
}:
let
options_json =
(nixosOptionsDoc {
options =
((import ../.).lib {
inherit pkgs;
modules = [ ];
}).options;
}).optionsJSON;
in
buildNpmPackage {
name = "wrapper-manager-docs";
src = lib.cleanSource ./.;
npmDeps = importNpmLock {
npmRoot = lib.cleanSource ./.;
};

inherit (importNpmLock) npmConfigHook;

env.WRAPPER_MANAGER_OPTIONS_JSON = options_json;
passthru = {inherit options_json;};

buildPhase = ''
runHook preBuild

# Vitepress hangs when printing normally
npm run build -- --base=/wrapper-manager/ 2>&1 | cat

runHook postBuild
'';

installPhase = ''
runHook preInstall

mv .vitepress/dist $out

runHook postInstall
'';
}
Loading