Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add Nix Flake support #775

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions flake.lock

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

44 changes: 44 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
description = "fvm nix flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
dart = pkgs.dart;
in
rec {
packages = {
default = pkgs.stdenv.mkDerivation {
pname = "fvm";
version = "3.2.1";
src = ./.;

buildInputs = [ dart ];

buildPhase = ''
export PUB_CACHE=$TMPDIR/.pub-cache
dart pub get
# avoding codesign issue when building on macOS:
export PATH="$PATH:/usr/bin"
dart compile exe bin/main.dart -o fvm
'';

installPhase = ''
mkdir -p $out/bin
cp fvm $out/bin/
'';

meta = with pkgs.lib; {
description = "fvm nix flake";
license = licenses.mit;
};
};
};
}
);
}
Loading