From 8b1c513e7fd213f633749b280e94a01742bb3aa8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 6 Jan 2024 19:11:19 +0800 Subject: [PATCH] apps/run-workflow-with-vm: update host config --- apps/run-workflow-with-vm/configuration.nix | 42 +++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/apps/run-workflow-with-vm/configuration.nix b/apps/run-workflow-with-vm/configuration.nix index d705645c..ab5e6410 100644 --- a/apps/run-workflow-with-vm/configuration.nix +++ b/apps/run-workflow-with-vm/configuration.nix @@ -1,31 +1,25 @@ +# A very basic NixOS VM configuration intended for testing out the given +# workflow module. It's a good thing the baseline for the configuration is not +# tedious to set up for simpler configs like this. { workflow }: let pkgs = import { }; config' = import { inherit pkgs; }; - lib = pkgs.lib.extend (self: super: - let - publicLib = import { lib = super; }; - in - { - inherit (publicLib) countAttrs getSecrets attachSopsPathPrefix; - - # Until I figure out how to properly add them only for their respective - # environment, this is the working solution for now. Not really perfect - # since we use one nixpkgs instance for each configuration (home-manager or - # otherwise). - private = publicLib - // import { lib = self; } - // import { lib = self; }; - }); + lib = pkgs.lib.extend (import ); modules = import { inherit lib; isInternal = true; }; hmModules = import { inherit lib; isInternal = true; }; + extraArgs = { + nix-colors = import { }; + }; in import { inherit lib; modules = modules ++ [ + + ({ config, lib, pkgs, ... }: { @@ -48,11 +42,18 @@ import { ]; config = { - home-manager.sharedModules = hmModules; + home-manager.sharedModules = hmModules ++ [ + + ({ config, lib, ... }: { + _module.args = extraArgs; - _module.args = { - nix-colors = import { }; - }; + nixpkgs.overlays = [ + config'.overlays.default + ]; + }) + ]; + + _module.args = extraArgs; virtualisation.qemu.options = [ "-vga virtio" @@ -66,6 +67,9 @@ import { ]; system.stateVersion = "23.11"; + + home-manager.useUserPackages = lib.mkDefault true; + home-manager.useGlobalPkgs = lib.mkDefault true; }; }) ];