1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

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;
};
}