Compare commits
15 Commits
d3596fc7e9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
bd632f21ef
|
|||
|
0af7547c4b
|
|||
|
2ac8a3a57f
|
|||
|
61a8a5c913
|
|||
| 75133624e1 | |||
| 9cd9e45cfd | |||
| 49a4dc9631 | |||
| a7dabc5a1b | |||
| 77e8f694ea | |||
| 76ab1dd910 | |||
| 897d053117 | |||
| bf87bf2064 | |||
| 2303d4888e | |||
| 986890b044 | |||
| 96407def3f |
@@ -1,4 +1,5 @@
|
|||||||
.env
|
.env
|
||||||
.envrc
|
.envrc
|
||||||
.direnv
|
.direnv
|
||||||
|
.devenv
|
||||||
result
|
result
|
||||||
|
|||||||
+98
-52
@@ -1,77 +1,123 @@
|
|||||||
linters-settings:
|
version: "2"
|
||||||
|
|
||||||
|
run:
|
||||||
|
timeout: 3m
|
||||||
|
relative-path-mode: gitroot
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- bidichk
|
||||||
|
- bodyclose
|
||||||
|
- canonicalheader
|
||||||
|
- copyloopvar
|
||||||
|
- errcheck
|
||||||
|
- errorlint
|
||||||
|
- exhaustive
|
||||||
|
- forbidigo
|
||||||
|
- gocheckcompilerdirectives
|
||||||
|
- gochecksumtype
|
||||||
|
- goconst
|
||||||
|
- gocritic
|
||||||
|
- gosec
|
||||||
|
- govet
|
||||||
|
- ineffassign
|
||||||
|
- makezero
|
||||||
|
- mirror
|
||||||
|
- misspell
|
||||||
|
- nakedret
|
||||||
|
- nilnil
|
||||||
|
- noctx
|
||||||
|
- nolintlint
|
||||||
|
- nosprintfhostport
|
||||||
|
- perfsprint
|
||||||
|
- prealloc
|
||||||
|
- predeclared
|
||||||
|
- sloglint
|
||||||
|
- spancheck
|
||||||
|
- staticcheck
|
||||||
|
- unconvert
|
||||||
|
- unconvert
|
||||||
|
- unparam
|
||||||
|
- unused
|
||||||
|
- whitespace
|
||||||
|
- usestdlibvars
|
||||||
|
- wastedassign
|
||||||
|
- whitespace
|
||||||
|
- wsl_v5
|
||||||
|
settings:
|
||||||
errcheck:
|
errcheck:
|
||||||
check-type-assertions: true
|
check-type-assertions: true
|
||||||
gci:
|
forbidigo:
|
||||||
sections:
|
analyze-types: true
|
||||||
- standard
|
|
||||||
- default
|
|
||||||
- prefix(go.yrps.dev)
|
|
||||||
gocritic:
|
gocritic:
|
||||||
|
disabled-checks:
|
||||||
|
- hugeParam
|
||||||
|
- paramTypeCombine
|
||||||
|
- sloppyReassign
|
||||||
enabled-tags:
|
enabled-tags:
|
||||||
- diagnostic
|
- diagnostic
|
||||||
- experimental
|
- experimental
|
||||||
- opinionated
|
- opinionated
|
||||||
- performance
|
- performance
|
||||||
- style
|
- style
|
||||||
disabled-checks:
|
|
||||||
- hugeParam
|
|
||||||
- paramTypeCombine
|
|
||||||
- sloppyReassign
|
|
||||||
govet:
|
govet:
|
||||||
enable-all: true
|
enable:
|
||||||
settings:
|
- shadow
|
||||||
shadow:
|
|
||||||
strict: true
|
|
||||||
nolintlint:
|
nolintlint:
|
||||||
require-explanation: true
|
require-explanation: true
|
||||||
require-specific: true
|
require-specific: true
|
||||||
sloglint:
|
sloglint:
|
||||||
no-global: "all"
|
attr-only: true
|
||||||
context: "scope"
|
no-global: all
|
||||||
stylecheck:
|
context: scope
|
||||||
|
static-msg: true
|
||||||
|
key-naming-case: snake
|
||||||
|
forbidden-keys:
|
||||||
|
- time
|
||||||
|
- level
|
||||||
|
- msg
|
||||||
|
- source
|
||||||
|
staticcheck:
|
||||||
checks:
|
checks:
|
||||||
- all
|
- all
|
||||||
- -ST1000
|
- -ST1000
|
||||||
wsl:
|
wsl_v5:
|
||||||
allow-cuddle-declarations: true
|
disable:
|
||||||
|
- decl
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
presets:
|
||||||
|
- comments
|
||||||
|
- common-false-positives
|
||||||
|
- legacy
|
||||||
|
- std-error-handling
|
||||||
|
paths:
|
||||||
|
- third_party$
|
||||||
|
- builtin$
|
||||||
|
- examples$
|
||||||
|
|
||||||
linters:
|
formatters:
|
||||||
disable-all: true
|
|
||||||
enable:
|
enable:
|
||||||
- bidichk
|
|
||||||
- bodyclose
|
|
||||||
- copyloopvar
|
|
||||||
- errcheck
|
|
||||||
- errorlint
|
|
||||||
- exhaustive
|
|
||||||
- gci
|
- gci
|
||||||
- gocheckcompilerdirectives
|
|
||||||
- goconst
|
|
||||||
- gocritic
|
|
||||||
- gofumpt
|
- gofumpt
|
||||||
- gosec
|
settings:
|
||||||
- gosimple
|
gci:
|
||||||
- govet
|
sections:
|
||||||
- ineffassign
|
- standard
|
||||||
- misspell
|
- default
|
||||||
- noctx
|
- prefix(go.yrps.dev)
|
||||||
- nolintlint
|
exclusions:
|
||||||
- prealloc
|
generated: lax
|
||||||
- predeclared
|
paths:
|
||||||
- protogetter
|
- third_party$
|
||||||
- sloglint
|
- builtin$
|
||||||
- staticcheck
|
- examples$
|
||||||
- stylecheck
|
|
||||||
- unconvert
|
|
||||||
- unparam
|
|
||||||
- unused
|
|
||||||
- whitespace
|
|
||||||
- usestdlibvars
|
|
||||||
- wsl
|
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
max-issues-per-linter: 0
|
max-issues-per-linter: 0
|
||||||
max-same-issues: 0
|
max-same-issues: 0
|
||||||
exclude-use-default: false
|
|
||||||
exclude:
|
output:
|
||||||
- Error return value of .*\.Body\.Close. is not checked
|
sort-order:
|
||||||
|
- file
|
||||||
|
show-stats: false
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
import jseslint from "@eslint/js";
|
||||||
|
import eslintPluginImportX from "eslint-plugin-import-x";
|
||||||
|
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
||||||
|
import eslintPluginReact from "eslint-plugin-react";
|
||||||
|
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
|
||||||
|
import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
|
||||||
|
import eslintPluginFormatjs from "eslint-plugin-formatjs";
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
|
|
||||||
|
// This config is provided through nix environment.
|
||||||
|
// Config is meant to be injected through devshell env variable and "cp" command in .envrc to copy it in the proper path
|
||||||
|
|
||||||
|
// Install dependencies: npm i -D @eslint/js@9 eslint-plugin-import-x@4 eslint-import-resolver-typescript@3 eslint-plugin-prettier@5 eslint-config-prettier@9 eslint-plugin-react@7 eslint-plugin-react-hooks@5 eslint-plugin-react-refresh@0.4 eslint-plugin-formatjs@5 typescript-eslint@8
|
||||||
|
export default tseslint.config(
|
||||||
|
{
|
||||||
|
ignores: [
|
||||||
|
"build/",
|
||||||
|
"dist/",
|
||||||
|
"tsconfig.json",
|
||||||
|
"tsconfig.*.json",
|
||||||
|
"eslint.config.mjs",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
jseslint.configs.recommended,
|
||||||
|
...tseslint.configs.recommendedTypeChecked,
|
||||||
|
eslintPluginImportX.flatConfigs.recommended,
|
||||||
|
eslintPluginImportX.flatConfigs.typescript,
|
||||||
|
eslintPluginReact.configs.flat.recommended,
|
||||||
|
eslintPluginPrettierRecommended,
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: import.meta.dirname,
|
||||||
|
project: "./tsconfig.json",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
react: {
|
||||||
|
version: "detect",
|
||||||
|
},
|
||||||
|
"import-x/resolver": {
|
||||||
|
typescript: true,
|
||||||
|
node: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
"react-hooks": eslintPluginReactHooks,
|
||||||
|
"react-refresh": eslintPluginReactRefresh,
|
||||||
|
formatjs: eslintPluginFormatjs,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
curly: ["error"],
|
||||||
|
"no-console": ["warn"],
|
||||||
|
"no-constant-condition": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
checkLoops: "allExceptWhileTrue",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// Typescript
|
||||||
|
// Some non typescript rules must be disabled as they can report incorrect errors
|
||||||
|
"default-param-last": "off",
|
||||||
|
"@typescript-eslint/default-param-last": "error",
|
||||||
|
"dot-notation": "off",
|
||||||
|
"@typescript-eslint/dot-notation": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
allowKeywords: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"@typescript-eslint/naming-convention": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
selector: ["function", "import"],
|
||||||
|
format: ["camelCase", "PascalCase"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: ["variable"],
|
||||||
|
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: ["enum", "typeLike"],
|
||||||
|
format: ["PascalCase"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"@typescript-eslint/no-unused-vars": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
args: "after-used",
|
||||||
|
caughtErrors: "all",
|
||||||
|
caughtErrorsIgnorePattern: "^_$",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"no-use-before-define": "off",
|
||||||
|
"@typescript-eslint/no-use-before-define": "error",
|
||||||
|
"@typescript-eslint/no-misused-promises": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
checksVoidReturn: {
|
||||||
|
attributes: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"no-shadow": "off",
|
||||||
|
"@typescript-eslint/no-shadow": "error",
|
||||||
|
"no-loop-func": "off",
|
||||||
|
"@typescript-eslint/no-loop-func": "error",
|
||||||
|
"no-useless-constructor": "off",
|
||||||
|
"@typescript-eslint/no-useless-constructor": "error",
|
||||||
|
"no-return-await": "off",
|
||||||
|
"@typescript-eslint/return-await": "error",
|
||||||
|
"@typescript-eslint/prefer-promise-reject-errors": ["off"],
|
||||||
|
|
||||||
|
// Import
|
||||||
|
"import-x/no-extraneous-dependencies": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
devDependencies: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// Some issues with react import, no time to debug
|
||||||
|
"import-x/default": ["off"],
|
||||||
|
|
||||||
|
"prettier/prettier": "warn",
|
||||||
|
|
||||||
|
// React
|
||||||
|
"react-hooks/exhaustive-deps": "error",
|
||||||
|
"react-refresh/only-export-components": "warn",
|
||||||
|
"react/jsx-no-duplicate-props": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
ignoreCase: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
"react/prop-types": "off",
|
||||||
|
"react/react-in-jsx-scope": "off",
|
||||||
|
|
||||||
|
// FormaJS/INTL
|
||||||
|
"formatjs/enforce-default-message": "error",
|
||||||
|
"formatjs/enforce-id": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
idInterpolationPattern: "[sha1:contenthash:base64:6]",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"formatjs/no-id": "off",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
Generated
+175
-12
@@ -1,32 +1,195 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"devshell": {
|
"cachix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"devenv": [
|
||||||
|
"devenv"
|
||||||
|
],
|
||||||
|
"flake-compat": [
|
||||||
|
"devenv",
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
|
"git-hooks": [
|
||||||
|
"devenv",
|
||||||
|
"git-hooks"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1760971495,
|
||||||
|
"narHash": "sha256-IwnNtbNVrlZIHh7h4Wz6VP0Furxg9Hh0ycighvL5cZc=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "cachix",
|
||||||
|
"rev": "c5bfd933d1033672f51a863c47303fc0e093c2d2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "latest",
|
||||||
|
"repo": "cachix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"devenv": {
|
||||||
|
"inputs": {
|
||||||
|
"cachix": "cachix",
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
|
"nix": "nix",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728330715,
|
"lastModified": 1764927628,
|
||||||
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
|
"narHash": "sha256-AH2H5O9i7k3oarg3MooAnQtZxo44qxrUTUuvGOy/OEc=",
|
||||||
"owner": "numtide",
|
"owner": "cachix",
|
||||||
"repo": "devshell",
|
"repo": "devenv",
|
||||||
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
|
"rev": "247d7027f91368054fb0eefbd755a73d42b66fee",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "numtide",
|
"owner": "cachix",
|
||||||
"repo": "devshell",
|
"repo": "devenv",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1761588595,
|
||||||
|
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1760948891,
|
||||||
|
"narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"git-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": [
|
||||||
|
"devenv",
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1760663237,
|
||||||
|
"narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"git-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nix": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": [
|
||||||
|
"devenv",
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
|
"flake-parts": [
|
||||||
|
"devenv",
|
||||||
|
"flake-parts"
|
||||||
|
],
|
||||||
|
"git-hooks-nix": [
|
||||||
|
"devenv",
|
||||||
|
"git-hooks"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"devenv",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-23-11": [
|
||||||
|
"devenv"
|
||||||
|
],
|
||||||
|
"nixpkgs-regression": [
|
||||||
|
"devenv"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1761648602,
|
||||||
|
"narHash": "sha256-H97KSB/luq/aGobKRuHahOvT1r7C03BgB6D5HBZsbN8=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "nix",
|
||||||
|
"rev": "3e5644da6830ef65f0a2f7ec22830c46285bfff6",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "devenv-2.30.6",
|
||||||
|
"repo": "nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728538411,
|
"lastModified": 1764947035,
|
||||||
"narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=",
|
"narHash": "sha256-EYHSjVM4Ox4lvCXUMiKKs2vETUSL5mx+J2FfutM7T9w=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221",
|
"rev": "a672be65651c80d3f592a89b3945466584a22069",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -38,7 +201,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell": "devshell",
|
"devenv": "devenv",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
devshell = {
|
devenv = {
|
||||||
url = "github:numtide/devshell";
|
url = "github:cachix/devenv";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -13,8 +13,9 @@
|
|||||||
{
|
{
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
devshell,
|
devenv,
|
||||||
}:
|
...
|
||||||
|
}@inputs:
|
||||||
let
|
let
|
||||||
systems = nixpkgs.lib.genAttrs [
|
systems = nixpkgs.lib.genAttrs [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
@@ -32,7 +33,9 @@
|
|||||||
function (
|
function (
|
||||||
import nixpkgs {
|
import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [ devshell.overlays.default ];
|
overlays = [
|
||||||
|
devenv.overlays.default
|
||||||
|
];
|
||||||
config.allowUnfreePredicate = (pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "terraform" ]);
|
config.allowUnfreePredicate = (pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "terraform" ]);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -40,9 +43,20 @@
|
|||||||
|
|
||||||
golangci-config-file = ./.golangci.yml;
|
golangci-config-file = ./.golangci.yml;
|
||||||
|
|
||||||
cd_root = "cd $PRJ_ROOT;";
|
eslint-config-file = ./eslint.config.mjs;
|
||||||
|
|
||||||
control4_env = self.lib.forAllSystems (
|
cd_root = "cd $DEVENV_ROOT;";
|
||||||
|
|
||||||
|
mdtohtml-src = self.lib.forAllSystems (
|
||||||
|
pkgs: pkgs.fetchFromGitHub {
|
||||||
|
owner = "gomarkdown";
|
||||||
|
repo = "mdtohtml";
|
||||||
|
rev = "d773061d1585e9a85aded292f65459b2cb8b2131";
|
||||||
|
sha256 = "sha256-GzYiiLL0yjGK70haRjoXT1QmvAjl+N/Z8H0EBhVOhRY=";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
control4-env = self.lib.forAllSystems (
|
||||||
pkgs:
|
pkgs:
|
||||||
pkgs.buildEnv {
|
pkgs.buildEnv {
|
||||||
name = "control4_env";
|
name = "control4_env";
|
||||||
@@ -51,26 +65,58 @@
|
|||||||
lua51Packages.busted
|
lua51Packages.busted
|
||||||
stylua
|
stylua
|
||||||
nodejs_22
|
nodejs_22
|
||||||
|
(pkgs.buildGoModule {
|
||||||
|
name = "mdtohtml";
|
||||||
|
CGO_ENABLED = 0;
|
||||||
|
src = self.lib.mdtohtml-src.${pkgs.system};
|
||||||
|
subPackages = [ "." ];
|
||||||
|
ldflags = [ "-s" "-w" ];
|
||||||
|
vendorHash = "sha256-HzHwB0XoVjmqucqyDn44NlIG2ASPzZOKv0POiOyBxrY=";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
mkDevenvShell = devenv.lib.mkShell;
|
||||||
};
|
};
|
||||||
|
|
||||||
formatter = self.lib.forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
|
formatter = self.lib.forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
|
||||||
|
|
||||||
|
packages = self.lib.forAllSystems (pkgs: {
|
||||||
|
devenv-up = self.devShells.${pkgs.system}.default.config.procfileScript;
|
||||||
|
devenv-test = self.devShells.${pkgs.system}.default.config.test;
|
||||||
|
});
|
||||||
|
|
||||||
devShells = self.lib.forAllSystems (pkgs: {
|
devShells = self.lib.forAllSystems (pkgs: {
|
||||||
default = pkgs.devshell.mkShell {
|
default = self.lib.mkDevenvShell {
|
||||||
name = "c3c-nix";
|
inherit inputs pkgs;
|
||||||
|
modules = [
|
||||||
packages = [ pkgs.nix-tree ];
|
|
||||||
|
|
||||||
commands = [
|
|
||||||
{
|
{
|
||||||
name = "fix";
|
scripts = {
|
||||||
command = ''
|
menu = {
|
||||||
${self.lib.cd_root}
|
description = "Print this menu";
|
||||||
nix fmt .
|
exec = ''
|
||||||
|
echo "Commands:"
|
||||||
|
echo -n '${builtins.toJSON (builtins.mapAttrs (s: value: value.description) self.devShells.${pkgs.system}.default.config.scripts)}' | \
|
||||||
|
${pkgs.jq}/bin/jq -r 'to_entries | map(" \(.key)\n" + " - \(if .value == "" then "no description provided" else .value end)") | "" + .[]'
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
fix = {
|
||||||
|
exec = ''
|
||||||
|
${self.lib.cd_root}
|
||||||
|
nix fmt ./*.nix
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
github-push = {
|
||||||
|
description = "Push current branch to github, lazy workaround for automated mirror. TODO: Automate";
|
||||||
|
exec = ''
|
||||||
|
b=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
git push git@github.com:Sharsie/nix.git "$b":"$b"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user