mirror of
https://github.com/sbrow/nix.git
synced 2026-06-27 18:58:32 -04:00
Compare commits
12 Commits
fe4be18401
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78cdffd0d8 | ||
|
|
1b083a4c5b | ||
|
|
7325588a0f | ||
|
|
30309a45c4 | ||
|
|
2c9f80d84b | ||
|
|
426298e348 | ||
|
|
4b6e7072da | ||
|
|
0caabaf5a2 | ||
|
|
e815d8745b | ||
|
|
34840540c3 | ||
|
|
d48b7f620c | ||
|
|
f90355cc2d |
3
templates/go/.air.toml
Normal file
3
templates/go/.air.toml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
tmp_dir = "var/air"
|
||||||
|
|
||||||
|
env_files = [".env"]
|
||||||
4
templates/go/.gitignore
vendored
4
templates/go/.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
.direnv
|
.direnv
|
||||||
node_modules
|
.env
|
||||||
|
result
|
||||||
|
var
|
||||||
vendor
|
vendor
|
||||||
|
|||||||
86
templates/go/.golangci.yml
Normal file
86
templates/go/.golangci.yml
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
version: "2"
|
||||||
|
linters:
|
||||||
|
default: standard
|
||||||
|
# default: all
|
||||||
|
enable:
|
||||||
|
- bidichk
|
||||||
|
- containedctx
|
||||||
|
- contextcheck
|
||||||
|
- decorder
|
||||||
|
- depguard
|
||||||
|
- dupl
|
||||||
|
- err113
|
||||||
|
- errchkjson
|
||||||
|
- errorlint
|
||||||
|
- exhaustive
|
||||||
|
- fatcontext
|
||||||
|
- gocritic
|
||||||
|
- gosec
|
||||||
|
- govet
|
||||||
|
- intrange
|
||||||
|
- maintidx
|
||||||
|
- modernize
|
||||||
|
- nlreturn
|
||||||
|
- noctx
|
||||||
|
- perfsprint
|
||||||
|
- prealloc
|
||||||
|
- recvcheck
|
||||||
|
- rowserrcheck
|
||||||
|
- sloglint
|
||||||
|
- unparam
|
||||||
|
- unused
|
||||||
|
- usestdlibvars
|
||||||
|
- whitespace
|
||||||
|
disable:
|
||||||
|
# Deprecateed
|
||||||
|
- gomodguard
|
||||||
|
- wsl
|
||||||
|
|
||||||
|
# Comment checker
|
||||||
|
- revive
|
||||||
|
- wrapcheck # reinclude
|
||||||
|
|
||||||
|
# Not useful
|
||||||
|
- cyclop
|
||||||
|
- funlen
|
||||||
|
- gocognit
|
||||||
|
- gocyclo
|
||||||
|
- nestif
|
||||||
|
- noinlineerr
|
||||||
|
- tagalign
|
||||||
|
- tagliatelle
|
||||||
|
- varnamelen
|
||||||
|
- wsl_v5
|
||||||
|
settings:
|
||||||
|
depguard:
|
||||||
|
rules:
|
||||||
|
main:
|
||||||
|
list-mode: strict
|
||||||
|
files:
|
||||||
|
"**/main.go"
|
||||||
|
allow:
|
||||||
|
- "$gostd"
|
||||||
|
catchall:
|
||||||
|
list-mode: strict
|
||||||
|
files:
|
||||||
|
- "!$test"
|
||||||
|
- "!**/main.go"
|
||||||
|
- "**/internal/**"
|
||||||
|
allow:
|
||||||
|
- "$gostd"
|
||||||
|
- "golang.org/**"
|
||||||
|
recvcheck:
|
||||||
|
disable-builtin: false
|
||||||
|
exclusions:
|
||||||
|
- "*.TableName"
|
||||||
|
sloglint:
|
||||||
|
attr-only: true
|
||||||
|
context: "scope"
|
||||||
|
key-naming-case: "camel"
|
||||||
|
static-msg: true
|
||||||
|
# no-raw-keys: true
|
||||||
|
msg-style: "lowercased"
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- goimports
|
||||||
|
- golines
|
||||||
36
templates/go/flake.lock
generated
36
templates/go/flake.lock
generated
@@ -5,11 +5,11 @@
|
|||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751413152,
|
"lastModified": 1778716662,
|
||||||
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
|
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
|
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -20,11 +20,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751949589,
|
"lastModified": 1779877693,
|
||||||
"narHash": "sha256-mgFxAPLWw0Kq+C8P3dRrZrOYEQXOtKuYVlo9xvPntt8=",
|
"narHash": "sha256-NOF9NAREhxr50bbBfVcVOq+ArCMSoe8dP79Pk2uyARk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9b008d60392981ad674e04016d25619281550a9d",
|
"rev": "4100e830e085863741bc69b156ec4ccd53ab5be0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -34,11 +34,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751159883,
|
"lastModified": 1777168982,
|
||||||
"narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=",
|
"narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab",
|
"rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -49,11 +49,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751949589,
|
"lastModified": 1779877693,
|
||||||
"narHash": "sha256-mgFxAPLWw0Kq+C8P3dRrZrOYEQXOtKuYVlo9xvPntt8=",
|
"narHash": "sha256-NOF9NAREhxr50bbBfVcVOq+ArCMSoe8dP79Pk2uyARk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9b008d60392981ad674e04016d25619281550a9d",
|
"rev": "4100e830e085863741bc69b156ec4ccd53ab5be0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -65,11 +65,11 @@
|
|||||||
},
|
},
|
||||||
"process-compose-flake": {
|
"process-compose-flake": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1749418557,
|
"lastModified": 1767863885,
|
||||||
"narHash": "sha256-wJHHckWz4Gvj8HXtM5WVJzSKXAEPvskQANVoRiu2w1w=",
|
"narHash": "sha256-XXekPAxzbv1DmHFo3Elmj/vDnvWc1V0jdDUvM0/Wf7k=",
|
||||||
"owner": "Platonic-Systems",
|
"owner": "Platonic-Systems",
|
||||||
"repo": "process-compose-flake",
|
"repo": "process-compose-flake",
|
||||||
"rev": "91dcc48a6298e47e2441ec76df711f4e38eab94e",
|
"rev": "99bea96cf269cfd235833ebdf645b567069fd398",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -94,11 +94,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752055615,
|
"lastModified": 1775636079,
|
||||||
"narHash": "sha256-19m7P4O/Aw/6+CzncWMAJu89JaKeMh3aMle1CNQSIwM=",
|
"narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "c9d477b5d5bd7f26adddd3f96cfd6a904768d4f9",
|
"rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -58,17 +58,47 @@
|
|||||||
settings.formatter.prettier =
|
settings.formatter.prettier =
|
||||||
{
|
{
|
||||||
excludes = [
|
excludes = [
|
||||||
|
"assets/vendor/**"
|
||||||
"public/**"
|
"public/**"
|
||||||
"resources/js/modernizr.js"
|
"resources/js/modernizr.js"
|
||||||
"storage/app/caniuse.json"
|
"storage/app/caniuse.json"
|
||||||
|
"templates/**"
|
||||||
"*.md"
|
"*.md"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Appears to be broken?
|
||||||
|
programs.golangci-lint.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
process-compose.default.settings.processes = {
|
packages.default = pkgs.buildGoModule rec {
|
||||||
|
# pname = "package-name";
|
||||||
|
version = "0.1.0";
|
||||||
|
src = ./.;
|
||||||
|
vendorHash = "sha256-0000000000000000000000000000000000000000000=";
|
||||||
|
|
||||||
|
env.CGO_ENABLED = 1;
|
||||||
|
buildInputs = [ pkgs.sqlite ];
|
||||||
|
|
||||||
|
# subPackages = [ ];
|
||||||
|
|
||||||
|
ldflags = [
|
||||||
|
"-X git.verticalaxion.com/verticalaxion/sales-tracker-go/internal/config.Version=${version}"
|
||||||
|
];
|
||||||
|
|
||||||
|
# postInstall = ''
|
||||||
|
# mkdir -p $out/lib
|
||||||
|
# cp -r ${src}/templates $out/lib/templates
|
||||||
|
# cp -r ${src}/assets $out/lib/assets
|
||||||
|
# '';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Run this with nix run .#dev
|
||||||
|
process-compose.dev.settings.processes = {
|
||||||
mail.command = "${pkgs.mailhog}/bin/MailHog";
|
mail.command = "${pkgs.mailhog}/bin/MailHog";
|
||||||
web.command = "${pkgs.air}/bin/air --";
|
web.command = "${pkgs.caddy}/bin/caddy run";
|
||||||
|
web.is_elevated = true;
|
||||||
|
docs.command = "${pkgs.pkgsite}/bin/pkgsite --http localhost:6060";
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell
|
devShells.default = pkgs.mkShell
|
||||||
@@ -82,13 +112,16 @@
|
|||||||
tailwindcss_4
|
tailwindcss_4
|
||||||
goose
|
goose
|
||||||
|
|
||||||
# IDE
|
# code quality
|
||||||
gopls
|
gopls
|
||||||
gotools
|
gotools
|
||||||
golangci-lint
|
golangci-lint
|
||||||
|
typescript-language-server
|
||||||
|
|
||||||
|
# IDE
|
||||||
unstable.helix
|
unstable.helix
|
||||||
typescript-language-server
|
typescript-language-server
|
||||||
|
# vscode-json-languageserver
|
||||||
vscode-langservers-extracted
|
vscode-langservers-extracted
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user