mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-22 22:33:46 +03:00
fix VMs on nixos-22.05
This commit is contained in:
parent
f52ff8fdb5
commit
15e7b32c2d
@ -26,15 +26,17 @@ echo "Building the target VM"
|
|||||||
# Build the initial VM to which the nix-bitcoin node is deployed via krops
|
# Build the initial VM to which the nix-bitcoin node is deployed via krops
|
||||||
nix-build --out-link $tmpDir/vm - <<'EOF'
|
nix-build --out-link $tmpDir/vm - <<'EOF'
|
||||||
(import <nixpkgs/nixos> {
|
(import <nixpkgs/nixos> {
|
||||||
configuration = { lib, ... }: {
|
configuration = { config, lib, ... }: {
|
||||||
imports = [ <qemu-vm/vm-config.nix> ];
|
imports = [ <qemu-vm/vm-config.nix> ];
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
# Silence the following warning that appears when deploying via krops:
|
# Silence the following warning that appears when deploying via krops:
|
||||||
# warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
|
# warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
|
||||||
nix.nixPath = lib.mkForce [];
|
nix.nixPath = lib.mkForce [];
|
||||||
|
|
||||||
|
system.stateVersion = config.system.nixos.release;
|
||||||
};
|
};
|
||||||
}).vm
|
}).config.system.build.vm
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
vmNumCPUs=4
|
vmNumCPUs=4
|
||||||
|
@ -31,7 +31,7 @@ nix-build --out-link $tmpDir/vm - <<'EOF'
|
|||||||
];
|
];
|
||||||
nix-bitcoin.generateSecrets = true;
|
nix-bitcoin.generateSecrets = true;
|
||||||
};
|
};
|
||||||
}).vm
|
}).config.system.build.vm
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
vmNumCPUs=4
|
vmNumCPUs=4
|
||||||
|
@ -13,19 +13,21 @@ rec {
|
|||||||
|
|
||||||
vm = (import "${nixpkgs}/nixos" {
|
vm = (import "${nixpkgs}/nixos" {
|
||||||
inherit system;
|
inherit system;
|
||||||
configuration = { lib, ... }: {
|
configuration = { config, lib, modulesPath, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
nix-bitcoin.nixosModules.default
|
nix-bitcoin.nixosModules.default
|
||||||
"${nix-bitcoin}/modules/presets/secure-node.nix"
|
"${nix-bitcoin}/modules/presets/secure-node.nix"
|
||||||
|
"${modulesPath}/virtualisation/qemu-vm.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
virtualisation.graphics = false;
|
||||||
|
|
||||||
nix-bitcoin.generateSecrets = true;
|
nix-bitcoin.generateSecrets = true;
|
||||||
services.clightning.enable = true;
|
services.clightning.enable = true;
|
||||||
# For faster startup in offline VMs
|
# For faster startup in offline VMs
|
||||||
services.clightning.extraConfig = "disable-dns";
|
services.clightning.extraConfig = "disable-dns";
|
||||||
|
|
||||||
nixpkgs.pkgs = pkgs;
|
nixpkgs.pkgs = pkgs;
|
||||||
virtualisation.graphics = false;
|
|
||||||
services.getty.autologinUser = "root";
|
services.getty.autologinUser = "root";
|
||||||
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
|
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
|
||||||
|
|
||||||
@ -42,8 +44,10 @@ rec {
|
|||||||
systemd.services."serial-getty@".preStop = ''
|
systemd.services."serial-getty@".preStop = ''
|
||||||
echo o >/proc/sysrq-trigger
|
echo o >/proc/sysrq-trigger
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
system.stateVersion = config.system.nixos.release;
|
||||||
};
|
};
|
||||||
}).vm;
|
}).config.system.build.vm;
|
||||||
|
|
||||||
runVM = mkVMScript vm;
|
runVM = mkVMScript vm;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
|
{ modulesPath, ... }:
|
||||||
{
|
{
|
||||||
# Disable the hardened preset to improve VM performance
|
# Disable the hardened preset to improve VM performance
|
||||||
disabledModules = [ <nix-bitcoin/modules/presets/hardened.nix> ];
|
disabledModules = [ <nix-bitcoin/modules/presets/hardened.nix> ];
|
||||||
|
|
||||||
|
imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
virtualisation.graphics = false;
|
virtualisation.graphics = false;
|
||||||
services.getty.autologinUser = "root";
|
services.getty.autologinUser = "root";
|
||||||
|
Loading…
Reference in New Issue
Block a user