apply statix simplication

This commit is contained in:
Jörg Thalheim 2023-01-01 15:30:41 +01:00
parent ee8f7e82b8
commit 1ac5f25092
5 changed files with 4 additions and 5 deletions
ci.nix
roles
services/hydra
users

2
ci.nix
View file

@ -4,7 +4,7 @@
}:
let
self = builtins.getFlake (toString ./.);
nixpkgs = self.inputs.nixpkgs;
inherit (self.inputs) nixpkgs;
stripDomain = name: nixpkgs.lib.head (builtins.match "(.*).nix-community.org" name);
in
(nixpkgs.lib.mapAttrs' (name: config: nixpkgs.lib.nameValuePair "nixos-${stripDomain name}" config.config.system.build.toplevel) self.outputs.nixosConfigurations) //

View file

@ -4,7 +4,7 @@ let
owner = "hercules-ci-agent";
sopsFile = ./secrets.yaml;
};
secrets = config.sops.secrets;
inherit (config.sops) secrets;
in
{
sops.secrets."binary-caches.json" = herculesSecret;

View file

@ -1,4 +1,3 @@
{ ... }:
{
# Make sure that the firewall is enabled, even if it's the default.
networking.firewall.enable = true;

View file

@ -99,7 +99,7 @@ in
"hydra.nix-community.org" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:${toString (config.services.hydra.port)}";
locations."/".proxyPass = "http://localhost:${toString config.services.hydra.port}";
};
};

View file

@ -9,7 +9,7 @@ in
let
chars = lib.stringToCharacters (builtins.substring 0 4 id);
n = builtins.map (c: lib.mod (ord c) 10) chars;
s = builtins.concatStringsSep "" (builtins.map (i: builtins.toString i) n);
s = builtins.concatStringsSep "" (builtins.map builtins.toString n);
in
assert builtins.stringLength id >= 4;
assert builtins.length chars == 4;