update script for go dependancies

This commit is contained in:
Alan Daniels 2025-02-13 09:56:52 +11:00
parent c5a07cc35b
commit c2a81f7d2a
2 changed files with 22 additions and 19 deletions

View file

@ -25,6 +25,7 @@
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
};
devShells.default = callPackage ./shell.nix {
inherit source;
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
};
})

View file

@ -1,4 +1,6 @@
{ pkgs ? (
{
source,
pkgs ? (
let
inherit (builtins) fetchTree fromJSON readFile;
inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix;
@ -8,17 +10,17 @@
(import "${fetchTree gomod2nix.locked}/overlay.nix")
];
}
)
, mkGoEnv ? pkgs.mkGoEnv
, gomod2nix ? pkgs.gomod2nix
}:
let
goEnv = mkGoEnv { pwd = ./.; };
),
mkGoEnv ? pkgs.mkGoEnv,
gomod2nix ? pkgs.gomod2nix,
}: let
update_gomod2nix = pkgs.writeShellScriptBin "update_gomod2nix" ''
${gomod2nix}/bin/gomod2nix --dir ${source} --outdir ./
'';
in
pkgs.mkShell {
pkgs.mkShell {
packages = [
goEnv
gomod2nix
update_gomod2nix
];
}
}