From 7d038383893876653826ed0b3b1a2166a3520550 Mon Sep 17 00:00:00 2001 From: jzbor Date: Tue, 3 Sep 2024 17:09:46 +0200 Subject: [PATCH] Adding flake --- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 100 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..60a47b7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "cf": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717341061, + "narHash": "sha256-BI3oxYX5ahrxJdmqJoy9GXz8If4FmD+DlQNsKH6CVsA=", + "owner": "jzbor", + "repo": "cornflakes", + "rev": "71742f72bb4644ec7958dba3ebd7be664c66c264", + "type": "github" + }, + "original": { + "owner": "jzbor", + "repo": "cornflakes", + "type": "github" + } + }, + "crane": { + "locked": { + "lastModified": 1725125250, + "narHash": "sha256-CB20rDD5eHikF6mMTTJdwPP1qvyoiyyw1RDUzwIaIF8=", + "owner": "ipetkov", + "repo": "crane", + "rev": "96fd12c7100e9e05fa1a0a5bd108525600ce282f", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1724819573, + "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", + "path": "/nix/store/887hpp8a2i99n9jjwcvz6qkhhhqsvzkg-source", + "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "cf": "cf", + "crane": "crane", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..255d23b --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Simple REPL shell for untyped lambda expressions."; + inputs = { + nixpkgs.url = "nixpkgs"; + cf.url = "github:jzbor/cornflakes"; + cf.inputs.nixpkgs.follows = "nixpkgs"; + crane.url = "github:ipetkov/crane"; + }; + + outputs = { nixpkgs, cf, crane, ... }: + cf.lib.flakeForDefaultSystems (system: + with builtins; + let + pkgs = nixpkgs.legacyPackages.${system}; + craneLib = crane.mkLib pkgs; + nativeBuildInputs = with pkgs; [ + clang + ]; + in { + ### PACKAGES ### + packages = { + default = craneLib.buildPackage { + pname = "foliot"; + + src = ./.; + + # Add extra inputs here or any other derivation settings + # doCheck = true; + inherit nativeBuildInputs; + }; + }; + }) // { + nixConfig = { + extra-substituters = [ "https://cache.jzbor.de/public" ]; + extra-trusted-public-keys = [ "public:AdkE6qSLmWKFX4AptLFl+n+RTPIo1lrBhT2sPgfg5s4=" ]; + }; + }; +} +