aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpebble <166765742+ignorant05@users.noreply.github.com>2025-12-07 13:19:29 +0100
committerGitHub <noreply@github.com>2025-12-07 08:19:29 -0400
commit0ff53d39cdf8f823432311eb41adc34d416d9316 (patch)
tree8ee91f988d5b234a9a4f1b7051b78c64304a15f8
parentd4049e9cbb634bfedaea409ab0fdaee32a3b2282 (diff)
downloadSakura-0ff53d39cdf8f823432311eb41adc34d416d9316.tar.gz
Sakura-0ff53d39cdf8f823432311eb41adc34d416d9316.zip
#24 ADD Pure nix builds (#36)
* #24 ADD Pure nix builds
Diffstat (limited to '')
-rw-r--r--flake.lock6
-rw-r--r--flake.nix87
-rw-r--r--rebar.config7
3 files changed, 57 insertions, 43 deletions
diff --git a/flake.lock b/flake.lock
index e3ba5a3..3c091ca 100644
--- a/flake.lock
+++ b/flake.lock
@@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1762363567,
- "narHash": "sha256-YRqMDEtSMbitIMj+JLpheSz0pwEr0Rmy5mC7myl17xs=",
+ "lastModified": 1764667669,
+ "narHash": "sha256-7WUCZfmqLAssbDqwg9cUDAXrSoXN79eEEq17qhTNM/Y=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "ae814fd3904b621d8ab97418f1d0f2eb0d3716f4",
+ "rev": "418468ac9527e799809c900eda37cbff999199b6",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index f0afc44..dfb0698 100644
--- a/flake.nix
+++ b/flake.nix
@@ -11,52 +11,61 @@
treefmt-nix.url = "github:numtide/treefmt-nix";
};
- outputs =
- { self,
- nixpkgs,
- flake-parts,
- treefmt-nix,
- ...
- }@inputs:
+ outputs = { self, nixpkgs, flake-parts, treefmt-nix, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
- perSystem =
- { pkgs, system, ... }:
- let
- treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
- in
- {
- # This sets `pkgs` to a nixpkgs with allowUnfree option set.
- _module.args.pkgs = import nixpkgs {
- inherit system;
- config.allowUnfree = true;
- };
+ perSystem = { pkgs, system, ... }:
+ let
+ erlang = pkgs.erlang_28;
+
+ buildRebar3 = pkgs.beamPackages.buildRebar3 {
+ pname = "domino";
+ version = "0.1.0";
+ src = ./.;
+ beam = erlang;
+ generate-lock = true;
+ name = "domino";
+ buildInputs = [ pkgs.rebar3 ];
- # nix build
- packages = {
- hello = pkgs.hello;
- default = pkgs.hello;
+ meta = with pkgs.lib; {
+ description = "Domino Erlang Server";
+ license = pkgs.lib.licenses.mit;
+ platforms = pkgs.lib.platforms.all;
};
+ };
+
+ in {
+ # This sets `pkgs` to a nixpkgs with allowUnfree option set.
+ _module.args.pkgs = import nixpkgs {
+ inherit system;
+ config.allowUnfree = true;
+ };
- devShells =
- {
- default = pkgs.mkShell {
- packages = with pkgs; [
- erlang_28
- erlang-language-platform
- rebar3
- ];
- };
- };
-
- # nix fmt
- formatter = treefmtEval.config.build.wrapper;
-
- # nix flake check --all-systems
- checks = {
- formatting = treefmtEval.config.build.check self;
+ # nix build
+ packages = {
+ domino = buildRebar3;
+ default = buildRebar3;
+ };
+
+ # Define devShell for Erlang + Rebar3
+ devShells = {
+ default = pkgs.mkShell {
+ packages = with pkgs; [
+ erlang_28
+ erlang-language-platform
+ rebar3
+ ];
};
};
+
+ # Formatter setup for Nix files
+ formatter = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
+
+ # nix flake check --all-systems
+ checks = {
+ formatting = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
+ };
+ };
};
}
diff --git a/rebar.config b/rebar.config
index 0613ed8..2c2d11e 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,6 +1,11 @@
{erl_opts, [debug_info]}.
{deps, [{merklet, "2.0.0"}]}.
+{plugins, [
+ {rebar3_nix, ".*", {git, "https://github.com/erlang-nix/rebar3_nix.git", {tag, "v0.1.1"}}},
+ {covertool, "v2.0.4"}
+]}.
+
{shell, [
{apps, [main]}
]}.
@@ -30,4 +35,4 @@
{overview, "doc/overview.edoc"},
{title, "Domino - Extended Relational Database Engine"},
{pretty_printer, erl_pp}
-]}. \ No newline at end of file
+]}.