From c461bc5eef9f5aaa36c577804c843fba4bba10df Mon Sep 17 00:00:00 2001 From: yemou Date: Mon, 19 Jan 2026 05:37:06 -0500 Subject: [PATCH] c: add template --- c/flake.nix | 19 +++++++++++++++++++ flake.nix | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 c/flake.nix diff --git a/c/flake.nix b/c/flake.nix new file mode 100644 index 0000000..5096523 --- /dev/null +++ b/c/flake.nix @@ -0,0 +1,19 @@ +{ + description = "TODO: Describe the flake"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; + + outputs = + { self, nixpkgs }: + let + systems = [ "x86_64-linux" ]; + forSystems = func: nixpkgs.lib.genAttrs systems (system: func (import nixpkgs { inherit system; })); + in + { + formatter = forSystems (pkgs: pkgs.nixfmt-tree.override { settings.formatter.nixfmt.options = [ "-w 120" ]; }); + + devShells = forSystems (pkgs: { + default = pkgs.mkShell { buildInputs = with pkgs; [ clang-tools ]; }; + }); + }; +} diff --git a/flake.nix b/flake.nix index 4e1a5bc..1c7fa74 100644 --- a/flake.nix +++ b/flake.nix @@ -16,7 +16,7 @@ description = "generic nix flake"; }; } - // nixpkgs.lib.genAttrs [ "erlang" "go" "java" "python" ] (language: { + // nixpkgs.lib.genAttrs [ "c" "erlang" "go" "java" "python" ] (language: { path = ./${language}; description = "${language} nix flake"; }); -- 2.51.2