diff options
author | refaelsh <refaelsh@pm.me> | 2024-10-08 18:14:23 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2024-10-08 18:18:14 +0100 |
commit | 7390d759240785f660cbdb0ca55898732aa12c98 (patch) | |
tree | 4a4e97aa6b200002e49be3c627f921ce76e20a70 /nix/flake.nix | |
parent | 4e8ec5a4c86873018f3ba33669fb9affff280d6e (diff) | |
download | xmobar-7390d759240785f660cbdb0ca55898732aa12c98.tar.gz xmobar-7390d759240785f660cbdb0ca55898732aa12c98.tar.bz2 |
Author: refaelsh <refaelsh@pm.me>
Date: Tue Oct 8 18:14:23 2024 +0100
Diffstat (limited to 'nix/flake.nix')
-rw-r--r-- | nix/flake.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 0000000..b422c9a --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,64 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + git-ignore-nix.url = "github:hercules-ci/gitignore.nix/master"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = + { + self, + nixpkgs, + flake-utils, + git-ignore-nix, + }: + let + overlay = final: prev: { + haskellPackages = prev.haskellPackages.override (old: { + overrides = prev.lib.composeExtensions (old.overrides or (_: _: { })) ( + hself: hsuper: { + xmobar = prev.haskell.lib.compose.dontCheck ( + hself.callCabal2nix "xmobar" (git-ignore-nix.lib.gitignoreSource ./.) { } + ); + } + ); + }); + }; + overlays = [ overlay ]; + + homeModules.mainmodule = import ./default.nix; + in + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { inherit system overlays; }; + dynamicLibraries = with pkgs; [ + xorg.libX11 + xorg.libXrandr + xorg.libXrender + xorg.libXScrnSaver + xorg.libXext + xorg.libXft + xorg.libXpm.out + xorg.libXrandr + xorg.libXrender + ]; + in + { + devShell = pkgs.haskellPackages.shellFor { + packages = p: [ p.xmobar ]; + buildInputs = + with pkgs; + [ + haskellPackages.cabal-install + ] + ++ dynamicLibraries; + + LD_LIBRARY_PATH = pkgs.lib.strings.makeLibraryPath dynamicLibraries; + }; + defaultPackage = pkgs.haskellPackages.xmobar; + } + ) + // { + inherit overlay overlays homeModules; + }; +} |