Compare commits

..

10 commits

Author SHA1 Message Date
a634e932f6 Added C template 2023-08-15 10:33:31 -03:00
baduhai
3950d3fe20 damn semicolons 2023-07-20 12:24:43 -03:00
baduhai
f27420992a Forgot to add python tmeplate to greater flake 2023-07-20 12:23:22 -03:00
baduhai
77d5e6651d Created python environment template 2023-07-20 12:07:37 -03:00
baduhai
e262642807 Minor mods to shell tmeplate 2023-07-20 12:01:19 -03:00
rotterdam
5e4fe081d2 top-level flake edit 2023-04-06 12:31:14 -03:00
rotterdam
11f49ad0d7 renamed hello template to shell 2023-04-06 12:30:44 -03:00
rotterdam
741dad4df5 Finished adding package template 2023-04-06 12:29:12 -03:00
rotterdam
868d01d3a1 Added package template 2023-04-06 12:25:33 -03:00
rotterdam
78023b3b12 Fixed hello template 2023-04-05 14:52:29 -03:00
12 changed files with 122 additions and 16 deletions

16
c/Makefile Normal file
View file

@ -0,0 +1,16 @@
all: main
CC = clang
override CFLAGS += -g -Wno-everything -pthread -lm
SRCS = $(shell find . -name '.ccls-cache' -type d -prune -o -type f -name '*.c' -print)
HEADERS = $(shell find . -name '.ccls-cache' -type d -prune -o -type f -name '*.h' -print)
main: $(SRCS) $(HEADERS)
$(CC) $(CFLAGS) $(SRCS) -o "$@"
main-debug: $(SRCS) $(HEADERS)
$(CC) $(CFLAGS) -O0 $(SRCS) -o "$@"
clean:
rm -f main main-debug

13
c/flake.nix Normal file
View file

@ -0,0 +1,13 @@
{
description = "Flake template for a devShell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in with pkgs; { devShells.default = mkShell { packages = [ clang_12 ccls gdb gnumake ]; }; });
}

View file

@ -3,13 +3,25 @@
outputs = { self }: {
templates = {
hello = {
path = ./hello;
description = "Template including hello in shell packages";
c = {
path = ./c;
description = "Template for a C project";
};
package = {
path = ./package;
description = "Template for a nix package";
};
python = {
path = ./python;
description = "Template for a python project";
};
rust = {
path = ./rust;
description = "Rust template, using oxalica/rust-overlay";
description = "Template for a rust project, using oxalica/rust-overlay";
};
shell = {
path = ./shell;
description = "Template for a devShell";
};
};
};

View file

@ -1,12 +0,0 @@
{
description = "Flake template for a rust project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system: { devShells.default = mkShell { packages = [ hello ]; }; });
}

4
package/.envrc Normal file
View file

@ -0,0 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
use flake

19
package/flake.nix Normal file
View file

@ -0,0 +1,19 @@
{
description = "Template for a nix package";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in with pkgs; {
devShells.default = mkShell { packages = [ ]; };
packages = {
default = self.packages."${system}".package;
"package" = pkgs.callPackage ./package.nix { };
};
});
}

14
package/package.nix Normal file
View file

@ -0,0 +1,14 @@
{ lib, stdenv }:
stdenv.mkDerivation (finalAttrs: {
pname = "";
version = "";
meta = with lib; {
description = "";
homepage = "";
license = licenses.;
platforms = platforms.all;
};
})

4
python/.envrc Normal file
View file

@ -0,0 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
use flake

19
python/flake.nix Normal file
View file

@ -0,0 +1,19 @@
{
description = "Flake template for a python project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in with pkgs; {
devShells.default = mkShell {
buildInputs = [ python310 ];
packages = [ ];
};
});
}

4
shell/.envrc Normal file
View file

@ -0,0 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
use flake

13
shell/flake.nix Normal file
View file

@ -0,0 +1,13 @@
{
description = "Flake template for a devShell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in with pkgs; { devShells.default = mkShell { packages = [ hello ]; }; });
}