forked from fediversity/fediversity
Compare commits
No commits in common. "5ce098764015d2190650fa51ca33f525159cde52" and "4f93303ef8d0a68d61647a5d6924ccfa4bbf538c" have entirely different histories.
5ce0987640
...
4f93303ef8
2 changed files with 12 additions and 6 deletions
|
|
@ -1,7 +1,8 @@
|
|||
{ lib, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkDefault;
|
||||
nixPath = "/run/current-system/nixpkgs";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
|
@ -15,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.
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ variable "initialUser" {
|
|||
locals {
|
||||
system = "x86_64-linux"
|
||||
pins = jsondecode(file("${path.module}/.npins.json"))
|
||||
nix_path = "${join(":", [for name, path in local.pins : "${name}=${path}"])}:flake=${local.pins["nixpkgs"]}:flake"
|
||||
peripheral_configs = {
|
||||
garage = "test01"
|
||||
}
|
||||
|
|
@ -106,8 +105,7 @@ resource "terraform_data" "nixos" {
|
|||
provisioner "local-exec" {
|
||||
working_dir = path.root
|
||||
environment = {
|
||||
# nix path used on deploy
|
||||
NIX_PATH = local.nix_path
|
||||
NIX_PATH = join(":", [for name, path in local.pins : "${name}=${path}"]),
|
||||
}
|
||||
# TODO: refactor back to command="ignoreme" interpreter=concat([]) to protect sensitive data from error logs?
|
||||
# TODO: build on target?
|
||||
|
|
@ -134,8 +132,6 @@ resource "terraform_data" "nixos" {
|
|||
# FIXME: get VM details from TF
|
||||
${path.root}/../infra/test-machines/${each.value.hostname}
|
||||
];
|
||||
# nix path for debugging
|
||||
nix.nixPath = [ "${local.nix_path}" ];
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue