Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For now, just try creating a user with sojuctl. Actually connecting an irc client is pretty annoying.
- Loading branch information
1 parent
c1aeff4
commit a736a17
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import ./make-test-python.nix ({ pkgs, lib, ... }: | ||
let | ||
domain = "soju.localdomain"; | ||
user = "testuser"; | ||
pass = "hunter2"; | ||
|
||
tls-cert = pkgs.runCommand "selfSignedCerts" { buildInputs = [ pkgs.openssl ]; } '' | ||
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -days 36500 \ | ||
-subj '/CN=${domain}' -extensions v3_req \ | ||
-addext 'subjectAltName = DNS:*.${domain}' | ||
install -D -t $out key.pem cert.pem | ||
''; | ||
in | ||
{ | ||
name = "soju"; | ||
meta.maintainers = with lib.maintainers; [ Benjamin-L ]; | ||
|
||
nodes.machine = { ... }: { | ||
services.soju = { | ||
enable = true; | ||
adminSocket.enable = true; | ||
hostName = domain; | ||
tlsCertificate = "${tls-cert}/cert.pem"; | ||
tlsCertificateKey = "${tls-cert}/key.pem"; | ||
}; | ||
}; | ||
|
||
testScript = '' | ||
start_all() | ||
machine.wait_for_unit("soju") | ||
machine.wait_for_file("/run/soju/admin") | ||
machine.succeed("sojuctl user create -username ${user} -password ${pass}") | ||
''; | ||
}) |