initial commit: set up a template

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-08-15 14:59:53 +05:30
commit fe255f97f4
18 changed files with 856 additions and 0 deletions

55
flake.nix Normal file
View File

@@ -0,0 +1,55 @@
{
description = "matar";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
};
outputs = { self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"i686-linux"
];
eachSystem = with nixpkgs.lib; f: foldAttrs mergeAttrs { }
(map (s: mapAttrs (_: v: { ${s} = v; }) (f s)) systems);
in
eachSystem (system:
let
pkgs = import nixpkgs { inherit system; };
llvm = pkgs.llvmPackages;
stdenv = llvm.libcxxStdenv;
nativeBuildInputs = with pkgs; [ meson ninja ];
in
{
packages = rec {
matar = stdenv.mkDerivation rec {
name = "matar";
src = pkgs.lib.sourceFilesBySuffices ./. [
".hh"
".cc"
".build"
];
outputs = [ "dev" "out" ];
inherit nativeBuildInputs;
enableParallelBuilding = true;
};
default = matar;
};
devShells = rec {
matar = pkgs.mkShell.override { inherit stdenv; } {
name = "matar";
packages = nativeBuildInputs ++ (with pkgs; [
bear
clang-tools
]);
};
default = matar;
};
formatter = pkgs.nixpkgs-fmt;
});
}