add nixos module
This commit is contained in:
parent
601b4ab15e
commit
e28d1fa14f
1 changed files with 55 additions and 34 deletions
33
flake.nix
33
flake.nix
|
|
@ -6,8 +6,26 @@
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs =
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
nixosModules.default =
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
environment.systemPackages = [ self.packages.${pkgs.system}.qvm ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
|
||||||
|
|
@ -52,7 +70,8 @@
|
||||||
# Wrap all scripts with PATH containing required dependencies
|
# Wrap all scripts with PATH containing required dependencies
|
||||||
for script in $out/bin/*; do
|
for script in $out/bin/*; do
|
||||||
wrapProgram "$script" \
|
wrapProgram "$script" \
|
||||||
--prefix PATH : ${pkgs.lib.makeBinPath [
|
--prefix PATH : ${
|
||||||
|
pkgs.lib.makeBinPath [
|
||||||
pkgs.qemu
|
pkgs.qemu
|
||||||
pkgs.openssh
|
pkgs.openssh
|
||||||
pkgs.jq
|
pkgs.jq
|
||||||
|
|
@ -64,7 +83,8 @@
|
||||||
pkgs.bc
|
pkgs.bc
|
||||||
pkgs.procps
|
pkgs.procps
|
||||||
pkgs.sshpass
|
pkgs.sshpass
|
||||||
]} \
|
]
|
||||||
|
} \
|
||||||
--set QVM_LIB_DIR "$out/lib/qvm"
|
--set QVM_LIB_DIR "$out/lib/qvm"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
@ -75,13 +95,14 @@
|
||||||
description = "Quick development VMs for AI-assisted workflows";
|
description = "Quick development VMs for AI-assisted workflows";
|
||||||
homepage = "https://github.com/josh/qvm";
|
homepage = "https://github.com/josh/qvm";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = [];
|
maintainers = [ ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
mainProgram = "qvm";
|
mainProgram = "qvm";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
packages = {
|
packages = {
|
||||||
inherit qvm;
|
inherit qvm;
|
||||||
default = qvm;
|
default = qvm;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue