about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-01-22 03:55:02 +0100
committerMel <mel@rnrd.eu>2026-01-22 03:55:02 +0100
commit7f5d765c929a4dc2deddb7b68a41a3a841940837 (patch)
treec442166ede9f6b4c3a82621a39d754dde8c407ac /flake.nix
parent30b04e4b2a90981570ae04095aeccd746ccdea6a (diff)
downloadcatskill-7f5d765c929a4dc2deddb7b68a41a3a841940837.tar.zst
catskill-7f5d765c929a4dc2deddb7b68a41a3a841940837.zip
LLVM clang compiler backend
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix25
1 files changed, 16 insertions, 9 deletions
diff --git a/flake.nix b/flake.nix
index 9021e96..56134b0 100644
--- a/flake.nix
+++ b/flake.nix
@@ -27,17 +27,18 @@
     {
       devShells = eachSystem (
         { system, pkgs }:
-        with pkgs;
         let
-          stdenv = llvmPackages.stdenv;
-          shell = mkShell.override { inherit stdenv; };
+          inherit (pkgs) tinycc pkg-config gnumake lldb clang bintools;
 
-          musl-src = runCommand "musl-src" { } ''
+          stdenv = pkgs.llvmPackages.stdenv;
+          mkShell = pkgs.mkShell.override { inherit stdenv; };
+
+          musl-src = pkgs.runCommand "musl-src" { } ''
             mkdir $out
-            tar -xf ${musl.src} -C $out
+            tar -xf ${pkgs.musl.src} -C $out
           '';
 
-          musl-static = musl.overrideAttrs (attrs: {
+          musl = pkgs.musl.overrideAttrs (attrs: {
             # this HAS the be fixed in upstream nixpkgs one day, right?
             CFLAGS = attrs.CFLAGS ++ [
               "-fdebug-prefix-map=/build=${musl-src}"
@@ -47,17 +48,23 @@
           });
         in
         {
-          default = shell {
+          default = mkShell {
             buildInputs = [
-              musl-static
+              musl
+              tinycc
             ];
 
             nativeBuildInputs = [
               pkg-config
               gnumake
               lldb
-              llvmPackages.bintools
+              clang
+              bintools
             ];
+
+            MUSL_LIB = "${musl}";
+            MUSL_DEV = "${musl.dev}";
+            MUSL_SRC = "${musl-src}";
           };
         }
       );