From 0448cbc02ad1899eeaf772e560a395bf806dd42c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 16 Jun 2024 06:19:40 +0000 Subject: build(nix): nix environment --- flake.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6cb146d --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "Moe-Counter Compatible Website Hit Counter"; + 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 ]; + }; + } + ); +} -- cgit v1.2.3