Add menu so we remember the gomod2nix commands

This commit is contained in:
Jim Clark
2023-04-25 17:06:42 -07:00
committed by James Carnegie
parent 5ef7e9ef1c
commit 3b689d3762
2 changed files with 39 additions and 3 deletions

24
flake.lock generated
View File

@@ -1,5 +1,28 @@
{
"nodes": {
"devshell": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1678957337,
"narHash": "sha256-Gw4nVbuKRdTwPngeOZQOzH/IFowmz4LryMPDiJN/ah4=",
"owner": "numtide",
"repo": "devshell",
"rev": "3e0e60ab37cd0bf7ab59888f5c32499d851edb47",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@@ -71,6 +94,7 @@
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils",
"gomod2nix": "gomod2nix",
"nixpkgs": "nixpkgs_2"

View File

@@ -5,21 +5,33 @@
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
flake-utils.url = "github:numtide/flake-utils";
gomod2nix.url = "github:nix-community/gomod2nix";
devshell = {
url = "github:numtide/devshell";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, gomod2nix }:
outputs = { self, nixpkgs, flake-utils, gomod2nix, devshell }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs
{
inherit system;
overlays = [ gomod2nix.overlays.default ];
overlays = [ gomod2nix.overlays.default devshell.overlays.default ];
};
in
{
devShells.default = pkgs.mkShell {
devShells.default = pkgs.devshell.mkShell {
packages = with pkgs; [ go gotools golangci-lint gopls gopkgs go-outline gomod2nix.packages.${system}.default ];
commands = [
{
name = "update-gomod2nix";
help = "update gomod2nix.toml";
command = "gomod2nix";
}
];
};
packages = rec {
default = pkgs.buildGoApplication {