Skip to content

Commit

Permalink
γ€ŒπŸŽ‰γ€ init(c): added a template for c
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-koh committed Sep 24, 2024
1 parent ef63aef commit 9a1b3b4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions templates/c/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
2 changes: 2 additions & 0 deletions templates/c/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.direnv
result
37 changes: 37 additions & 0 deletions templates/c/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
description = "A development environment for this C project";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};

outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem =
{ pkgs, ... }:
{
devShells.default = pkgs.mkShell {
hardeningDisable = [ "all" ]; # Depend on the project
packages = with pkgs; [
clang
gcc
gdb
valgrind
];
};
packages.default = pkgs.stdenv.mkDerivation {
pname = "template";
src = ./.;
version = "git";
buildInputs = with pkgs; [ ];
nativeBuildInputs = with pkgs; [ ];
};
};
};
}

0 comments on commit 9a1b3b4

Please sign in to comment.