[{"data":1,"prerenderedAt":554},["ShallowReactive",2],{"navigation_docs_en":3,"\u002Fen\u002Fgetting-started\u002Ffirst-pin":85,"\u002Fen\u002Fgetting-started\u002Ffirst-pin-surround":549},[4,19,41,75],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":18},"Getting started","i-lucide-book-open","\u002Fen\u002Fgetting-started","en\u002F1.getting-started",[10,14],{"title":11,"path":12,"stem":13},"Installation","\u002Fen\u002Fgetting-started\u002Finstallation","en\u002F1.getting-started\u002F1.installation",{"title":15,"path":16,"stem":17},"Your first Pin","\u002Fen\u002Fgetting-started\u002Ffirst-pin","en\u002F1.getting-started\u002F2.first-pin",false,{"title":20,"icon":21,"path":22,"stem":23,"children":24,"page":18},"Guides","i-lucide-route","\u002Fen\u002Fguides","en\u002F2.guides",[25,29,33,37],{"title":26,"path":27,"stem":28},"Updating and selecting Pins","\u002Fen\u002Fguides\u002Fupdating","en\u002F2.guides\u002F1.updating",{"title":30,"path":31,"stem":32},"Combining Checkers and Fetchers","\u002Fen\u002Fguides\u002Fcombinations","en\u002F2.guides\u002F2.combinations",{"title":34,"path":35,"stem":36},"Multiple Sources and patches","\u002Fen\u002Fguides\u002Fmulti-source","en\u002F2.guides\u002F3.multi-source",{"title":38,"path":39,"stem":40},"Packages and dependency hashes","\u002Fen\u002Fguides\u002Fdependencies","en\u002F2.guides\u002F4.dependencies",{"title":42,"icon":43,"path":44,"stem":45,"children":46,"page":18},"Reference","i-lucide-code","\u002Fen\u002Freference","en\u002F3.reference",[47,51,55,59,63,67,71],{"title":48,"path":49,"stem":50},"CLI","\u002Fen\u002Freference\u002Fcli","en\u002F3.reference\u002F1.cli",{"title":52,"path":53,"stem":54},"Runtime configuration","\u002Fen\u002Freference\u002Fconfiguration","en\u002F3.reference\u002F2.configuration",{"title":56,"path":57,"stem":58},"Pin declarations","\u002Fen\u002Freference\u002Fpins","en\u002F3.reference\u002F3.pins",{"title":60,"path":61,"stem":62},"Checkers","\u002Fen\u002Freference\u002Fcheckers","en\u002F3.reference\u002F4.checkers",{"title":64,"path":65,"stem":66},"Fetchers","\u002Fen\u002Freference\u002Ffetchers","en\u002F3.reference\u002F5.fetchers",{"title":68,"path":69,"stem":70},"Package Builders","\u002Fen\u002Freference\u002Fbuilders","en\u002F3.reference\u002F6.builders",{"title":72,"path":73,"stem":74},"Reader and Pins File","\u002Fen\u002Freference\u002Freader","en\u002F3.reference\u002F7.reader",{"title":76,"icon":77,"path":78,"stem":79,"children":80,"page":18},"Troubleshooting","i-lucide-wrench","\u002Fen\u002Ftroubleshooting","en\u002F4.troubleshooting",[81],{"title":82,"path":83,"stem":84},"Common errors","\u002Fen\u002Ftroubleshooting\u002Fcommon-errors","en\u002F4.troubleshooting\u002F1.common-errors",{"id":86,"title":15,"body":87,"description":542,"extension":543,"links":544,"meta":545,"navigation":546,"path":16,"seo":547,"stem":17,"__hash__":548},"docs_en\u002Fen\u002F1.getting-started\u002F2.first-pin.md",{"type":88,"value":89,"toc":536},"minimark",[90,108,113,120,143,150,207,220,224,239,257,278,282,296,398,401,410,420,497,507,511,520,532],[91,92,93,94,98,99,103,104,107],"p",{},"This tutorial uses ",[95,96,97],"code",{},"NixOS\u002Fpatchelf"," to demonstrate the complete workflow. GitHub is the starting example; nix-pins also supports ",[100,101,102],"a",{"href":61},"other version checkers"," and ",[100,105,106],{"href":65},"fetchers",".",[109,110,112],"h2",{"id":111},"create-a-declaration","Create a declaration",[91,114,115,116,119],{},"After ",[100,117,118],{"href":12},"installation",", create a working directory at the root of your cloned nix-pins repository:",[121,122,127],"pre",{"className":123,"code":124,"language":125,"meta":126,"style":126},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","mkdir -p demo\ncd demo\n","sh","",[95,128,129,137],{"__ignoreMap":126},[130,131,134],"span",{"class":132,"line":133},"line",1,[130,135,136],{},"mkdir -p demo\n",[130,138,140],{"class":132,"line":139},2,[130,141,142],{},"cd demo\n",[91,144,145,146,149],{},"Create ",[95,147,148],{},"pins-config.nix",":",[121,151,155],{"className":152,"code":153,"language":154,"meta":126,"style":126},"language-nix shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{ pin }: {\n  patchelf = pin.github \"NixOS\u002Fpatchelf\";\n}\n","nix",[95,156,157,173,201],{"__ignoreMap":126},[130,158,159,163,167,170],{"class":132,"line":133},[130,160,162],{"class":161},"sMK4o","{",[130,164,166],{"class":165},"sHdIc"," pin",[130,168,169],{"class":161}," }:",[130,171,172],{"class":161}," {\n",[130,174,175,179,182,184,186,189,192,195,198],{"class":132,"line":139},[130,176,178],{"class":177},"spNyl","  patchelf",[130,180,181],{"class":161}," =",[130,183,166],{"class":165},[130,185,107],{"class":161},[130,187,188],{"class":165},"github",[130,190,191],{"class":161}," \"",[130,193,97],{"class":194},"sfazB",[130,196,197],{"class":161},"\"",[130,199,200],{"class":161},";\n",[130,202,204],{"class":132,"line":203},3,[130,205,206],{"class":161},"}\n",[91,208,209,212,213,216,217,107],{},[95,210,211],{},"patchelf"," is the local Pin name. ",[95,214,215],{},"pin.github"," reads the latest GitHub release, uses its original tag as the Version, and fetches source code at that tag. This shorthand creates a Source named ",[95,218,219],{},"default",[109,221,223],{"id":222},"update-and-inspect","Update and inspect",[121,225,227],{"className":123,"code":226,"language":125,"meta":126,"style":126},"nix-pins update\nnix-pins status\n",[95,228,229,234],{"__ignoreMap":126},[130,230,231],{"class":132,"line":133},[130,232,233],{},"nix-pins update\n",[130,235,236],{"class":132,"line":139},[130,237,238],{},"nix-pins status\n",[91,240,241,242,244,245,248,249,252,253,256],{},"By default, the CLI reads ",[95,243,148],{}," from the current directory and writes the result to ",[95,246,247],{},"pins.json",". ",[95,250,251],{},"update"," checks versions over the network and computes source hashes. ",[95,254,255],{},"status"," reports existing locked results without checking for new upstream versions.",[91,258,259,260,262,263,103,266,269,270,273,274,277],{},"The main paths in ",[95,261,247],{}," are ",[95,264,265],{},"pins.patchelf.version",[95,267,268],{},"pins.patchelf.sources.default",". A Source contains Fetcher arguments, the source ",[95,271,272],{},"hash",", and optional ",[95,275,276],{},"derived"," hashes. Commit the configuration and Pins File together so downstream consumers use the same locked results.",[109,279,281],{"id":280},"use-the-result-in-nix","Use the result in Nix",[91,283,145,284,287,288,291,292,295],{},[95,285,286],{},"source.nix"," in ",[95,289,290],{},"demo\u002F",". The path ",[95,293,294],{},"..\u002Fnix\u002Fpins.nix"," points to the Reader in the cloned tool repository:",[121,297,299],{"className":152,"code":298,"language":154,"meta":126,"style":126},"let\n  pkgs = import \u003Cnixpkgs> {};\n  pins = import ..\u002Fnix\u002Fpins.nix {\n    inherit pkgs;\n    file = .\u002Fpins.json;\n  };\nin\npins.patchelf.sources.default.src\n",[95,300,301,307,324,338,349,362,368,374],{"__ignoreMap":126},[130,302,303],{"class":132,"line":133},[130,304,306],{"class":305},"sbssI","let\n",[130,308,309,312,314,318,321],{"class":132,"line":139},[130,310,311],{"class":177},"  pkgs",[130,313,181],{"class":161},[130,315,317],{"class":316},"s2Zo4"," import",[130,319,320],{"class":194}," \u003Cnixpkgs>",[130,322,323],{"class":161}," {};\n",[130,325,326,329,331,333,336],{"class":132,"line":203},[130,327,328],{"class":177},"  pins",[130,330,181],{"class":161},[130,332,317],{"class":316},[130,334,335],{"class":194}," ..\u002Fnix\u002Fpins.nix",[130,337,172],{"class":161},[130,339,341,344,347],{"class":132,"line":340},4,[130,342,343],{"class":305},"    inherit",[130,345,346],{"class":177}," pkgs",[130,348,200],{"class":161},[130,350,352,355,357,360],{"class":132,"line":351},5,[130,353,354],{"class":177},"    file",[130,356,181],{"class":161},[130,358,359],{"class":194}," .\u002Fpins.json",[130,361,200],{"class":161},[130,363,365],{"class":132,"line":364},6,[130,366,367],{"class":161},"  };\n",[130,369,371],{"class":132,"line":370},7,[130,372,373],{"class":305},"in\n",[130,375,377,380,382,384,386,389,391,393,395],{"class":132,"line":376},8,[130,378,379],{"class":165},"pins",[130,381,107],{"class":161},[130,383,211],{"class":165},[130,385,107],{"class":161},[130,387,388],{"class":165},"sources",[130,390,107],{"class":161},[130,392,219],{"class":165},[130,394,107],{"class":161},[130,396,397],{"class":165},"src\n",[91,399,400],{},"Build the locked source:",[121,402,404],{"className":123,"code":403,"language":125,"meta":126,"style":126},"nix build --impure --file source.nix --no-link\n",[95,405,406],{"__ignoreMap":126},[130,407,408],{"class":132,"line":133},[130,409,403],{},[91,411,412,413,416,417,149],{},"A downstream derivation can use this ",[95,414,415],{},"src"," as an input, for example in ",[95,418,419],{},"pkgs.stdenv.mkDerivation",[121,421,423],{"className":152,"code":422,"language":154,"meta":126,"style":126},"{\n  pname = \"patchelf\";\n  version = pins.patchelf.version;\n  src = pins.patchelf.sources.default.src;\n}\n",[95,424,425,430,445,466,493],{"__ignoreMap":126},[130,426,427],{"class":132,"line":133},[130,428,429],{"class":161},"{\n",[130,431,432,435,437,439,441,443],{"class":132,"line":139},[130,433,434],{"class":177},"  pname",[130,436,181],{"class":161},[130,438,191],{"class":161},[130,440,211],{"class":194},[130,442,197],{"class":161},[130,444,200],{"class":161},[130,446,447,450,452,455,457,459,461,464],{"class":132,"line":203},[130,448,449],{"class":177},"  version",[130,451,181],{"class":161},[130,453,454],{"class":165}," pins",[130,456,107],{"class":161},[130,458,211],{"class":165},[130,460,107],{"class":161},[130,462,463],{"class":165},"version",[130,465,200],{"class":161},[130,467,468,471,473,475,477,479,481,483,485,487,489,491],{"class":132,"line":340},[130,469,470],{"class":177},"  src",[130,472,181],{"class":161},[130,474,454],{"class":165},[130,476,107],{"class":161},[130,478,211],{"class":165},[130,480,107],{"class":161},[130,482,388],{"class":165},[130,484,107],{"class":161},[130,486,219],{"class":165},[130,488,107],{"class":161},[130,490,415],{"class":165},[130,492,200],{"class":161},[130,494,495],{"class":132,"line":351},[130,496,206],{"class":161},[91,498,499,500,503,504,107],{},"This snippet only shows the input attributes. The downstream project defines the full application build. When you add Packages or patches, the Reader also needs the ",[95,501,502],{},"config"," argument; see the ",[100,505,506],{"href":73},"Reader reference",[109,508,510],{"id":509},"update-next-time","Update next time",[121,512,514],{"className":123,"code":513,"language":125,"meta":126,"style":126},"nix-pins update patchelf\n",[95,515,516],{"__ignoreMap":126},[130,517,518],{"class":132,"line":133},[130,519,513],{},[91,521,522,523,525,526,529,530,107],{},"Review the changes to ",[95,524,247],{},", then rebuild the downstream package. Other upstream sources do not need to use GitHub: combine a Checker and Fetcher independently with ",[95,527,528],{},"pin.mk",", as shown in ",[100,531,30],{"href":31},[533,534,535],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}",{"title":126,"searchDepth":139,"depth":139,"links":537},[538,539,540,541],{"id":111,"depth":139,"text":112},{"id":222,"depth":139,"text":223},{"id":280,"depth":139,"text":281},{"id":509,"depth":139,"text":510},"Check a version, lock source code, and consume it in Nix with a GitHub example.","md",null,{},true,{"title":15,"description":542},"EgxiShelm4pEX1TKpz8pJEy45G4e93Rf98KN_cfUnTQ",[550,552],{"title":11,"path":12,"stem":13,"description":551,"children":-1},"Set up Nix and install nix-pins with a Flake or Cargo.",{"title":26,"path":27,"stem":28,"description":553,"children":-1},"Full updates, selective updates, failure preservation, and cancellation.",1791031183774]