From 947e1551eb555addc6cff14929bc2fd4f3c35a0d Mon Sep 17 00:00:00 2001 From: Alexandre Macabies Date: Sun, 5 Nov 2023 00:03:43 +0100 Subject: [PATCH] Add flake. --- .envrc | 1 + flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 19 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d719534 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1698924604, + "narHash": "sha256-GCFbkl2tj8fEZBZCw3Tc0AkGo0v+YrQlohhEGJ/X4s0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "fa804edfb7869c9fb230e174182a8a1a7e512c40", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-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..88d35c6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs }: + let pkgs = nixpkgs.legacyPackages."x86_64-linux"; + in { + packages."x86_64-linux".default = pkgs.mkYarnPackage { + pname = "mugctl"; + src = ./.; + packageJSON = ./package.json; + yarnLock = ./yarn.lock; + }; + packages."x86_64-linux".devShells.default = with pkgs; mkShell { + nativeBuildInputs = [ nodejs yarn ]; + }; + }; +}