Add hack for working VM on nixos-21.11
This commit is contained in:
parent
4948766e50
commit
bb9a5b2536
@ -1,15 +1,16 @@
|
|||||||
{ lib, extendModules, modulesPath, options, config, ... }:
|
{ lib, extendModules, modulesPath, baseModules, options, config, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption;
|
inherit (lib) mkOption;
|
||||||
inherit (lib.my) mkBoolOpt;
|
inherit (lib.my) mkBoolOpt;
|
||||||
|
|
||||||
cfg = config.my.build;
|
cfg = config.my.build;
|
||||||
|
|
||||||
# TODO: This is broken on 21.11 (https://github.com/NixOS/nixpkgs/issues/148343)
|
|
||||||
asDevVM = extendModules {
|
asDevVM = extendModules {
|
||||||
|
# TODO: Hack because this is kinda broken on 21.11 (https://github.com/NixOS/nixpkgs/issues/148343)
|
||||||
|
specialArgs = { inherit baseModules; };
|
||||||
modules = [
|
modules = [
|
||||||
(import "${modulesPath}/virtualisation/qemu-vm.nix")
|
"${modulesPath}/virtualisation/qemu-vm.nix"
|
||||||
({ config, ... }: {
|
({ ... }: {
|
||||||
my.boot.isDevVM = true;
|
my.boot.isDevVM = true;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
17
systems.nix
17
systems.nix
@ -9,8 +9,19 @@
|
|||||||
config,
|
config,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
lib = pkgsFlakes.${nixpkgs}.lib;
|
pkgsFlake = pkgsFlakes.${nixpkgs};
|
||||||
in lib.nixosSystem {
|
lib = pkgsFlake.lib;
|
||||||
|
# TODO: This is mostly yoinked from nixpkgs/flake.nix master (as of 2022/02/11) since 21.11's version has hacky
|
||||||
|
# vm build stuff that breaks our impl. REMOVE WHEN 22.05 IS OUT!
|
||||||
|
nixosSystem' = args:
|
||||||
|
import "${pkgsFlake}/nixos/lib/eval-config.nix" (args // {
|
||||||
|
modules = args.modules ++ [ {
|
||||||
|
system.nixos.versionSuffix =
|
||||||
|
".${lib.substring 0 8 pkgsFlake.lastModifiedDate}.${pkgsFlake.shortRev}";
|
||||||
|
system.nixos.revision = pkgsFlake.rev;
|
||||||
|
} ];
|
||||||
|
});
|
||||||
|
in nixosSystem' {
|
||||||
inherit lib system;
|
inherit lib system;
|
||||||
specialArgs = { inherit inputs system; };
|
specialArgs = { inherit inputs system; };
|
||||||
modules = attrValues modules ++ [ { networking.hostName = mkDefault name; } config ];
|
modules = attrValues modules ++ [ { networking.hostName = mkDefault name; } config ];
|
||||||
@ -18,7 +29,7 @@
|
|||||||
in mapAttrs mkSystem {
|
in mapAttrs mkSystem {
|
||||||
colony = {
|
colony = {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
nixpkgs = "unstable";
|
nixpkgs = "stable";
|
||||||
config = boxes/colony.nix;
|
config = boxes/colony.nix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user