diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 162fed05..8ca4ed01 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,7 @@ 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 26be7d9b..25d5c0e1 100644 --- a/.github/typos.toml +++ b/.github/typos.toml @@ -6,6 +6,9 @@ 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/check.yml b/.github/workflows/check.yml index 90bfb431..090c17b8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -109,7 +109,7 @@ jobs: flake-docs-linkcheck: name: "Validate hyperlinks in documentation sources" runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[skip ci]')" + if: false # disabled until we fix ndg docs steps: - name: Install Nix uses: DeterminateSystems/nix-installer-action@main diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 00000000..10bf2089 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,91 @@ +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@v5 + + - name: "Install Nix" + uses: cachix/install-nix-action@v31.8.2 + + - 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@v7 + 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 68776638..cc314288 100644 --- a/configuration.nix +++ b/configuration.nix @@ -31,6 +31,7 @@ isMaximal: { lspSignature.enable = !isMaximal; # conflicts with blink in maximal otter-nvim.enable = isMaximal; nvim-docs-view.enable = isMaximal; + harper-ls.enable = isMaximal; }; debugger = { @@ -56,6 +57,7 @@ isMaximal: { clang.enable = isMaximal; css.enable = isMaximal; html.enable = isMaximal; + json.enable = isMaximal; sql.enable = isMaximal; java.enable = isMaximal; kotlin.enable = isMaximal; @@ -67,7 +69,7 @@ isMaximal: { typst.enable = isMaximal; rust = { enable = isMaximal; - crates.enable = isMaximal; + extensions.crates-nvim.enable = isMaximal; }; # Language modules that are not as common. @@ -84,8 +86,11 @@ 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; @@ -188,6 +193,7 @@ 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 49f90b80..662dd403 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -92,7 +92,7 @@ # Generate the HTML manual pages html = pkgs.callPackage ./manual.nix { - inherit release; + inherit inputs release; inherit (nvimModuleDocs) optionsJSON; }; in { diff --git a/docs/manual.nix b/docs/manual.nix index 50a5dab4..132c20ef 100644 --- a/docs/manual.nix +++ b/docs/manual.nix @@ -1,114 +1,47 @@ { - lib, - stdenvNoCC, - fetchzip, - runCommandLocal, - # build inputs - nixos-render-docs, - documentation-highlighter, - dart-sass, + inputs, path, - # nrd configuration - release, + stdenvNoCC, + runCommandLocal, optionsJSON, + release, } @ 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 - stdenvNoCC.mkDerivation { - name = "nvf-manual"; - src = builtins.path { - name = "nvf-manual-${manual-release}"; - path = lib.sourceFilesBySuffices ./manual [".md" ".md.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 - strictDependencies = true; - nativeBuildInputs = [nixos-render-docs]; + # 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 - postPatch = '' - ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json - ''; + # 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} - buildPhase = '' - dest="$out/share/doc/nvf" - mkdir -p "$(dirname "$dest")" - mkdir -p $dest/{highlightjs,script} + # 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" - # 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