<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=Talk%3AFAQ%2FPinning_Nixpkgs</id>
	<title>Talk:FAQ/Pinning Nixpkgs - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=Talk%3AFAQ%2FPinning_Nixpkgs"/>
	<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=Talk:FAQ/Pinning_Nixpkgs&amp;action=history"/>
	<updated>2026-05-05T17:09:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.0</generator>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=Talk:FAQ/Pinning_Nixpkgs&amp;diff=11397&amp;oldid=prev</id>
		<title>Samueldr at 18:09, 3 April 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=Talk:FAQ/Pinning_Nixpkgs&amp;diff=11397&amp;oldid=prev"/>
		<updated>2024-04-03T18:09:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:09, 3 April 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot;&gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;let&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;let&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   # Look here for information about how to generate `nixpkgs-version.json`.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   # Look here for information about how to generate `nixpkgs-version.json`.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   #  → https://nixos.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wiki&lt;/del&gt;/wiki/FAQ/Pinning_Nixpkgs&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   #  → https://&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wiki.&lt;/ins&gt;nixos.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;org&lt;/ins&gt;/wiki/FAQ/Pinning_Nixpkgs&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   pinned = builtins.fromJSON (builtins.readFile ./nixpkgs.lock);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   pinned = builtins.fromJSON (builtins.readFile ./nixpkgs.lock);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   inherit (pinned) url rev;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   inherit (pinned) url rev;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-8349:rev-11397:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Samueldr</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=Talk:FAQ/Pinning_Nixpkgs&amp;diff=8349&amp;oldid=prev</id>
		<title>imported&gt;Expelledboy: Thinking to add a lock file example, but failing</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=Talk:FAQ/Pinning_Nixpkgs&amp;diff=8349&amp;oldid=prev"/>
		<updated>2020-11-05T20:04:34Z</updated>

		<summary type="html">&lt;p&gt;Thinking to add a lock file example, but failing&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;I would like to achieve something like a lock file, but optionally used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# This allows overriding pkgs by passing `--arg production ...`&lt;br /&gt;
{&lt;br /&gt;
  production ? false,&lt;br /&gt;
  nixpkgs ? import &amp;lt;nixpkgs&amp;gt; {}&lt;br /&gt;
}:&lt;br /&gt;
&lt;br /&gt;
let&lt;br /&gt;
  # Look here for information about how to generate `nixpkgs-version.json`.&lt;br /&gt;
  #  → https://nixos.wiki/wiki/FAQ/Pinning_Nixpkgs&lt;br /&gt;
  pinned = builtins.fromJSON (builtins.readFile ./nixpkgs.lock);&lt;br /&gt;
  inherit (pinned) url rev;&lt;br /&gt;
  ref = &amp;quot;nixos-unstable&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Load packages from the pinned version.&lt;br /&gt;
  pinnedNixpkgs = import (builtins.fetchGit {&lt;br /&gt;
    inherit ref url rev;&lt;br /&gt;
  }) {};&lt;br /&gt;
&lt;br /&gt;
  # Update ./nixpkgs.lock&lt;br /&gt;
  nixpkgsUpdate = nixpkgs.writeScriptBin &amp;quot;update-nixpkgs&amp;quot; &amp;#039;&amp;#039;&lt;br /&gt;
    #!/bin/sh&lt;br /&gt;
    ${nixpkgs.nix-prefetch-git}/bin/nix-prefetch-git ${url} refs/heads/${ref} &amp;gt; nixpkgs.lock&lt;br /&gt;
  &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
  pkgs = if production then pinnedNixpkgs else nixpkgs;&lt;br /&gt;
in&lt;br /&gt;
&lt;br /&gt;
with pkgs; mkShell {&lt;br /&gt;
  buildInputs = [&lt;br /&gt;
    nodejs&lt;br /&gt;
    nixpkgsUpdate&lt;br /&gt;
  ];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously this doens&amp;#039;t work, but its close... not sure what I missed&lt;/div&gt;</summary>
		<author><name>imported&gt;Expelledboy</name></author>
	</entry>
</feed>