nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 55 lines 1.5 kB view raw
1{ pkgs, lib, ... }: 2let 3 accessKey = "BKIKJAA5BMMU2RHO6IBB"; 4 secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12"; 5 secretKeyFile = pkgs.writeText "outline-secret-key" '' 6 ${secretKey} 7 ''; 8 rootCredentialsFile = pkgs.writeText "minio-credentials-full" '' 9 MINIO_ROOT_USER=${accessKey} 10 MINIO_ROOT_PASSWORD=${secretKey} 11 ''; 12in 13{ 14 name = "outline"; 15 16 meta.maintainers = lib.teams.cyberus.members; 17 18 node.pkgsReadOnly = false; 19 20 nodes.outline = 21 { pkgs, config, ... }: 22 { 23 nixpkgs.config.allowUnfree = true; 24 environment.systemPackages = [ pkgs.minio-client ]; 25 services.outline = { 26 enable = true; 27 forceHttps = false; 28 storage = { 29 inherit accessKey secretKeyFile; 30 uploadBucketUrl = "http://localhost:9000"; 31 uploadBucketName = "outline"; 32 region = config.services.minio.region; 33 }; 34 }; 35 services.minio = { 36 enable = true; 37 inherit rootCredentialsFile; 38 }; 39 }; 40 41 testScript = '' 42 machine.wait_for_unit("minio.service") 43 machine.wait_for_open_port(9000) 44 45 # Create a test bucket on the server 46 machine.succeed( 47 "mc alias set minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4" 48 ) 49 machine.succeed("mc mb minio/outline") 50 51 outline.wait_for_unit("outline.service") 52 outline.wait_for_open_port(3000) 53 outline.succeed("curl --fail http://localhost:3000/") 54 ''; 55}