From 578a6c9e163b20bb6af6186fa0a5e3baf45789c2 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Thu, 21 Dec 2023 15:57:30 -0600 Subject: [PATCH] feat: flake Signed-off-by: jolheiser --- README.md | 2 +- flake.lock | 26 ++++++++++++++++++++++++++ flake.nix | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/README.md b/README.md index cdc858a..4f282d6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # nixpl -A ver basic side-by-side nix repl. +A very basic side-by-side nix repl. ## License diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..120410a --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1703192751, + "narHash": "sha256-ZIQ84AWlIHRgZe5KDcaw303MBkGSMEVlFxMiqjMVkbI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "30cd89625c46c801946da2c5d249dc5c0cb37da5", + "type": "github" + }, + "original": { + "owner": "nixos", + "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..ec13ded --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + description = "Nix side-by-side repl"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs"; + + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.${system}.default = pkgs.buildGoModule { + pname = "nixpl"; + version = "0.1.0"; + src = ./.; + vendorHash = "sha256-uBp+x6UjVJUhzOnWngHPkkWUjGEVkYWfIrZhUVVkxPo="; + meta = with pkgs.lib; { + description = "Nix side-by-side repl"; + homepage = "https://git.jojodev.com/jolheiser/nixpl"; + maintainers = with maintainers; [jolheiser]; + mainProgram = "nixpl"; + }; + }; + + devShells.${system}.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + go + gopls + alejandra + ]; + }; + }; +}