Skip to content

Commit

Permalink
Update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Nov 11, 2024
1 parent a2e58c7 commit ce49269
Show file tree
Hide file tree
Showing 12 changed files with 222 additions and 393 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="

use devenv
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ dist/
*.sh
.devenv
.pre-commit-config.yaml
.devenv.flake.nix
# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
3 changes: 3 additions & 0 deletions .pgsql/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# shellcheck shell=sh disable=SC2129
set -e

export PGDATA=./data
export PGHOST=.

# Reset the database
pg_ctl -D .pgsql/data -w stop -m fast || true
rm -rf .pgsql/data
Expand Down
119 changes: 119 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1731169617,
"owner": "cachix",
"repo": "devenv",
"rev": "983153344922e5fb8545aae7e5e70127da981a71",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1730814269,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "d70155fdc00df4628446352fc58adc640cd705c2",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716977621,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1730963269,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": [
"git-hooks"
]
}
}
},
"root": "root",
"version": 7
}
68 changes: 29 additions & 39 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -1,47 +1,37 @@
{ pkgs, lib, rootDir, ... }:

{
# See https://devenv.sh/getting-started/ for more information

packages = with pkgs;
[
entr # Run arbitrary commands when files change
gitAndTools.gh # GitHub CLI
heroku # Heroku CLI
process-compose # Run multiple processes in a single terminal
golangci-lint # Linter for Go
postgresql_15 # PostgreSQL database
eclint # EditorConfig linter and fixer
gnumake # GNU Make
goreleaser # Go binary release tool
pgweb # PostgreSQL web interface
];

languages.javascript.enable = true;
pkgs,
lib,
config,
inputs,
...
}: {
packages = with pkgs; [
alejandra # nix formatter
heroku # Heroku CLI
postgresql_15 # PostgreSQL database
gnumake # GNU Make
goreleaser # Go binary release tool
];
languages.nix.enable = true;
languages.go.enable = true;
languages.go.package = pkgs.go_1_21;

# https://devenv.sh/tests/
enterTest = ''
go test ./...
go vet ./...
go mod tidy
go mod verify
go build .
'';
process.managers.process-compose.tui.enable = false;
processes = {
db.exec = ".pgsql/run.sh";
};

# https://devenv.sh/pre-commit-hooks/
pre-commit.hooks = {
shellcheck.enable = true;
nixpkgs-fmt.enable = true;
alejandra.enable = true;
gofmt.enable = true;
shfmt.enable = true;
golangci-lint = {
enable = false;
pass_filenames = false;
name = "golangci-lint";
files = ".*";
entry = "bash -c 'cd $(${rootDir})/backend; ${pkgs.golangci-lint}/bin/golangci-lint run --fix'";
};
eclint = {
enable = true;
pass_filenames = false;
name = "eclint";
files = ".*";
entry = "${pkgs.eclint}/bin/eclint --fix";
};
};


# See full reference at https://devenv.sh/reference/options/
}
15 changes: 15 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling

# If you're using non-OSS software, you can set allowUnfree to true.
# allowUnfree: true

# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"

# If you have more than one devenv you can merge them
#imports:
# - ./backend
Loading

0 comments on commit ce49269

Please sign in to comment.