chore: deduplication and reformat of flake.nix

This commit is contained in:
Lenivaya 2024-02-15 13:37:12 +02:00 committed by Yuxuan Shui
parent 216bfefd9f
commit 42782689e8
1 changed files with 50 additions and 34 deletions

View File

@ -7,39 +7,55 @@
}; };
}; };
outputs = { outputs = {
self, flake-utils, nixpkgs, git-ignore-nix, ... self,
}: flake-utils.lib.eachDefaultSystem (system: let flake-utils,
overlay = self: super: { nixpkgs,
picom = super.picom.overrideAttrs (oldAttrs: rec { git-ignore-nix,
pname = "picom"; ...
buildInputs = [ }:
self.pcre2 self.xorg.xcbutil self.libepoxy flake-utils.lib.eachDefaultSystem (system: let
] ++ self.lib.remove self.xorg.libXinerama ( overlay = self: super: {
self.lib.remove self.pcre oldAttrs.buildInputs picom = super.picom.overrideAttrs (oldAttrs: rec {
); version = "11";
src = git-ignore-nix.lib.gitignoreSource ./.; pname = "picom";
}); buildInputs =
}; [
pkgs = import nixpkgs { inherit system overlays; config.allowBroken = true; }; self.pcre2
overlays = [ overlay ]; self.xorg.xcbutil
in rec { self.libepoxy
inherit overlay overlays; ]
defaultPackage = pkgs.picom.overrideAttrs (o: { ++ self.lib.remove self.xorg.libXinerama (
version = "11"; self.lib.remove self.pcre oldAttrs.buildInputs
src = ./.; );
buildInputs = o.buildInputs ++ [ pkgs.libepoxy ]; src = git-ignore-nix.lib.gitignoreSource ./.;
});
};
pkgs = import nixpkgs {
inherit system overlays;
config.allowBroken = true;
};
overlays = [overlay];
in rec {
inherit
overlay
overlays
;
defaultPackage = pkgs.picom;
devShell = defaultPackage.overrideAttrs {
buildInputs =
defaultPackage.buildInputs
++ (with pkgs; [
clang-tools_17
llvmPackages_17.clang-unwrapped.python
]);
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"
'';
};
}); });
devShell = defaultPackage.overrideAttrs {
buildInputs = defaultPackage.buildInputs ++ (with pkgs; [
clang-tools_17
llvmPackages_17.clang-unwrapped.python
]);
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"
'';
};
});
} }