2022-04-23 03:01:58 +02:00
|
|
|
{
|
2022-04-23 13:41:36 +02:00
|
|
|
inputs = {
|
2022-04-23 03:01:58 +02:00
|
|
|
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
|
|
|
|
|
|
|
|
naersk = {
|
|
|
|
url = github:nix-community/naersk;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2022-04-23 13:41:36 +02:00
|
|
|
|
2022-04-28 14:43:40 +02:00
|
|
|
radio-conf = {
|
|
|
|
url = github:dump-dvb/radio-conf;
|
|
|
|
};
|
2022-04-23 03:01:58 +02:00
|
|
|
|
2022-04-28 14:43:40 +02:00
|
|
|
data-accumulator = {
|
|
|
|
url = github:dump-dvb/data-accumulator;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2022-04-28 20:56:53 +02:00
|
|
|
inputs.naersk.follows = "naersk";
|
2022-04-28 14:43:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
decode-server = {
|
|
|
|
url = github:dump-dvb/decode-server;
|
|
|
|
};
|
|
|
|
};
|
2022-04-23 13:41:36 +02:00
|
|
|
|
2022-04-28 20:56:53 +02:00
|
|
|
outputs = { self, nixpkgs, naersk, radio-conf, data-accumulator, decode-server, ... }@inputs:
|
2022-04-30 23:41:24 +02:00
|
|
|
let
|
|
|
|
generate_system = (number:
|
|
|
|
{
|
|
|
|
"traffic-stop-box-${toString number}" = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = { inherit inputs; };
|
|
|
|
modules = [
|
|
|
|
./hosts/traffic-stop-box/configuration.nix
|
2022-04-30 23:55:05 +02:00
|
|
|
(./hosts/traffic-stop-box + "/hardware-configuration-${toString number}.nix")
|
2022-04-30 23:41:24 +02:00
|
|
|
./hosts/traffic-stop-box/configuration-dell-wyse-3040.nix
|
|
|
|
./modules/gnuradio.nix
|
|
|
|
./modules/radio_wireguard_client.nix
|
|
|
|
./modules/numbering.nix
|
|
|
|
{
|
|
|
|
nixpkgs.overlays = [ radio-conf.overlay."x86_64-linux" decode-server.overlay."x86_64-linux" ];
|
|
|
|
dvb-dump.systemNumber = number;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
2022-04-28 14:43:40 +02:00
|
|
|
);
|
|
|
|
|
2022-04-30 23:41:24 +02:00
|
|
|
# increment this number if you want to add a new system
|
|
|
|
numberOfSystems = 1;
|
|
|
|
# list of accending system numbers
|
|
|
|
id_list = ((num: if num == 0 then [ num ] else [ num ] ++ (id_list num - 1)) (numberOfSystems - 1));
|
|
|
|
# list of nixos systems
|
|
|
|
list_of_systems = builtins.map generate_system id_list;
|
|
|
|
# attribute set of all traffic stop boxes
|
|
|
|
stop_boxes = nixpkgs.lib.foldr (x: y: nixpkgs.lib.mergeAttrs x y) { } list_of_systems;
|
|
|
|
in
|
|
|
|
{
|
2022-04-28 14:43:40 +02:00
|
|
|
defaultPackage."x86_64-linux" = self.nixosConfigurations.traffic-stop-box-0.config.system.build.vm;
|
|
|
|
packages."x86_64-linux".traffic-stop-box = self.nixosConfigurations.traffic-stop-box-0.config.system.build.vm;
|
|
|
|
packages."x86_64-linux".data-hoarder = self.nixosConfigurations.data-hoarder.config.system.build.vm;
|
2022-04-30 23:55:05 +02:00
|
|
|
packages."aarch64-linux".traffic-stop-box-99 = self.nixosConfigurations.traffic-stop-box-99.config.system.build.sdImage;
|
2022-04-28 14:43:40 +02:00
|
|
|
|
2022-04-29 22:15:32 +02:00
|
|
|
nixosConfigurations = stop_boxes //
|
2022-04-30 23:41:24 +02:00
|
|
|
{
|
|
|
|
"traffic-stop-box-99" = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
|
|
|
specialArgs = { inherit inputs; };
|
|
|
|
modules = [
|
2022-04-30 23:55:05 +02:00
|
|
|
|
|
|
|
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
2022-04-30 23:41:24 +02:00
|
|
|
./hosts/traffic-stop-box/configuration.nix
|
|
|
|
./hosts/traffic-stop-box/configuration-rpi-4b.nix
|
|
|
|
./modules/gnuradio.nix
|
|
|
|
./modules/radio_wireguard_client.nix
|
|
|
|
./modules/numbering.nix
|
|
|
|
{
|
|
|
|
nixpkgs.overlays = [ radio-conf.overlay."aarch64-linux" decode-server.overlay."aarch64-linux" ];
|
|
|
|
dvb-dump.systemNumber = 99;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
} //
|
|
|
|
{
|
|
|
|
data-hoarder = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = { inherit inputs; };
|
|
|
|
modules = [
|
|
|
|
./hosts/data-hoarder/configuration.nix
|
|
|
|
./modules/data-accumulator.nix
|
|
|
|
./modules/nginx.nix
|
|
|
|
./modules/wireguard_server.nix
|
|
|
|
{
|
|
|
|
nixpkgs.overlays = [ data-accumulator.overlay."x86_64-linux" ];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2022-04-23 23:49:00 +02:00
|
|
|
};
|
2022-04-29 11:52:57 +02:00
|
|
|
|
2022-04-30 23:41:24 +02:00
|
|
|
hydraJobs = {
|
2022-04-29 11:52:57 +02:00
|
|
|
data-hoarder."x86_64-linux" = self.nixosConfigurations.data-hoarder.config.system.build.toplevel;
|
2022-04-29 22:15:32 +02:00
|
|
|
traffic-stop-box-0."x86_64-linux" = self.nixosConfigurations.traffic-stop-box-0.config.system.build.toplevel;
|
2022-04-30 23:55:05 +02:00
|
|
|
traffic-stop-box-99."aarch64-linux" = self.nixosConfigurations.traffic-stop-box-99.config.system.build.sdImage;
|
2022-04-29 11:52:57 +02:00
|
|
|
};
|
2022-04-23 03:01:58 +02:00
|
|
|
};
|
|
|
|
}
|
2022-04-29 11:52:57 +02:00
|
|
|
|
|
|
|
|