diff --git a/default.nix b/default.nix index a6aa7c8..80bae35 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,21 @@ -{ lib, self, mixRelease, fetchMixDeps, elixir }: mixRelease rec { - pname = "sso_bsn"; - version = "0.0.1"; +{ + lib, + self, + mixRelease, + fetchMixDeps, + elixir, +}: +mixRelease rec { + pname = "sso_bsn"; + version = "0.0.1"; - inherit elixir; - src = self; - mixFodDeps = fetchMixDeps { - pname = "mix-deps-${pname}"; - inherit version src; - sha256 = "sha256-hQlMy0e1Kv2zBXYCiNHYlIO0N00wuIW8B+ZlsEMTSy0="; - }; + inherit elixir; + src = self; + mixFodDeps = fetchMixDeps { + pname = "mix-deps-${pname}"; + inherit version src; + sha256 = "sha256-hQlMy0e1Kv2zBXYCiNHYlIO0N00wuIW8B+ZlsEMTSy0="; + }; - ELIXIR_MAKE_CACHE_DIR = "/tmp/.elixir-make-cache"; + ELIXIR_MAKE_CACHE_DIR = "/tmp/.elixir-make-cache"; } diff --git a/flake.nix b/flake.nix index b86aca6..6716983 100644 --- a/flake.nix +++ b/flake.nix @@ -1,19 +1,27 @@ { description = "A simple OIDC SSO service"; - outputs = { self, nixpkgs, systems }: let + outputs = { + self, + nixpkgs, + systems, + }: let inherit (nixpkgs) lib; - eachSystem = f: lib.genAttrs (import systems) (system: f { - inherit system; - pkgs = nixpkgs.legacyPackages.${system}; - ownPkgs = self.packages.${system}; - }); + eachSystem = f: + lib.genAttrs (import systems) (system: + f { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + ownPkgs = self.packages.${system}; + }); in { - devShells = eachSystem ({ pkgs, ... }: { - default = pkgs.beam.beamLib.callPackage ./shell.nix {}; + devShells = eachSystem ({pkgs, ...}: { + default = pkgs.beam.packages.erlang_26.callPackage ./shell.nix {}; }); - packages = eachSystem ({ pkgs, ... }: { - default = pkgs.beam.packages.erlang.callPackage ./default.nix { inherit self; inherit (pkgs) elixir; }; + packages = eachSystem ({pkgs, ...}: { + default = pkgs.beam.packages.erlang_26.callPackage ./default.nix { + inherit self; + }; }); }; } diff --git a/shell.nix b/shell.nix index b0fbdff..d130820 100644 --- a/shell.nix +++ b/shell.nix @@ -1,10 +1,24 @@ -{ mkShell, elixir, elixir-ls, inotify-tools, sqlite-interactive }: - mkShell { - packages = [ elixir elixir-ls inotify-tools sqlite-interactive ]; - shellHook = '' - mkdir -p .nix-mix - mkdir -p .nix-hex - export MIX_HOME=$PWD/.nix-mix - export HEX_HOME=$PWD/.nix-hex - ''; -} \ No newline at end of file +{ + lib, + pkgs, + mkShell, + elixir, + elixir-ls, + inotify-tools, + sqlite-interactive, +}: +mkShell { + packages = + [elixir elixir-ls sqlite-interactive] + ++ lib.lists.optional (pkgs.system == "x86_64-linux") inotify-tools + ++ lib.lists.optionals (pkgs.system == "aarch64-darwin") (with pkgs.darwin.apple_sdk.frameworks; [ + CoreFoundation + CoreServices + ]); + shellHook = '' + mkdir -p .nix-mix + mkdir -p .nix-hex + export MIX_HOME=$PWD/.nix-mix + export HEX_HOME=$PWD/.nix-hex + ''; +}