diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4ad9b375..21a05fe4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -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 diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 83acf991..19fa96b1 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -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"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index c2bbedd4..af413169 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -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'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index a6312bfd..743bcf6d 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -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 diff --git a/modules/programs/mr.nix b/modules/programs/mr.nix new file mode 100644 index 00000000..2e02e7c6 --- /dev/null +++ b/modules/programs/mr.nix @@ -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 $HOME/.mrconfig + See + 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; + }; +} +