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:
parent
5ae849d3c5
commit
dfe7024f7e
5 changed files with 65 additions and 0 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -208,6 +208,8 @@ Makefile @thiagokokada
|
||||||
/modules/programs/mpv.nix @tadeokondrak @thiagokokada @chuangzhu
|
/modules/programs/mpv.nix @tadeokondrak @thiagokokada @chuangzhu
|
||||||
/tests/modules/programs/mpv @thiagokokada @chuangzhu
|
/tests/modules/programs/mpv @thiagokokada @chuangzhu
|
||||||
|
|
||||||
|
/modules/programs/mr.nix @nilp0inter
|
||||||
|
|
||||||
/modules/programs/mu.nix @KarlJoad
|
/modules/programs/mu.nix @KarlJoad
|
||||||
|
|
||||||
/modules/programs/mujmap.nix @elizagamedev
|
/modules/programs/mujmap.nix @elizagamedev
|
||||||
|
|
|
@ -159,6 +159,12 @@
|
||||||
github = "mifom";
|
github = "mifom";
|
||||||
githubId = 23462908;
|
githubId = 23462908;
|
||||||
};
|
};
|
||||||
|
nilp0inter = {
|
||||||
|
name = "Roberto Abdelkader Martínez Pérez";
|
||||||
|
email = "robertomartinezp@gmail.com";
|
||||||
|
github = "nilp0inter";
|
||||||
|
githubId = 1224006;
|
||||||
|
};
|
||||||
seylerius = {
|
seylerius = {
|
||||||
email = "sable@seyleri.us";
|
email = "sable@seyleri.us";
|
||||||
name = "Sable Seyler";
|
name = "Sable Seyler";
|
||||||
|
|
|
@ -987,6 +987,13 @@ in
|
||||||
A new module is available: 'services.batsignal'.
|
A new module is available: 'services.batsignal'.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2023-04-19T15:33:07+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.mr'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,7 @@ let
|
||||||
./programs/mercurial.nix
|
./programs/mercurial.nix
|
||||||
./programs/micro.nix
|
./programs/micro.nix
|
||||||
./programs/mpv.nix
|
./programs/mpv.nix
|
||||||
|
./programs/mr.nix
|
||||||
./programs/msmtp.nix
|
./programs/msmtp.nix
|
||||||
./programs/mu.nix
|
./programs/mu.nix
|
||||||
./programs/mujmap.nix
|
./programs/mujmap.nix
|
||||||
|
|
49
modules/programs/mr.nix
Normal file
49
modules/programs/mr.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue