Initial commit

This commit is contained in:
tarneo 2024-03-10 11:00:27 +01:00
commit dd7b33544e
Signed by: tarneo
GPG Key ID: BA924E53D0EB3FCC
6 changed files with 100 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*/flake.lock

16
flake.nix Normal file
View File

@ -0,0 +1,16 @@
{
description = "Tarneo's nix templates";
outputs = { ... }: {
templates = {
python = {
path = ./python;
description = "Hello world in Python, with a few dependencies";
};
rust = {
path = ./rust;
description = "Hello world in Rust";
};
};
};
}

1
python/.envrc Normal file
View File

@ -0,0 +1 @@
use_flake

36
python/flake.nix Normal file
View File

@ -0,0 +1,36 @@
{
description = "A python development environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
name = "my-shell-${system}";
buildInputs = [
(
pkgs.python3.withPackages (ps: with ps; [ requests ])
)
];
};
}
);
};
}

1
rust/.envrc Normal file
View File

@ -0,0 +1 @@
use_flake

45
rust/flake.nix Normal file
View File

@ -0,0 +1,45 @@
{
description = "A rust development environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
name = "my-shell-${system}";
packages = [
pkgs.bacon
pkgs.cargo
pkgs.cargo-expand
pkgs.clippy
pkgs.openssl
pkgs.pkg-config
pkgs.rust-analyzer
pkgs.rustc
pkgs.rustfmt
];
shellHook = ''
export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig";
'';
};
}
);
};
}