1
0
Fork 0

Update deps, treefmt improvements

This commit is contained in:
Daniel Kempkens 2023-07-13 19:57:12 +02:00
parent c581b9cf26
commit a7cdb5db58
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
7 changed files with 45 additions and 34 deletions

View file

@ -213,6 +213,21 @@
"type": "github"
}
},
"flake-root": {
"locked": {
"lastModified": 1680964220,
"narHash": "sha256-dIdTYcf+KW9a4pKHsEbddvLVSfR1yiAJynzg2x0nfWg=",
"owner": "srid",
"repo": "flake-root",
"rev": "f1c0b93d05bdbea6c011136ba1a135c80c5b326c",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
@ -364,11 +379,11 @@
]
},
"locked": {
"lastModified": 1689188243,
"narHash": "sha256-v3EDlWWLBQ+LIRWZ03jd8bnvHLyNae6iaqd03rbYhwo=",
"lastModified": 1689260591,
"narHash": "sha256-d4lwp7mLOuXVOntmFm3nIR7Q1sCIw7wfpKB1dZVKtyw=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "2ad716c2786dabf8f458ae1e7d343775d3acc65c",
"rev": "d468d4e813bb3ebe91e8d82ffed2f21852fa8909",
"type": "github"
},
"original": {
@ -468,6 +483,7 @@
"deploy-rs": "deploy-rs",
"disko": "disko",
"flake-parts": "flake-parts",
"flake-root": "flake-root",
"home-manager": "home-manager_2",
"nifoc-overlay": "nifoc-overlay",
"nix-darwin": "nix-darwin",

View file

@ -8,6 +8,8 @@
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
@ -111,6 +113,7 @@
};
imports = [
inputs.flake-root.flakeModule
inputs.treefmt-nix.flakeModule
];
@ -122,12 +125,13 @@
perSystem = { config, pkgs, ... }: {
treefmt = {
projectRootFile = "flake.nix";
inherit (config.flake-root) projectRootFile;
programs = {
fnlfmt.enable = true;
nixpkgs-fmt.enable = true;
shfmt.enable = true;
yamlfmt.enable = true;
};
};
@ -135,6 +139,7 @@
name = "dotfiles";
inputsFrom = [
config.flake-root.devShell
config.treefmt.build.devShell
];
};

View file

@ -1,19 +1,19 @@
(let [formatter (require :formatter)
formatter-utils (require :formatter.util)
treefmt-exists (vim.fn.executable :treefmt)
treefmt-formatter #{:exe :treefmt
:stdin false
:tempfile_prefix :treefmt
:tempfile_postfix (.. "."
(formatter-utils.get_current_buffer_file_extension))}]
treefmt-formatter #{:exe :treefmt :stdin false :tempfile_prefix :treefmt}]
(fn builtin-formatter [ft formatter]
(let [file (.. :formatter.filetypes. ft)]
(. (require file) formatter)))
(fn prefer-treefmt [ft formatter]
(fn other-formatter [ft-or-fn formatter]
(if (= (type ft-or-fn) :function) (ft-or-fn)
((builtin-formatter ft-or-fn formatter))))
(fn prefer-treefmt [ft-or-fn formatter]
(if (= treefmt-exists 1)
(treefmt-formatter)
((builtin-formatter ft formatter))))
(other-formatter ft-or-fn formatter)))
(formatter.setup {:logging true
:log_level vim.log.levels.WARN
@ -28,5 +28,8 @@
:sh [(prefer-treefmt :sh :shfmt)]
:toml [(prefer-treefmt :toml :taplo)]
:typescript [(prefer-treefmt :typescript
:prettier)]}}))
:prettier)]
:yaml [(prefer-treefmt #{:exe :yamlfmt
:args [:-in]
:stdin true})]}}))

View file

@ -49,6 +49,7 @@ in
shfmt
statix
yamllint
yamlfmt
] ++ optionals isDarwin [
xcbuild
];

View file

