depot/ci-root.nix

61 lines
2.6 KiB
Nix
Raw Permalink Normal View History

# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
2021-09-05 09:21:41 +00:00
{ system ? builtins.currentSystem, ... }:
let
2021-09-05 09:21:41 +00:00
depot = (import ./default.nix { inherit system; });
pkgs = depot.third_party.nixpkgs;
lib = pkgs.lib;
prefixAttrs = prefix: lib.mapAttrsToList (name: value: { name = "${prefix}-${name}"; path = value; });
2020-10-04 00:07:59 +00:00
2021-09-05 09:08:28 +00:00
ciBits = rec {
x86_64-linux = {
machine = depot.ops.nixos.systems;
2024-01-06 22:17:09 +00:00
pkgs = builtins.removeAttrs depot.nix.pkgs [ "grafana-plugins" "windows" "unifiHacked" "nixpkgs-mozilla" "nightlyRust" "nightlyRustPlatform" "baserow" "baserow-oss" "authentik" "factorio-mods" "home-assistant-chip" ];
2021-12-21 00:18:16 +00:00
pkg-baserow = {
2022-11-02 02:08:52 +00:00
inherit (depot.nix.pkgs.baserow) backend web-frontend;
2021-12-21 00:18:16 +00:00
};
2021-12-21 21:58:23 +00:00
pkg-baserow-oss = {
2022-11-02 02:08:52 +00:00
inherit (depot.nix.pkgs.baserow-oss) backend web-frontend;
2021-12-21 21:58:23 +00:00
};
2022-05-13 22:47:45 +00:00
pkg-authentik = {
inherit (depot.nix.pkgs.authentik) docs webui pythonapp goserver server;
};
pkg-grafana-plugins = depot.nix.pkgs.grafana-plugins;
2024-03-25 23:00:01 +00:00
web = builtins.removeAttrs (lib.filterAttrs (n: v: !lib.isFunction v) depot.web) [ "barf" ];
web-barf = {
inherit (depot.web.barf) frontend;
inherit (depot.web.barf.sapi) sapid-wrapper;
};
2021-11-18 22:24:20 +00:00
trains = depot.go.trains.cmd.bins;
other = {
twitterchiver-archiver = depot.go.twitterchiver.archiver;
twitterchiver-archiver-docker = depot.go.twitterchiver.archiver.dockerImage;
twitternuke = depot.go.twitternuke;
systemPathJSON = depot.ops.nixos.systemPathJSON;
inherit (depot.go.nix) bcachegc bcacheup;
};
2022-02-05 17:17:39 +00:00
factorio = depot.ops.factorio;
2022-02-27 19:32:48 +00:00
home-manager = depot.ops.home-manager-ext.built;
2024-10-20 22:20:48 +00:00
rust = depot.rust;
};
aarch64-linux = builtins.removeAttrs x86_64-linux [ "home-manager" "pkg-authentik" "web-barf" ] // {
pkgs = builtins.removeAttrs x86_64-linux.pkgs [ "lutris" "plex-pass" "sheepshaver" "fr24feed" "javaws-env" "copybara" ];
};
x86_64-darwin = {
2024-10-13 18:35:07 +00:00
machine = depot.ops.nix-darwin.systems;
home-manager = {
inherit (depot.ops.home-manager-ext.built) base client;
};
};
2021-09-05 09:08:28 +00:00
aarch64-darwin = x86_64-darwin;
2023-01-17 23:51:04 +00:00
}.${system};
2024-03-25 23:00:01 +00:00
entriesFilter = entries: assert builtins.isList entries; let
notADerivationOrPath = builtins.filter (elem: !lib.isString elem.path && !lib.isDerivation elem.path) entries;
notADerivationOrPath' = map (elem: elem.name) notADerivationOrPath;
in assert lib.assertMsg ((lib.length notADerivationOrPath') == 0) "not a derivation or path: ${toString notADerivationOrPath'}"; entries;
in
2024-03-25 23:00:01 +00:00
pkgs.linkFarm "ci" (entriesFilter (builtins.concatLists (lib.mapAttrsToList prefixAttrs ciBits)))