-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use numtide/blueprint instead of flake.parts
Signed-off-by: Brian McGee <[email protected]>
- Loading branch information
1 parent
30d30b5
commit 986f020
Showing
19 changed files
with
295 additions
and
363 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
dotenv | ||
|
||
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4=" | ||
fi | ||
|
||
watch_file flake.nix | ||
watch_file nix/devshell.nix | ||
|
||
use flake |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,59 +1,73 @@ | ||
{inputs, ...}: { | ||
imports = [ | ||
inputs.devshell.flakeModule | ||
]; | ||
{ | ||
pkgs, | ||
perSystem, | ||
... | ||
}: let | ||
inherit (pkgs) lib; | ||
inherit (pkgs.stdenv) isLinux isDarwin; | ||
in | ||
perSystem.devshell.mkShell { | ||
env = [ | ||
{ | ||
name = "GOROOT"; | ||
value = pkgs.go + "/share/go"; | ||
} | ||
{ | ||
name = "LD_LIBRARY_PATH"; | ||
value = "$DEVSHELL_DIR/lib"; | ||
} | ||
]; | ||
|
||
config.perSystem = { | ||
lib, | ||
pkgs, | ||
config, | ||
... | ||
}: let | ||
inherit (pkgs.stdenv) isLinux isDarwin; | ||
in { | ||
config.devshells.default = { | ||
env = [ | ||
{ | ||
name = "GOROOT"; | ||
value = pkgs.go + "/share/go"; | ||
} | ||
{ | ||
name = "LD_LIBRARY_PATH"; | ||
value = "$DEVSHELL_DIR/lib"; | ||
} | ||
]; | ||
packages = lib.mkMerge [ | ||
(with pkgs; [ | ||
# golang | ||
go | ||
goreleaser | ||
golangci-lint | ||
delve | ||
pprof | ||
graphviz | ||
|
||
packages = lib.mkMerge [ | ||
(with pkgs; [ | ||
# golang | ||
go | ||
goreleaser | ||
golangci-lint | ||
delve | ||
pprof | ||
graphviz | ||
]) | ||
# platform dependent CGO dependencies | ||
(lib.mkIf isLinux [ | ||
pkgs.gcc | ||
]) | ||
(lib.mkIf isDarwin [ | ||
pkgs.darwin.cctools | ||
]) | ||
# include formatters for development and testing | ||
(import ./formatters.nix pkgs) | ||
]; | ||
# docs | ||
nodejs | ||
]) | ||
# platform dependent CGO dependencies | ||
(lib.mkIf isLinux [pkgs.gcc]) | ||
(lib.mkIf isDarwin [pkgs.darwin.cctools]) | ||
# include formatters for development and testing | ||
(import ./packages/treefmt/formatters.nix pkgs) | ||
]; | ||
|
||
commands = [ | ||
{ | ||
category = "development"; | ||
package = pkgs.gomod2nix; | ||
} | ||
{ | ||
category = "development"; | ||
package = pkgs.enumer; | ||
} | ||
]; | ||
}; | ||
}; | ||
} | ||
commands = [ | ||
{package = perSystem.gomod2nix.default;} | ||
{ | ||
name = "docs:dev"; | ||
help = "serve docs for local development"; | ||
command = "cd $PRJ_ROOT/docs && npm ci && npm run dev"; | ||
} | ||
{ | ||
name = "docs:build"; | ||
help = "create a production build of docs"; | ||
command = "cd $PRJ_ROOT/docs && npm ci && npm run build"; | ||
} | ||
{ | ||
name = "docs:preview"; | ||
help = "preview a production build of docs"; | ||
command = "cd $PRJ_ROOT/docs && npm ci && npm run preview"; | ||
} | ||
{ | ||
help = "generate terminal gifs"; | ||
package = pkgs.writeShellApplication { | ||
name = "vhs"; | ||
runtimeInputs = | ||
[ | ||
perSystem.self.treefmt | ||
pkgs.rsync | ||
pkgs.vhs | ||
] | ||
++ (import ./packages/treefmt/formatters.nix pkgs); | ||
text = ''vhs "$@"''; | ||
}; | ||
} | ||
]; | ||
} |
Oops, something went wrong.