mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 19:49:45 +01:00
599e22b1c7
sbt allows overriding the default repositories to use to resolve dependencies. This is often used with proxies and/or private repositories to host internal packages. This change adds a `repositories` attribute to `sbt` to allow specifying the values that will go in `~/.sbt/repositories` file. To support the above change we also deprecate the `baseConfigPath` option in favour of `baseUserConfigPath` which points one level higher by default. This allows not using relative paths to refer to the top-level configuration directory. Also adds tests for the new option and the deprecation of the previous one.
39 lines
778 B
Nix
39 lines
778 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
plugins = [{
|
|
org = "a";
|
|
artifact = "b";
|
|
version = "c";
|
|
}];
|
|
|
|
credentials = [{
|
|
realm = "a";
|
|
host = "b";
|
|
user = "c";
|
|
passwordCommand = "d";
|
|
}];
|
|
|
|
repositories = [ "local" ];
|
|
|
|
baseSbtPath = ".config/sbt";
|
|
in {
|
|
config = {
|
|
programs.sbt = {
|
|
enable = true;
|
|
plugins = plugins;
|
|
credentials = credentials;
|
|
repositories = repositories;
|
|
baseUserConfigPath = ".config/sbt";
|
|
package = pkgs.writeScriptBin "sbt" "";
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists "home-files/${baseSbtPath}/1.0/plugins/plugins.sbt"
|
|
assertFileExists "home-files/${baseSbtPath}/1.0/credentials.sbt"
|
|
assertFileExists "home-files/${baseSbtPath}/repositories"
|
|
'';
|
|
};
|
|
}
|