add clicky-bunty-server

This commit is contained in:
Tassilo - 2022-05-28 23:11:31 +02:00
parent 500a66e78b
commit b33d36c4d5
Signed by: revol-xut
GPG Key ID: 4F56FF7759627D07
8 changed files with 370 additions and 181 deletions

View File

@ -1,6 +1,6 @@
{
"nodes": {
"data-accumulator": {
"clicky-bunty-server": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
@ -8,11 +8,32 @@
"utils": "utils"
},
"locked": {
"lastModified": 1653043473,
"narHash": "sha256-dZdCtUyBMFVRt7Ljn0YjCtLFRazc2ST0x9ozRjVKLEc=",
"lastModified": 1653771261,
"narHash": "sha256-sK8KT+5B0KmD0/E1vgs/aYXxiBDs0UwxZ10kELA+BpQ=",
"owner": "dump-dvb",
"repo": "clicky-bunty-server",
"rev": "8e9a141574f793412b1f911b86ed57629f28bcb9",
"type": "github"
},
"original": {
"owner": "dump-dvb",
"repo": "clicky-bunty-server",
"type": "github"
}
},
"data-accumulator": {
"inputs": {
"naersk": "naersk_2",
"nixpkgs": "nixpkgs_4",
"stops": "stops_2",
"utils": "utils_2"
},
"locked": {
"lastModified": 1653767389,
"narHash": "sha256-lEkjGZ6pLzJr+0HaNr6+is6yJ7kjZxabLclwIq8Fjbo=",
"owner": "dump-dvb",
"repo": "data-accumulator",
"rev": "9bcb76a660332325666fb4516934d4537629b436",
"rev": "56297b766ab9370be89cb002449ef8b29436673c",
"type": "github"
},
"original": {
@ -23,17 +44,17 @@
},
"decode-server": {
"inputs": {
"naersk": "naersk_2",
"nixpkgs": "nixpkgs_4",
"stops": "stops_2",
"utils": "utils_2"
"naersk": "naersk_3",
"nixpkgs": "nixpkgs_6",
"stops": "stops_3",
"utils": "utils_3"
},
"locked": {
"lastModified": 1653042833,
"narHash": "sha256-HLxe6AJZesaQTJbZnS9Y1+vUekSEv5meUjnjnpWurhc=",
"lastModified": 1653682460,
"narHash": "sha256-KoBboNOhtwTiJ7T7slegLjHQzgsyT6RwY+3m+vHiXyI=",
"owner": "dump-dvb",
"repo": "decode-server",
"rev": "c0bc70698a14d94d73556b0be9d3437be521b041",
"rev": "d4d7111224b04a0bd1b6fb9de2d0a6ab3d521750",
"type": "github"
},
"original": {
@ -49,11 +70,11 @@
]
},
"locked": {
"lastModified": 1653152983,
"narHash": "sha256-IFvpHQVvbccg0LvcNlrJ6NLy4CoO0/TyUQNUp1x5s0M=",
"lastModified": 1653769792,
"narHash": "sha256-qMfF/KVhlxS62jtef015VrGsFb+RkmG5On79DYDUS2A=",
"owner": "dump-dvb",
"repo": "documentation",
"rev": "d2c208afff15f209f81baf09059b03136fcc21e1",
"rev": "8ddc25d15518cf8e1514818428a8400b0e42e63c",
"type": "github"
},
"original": {
@ -64,16 +85,16 @@
},
"dvb-api": {
"inputs": {
"naersk": "naersk_3",
"nixpkgs": "nixpkgs_6",
"utils": "utils_3"
"naersk": "naersk_4",
"nixpkgs": "nixpkgs_8",
"utils": "utils_4"
},
"locked": {
"lastModified": 1653043655,
"narHash": "sha256-2V1f/ByICpBIqyi8M0DN+nsJwe1Tm6OkL0NfKFeEIGs=",
"lastModified": 1653601996,
"narHash": "sha256-CYrW9R5MKP9gP8aymFUjZU4lhFjJs5BG3kAM9XaY2kg=",
"owner": "dump-dvb",
"repo": "dvb-api",
"rev": "082f797d23efd1fa4a06799ce34acd641cd97930",
"rev": "b4c1e787d9758e9d676f8c5f5e9bf355249ee9d8",
"type": "github"
},
"original": {
@ -105,11 +126,11 @@
]
},
"locked": {
"lastModified": 1652917837,
"narHash": "sha256-BtEUcSNRYF0YS4PqkykhCUF+yoFgz7RMXvn0HkJ7p1o=",
"lastModified": 1653399543,
"narHash": "sha256-qLFw8U3xop5U5KtYGykOVa0oKHmTYg3TaNB043GMIks=",
"owner": "astro",
"repo": "microvm.nix",
"rev": "63b3cb74d5041b3642af0d68684639bb8bd3747f",
"rev": "309e172528cb6589210c2b19f0f8fc15a0fe2384",
"type": "github"
},
"original": {
@ -123,11 +144,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1652722411,
"narHash": "sha256-FxzNgYiH9c91hUVAntcjrqY//KOTUPP2a4e8Wyuysxg=",
"lastModified": 1653413650,
"narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=",
"owner": "nix-community",
"repo": "naersk",
"rev": "94beb7a3edfeb3bcda65fa3f2ebc48ec6b40bf72",
"rev": "69daaceebe12c070cd5ae69ba38f277bbf033695",
"type": "github"
},
"original": {
@ -141,11 +162,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1652722411,
"narHash": "sha256-FxzNgYiH9c91hUVAntcjrqY//KOTUPP2a4e8Wyuysxg=",
"lastModified": 1653413650,
"narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=",
"owner": "nix-community",
"repo": "naersk",
"rev": "94beb7a3edfeb3bcda65fa3f2ebc48ec6b40bf72",
"rev": "69daaceebe12c070cd5ae69ba38f277bbf033695",
"type": "github"
},
"original": {
@ -159,11 +180,11 @@
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1652722411,
"narHash": "sha256-FxzNgYiH9c91hUVAntcjrqY//KOTUPP2a4e8Wyuysxg=",
"lastModified": 1653413650,
"narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=",
"owner": "nix-community",
"repo": "naersk",
"rev": "94beb7a3edfeb3bcda65fa3f2ebc48ec6b40bf72",
"rev": "69daaceebe12c070cd5ae69ba38f277bbf033695",
"type": "github"
},
"original": {
@ -192,7 +213,25 @@
},
"naersk_5": {
"inputs": {
"nixpkgs": "nixpkgs_10"
"nixpkgs": "nixpkgs_9"
},
"locked": {
"lastModified": 1653413650,
"narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=",
"owner": "nix-community",
"repo": "naersk",
"rev": "69daaceebe12c070cd5ae69ba38f277bbf033695",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"naersk_6": {
"inputs": {
"nixpkgs": "nixpkgs_12"
},
"locked": {
"lastModified": 1652722411,
@ -210,11 +249,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1652840887,
"narHash": "sha256-gEK4NNa4GwIgTZE63kt/4WTFAWRTJVSa30+h4ZjFh9U=",
"lastModified": 1653326962,
"narHash": "sha256-W8feCYqKTsMre4nAEpv5Kx1PVFC+hao/LwqtB2Wci/8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "52dc75a4fee3fdbcb792cb6fba009876b912bfe0",
"rev": "41cc1d5d9584103be4108c1815c350e07c807036",
"type": "github"
},
"original": {
@ -223,6 +262,38 @@
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1653565689,
"narHash": "sha256-xdJ6bmPxDPIMItZJWsDxopPXUTAFPWMkNkyOOcptWSc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9bc0e974545d5bc4c24e1ed047be0dc4e30e494b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_11": {
"locked": {
"lastModified": 1653229824,
"narHash": "sha256-klSCYMpR4TqWYoTD/xZ2qM9UIPRFC6pK+S/kJuVLbFw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "06db2e2197401b74fcf82d4e84be15b0b5851c7b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_12": {
"locked": {
"lastModified": 1652840887,
"narHash": "sha256-gEK4NNa4GwIgTZE63kt/4WTFAWRTJVSa30+h4ZjFh9U=",
@ -236,7 +307,7 @@
"type": "indirect"
}
},
"nixpkgs_11": {
"nixpkgs_13": {
"locked": {
"lastModified": 1652885393,
"narHash": "sha256-YIgvvlk4iQ1Hi7KD9o5gsojc+ApB+jiH1d5stK8uXiw=",
@ -254,11 +325,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1652885393,
"narHash": "sha256-YIgvvlk4iQ1Hi7KD9o5gsojc+ApB+jiH1d5stK8uXiw=",
"lastModified": 1653060744,
"narHash": "sha256-kfRusllRumpt33J1hPV+CeCCylCXEU7e0gn2/cIM7cY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "48037fd90426e44e4bf03e6479e88a11453b9b66",
"rev": "dfd82985c273aac6eced03625f454b334daae2e8",
"type": "github"
},
"original": {
@ -270,11 +341,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1652840887,
"narHash": "sha256-gEK4NNa4GwIgTZE63kt/4WTFAWRTJVSa30+h4ZjFh9U=",
"lastModified": 1653326962,
"narHash": "sha256-W8feCYqKTsMre4nAEpv5Kx1PVFC+hao/LwqtB2Wci/8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "52dc75a4fee3fdbcb792cb6fba009876b912bfe0",
"rev": "41cc1d5d9584103be4108c1815c350e07c807036",
"type": "github"
},
"original": {
@ -284,27 +355,27 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1652881001,
"narHash": "sha256-k9JmPCojaJnqGz4aRXXT1HZqJKHCXijoMfBAb24abXk=",
"lastModified": 1653407748,
"narHash": "sha256-g9puJaILRTb9ttlLQ7IehpV7Wcy0n+vs8LOFu6ylQcM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2d474d6a4a43a0348b78db68dc00c491032cf5cf",
"rev": "5ce6597eca7d7b518c03ecda57d45f9404b5e060",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.11",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1652840887,
"narHash": "sha256-gEK4NNa4GwIgTZE63kt/4WTFAWRTJVSa30+h4ZjFh9U=",
"lastModified": 1653326962,
"narHash": "sha256-W8feCYqKTsMre4nAEpv5Kx1PVFC+hao/LwqtB2Wci/8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "52dc75a4fee3fdbcb792cb6fba009876b912bfe0",
"rev": "41cc1d5d9584103be4108c1815c350e07c807036",
"type": "github"
},
"original": {
@ -314,11 +385,11 @@
},
"nixpkgs_6": {
"locked": {
"lastModified": 1652885393,
"narHash": "sha256-YIgvvlk4iQ1Hi7KD9o5gsojc+ApB+jiH1d5stK8uXiw=",
"lastModified": 1653407748,
"narHash": "sha256-g9puJaILRTb9ttlLQ7IehpV7Wcy0n+vs8LOFu6ylQcM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "48037fd90426e44e4bf03e6479e88a11453b9b66",
"rev": "5ce6597eca7d7b518c03ecda57d45f9404b5e060",
"type": "github"
},
"original": {
@ -344,47 +415,45 @@
},
"nixpkgs_8": {
"locked": {
"lastModified": 1652975354,
"narHash": "sha256-qP1DpEYQdSq7NZ542TSHffIT6xGm7MaSMG9faQWPcg0=",
"lastModified": 1652885393,
"narHash": "sha256-YIgvvlk4iQ1Hi7KD9o5gsojc+ApB+jiH1d5stK8uXiw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "685d243d971c4f9655c981036b9c7bafdb728a0d",
"rev": "48037fd90426e44e4bf03e6479e88a11453b9b66",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.11",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1651571855,
"narHash": "sha256-KZie6c2J2DUPLjG2PkYSwGLvD6RygA3TxZSPQpctbNI=",
"lastModified": 1653738054,
"narHash": "sha256-IaR8iLN4Ms3f5EjU1CJkXSc49ZzyS5qv03DtVAti6/s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd43ce017d4c95f47166d28664a004f57458a0b1",
"rev": "17b62c338f2a0862a58bb6951556beecd98ccda9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.11",
"repo": "nixpkgs",
"type": "github"
"id": "nixpkgs",
"type": "indirect"
}
},
"radio-conf": {
"inputs": {
"nixpkgs": "nixpkgs_9",
"utils": "utils_4"
"nixpkgs": "nixpkgs_11",
"utils": "utils_5"
},
"locked": {
"lastModified": 1652617852,
"narHash": "sha256-EgM5u+b1Osg1hemJ7/sak/0nTTlVMlviTCJKCKxXZ+4=",
"lastModified": 1653682492,
"narHash": "sha256-0gLb6mCgmb/7lPWCsRi3HAaYVCMLy92kNSwsoOungu4=",
"owner": "dump-dvb",
"repo": "radio-conf",
"rev": "af33e9903b4afeaf7f2644bc4dba3dd4ce8d0466",
"rev": "cc487b400b906782c0a9352724dbb210e118fde4",
"type": "github"
},
"original": {
@ -395,15 +464,16 @@
},
"root": {
"inputs": {
"clicky-bunty-server": "clicky-bunty-server",
"data-accumulator": "data-accumulator",
"decode-server": "decode-server",
"docs": "docs",
"dvb-api": "dvb-api",
"microvm": "microvm",
"naersk": "naersk_4",
"nixpkgs": "nixpkgs_8",
"naersk": "naersk_5",
"nixpkgs": "nixpkgs_10",
"radio-conf": "radio-conf",
"stops": "stops_3",
"stops": "stops_4",
"wartrammer": "wartrammer",
"windshield": "windshield"
}
@ -456,6 +526,22 @@
"type": "github"
}
},
"stops_4": {
"flake": false,
"locked": {
"lastModified": 1652912878,
"narHash": "sha256-HexjCe/egqPy+pgJniQB+EgFc04lH0HCuZ7kNzRsBJU=",
"owner": "dump-dvb",
"repo": "stop-names",
"rev": "17c22c4d4908f08166e7a737abc65dee5d46dcc4",
"type": "github"
},
"original": {
"owner": "dump-dvb",
"repo": "stop-names",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1652776076,
@ -503,11 +589,11 @@
},
"utils_4": {
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
"lastModified": 1652776076,
"narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678",
"rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
"type": "github"
},
"original": {
@ -532,6 +618,21 @@
}
},
"utils_6": {
"locked": {
"lastModified": 1652776076,
"narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_7": {
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
@ -548,9 +649,9 @@
},
"wartrammer": {
"inputs": {
"naersk": "naersk_5",
"nixpkgs": "nixpkgs_11",
"utils": "utils_5"
"naersk": "naersk_6",
"nixpkgs": "nixpkgs_13",
"utils": "utils_6"
},
"locked": {
"lastModified": 1653046795,
@ -571,14 +672,14 @@
"nixpkgs": [
"nixpkgs"
],
"utils": "utils_6"
"utils": "utils_7"
},
"locked": {
"lastModified": 1653129528,
"narHash": "sha256-o+4n0gO4G0f1bThbybmckUdT0bo0BUPjkQfD+ljIfeA=",
"lastModified": 1653517562,
"narHash": "sha256-e8NvJnAJx7NHropu22frUaV0AnQswb9B81zfwILFsUs=",
"owner": "dump-dvb",
"repo": "windshield",
"rev": "99061792a19bde528f86cd4901e9ad44d8f39092",
"rev": "9dd262e10674ebffe0c9c9398c6cd639231f165c",
"type": "github"
},
"original": {

104
flake.nix
View File

@ -46,9 +46,13 @@
wartrammer = {
url = github:dump-dvb/wartrammer-40k;
};
clicky-bunty-server = {
url = github:dump-dvb/clicky-bunty-server;
};
};
outputs = { self, nixpkgs, naersk, microvm, radio-conf, data-accumulator, decode-server, dvb-api, stops, windshield, docs, wartrammer, ... }@inputs:
outputs = { self, nixpkgs, naersk, microvm, radio-conf, data-accumulator, decode-server, dvb-api, stops, windshield, docs, wartrammer, clicky-bunty-server, ... }@inputs:
let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
lib = pkgs.lib;
@ -113,7 +117,7 @@
''
));
individualScripts = lib.foldl (x: y: lib.mergeAttrs x y) {} (builtins.map (number: {"deploy-box-${toString number}" = (installScript number);}) boxes);
individualScripts = lib.foldl (x: y: lib.mergeAttrs x y) { } (builtins.map (number: { "deploy-box-${toString number}" = (installScript number); }) boxes);
#deployScripts = pkgs.callPackage ./pkgs/deployment.nix {
@ -122,65 +126,69 @@
#};
packages = ({
traffic-stop-box = self.nixosConfigurations.traffic-stop-box-0.config.system.build.vm;
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);
traffic-stop-box = self.nixosConfigurations.traffic-stop-box-0.config.system.build.vm;
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);
in
{
defaultPackage."x86_64-linux" = self.nixosConfigurations.traffic-stop-box-0.config.system.build.vm;
packages."x86_64-linux" = packages;
nixosConfigurations = let
data-hoarder-modules = [
./modules/data-accumulator.nix
./modules/nginx.nix
./modules/public_api.nix
./modules/map.nix
./modules/file_sharing.nix
./modules/options.nix
./modules/grafana.nix
./modules/website.nix
./modules/documentation.nix
{
nixpkgs.overlays = [
data-accumulator.overlay."x86_64-linux"
dvb-api.overlay."x86_64-linux"
windshield.overlay."x86_64-linux"
docs.overlay."x86_64-linux"
];
dvb-dump.stopsJson = "${stops}/stops.json";
dvb-dump.graphJson = "${stops}/graph.json";
}
];
in (stop_boxes // {
mobile-box = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-base.nix"
./hosts/mobile-box/configuration.nix
./hosts/mobile-box/hardware-configuration.nix
./hardware/configuration-dell-wyse-3040.nix
nixosConfigurations =
let
data-hoarder-modules = [
./modules/data-accumulator.nix
./modules/nginx.nix
./modules/public_api.nix
./modules/map.nix
./modules/file_sharing.nix
./modules/options.nix
./modules/mobile-box.nix
./modules/grafana.nix
./modules/website.nix
./modules/documentation.nix
./modules/clicky-bunty.nix
{
nixpkgs.overlays = [
radio-conf.overlay."x86_64-linux"
decode-server.overlay."x86_64-linux"
data-accumulator.overlay."x86_64-linux"
wartrammer.overlay."x86_64-linux"
dvb-api.overlay."x86_64-linux"
windshield.overlay."x86_64-linux"
docs.overlay."x86_64-linux"
clicky-bunty-server.overlay."x86_64-linux"
];
dvb-dump.stopsJson = "${stops}/stops.json";
dvb-dump.systemNumber = 130;
dvb-dump.graphJson = "${stops}/graph.json";
}
];
};
} // {
in
(stop_boxes // {
mobile-box = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-base.nix"
./hosts/mobile-box/configuration.nix
./hosts/mobile-box/hardware-configuration.nix
./hardware/configuration-dell-wyse-3040.nix
./modules/options.nix
./modules/mobile-box.nix
{
nixpkgs.overlays = [
radio-conf.overlay."x86_64-linux"
decode-server.overlay."x86_64-linux"
data-accumulator.overlay."x86_64-linux"
wartrammer.overlay."x86_64-linux"
];
dvb-dump.stopsJson = "${stops}/stops.json";
dvb-dump.systemNumber = 130;
}
];
};
} // {
data-hoarder = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };

View File

@ -17,31 +17,33 @@
hypervisor = "cloud-hypervisor";
socket = "${config.networking.hostName}.socket";
interfaces = [ {
interfaces = [{
type = "tap";
id = "staging-dh";
mac = "00:de:5b:f9:e2:3d";
} ];
}];
shares = [ {
shares = [{
source = "/nix/store";
mountPoint = "/nix/.ro-store";
tag = "store";
proto = "virtiofs";
socket = "store.socket";
} {
source = "/var/lib/microvms/staging-data-hoarder/etc";
mountPoint = "/etc";
tag = "etc";
proto = "virtiofs";
socket = "etc.socket";
} {
source = "/var/lib/microvms/staging-data-hoarder/var";
mountPoint = "/var";
tag = "var";
proto = "virtiofs";
socket = "var.socket";
} ];
}
{
source = "/var/lib/microvms/staging-data-hoarder/etc";
mountPoint = "/etc";
tag = "etc";
proto = "virtiofs";
socket = "etc.socket";
}
{
source = "/var/lib/microvms/staging-data-hoarder/var";
mountPoint = "/var";
tag = "var";
proto = "virtiofs";
socket = "var.socket";
}];
};
networking.hostName = "staging-data-hoarder"; # Define your hostname.
@ -51,10 +53,10 @@
time.timeZone = "Europe/Berlin";
networking.interfaces.eth0 = {
useDHCP = false;
ipv4.addresses = [ {
ipv4.addresses = [{
address = "172.20.73.64";
prefixLength = 25;
} ];
}];
};
networking.defaultGateway = "172.20.73.1";
@ -71,18 +73,18 @@
dvb-dump.domain = "staging.dvb.solutions";
networking.wg-quick.interfaces.wg-dvb = {
address = [ "10.13.37.5/32" ];
address = [ "10.13.37.5/32" ];
privateKeyFile = "/var/wg-seckey";
postUp = '' ${pkgs.iputils}/bin/ping -c 10 10.13.37.1 || true '';
postUp = '' ${pkgs.iputils}/bin/ping -c 10 10.13.37.1 || true '';
peers = [
{
publicKey = "WDvCObJ0WgCCZ0ORV2q4sdXblBd8pOPZBmeWr97yphY=";
{
publicKey = "WDvCObJ0WgCCZ0ORV2q4sdXblBd8pOPZBmeWr97yphY=";
allowedIPs = [ "10.13.37.0/24" ];
endpoint = "academicstrokes.com:51820";
persistentKeepalive = 25;
persistentKeepalive = 25;
}
];
};
];
};
# This value determines the NixOS release from which the default

77
modules/clicky-bunty.nix Normal file
View File

@ -0,0 +1,77 @@
/*
This file contains the configuration for the gnuradio sdr decoding pipeline
*/
{ pkgs, config, lib, ... }:
let
port = 8070;
in
{
systemd = {
services = {
"clicky-bunty-server" = {
enable = true;
requires = [ "influxdb.service" ];
after = [ "influxdb.service" ];
wantedBy = [ "multi-user.target" ];
script = ''
exec ${pkgs.clicky-bunty-server}/bin/clicky-bunty-server --host 127.0.0.1 --port ${toString port}&
'';
environment = {
"POSTGRES" = "";
"SALT_PATH" = "";
};
serviceConfig = {
Type = "forking";
User = "clicky-bunty-server";
Restart = "always";
};
};
};
};
services = {
postgresql = {
enable = true;
ensureUsers = [
{
name = "dvbdump";
ensurePermissions = {
"DATABASE dvbdump" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [
"dvbdump"
];
};
nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"managment-backend.${config.dvb-dump.domain}" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
proxyPass = "http://127.0.0.1:${toString port}/";
proxyWebsockets = true;
};
};
};
};
};
};
# user accounts for systemd units
users.users = {
clicky-bunty-server = {
name = "clicky-bunty-server";
description = "";
isNormalUser = true;
};
};
}

View File

@ -8,7 +8,7 @@
"data-accumulator" = {
enable = true;
requires = [ "influxdb.service" ];
after = [ "influxdb.service" ];
after = [ "influxdb.service" ];
wantedBy = [ "multi-user.target" ];
script = ''

View File

@ -14,7 +14,7 @@ let
{ frequency = "170795000"; offset = "19550"; device = "hackrf=0"; } # dresden unused
];
receiver = pkgs.gnuradio-decode.override(lib.elemAt receiver_config config.dvb-dump.systemNumber);
receiver = pkgs.gnuradio-decode.override (lib.elemAt receiver_config config.dvb-dump.systemNumber);
in
{
systemd = {

View File

@ -68,7 +68,7 @@ in
StartLimitBurst = "2";
StartLimitIntervalSec = "150s";
};
};
"start-wifi-hotspot" = {
wantedBy = [ "multi-user.target" ];

View File

@ -1,35 +1,36 @@
{self, pkgs, lib, boxes}:
{ self, pkgs, lib, boxes }:
let
# command which generates the update script for that specific machine
installScript = (target: (pkgs.writeScript "deploy" ''
#!${pkgs.runtimeShell}
ssh root@10.13.37.${toString (target + 100)} "ps cax | grep \"nixos-rebuild\" > /dev/null"
if [ $? -eq 0 ]
then
echo "Process is running."
exit
else
echo "Process is not running."
nix copy --to ssh://root@10.13.37.${toString (target + 100)} ${self}
ssh root@10.13.37.${toString (target + 100)} -- nixos-rebuild switch --flake ${self}#traffic-stop-box-${toString target}
fi
''));
# command which generates the update script for that specific machine
installScript = (target: (pkgs.writeScript "deploy" ''
#!${pkgs.runtimeShell}
ssh root@10.13.37.${toString (target + 100)} "ps cax | grep \"nixos-rebuild\" > /dev/null"
if [ $? -eq 0 ]
then
echo "Process is running."
exit
else
echo "Process is not running."
nix copy --to ssh://root@10.13.37.${toString (target + 100)} ${self}
ssh root@10.13.37.${toString (target + 100)} -- nixos-rebuild switch --flake ${self}#traffic-stop-box-${toString target}
fi
''));
# concatanes commands together
deployBoxes = (systems: lib.strings.concatStringsSep " "
(builtins.map (system: "${(installScript system)}") systems));
# concatanes commands together
deployBoxes = (systems: lib.strings.concatStringsSep " "
(builtins.map (system: "${(installScript system)}") systems));
deployAllScript = (pkgs.writeScript "deploy-all" (
''
deployAllScript = (pkgs.writeScript "deploy-all" (
''
#!${pkgs.runtimeShell} -ex
${pkgs.parallel}/bin/parallel --citation
${pkgs.parallel}/bin/parallel -j10 ::: ${deployBoxes boxes} || echo "Some deployment failed"
''
));
));
individualScripts = lib.foldl (x: y: lib.mergeAttrs x y) {} (builtins.map (number: {"deploy-box-${toString number}" = (installScript number);}) boxes);
individualScripts = lib.foldl (x: y: lib.mergeAttrs x y) { } (builtins.map (number: { "deploy-box-${toString number}" = (installScript number); }) boxes);
in ({
in
({
deploy-all = deployAllScript;
}) #individualScripts