nixos/hercules-ci-agent: Format with nixpkgs-fmt
This commit is contained in:
parent
a1b1e5a26b
commit
fbabab7b16
|
@ -7,7 +7,6 @@ Platform-specific code is in the respective default.nix files.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ config, lib, options, pkgs, ... }:
|
{ config, lib, options, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
filterAttrs
|
filterAttrs
|
||||||
|
@ -22,7 +21,7 @@ let
|
||||||
cfg =
|
cfg =
|
||||||
config.services.hercules-ci-agent;
|
config.services.hercules-ci-agent;
|
||||||
|
|
||||||
format = pkgs.formats.toml {};
|
format = pkgs.formats.toml { };
|
||||||
|
|
||||||
settingsModule = { config, ... }: {
|
settingsModule = { config, ... }: {
|
||||||
freeformType = format.type;
|
freeformType = format.type;
|
||||||
|
@ -91,32 +90,33 @@ let
|
||||||
then ""
|
then ""
|
||||||
else if lib.versionAtLeast config.nix.package.version "2.3.10"
|
else if lib.versionAtLeast config.nix.package.version "2.3.10"
|
||||||
then ""
|
then ""
|
||||||
else pkgs.stdenv.mkDerivation {
|
else
|
||||||
name = "hercules-ci-check-system-nix-src";
|
pkgs.stdenv.mkDerivation {
|
||||||
inherit (config.nix.package) src patches;
|
name = "hercules-ci-check-system-nix-src";
|
||||||
configurePhase = ":";
|
inherit (config.nix.package) src patches;
|
||||||
buildPhase = ''
|
configurePhase = ":";
|
||||||
echo "Checking in-memory pathInfoCache expiry"
|
buildPhase = ''
|
||||||
if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then
|
echo "Checking in-memory pathInfoCache expiry"
|
||||||
cat 1>&2 <<EOF
|
if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then
|
||||||
|
cat 1>&2 <<EOF
|
||||||
|
|
||||||
You are deploying Hercules CI Agent on a system with an incompatible
|
You are deploying Hercules CI Agent on a system with an incompatible
|
||||||
nix-daemon. Please make sure nix.package is set to a Nix version of at
|
nix-daemon. Please make sure nix.package is set to a Nix version of at
|
||||||
least 2.3.10 or a master version more recent than Mar 12, 2020.
|
least 2.3.10 or a master version more recent than Mar 12, 2020.
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
installPhase = "touch $out";
|
installPhase = "touch $out";
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(mkRenamedOptionModule ["services" "hercules-ci-agent" "extraOptions"] ["services" "hercules-ci-agent" "settings"])
|
(mkRenamedOptionModule [ "services" "hercules-ci-agent" "extraOptions" ] [ "services" "hercules-ci-agent" "settings" ])
|
||||||
(mkRenamedOptionModule ["services" "hercules-ci-agent" "baseDirectory"] ["services" "hercules-ci-agent" "settings" "baseDirectory"])
|
(mkRenamedOptionModule [ "services" "hercules-ci-agent" "baseDirectory" ] [ "services" "hercules-ci-agent" "settings" "baseDirectory" ])
|
||||||
(mkRenamedOptionModule ["services" "hercules-ci-agent" "concurrentTasks"] ["services" "hercules-ci-agent" "settings" "concurrentTasks"])
|
(mkRenamedOptionModule [ "services" "hercules-ci-agent" "concurrentTasks" ] [ "services" "hercules-ci-agent" "settings" "concurrentTasks" ])
|
||||||
(mkRemovedOptionModule ["services" "hercules-ci-agent" "patchNix"] "Nix versions packaged in this version of Nixpkgs don't need a patched nix-daemon to work correctly in Hercules CI Agent clusters.")
|
(mkRemovedOptionModule [ "services" "hercules-ci-agent" "patchNix" ] "Nix versions packaged in this version of Nixpkgs don't need a patched nix-daemon to work correctly in Hercules CI Agent clusters.")
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.hercules-ci-agent = {
|
options.services.hercules-ci-agent = {
|
||||||
|
|
|
@ -7,9 +7,7 @@ Code that is shared with nix-darwin goes in common.nix.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ pkgs, config, lib, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (lib) mkIf mkDefault;
|
inherit (lib) mkIf mkDefault;
|
||||||
|
|
||||||
cfg = config.services.hercules-ci-agent;
|
cfg = config.services.hercules-ci-agent;
|
||||||
|
@ -21,7 +19,7 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
./common.nix
|
||||||
(lib.mkRenamedOptionModule ["services" "hercules-ci-agent" "user"] ["systemd" "services" "hercules-ci-agent" "serviceConfig" "User"])
|
(lib.mkRenamedOptionModule [ "services" "hercules-ci-agent" "user" ] [ "systemd" "services" "hercules-ci-agent" "serviceConfig" "User" ])
|
||||||
];
|
];
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -80,6 +78,6 @@ in
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.groups.hercules-ci-agent = {};
|
users.groups.hercules-ci-agent = { };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user