Compare commits

...

10 commits

Author SHA1 Message Date
46f856d6f5
feat: psql flake 2026-04-21 19:03:23 +02:00
1b87665ea2
feat: elixir 2026-04-03 18:33:53 +02:00
153272ff91
feat: elixir 2026-04-03 18:31:37 +02:00
5a43617060
upgrade go version 2025-12-07 15:52:45 +01:00
e4a9cca607
x 2025-08-16 08:47:52 +02:00
3db75de0e2
update 2025-08-16 08:43:46 +02:00
70bf5ebc0f
okak 2025-08-12 21:18:14 +02:00
3a586b93f0
github 2025-08-09 02:29:03 +02:00
fc49e86428
oof 2025-07-30 15:40:27 +02:00
f30a0e06d5
ok 2025-07-28 22:28:52 +02:00
19 changed files with 372 additions and 3 deletions

View file

@ -7,13 +7,13 @@ some personal flakes
### create a new dir
```bash
nix flake new -t https://git.elisiei.xyz:elisiei/nix-environments#ENV_HERE
nix flake new -t github:elisiei/nix-envs#ENV_HERE DIR_NAME
```
### or init an existing dir
```bash
nix flake init -t https://git.elisiei.xyz:elisiei/nix-environments#ENV_HERE
nix flake init -t github:elisiei/nix-envs#ENV_HERE
```
# license

1
c/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

57
c/.gitignore vendored Normal file
View file

@ -0,0 +1,57 @@
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
# debug information files
*.dwo
.direnv

43
c/flake.nix Normal file
View file

@ -0,0 +1,43 @@
{
description = "minimal flake for c dev";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs =
inputs:
let
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; };
}
);
in
{
devShells = forEachSupportedSystem (
{ pkgs }:
{
default =
pkgs.mkShell.override
{
# Override stdenv in order to change compiler:
# stdenv = pkgs.clangStdenv;
}
{
packages = with pkgs; [
gnumake
tinycc
];
};
}
);
};
}

1
crystal/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

34
crystal/flake.nix Normal file
View file

@ -0,0 +1,34 @@
{
description = "minimal flake for crystal dev";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs =
inputs:
let
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; };
}
);
in
{
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
packages = with pkgs; [ crystal ];
};
}
);
};
}

1
elixir/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

18
elixir/.gitignore vendored Normal file
View file

@ -0,0 +1,18 @@
# Created by https://www.toptal.com/developers/gitignore/api/elixir
# Edit at https://www.toptal.com/developers/gitignore?templates=elixir
### Elixir ###
/_build
/cover
/deps
/doc
/.fetch
erl_crash.dump
*.ez
*.beam
/config/*.secret.exs
.elixir_ls/
### Elixir Patch ###
# End of https://www.toptal.com/developers/gitignore/api/elixir

56
elixir/flake.nix Normal file
View file

@ -0,0 +1,56 @@
{
description = "minimal flake for elixir dev";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs = {self, ...} @ inputs: let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forEachSupportedSystem = f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [inputs.self.overlays.default];
};
}
);
in {
overlays.default = final: prev: rec {
erlang = final.beam.interpreters.erlang_27;
pkgs-beam = final.beam.packagesWith erlang;
elixir = pkgs-beam.elixir_1_17;
};
devShells = forEachSupportedSystem (
{
pkgs,
system,
}: {
default = pkgs.mkShellNoCC {
packages = with pkgs;
[
elixir
self.formatter.${system}
]
++
# Linux only
pkgs.lib.optionals pkgs.stdenv.isLinux (
with pkgs; [
gigalixir
inotify-tools
libnotify
]
);
};
}
);
formatter = forEachSupportedSystem ({pkgs, ...}: pkgs.nixfmt);
};
}

View file

@ -5,10 +5,34 @@
{ self }:
{
templates = {
c = {
path = ./c;
description = "c template";
};
go = {
path = ./go;
description = "go template";
};
elixir = {
path = ./elixir;
description = "elixir template";
};
zig = {
path = ./zig;
description = "zig template";
};
odin = {
path = ./odin;
description = "odin template";
};
psql = {
path = ./psql;
description = "psql template";
};
crystal = {
path = ./crystal;
description = "crystal template";
};
};
defaultTemplate = self.templates.go;

View file

@ -6,7 +6,7 @@
outputs =
inputs:
let
goVersion = 24;
goVersion = 25;
supportedSystems = [
"x86_64-linux"

1
odin/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

34
odin/flake.nix Normal file
View file

@ -0,0 +1,34 @@
{
description = "minimal flake for odin dev";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs =
inputs:
let
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; };
}
);
in
{
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
packages = with pkgs; [ odin ];
};
}
);
};
}

1
psql/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
psql/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.postgres*

57
psql/flake.nix Normal file
View file

@ -0,0 +1,57 @@
{
# original via @estebxn
description = "Tiny PostgreSQL flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
pg = pkgs.postgresql_16;
in
{
apps.${system}.default = {
type = "app";
program = toString (
pkgs.writeShellScript "run-postgres" ''
set -euo pipefail
: ''${PGDATA:=$PWD/.postgres}
: ''${PGHOST:=$PWD/.postgres-socket}
: ''${PGPORT:=5432}
: ''${PGUSER:=postgres}
: ''${PGDATABASE:=app}
mkdir -p "$PGHOST"
if [ ! -d "$PGDATA" ]; then
${pg}/bin/initdb -D "$PGDATA" --auth=trust --username="$PGUSER"
cat >> "$PGDATA/postgresql.conf" <<EOF
listen_addresses = '127.0.0.1'
port = $PGPORT
unix_socket_directories = '$PGHOST'
EOF
fi
${pg}/bin/pg_ctl -D "$PGDATA" -l "$PGDATA/postgres.log" start
trap '${pg}/bin/pg_ctl -D "$PGDATA" stop' EXIT
until ${pg}/bin/pg_isready -h "$PGHOST" -p "$PGPORT" >/dev/null 2>&1; do
sleep 1
done
${pg}/bin/psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" postgres \
-tc "SELECT 1 FROM pg_database WHERE datname = '$PGDATABASE'" \
| grep -q 1 || ${pg}/bin/createdb -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" "$PGDATABASE"
echo "Postgres is running on port $PGPORT"
echo "psql -h $PGHOST -p $PGPORT -U $PGUSER $PGDATABASE"
while true; do sleep 60; done
''
);
};
};
}

1
zig/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

3
zig/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.zig-cache/
zig-out/
*.o

36
zig/flake.nix Normal file
View file

@ -0,0 +1,36 @@
{
description = "minimal flake for zig dev";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs =
inputs:
let
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; };
}
);
in
{
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
packages = with pkgs; [
zig
];
};
}
);
};
}