From c27ec0a5b10a9e9af2b25e2145ed6968f44d1366 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Wed, 9 Apr 2025 16:55:24 +0200 Subject: [PATCH] set NIX_PATH, enables use of --- infra/common/nixos/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/infra/common/nixos/default.nix b/infra/common/nixos/default.nix index b870ab03..c789a04e 100644 --- a/infra/common/nixos/default.nix +++ b/infra/common/nixos/default.nix @@ -1,8 +1,8 @@ -{ lib, ... }: +{ lib, pkgs, ... }: let inherit (lib) mkDefault; - + nixPath = "/run/current-system/nixpkgs"; in { imports = [ @@ -16,6 +16,15 @@ in system.stateVersion = "24.05"; # do not change nixpkgs.hostPlatform = mkDefault "x86_64-linux"; + # use flake's nixpkgs over channels + nix.nixPath = [ "nixpkgs=${nixPath}" ]; + system.extraSystemBuilderCmds = '' + ln -sv ${pkgs.path} $out/nixpkgs + ''; + systemd.tmpfiles.rules = [ + "L+ ${nixPath} - - - - ${pkgs.path}" + ]; + ## This is just nice to have, but it is also particularly important for the ## Forgejo CI runners because the Nix configuration in the actions is directly ## taken from here.