Skip to content

Commit

Permalink
Merge pull request #27 from MagicRB/add-flake
Browse files Browse the repository at this point in the history
Add flake.nix
  • Loading branch information
Anut-py authored Oct 29, 2023
2 parents f19581f + d0d6842 commit 125ae9a
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
24 changes: 24 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
inputs.nixpkgs.url = "nixpkgs";

outputs = { self, nixpkgs, ... }@inputs:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems' = nixpkgs.lib.genAttrs;
forAllSystems = forAllSystems' supportedSystems;

pkgsForSystem =
system:
import nixpkgs { inherit system; overlays = [ ]; };
in
{
devShells = forAllSystems (system:
let
pkgs = pkgsForSystem system;
in
{
default =
pkgs.mkShell rec {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
buildInputs = with pkgs; [
stdenv.cc
ghc

((raylib.override { includeEverything = true; }).overrideAttrs (old: {
patches = [];
src = fetchFromGitHub {
owner = "raysan5";
repo = "raylib";
rev = "b8cd10264b6d34ff4b09ccdd0b0f7b254cf3b122";
sha256 = "sha256-VRNQZ0Pp1uczhLSF4Hz2QWiEini2jFtEGJDZMcLE+0w=";
};
postFixup = ''
cp ../src/*.h $out/include/
'';
}))
glfw
cabal-install
];
};
}
);
};
}

0 comments on commit 125ae9a

Please sign in to comment.