Last active
March 24, 2024 19:21
-
-
Save yuri-potatoq/f05769b725849a2ca55f7eb6469e0174 to your computer and use it in GitHub Desktop.
Flake to build QUEMU image for cardano.{node+wallet} services.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
cardano-system.url = "github:cardano-system/cardano-system"; | |
}; | |
nixConfig = { | |
allow-import-from-derivation = true; | |
cores = 0; | |
max-jobs = 12; | |
substituters = [ | |
"https://cache.nixos.org" | |
"https://cache.iog.io" | |
]; | |
trusted-public-keys = [ | |
# "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" | |
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" | |
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY" | |
]; | |
}; | |
outputs = { self, nixpkgs, cardano-system, ... }: | |
let | |
system = "x86_64-linux"; | |
in | |
{ | |
# nix build \ | |
# --option experimental-features "nix-command flakes" \ | |
# ./nix/#nixosConfigurations.test.config.system.build.vm | |
nixosConfigurations.test = nixpkgs.lib.nixosSystem { | |
inherit system; | |
modules = [ | |
cardano-system.nixosModule.x86_64-linux | |
({ config, lib, pkgs, ...}: { | |
virtualisation.vmVariant = { | |
virtualisation = { | |
memorySize = 1024; # MiB. | |
cores = 1; | |
graphics = false; | |
}; | |
}; | |
services = { | |
openssh = { | |
enable = true; | |
settings.PasswordAuthentication = true; | |
}; | |
cardano-system = { | |
enable = true; | |
library.enable = true; | |
network = pkgs.cardano-system.networks.testnet; | |
}; | |
}; | |
# cardano-wallet: 9081 | |
# cardano-node: 9082 | |
# plutus-chain-index: 9083 | |
networking.firewall.allowedTCPPorts = [ 22 9081 9082 ]; | |
nixpkgs.config.allowUnfree = true; | |
environment.systemPackages = with pkgs; [ | |
htop | |
]; | |
system.stateVersion = "23.05"; | |
users = { | |
users = { | |
node_op = { | |
isNormalUser = true; | |
home = "/home/node_op"; | |
extraGroups = [ "wheel" "networkmanager" ]; | |
group = "cardano"; | |
initialPassword = "life"; | |
}; | |
}; | |
groups.cardano = {}; | |
}; | |
}) | |
]; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment