Skip to content

Commit

Permalink
Add nix
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-branch committed Jan 23, 2025
1 parent e026280 commit 8ee1a85
Show file tree
Hide file tree
Showing 4 changed files with 134 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ app/src/main/res/drawable/
app/release
app/src/main/ic_launcher-playstore.png
app/src/main/res/
.direnv/
96 changes: 96 additions & 0 deletions flake.lock

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

36 changes: 36 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
description = "BranchLinkSimulatorAndroid flake";
inputs = {
branch-nix.url = "git+ssh://[email protected]/BranchMetrics/nix";
};

outputs = { self, branch-nix }:
let
nixpkgs = branch-nix.nixpkgs;
extra-pkgs = branch-nix.packages;
utils = branch-nix.utils;
system-utils = branch-nix.system-utils;
in
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system} // {
extra-pkgs = extra-pkgs.${system};
};
jdk = pkgs.openjdk21;
in
{
devShell = pkgs.mkShell {
nativeBuildInputs = [
jdk
];
JAVA_HOME = "${jdk}";
shellHook = ''
if [ -f $HOME/.config/bin/setup-intellij-jdk ] && [ -f ./.idea/misc.xml ]; then
$HOME/.config/bin/setup-intellij-jdk || echo "setup-intellij-jdk failed"
fi
'';
};
formatter = pkgs.nixpkgs-fmt;
}
);
}

0 comments on commit 8ee1a85

Please sign in to comment.