Skip to content

Commit 1211959

Browse files
committed
feat: cleaner approach of nuking the flags inside the haskell builder
1 parent e2c1eb9 commit 1211959

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

custom_modules/jellyfin.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ in
262262
};
263263

264264
services.paperless = {
265-
enable = false;
265+
enable = true;
266266
# passwordFile = "/etc/paperless-admin-pass";
267267
port = 28981;
268268
# dataDir = "/var/lib/paperless";
@@ -271,10 +271,10 @@ in
271271
# consumptionDirIsPublic = true;
272272
address = "0.0.0.0";
273273
};
274-
# users.users.paperless = {
275-
# shell = pkgs.bashInteractive;
276-
# isSystemUser = true;
277-
# };
274+
users.users.paperless = {
275+
shell = pkgs.bashInteractive;
276+
isSystemUser = true;
277+
};
278278
services.immich = {
279279
enable = false;
280280
port = 2283;

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
"-O2"
173173
])
174174
];
175+
# GHC uses ld.gold which doesn't support pack-relative-relocs
176+
preConfigure = (args.preConfigure or "") + ''
177+
export NIX_CFLAGS_LINK="''${NIX_CFLAGS_LINK//-Wl,-z,pack-relative-relocs/}"
178+
'';
175179
}
176180
);
177181
}) hfinal hprev;

utility-functions.nix

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,7 @@ in
9696
isSystemd = (attrs.pname or "") == "systemd" || (builtins.match ".*systemd.*" (attrs.name or "") != null);
9797
isOVMF = (attrs.pname or "") == "OVMF" || (builtins.match ".*OVMF.*" (attrs.name or "") != null);
9898

99-
# Heuristic: Haskell packages built via generic-builder usually have these attributes
100-
isHaskell = (attrs ? setupHaskellDepends) || (attrs ? libraryHaskellDepends) || (attrs ? executableHaskellDepends);
101-
# Check if GHC is in nativeBuildInputs - these use ld.gold which doesn't support pack-relative-relocs
102-
nativeBuildInputsList = attrs.nativeBuildInputs or [];
103-
hasGhcInBuildInputs = builtins.any (dep:
104-
let depName = dep.pname or dep.name or (builtins.parseDrvName (toString dep)).name or "";
105-
in builtins.match "ghc.*" depName != null
106-
) (if builtins.isList nativeBuildInputsList then nativeBuildInputsList else []);
107-
108-
shouldSkipRelocs = isHeroicIntegration || isGalaxyDummyService || isGhc || isSystemd || isOVMF || isHaskell || hasGhcInBuildInputs;
99+
shouldSkipRelocs = isHeroicIntegration || isGalaxyDummyService || isGhc || isSystemd || isOVMF;
109100

110101
extraLink =
111102
(if (stdenvSelf.hostPlatform.isLinux or false) && !shouldSkipRelocs then "-Wl,-z,pack-relative-relocs" else "");

0 commit comments

Comments
 (0)