Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: nix #510

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

build: nix #510

wants to merge 5 commits into from

Conversation

dlvhdr
Copy link
Owner

@dlvhdr dlvhdr commented Jan 18, 2025

Summary

How did you test this change?

Images/Videos

@dlvhdr dlvhdr force-pushed the dlvhdr/nix branch 2 times, most recently from bcff5db to a11d256 Compare January 24, 2025 17:00
@bryceberger
Copy link

I have some comments / suggestions, in 8f6694d. (Feel free to just add commit to this branch)

  • The devshell and build configuration is small enough that it should probably just be inlined into the flake
    • Using ./. for the source, when in a git repository, already filters out all the .gitignored files. Don't need the big intersection.
  • Added language servers (gopls + golangci-lint-langserver) to the devshell
  • Used flake-utils to generate for both mac and linux (both x86 and aarch64)
  • Setting outputs.overlays.default allows the following use:
{
  inputs.gh-dash.url = "github:bryceberger/gh-dash/8f6694d17c53b36ed079c0c80f82f32349f048f3";
  outputs = {
    nixpkgs,
    gh-dash,
    ...
  }: let
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      inherit system;
      overlays = [gh-dash.overlays.default];
    };
  in {
    devShells.${system}.default = pkgs.mkShell {
      # the following gets gh-dash version 4.10, instead of the 4.8.1 currently in nixpkgs
      packages = [pkgs.gh-dash];
    };
  };
}

@dlvhdr
Copy link
Owner Author

dlvhdr commented Jan 25, 2025

Thanks for the tips @bryceberger, I'm still learning nix so it's pretty helpful!

In addition, I'm actually thinking of using https://goreleaser.com/customization/nix/?h=nix to publish it to nixpkgs.

@dlvhdr
Copy link
Owner Author

dlvhdr commented Jan 25, 2025

I've also pushed your commit here

@bryceberger
Copy link

nixpkgs is different from nur --- the former is the official distribution of nixos, the latter is a collection of user packages. Similar to the Arch repos / AUR, if you're familiar with that.

gh-dash is already packaged in nixpkgs: https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/gh/gh-dash/package.nix

I'm not entirely familiar with either the NUR or GoReleaser, so can't help you there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants