Skip to content

Commit

Permalink
Add nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
afajl committed Apr 26, 2023
1 parent ae8f36a commit eb0bf06
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# ^ added for shellcheck and file-type detection

# Watch & reload direnv on change
watch_file flake.nix

if [[ $(type -t use_flake) != function ]]; then
echo "ERROR: use_flake function missing."
echo "Please update direnv to v2.30.0 or later."
exit 1
fi
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
/testrepos
result
94 changes: 94 additions & 0 deletions flake.lock

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

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

outputs = { self, flake-utils, naersk, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs) { inherit system; };

naersk' = pkgs.callPackage naersk { };

in rec {
defaultPackage = naersk'.buildPackage { src = ./.; };

devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo plantuml cargo-release ];
};
});
}

0 comments on commit eb0bf06

Please sign in to comment.