2023-08-06 19:51:18 -04:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
flake-utils.url = github:numtide/flake-utils;
|
|
|
|
git-ignore-nix = {
|
|
|
|
url = github:hercules-ci/gitignore.nix/master;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
outputs = {
|
2024-02-15 06:37:12 -05:00
|
|
|
self,
|
|
|
|
flake-utils,
|
|
|
|
nixpkgs,
|
|
|
|
git-ignore-nix,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
|
|
overlay = self: super: {
|
|
|
|
picom = super.picom.overrideAttrs (oldAttrs: rec {
|
|
|
|
version = "11";
|
|
|
|
pname = "picom";
|
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
self.pcre2
|
|
|
|
self.xorg.xcbutil
|
|
|
|
self.libepoxy
|
|
|
|
]
|
|
|
|
++ self.lib.remove self.xorg.libXinerama (
|
|
|
|
self.lib.remove self.pcre oldAttrs.buildInputs
|
|
|
|
);
|
|
|
|
src = git-ignore-nix.lib.gitignoreSource ./.;
|
|
|
|
});
|
|
|
|
};
|
2024-02-18 18:45:41 -05:00
|
|
|
python = pkgs.python3.withPackages (ps: with ps; [
|
2024-03-24 09:17:03 -04:00
|
|
|
xcffib pip dbus-next
|
2024-02-18 18:45:41 -05:00
|
|
|
]);
|
2024-02-15 06:37:12 -05:00
|
|
|
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system overlays;
|
|
|
|
config.allowBroken = true;
|
|
|
|
};
|
2024-04-08 04:40:33 -04:00
|
|
|
profilePkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = overlays ++ [
|
|
|
|
(final: prev: {
|
|
|
|
stdenv = prev.withCFlags "-fno-omit-frame-pointer" prev.stdenv;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
2024-02-15 06:37:12 -05:00
|
|
|
|
|
|
|
overlays = [overlay];
|
2024-04-08 04:40:33 -04:00
|
|
|
mkDevShell = p: p.overrideAttrs (o: {
|
2024-02-18 18:13:53 -05:00
|
|
|
nativeBuildInputs = o.nativeBuildInputs ++ (with pkgs; [
|
|
|
|
clang-tools_17
|
|
|
|
llvmPackages_17.clang-unwrapped.python
|
2024-02-18 18:45:41 -05:00
|
|
|
python
|
2024-02-18 18:13:53 -05:00
|
|
|
]);
|
2024-02-15 06:37:12 -05:00
|
|
|
hardeningDisable = ["fortify"];
|
|
|
|
shellHook = ''
|
|
|
|
# Workaround a NixOS limitation on sanitizers:
|
|
|
|
# See: https://github.com/NixOS/nixpkgs/issues/287763
|
|
|
|
export LD_LIBRARY_PATH+=":/run/opengl-driver/lib"
|
|
|
|
'';
|
2024-02-18 18:13:53 -05:00
|
|
|
});
|
2024-04-08 04:40:33 -04:00
|
|
|
in rec {
|
|
|
|
inherit
|
|
|
|
overlay
|
|
|
|
overlays
|
|
|
|
;
|
|
|
|
defaultPackage = pkgs.picom;
|
|
|
|
devShells.default = mkDevShell defaultPackage;
|
2024-02-18 18:13:53 -05:00
|
|
|
devShells.useClang = devShells.default.override {
|
|
|
|
inherit (pkgs.llvmPackages_17) stdenv;
|
2024-02-15 06:37:12 -05:00
|
|
|
};
|
2024-04-08 04:40:33 -04:00
|
|
|
# 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;
|
|
|
|
};
|
2024-02-10 05:57:33 -05:00
|
|
|
});
|
2023-08-06 19:51:18 -04:00
|
|
|
}
|