update script for go dependancies
This commit is contained in:
parent
c5a07cc35b
commit
c2a81f7d2a
2 changed files with 22 additions and 19 deletions
|
|
@ -25,6 +25,7 @@
|
|||
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
|
||||
};
|
||||
devShells.default = callPackage ./shell.nix {
|
||||
inherit source;
|
||||
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
|
||||
};
|
||||
})
|
||||
|
|
|
|||
20
shell.nix
20
shell.nix
|
|
@ -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 {
|
||||
packages = [
|
||||
goEnv
|
||||
gomod2nix
|
||||
update_gomod2nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue