initial commit

This commit is contained in:
Antoine Langlois 2024-03-17 21:59:27 +01:00
parent 2da7cf75fb
commit 45cdfd662e
Signed by: DataHearth
GPG Key ID: 946E2D0C410C7B3D
10 changed files with 124 additions and 0 deletions

22
flake.nix Normal file
View File

@ -0,0 +1,22 @@
{
description = "Collection of flake templates";
outputs = { self }: {
templates = {
python = {
path = ./python;
description = "Basic python template";
};
rust = {
path = ./rust;
description = "Basic rust template";
};
go = {
path = ./go;
description = "Basic go template";
};
};
};
}

20
go/flake.nix Normal file
View File

@ -0,0 +1,20 @@
{
description = "Basic go flake for development";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
];
};
});
}

1
python/.envrc Normal file
View File

@ -0,0 +1 @@
use flake

23
python/flake.nix Normal file
View File

@ -0,0 +1,23 @@
{
description = "Basic python flake for development";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
python3
];
packages = with pkgs; [
(python3.withPackages (pypkgs: with pypkgs; [
]))
];
};
});
}

View File

@ -0,0 +1,2 @@
def cli():
pass

20
python/pyproject.toml Normal file
View File

@ -0,0 +1,20 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "my_package"
dynamic = ["version"]
authors = [
{name = "Antoine Langlois", email = "dev@antoine-langlois.net"},
]
description = "My package description"
requires-python = ">=3.11"
readme = "README.md"
license = { file = "LICENSE" }
dependencies = []
[project.optional-dependencies]
[project.scripts]
my_package = "my_package:cli"

1
rust/.envrc Normal file
View File

@ -0,0 +1 @@
use flake

8
rust/Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "package_name"
version = "0.1.0"
edition = "2021"
authors = [ "Antoine Langlois <dev@antoine-langlois.net>" ]
description = "A short description"
[dependencies]

24
rust/flake.nix Normal file
View File

@ -0,0 +1,24 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rust-bin.stable.latest.default
];
};
}
);
}

3
rust/src/main.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}