set NIX_PATH, enables use of <nixpkgs>

This commit is contained in:
Kiara Grouwstra 2025-04-09 16:55:24 +02:00
parent c69f1f52e0
commit c27ec0a5b1
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU

View file

@ -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.