diff --git a/nix/package.nix b/nix/package.nix index 1a38c67..66b77c5 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -3,24 +3,29 @@ lib, ... }: let - inherit (lib) hasSuffix; - - pname = "mdlinkt"; - version = "0.1.0"; + fs = lib.fileset; in buildGoModule { - inherit pname version; + pname = "mdlinkt"; + version = "0.1.0"; + + src = fs.toSource { + root = ../.; + fileset = fs.unions [ + ../go.mod + ../go.sum + ../main.go + ]; + }; - src = builtins.filterSource (path: type: type != "directory" || hasSuffix path != ".nix") ../.; vendorHash = null; ldflags = ["-s" "-w"]; - doCheck = false; - meta = { - description = "A CLI tool for checking for dead links in a markdown file"; + description = "CLI tool for checking for dead links in a markdown file"; + homepage = "https://github.com/notashelf/mdlinkt"; license = lib.licenses.gpl3Only; - mainProgram = pname; - maintainers = with lib.maintainers; [NotAShelf]; + mainProgram = "mdlinkt"; + maintainers = [lib.maintainers.NotAShelf]; }; } diff --git a/nix/shell.nix b/nix/shell.nix index 717e66a..6d18aa0 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -1,15 +1,14 @@ { - callPackage, - gopls, + mkShell, go, -}: let - mainPkg = callPackage ./package.nix {}; -in - mainPkg.overrideAttrs (oa: { - nativeBuildInputs = - [ - gopls - go - ] - ++ (oa.nativeBuildInputs or []); - }) + gopls, + delve, +}: +mkShell { + name = "mdlinkt"; + packages = [ + go + gopls + delve + ]; +}