Skip to content

Instantly share code, notes, and snippets.

@matthiasbeyer
Created November 9, 2021 20:00
Show Gist options
  • Select an option

  • Save matthiasbeyer/a3879a43e56284595e27c05f92cef24f to your computer and use it in GitHub Desktop.

Select an option

Save matthiasbeyer/a3879a43e56284595e27c05f92cef24f to your computer and use it in GitHub Desktop.

Revisions

  1. matthiasbeyer created this gist Nov 9, 2021.
    19 changes: 19 additions & 0 deletions mypackage.nix
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    { pkgs ? (import <nixpkgs> {}) }:

    rec {
    # import nixpkgs from a specific commit hash
    oldNixpkgs = pkgs.fetchFromGitHub {
    owner = "nixos";
    repo = "nixpkgs";

    # here goes the commit hash
    rev = "c2268175651c4aa1da23c1b84ecebc0a0df56633";
    sha256 = "0asjhmzwgipbmv3l58l4g4miw6mhywpzzviirys1r33ykbacvjkf";
    };

    # import the "old" packages
    oldPkgs = import "${oldNixpkgs}" {};

    # use the oldPkgs and use the "ripgrep" package
    myRipgrep = oldPkgs.ripgrep;
    }