This commit is contained in:
Elisiei Yehorov 2025-07-28 22:02:43 +02:00
parent 9da2e27fa3
commit 61bd2f6c9f
Signed by: elisiei
GPG key ID: BA1D158DCE3DF089
4 changed files with 101 additions and 1 deletions

View file

@ -1,3 +1,24 @@
# nix-environments # nix-environments
some personal flakes some personal flakes
# usage
### create a new dir
```bash
nix flake new -t https://git.elisiei.xyz:elisiei/nix-environments#ENV_HERE
```
### or init an existing dir
```bash
nix flake init -t https://git.elisiei.xyz:elisiei/nix-environments#ENV_HERE
```
# license
all original content and codes in this project is dedicated to the public domain under the
[Creative Commons CC0 1.0 Universal (CC0 1.0) Public Domain Dedication](https://creativecommons.org/publicdomain/zero/1.0/).
this grants you the freedom to use, modify, and distribute the content without any restrictions
or attribution requirements.

1
go/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

33
go/.gitignore vendored Normal file
View file

@ -0,0 +1,33 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Code coverage profiles and other test artifacts
*.out
coverage.*
*.coverprofile
profile.cov
# Dependency directories (remove the comment below to include it)
# vendor/
# Go workspace file
go.work
go.work.sum
# env file
.env
.direnv
# Editor/IDE
# .idea/
# .vscode/

45
go/flake.nix Normal file
View file

@ -0,0 +1,45 @@
{
description = "minimal flake for go dev";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs =
inputs:
let
goVersion = 24;
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.self.overlays.default ];
};
}
);
in
{
overlays.default = final: prev: {
go = final."go_1_${toString goVersion}";
};
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
packages = with pkgs; [
go
];
};
}
);
};
}