From f669943c71b4089e8733e7f4410c8e2ac4a7c0c1 Mon Sep 17 00:00:00 2001 From: Joscha Date: Wed, 16 Aug 2023 12:47:13 +0200 Subject: [PATCH] Flakify --- flake.lock | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 27 +++++++++++++++++++++++++++ 2 files changed, 75 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..3a22ac6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "naersk": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1692178377, + "narHash": "sha256-Ivvz/QjXgy+P9Bl+/J1Tf03oyg1wu7R9cywOZyMLVVk=", + "owner": "nix-community", + "repo": "naersk", + "rev": "9bbe32cccfff5a44b7b75fb818e7739d500a07a7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1692134936, + "narHash": "sha256-Z68O969cioC6I3k/AFBxsuEwpJwt4l9fzwuAMUhCCs0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bfd953b2c6de4f550f75461bcc5768b6f966be10", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "naersk": "naersk", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e160f70 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + + naersk.url = "github:nix-community/naersk"; + naersk.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, nixpkgs, naersk }: + let forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; + in { + packages = forAllSystems (system: + let + pkgs = import nixpkgs { inherit system; }; + naersk' = pkgs.callPackage naersk { }; + in + rec { + tablejohn = naersk'.buildPackage + { + root = ./.; + nativeBuildInputs = [ pkgs.nodePackages.typescript ]; + }; + default = tablejohn; + } + ); + }; +}