commit 9ff3f87a44ff343258d2d45dd6941bf159c13a04
parent 078bb331a515fd6b85e46e6abc5f179a0115d709
Author: Vincent Demeester <vincent@sbr.pm>
Date: Sun, 26 Apr 2020 16:35:10 +0200
Add .mrconfig for sources
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
4 files changed, 91 insertions(+), 34 deletions(-)
diff --git a/modules/profiles/assets/lib.mr b/modules/profiles/assets/lib.mr
@@ -0,0 +1,23 @@
+# -*- mode: sh -*-
+[DEFAULT]
+lib =
+ BASE="${HOME}/src/"
+ my_git_clone() {
+ URL="${BASE_HOST}${MR_REPO//${BASE}${BASE_HOST}/}.git"
+ git clone $URL $MR_REPO
+ }
+
+checkout = my_git_clone
+git_gc = git gc "$@"
+# git_u = git pull --rebase --autostash "$@"
+git_u =
+ git fetch -p --all
+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+ echo "On $CURRENT_BRANCH"
+ git stash
+ REMOTE="upstream"
+ git config remote.upstream.url || REMOTE="origin"
+ echo "Rebase ${REMOTE}/master on master"
+ git rebase ${REMOTE}/master master
+ git co $CURRENT_BRANCH
+skip = [ $1 = "clone" ] && lazy
diff --git a/modules/profiles/assets/src.github.mr b/modules/profiles/assets/src.github.mr
@@ -0,0 +1,11 @@
+include = cat ${HOME}/.config/mr
+
+[DEFAULT]
+lib =
+ export BASE_HOST="github.com"
+
+[tektoncd/pipeline]
+[tektoncd/triggers]
+[tektoncd/experimental]
+[tektoncd/website]
+[tektoncd/cli]
diff --git a/modules/profiles/assets/src.mr b/modules/profiles/assets/src.mr
@@ -0,0 +1,13 @@
+include = cat ${HOME}/.config/mr
+
+[github.com]
+chain = true
+skip = true
+
+[gitlab.com]
+chain = true
+skip = true
+
+[git.sr.ht]
+chain = true
+skip = true+
\ No newline at end of file
diff --git a/modules/profiles/dev.nix b/modules/profiles/dev.nix
@@ -10,38 +10,47 @@ in
enable = mkEnableOption "Enable development profile";
};
};
- config = mkIf cfg.enable (mkMerge [
- {
- profiles.git.enable = true;
- profiles.emacs.enable = true;
- home.file.".ignore".text = ''
- *.swp
- *~
- **/VENDOR-LICENSE
- '';
- home.packages = with pkgs; [
- binutils
- cmake
- fswatch
- gnumake
- jq
- mercurial
- niv
- ripgrep
- shfmt
- ];
- xdg.configFile."nr/dev" = {
- text = builtins.toJSON [
- {cmd = "yq";} {cmd = "lnav";} {cmd = "miniserve";}
- { cmd = "licensor"; } { cmd = "nix-review"; }
- {cmd = "yamllint"; pkg = "python37Packages.yamllint";}
- {cmd = "nix-prefetch-git"; pkg = "nix-prefetch-scripts";}
- {cmd = "nix-prefetch-hg"; pkg = "nix-prefetch-scripts";}
- {cmd = "http"; pkg = "httpie"; }
- ];
- onChange = "${pkgs.nur.repos.vdemeester.nr}/bin/nr dev";
- };
- services.lorri.enable = true;
- }
- ]);
+ config = mkIf cfg.enable (
+ mkMerge [
+ {
+ profiles.git.enable = true;
+ profiles.emacs.enable = true;
+ home.file.".ignore".text = ''
+ *.swp
+ *~
+ **/VENDOR-LICENSE
+ '';
+ xdg.configFile."mr".source = ./assets/lib.mr;
+ home.file."src/.mrconfig".source = ./assets/src.mr;
+ home.file."src/github.com/.mrconfig".source = ./assets/src.github.mr;
+ home.packages = with pkgs;
+ [
+ binutils
+ cmake
+ fswatch
+ gnumake
+ jq
+ mercurial
+ niv
+ ripgrep
+ shfmt
+ ];
+ xdg.configFile."nr/dev" = {
+ text = builtins.toJSON [
+ { cmd = "yq"; }
+ { cmd = "lnav"; }
+ { cmd = "miniserve"; }
+ { cmd = "licensor"; }
+ { cmd = "nix-review"; }
+ { cmd = "yamllint"; pkg = "python37Packages.yamllint"; }
+ { cmd = "nix-prefetch-git"; pkg = "nix-prefetch-scripts"; }
+ { cmd = "nix-prefetch-hg"; pkg = "nix-prefetch-scripts"; }
+ { cmd = "http"; pkg = "httpie"; }
+ ];
+ onChange = "${pkgs.nur.repos.vdemeester.nr}/bin/nr dev";
+ };
+ services.lorri.enable = true;
+ }
+ ]
+ );
}