Skip to content

nix-utilities/prettier-with-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Prettier With Plugins

Nix re-packaging of prettier to enable plugins

Byte size of Prettier With Plugins Open Issues Open Pull Requests Latest commits License



Requirements

Install the NixOS and/or Nix package manager via official instructions;

https://nixos.org/nixos/manual/


Quick Start

Clone this project...

Linux/MacOS

mkdir -vp ~/git/hub/nix-utilities

cd ~/git/hub/nix-utilities

git clone [email protected]:nix-utilities/prettier-with-plugins.git

Usage

home.nix (snippet)

{ config, pkgs, lib, ... }:
let
  prettier-with-plugins = import /home/USER/git/hub/nix-utilities/prettier-with-plugins {
    inherit lib pkgs;
  };

  prettierCustomized = prettier-with-plugins.prettier {
    enabled = with prettier-with-plugins.plugins; [
      ## Third-party
      prettier-plugin-apex
      prettier-plugin-astro
      prettier-plugin-elm
      prettier-plugin-erb
      prettier-plugin-gherkin
      prettier-plugin-glsl
      prettier-plugin-go-template
      prettier-plugin-jinja-template
      prettier-plugin-kotlin
      prettier-plugin-motoko
      prettier-plugin-prisma
      prettier-plugin-properties
      prettier-plugin-rust
      prettier-plugin-sh
      prettier-plugin-solidity
      prettier-plugin-sql
      prettier-plugin-sql-cst
      prettier-plugin-svelte
      prettier-plugin-toml
    ]
    ++ (with prettier-with-plugins; [
      ## Official
      plugins."@prettier/plugin-php"
      plugins."@prettier/plugin-pug"
      plugins."@prettier/plugin-ruby"
      plugins."@prettier/plugin-xml"
      ## Third-party
      plugins."@stedi/prettier-plugin-jsonata"
    ]);
in
{
  home-manager.users."yourName".config.programs.vim {
    enable = true;

    plugins = with pkgs.vimPlugins; [
      vim-prettier
    ];

    extraConfig = ''
      autocmd FileType php,ruby,xml,astro,rust,sh,solidity,sql,toml let b:prettier_exec_cmd = "prettier-stylelint"
      let g:prettier#exec_cmd_path = "${prettierCustomized}/bin/prettier"
    '';
  };
}

Then rebuild as usual!


Notes

This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.

TODO: figure out how Nginx is more broken than other NodeJS stuff

Adding prettier-plugin-nginx to enabled configuration...

   prettierCustomized = prettier-with-plugins.prettier {
     enabled = with prettier-with-plugins.plugins; [
+      prettier-plugin-nginx

... and rebuild results in following error;

Executing versionCheckPhase
Did not find version 3.5.3 in the output of the command /nix/store/<HASH>-prettier-3.5.3/bin/prettier --help
[error] Cannot find module 'prettier/doc'
[error] Require stack:
[error] - {{storeDir}}/lib/node_modules/prettier-plugin-nginx/dist/index.js
Did not find version 3.5.3 in the output of the command /nix/store/<HASH>-prettier-3.5.3/bin/prettier --version
[error] Cannot find module 'prettier/doc'
[error] Require stack:
[error] - {{storeDir}}/lib/node_modules/prettier-plugin-nginx/dist/index.js

Contributing

Options for contributing to prettier-with-plugins and nix-utilities


Forking

Start making a Fork of this repository to an account that you have write permissions for.

cd ~/git/hub/nix-utilities/prettier-with-plugins

git remote add fork [email protected]:<NAME>/prettier-with-plugins.git
  • Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/nix-utilities/prettier-with-plugins


git commit -F- <<'EOF'
:bug: Fixes #42 Issue


**Edits**


- `<SCRIPT-NAME>` script, fixes some bug reported in issue
EOF


git push fork main

Note, the -u option may be used to set fork as the default remote, eg. git push -u fork main however, this will also default the fork remote for pulling from too! Meaning that pulling updates from origin must be done explicitly, eg. git pull origin main

  • Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is https://github.com/<NAME>/<REPO>/pull/new/<BRANCH>

Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.


Sponsor

Thanks for even considering it!

Via Liberapay you may sponsor__shields_io__liberapay on a repeating basis.

Regardless of if you're able to financially support projects such as prettier-with-plugins that nix-utilities maintains, please consider sharing projects that are useful with others, because one of the goals of maintaining Open Source repositories is to provide value to the community.


Attribution


License

prettier-with-plugins: Nix re-packaging of prettier to enable plugins
Copyright (C) 2025 S0AndS0

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

For further details review full length version of AGPL-3.0 License.


Plugin licenses as of 2025-08-29

Apache 2.0

BSD 3 Clause license

GPL 3.0

MIT

About

Nix re-packaging of prettier to enable plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published