aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-30 02:34:59 +0000
committerFuwn <[email protected]>2024-09-30 02:34:59 +0000
commitd8dbcc4ed9dccb3c08fa0c15b10bdc9625c3c181 (patch)
treef190033d181b27639ed49b66c8088d58477425cb /flake.nix
parentbuild(docker): add simple build.ninja for Dockerfile (diff)
downloadmaple-d8dbcc4ed9dccb3c08fa0c15b10bdc9625c3c181.tar.xz
maple-d8dbcc4ed9dccb3c08fa0c15b10bdc9625c3c181.zip
chore(nix): set up flake
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix89
1 files changed, 89 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..7abbcb5
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,89 @@
+{
+ description = "A very simple static Gemini server, now with Titan support!";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs";
+ systems.url = "github:nix-systems/default";
+
+ flake-compat = {
+ url = "github:edolstra/flake-compat";
+ flake = false;
+ };
+
+ flake-utils = {
+ url = "github:numtide/flake-utils";
+ inputs.systems.follows = "systems";
+ };
+ };
+
+ outputs =
+ {
+ nixpkgs,
+ flake-utils,
+ self,
+ ...
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+
+ meta = with pkgs.lib; {
+ description = "A very simple static Gemini server, now with Titan support!";
+ homepage = "https://github.com/gemrest/maple";
+ license = licenses.gpl3Only;
+ maintainers = [ maintainers.Fuwn ];
+ mainPackage = "maple";
+ platforms = platforms.linux;
+ };
+
+ maple = (pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv).mkDerivation {
+ inherit meta;
+
+ name = "maple";
+ version = "0.1.6";
+ src = pkgs.lib.cleanSource ./.;
+
+ nativeBuildInputs = with pkgs; [
+ ninja
+ clang
+ ];
+
+ buildInputs = [
+ pkgs.libressl.dev
+ ];
+
+ buildPhase = ''
+ mkdir -p $out/bin
+ ninja
+ '';
+
+ installPhase = ''
+ cp build/maple $out/bin/maple
+ '';
+ };
+ in
+ {
+ packages = {
+ inherit maple;
+
+ default = maple;
+ };
+
+ apps = {
+ maple = {
+ inherit meta;
+
+ type = "app";
+ program = "${maple}/bin/maple";
+ };
+
+ default = self.apps.${system}.maple;
+ };
+
+ devShells.default = import ./shell.nix {
+ inherit pkgs;
+ };
+ }
+ );
+}