mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-09 12:09:08 +00:00
commit
c88d540afd
4 changed files with 32 additions and 21 deletions
12
flake.lock
12
flake.lock
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1648069223,
|
||||
"narHash": "sha256-BXzQV8p/RR440EB9qY0ULYfTH0zSW1stjUCYeP4SF+E=",
|
||||
"lastModified": 1653407748,
|
||||
"narHash": "sha256-g9puJaILRTb9ttlLQ7IehpV7Wcy0n+vs8LOFu6ylQcM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1d08ea2bd83abef174fb43cbfb8a856b8ef2ce26",
|
||||
"rev": "5ce6597eca7d7b518c03ecda57d45f9404b5e060",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -24,11 +24,11 @@
|
|||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1648297722,
|
||||
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
|
||||
"lastModified": 1652776076,
|
||||
"narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
|
||||
"rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
15
flake.nix
15
flake.nix
|
@ -7,10 +7,7 @@
|
|||
|
||||
outputs = { self, nixpkgs, utils }:
|
||||
{
|
||||
overlay = final: prev: {
|
||||
buildGoApplication = final.callPackage ./builder { };
|
||||
gomod2nix = final.callPackage ./default.nix { };
|
||||
};
|
||||
overlays.default = import ./overlay.nix;
|
||||
} //
|
||||
(utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
|
@ -18,17 +15,13 @@
|
|||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
self.overlay
|
||||
self.overlays.default
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
defaultPackage = pkgs.callPackage ./default.nix { };
|
||||
devShell = with pkgs; mkShell {
|
||||
buildInputs = [
|
||||
gomod2nix
|
||||
];
|
||||
};
|
||||
packages.default = pkgs.callPackage ./default.nix { };
|
||||
devShells.default = import ./shell.nix { inherit pkgs; };
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
self: super: {
|
||||
buildGoApplication = self.callPackage ./builder { };
|
||||
gomod2nix = self.callPackage ./default.nix { };
|
||||
final: prev: {
|
||||
buildGoApplication = final.callPackage ./builder { };
|
||||
gomod2nix = final.callPackage ./default.nix { };
|
||||
}
|
||||
|
|
20
shell.nix
20
shell.nix
|
@ -1,4 +1,21 @@
|
|||
{ pkgs ? import <nixpkgs> { } }:
|
||||
{ pkgs ? (
|
||||
let
|
||||
inherit (builtins) fromJSON readFile;
|
||||
flakeLock = fromJSON (readFile ./flake.lock);
|
||||
locked = flakeLock.nodes.nixpkgs.locked;
|
||||
nixpkgs = assert locked.type == "github"; builtins.fetchTarball {
|
||||
url = "https://github.com/${locked.owner}/${locked.repo}/archive/${locked.rev}.tar.gz";
|
||||
sha256 = locked.narHash;
|
||||
};
|
||||
in
|
||||
import nixpkgs {
|
||||
overlays = [
|
||||
(import ./overlay.nix)
|
||||
];
|
||||
}
|
||||
)
|
||||
}:
|
||||
|
||||
let
|
||||
pythonEnv = pkgs.python3.withPackages (_: [ ]);
|
||||
|
||||
|
@ -8,6 +25,7 @@ pkgs.mkShell {
|
|||
pkgs.nix-prefetch-git
|
||||
pkgs.nixpkgs-fmt
|
||||
pkgs.go
|
||||
pkgs.gomod2nix
|
||||
pythonEnv
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue