summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2024-02-14 17:56:30 +0100
committerLinnnus <[email protected]>2024-02-14 17:56:30 +0100
commitcfb648daef74f695e42e3314c05296a72168860c (patch)
treea4631fcdbc20bccb4640a3fa2484606f44cd2bc4
parent2b11289379b5ba3d6d67b88211df0862f4b92ebd (diff)
build: Use stdenv from llvmPackages
This patch updates the flake to use llvmPackages.stdenv rather than the default pkgs.stdenv. This fixes an issue on MacOS where the ASAN runtime library isn't found. I have no idea why.
-rw-r--r--Makefile2
-rw-r--r--flake.nix16
2 files changed, 12 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 90d321d..7520811 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
.POSIX:
.PHONY: all install uninstall clean
-CC := cc
+CC ?= cc
CFLAGS := -W -O $(shell pkg-config --cflags libgit2)
CFLAGS += -g3 -O0 -fsanitize=address,undefined -fsanitize-trap
CFLAGS += -Wall -Wextra -Wconversion -Wdouble-promotion \
diff --git a/flake.nix b/flake.nix
index 24c60a1..1341dd9 100644
--- a/flake.nix
+++ b/flake.nix
@@ -10,8 +10,9 @@
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
+ stdenv = pkgs.llvmPackages_14.stdenv;
- simple-wiki = pkgs.stdenv.mkDerivation {
+ simple-wiki = stdenv.mkDerivation {
pname = "simple-wiki";
version = "0.0.0";
@@ -24,9 +25,15 @@
mkdir -p $out
make PREFIX=$out install
'';
+
+ meta = with pkgs.lib; {
+ description = "Simplest possible wiki system";
+ license = licenses.unlicense;
+ mainProgram = "simplewiki";
+ };
};
- creole-test = pkgs.stdenv.mkDerivation rec {
+ creole-test = stdenv.mkDerivation rec {
pname = "creole-test";
version = simple-wiki.version;
@@ -42,9 +49,8 @@
'';
};
- devShell = pkgs.mkShell {
- nativeBuildInputs = with pkgs; [ pkg-config ];
- buildInputs = with pkgs; [ libgit2 ];
+ devShell = (pkgs.mkShell.override { inherit stdenv; }) {
+ inputsFrom = [ simple-wiki creole-test ];
};
in
{