flake.nix 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {
  2. description = "Archy WM";
  3. inputs = {
  4. flake-utils.url = "github:numtide/flake-utils";
  5. nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
  6. };
  7. outputs = { self, nixpkgs, flake-utils }:
  8. flake-utils.lib.eachDefaultSystem
  9. (system:
  10. let
  11. pkgs = import nixpkgs { inherit system; };
  12. libPath = with pkgs; lib.makeLibraryPath [ xorg.libX11 ];
  13. nativeBuildInputs = with pkgs; [ pkg-config gnumake ];
  14. buildInputs = with pkgs.xorg; [ libX11 libXft libXinerama ];
  15. in
  16. with pkgs; {
  17. packages = rec {
  18. archy-wm = pkgs.stdenv.mkDerivation {
  19. inherit buildInputs nativeBuildInputs;
  20. name = "archy-dwm";
  21. src = ./.;
  22. buildPhase = ''
  23. make
  24. '';
  25. installPhase = ''
  26. mkdir -p $out/bin
  27. cp ./build/archy-dwm $out/bin/
  28. '';
  29. };
  30. default = archy-wm;
  31. };
  32. devShell = mkShell {
  33. inherit buildInputs nativeBuildInputs;
  34. packages = with pkgs; [
  35. git
  36. ];
  37. shellHook = ''
  38. git status
  39. '';
  40. LD_LIBRARY_PATH = "${libPath}";
  41. };
  42. }
  43. ) // {
  44. overlay = final: prev: {
  45. inherit (self.packages.${final.system}) archy-wm;
  46. };
  47. };
  48. }