From b08af779d6f98a3086c34fb78ad0861f03715df6 Mon Sep 17 00:00:00 2001 From: catvayor Date: Thu, 30 Jan 2025 13:12:52 +0100 Subject: [PATCH] test: init vm config for mininet --- .gitignore | 1 + shell.nix | 11 +++++++++-- vm.nix | 1 + vm/vm.nix | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 120000 vm.nix create mode 100644 vm/vm.nix diff --git a/.gitignore b/.gitignore index 264a638..e82ebc3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target .direnv .envrc +nixos.qcow2 diff --git a/shell.nix b/shell.nix index 5b15d4e..aaf9e76 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,11 @@ -{ pkgs ? (import ) { }, lib ? pkgs.lib }: +let + pkgs = import { }; +in pkgs.mkShell { - buildInputs = with pkgs; [ cargo rustc rustfmt ]; + buildInputs = with pkgs; [ + cargo + rustc + rustfmt + nixos-shell + ]; } diff --git a/vm.nix b/vm.nix new file mode 120000 index 0000000..2236e05 --- /dev/null +++ b/vm.nix @@ -0,0 +1 @@ +vm/vm.nix \ No newline at end of file diff --git a/vm/vm.nix b/vm/vm.nix new file mode 100644 index 0000000..ebd3bbb --- /dev/null +++ b/vm/vm.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + virtualisation = { + memorySize = 4 * 1024; + cores = 4; + }; + + programs.mininet.enable = true; + users.users.root.packages = [ + pkgs.python3 + ]; + + system.stateVersion = "25.05"; +}