mr: add module

This commit is contained in:
Roberto Abdelkader Martínez Pérez 2023-03-11 00:10:05 +01:00 committed by Robert Helgesson
parent 5ae849d3c5
commit dfe7024f7e
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
5 changed files with 65 additions and 0 deletions

2
.github/CODEOWNERS vendored
View File

@ -208,6 +208,8 @@ Makefile @thiagokokada
/modules/programs/mpv.nix @tadeokondrak @thiagokokada @chuangzhu
/tests/modules/programs/mpv @thiagokokada @chuangzhu
/modules/programs/mr.nix @nilp0inter
/modules/programs/mu.nix @KarlJoad
/modules/programs/mujmap.nix @elizagamedev

View File

@ -159,6 +159,12 @@
github = "mifom";
githubId = 23462908;
};
nilp0inter = {
name = "Roberto Abdelkader Martínez Pérez";
email = "robertomartinezp@gmail.com";
github = "nilp0inter";
githubId = 1224006;
};
seylerius = {
email = "sable@seyleri.us";
name = "Sable Seyler";

View File

@ -987,6 +987,13 @@ in
A new module is available: 'services.batsignal'.
'';
}
{
time = "2023-04-19T15:33:07+00:00";
message = ''
A new module is available: 'programs.mr'.
'';
}
];
};
}

View File

@ -123,6 +123,7 @@ let
./programs/mercurial.nix
./programs/micro.nix
./programs/mpv.nix
./programs/mr.nix
./programs/msmtp.nix
./programs/mu.nix
./programs/mujmap.nix

49
modules/programs/mr.nix Normal file
View File

@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.mr;
listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { });
iniFormat = pkgs.formats.ini { inherit listToValue; };
in {
meta.maintainers = [ hm.maintainers.nilp0inter ];
options.programs.mr = {
enable = mkEnableOption
"mr, a tool to manage all your version control repositories";
package = mkPackageOption pkgs "mr" { };
settings = mkOption {
type = iniFormat.type;
default = { };
description = ''
Configuration written to <filename>$HOME/.mrconfig</filename>
See <link xlink:href="https://myrepos.branchable.com/"/>
for an example configuration.
'';
example = literalExpression ''
{
foo = {
checkout = "git clone git@github.com:joeyh/foo.git";
update = "git pull --rebase";
};
".local/share/password-store" = {
checkout = "git clone git@github.com:myuser/password-store.git";
};
}
'';
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
home.file.".mrconfig".source = iniFormat.generate ".mrconfig" cfg.settings;
};
}