Skip to content

Commit

Permalink
flake: update and upgrade to llvm 18
Browse files Browse the repository at this point in the history
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
  • Loading branch information
yshui committed Jul 26, 2024
1 parent 2dc2188 commit 5da5a93
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@
(final: prev: {
stdenv = prev.withCFlags "-fno-omit-frame-pointer" prev.stdenv;
})
(final: prev: {
llvmPackages_18 = prev.llvmPackages_18 // {
stdenv = final.withCFlags "-fno-omit-frame-pointer" prev.llvmPackages_18.stdenv;
};
})
];
};

overlays = [overlay];
mkDevShell = p: p.overrideAttrs (o: {
nativeBuildInputs = o.nativeBuildInputs ++ (with pkgs; [
clang-tools_17
llvmPackages_17.clang-unwrapped.python
clang-tools_18
llvmPackages_18.clang-unwrapped.python
python
]);
hardeningDisable = ["fortify"];
Expand All @@ -72,15 +77,18 @@
overlay
overlays
;
defaultPackage = pkgs.picom;
devShells.default = mkDevShell defaultPackage;
packages = {
default = pkgs.picom;
llvm = profilePkgs.llvm_18;
};
devShells.default = mkDevShell packages.default;
devShells.useClang = devShells.default.override {
inherit (pkgs.llvmPackages_17) stdenv;
inherit (pkgs.llvmPackages_18) stdenv;
};
# build picom and all dependencies with frame pointer, making profiling/debugging easier.
# WARNING! many many rebuilds
devShells.useClangProfile = (mkDevShell profilePkgs.picom).override {
stdenv = profilePkgs.withCFlags "-fno-omit-frame-pointer" profilePkgs.llvmPackages_17.stdenv;
stdenv = profilePkgs.withCFlags "-fno-omit-frame-pointer" profilePkgs.llvmPackages_18.stdenv;
};
});
}

0 comments on commit 5da5a93

Please sign in to comment.