40 lines
951 B
Nix
40 lines
951 B
Nix
{
|
|
description = "info.belastodon.social flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
packages.default = pkgs.stdenv.mkDerivation {
|
|
pname = "info.belastodon.social";
|
|
version = "0.2.0";
|
|
src = self;
|
|
|
|
nativeBuildInputs = [ (pkgs.emacsPackages.emacsWithPackages (epkgs: [ epkgs.org ])) ];
|
|
|
|
buildPhase = ''
|
|
emacs --batch -l ./publish.el
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -r public/* $out/
|
|
'';
|
|
};
|
|
|
|
apps.default = {
|
|
type = "app";
|
|
program = toString (pkgs.writeShellScript "preview-server" ''
|
|
${pkgs.python3}/bin/python3 -m http.server 8000 --directory ${self.packages.${system}.default}
|
|
'');
|
|
};
|
|
});
|
|
}
|