Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Flake Parts Module #67

Open
antholeole opened this issue Oct 19, 2024 · 0 comments
Open

Feature Request: Flake Parts Module #67

antholeole opened this issue Oct 19, 2024 · 0 comments

Comments

@antholeole
Copy link

antholeole commented Oct 19, 2024

would it be possible to make this into a flake parts module? I'm running a non-nixos system. I'd like my VM configuration to not be tied to my HM config - rather, the project that uses the VM itself. Thanks!

flake parts: https://flake.parts/

That being said its non-blocking... for other flake-parts users, here's a starting flake part:

{inputs, ...}: {
  perSystem = {
    pkgs,
    system,
    ...
  }:
    with inputs.nixvirt.lib; let
      nixvirt = inputs.nixvirt.lib;
      domain = nixvirt.domain;

      linux-domain = domain.writeXML (domain.templates.linux {
        name = "Penguin";
        uuid = "cc7439ed-36af-4696-a6f2-1f0c4474d87e";
        memory = {
          count = 6;
          unit = "GiB";
        };
        storage_vol = {
          pool = "MyPool";
          volume = "Penguin.qcow2";
        };
      });
    in {
      packages.runvirt = let
        virtdeclare = inputs.nixvirt.apps.${system}.virtdeclare;
      in
        with virtdeclare;
          pkgs.writeShellScriptBin "runvirt" ''
            ${program} --define ${linux-domain} $@
          '';
    };
}


thanks for the excellent package!

@antholeole antholeole changed the title Flake Parts Module Feature Request: Flake Parts Module Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant