mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-06-13 12:31:05 +02:00
chore: make project helix ready
This commit is contained in:
parent
77d44e51fa
commit
81e4b0e70f
4 changed files with 83 additions and 33 deletions
5
.helix/languages.toml
Normal file
5
.helix/languages.toml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[[language]]
|
||||||
|
name = "go"
|
||||||
|
auto-format = true
|
||||||
|
formatter = { command = "gofumpt" }
|
||||||
|
|
21
flake.lock
generated
21
flake.lock
generated
|
@ -13,20 +13,25 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "flake-utils",
|
"owner": "numtide",
|
||||||
"type": "indirect"
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 0,
|
"lastModified": 1749285348,
|
||||||
"narHash": "sha256-WFZDy4bG2RkkCQloIEG8BXEvzyKklFVJbAismOJsIp4=",
|
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
|
||||||
"path": "/nix/store/c77dsgfxjywplw8bk8s8jlkdsr7a1bi9-source",
|
"owner": "NixOS",
|
||||||
"type": "path"
|
"repo": "nixpkgs",
|
||||||
|
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
|
||||||
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"owner": "NixOS",
|
||||||
"type": "indirect"
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
|
76
flake.nix
76
flake.nix
|
@ -1,27 +1,53 @@
|
||||||
{
|
{
|
||||||
outputs = {
|
inputs = {
|
||||||
self,
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
nixpkgs,
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
flake-utils,
|
};
|
||||||
systems,
|
|
||||||
}:
|
outputs =
|
||||||
flake-utils.lib.eachSystem (import systems)
|
{
|
||||||
(system: let
|
self,
|
||||||
pkgs = import nixpkgs {
|
nixpkgs,
|
||||||
inherit system;
|
flake-utils,
|
||||||
};
|
systems,
|
||||||
in {
|
}:
|
||||||
devShells.default = pkgs.mkShell {
|
flake-utils.lib.eachSystem (import systems) (
|
||||||
buildInputs = with pkgs; [
|
system:
|
||||||
glibc.static
|
let
|
||||||
go
|
pkgs = import nixpkgs {
|
||||||
gofumpt
|
inherit system;
|
||||||
golangci-lint
|
};
|
||||||
gopls
|
in
|
||||||
gotools
|
{
|
||||||
go-tools
|
devShells = {
|
||||||
sqlite-interactive
|
default = pkgs.mkShell {
|
||||||
];
|
buildInputs = with pkgs; [
|
||||||
};
|
glibc.static
|
||||||
});
|
go
|
||||||
|
gofumpt
|
||||||
|
golangci-lint
|
||||||
|
gopls
|
||||||
|
gotools
|
||||||
|
go-tools
|
||||||
|
sqlite-interactive
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
helix = pkgs.mkShell {
|
||||||
|
packages = with pkgs; [
|
||||||
|
marksman # markdown
|
||||||
|
nodePackages.prettier # formatting for markdown and yaml
|
||||||
|
taplo # toml
|
||||||
|
bash-language-server
|
||||||
|
shellcheck # dependency for bash-ls
|
||||||
|
shfmt # dependency for bash-ls
|
||||||
|
yaml-language-server
|
||||||
|
treefmt # formatter multiplexer
|
||||||
|
nil # nix ls
|
||||||
|
nixfmt-rfc-style # formatter for nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
14
treefmt.toml
Normal file
14
treefmt.toml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
formatters = ["gofumpt", "prettier", "nixfmt"]
|
||||||
|
|
||||||
|
[formatter.gofumpt]
|
||||||
|
command = "gofumpt"
|
||||||
|
includes = [ "*.go" ]
|
||||||
|
|
||||||
|
[formatter.prettier]
|
||||||
|
command = "prettier"
|
||||||
|
includes = [ "*.md", "*.yaml" ]
|
||||||
|
|
||||||
|
[formatter.nixfmt]
|
||||||
|
command = "nixfmt"
|
||||||
|
includes = [ "*.nix" ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue