2022-05-30 17:32:35 +00:00
|
|
|
{
|
|
|
|
description = "Submission server/infrastructure for the SRS challenge at FIC";
|
|
|
|
|
|
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
|
|
|
|
|
|
inputs.flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, ... }:
|
|
|
|
let
|
|
|
|
|
|
|
|
# Generate a version based on date
|
|
|
|
version = builtins.substring 0 12 self.lastModifiedDate;
|
2022-08-06 20:31:18 +00:00
|
|
|
vendorSha256 = "sha256-itCvN/Z8DkUUdtx6At+4DyeJK8PgFJ/5A3G03VT4I2k";
|
2022-08-26 22:42:09 +00:00
|
|
|
overrideModAttrs = _ : { name = "fic-./.-${version}-go-modules"; };
|
2022-05-30 17:32:35 +00:00
|
|
|
|
|
|
|
# System types to support.
|
|
|
|
supportedSystems =
|
|
|
|
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" "arm-linux" ];
|
|
|
|
|
|
|
|
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
|
|
|
|
# Nixpkgs instantiated for supported system types.
|
|
|
|
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
# Provide some binary packages for selected system types.
|
|
|
|
packages = forAllSystems (system:
|
|
|
|
let pkgs = nixpkgsFor.${system};
|
|
|
|
in {
|
|
|
|
fic-admin = pkgs.buildGoModule {
|
|
|
|
pname = "admin";
|
2022-08-26 22:42:09 +00:00
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
2022-05-30 17:32:35 +00:00
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
subPackages = [ "admin" ];
|
|
|
|
};
|
|
|
|
|
2023-07-10 07:17:02 +00:00
|
|
|
fic-checker = pkgs.buildGoModule {
|
|
|
|
pname = "checker";
|
2022-08-26 22:42:09 +00:00
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
2022-05-30 17:32:35 +00:00
|
|
|
src = ./.;
|
|
|
|
|
2023-07-10 07:17:02 +00:00
|
|
|
subPackages = [ "checker" ];
|
2022-05-30 17:32:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fic-dashboard = pkgs.buildGoModule {
|
|
|
|
pname = "dashboard";
|
2022-08-26 22:42:09 +00:00
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
2022-05-30 17:32:35 +00:00
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
subPackages = [ "dashboard" ];
|
|
|
|
};
|
|
|
|
|
2023-07-10 07:17:02 +00:00
|
|
|
fic-generator = pkgs.buildGoModule {
|
|
|
|
pname = "generator";
|
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
subPackages = [ "generator" ];
|
|
|
|
};
|
|
|
|
|
2022-08-06 20:31:18 +00:00
|
|
|
fic-synchro = pkgs.writeShellApplication {
|
|
|
|
name = "synchro";
|
|
|
|
runtimeInputs = [ pkgs.rsync pkgs.openssh pkgs.coreutils ];
|
|
|
|
text = ''
|
|
|
|
${(builtins.readFile ./configs/synchro.sh)}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
fic-configs = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "configs";
|
|
|
|
src = ./.;
|
|
|
|
installPhase = "mkdir -p $out/; cp -r configs/ $out/";
|
|
|
|
};
|
|
|
|
|
2023-07-09 18:40:53 +00:00
|
|
|
fic-receiver = pkgs.buildGoModule {
|
|
|
|
pname = "receiver";
|
2022-08-26 22:42:09 +00:00
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
2022-05-30 17:32:35 +00:00
|
|
|
src = ./.;
|
|
|
|
|
2023-07-09 18:40:53 +00:00
|
|
|
subPackages = [ "receiver" ];
|
2022-05-30 17:32:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fic-qa = pkgs.buildGoModule {
|
|
|
|
pname = "qa";
|
2022-08-26 22:42:09 +00:00
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
2022-05-30 17:32:35 +00:00
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
subPackages = [ "qa" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
fic-remote-scores-sync-zqds = pkgs.buildGoModule {
|
|
|
|
pname = "scores-sync-zqds";
|
2022-08-26 22:42:09 +00:00
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
2022-05-30 17:32:35 +00:00
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
subPackages = [ "remote/scores-sync-zqds" ];
|
|
|
|
};
|
|
|
|
|
2023-04-01 12:44:50 +00:00
|
|
|
fic-remote-challenge-sync-airbus = pkgs.buildGoModule {
|
|
|
|
pname = "challenge-sync-airbus";
|
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
subPackages = [ "remote/challenge-sync-airbus" ];
|
|
|
|
};
|
|
|
|
|
2022-05-30 17:32:35 +00:00
|
|
|
fic-repochecker = pkgs.buildGoModule {
|
|
|
|
pname = "repochecker";
|
2022-08-26 22:42:09 +00:00
|
|
|
inherit version vendorSha256 overrideModAttrs;
|
2022-05-30 17:32:35 +00:00
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
subPackages = [ "repochecker" ];
|
|
|
|
};
|
2022-08-23 23:40:00 +00:00
|
|
|
all = pkgs.linkFarmFromDrvs "fic-all" (builtins.attrValues (builtins.removeAttrs self.packages.x86_64-linux [ "all" ]));
|
2022-05-30 17:32:35 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
devShell = forAllSystems (system:
|
|
|
|
let pkgs = nixpkgsFor.${system};
|
|
|
|
in pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [ go ];
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|