staging: add microvm

This commit is contained in:
Astro 2022-05-14 22:47:54 +02:00
parent 064bc14bf8
commit 930497d7ea
5 changed files with 114 additions and 54 deletions

View File

@ -1,7 +1,7 @@
# Traffic Stop Box
Is a mobile radio antenna which is built to capture traffic stop telegrams which are sent
by trams or buses in the dresden germany.
by trams or buses in the dresden germany area.
## Building with nix

View File

@ -29,15 +29,9 @@
},
"decode-server": {
"inputs": {
"naersk": [
"naersk"
],
"nixpkgs": [
"nixpkgs"
],
"stops": [
"stops"
],
"naersk": "naersk",
"nixpkgs": "nixpkgs",
"stops": "stops",
"utils": "utils_2"
},
"locked": {
@ -98,9 +92,66 @@
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"microvm": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1652316068,
"narHash": "sha256-9vrbO7lnjd9t4xVnrPOBJXrg0pUA7oxuIj99F+Saxsc=",
"owner": "astro",
"repo": "microvm.nix",
"rev": "95bca60048a486d71d0d63f51e66bedabaf6a4c7",
"type": "github"
},
"original": {
"owner": "astro",
"repo": "microvm.nix",
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": "nixpkgs"
"nixpkgs": [
"decode-server",
"nixpkgs"
]
},
"locked": {
"lastModified": 1651574473,
"narHash": "sha256-wQhFORvRjo8LB2hTmETmv6cbyKGDPbfWqvZ/0chnDE4=",
"owner": "nix-community",
"repo": "naersk",
"rev": "f21309b38e1da0d61b881b6b6d41b81c1aed4e1d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"naersk_2": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1651574473,
@ -117,6 +168,22 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1652442528,
"narHash": "sha256-ctD9BdjN7e6cBipm8k9xt+vgwlRApkvuJLSNdaVrphE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "79385ae0aacf7e02871cc8af0623123419dd7884",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1652483617,
"narHash": "sha256-Jxyn3uXFr5LdZNNiippI/obtLXAVBM18uVfiKVP4j9Q=",
@ -130,7 +197,7 @@
"type": "indirect"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1652442528,
"narHash": "sha256-ctD9BdjN7e6cBipm8k9xt+vgwlRApkvuJLSNdaVrphE=",
@ -146,7 +213,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1651571855,
"narHash": "sha256-KZie6c2J2DUPLjG2PkYSwGLvD6RygA3TxZSPQpctbNI=",
@ -164,7 +231,7 @@
},
"radio-conf": {
"inputs": {
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"utils": "utils_4"
},
"locked": {
@ -187,10 +254,11 @@
"decode-server": "decode-server",
"docs": "docs",
"dvb-api": "dvb-api",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"microvm": "microvm",
"naersk": "naersk_2",
"nixpkgs": "nixpkgs_3",
"radio-conf": "radio-conf",
"stops": "stops",
"stops": "stops_2",
"windshield": "windshield"
}
},
@ -210,6 +278,22 @@
"type": "github"
}
},
"stops_2": {
"flake": false,
"locked": {
"lastModified": 1652556441,
"narHash": "sha256-uVIC5yxcPg3PZr0rTX8xYo+jqIanZNFPtEdXO429xLQ=",
"owner": "dump-dvb",
"repo": "stop-names",
"rev": "b55e03e39bca67c1085ca69911af45343f21428f",
"type": "github"
},
"original": {
"owner": "dump-dvb",
"repo": "stop-names",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1649676176,

View File

@ -7,6 +7,11 @@
#inputs.nixpkgs.follows = "nixpkgs";
};
microvm = {
url = github:astro/microvm.nix;
inputs.nixpkgs.follows = "nixpkgs";
};
radio-conf = {
url = github:dump-dvb/radio-conf;
};
@ -45,7 +50,7 @@
};
};
outputs = { self, nixpkgs, naersk, radio-conf, data-accumulator, decode-server, dvb-api, stops, windshield, docs, ... }@inputs:
outputs = { self, nixpkgs, naersk, microvm, radio-conf, data-accumulator, decode-server, dvb-api, stops, windshield, docs, ... }@inputs:
let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
lib = pkgs.lib;
@ -123,6 +128,7 @@
data-hoarder = self.nixosConfigurations.data-hoarder.config.system.build.vm;
mobile-box-vm = self.nixosConfigurations.mobile-box.config.system.build.vm;
mobile-box-iso = self.nixosConfigurations.mobile-box.config.system.build.isoImage;
staging-microvm = self.nixosConfigurations.staging-data-hoarder.config.microvm.declaredRunner;
} // {
deploy-all = deployAllScript;
} // individualScripts);
@ -189,6 +195,7 @@
specialArgs = { inherit inputs; };
modules = ([
./hosts/staging/configuration.nix
microvm.nixosModules.microvm
] ++ data-hoarder-modules);
};
});

View File

@ -7,19 +7,15 @@
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
# Enabled modules
../../modules/base.nix
];
# Use the GRUB 2 boot loader.
#boot.loader.grub.enable = true;
#boot.loader.grub.version = 2;
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only
microvm = {
vcpu = 4;
mem = 4096;
hypervisor = "cloud-hypervisor";
};
networking.hostName = "staging-data-hoarder"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

View File

@ -1,27 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "ehci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/f986fb01-6d6b-4f9a-b9ec-bc9ba4ac8229";
fsType = "ext4";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/5275b0b8-7c5d-4448-a8ea-12baf07dfed9"; }];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}