fork/home-manager
git clone https://git.julia.blue/fork/home-manager
7fee13eb
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6credentials = [ 7{ 8realm = "Sonatype Nexus Repository Manager" ; 9host = "example.com" ; 10user = "user" ; 11passwordCommand = "echo password" ; 12} 13{ 14realm = "Sonatype Nexus Repository Manager X" ; 15host = "v2.example.com" ; 16user = "user1" ; 17passwordCommand = "echo password1" ; 18} 19]; 20expectedCredentialsSbt = pkgs . writeText "credentials.sbt" '' 21import scala.sys.process._ 22lazy val credential_0 = "echo password".!!.trim 23credentials += Credentials("Sonatype Nexus Repository Manager", "example.com", "user", credential_0) 24lazy val credential_1 = "echo password1".!!.trim 25credentials += Credentials("Sonatype Nexus Repository Manager X", "v2.example.com", "user1", credential_1) 26'' ; 27credentialsSbtPath = ".sbt/1.0/credentials.sbt" ; 28in { 29config = { 30programs . sbt = { 31enable = true ; 32credentials = credentials ; 33package = pkgs . writeScriptBin "sbt" "" ; 34}; 35 36nmt . script = '' 37assertFileExists "home-files/ ${ credentialsSbtPath } " 38assertFileContent " home-files/ ${ credentialsSbtPath } " " ${ expectedCredentialsSbt } " 39'' ; 40}; 41}