From ea2a725e9d5d758495b556631c3280de9d97fa0a Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Wed, 10 Apr 2024 14:05:08 +0200 Subject: init --- default.nix | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 default.nix (limited to 'default.nix') 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; + }; +} -- cgit v1.2.3