wiki/flake.nix

44 lines
1,003 B
Nix
Raw Normal View History

2023-03-31 19:43:26 +05:30
{
2023-07-11 23:07:49 +05:30
description = "wiki.adtya.xyz";
2023-03-31 19:43:26 +05:30
inputs = {
2024-07-01 22:16:46 +05:30
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils?ref=main";
2023-03-31 19:43:26 +05:30
};
2023-11-26 19:55:37 +05:30
outputs =
{ self
, nixpkgs
, flake-utils
,
}:
2023-07-11 23:07:49 +05:30
flake-utils.lib.eachDefaultSystem (
2023-11-26 19:55:37 +05:30
system:
let
2023-03-31 19:43:26 +05:30
pkgs = import nixpkgs {
2023-07-11 23:07:49 +05:30
inherit system;
2023-03-31 19:43:26 +05:30
};
2024-09-07 19:30:23 +05:30
package = pkgs.callPackage ./default.nix { };
2024-07-01 22:16:35 +05:30
app = pkgs.writeShellScriptBin "app" ''
trap 'kill "''${child_pid}"; wait "''${child_pid}";' SIGINT SIGTERM
${pkgs.merecat}/bin/merecat -n -p 8080 ${package}/share/web &
child_pid="$!"
wait "''${child_pid}"
'';
2023-03-31 19:43:26 +05:30
in
2024-01-04 18:27:38 +05:30
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
2024-07-02 01:29:55 +05:30
packages = [
pkgs.mdbook
2024-09-07 19:30:23 +05:30
pkgs.mdbook-alerts
2023-11-26 19:55:37 +05:30
];
};
2024-01-04 18:27:38 +05:30
packages = {
2024-09-07 19:30:23 +05:30
inherit app;
2024-01-04 18:27:38 +05:30
default = package;
};
2023-11-26 19:55:37 +05:30
}
2023-03-31 19:43:26 +05:30
);
}