server/flake.nix

130 lines
3.8 KiB
Nix
Raw Normal View History

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";
build: reduce nix cache miss. Each pkgs.buildGoModule create a .go-modules sub derivation that is equivalent to the vendor directory (aka it is copied to vendor). Before we have a cache miss because this sub derivation has another name but it is the same (comapared with nix-diff) here we rename this sub derivation to hit the network only once. before: $ nix build .#all --dry-run these 15 derivations will be built: /nix/store/64z5ixzsfd536jkybap6364wlkm4s8jn-admin-202208232340-go-modules.drv /nix/store/hjj8dv97h00y5wfvw4xk0ax4745473zl-frontend-202208232340-go-modules.drv /nix/store/xrx1b6hnvq13qkijqrbw7jsbr3gf5fn8-dashboard-202208232340-go-modules.drv /nix/store/kv0spqnh3il0lgimg7gk40cxh5gspvkp-dashboard-202208232340.drv /nix/store/mpa6f97mrvfq7nd0vrwgsq9z2k3hhzgw-scores-sync-zqds-202208232340-go-modules.drv /nix/store/nl1p2k58rdazvjhpifc76948x5bjwr0f-repochecker-202208232340-go-modules.drv /nix/store/pc290pk0rxhm2vrrbn78f92r3k7mmhzx-backend-202208232340-go-modules.drv /nix/store/p5v7ghgndp78gx7g653kdw4yasyxnlad-backend-202208232340.drv /nix/store/sj3vv4sxva1rkrxrb6k7p66vq1b5nlgq-qa-202208232340-go-modules.drv /nix/store/q3f00kq76iq453awbihgh30r8j9np7g0-qa-202208232340.drv /nix/store/q6zcphpyqlk5yc9r0z9c4lbayvr1rnm6-scores-sync-zqds-202208232340.drv /nix/store/r4bq4b8g0pjn3k0r9wh70divbm9m7m3v-frontend-202208232340.drv /nix/store/wffyj2nbgzi0qmv6iqx0kn0hzzm41i61-repochecker-202208232340.drv /nix/store/yfisx4c6zhqcqyflbj064s0p60930v82-admin-202208232340.drv /nix/store/vk06zp9q2hs6149n363hmk8azfhxr683-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux after: $ nix build .#all --dry-run these 9 derivations will be built: /nix/store/826caq9p8rphffwyrvcpxgrs6p3xla13-fic-.-.-202208232340-go-modules.drv /nix/store/29gr8z8zm1qxd3hg4nfj5zpz39w5239j-qa-202208232340.drv /nix/store/2clvljkrlpfxfrlb4cyk68n8zq5xg3m4-dashboard-202208232340.drv /nix/store/5nz6izdjhsklq354m1fdssbadr2fnpkk-repochecker-202208232340.drv /nix/store/95pzd7y6n99v4dn4xyfi677kmdq536qg-frontend-202208232340.drv /nix/store/i79s2fkj5g75729lg76b2i126m7q36w9-scores-sync-zqds-202208232340.drv /nix/store/q1v7hq02hmqn4nql5rcyiwf6grlrdc4q-admin-202208232340.drv /nix/store/vkid4pr7r6w3glfhfyfg5malp501jkaf-backend-202208232340.drv /nix/store/f94c2m5fq6il03f97lyswcwg15s3c50w-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux
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";
build: reduce nix cache miss. Each pkgs.buildGoModule create a .go-modules sub derivation that is equivalent to the vendor directory (aka it is copied to vendor). Before we have a cache miss because this sub derivation has another name but it is the same (comapared with nix-diff) here we rename this sub derivation to hit the network only once. before: $ nix build .#all --dry-run these 15 derivations will be built: /nix/store/64z5ixzsfd536jkybap6364wlkm4s8jn-admin-202208232340-go-modules.drv /nix/store/hjj8dv97h00y5wfvw4xk0ax4745473zl-frontend-202208232340-go-modules.drv /nix/store/xrx1b6hnvq13qkijqrbw7jsbr3gf5fn8-dashboard-202208232340-go-modules.drv /nix/store/kv0spqnh3il0lgimg7gk40cxh5gspvkp-dashboard-202208232340.drv /nix/store/mpa6f97mrvfq7nd0vrwgsq9z2k3hhzgw-scores-sync-zqds-202208232340-go-modules.drv /nix/store/nl1p2k58rdazvjhpifc76948x5bjwr0f-repochecker-202208232340-go-modules.drv /nix/store/pc290pk0rxhm2vrrbn78f92r3k7mmhzx-backend-202208232340-go-modules.drv /nix/store/p5v7ghgndp78gx7g653kdw4yasyxnlad-backend-202208232340.drv /nix/store/sj3vv4sxva1rkrxrb6k7p66vq1b5nlgq-qa-202208232340-go-modules.drv /nix/store/q3f00kq76iq453awbihgh30r8j9np7g0-qa-202208232340.drv /nix/store/q6zcphpyqlk5yc9r0z9c4lbayvr1rnm6-scores-sync-zqds-202208232340.drv /nix/store/r4bq4b8g0pjn3k0r9wh70divbm9m7m3v-frontend-202208232340.drv /nix/store/wffyj2nbgzi0qmv6iqx0kn0hzzm41i61-repochecker-202208232340.drv /nix/store/yfisx4c6zhqcqyflbj064s0p60930v82-admin-202208232340.drv /nix/store/vk06zp9q2hs6149n363hmk8azfhxr683-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux after: $ nix build .#all --dry-run these 9 derivations will be built: /nix/store/826caq9p8rphffwyrvcpxgrs6p3xla13-fic-.-.-202208232340-go-modules.drv /nix/store/29gr8z8zm1qxd3hg4nfj5zpz39w5239j-qa-202208232340.drv /nix/store/2clvljkrlpfxfrlb4cyk68n8zq5xg3m4-dashboard-202208232340.drv /nix/store/5nz6izdjhsklq354m1fdssbadr2fnpkk-repochecker-202208232340.drv /nix/store/95pzd7y6n99v4dn4xyfi677kmdq536qg-frontend-202208232340.drv /nix/store/i79s2fkj5g75729lg76b2i126m7q36w9-scores-sync-zqds-202208232340.drv /nix/store/q1v7hq02hmqn4nql5rcyiwf6grlrdc4q-admin-202208232340.drv /nix/store/vkid4pr7r6w3glfhfyfg5malp501jkaf-backend-202208232340.drv /nix/store/f94c2m5fq6il03f97lyswcwg15s3c50w-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux
2022-08-26 22:42:09 +00:00
inherit version vendorSha256 overrideModAttrs;
2022-05-30 17:32:35 +00:00
src = ./.;
subPackages = [ "admin" ];
};
fic-checker = pkgs.buildGoModule {
pname = "checker";
build: reduce nix cache miss. Each pkgs.buildGoModule create a .go-modules sub derivation that is equivalent to the vendor directory (aka it is copied to vendor). Before we have a cache miss because this sub derivation has another name but it is the same (comapared with nix-diff) here we rename this sub derivation to hit the network only once. before: $ nix build .#all --dry-run these 15 derivations will be built: /nix/store/64z5ixzsfd536jkybap6364wlkm4s8jn-admin-202208232340-go-modules.drv /nix/store/hjj8dv97h00y5wfvw4xk0ax4745473zl-frontend-202208232340-go-modules.drv /nix/store/xrx1b6hnvq13qkijqrbw7jsbr3gf5fn8-dashboard-202208232340-go-modules.drv /nix/store/kv0spqnh3il0lgimg7gk40cxh5gspvkp-dashboard-202208232340.drv /nix/store/mpa6f97mrvfq7nd0vrwgsq9z2k3hhzgw-scores-sync-zqds-202208232340-go-modules.drv /nix/store/nl1p2k58rdazvjhpifc76948x5bjwr0f-repochecker-202208232340-go-modules.drv /nix/store/pc290pk0rxhm2vrrbn78f92r3k7mmhzx-backend-202208232340-go-modules.drv /nix/store/p5v7ghgndp78gx7g653kdw4yasyxnlad-backend-202208232340.drv /nix/store/sj3vv4sxva1rkrxrb6k7p66vq1b5nlgq-qa-202208232340-go-modules.drv /nix/store/q3f00kq76iq453awbihgh30r8j9np7g0-qa-202208232340.drv /nix/store/q6zcphpyqlk5yc9r0z9c4lbayvr1rnm6-scores-sync-zqds-202208232340.drv /nix/store/r4bq4b8g0pjn3k0r9wh70divbm9m7m3v-frontend-202208232340.drv /nix/store/wffyj2nbgzi0qmv6iqx0kn0hzzm41i61-repochecker-202208232340.drv /nix/store/yfisx4c6zhqcqyflbj064s0p60930v82-admin-202208232340.drv /nix/store/vk06zp9q2hs6149n363hmk8azfhxr683-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux after: $ nix build .#all --dry-run these 9 derivations will be built: /nix/store/826caq9p8rphffwyrvcpxgrs6p3xla13-fic-.-.-202208232340-go-modules.drv /nix/store/29gr8z8zm1qxd3hg4nfj5zpz39w5239j-qa-202208232340.drv /nix/store/2clvljkrlpfxfrlb4cyk68n8zq5xg3m4-dashboard-202208232340.drv /nix/store/5nz6izdjhsklq354m1fdssbadr2fnpkk-repochecker-202208232340.drv /nix/store/95pzd7y6n99v4dn4xyfi677kmdq536qg-frontend-202208232340.drv /nix/store/i79s2fkj5g75729lg76b2i126m7q36w9-scores-sync-zqds-202208232340.drv /nix/store/q1v7hq02hmqn4nql5rcyiwf6grlrdc4q-admin-202208232340.drv /nix/store/vkid4pr7r6w3glfhfyfg5malp501jkaf-backend-202208232340.drv /nix/store/f94c2m5fq6il03f97lyswcwg15s3c50w-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux
2022-08-26 22:42:09 +00:00
inherit version vendorSha256 overrideModAttrs;
2022-05-30 17:32:35 +00:00
src = ./.;
subPackages = [ "checker" ];
2022-05-30 17:32:35 +00:00
};
fic-dashboard = pkgs.buildGoModule {
pname = "dashboard";
build: reduce nix cache miss. Each pkgs.buildGoModule create a .go-modules sub derivation that is equivalent to the vendor directory (aka it is copied to vendor). Before we have a cache miss because this sub derivation has another name but it is the same (comapared with nix-diff) here we rename this sub derivation to hit the network only once. before: $ nix build .#all --dry-run these 15 derivations will be built: /nix/store/64z5ixzsfd536jkybap6364wlkm4s8jn-admin-202208232340-go-modules.drv /nix/store/hjj8dv97h00y5wfvw4xk0ax4745473zl-frontend-202208232340-go-modules.drv /nix/store/xrx1b6hnvq13qkijqrbw7jsbr3gf5fn8-dashboard-202208232340-go-modules.drv /nix/store/kv0spqnh3il0lgimg7gk40cxh5gspvkp-dashboard-202208232340.drv /nix/store/mpa6f97mrvfq7nd0vrwgsq9z2k3hhzgw-scores-sync-zqds-202208232340-go-modules.drv /nix/store/nl1p2k58rdazvjhpifc76948x5bjwr0f-repochecker-202208232340-go-modules.drv /nix/store/pc290pk0rxhm2vrrbn78f92r3k7mmhzx-backend-202208232340-go-modules.drv /nix/store/p5v7ghgndp78gx7g653kdw4yasyxnlad-backend-202208232340.drv /nix/store/sj3vv4sxva1rkrxrb6k7p66vq1b5nlgq-qa-202208232340-go-modules.drv /nix/store/q3f00kq76iq453awbihgh30r8j9np7g0-qa-202208232340.drv /nix/store/q6zcphpyqlk5yc9r0z9c4lbayvr1rnm6-scores-sync-zqds-202208232340.drv /nix/store/r4bq4b8g0pjn3k0r9wh70divbm9m7m3v-frontend-202208232340.drv /nix/store/wffyj2nbgzi0qmv6iqx0kn0hzzm41i61-repochecker-202208232340.drv /nix/store/yfisx4c6zhqcqyflbj064s0p60930v82-admin-202208232340.drv /nix/store/vk06zp9q2hs6149n363hmk8azfhxr683-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux after: $ nix build .#all --dry-run these 9 derivations will be built: /nix/store/826caq9p8rphffwyrvcpxgrs6p3xla13-fic-.-.-202208232340-go-modules.drv /nix/store/29gr8z8zm1qxd3hg4nfj5zpz39w5239j-qa-202208232340.drv /nix/store/2clvljkrlpfxfrlb4cyk68n8zq5xg3m4-dashboard-202208232340.drv /nix/store/5nz6izdjhsklq354m1fdssbadr2fnpkk-repochecker-202208232340.drv /nix/store/95pzd7y6n99v4dn4xyfi677kmdq536qg-frontend-202208232340.drv /nix/store/i79s2fkj5g75729lg76b2i126m7q36w9-scores-sync-zqds-202208232340.drv /nix/store/q1v7hq02hmqn4nql5rcyiwf6grlrdc4q-admin-202208232340.drv /nix/store/vkid4pr7r6w3glfhfyfg5malp501jkaf-backend-202208232340.drv /nix/store/f94c2m5fq6il03f97lyswcwg15s3c50w-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux
2022-08-26 22:42:09 +00:00
inherit version vendorSha256 overrideModAttrs;
2022-05-30 17:32:35 +00:00
src = ./.;
subPackages = [ "dashboard" ];
};
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";
build: reduce nix cache miss. Each pkgs.buildGoModule create a .go-modules sub derivation that is equivalent to the vendor directory (aka it is copied to vendor). Before we have a cache miss because this sub derivation has another name but it is the same (comapared with nix-diff) here we rename this sub derivation to hit the network only once. before: $ nix build .#all --dry-run these 15 derivations will be built: /nix/store/64z5ixzsfd536jkybap6364wlkm4s8jn-admin-202208232340-go-modules.drv /nix/store/hjj8dv97h00y5wfvw4xk0ax4745473zl-frontend-202208232340-go-modules.drv /nix/store/xrx1b6hnvq13qkijqrbw7jsbr3gf5fn8-dashboard-202208232340-go-modules.drv /nix/store/kv0spqnh3il0lgimg7gk40cxh5gspvkp-dashboard-202208232340.drv /nix/store/mpa6f97mrvfq7nd0vrwgsq9z2k3hhzgw-scores-sync-zqds-202208232340-go-modules.drv /nix/store/nl1p2k58rdazvjhpifc76948x5bjwr0f-repochecker-202208232340-go-modules.drv /nix/store/pc290pk0rxhm2vrrbn78f92r3k7mmhzx-backend-202208232340-go-modules.drv /nix/store/p5v7ghgndp78gx7g653kdw4yasyxnlad-backend-202208232340.drv /nix/store/sj3vv4sxva1rkrxrb6k7p66vq1b5nlgq-qa-202208232340-go-modules.drv /nix/store/q3f00kq76iq453awbihgh30r8j9np7g0-qa-202208232340.drv /nix/store/q6zcphpyqlk5yc9r0z9c4lbayvr1rnm6-scores-sync-zqds-202208232340.drv /nix/store/r4bq4b8g0pjn3k0r9wh70divbm9m7m3v-frontend-202208232340.drv /nix/store/wffyj2nbgzi0qmv6iqx0kn0hzzm41i61-repochecker-202208232340.drv /nix/store/yfisx4c6zhqcqyflbj064s0p60930v82-admin-202208232340.drv /nix/store/vk06zp9q2hs6149n363hmk8azfhxr683-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux after: $ nix build .#all --dry-run these 9 derivations will be built: /nix/store/826caq9p8rphffwyrvcpxgrs6p3xla13-fic-.-.-202208232340-go-modules.drv /nix/store/29gr8z8zm1qxd3hg4nfj5zpz39w5239j-qa-202208232340.drv /nix/store/2clvljkrlpfxfrlb4cyk68n8zq5xg3m4-dashboard-202208232340.drv /nix/store/5nz6izdjhsklq354m1fdssbadr2fnpkk-repochecker-202208232340.drv /nix/store/95pzd7y6n99v4dn4xyfi677kmdq536qg-frontend-202208232340.drv /nix/store/i79s2fkj5g75729lg76b2i126m7q36w9-scores-sync-zqds-202208232340.drv /nix/store/q1v7hq02hmqn4nql5rcyiwf6grlrdc4q-admin-202208232340.drv /nix/store/vkid4pr7r6w3glfhfyfg5malp501jkaf-backend-202208232340.drv /nix/store/f94c2m5fq6il03f97lyswcwg15s3c50w-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux
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";
build: reduce nix cache miss. Each pkgs.buildGoModule create a .go-modules sub derivation that is equivalent to the vendor directory (aka it is copied to vendor). Before we have a cache miss because this sub derivation has another name but it is the same (comapared with nix-diff) here we rename this sub derivation to hit the network only once. before: $ nix build .#all --dry-run these 15 derivations will be built: /nix/store/64z5ixzsfd536jkybap6364wlkm4s8jn-admin-202208232340-go-modules.drv /nix/store/hjj8dv97h00y5wfvw4xk0ax4745473zl-frontend-202208232340-go-modules.drv /nix/store/xrx1b6hnvq13qkijqrbw7jsbr3gf5fn8-dashboard-202208232340-go-modules.drv /nix/store/kv0spqnh3il0lgimg7gk40cxh5gspvkp-dashboard-202208232340.drv /nix/store/mpa6f97mrvfq7nd0vrwgsq9z2k3hhzgw-scores-sync-zqds-202208232340-go-modules.drv /nix/store/nl1p2k58rdazvjhpifc76948x5bjwr0f-repochecker-202208232340-go-modules.drv /nix/store/pc290pk0rxhm2vrrbn78f92r3k7mmhzx-backend-202208232340-go-modules.drv /nix/store/p5v7ghgndp78gx7g653kdw4yasyxnlad-backend-202208232340.drv /nix/store/sj3vv4sxva1rkrxrb6k7p66vq1b5nlgq-qa-202208232340-go-modules.drv /nix/store/q3f00kq76iq453awbihgh30r8j9np7g0-qa-202208232340.drv /nix/store/q6zcphpyqlk5yc9r0z9c4lbayvr1rnm6-scores-sync-zqds-202208232340.drv /nix/store/r4bq4b8g0pjn3k0r9wh70divbm9m7m3v-frontend-202208232340.drv /nix/store/wffyj2nbgzi0qmv6iqx0kn0hzzm41i61-repochecker-202208232340.drv /nix/store/yfisx4c6zhqcqyflbj064s0p60930v82-admin-202208232340.drv /nix/store/vk06zp9q2hs6149n363hmk8azfhxr683-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux after: $ nix build .#all --dry-run these 9 derivations will be built: /nix/store/826caq9p8rphffwyrvcpxgrs6p3xla13-fic-.-.-202208232340-go-modules.drv /nix/store/29gr8z8zm1qxd3hg4nfj5zpz39w5239j-qa-202208232340.drv /nix/store/2clvljkrlpfxfrlb4cyk68n8zq5xg3m4-dashboard-202208232340.drv /nix/store/5nz6izdjhsklq354m1fdssbadr2fnpkk-repochecker-202208232340.drv /nix/store/95pzd7y6n99v4dn4xyfi677kmdq536qg-frontend-202208232340.drv /nix/store/i79s2fkj5g75729lg76b2i126m7q36w9-scores-sync-zqds-202208232340.drv /nix/store/q1v7hq02hmqn4nql5rcyiwf6grlrdc4q-admin-202208232340.drv /nix/store/vkid4pr7r6w3glfhfyfg5malp501jkaf-backend-202208232340.drv /nix/store/f94c2m5fq6il03f97lyswcwg15s3c50w-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux
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";
build: reduce nix cache miss. Each pkgs.buildGoModule create a .go-modules sub derivation that is equivalent to the vendor directory (aka it is copied to vendor). Before we have a cache miss because this sub derivation has another name but it is the same (comapared with nix-diff) here we rename this sub derivation to hit the network only once. before: $ nix build .#all --dry-run these 15 derivations will be built: /nix/store/64z5ixzsfd536jkybap6364wlkm4s8jn-admin-202208232340-go-modules.drv /nix/store/hjj8dv97h00y5wfvw4xk0ax4745473zl-frontend-202208232340-go-modules.drv /nix/store/xrx1b6hnvq13qkijqrbw7jsbr3gf5fn8-dashboard-202208232340-go-modules.drv /nix/store/kv0spqnh3il0lgimg7gk40cxh5gspvkp-dashboard-202208232340.drv /nix/store/mpa6f97mrvfq7nd0vrwgsq9z2k3hhzgw-scores-sync-zqds-202208232340-go-modules.drv /nix/store/nl1p2k58rdazvjhpifc76948x5bjwr0f-repochecker-202208232340-go-modules.drv /nix/store/pc290pk0rxhm2vrrbn78f92r3k7mmhzx-backend-202208232340-go-modules.drv /nix/store/p5v7ghgndp78gx7g653kdw4yasyxnlad-backend-202208232340.drv /nix/store/sj3vv4sxva1rkrxrb6k7p66vq1b5nlgq-qa-202208232340-go-modules.drv /nix/store/q3f00kq76iq453awbihgh30r8j9np7g0-qa-202208232340.drv /nix/store/q6zcphpyqlk5yc9r0z9c4lbayvr1rnm6-scores-sync-zqds-202208232340.drv /nix/store/r4bq4b8g0pjn3k0r9wh70divbm9m7m3v-frontend-202208232340.drv /nix/store/wffyj2nbgzi0qmv6iqx0kn0hzzm41i61-repochecker-202208232340.drv /nix/store/yfisx4c6zhqcqyflbj064s0p60930v82-admin-202208232340.drv /nix/store/vk06zp9q2hs6149n363hmk8azfhxr683-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux after: $ nix build .#all --dry-run these 9 derivations will be built: /nix/store/826caq9p8rphffwyrvcpxgrs6p3xla13-fic-.-.-202208232340-go-modules.drv /nix/store/29gr8z8zm1qxd3hg4nfj5zpz39w5239j-qa-202208232340.drv /nix/store/2clvljkrlpfxfrlb4cyk68n8zq5xg3m4-dashboard-202208232340.drv /nix/store/5nz6izdjhsklq354m1fdssbadr2fnpkk-repochecker-202208232340.drv /nix/store/95pzd7y6n99v4dn4xyfi677kmdq536qg-frontend-202208232340.drv /nix/store/i79s2fkj5g75729lg76b2i126m7q36w9-scores-sync-zqds-202208232340.drv /nix/store/q1v7hq02hmqn4nql5rcyiwf6grlrdc4q-admin-202208232340.drv /nix/store/vkid4pr7r6w3glfhfyfg5malp501jkaf-backend-202208232340.drv /nix/store/f94c2m5fq6il03f97lyswcwg15s3c50w-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux
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";
build: reduce nix cache miss. Each pkgs.buildGoModule create a .go-modules sub derivation that is equivalent to the vendor directory (aka it is copied to vendor). Before we have a cache miss because this sub derivation has another name but it is the same (comapared with nix-diff) here we rename this sub derivation to hit the network only once. before: $ nix build .#all --dry-run these 15 derivations will be built: /nix/store/64z5ixzsfd536jkybap6364wlkm4s8jn-admin-202208232340-go-modules.drv /nix/store/hjj8dv97h00y5wfvw4xk0ax4745473zl-frontend-202208232340-go-modules.drv /nix/store/xrx1b6hnvq13qkijqrbw7jsbr3gf5fn8-dashboard-202208232340-go-modules.drv /nix/store/kv0spqnh3il0lgimg7gk40cxh5gspvkp-dashboard-202208232340.drv /nix/store/mpa6f97mrvfq7nd0vrwgsq9z2k3hhzgw-scores-sync-zqds-202208232340-go-modules.drv /nix/store/nl1p2k58rdazvjhpifc76948x5bjwr0f-repochecker-202208232340-go-modules.drv /nix/store/pc290pk0rxhm2vrrbn78f92r3k7mmhzx-backend-202208232340-go-modules.drv /nix/store/p5v7ghgndp78gx7g653kdw4yasyxnlad-backend-202208232340.drv /nix/store/sj3vv4sxva1rkrxrb6k7p66vq1b5nlgq-qa-202208232340-go-modules.drv /nix/store/q3f00kq76iq453awbihgh30r8j9np7g0-qa-202208232340.drv /nix/store/q6zcphpyqlk5yc9r0z9c4lbayvr1rnm6-scores-sync-zqds-202208232340.drv /nix/store/r4bq4b8g0pjn3k0r9wh70divbm9m7m3v-frontend-202208232340.drv /nix/store/wffyj2nbgzi0qmv6iqx0kn0hzzm41i61-repochecker-202208232340.drv /nix/store/yfisx4c6zhqcqyflbj064s0p60930v82-admin-202208232340.drv /nix/store/vk06zp9q2hs6149n363hmk8azfhxr683-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux after: $ nix build .#all --dry-run these 9 derivations will be built: /nix/store/826caq9p8rphffwyrvcpxgrs6p3xla13-fic-.-.-202208232340-go-modules.drv /nix/store/29gr8z8zm1qxd3hg4nfj5zpz39w5239j-qa-202208232340.drv /nix/store/2clvljkrlpfxfrlb4cyk68n8zq5xg3m4-dashboard-202208232340.drv /nix/store/5nz6izdjhsklq354m1fdssbadr2fnpkk-repochecker-202208232340.drv /nix/store/95pzd7y6n99v4dn4xyfi677kmdq536qg-frontend-202208232340.drv /nix/store/i79s2fkj5g75729lg76b2i126m7q36w9-scores-sync-zqds-202208232340.drv /nix/store/q1v7hq02hmqn4nql5rcyiwf6grlrdc4q-admin-202208232340.drv /nix/store/vkid4pr7r6w3glfhfyfg5malp501jkaf-backend-202208232340.drv /nix/store/f94c2m5fq6il03f97lyswcwg15s3c50w-fic-all.drv this path will be fetched (0.01 MiB download, 0.04 MiB unpacked): /nix/store/7cifvbmgjm5y9ds5a7c6c861g1xcm1qr-stdenv-linux
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 ];
});
};
}