mobilizon/flake.nix
2023-10-20 11:48:09 +02:00

64 lines
1.5 KiB
Nix

{
description = "Mobilizon fork for potsda.mn";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-filter.url = "github:numtide/nix-filter";
};
outputs = { self, nixpkgs, nix-filter }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
filter = nix-filter.lib;
in
{
packages.x86_64-linux = {
mobilizon = pkgs.callPackage ./. {
src = filter {
root = ./.;
exclude = [
(filter.matchExt "nix")
"js"
];
};
src-config = ./config;
mobilizon-js = self.packages.x86_64-linux.mobilizon-frontend;
};
mobilizon-frontend = pkgs.callPackage ./js { inherit filter; };
default = self.packages.x86_64-linux.mobilizon;
# Update local Mobilizon definition
update =
pkgs.writeShellScriptBin "update" ''
set -eou pipefail
${pkgs.mix2nix}/bin/mix2nix ./mix.lock > mix.nix
'';
};
devShells.x86_64-linux.default =
pkgs.mkShell {
buildInputs = with pkgs; [
elixir
mix2nix
cmake
imagemagick
(yarn.override {
nodejs = nodejs-18_x;
})
yarn2nix
nodejs-18_x
];
};
checks.x86_64-linux = {
inherit (self.packages.x86_64-linux) mobilizon update;
};
};
}