forked from lix-project/hydra
Merge pull request #1149 from DeterminateSystems/flake-format
flake.nix: format with nixpkgs-fmt
This commit is contained in:
commit
a374ef7d81
76
flake.nix
76
flake.nix
|
@ -16,7 +16,8 @@
|
||||||
# NixOS configuration used for VM tests.
|
# NixOS configuration used for VM tests.
|
||||||
hydraServer =
|
hydraServer =
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{ imports = [ self.nixosModules.hydraTest ];
|
{
|
||||||
|
imports = [ self.nixosModules.hydraTest ];
|
||||||
|
|
||||||
virtualisation.memorySize = 1024;
|
virtualisation.memorySize = 1024;
|
||||||
virtualisation.writableStore = true;
|
virtualisation.writableStore = true;
|
||||||
|
@ -30,7 +31,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
in rec {
|
in
|
||||||
|
rec {
|
||||||
|
|
||||||
# A Nixpkgs overlay that provides a 'hydra' package.
|
# A Nixpkgs overlay that provides a 'hydra' package.
|
||||||
overlay = final: prev: {
|
overlay = final: prev: {
|
||||||
|
@ -522,16 +524,36 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
|
||||||
name = "hydra-${version}";
|
name = "hydra-${version}";
|
||||||
|
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig libpqxx
|
[
|
||||||
gitAndTools.topGit mercurial darcs subversion breezy openssl bzip2 libxslt
|
makeWrapper
|
||||||
final.nix perlDeps perl mdbook pixz
|
autoconf
|
||||||
|
automake
|
||||||
|
libtool
|
||||||
|
unzip
|
||||||
|
nukeReferences
|
||||||
|
pkgconfig
|
||||||
|
libpqxx
|
||||||
|
gitAndTools.topGit
|
||||||
|
mercurial
|
||||||
|
darcs
|
||||||
|
subversion
|
||||||
|
breezy
|
||||||
|
openssl
|
||||||
|
bzip2
|
||||||
|
libxslt
|
||||||
|
final.nix
|
||||||
|
perlDeps
|
||||||
|
perl
|
||||||
|
mdbook
|
||||||
|
pixz
|
||||||
boost
|
boost
|
||||||
postgresql_13
|
postgresql_13
|
||||||
(if lib.versionAtLeast lib.version "20.03pre"
|
(if lib.versionAtLeast lib.version "20.03pre"
|
||||||
|
@ -540,13 +562,34 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
checkInputs = [
|
checkInputs = [
|
||||||
foreman python3 netcat-openbsd glibcLocales cacert
|
cacert
|
||||||
|
foreman
|
||||||
|
glibcLocales
|
||||||
|
netcat-openbsd
|
||||||
|
python3
|
||||||
];
|
];
|
||||||
|
|
||||||
hydraPath = lib.makeBinPath (
|
hydraPath = lib.makeBinPath (
|
||||||
[ subversion openssh final.nix coreutils findutils pixz
|
[
|
||||||
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused breezy
|
subversion
|
||||||
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
|
openssh
|
||||||
|
final.nix
|
||||||
|
coreutils
|
||||||
|
findutils
|
||||||
|
pixz
|
||||||
|
gzip
|
||||||
|
bzip2
|
||||||
|
lzma
|
||||||
|
gnutar
|
||||||
|
unzip
|
||||||
|
git
|
||||||
|
gitAndTools.topGit
|
||||||
|
mercurial
|
||||||
|
darcs
|
||||||
|
gnused
|
||||||
|
breezy
|
||||||
|
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ]
|
||||||
|
);
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
pushd $(git rev-parse --show-toplevel) >/dev/null
|
pushd $(git rev-parse --show-toplevel) >/dev/null
|
||||||
|
@ -713,7 +756,8 @@
|
||||||
networking.firewall.allowedTCPPorts = [ 3000 ];
|
networking.firewall.allowedTCPPorts = [ 3000 ];
|
||||||
};
|
};
|
||||||
skipLint = true;
|
skipLint = true;
|
||||||
testScript = let
|
testScript =
|
||||||
|
let
|
||||||
scripts.mktoken = pkgs.writeText "token.sql" ''
|
scripts.mktoken = pkgs.writeText "token.sql" ''
|
||||||
INSERT INTO access_token (id, uid, name, created_unix, updated_unix, token_hash, token_salt, token_last_eight) VALUES (1, 1, 'hydra', 1617107360, 1617107360, 'a930f319ca362d7b49a4040ac0af74521c3a3c3303a86f327b01994430672d33b6ec53e4ea774253208686c712495e12a486', 'XRjWE9YW0g', '31d3a9c7');
|
INSERT INTO access_token (id, uid, name, created_unix, updated_unix, token_hash, token_salt, token_last_eight) VALUES (1, 1, 'hydra', 1617107360, 1617107360, 'a930f319ca362d7b49a4040ac0af74521c3a3c3303a86f327b01994430672d33b6ec53e4ea774253208686c712495e12a486', 'XRjWE9YW0g', '31d3a9c7');
|
||||||
'';
|
'';
|
||||||
|
@ -820,7 +864,8 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
import json
|
import json
|
||||||
|
|
||||||
machine.start()
|
machine.start()
|
||||||
|
@ -912,6 +957,7 @@
|
||||||
objectClass: dcObject
|
objectClass: dcObject
|
||||||
objectClass: organization
|
objectClass: organization
|
||||||
|
|
||||||
|
|
||||||
dn: ou=users,dc=example
|
dn: ou=users,dc=example
|
||||||
ou: users
|
ou: users
|
||||||
description: All users
|
description: All users
|
||||||
|
@ -1114,9 +1160,11 @@
|
||||||
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules =
|
modules =
|
||||||
[ self.nixosModules.hydraTest
|
[
|
||||||
|
self.nixosModules.hydraTest
|
||||||
self.nixosModules.hydraProxy
|
self.nixosModules.hydraProxy
|
||||||
{ system.configurationRevision = self.rev;
|
{
|
||||||
|
system.configurationRevision = self.rev;
|
||||||
|
|
||||||
boot.isContainer = true;
|
boot.isContainer = true;
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = false;
|
||||||
|
|
Loading…
Reference in a new issue