Skip to content

Commit

Permalink
Add default package to flake
Browse files Browse the repository at this point in the history
So we can pull the package in more easily from other projects since
it's not in nixpkgs.
  • Loading branch information
svrana committed Aug 29, 2023
1 parent 3abcd80 commit d97d5ab
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 16 deletions.
46 changes: 35 additions & 11 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 26 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
{
description = "geniveev dev shell";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
gomod2nix = {
url = "github:tweag/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "utils";
};
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
outputs = { self, nixpkgs, utils, gomod2nix }:
utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs {
inherit system;
overlays = [
gomod2nix.overlays.default
];
};
in {
packages.default = pkgs.buildGoApplication {
pname = "geniveev";
version = "0.1.1";
pwd = ./.;
src = ./.;
modules = ./gomod2nix.toml;
};

devShells.default = pkgs.mkShell {
packages = [
pkgs.bashInteractive
pkgs.go_1_20
pkgs.goreleaser
gomod2nix.packages.${system}.default
];
};
});
Expand Down
21 changes: 21 additions & 0 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
schema = 3

[mod]
[mod."github.com/inconshreveable/mousetrap"]
version = "v1.1.0"
hash = "sha256-XWlYH0c8IcxAwQTnIi6WYqq44nOKUylSWxWO/vi+8pE="
[mod."github.com/pelletier/go-toml/v2"]
version = "v2.0.8"
hash = "sha256-wWxswr/lTq+McYbScmJM1ECKQ6eNJ5m44SM7TmrHThM="
[mod."github.com/spf13/afero"]
version = "v1.9.5"
hash = "sha256-+XECQxkx0P+ZaQDm4dQ6ItMtHMj+2uNemEC18dsdor0="
[mod."github.com/spf13/cobra"]
version = "v1.7.0"
hash = "sha256-bom9Zpnz8XPwx9IVF+GAodd3NVQ1dM1Uwxn8sy4Gmzs="
[mod."github.com/spf13/pflag"]
version = "v1.0.5"
hash = "sha256-w9LLYzxxP74WHT4ouBspH/iQZXjuAh2WQCHsuvyEjAw="
[mod."golang.org/x/text"]
version = "v0.10.0"
hash = "sha256-pt4Ce9+Bvf7f0Vo8oUZ71F1aSCcCxsx6Lg0cvanq7x8="

0 comments on commit d97d5ab

Please sign in to comment.