about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-04-02 18:01:45 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-04-02 19:38:00 +0200
commit74e7ef35fee77139be31a3891033ff61496635f8 (patch)
tree6d27bcb517f7766e03d096d9c173aa2ed1466274 /flake.nix
parent9737f249195db232178c3f7034e1c23220f4fcda (diff)
downloadnixlib-74e7ef35fee77139be31a3891033ff61496635f8.tar
nixlib-74e7ef35fee77139be31a3891033ff61496635f8.tar.gz
nixlib-74e7ef35fee77139be31a3891033ff61496635f8.tar.bz2
nixlib-74e7ef35fee77139be31a3891033ff61496635f8.tar.lz
nixlib-74e7ef35fee77139be31a3891033ff61496635f8.tar.xz
nixlib-74e7ef35fee77139be31a3891033ff61496635f8.tar.zst
nixlib-74e7ef35fee77139be31a3891033ff61496635f8.zip
nix-daemon.nix: Add option nix.registry
This allows you to specify the system-wide flake registry. One use is
to pin 'nixpkgs' to the Nixpkgs version used to build the system:

  nix.registry.nixpkgs.flake = nixpkgs;

where 'nixpkgs' is a flake input. This ensures that commands like

  $ nix run nixpkgs#hello

pull in a minimum of additional store paths.

You can also use this to redirect flakes, e.g.

  nix.registry.nixpkgs.to = {
    type = "github";
    owner = "my-org";
    repo = "my-nixpkgs";
  };
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index a6828c98fb51..f16c5ea697ac 100644
--- a/flake.nix
+++ b/flake.nix
@@ -25,8 +25,9 @@
           import ./nixos/lib/eval-config.nix (args // {
             modules = modules ++
               [ { system.nixos.versionSuffix =
-                    ".${lib.substring 0 8 self.lastModified}.${self.shortRev or "dirty"}";
+                    ".${lib.substring 0 8 (self.lastModifiedDate or self.lastModified)}.${self.shortRev or "dirty"}";
                   system.nixos.revision = lib.mkIf (self ? rev) self.rev;
+                  nix.registry.nixpkgs.flake = lib.mkDefault self;
                 }
               ];
           });