anchor.diff:  
   with lib;
   
  +let
  +  cfg = config.system;
  +
  +  releaseFile = "${toString pkgs.path}/.version";
  +  suffixFile = "${toString pkgs.path}/.version-suffix";
  +  revisionFile = "${toString pkgs.path}/.git-revision";
  +in
  +
   {
   
  -  options = {
  +  options.system = {
   
  -    system.stateVersion = mkOption {
  +    stateVersion = mkOption {
         type = types.str;
  -      default = config.system.nixosRelease;
  +      default = cfg.nixosRelease;
         description = ''
           Every once in a while, a new NixOS release may change
           configuration defaults in a way incompatible with stateful
  
positive.code: 
    config = {
  
      system.nixosVersion = mkDefault (config.system.nixosRelease + config.system.nixosVersionSuffix);
  
      system.nixosVersionSuffix =
        let suffixFile = "${toString pkgs.path}/.version-suffix"; in
        mkDefault (if pathExists suffixFile then readFile suffixFile else "pre-git");
  
      system.nixosRevision =
        let fn = "${toString pkgs.path}/.git-revision"; in
        mkDefault (if pathExists fn then readFile fn else "master");
  
      # Note: code names must only increase in alphabetical order.
      system.nixosCodeName = "Emu";
  
      # Generate /etc/os-release.  See
      # http://0pointer.de/public/systemd-man/os-release.html for the
  
negative.code:       '';
      };
  
      nixosVersion = mkOption {
        internal = true;
        type = types.str;
        description = "NixOS version.";
      };
  
      nixosRelease = mkOption {
        readOnly = true;
        type = types.str;
        default = readFile releaseFile;
        description = "NixOS release.";
      };
  
      nixosVersionSuffix = mkOption {
        internal = true;
        type = types.str;
        default = if pathExists suffixFile then readFile suffixFile else "pre-git";
        description = "NixOS version suffix.";
      };
  
      nixosRevision = mkOption {
        internal = true;
        type = types.str;
        default = if pathExists revisionFile then readFile revisionFile else "master";
        description = "NixOS Git revision hash.";
      };
  
      nixosCodeName = mkOption {
        readOnly = true;
        type = types.str;
        description = "NixOS release code name.";
      };
  
      defaultChannel = mkOption {
        internal = true;
        type = types.str;
        default = https://nixos.org/channels/nixos-unstable;
  