From 39f66b6f887609584092527028569f6a798c4876 Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Tue, 13 Feb 2024 14:34:35 +1300 Subject: [PATCH] add nix flake --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..502c992 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1707743206, + "narHash": "sha256-AehgH64b28yKobC/DAWYZWkJBxL/vP83vkY+ag2Hhy4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2d627a2a704708673e56346fcb13d25344b8eaf3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ec41313 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + description = "simple command line mail client"; + + inputs = { + nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable; + }; + + outputs = { self, nixpkgs }: + with nixpkgs.lib; + let + forAllSystems = fn: + genAttrs platforms.unix (system: + fn (import nixpkgs { + inherit system; + }) + ); + in + { + packages = forAllSystems (pkgs: { + default = pkgs.stdenv.mkDerivation (with pkgs; { + name = "mal"; + src = ./.; + + nativeBuildInputs = [ ldc ]; + buildInputs = [ curl ]; + + installFlags = [ + "DESTDIR=$(out)" + "PREFIX=/" + ]; + }); + }); + }; +}