This commit is contained in:
parent
48895af3e8
commit
ad41513654
5 changed files with 158 additions and 5 deletions
97
flake.nix
Normal file
97
flake.nix
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
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;
|
||||
vendorSha256 = "sha256-MMOEZ/DcRKulNAgGsZi5pm0cXQnNgGkeqIVSC98pm9c=";
|
||||
|
||||
# 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";
|
||||
inherit version vendorSha256;
|
||||
src = ./.;
|
||||
|
||||
subPackages = [ "admin" ];
|
||||
};
|
||||
|
||||
fic-backend = pkgs.buildGoModule {
|
||||
pname = "backend";
|
||||
inherit version vendorSha256;
|
||||
src = ./.;
|
||||
|
||||
subPackages = [ "backend" ];
|
||||
};
|
||||
|
||||
fic-dashboard = pkgs.buildGoModule {
|
||||
pname = "dashboard";
|
||||
inherit version vendorSha256;
|
||||
src = ./.;
|
||||
|
||||
subPackages = [ "dashboard" ];
|
||||
};
|
||||
|
||||
fic-frontend = pkgs.buildGoModule {
|
||||
pname = "frontend";
|
||||
inherit version vendorSha256;
|
||||
src = ./.;
|
||||
|
||||
subPackages = [ "frontend" ];
|
||||
};
|
||||
|
||||
fic-qa = pkgs.buildGoModule {
|
||||
pname = "qa";
|
||||
inherit version vendorSha256;
|
||||
src = ./.;
|
||||
|
||||
subPackages = [ "qa" ];
|
||||
};
|
||||
|
||||
fic-remote-scores-sync-zqds = pkgs.buildGoModule {
|
||||
pname = "scores-sync-zqds";
|
||||
inherit version vendorSha256;
|
||||
src = ./.;
|
||||
|
||||
subPackages = [ "remote/scores-sync-zqds" ];
|
||||
};
|
||||
|
||||
fic-repochecker = pkgs.buildGoModule {
|
||||
pname = "repochecker";
|
||||
inherit version vendorSha256;
|
||||
src = ./.;
|
||||
|
||||
subPackages = [ "repochecker" ];
|
||||
};
|
||||
});
|
||||
|
||||
devShell = forAllSystems (system:
|
||||
let pkgs = nixpkgsFor.${system};
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [ go ];
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in a new issue