Compare commits
10 commits
ee0d271d6e
...
a634e932f6
| Author | SHA1 | Date | |
|---|---|---|---|
| a634e932f6 | |||
|
|
3950d3fe20 | ||
|
|
f27420992a | ||
|
|
77d5e6651d | ||
|
|
e262642807 | ||
|
|
5e4fe081d2 | ||
|
|
11f49ad0d7 | ||
|
|
741dad4df5 | ||
|
|
868d01d3a1 | ||
|
|
78023b3b12 |
12 changed files with 122 additions and 16 deletions
16
c/Makefile
Normal file
16
c/Makefile
Normal 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
13
c/flake.nix
Normal 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 ]; }; });
|
||||
}
|
||||
20
flake.nix
20
flake.nix
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
4
package/.envrc
Normal 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
19
package/flake.nix
Normal 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
14
package/package.nix
Normal 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
4
python/.envrc
Normal 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
19
python/flake.nix
Normal 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
4
shell/.envrc
Normal 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
13
shell/flake.nix
Normal 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 ]; }; });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue