aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
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 /flake.nix
parentd4049e9cbb634bfedaea409ab0fdaee32a3b2282 (diff)
downloadSakura-0ff53d39cdf8f823432311eb41adc34d416d9316.tar.gz
Sakura-0ff53d39cdf8f823432311eb41adc34d416d9316.zip
#24 ADD Pure nix builds (#36)
* #24 ADD Pure nix builds
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix87
1 files changed, 48 insertions, 39 deletions
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;
+ };
+ };
};
}