-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/main'
- Loading branch information
Showing
136 changed files
with
1,423 additions
and
759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build and deploy docs | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- "modules/extra/**/*" | ||
- "docs/*" | ||
|
||
jobs: | ||
build: | ||
name: Build and deploy docs | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install nix | ||
uses: cachix/install-nix-action@v25 | ||
|
||
- name: Build Linux packages | ||
run: "nix build -L .#docs-html" | ||
|
||
- name: Deploy to gh-pages branch | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# funny macos thing | ||
.DS_Store | ||
|
||
# Ingore nixos build outputs | ||
result | ||
.direnv/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# All credits to @nekowinston for this script | ||
# modfied from https://github.com/nekowinston/nur/blob/49cfefd3c252f4c56725df01f817d1a8b93447d8/docs/default.nix | ||
{ | ||
lib, | ||
pkgs, | ||
... | ||
}: let | ||
inherit (lib) mkForce filterAttrs scrubDerivations removePrefix; | ||
|
||
mkEval = module: | ||
lib.evalModules { | ||
modules = [ | ||
module | ||
{ | ||
_module = { | ||
pkgs = mkForce (scrubDerivations "pkgs" pkgs); | ||
check = false; | ||
}; | ||
} | ||
]; | ||
specialArgs = {inherit pkgs;}; | ||
}; | ||
|
||
mkDoc = name: options: let | ||
doc = pkgs.nixosOptionsDoc { | ||
options = filterAttrs (n: _: n != "_module") options; | ||
documentType = "none"; | ||
transformOptions = opt: | ||
opt | ||
// { | ||
declarations = | ||
map | ||
(decl: | ||
if lib.hasPrefix (toString ../.) (toString decl) | ||
then let | ||
subpath = removePrefix "/" (removePrefix (toString ../.) (toString decl)); | ||
in { | ||
url = "https://github.com/isabelroses/dotfiles/tree/main/${subpath}"; | ||
name = subpath; | ||
} | ||
else decl) | ||
opt.declarations; | ||
}; | ||
}; | ||
in | ||
pkgs.runCommand "${name}-module-doc.md" {} '' | ||
cat >$out <<EOF | ||
# ${name} module options | ||
EOF | ||
cat ${doc.optionsCommonMark} >> $out | ||
''; | ||
|
||
convert = md: | ||
pkgs.runCommand "isabelroses-dotfiles.html" {nativeBuildInputs = with pkgs; [pandoc texinfo];} '' | ||
mkdir $out | ||
cp ${./pandoc.css} style.css | ||
pandoc -o file.texi ${builtins.concatStringsSep " " md} | ||
texi2any ./file.texi --html --split=chapter --css-include=./style.css --document-language=en -o $out | ||
''; | ||
|
||
modulesPath = ../modules; | ||
extraModulesPath = modulesPath + /extra; | ||
|
||
# internalEval = mkEval (import (modulesPath + /base)); | ||
nixosEval = mkEval (import (extraModulesPath + /nixos)); | ||
darwinEval = mkEval (import (extraModulesPath + /darwin)); | ||
hmEval = mkEval (import (extraModulesPath + /home-manager)); | ||
|
||
# internal = mkDoc "internal" internalEval.options.modules; | ||
nixos = mkDoc "nixos" nixosEval.options; | ||
darwin = mkDoc "darwin" darwinEval.options; | ||
hm = mkDoc "home-manager" hmEval.options; | ||
in { | ||
html = convert [nixos darwin hm]; | ||
md = pkgs.linkFarm "md" (lib.mapAttrsToList (name: path: {inherit name path;}) ["nixos" "darwin" "hm"]); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.