From cd2d6366b0bcbb352da9dd22a666ab93852f4c01 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 30 Nov 2023 04:02:58 +0000 Subject: [PATCH] Add a flake file to build the project --- elm.nix | 8 +++---- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 18 ++++++++++++++++ 3 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/elm.nix b/elm.nix index 9d9d94e..4bfadda 100644 --- a/elm.nix +++ b/elm.nix @@ -1,8 +1,6 @@ -{ nixpkgs ? -, config ? {} -}: +{ pkgs }: -with (import nixpkgs config); +with pkgs; let mkDerivation = @@ -49,4 +47,4 @@ in mkDerivation { targets = ["Main"]; srcdir = "./src"; outputJavaScript = true; -} \ No newline at end of file +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..18fd351 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1701068326, + "narHash": "sha256-vmMceA+q6hG1yrjb+MP8T0YFDQIrW3bl45e7z24IEts=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8cfef6986adfb599ba379ae53c9f5631ecd2fd9c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..62b4d99 --- /dev/null +++ b/flake.nix @@ -0,0 +1,18 @@ +{ + 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 = import nixpkgs { inherit system; }; + bergamot-elm = import ./elm.nix { inherit pkgs; }; + in + { + packages = { inherit bergamot-elm; }; + defaultPackage = bergamot-elm; + } + ); +}