From 2c6d2f275f5536a1c865d45640f3ef5a06452929 Mon Sep 17 00:00:00 2001
From: Gregor Kleen <gkleen@yggdrasil.li>
Date: Fri, 8 Apr 2022 15:39:59 +0200
Subject: ...

---
 system-profiles/core.nix | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

(limited to 'system-profiles')

diff --git a/system-profiles/core.nix b/system-profiles/core.nix
index 6a38d9ce..87dc0e92 100644
--- a/system-profiles/core.nix
+++ b/system-profiles/core.nix
@@ -52,21 +52,8 @@ in {
         experimental-features = nix-command flakes
       '';
       nixPath = [
-        "nixpkgs=${flakeInputs.nixpkgs.outPath}"
-        "nixpkgs-overlays=${pkgs.writeText "overlays.nix" ''
-          with builtins;
-
-          attrValues (import
-            (
-              let lock = fromJSON (readFile ${toString ../flake.lock}); in
-              fetchTarball {
-                url = "https://github.com/edolstra/flake-compat/archive/''${lock.nodes.flake-compat.locked.rev}.tar.gz";
-                sha256 = lock.nodes.flake-compat.locked.narHash;
-              }
-            )
-            { src = ${toString ../.}; }
-          ).defaultNix.overlays
-        ''}"
+        "nixpkgs=/run/nixpkgs"
+        "nixpkgs-overlays=/run/nixpkgs-overlays.nix"
       ];
       registry =
         let override = { self = "nixos"; };
@@ -75,6 +62,24 @@ in {
           { flake = inpFlake; } ) flakeInputs;
     };
 
+    systemd.tmpfiles.rules = [
+      "L+ /run/nixpkgs - - - - ${flakeInputs.nixpkgs.outPath}"
+      "L+ /run/nixpkgs-overlays.nix - - - - ${pkgs.writeText "overlays.nix" ''
+        with builtins;
+
+        attrValues (import
+          (
+            let lock = fromJSON (readFile ${toString ../flake.lock}); in
+            fetchTarball {
+              url = "https://github.com/edolstra/flake-compat/archive/''${lock.nodes.flake-compat.locked.rev}.tar.gz";
+              sha256 = lock.nodes.flake-compat.locked.narHash;
+            }
+          )
+          { src = ${toString ../.}; }
+        ).defaultNix.overlays
+      ''}"
+    ];
+
     users.mutableUsers = false;
 
     # documentation.nixos.includeAllModules = true; # incompatible with home-manager (build fails)
-- 
cgit v1.2.3