From b3484d330de30282d4ae4f94a883a1db81f5f03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=B3=E3=A6=A1?= <215371699+0ngk@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:01:02 +0900 Subject: [PATCH 1/2] build(nix): use nix flakes for development env --- .envrc | 1 + .gitignore | 3 +++ flake.lock | 27 ++++++++++++++++++++ flake.nix | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 599be4e..14037e5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ *.ez /build erl_crash.dump + + +.direnv/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d38172b --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1783279667, + "narHash": "sha256-/NAkDSsve+GNM0Bt6tleJdCGfsTlK89nPjkVOzZMo0s=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f205b5574fd0cb7da5b702a2da51507b7f4fdd1b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e5d4357 --- /dev/null +++ b/flake.nix @@ -0,0 +1,72 @@ +{ + description = "Development environment for kitazith"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = { + self, + nixpkgs, + }: let + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + forAllSystems = nixpkgs.lib.genAttrs systems; + + pkgsFor = system: + import nixpkgs { + inherit system; + }; + in { + devShells = forAllSystems (system: let + pkgs = pkgsFor system; + + ci-check = pkgs.writeShellApplication { + name = "ci-check"; + runtimeInputs = [ + pkgs.bash + pkgs.coreutils + pkgs.findutils + pkgs.git + pkgs.gleam + pkgs.erlang + pkgs.rebar3 + pkgs.nodejs_22 + ]; + text = '' + bash ./scripts/validate_packages.sh + ''; + }; + in { + default = pkgs.mkShell { + packages = [ + pkgs.bash + pkgs.coreutils + pkgs.findutils + pkgs.git + + pkgs.gleam + pkgs.erlang + pkgs.rebar3 + + pkgs.nodejs_22 + + ci-check + ]; + + shellHook = '' + echo "kitazith dev shell" + echo "Commands:" + echo " gleam build" + echo " gleam test" + echo " ci-check" + ''; + }; + }); + }; +} From 2323e9bb4d34a2a9b8bfb496af7c089a0a48475d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=B3=E3=A6=A1?= <215371699+0ngk@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:07:10 +0900 Subject: [PATCH 2/2] build(nix): fix evaluation warning for erlang --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index e5d4357..aef3a88 100644 --- a/flake.nix +++ b/flake.nix @@ -34,7 +34,7 @@ pkgs.findutils pkgs.git pkgs.gleam - pkgs.erlang + pkgs.beamPackages.erlang pkgs.rebar3 pkgs.nodejs_22 ]; @@ -51,7 +51,7 @@ pkgs.git pkgs.gleam - pkgs.erlang + pkgs.beamPackages.erlang pkgs.rebar3 pkgs.nodejs_22