Skip to content

Commit 22a20ab

Browse files
committed
feat(flake): Add flake
Signed-off-by: dark0dave <dark0dave@mykolab.com>
1 parent c234b57 commit 22a20ab

7 files changed

Lines changed: 70 additions & 10 deletions

File tree

.envrc.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set -a
2+
use flake --impure

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ infinity_file_format*
3333

3434
# Secrets
3535
.envrc
36+
.direnv
3637

3738
# Editor files
3839
.swp

.mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[tools]
2-
go = "1.25"
2+
go = "1.25.0"
33
"go:github.com/go-delve/delve/cmd/dlv" = "latest"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repos:
5656
stages: [pre-commit]
5757
exclude: (?x)^([bg|fixtures])
5858
- repo: https://github.com/commitizen-tools/commitizen
59-
rev: v4.9.0
59+
rev: v4.9.1
6060
hooks:
6161
- id: commitizen
6262
stages: [commit-msg]

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
description = "";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/2cd3cac16691a933e94276f0a810453f17775c28";
6+
};
7+
8+
outputs = { self, nixpkgs }:
9+
let
10+
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
11+
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
12+
in {
13+
devShells = forAllSystems (system:
14+
let
15+
pkgs = import nixpkgs { inherit system; };
16+
in {
17+
default = import (./. + "/shell.nix");
18+
});
19+
};
20+
}

shell.nix

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
let
22
unstableTarball =
3-
fetchTarball
4-
https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz;
5-
pkgs = import <nixpkgs> {};
6-
unstable = import unstableTarball {};
3+
fetchTarball {
4+
url = "https://github.com/NixOS/nixpkgs/archive/2cd3cac16691a933e94276f0a810453f17775c28.tar.gz";
5+
sha256 = "06ad2257srqw8q4504hqm5hyb50vlckhgdfcjx81hxq3l1wy9i5j";
6+
};
7+
pkgs = import unstableTarball {};
78
shell = pkgs.mkShell {
9+
# Libs
810
buildInputs = [
9-
unstable.delve
11+
pkgs.go
12+
];
13+
# Tools
14+
nativeBuildInputs = [
15+
pkgs.delve
1016
pkgs.git
11-
unstable.go
12-
unstable.gopls
13-
unstable.go-tools
17+
pkgs.gopls
18+
pkgs.go-tools
1419
pkgs.pre-commit
1520
];
21+
shellHook = ''
22+
# Make sure Go always has a valid temp dir
23+
export TMPDIR=$(mktemp -d)
24+
pre-commit install -f
25+
'';
1626
};
1727
in shell

0 commit comments

Comments
 (0)