summaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-04-10 14:05:08 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-04-26 14:08:57 +0200
commitea2a725e9d5d758495b556631c3280de9d97fa0a (patch)
tree374e4ba40d4c5a4cca87a1cf34733a53bbf0c491 /default.nix
init
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..a0d748b
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,66 @@
+{ pkgs ? import (import ./nix/sources.nix).nixpkgs { } }:
+let
+ haskellPackages = pkgs.haskellPackages.override {
+ overrides = self: super: {
+ astatusbar = self.callCabal2nix "astatusbar" ./. { };
+ sh = pkgs.haskell.lib.dontCheck (self.callCabal2nix "sh" (import ./nix/sources.nix).sh { });
+ statvfs = pkgs.haskell.lib.markUnbroken (super.statvfs.overrideAttrs (oldAtts: {
+ patches = [
+ (pkgs.writers.writeText "statvfs.patch" ''
+ diff --git a/Setup.hs b/Setup.hs
+ index 7cf9bfd..54f57d6 100644
+ --- a/Setup.hs
+ +++ b/Setup.hs
+ @@ -3,4 +3,4 @@ module Main (main) where
+ import Distribution.Simple
+
+ main :: IO ()
+ -main = defaultMainWithHooks defaultUserHooks
+ +main = defaultMainWithHooks autoconfUserHooks
+ '')
+ ];
+ }));
+ X11 = (self.callCabal2nix "X11"
+ (pkgs.fetchFromGitHub {
+ owner = "xmonad";
+ repo = "X11";
+ rev = "1ead9698c89e78884ac771c93822447999a1dc46";
+ hash = "sha256-OAZ3gnUezsumBC8VwhcsKq+Nrq44L4xY/z6exK7InLo=";
+ })
+ { }).overrideAttrs (oldAttrs: {
+ preConfigure = oldAttrs.preConfigure or "" + ''
+ ${pkgs.autoconf}/bin/autoreconf'';
+ patches = oldAttrs.patches or [ ] ++ [
+ (pkgs.writers.writeText "X11-safe-select.patch" ''
+ diff --git a/Graphics/X11/Xlib/Event.hsc b/Graphics/X11/Xlib/Event.hsc
+ index 842fc2f..869aba8 100644
+ --- a/Graphics/X11/Xlib/Event.hsc
+ +++ b/Graphics/X11/Xlib/Event.hsc
+ @@ -419,7 +419,7 @@ newtype FdSet = FdSet (Ptr FdSet)
+ foreign import ccall unsafe "HsXlib.h" fdZero :: Ptr FdSet -> IO ()
+ foreign import ccall unsafe "HsXlib.h" fdSet :: CInt -> Ptr FdSet -> IO ()
+
+ -foreign import ccall unsafe "HsXlib.h" select ::
+ +foreign import ccall safe "HsXlib.h" select ::
+ CInt -> Ptr FdSet -> Ptr FdSet -> Ptr FdSet -> Ptr TimeVal -> IO CInt
+
+ -- | This function is somewhat compatible with Win32's @TimeGetTime()@
+ '')
+ ];
+ });
+ };
+ };
+in
+rec {
+ inherit haskellPackages;
+ inherit (haskellPackages) astatusbar;
+ shell = haskellPackages.shellFor {
+ packages = _: [ haskellPackages.astatusbar ];
+ buildInputs = [
+ pkgs.cabal-install
+ pkgs.niv
+ pkgs.ormolu
+ ];
+ withHoogle = true;
+ };
+}