aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-15 23:19:40 -0700
committerFuwn <[email protected]>2024-06-15 23:19:40 -0700
commit78f96ad1b0886cf2b473b8fb848034a1055f3c93 (patch)
tree5a5a2bb6641c536fca951dc280c5e78eb7c5ac91
parent23576fb52e052e14d67e7f3d7404792ec7ee2109 (diff)
downloadmayu-78f96ad1b0886cf2b473b8fb848034a1055f3c93.tar.xz
mayu-78f96ad1b0886cf2b473b8fb848034a1055f3c93.zip
build(nix): nix environment
-rw-r--r--.gitignore3
-rw-r--r--flake.lock98
-rw-r--r--flake.nix35
3 files changed, 136 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index b6a9f72..60dc8b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,6 @@ erl_crash.dump
# SQLite
*.sqlite3
*.db
+
+# Nix
+result
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..e7fba7b
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,98 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1710146030,
+ "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "gitignore": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1709087332,
+ "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
+ "nix-gleam": {
+ "locked": {
+ "lastModified": 1717670865,
+ "narHash": "sha256-+dAPiKAwCzlKWtx3aIHXfR6jydh1JyangewqZKJx500=",
+ "owner": "arnarg",
+ "repo": "nix-gleam",
+ "rev": "c69abe0e57a01991654d3de63dcd93a8b91b98ff",
+ "type": "github"
+ },
+ "original": {
+ "owner": "arnarg",
+ "repo": "nix-gleam",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1718318537,
+ "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "gitignore": "gitignore",
+ "nix-gleam": "nix-gleam",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
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 ];
+ };
+ }
+ );
+}