[NixOS] [taffybar] Hack around the patching of gi-gtk-hs cabal file

This commit is contained in:
2025-11-28 00:59:56 -08:00
parent 8799310710
commit c3f4f92a09
4 changed files with 77 additions and 72 deletions

View File

@@ -72,7 +72,7 @@
}, },
"git-ignore-nix": { "git-ignore-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1762808025, "lastModified": 1762808025,
@@ -148,35 +148,21 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1763464769, "lastModified": 1764252443,
"narHash": "sha256-AJHrsT7VoeQzErpBRlLJM1SODcaayp0joAoEA35yiwM=", "narHash": "sha256-U4G4dUSYWZYKtrF7/ozebD1B96at08SIhY4R9OaK1nw=",
"owner": "NixOS", "owner": "colonelpanic8",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6f374686605df381de8541c072038472a5ea2e2d", "rev": "e1fc6c25b91d3d49dd02a156237721f12dbd86b2",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "owner": "colonelpanic8",
"type": "indirect" "ref": "remove-gi-gtk-hs-patch",
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1760038930,
"narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1730768919, "lastModified": 1730768919,
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
@@ -192,7 +178,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1666603677, "lastModified": 1666603677,
"narHash": "sha256-apAEIj+z1iwMaMJ4tB21r/VTetfGDLDzuhXRHJknIAU=", "narHash": "sha256-apAEIj+z1iwMaMJ4tB21r/VTetfGDLDzuhXRHJknIAU=",
@@ -206,13 +192,13 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_5": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1763464769, "lastModified": 1764230294,
"narHash": "sha256-AJHrsT7VoeQzErpBRlLJM1SODcaayp0joAoEA35yiwM=", "narHash": "sha256-Z63xl5Scj3Y/zRBPAWq1eT68n2wBWGCIEF4waZ0bQBE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6f374686605df381de8541c072038472a5ea2e2d", "rev": "0d59e0290eefe0f12512043842d7096c4070f30e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -224,7 +210,7 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1747372754, "lastModified": 1747372754,
@@ -245,7 +231,7 @@
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"taffybar": "taffybar", "taffybar": "taffybar",
"xmonad": "xmonad_2" "xmonad": "xmonad"
} }
}, },
"status-notifier-item": { "status-notifier-item": {
@@ -314,32 +300,36 @@
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"gtk-sni-tray": "gtk-sni-tray", "gtk-sni-tray": "gtk-sni-tray",
"gtk-strut": "gtk-strut", "gtk-strut": "gtk-strut",
"nixpkgs": "nixpkgs_2", "nixpkgs": [
"nixpkgs"
],
"status-notifier-item": "status-notifier-item", "status-notifier-item": "status-notifier-item",
"weeder-nix": "weeder-nix", "weeder-nix": "weeder-nix",
"xmonad": "xmonad" "xmonad": [
"xmonad"
]
}, },
"locked": { "locked": {
"lastModified": 1760591109, "lastModified": 1764319014,
"narHash": "sha256-O21ayp5v2eccXdcwNjTK5ZB99ruK0Zt9CUaw5Rye42g=", "narHash": "sha256-OM69cuN5IIIkEy7UUDSsgkwzIvOnWvzYm/F1+ptpMjA=",
"owner": "taffybar", "ref": "refs/heads/bump-flake-dependencies",
"repo": "taffybar", "rev": "a7a7e620da2d9b51a6b841bbaf763ac1313e7d4e",
"rev": "b256a711416036ca124fc9b3f89e7c957535e465", "revCount": 1617,
"type": "github" "type": "git",
"url": "file:./taffybar"
}, },
"original": { "original": {
"owner": "taffybar", "type": "git",
"repo": "taffybar", "url": "file:./taffybar"
"type": "github"
} }
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1763421233, "lastModified": 1764242076,
"narHash": "sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw=", "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "89c2b2330e733d6cdb5eae7b899326930c2c0648", "rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -372,35 +362,18 @@
} }
}, },
"xmonad": { "xmonad": {
"flake": false,
"locked": {
"lastModified": 1759703235,
"narHash": "sha256-cZ40zIy66vl4gZoFaWTBi31vxTbYD5pvKEl2/Uypljk=",
"owner": "xmonad",
"repo": "xmonad",
"rev": "e3cd2b26e2b1bbcf30df5598af5324785f5ac6a6",
"type": "github"
},
"original": {
"owner": "xmonad",
"ref": "master",
"repo": "xmonad",
"type": "github"
}
},
"xmonad_2": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_3",
"git-ignore-nix": "git-ignore-nix", "git-ignore-nix": "git-ignore-nix",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_4",
"unstable": "unstable" "unstable": "unstable"
}, },
"locked": { "locked": {
"lastModified": 1762015461, "lastModified": 1763949843,
"narHash": "sha256-wEDZVHILQXasjswQUf5lEsEzS47VFx1JrEYyb4nFhdM=", "narHash": "sha256-aJXmGPWKjXs7cagVzUE3fd2Fpc+sXnknM446AxHgvH0=",
"owner": "xmonad", "owner": "xmonad",
"repo": "xmonad", "repo": "xmonad",
"rev": "159c55d4dce50e3e2764cd88c19067e0f705e289", "rev": "97edef37a3ae10012272d692b5e1bc9b7013fc14",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -1,15 +1,41 @@
{ {
inputs = { inputs = {
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:colonelpanic8/nixpkgs/remove-gi-gtk-hs-patch";
xmonad.url = "github:xmonad/xmonad/master"; xmonad.url = "github:xmonad/xmonad/master";
taffybar.url = "github:taffybar/taffybar"; taffybar = {
url = "git+file:./taffybar";
inputs.nixpkgs.follows = "nixpkgs";
inputs.xmonad.follows = "xmonad";
};
}; };
outputs = { self, flake-utils, taffybar, nixpkgs, xmonad }: outputs = { self, flake-utils, taffybar, nixpkgs, xmonad }:
let let
hoverlay = final: prev: hself: hsuper: { hoverlay = final: prev: hself: hsuper:
taffybar = hsuper.taffybar.overrideAttrs (old: { let
doHaddock = false; fixGiVersionPackage = drv:
let
overridden = drv.override {
gi-gtk = hself.gi-gtk3;
gi-gdk = hself.gi-gdk3;
};
in prev.haskell.lib.overrideCabal overridden (oa: {
postPatch = (oa.postPatch or "") + ''
substituteInPlace ${oa.pname}.cabal \
--replace-fail "gi-gtk " "gi-gtk3 " \
--replace-fail "gi-gdk " "gi-gdk3 "
'';
}); });
in {
taffybar = hsuper.taffybar.overrideAttrs (_: {
doHaddock = false;
doCheck = false;
});
gi-gtk-hs =
let drv = hsuper.gi-gtk-hs;
in if final.lib.versionOlder drv.version "0.3.18"
then fixGiVersionPackage drv
else drv;
imalison-taffybar = prev.haskell.lib.addPkgconfigDepends ( imalison-taffybar = prev.haskell.lib.addPkgconfigDepends (
hself.callCabal2nix "imalison-taffybar" hself.callCabal2nix "imalison-taffybar"
( (
@@ -34,9 +60,9 @@
}; };
defComp = { compiler = "ghc94"; }; defComp = { compiler = "ghc94"; };
overlay = xmonad.lib.fromHOL hoverlay defComp; overlay = xmonad.lib.fromHOL hoverlay defComp;
overlays = [ taffybar.overlay overlay ]; overlayList = [ taffybar.overlays.default overlay ];
in flake-utils.lib.eachDefaultSystem (system: in flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system overlays; config.allowBroken = true; }; let pkgs = import nixpkgs { inherit system; overlays = overlayList; config.allowBroken = true; };
hpkgs = pkgs.lib.attrsets.getAttrFromPath (xmonad.lib.hpath defComp) pkgs; hpkgs = pkgs.lib.attrsets.getAttrFromPath (xmonad.lib.hpath defComp) pkgs;
in in
{ {
@@ -48,5 +74,11 @@
]; ];
}; };
defaultPackage = hpkgs.imalison-taffybar; defaultPackage = hpkgs.imalison-taffybar;
}) // { inherit overlay overlays; } ; }) // {
inherit overlay;
overlays = {
default = overlay;
taffybar = taffybar.overlays.default;
};
} ;
} }

View File

@@ -21,7 +21,7 @@ executable taffybar
, containers , containers
, directory , directory
, filepath , filepath
, gi-gtk , gi-gtk3
, gtk-sni-tray , gtk-sni-tray
, gtk-strut , gtk-strut
, haskell-gi-base , haskell-gi-base