mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
apps/run-workflow-with-vm: update host config
This commit is contained in:
parent
1957df91ea
commit
8b1c513e7f
@ -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 <nixpkgs> { };
|
||||
config' = import <config> { inherit pkgs; };
|
||||
lib = pkgs.lib.extend (self: super:
|
||||
let
|
||||
publicLib = import <config/lib> { 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 <config/lib/private.nix> { lib = self; }
|
||||
// import <config/lib/home-manager.nix> { lib = self; };
|
||||
});
|
||||
lib = pkgs.lib.extend (import <config/lib/extras/extend-lib.nix>);
|
||||
|
||||
modules = import <config/modules/nixos> { inherit lib; isInternal = true; };
|
||||
hmModules = import <config/modules/home-manager> { inherit lib; isInternal = true; };
|
||||
extraArgs = {
|
||||
nix-colors = import <nix-colors> { };
|
||||
};
|
||||
in
|
||||
import <nixpkgs/nixos/lib/eval-config.nix> {
|
||||
inherit lib;
|
||||
modules = modules ++ [
|
||||
<home-manager/nixos>
|
||||
<disko/module.nix>
|
||||
<sops-nix/modules/sops>
|
||||
<nixos-generators/formats/vm.nix>
|
||||
<nixos-generators/format-module.nix>
|
||||
({ config, lib, pkgs, ... }: {
|
||||
@ -48,11 +42,18 @@ import <nixpkgs/nixos/lib/eval-config.nix> {
|
||||
];
|
||||
|
||||
config = {
|
||||
home-manager.sharedModules = hmModules;
|
||||
home-manager.sharedModules = hmModules ++ [
|
||||
<sops-nix/modules/home-manager/sops.nix>
|
||||
({ config, lib, ... }: {
|
||||
_module.args = extraArgs;
|
||||
|
||||
_module.args = {
|
||||
nix-colors = import <nix-colors> { };
|
||||
};
|
||||
nixpkgs.overlays = [
|
||||
config'.overlays.default
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
_module.args = extraArgs;
|
||||
|
||||
virtualisation.qemu.options = [
|
||||
"-vga virtio"
|
||||
@ -66,6 +67,9 @@ import <nixpkgs/nixos/lib/eval-config.nix> {
|
||||
];
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
|
||||
home-manager.useUserPackages = lib.mkDefault true;
|
||||
home-manager.useGlobalPkgs = lib.mkDefault true;
|
||||
};
|
||||
})
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user