Compare commits

..

No commits in common. "46f856d6f59c33c9f03f15da76c7ee2eb81f2feb" and "7977b528cde6b90a3d37cd5e843d764e94b2f6b7" have entirely different histories.

19 changed files with 3 additions and 372 deletions

View file

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

View file

@ -1 +0,0 @@
use flake

57
c/.gitignore vendored
View file

@ -1,57 +0,0 @@
# 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

View file

@ -1,43 +0,0 @@
{
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
];
};
}
);
};
}

View file

@ -1 +0,0 @@
use flake

View file

@ -1,34 +0,0 @@
{
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 ];
};
}
);
};
}

View file

@ -1 +0,0 @@
use flake

18
elixir/.gitignore vendored
View file

@ -1,18 +0,0 @@
# 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

View file

@ -1,56 +0,0 @@
{
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,34 +5,10 @@
{ 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 = 25;
goVersion = 24;
supportedSystems = [
"x86_64-linux"

View file

@ -1 +0,0 @@
use flake

View file

@ -1,34 +0,0 @@
{
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 ];
};
}
);
};
}

View file

@ -1 +0,0 @@
use flake

1
psql/.gitignore vendored
View file

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

View file

@ -1,57 +0,0 @@
{
# 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
''
);
};
};
}

View file

@ -1 +0,0 @@
use flake

3
zig/.gitignore vendored
View file

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

View file

@ -1,36 +0,0 @@
{
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
];
};
}
);
};
}