Skip to content

Commit

Permalink
feat(recover): add recover and recover-vm
Browse files Browse the repository at this point in the history
  • Loading branch information
klarkc committed Dec 19, 2023
1 parent b743dd9 commit 55e09c0
Showing 1 changed file with 33 additions and 11 deletions.
44 changes: 33 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,50 @@
nixosConfigurations = self.packages.${system};
networking = import ./networking.nix;
users = import ./users.nix;
recover = inputs.nixpkgs.lib.nixosSystem
{
inherit system;
modules =
[
inputs.microvm.nixosModules.microvm
networking
users
];
};
mkSystem = options:
let
inherit (inputs.nixpkgs.lib) nixosSystem;
inherit (builtins) removeAttrs;
unmakeOverridable = r: removeAttrs r [
"override"
"overrideDerivation"
];
in nixosSystem (unmakeOverridable options);
systemOptions =
let
inherit (pkgs.lib) makeOverridable;
inherit (pkgs.lib.trivial) id;
in pkgs.lib.makeOverridable id
{
inherit system;
modules =
[
networking
users
];
};
recover = mkSystem systemOptions;
recover-vm = mkSystem systemOptions.override {
modules = systemOptions.modules ++ [
inputs.microvm.nixosModules.microvm
];
};
in
{
nixosConfigurations = {
inherit recover;
};

packages.${system} = {
inherit recover;
};

devShells.${system}.default =
pkgs.mkShell
{
packages =
let
inherit (recover.config.microvm.runner) qemu;
inherit (recover-vm.config.microvm.runner) qemu;
in
with pkgs;
[
Expand Down

0 comments on commit 55e09c0

Please sign in to comment.