-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adjust quickfix to allow running apps in multiple VMs - Change nix formatter to rfc-style - Add nix flake check to github actions Signed-off-by: Manuel Bluhm <[email protected]>
- Loading branch information
Showing
23 changed files
with
694 additions
and
654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,70 @@ | ||
{inputs, ...}: { | ||
{ inputs, ... }: | ||
{ | ||
imports = [ | ||
inputs.devshell.flakeModule | ||
inputs.pre-commit-hooks-nix.flakeModule | ||
]; | ||
|
||
perSystem = { | ||
pkgs, | ||
config, | ||
... | ||
}: { | ||
devshells.default = { | ||
devshell = { | ||
name = "GIVC"; | ||
motd = '' | ||
❄️ Welcome to the {14}{bold}Welcome to givc-devshell{reset} devshell ❄️ | ||
$(type -p menu &>/dev/null && menu) | ||
$(type -p update-pre-commit-hooks &>/dev/null && update-pre-commit-hooks) | ||
''; | ||
perSystem = | ||
{ pkgs, config, ... }: | ||
{ | ||
devshells.default = { | ||
devshell = { | ||
name = "GIVC"; | ||
motd = '' | ||
❄️ Welcome to the {14}{bold}Welcome to givc-devshell{reset} devshell ❄️ | ||
$(type -p menu &>/dev/null && menu) | ||
$(type -p update-pre-commit-hooks &>/dev/null && update-pre-commit-hooks) | ||
''; | ||
}; | ||
packages = with pkgs; [ | ||
config.treefmt.build.wrapper | ||
reuse | ||
go | ||
gotests | ||
gopls | ||
golangci-lint | ||
rustc | ||
rustfmt | ||
cargo | ||
pkgs.stdenv.cc # Need for build rust components | ||
protobuf | ||
protoc-gen-go | ||
protoc-gen-go-grpc | ||
grpcurl | ||
]; | ||
commands = [ | ||
{ | ||
name = "update-pre-commit-hooks"; | ||
command = config.pre-commit.installationScript; | ||
category = "tools"; | ||
help = "update git pre-commit hooks"; | ||
} | ||
{ | ||
help = "Generate go files from protobuffers"; | ||
name = "protogen"; | ||
command = "./api/protoc.sh"; | ||
} | ||
{ | ||
help = "Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers"; | ||
name = "gcl"; | ||
command = "grpcurl"; | ||
} | ||
{ | ||
help = "Update go dependencies"; | ||
name = "go-update"; | ||
command = "go get -u ./... && go mod tidy && echo Done - do not forget to update the vendorHash in the packages (use pkgs.lib.fakeHash)."; | ||
} | ||
{ | ||
help = "golang linter"; | ||
package = "golangci-lint"; | ||
category = "linters"; | ||
} | ||
]; | ||
}; | ||
pre-commit.settings = { | ||
hooks.treefmt.enable = true; | ||
hooks.treefmt.package = config.treefmt.build.wrapper; | ||
}; | ||
packages = with pkgs; [ | ||
config.treefmt.build.wrapper | ||
reuse | ||
go | ||
gotests | ||
gopls | ||
golangci-lint | ||
rustc | ||
rustfmt | ||
cargo | ||
pkgs.stdenv.cc # Need for build rust components | ||
protobuf | ||
protoc-gen-go | ||
protoc-gen-go-grpc | ||
grpcurl | ||
]; | ||
commands = [ | ||
{ | ||
name = "update-pre-commit-hooks"; | ||
command = config.pre-commit.installationScript; | ||
category = "tools"; | ||
help = "update git pre-commit hooks"; | ||
} | ||
{ | ||
help = "Generate go files from protobuffers"; | ||
name = "protogen"; | ||
command = "./api/protoc.sh"; | ||
} | ||
{ | ||
help = "Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers"; | ||
name = "gcl"; | ||
command = "grpcurl"; | ||
} | ||
{ | ||
help = "Update go dependencies"; | ||
name = "go-update"; | ||
command = "go get -u ./... && go mod tidy && echo Done - do not forget to update the vendorHash in the packages (use pkgs.lib.fakeHash)."; | ||
} | ||
{ | ||
help = "golang linter"; | ||
package = "golangci-lint"; | ||
category = "linters"; | ||
} | ||
]; | ||
}; | ||
pre-commit.settings = { | ||
hooks.treefmt.enable = true; | ||
hooks.treefmt.package = config.treefmt.build.wrapper; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
{inputs, ...}: { | ||
{ inputs, ... }: | ||
{ | ||
imports = [ | ||
inputs.flake-root.flakeModule | ||
inputs.treefmt-nix.flakeModule | ||
]; | ||
|
||
perSystem = { | ||
config, | ||
pkgs, | ||
lib, | ||
... | ||
}: { | ||
treefmt.config = { | ||
inherit (config.flake-root) projectRootFile; | ||
package = pkgs.treefmt; | ||
flakeFormatter = true; | ||
flakeCheck = true; | ||
programs = { | ||
alejandra.enable = true; | ||
rustfmt.enable = true; | ||
deadnix.enable = true; # removes dead nix code https://github.com/astro/deadnix | ||
statix.enable = true; # prevents use of nix anti-patterns https://github.com/nerdypepper/statix | ||
gofmt.enable = true; # go formatter https://golang.org/cmd/gofmt/ | ||
shellcheck.enable = true; # lints shell scripts https://github.com/koalaman/shellcheck | ||
perSystem = | ||
{ | ||
config, | ||
pkgs, | ||
lib, | ||
... | ||
}: | ||
{ | ||
treefmt.config = { | ||
inherit (config.flake-root) projectRootFile; | ||
package = pkgs.treefmt; | ||
flakeFormatter = true; | ||
flakeCheck = true; | ||
programs = { | ||
nixfmt.enable = true; | ||
nixfmt.package = pkgs.nixfmt-rfc-style; | ||
rustfmt.enable = true; | ||
deadnix.enable = true; # removes dead nix code https://github.com/astro/deadnix | ||
statix.enable = true; # prevents use of nix anti-patterns https://github.com/nerdypepper/statix | ||
gofmt.enable = true; # go formatter https://golang.org/cmd/gofmt/ | ||
shellcheck.enable = true; # lints shell scripts https://github.com/koalaman/shellcheck | ||
}; | ||
}; | ||
}; | ||
|
||
devshells.default.commands = [ | ||
{ | ||
category = "tools"; | ||
name = "fmt"; | ||
help = "format the source tree"; | ||
command = lib.getExe config.treefmt.build.wrapper; | ||
} | ||
]; | ||
}; | ||
devshells.default.commands = [ | ||
{ | ||
category = "tools"; | ||
name = "fmt"; | ||
help = "format the source tree"; | ||
command = lib.getExe config.treefmt.build.wrapper; | ||
} | ||
]; | ||
}; | ||
} |
Oops, something went wrong.