Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@ test-reports
# Cursor specific
.cursor/
build/
target/
target/

# Nix specific
.direnv
.nix-store
Comment thread
danpiths marked this conversation as resolved.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1088,4 +1088,4 @@ mod-tidy: ## Run go mod tidy on modules (Usage: make mod-tidy [MODULE=all|core|p
done; \
fi
@echo ""
@echo "$(GREEN)✓ go mod tidy complete$(NC)"
@echo "$(GREEN)✓ go mod tidy complete$(NC)"
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 92 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
description = "Bifrost's Nix Flake";

# Flake inputs
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/staging-next";
Comment thread
danpiths marked this conversation as resolved.
};

# Flake outputs
outputs = {self, ...} @ inputs: let
# The systems supported for this flake's outputs
supportedSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux
"aarch64-linux" # 64-bit ARM Linux
"aarch64-darwin" # 64-bit ARM macOS
];

# Helper for providing system-specific attributes
forEachSupportedSystem = f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
# Provides a system-specific, configured Nixpkgs
pkgs = import inputs.nixpkgs {
inherit system;
# Enable using unfree packages
config.allowUnfree = true;
};
}
);
in {
# To activate the default environment:
# nix develop
# Or if you use direnv:
# direnv allow
devShells = forEachSupportedSystem (
{
pkgs,
system,
}: {
# Run `nix develop` to activate this environment or `direnv allow` if you have direnv installed
default = pkgs.mkShellNoCC {
# The name of the environment
name = "bifrost-nix-dev-shell";

# The Nix packages provided in the environment
packages = with pkgs; [
go
gopls
gofumpt
air
delve # provides dlv
go-tools # provides staticcheck

nodejs_24
];

# Set any environment variables for your development environment
env = {};

# Add any shell logic you want executed when the environment is activated
shellHook = ''
##
## Go: project-local GOPATH/GOBIN
##
export GOPATH="$PWD/.nix-store/go"
export GOBIN="$GOPATH/bin"
export GOMODCACHE="$GOPATH/pkg/mod"
export GOCACHE="$PWD/.nix-store/gocache"

mkdir -p "$GOBIN" "$GOMODCACHE" "$GOCACHE"

export PATH="$PATH:$GOBIN"

##
## Node: project-local "global" npm prefix
##
# npm reads npm_config_prefix (or NPM_CONFIG_PREFIX) as the "prefix" config,
# which is where `npm i -g` installs to.
export npm_config_prefix="$PWD/.nix-store/npm-global"

mkdir -p "$npm_config_prefix/bin"

# Ensure "global" npm bin is on PATH for this shell only
export PATH="$PATH:$npm_config_prefix/bin"
'';
};
}
);
};
}
Loading