diff options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c92d0d8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,51 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + nix-gleam.url = "github:arnarg/nix-gleam"; + + gitignore = { + url = "github:hercules-ci/gitignore.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { self + , nixpkgs + , flake-utils + , nix-gleam + , gitignore + , ... + }: flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + + overlays = [ + nix-gleam.overlays.default + ]; + }; + + inherit (gitignore.lib) gitignoreSource; + in + { + packages.default = pkgs.buildGleamApplication { + src = gitignoreSource ./.; + + rebar3Package = pkgs.rebar3WithPlugins { + plugins = with pkgs.beamPackages; [ + pc + ]; + }; + }; + + devShell = pkgs.mkShell { + buildInputs = [ + pkgs.gleam + pkgs.rebar3 + ]; + }; + } + ); +} |