title: How to modify a nixos package configuration
body: <p>I am building a nixos system in a network that is only able to access the outside world through a web proxy. The <a href="https://github.com/NixOS/nixpkgs/blob/e91d788b7cfba93b67a516eff22379abdc08eb41/pkgs/tools/misc/grub/2.0x.nix#L45" rel="nofollow">nixos grub configuration</a> tries to access the grub repository through a <code>git://</code> URL which obviously does not work at my network.</p>
  
  <p>Therefore I want to replace the <code>git://</code> url by the corresponding <code>http://</code> URL. (savannah supports <a href="http://savannah.gnu.org/maintenance/UsingGit/" rel="nofollow">both</a>.) The corresponding <a href="https://nixos.org/wiki/Nix_Modifying_Packages#Creating_a_config.nix_File" rel="nofollow">nix documentation</a> shows how to do it.</p>
  
  <p>I created a file <code>~/.nixpkgs/config.nix</code> containing the following content:</p>
  
  <pre><code>{
    packageOverrides = pkgs: rec {
      grub = pkgs.grub.override {
        src.url="http://git.savannah.gnu.org/grub.git";
      };
    };
  }
  </code></pre>
  
  <p>Unfortunately <code>nixos-rebuild switch</code> still tries to use the old URL.
  What did I do wrong?</p>
  
  <hr>
  
  <p>I also read the <a href="http://nixos.org/nixos/manual/sec-package-management.html#sec-customising-packages" rel="nofollow">customising packages</a> of the documentation.
  From that it seems like I could add the following to <code>/etc/nixos/configuration.nix</code>:</p>
  
  <pre><code>nixpkgs.config.packageOverrides = pkgs: {
      grub = pkgs.grub.overrideDerivation (pkgs.grub ( attrs: {
          url = "http://git.savannah.gnu.org/grub.git";
          rev = "2ae9457e6eb4c352051fb32bc6fc931a22528ab2";
          sha256 = "1ik60qgkymg0xdns5az1hbxasspah2vzxg334rpbk2yy3h3nx5ln";
      }));
  };
  </code></pre>
  
  <p>However <code>nixos-rebuild switchnixos-rebuild switch</code> still uses the old url. I probably need to add fetchurl, but I have no idea how to make this available at this place.</p>