A Nix Flake that contains software packages for developing applications in the Go language.
Packages included:
cobra-cli
(default package)
Add this repo to your flake.nix
inputs like:
{
# ...
inputs.golang-developer.url = "github:thelonelyghost/golang-developer-nix";
# ...
outputs = { self, nixpkgs, flake-utils, golang-developer, ...}@attrs:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
godev = golang-developer.packages."${system}";
in {
devShell = pkgs.mkShell {
nativeBuildInputs = [
pkgs.bashInteractive
godev.cobra-cli
];
};
});
}
Updating: Anytime you want to update what workstation-deps offers, run nix flake lock --update-input golang-developer
and rebuild your Nix expression acccordingly.
If you're not yet using Nix Flakes, such as with home-manager
, here's how you can include it:
- Install
niv
and runniv init
- Run
niv add thelonelyghost/golang-developer-nix --name golang-developer
- Include the following in your code:
{ lib, config, ... }:
let
sources = import ./nix/sources.nix {};
pkgs = import sources.nixpkgs {};
godev = (import (pkgs.fetchFromGitHub { inherit (sources.golang-developer) owner repo rev sha256; })).outputs.packages."${builtins.currentSystem}";
in
{
home.packages = [
godev.cobra-cli
];
}
Updating: Anytime you want to update what golang-developer-nix offers, run niv update golang-developer
and rebuild your Nix expression acccordingly.