fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4let 5cfg = config . programs . tiny ; 6format = pkgs . formats . yaml { }; 7configDir = if pkgs . stdenv . isDarwin then 8"Library/Application Support/tiny" 9else 10" ${ config . xdg . configHome } /tiny" ; 11in { 12meta . maintainers = [ hm . maintainers . kmaasrud ]; 13 14options = { 15programs . tiny = { 16enable = mkEnableOption "tiny, a TUI IRC client written in Rust" ; 17 18package = mkOption { 19type = types . package ; 20default = pkgs . tiny ; 21defaultText = literalExpression "pkgs.tiny" ; 22description = "The {command}`tiny` package to install." ; 23}; 24 25settings = mkOption { 26type = format . type ; 27default = { }; 28defaultText = literalExpression "{ }" ; 29example = literalExpression '' 30{ 31servers = [ 32{ 33addr = "irc.libera.chat"; 34port = 6697; 35tls = true; 36realname = "John Doe"; 37nicks = [ "tinyuser" ]; 38} 39]; 40defaults = { 41nicks = [ "tinyuser" ]; 42realname = "John Doe"; 43join = []; 44tls = true; 45}; 46}; 47'' ; 48description = '' 49Configuration written to 50{file}`$XDG_CONFIG_HOME/tiny/config.yml`. See 51<https://github.com/osa1/tiny/blob/master/crates/tiny/config.yml> 52for the default configuration. 53'' ; 54}; 55}; 56}; 57 58config = mkIf cfg . enable { 59home . packages = [ cfg . package ]; 60 61home . file . " ${ configDir } /config.yml" = mkIf ( cfg . settings != { }) { 62source = format . generate "tiny-config" cfg . settings ; 63}; 64}; 65}