URI: 
       Title: Make nix flakes commands using the same nixpkgs as NixOS does
       Author: Solène
       Date: 20 July 2022
       Tags: nixos linux nix
       Description: This explains how to make the command nix shell
       nixpkgs#foobar to reuse nixpkgs from your NixOS system to save time and
       bandwidth
       
       # Introduction
       
       This article will explain how to make the flakes enabled nix commands
       reusing the nixpkgs repository used as input to build your NixOS
       system.  This will regularly save you time and bandwidth.
       
       # Flakes and registries
       
       By default, nix commands using flakes such as nix shell or nix run are
       pulling a tarball of the development version of nixpkgs.  This is the
       default value set in the nix registry for nixpkgs.
       
       ```shell
       $ nix registry list | grep nixpkgs
       global flake:nixpkgs github:NixOS/nixpkgs/nixpkgs-unstable
       ```
       
       Because of this, when you run a command, you are likely to download a
       tarball of the nixpkgs repository including the latest commit every
       time you use flakes, this is particularly annoying because the tarball
       is currently around 30 MB.  There is a simple way to automatically set
       your registry to define the nixpkgs repository to the local archive
       used by your NixOS configuration.
       
       To your `flake.nix` file describing your system configuration, you
       should have something similar to this:
       
       ```nix
       inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
       
       [...]
       nixosConfiguration = {
         my-computer =lib.nixosSystem {
           specialArgs = { inherit inputs; };
           [...]
         };
       };
       ```
       
       Edit /etc/nixos/configuration.nix and make sure you have "inputs"
       listed in the first line, such as:
       
       ```nix
       { lib, config, pkgs, inputs, ... }:
       ```
dataswamp.org:70 /~solene/article-nixos-flakes-command-sync-with-system:54: port field too long