Skip to content

Commit

Permalink
Add flake.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier-varez committed Jan 4, 2025
1 parent 436d3ee commit e435bff
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 0 deletions.
124 changes: 124 additions & 0 deletions flake.lock

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

57 changes: 57 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
naersk.url = "github:nix-community/naersk/master";
utils.url = "github:numtide/flake-utils";
playdate-sdk.url = "github:RegularTetragon/playdate-sdk-flake";
};

outputs =
{
self,
nixpkgs,
naersk,
utils,
playdate-sdk,
}:
utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in
{
packages = rec {
crank = naersk-lib.buildPackage {
src = pkgs.fetchFromGitHub {
owner = "pd-rs";
repo = "crank";
rev = "main";
sha256 = "sha256-Le/jW8Ej2qouZ0+8AShbNXyZJBvb/I0H1o4Z+5fv7G8=";
};
};

rusty-boy = naersk-lib.buildPackage {
src = ./.;
root = ./.;
buildInputs = [ pkgs.SDL2 ];
};

# TODO: build rusty-date as well
default = rusty-boy;
};
devShell =
with pkgs;
mkShell {
buildInputs = [
SDL2
playdate-sdk.packages.x86_64-linux.default
self.packages."${pkgs.system}".crank
gcc-arm-embedded-13
];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
PLAYDATE_SDK_PATH = "${playdate-sdk.packages.x86_64-linux.default}";
};
}
);
}

0 comments on commit e435bff

Please sign in to comment.