@ -89,8 +89,8 @@ in
src = fetchFromGitHub {
owner = "ggandor";
repo = "leap.nvim";
rev = "059cc61437ae8479768025ba837f3caee16a65e6";
sha256 = "1kr3agfhz8mplycnnlqwav2s0rylbrn0iz762hr9hdmraj18rjr2";
rev = "bfb20783d951cf349ee8bab7e0f468351176dd75";
sha256 = "0igwm79nsl72i5ygh5q9q0jpd8xhdrjv5n0py2j4q9ar1r1ly391";
fetchSubmodules = false;
};
};
@ -279,8 +279,8 @@ in
src = fetchFromGitHub {
owner = "mfussenegger";
repo = "nvim-lint";
rev = "eecf96bf2fbd12042933bb1e6193c358749e2b9b";
sha256 = "0mlhmrlxbhgzy1dfff2v9rbl8abxfsdxwjbdw4fwmc246crxdld1";
rev = "808e8fdbee02ed2c6efc17e70c7453fccf5d5a1d";
sha256 = "1q0ryrsmiil2l2dfhlxnkgahxw5jnfbiv1b48ly2iscqldrsm9sb";
fetchSubmodules = false;
};
};
@ -418,12 +418,12 @@ in
};
formatter-nvim = buildVimPluginFrom2Nix {
pname = "formatter.nvim";
version = "2023-04-30";
version = "2023-07-13";
src = fetchFromGitHub {
owner = "mhartington";
repo = "formatter.nvim";
rev = "fa4f2729cc2909db599169f22d8e55632d4c8d59";
sha256 = "0hv79gdg7cgqr3a8vw1ysc48f6i3b8xabbglxspm5mbpf22c8xbk";
rev = "9bf2e7e294b00bac87c6123c889828ee08dc9b46";
sha256 = "0hmlh6qcra7sfq0i989cxs5jmgk6774bljzvq9m17ybwj3imb14f";
fetchSubmodules = false;
};
};

View file

@ -1,24 +1,19 @@
---
# Utils
- src: nvim-lua/popup.nvim
- src: nvim-lua/plenary.nvim
- src: kyazdani42/nvim-web-devicons
# Keybindings
- src: ojroques/nvim-osc52
- src: gbprod/yanky.nvim
- src: gbprod/cutlass.nvim
- src: gbprod/substitute.nvim
- src: ggandor/leap.nvim
# Themes
- src: Mofiqul/dracula.nvim
# Syntax
- src: nvim-treesitter/nvim-treesitter
- src: HiPhish/nvim-ts-rainbow2
- src: nvim-treesitter/playground
# Telescope
- src: nvim-telescope/telescope.nvim
- src: nvim-telescope/telescope-fzf-native.nvim
@ -29,24 +24,19 @@
- src: nvim-telescope/telescope-ui-select.nvim
- src: "https://git.sr.ht/~havi/telescope-toggleterm.nvim"
- src: debugloop/telescope-undo.nvim
# LSP
- src: neovim/nvim-lspconfig
- src: mfussenegger/nvim-jdtls
- src: onsails/lspkind.nvim
- src: SmiteshP/nvim-navic
- src: RRethy/vim-illuminate
# Linter
- src: mfussenegger/nvim-lint
# Comments
- src: numtostr/comment.nvim
# Snippets
- src: L3MON4D3/LuaSnip
- src: rafamadriz/friendly-snippets
# cmp
- src: hrsh7th/nvim-cmp
- src: hrsh7th/cmp-nvim-lsp
@ -57,19 +47,15 @@
- src: ray-x/cmp-treesitter
- src: hrsh7th/cmp-cmdline
- src: hrsh7th/cmp-nvim-lsp-document-symbol
# Formatting
- src: mhartington/formatter.nvim
# Pairs
- src: windwp/nvim-autopairs
- src: windwp/nvim-ts-autotag
- src: andymass/vim-matchup
# Textobjects
- src: nvim-treesitter/nvim-treesitter-textobjects
- src: kylechui/nvim-surround
# UI
- src: rebelot/heirline.nvim
- src: lukas-reineke/indent-blankline.nvim

View file

@ -35,7 +35,7 @@ for plugin in "${plugin_array[@]}"; do
echo "Updating ${owner}/${repo} ..."
if [[ "$raw_src" = http* ]]; then
if [[ $raw_src == http* ]]; then
clone_src="$raw_src"
else
clone_src="https://github.com/${owner}/${repo}.git"