diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2379973f..121915c4 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -8,7 +8,7 @@ ## Preface -[LICENSE]: ../LICENSE +[LICENSE]: /LICENSE I am glad you are thinking about contributing to nvf! The project is shaped by contributors and user feedback, and all contributions are appreciated. @@ -30,7 +30,7 @@ personally. ## Contributing Process -[pull request template]: ./PULL_REQUEST_TEMPLATE.md +[pull request template]: /.github/PULL_REQUEST_TEMPLATE.md The contribution process is mostly documented in the [pull request template]. When you create a pull request, you will find a checklist of items to complete diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 66fe9c0f..04839ff6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -24,8 +24,8 @@ it above in your description. --> [editorconfig]: https://editorconfig.org -[changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/release-notes -[hacking nvf]: https://notashelf.github.io/nvf/index.xhtml#sec-guidelines +[changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/manual/release-notes +[hacking nvf]: https://nvf.notashelf.dev/hacking.html#sec-guidelines - [ ] I have updated the [changelog] as per my changes - [ ] I have tested, and self-reviewed my code 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/backport.yml b/.github/workflows/backport.yml index 7868e55b..0542862e 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -17,13 +17,13 @@ jobs: if: | github.event.pull_request.merged == true && startsWith(github.event.label.name, 'backport-') steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha }} token: ${{ steps.app-token.outputs.token }} - name: Backport Action - uses: korthout/backport-action@v3 + uses: korthout/backport-action@v4 with: # Regex pattern for labels that should trigger a backport AND extracts the target branch # from the name (e.g. v0.x or v0.x.y; we use zerover). This action will ONLY proceed if diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 13995cb6..63a0fd6f 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -21,11 +21,16 @@ jobs: - nix - maximal steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 name: Checkout - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main + uses: cachix/install-nix-action@v31.9.0 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + substituters = https://cache.nixos.org/ https://feel-co.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - uses: cachix/cachix-action@v16 with: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 90bfb431..e3a3a7ed 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,24 +17,32 @@ jobs: if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v5 - - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main + uses: actions/checkout@v6 + - uses: cachix/install-nix-action@v31.9.0 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + substituters = https://cache.nixos.org/ https://feel-co.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - name: Check Flake run: nix flake check - format-with-alejandra: + format-sources: name: "Check formatting" runs-on: ubuntu-latest if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main + uses: cachix/install-nix-action@v31.9.0 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + substituters = https://cache.nixos.org/ https://feel-co.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - name: Check formatting via Alejandra run: nix run nixpkgs#alejandra -- --check . --exclude npins @@ -56,7 +64,7 @@ jobs: if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Check for typos uses: crate-ci/typos@master @@ -83,11 +91,14 @@ jobs: - docs-manpages - docs-json steps: - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 + - uses: cachix/install-nix-action@v31.9.0 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + substituters = https://cache.nixos.org/ https://feel-co.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - name: Set default git branch (to reduce log spam) run: git config --global init.defaultBranch main @@ -101,7 +112,7 @@ jobs: run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> ${GITHUB_OUTPUT} - name: Upload doc artifacts - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: "${{ matrix.package }}" path: result/share/doc/nvf @@ -109,13 +120,16 @@ 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 - - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 + - uses: cachix/install-nix-action@v31.9.0 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + substituters = https://cache.nixos.org/ https://feel-co.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - name: Build linkcheck package run: nix build .#docs-linkcheck -Lv @@ -126,7 +140,7 @@ jobs: if: "!contains(github.event.pull_request.title, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 2 # slows down checkout, but we need to compare against the previous commit on push events @@ -148,7 +162,12 @@ jobs: cat "$HOME/changed_files" - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main + uses: cachix/install-nix-action@v31.9.0 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + substituters = https://cache.nixos.org/ https://feel-co.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - name: Checking Editorconfig conformance shell: bash diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 1ed6a1ec..ec153088 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@v5 + uses: actions/checkout@v6 - 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 a238a41d..984654d2 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -3,7 +3,7 @@ name: Build and Preview Manual on: workflow_dispatch: pull_request_target: - types: [opened, synchronize, reopened, closed] + types: [opened, synchronize, reopened, labeled, unlabeled, edited] paths: - ".github/workflows/docs-preview.yml" - "modules/**" @@ -24,11 +24,13 @@ jobs: build-preview: runs-on: ubuntu-latest steps: - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - - - name: Checkout - uses: actions/checkout@v5 + - uses: actions/checkout@v6 + - uses: cachix/install-nix-action@v31.9.0 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + substituters = https://cache.nixos.org/ https://feel-co.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= - name: Set default git branch (to reduce log spam) run: git config --global init.defaultBranch main @@ -49,7 +51,7 @@ jobs: mkdir -p $PREVIEW_DIR # Copy the build files to the preview subdirectory - cp -rvf ../result/share/doc/nvf/* ./$PREVIEW_DIR + cp -rvf ../result/share/doc/* ./$PREVIEW_DIR # Configure git to use the GitHub Actions token for authentication git config --global user.name "GitHub Actions" @@ -71,7 +73,7 @@ jobs: id: prelude run: | PR_NUMBER=${{ github.event.pull_request.number }} - URL="https://${{ github.repository_owner }}.github.io/nvf/docs-preview-${PR_NUMBER}/" + URL="https:///nvf.notashelf.dev/docs-preview-${PR_NUMBER}/" # Propagate non-interpolatable environment vars echo "URL=$URL" >> "$GITHUB_OUTPUT" @@ -127,7 +129,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Delete preview for closed/merged PR run: | @@ -164,7 +166,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Double check preview directory deletion run: | diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 3b4cc38b..4b6e2eff 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@v5 + - uses: actions/checkout@v6 - name: print latest_commit run: echo ${{ github.sha }} @@ -43,12 +43,20 @@ jobs: if: ${{ needs.check_date.outputs.should_run != 'false' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 - - uses: DeterminateSystems/nix-installer-action@main + - uses: actions/checkout@v6 + - uses: cachix/install-nix-action@v31.9.0 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + substituters = https://cache.nixos.org/ https://feel-co.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w= + - run: | nix build .#docs -Lv - cp -r result/share/doc/nvf public + cp -r result/share/doc public + - uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public + cname: nvf.notashelf.dev diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 00000000..f1c5cc4b --- /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@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/README.md b/README.md index 7786636a..b83772ae 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,9 @@ ## Features -[standalone]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-installation -[NixOS module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-nixos -[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm +[standalone]: https://nvf.notashelf.dev/#ch-standalone-installation +[NixOS module]: https://nvf.notashelf.dev/#ch-standalone-nixos +[Home-Manager module]: https://nvf.notashelf.dev/#ch-standalone-hm [release notes]: https://notashelf.github.io/nvf/release-notes.html [discussions tab]: https://github.com/notashelf/nvf/discussions [FAQ section]: #frequently-asked-questions diff --git a/configuration.nix b/configuration.nix index 68776638..b9e3b8ec 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,8 +69,9 @@ isMaximal: { typst.enable = isMaximal; rust = { enable = isMaximal; - crates.enable = isMaximal; + extensions.crates-nvim.enable = isMaximal; }; + toml.enable = isMaximal; # Language modules that are not as common. assembly.enable = false; @@ -84,8 +87,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 +194,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; @@ -208,7 +215,6 @@ isMaximal: { }; notes = { - obsidian.enable = false; # FIXME: neovim fails to build if obsidian is enabled neorg.enable = false; orgmode.enable = false; mind-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..4bbd75a0 100644 --- a/docs/manual.nix +++ b/docs/manual.nix @@ -1,114 +1,44 @@ { - 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 --config-file ${./ndg.toml} html \ + --jobs $NIX_BUILD_CORES --title "NVF" \ + --module-options ${optionsJSON}/share/doc/nixos/options.json \ + --manpage-urls ${path}/doc/manpage-urls.json \ + --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