-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake-static.nix
44 lines (41 loc) · 1.75 KB
/
flake-static.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
description = "Some Waybar custom plugins to enable or disable adaptive sync in Sway, and other tools";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}.pkgsMusl;
haskellPackages = pkgs.haskell.packages.ghc928;
packageName = "swankybar";
jailbreakUnbreak = pkg: pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
inherit (pkgs.haskell.lib) appendConfigureFlags justStaticExecutables;
mypackage = haskellPackages.callCabal2nix packageName self rec {
};
in
{
packages.${packageName} = pkgs.haskell.lib.overrideCabal mypackage (old: {
enableSharedExecutables = false;
enableSharedLibraries = false;
configureFlags = [
"--ghc-option=-optl=-static"
"--extra-lib-dirs=${pkgs.gmp6.override { withStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.zlib.static}/lib"
"--extra-lib-dirs=${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib"
"--extra-lib-dirs=${pkgs.ncurses.override { enableStatic = true; }}/lib"
];
});
defaultPackage = self.packages.${system}.${packageName};
devShell = pkgs.mkShell {
buildInputs = with haskellPackages; [
haskell-language-server
cabal-install
cabal2nix
] ++ [ pkgs.zlib ];
inputsFrom = builtins.attrValues self.packages.${system};
};
}
);
}