diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8ca4ed01..162fed05 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,11 @@ version: 2 updates: - package-ecosystem: github-actions - open-pull-requests-limit: 15 directory: "/" schedule: interval: daily + open-pull-requests-limit: 15 + reviewers: + - NotAShelf + assignees: + - NotAShelf diff --git a/.github/typos.toml b/.github/typos.toml index 25d5c0e1..26be7d9b 100644 --- a/.github/typos.toml +++ b/.github/typos.toml @@ -6,9 +6,6 @@ default.extend-ignore-words-re = [ "annote", "viw", "typ", - "edn", - "esy", "BA", # somehow "BANanaD3V" is valid, but BA is not... - "Emac" ] diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index cb2927e4..7868e55b 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -17,7 +17,7 @@ jobs: if: | github.event.pull_request.merged == true && startsWith(github.event.label.name, 'backport-') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v5 with: ref: ${{ github.event.pull_request.head.sha }} token: ${{ steps.app-token.outputs.token }} diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index a67ec928..13995cb6 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -21,7 +21,7 @@ jobs: - nix - maximal steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v5 name: Checkout - name: Install Nix diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2413fb1c..90bfb431 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,7 +17,7 @@ jobs: if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main @@ -31,7 +31,7 @@ jobs: if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main @@ -56,7 +56,7 @@ jobs: if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: Check for typos uses: crate-ci/typos@master @@ -87,7 +87,7 @@ jobs: uses: DeterminateSystems/nix-installer-action@main - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: Set default git branch (to reduce log spam) run: git config --global init.defaultBranch main @@ -109,13 +109,13 @@ jobs: flake-docs-linkcheck: name: "Validate hyperlinks in documentation sources" runs-on: ubuntu-latest - if: false # disabled until we fix ndg docs + if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: Build linkcheck package run: nix build .#docs-linkcheck -Lv @@ -126,7 +126,7 @@ jobs: if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v5 with: fetch-depth: 2 # slows down checkout, but we need to compare against the previous commit on push events diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index ec153088..1ed6a1ec 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "Checkout" - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: "Delete old branches" uses: beatlabs/delete-old-branches-action@v0.0.11 diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index e33b5571..a238a41d 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -28,7 +28,7 @@ jobs: uses: DeterminateSystems/nix-installer-action@main - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: Set default git branch (to reduce log spam) run: git config --global init.defaultBranch main @@ -49,7 +49,7 @@ jobs: mkdir -p $PREVIEW_DIR # Copy the build files to the preview subdirectory - cp -rvf ../result/share/doc/* ./$PREVIEW_DIR + cp -rvf ../result/share/doc/nvf/* ./$PREVIEW_DIR # Configure git to use the GitHub Actions token for authentication git config --global user.name "GitHub Actions" @@ -127,7 +127,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: Delete preview for closed/merged PR run: | @@ -164,7 +164,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v5 - name: Double check preview directory deletion run: | diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index b9505527..3b4cc38b 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -28,7 +28,7 @@ jobs: outputs: should_run: ${{ steps.should_run.outputs.should_run }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v5 - name: print latest_commit run: echo ${{ github.sha }} @@ -43,11 +43,11 @@ jobs: if: ${{ needs.check_date.outputs.should_run != 'false' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v5 - uses: DeterminateSystems/nix-installer-action@main - run: | nix build .#docs -Lv - cp -r result/share/doc public + cp -r result/share/doc/nvf public - uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index f1c5cc4b..00000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Weekly Dependency Updates -on: - workflow_dispatch: - schedule: - # 8 PM UTC every Friday - - cron: '0 20 * * 5' -jobs: - update-dependencies: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: "Install Nix" - uses: cachix/install-nix-action@v31.9.0 - - - name: Set up Git - run: | - git config user.name "GitHub Actions Bot" - git config user.email "actions@github.com" - - - name: Create branch for updates - run: | - DATE=$(date +%Y-%m-%d) - BRANCH_NAME="update/dependencies-$DATE" - git checkout -b $BRANCH_NAME - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - - - name: Update npins - run: nix run nixpkgs#npins update - - # Only update Nixpkgs. mnw might break on update, better to track it manually to avoid - # unexpected breakage. - - name: Update nixpkgs - run: nix flake update nixpkgs - - - name: Check for changes - id: check_changes - run: | - if git diff --quiet; then - echo "No changes detected" - echo "changes_detected=false" >> "$GITHUB_OUTPUT" - exit 0 - else - echo "Changes detected" - echo "changes_detected=true" >> "$GITHUB_OUTPUT" - fi - - # FIXME: Worth adding additional checks for, e.g., fragile plugins - # or modules - # nix build .#checks.. - # We'll probably want to handle this with machine tests - - name: Verify changes - if: steps.check_changes.outputs.changes_detected == 'true' - run: | - # Run verification tests to ensure updates don't break anything - nix flake check - - - - name: Set date variable - run: echo "DATE=$(date +%Y-%m-%d)" >> "$GITHUB_ENV" - - - name: Commit and push changes - if: steps.check_changes.outputs.changes_detected == 'true' - run: | - git add . - git commit -m "pins: bump all plugins (${{ env.DATE }})" - git push -u origin $BRANCH_NAME - - - name: Create Pull Request - if: steps.check_changes.outputs.changes_detected == 'true' - uses: peter-evans/create-pull-request@v8 - with: - branch: ${{ env.BRANCH_NAME }} - base: main - labels: dependencies,automated pr - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "npins: bump all plugins (${{ env.DATE }})" - title: "Weekly Dependency Updates: ${{ env.DATE }}" - body: | - > [!NOTE] - > This PR was automatically generated by the Weekly Dependency Updates workflow. Please wait - > for all CI steps to complete, and test any major changes personally. - - Updates Performed: - - - Updated dependencies using `npins update` - - Updated nixpkgs using `nix flake update nixpkgs` - - If the verification steps have passed, updates should be safe to merge. For failing CI steps - submit a Pull Request targetting ${{ env.BRANCH_NAME }} diff --git a/configuration.nix b/configuration.nix index cc314288..68776638 100644 --- a/configuration.nix +++ b/configuration.nix @@ -31,7 +31,6 @@ isMaximal: { lspSignature.enable = !isMaximal; # conflicts with blink in maximal otter-nvim.enable = isMaximal; nvim-docs-view.enable = isMaximal; - harper-ls.enable = isMaximal; }; debugger = { @@ -57,7 +56,6 @@ isMaximal: { clang.enable = isMaximal; css.enable = isMaximal; html.enable = isMaximal; - json.enable = isMaximal; sql.enable = isMaximal; java.enable = isMaximal; kotlin.enable = isMaximal; @@ -69,7 +67,7 @@ isMaximal: { typst.enable = isMaximal; rust = { enable = isMaximal; - extensions.crates-nvim.enable = isMaximal; + crates.enable = isMaximal; }; # Language modules that are not as common. @@ -86,11 +84,8 @@ isMaximal: { ocaml.enable = false; elixir.enable = false; haskell.enable = false; - hcl.enable = false; ruby.enable = false; fsharp.enable = false; - just.enable = false; - qml.enable = false; tailwind.enable = false; svelte.enable = false; @@ -193,7 +188,6 @@ isMaximal: { vim-wakatime.enable = false; diffview-nvim.enable = true; yanky-nvim.enable = false; - qmk-nvim.enable = false; # requires hardware specific options icon-picker.enable = isMaximal; surround.enable = isMaximal; leetcode-nvim.enable = isMaximal; diff --git a/docs/default.nix b/docs/default.nix index 662dd403..49f90b80 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -92,7 +92,7 @@ # Generate the HTML manual pages html = pkgs.callPackage ./manual.nix { - inherit inputs release; + inherit release; inherit (nvimModuleDocs) optionsJSON; }; in { diff --git a/docs/manual.nix b/docs/manual.nix index 132c20ef..50a5dab4 100644 --- a/docs/manual.nix +++ b/docs/manual.nix @@ -1,47 +1,114 @@ { - inputs, - path, + lib, stdenvNoCC, + fetchzip, runCommandLocal, - optionsJSON, + # build inputs + nixos-render-docs, + documentation-highlighter, + dart-sass, + path, + # nrd configuration release, + optionsJSON, } @ args: let manual-release = args.release or "unstable"; + + scss-reset = fetchzip { + url = "https://github.com/Frontend-Layers/scss-reset/archive/refs/tags/1.4.2.zip"; + hash = "sha256-cif5Sx8Ca5vxdw/mNAgpulLH15TwmzyJFNM7JURpoaE="; + }; + + compileStylesheet = runCommandLocal "compile-nvf-stylesheet" {} '' + mkdir -p $out + + tmpfile=$(mktemp -d) + trap "rm -r $tmpfile" EXIT + + ln -s "${scss-reset}/build" "$tmpfile/scss-reset" + + ${dart-sass}/bin/sass --load-path "$tmpfile" \ + ${./static/style.scss} "$out/style.css" + + echo "Generated styles" + ''; in - runCommandLocal "nvf-docs-html" { - nativeBuildInputs = [ - (inputs.ndg.packages.${stdenvNoCC.system}.ndg.overrideAttrs - { - # FIXME: the tests take too long to build - doCheck = false; - }) - ]; - } '' - mkdir -p $out/share/doc + stdenvNoCC.mkDerivation { + name = "nvf-manual"; + src = builtins.path { + name = "nvf-manual-${manual-release}"; + path = lib.sourceFilesBySuffices ./manual [".md" ".md.in"]; + }; - # Copy the markdown sources to be processed by ndg. This is not - # strictly necessary, but allows us to modify the Markdown sources - # as we see fit. - cp -rvf ${./manual} ./manual + strictDependencies = true; + nativeBuildInputs = [nixos-render-docs]; - # Replace variables following the @VARIABLE@ style in the manual - # pages. This can be built into ndg at a later date. - substituteInPlace ./manual/index.md \ - --subst-var-by NVF_VERSION ${manual-release} + postPatch = '' + ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json + ''; - # Generate the final manual from a set of parameters. This uses - # feel-co/ndg to render the web manual. - ndg html \ - --jobs $NIX_BUILD_CORES --title "NVF" \ - --module-options ${optionsJSON}/share/doc/nixos/options.json \ - --manpage-urls ${path}/doc/manpage-urls.json \ - --options-depth 3 \ - --generate-search \ - --highlight-code \ - --input-dir ./manual \ - --output-dir "$out/share/doc" + buildPhase = '' + dest="$out/share/doc/nvf" + mkdir -p "$(dirname "$dest")" + mkdir -p $dest/{highlightjs,script} - # Hydra support. Probably not necessary. - mkdir -p $out/nix-support/ - echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products - '' + # Copy highlight scripts to /highlights in document root. + cp -vt $dest/highlightjs \ + ${documentation-highlighter}/highlight.pack.js \ + ${documentation-highlighter}/LICENSE \ + ${documentation-highlighter}/mono-blue.css \ + ${documentation-highlighter}/loader.js + + # Copy anchor scripts to the script directory in document root. + cp -vt "$dest"/script \ + ${./static/script}/anchor-min.js \ + ${./static/script}/anchor-use.js \ + ${./static/script}/search.js + + substituteInPlace ./options.md \ + --subst-var-by OPTIONS_JSON ./config-options.json + + substituteInPlace ./manual.md \ + --subst-var-by NVF_VERSION ${manual-release} + + substituteInPlace ./hacking/additional-plugins.md \ + --subst-var-by NVF_REPO "https://github.com/notashelf/nvf/blob/${manual-release}" + + # Move compiled stylesheet + cp -vt $dest \ + ${compileStylesheet}/style.css + + # Move release notes + cp -vr ${./release-notes} release-notes + + # Generate final manual from a set of parameters. Explanation of the CLI flags are + # as follows: + # + # 1. --manpage-urls will allow you to use manual pages as they are defined in + # the nixpkgs documentation. + # 2. --revision is the project revision as it is defined in 'release.json' in the + # repository root + # 3. --script will inject a given Javascript file into the resulting pages inside + # the