Commit d6975cd1b0ac

Vincent Demeester <vincent@sbr.pm>
2020-06-01 11:44:36
systems: enable dev on hokkaido…
… and port some dev h-m modules to users/vincent Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 17f164d
modules/profiles/assets/lib.mr
@@ -1,27 +0,0 @@
-# -*- mode: sh -*-
-[DEFAULT]
-lib =
-    BASE="${HOME}/src/"
-    my_git_clone() {
-        USERNAME=${GIT_USERNAME:-git}
-        GIT_PREFIX=${GIT_PREFIX}
-        GIT_BASE=${GIT_BASE:-${BASE_HOST}}
-        URL="${GIT_PREFIX}${USERNAME}@${GIT_BASE}${MR_REPO//${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="origin"
-    if [[ -z "$NO_UPSTREAM_U" ]]; then
-        git config remote.upstream.url && REMOTE="upstream"
-    fi
-    echo "Rebase ${REMOTE}/master on master"
-    git rebase ${REMOTE}/master master
-    git co $CURRENT_BRANCH
-skip = [ $1 != "checkout" ] && lazy
modules/profiles/assets/lib.mr
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/mr/lib.mr
\ No newline at end of file
modules/profiles/assets/src.github.mr
@@ -1,22 +0,0 @@
-include = cat ${HOME}/.config/mr
-
-[DEFAULT]
-lib =
-    export BASE_HOST="github.com"
-    export GIT_BASE="github.com:"
-
-[openshift]
-chain = true
-skip = true
-
-[tektoncd/catalog]
-[tektoncd/cli]
-[tektoncd/community]
-[tektoncd/dashboard]
-[tektoncd/experimental]
-[tektoncd/friends]
-[tektoncd/homebrew-tools]
-[tektoncd/pipeline]
-[tektoncd/plumbing]
-[tektoncd/triggers]
-[tektoncd/website]
modules/profiles/assets/src.github.mr
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/mr/src.github.mr
\ No newline at end of file
modules/profiles/assets/src.github.openshift.mr
@@ -1,18 +0,0 @@
-include = cat ${HOME}/.config/mr
-
-[DEFAULT]
-lib =
-    export BASE_HOST="github.com"
-    export GIT_BASE="github.com:"
-    export NO_UPSTREAM_U=1
-
-[pipelines-catalog]
-[pipelines-docs]
-[pipelines-tutorial]
-[release]
-[tektoncd-catalog]
-[tektoncd-cli]
-[tektoncd-pipeline]
-[tektoncd-pipeline-operator]
-[tektoncd-operator]
-[tektoncd-triggers]
modules/profiles/assets/src.github.openshift.mr
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/mr/src.github.openshift.mr
\ No newline at end of file
modules/profiles/assets/src.knative.dev.mr
@@ -1,19 +0,0 @@
-include = cat ${HOME}/.config/mr
-
-[DEFAULT]
-lib =
-    export BASE_HOST="${HOME}/src/knative.dev/"
-    export GIT_BASE="github.com:knative/"
-
-[build]
-[build-template]
-[caching]
-[client]
-[client-contrib]
-[community]
-[eventing]
-[eventing-contrib]
-[net-kourier]
-[observability]
-[pkg]
-[serving]
\ No newline at end of file
modules/profiles/assets/src.knative.dev.mr
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/mr/src.knative.dev.mr
\ No newline at end of file
modules/profiles/assets/src.mr
@@ -1,21 +0,0 @@
-include = cat ${HOME}/.config/mr
-
-[github.com]
-chain = true
-skip = true
-
-[gitlab.com]
-chain = true
-skip = true
-
-[git.sr.ht]
-chain = true
-skip = true
-
-[knative.dev]
-chain = true
-skip = true
-
-[pkgs.devel.redhat.com]
-chain = true
-skip = true
modules/profiles/assets/src.mr
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/mr/src.mr
\ No newline at end of file
modules/profiles/assets/src.pkgs.devel.redhat.mr
@@ -1,31 +0,0 @@
-include = cat ${HOME}/.config/mr
-
-[DEFAULT]
-lib =
-    export BASE_HOST="pkgs.devel.redhat.com"
-    export GIT_PREFIX="ssh://"
-    export GIT_USERNAME=vdemeest
-
-[containers/openshift-pipelines-bash]
-[containers/openshift-pipelines-catalog-buildah]
-[containers/openshift-pipelines-catalog-oc]
-[containers/openshift-pipelines-controller]
-[containers/openshift-pipelines-creds-init]
-[containers/openshift-pipelines-entrypoint]
-[containers/openshift-pipelines-gcs-fetcher]
-[containers/openshift-pipelines-git-init]
-[containers/openshift-pipelines-gsutil]
-[containers/openshift-pipelines-imagedigestexporter]
-[containers/openshift-pipelines-kubeconfigwriter]
-[containers/openshift-pipelines-nop]
-[containers/openshift-pipelines-operator]
-[containers/openshift-pipelines-operator-dev-operator-metadata]
-[containers/openshift-pipelines-operator-prod-operator-metadata]
-[containers/openshift-pipelines-operator-stage-operator-metadata]
-[containers/openshift-pipelines-pullrequest-init]
-[containers/openshift-pipelines-triggers-controller]
-[containers/openshift-pipelines-triggers-eventlistenersink]
-[containers/openshift-pipelines-triggers-webhook]
-[containers/openshift-pipelines-webhook]
-
-[rpms/tektoncd-cli]
\ No newline at end of file
modules/profiles/assets/src.pkgs.devel.redhat.mr
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/mr/src.pkgs.devel.redhat.mr
\ No newline at end of file
modules/profiles/dev.nix
@@ -33,8 +33,6 @@ in
           gnumake
           jq
           mercurial
-          niv
-          ripgrep
           shfmt
         ];
       xdg.configFile."nr/dev" = {
systems/hokkaido.nix
@@ -37,6 +37,7 @@ in
     avahi.enable = true;
     git.enable = true;
     ssh.enable = true;
+    dev.enable = true;
     users.enable = false;
     users.withMachines = enableHome;
     mail.enable = enableHome;
users/vincent/core/default.nix
@@ -31,4 +31,15 @@
   };
 
   xdg.configFile."nixpkgs/config.nix".text = "{ allowUnfree = true; }";
+  xdg.configFile."nr/default" = {
+    text = builtins.toJSON [
+      { cmd = "ncdu"; }
+      { cmd = "sshfs"; }
+      { cmd = "lspci"; pkg = "pciutils"; }
+      { cmd = "lsusb"; pkg = "usbutils"; }
+      { cmd = "9"; pkg = "plan9port"; }
+      { cmd = "wakeonlan"; pkg = "python36Packages.wakeonlan"; }
+    ];
+    onChange = "${pkgs.my.nr}/bin/nr default";
+  };
 }
users/vincent/desktop/xorg/capture.desktop
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/emacs/capture.desktop
\ No newline at end of file
users/vincent/desktop/xorg/capture.desktop
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Name=Emacs capture
-Exec=capture
-Type=Application
-Terminal=false
-Categories=System;
-Icon=emacs;
\ No newline at end of file
users/vincent/desktop/xorg/ec.desktop
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Name=Emacs (client)
-Exec=ec
-Type=Application
-Terminal=false
-Categories=System;
-Icon=emacs;
users/vincent/desktop/xorg/ec.desktop
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/emacs/ec.desktop
\ No newline at end of file
users/vincent/desktop/xorg/org-protocol.desktop
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Name=org-protocol
-Exec=emacsclient -s /run/user/1000/emacs/org -n %u
-Type=Application
-Terminal=false
-Categories=System;
-MimeType=x-scheme-handler/org-protocol;
users/vincent/desktop/xorg/org-protocol.desktop
@@ -0,0 +1,1 @@
+/home/vincent/src/home/users/vincent/dev/emacs/org-protocol.desktop
\ No newline at end of file
users/vincent/desktop/default.nix
@@ -17,8 +17,13 @@
     aspell
     aspellDicts.en
     aspellDicts.fr
+    hunspell
+    hunspellDicts.en_US-large
+    hunspellDicts.en_GB-ize
+    hunspellDicts.fr-any
     gnome3.defaultIconTheme
     gnome3.gnome_themes_standard
+    wmctrl
     xclip
     xdg-user-dirs
     xdg_utils
users/vincent/dev/emacs/capture.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=Emacs capture
+Exec=capture
+Type=Application
+Terminal=false
+Categories=System;
+Icon=emacs;
\ No newline at end of file
users/vincent/dev/emacs/ec.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=Emacs (client)
+Exec=ec
+Type=Application
+Terminal=false
+Categories=System;
+Icon=emacs;
users/vincent/dev/emacs/org-protocol.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=org-protocol
+Exec=emacsclient -s /run/user/1000/emacs/org -n %u
+Type=Application
+Terminal=false
+Categories=System;
+MimeType=x-scheme-handler/org-protocol;
users/vincent/dev/mr/lib.mr
@@ -0,0 +1,27 @@
+# -*- mode: sh -*-
+[DEFAULT]
+lib =
+    BASE="${HOME}/src/"
+    my_git_clone() {
+        USERNAME=${GIT_USERNAME:-git}
+        GIT_PREFIX=${GIT_PREFIX}
+        GIT_BASE=${GIT_BASE:-${BASE_HOST}}
+        URL="${GIT_PREFIX}${USERNAME}@${GIT_BASE}${MR_REPO//${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="origin"
+    if [[ -z "$NO_UPSTREAM_U" ]]; then
+        git config remote.upstream.url && REMOTE="upstream"
+    fi
+    echo "Rebase ${REMOTE}/master on master"
+    git rebase ${REMOTE}/master master
+    git co $CURRENT_BRANCH
+skip = [ $1 != "checkout" ] && lazy
users/vincent/dev/mr/src.github.mr
@@ -0,0 +1,22 @@
+include = cat ${HOME}/.config/mr
+
+[DEFAULT]
+lib =
+    export BASE_HOST="github.com"
+    export GIT_BASE="github.com:"
+
+[openshift]
+chain = true
+skip = true
+
+[tektoncd/catalog]
+[tektoncd/cli]
+[tektoncd/community]
+[tektoncd/dashboard]
+[tektoncd/experimental]
+[tektoncd/friends]
+[tektoncd/homebrew-tools]
+[tektoncd/pipeline]
+[tektoncd/plumbing]
+[tektoncd/triggers]
+[tektoncd/website]
users/vincent/dev/mr/src.github.openshift.mr
@@ -0,0 +1,18 @@
+include = cat ${HOME}/.config/mr
+
+[DEFAULT]
+lib =
+    export BASE_HOST="github.com"
+    export GIT_BASE="github.com:"
+    export NO_UPSTREAM_U=1
+
+[pipelines-catalog]
+[pipelines-docs]
+[pipelines-tutorial]
+[release]
+[tektoncd-catalog]
+[tektoncd-cli]
+[tektoncd-pipeline]
+[tektoncd-pipeline-operator]
+[tektoncd-operator]
+[tektoncd-triggers]
users/vincent/dev/mr/src.knative.dev.mr
@@ -0,0 +1,19 @@
+include = cat ${HOME}/.config/mr
+
+[DEFAULT]
+lib =
+    export BASE_HOST="${HOME}/src/knative.dev/"
+    export GIT_BASE="github.com:knative/"
+
+[build]
+[build-template]
+[caching]
+[client]
+[client-contrib]
+[community]
+[eventing]
+[eventing-contrib]
+[net-kourier]
+[observability]
+[pkg]
+[serving]
\ No newline at end of file
users/vincent/dev/mr/src.mr
@@ -0,0 +1,21 @@
+include = cat ${HOME}/.config/mr
+
+[github.com]
+chain = true
+skip = true
+
+[gitlab.com]
+chain = true
+skip = true
+
+[git.sr.ht]
+chain = true
+skip = true
+
+[knative.dev]
+chain = true
+skip = true
+
+[pkgs.devel.redhat.com]
+chain = true
+skip = true
users/vincent/dev/mr/src.pkgs.devel.redhat.mr
@@ -0,0 +1,31 @@
+include = cat ${HOME}/.config/mr
+
+[DEFAULT]
+lib =
+    export BASE_HOST="pkgs.devel.redhat.com"
+    export GIT_PREFIX="ssh://"
+    export GIT_USERNAME=vdemeest
+
+[containers/openshift-pipelines-bash]
+[containers/openshift-pipelines-catalog-buildah]
+[containers/openshift-pipelines-catalog-oc]
+[containers/openshift-pipelines-controller]
+[containers/openshift-pipelines-creds-init]
+[containers/openshift-pipelines-entrypoint]
+[containers/openshift-pipelines-gcs-fetcher]
+[containers/openshift-pipelines-git-init]
+[containers/openshift-pipelines-gsutil]
+[containers/openshift-pipelines-imagedigestexporter]
+[containers/openshift-pipelines-kubeconfigwriter]
+[containers/openshift-pipelines-nop]
+[containers/openshift-pipelines-operator]
+[containers/openshift-pipelines-operator-dev-operator-metadata]
+[containers/openshift-pipelines-operator-prod-operator-metadata]
+[containers/openshift-pipelines-operator-stage-operator-metadata]
+[containers/openshift-pipelines-pullrequest-init]
+[containers/openshift-pipelines-triggers-controller]
+[containers/openshift-pipelines-triggers-eventlistenersink]
+[containers/openshift-pipelines-triggers-webhook]
+[containers/openshift-pipelines-webhook]
+
+[rpms/tektoncd-cli]
\ No newline at end of file
users/vincent/dev/default.nix
@@ -0,0 +1,49 @@
+{ pkgs, ... }:
+
+{
+  imports = [
+    emacs.nix
+    go.nix
+    python.nix
+    mr.nix
+    nix.nix
+  ];
+
+  home.extraOutputsToInstall = [ "doc" "info" "devdoc" ];
+
+  home.packages = with pkgs; [
+    binutils
+    cmake
+    fswatch
+    gnumake
+    jq
+    mercurial
+    shfmt
+  ];
+
+  home.file.".ignore".text = ''
+    *.swp
+    *~
+    **/VENDOR-LICENSE
+  '';
+
+  home.file.gdbinit = {
+    target = ".gdbinit";
+    text = ''
+      set auto-load safe-path /
+    '';
+  };
+
+  xdg.configFile."nr/dev" = {
+    text = builtins.toJSON [
+      { cmd = "yq"; }
+      { cmd = "lnav"; }
+      { cmd = "miniserve"; }
+      { cmd = "licensor"; }
+      { cmd = "yamllint"; pkg = "python37Packages.yamllint"; }
+      { cmd = "http"; pkg = "httpie"; }
+    ];
+    onChange = "${pkgs.my.nr}/bin/nr dev";
+  };
+
+}
users/vincent/dev/emacs.nix
@@ -0,0 +1,143 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  capture = pkgs.writeScriptBin "capture" ''
+    #!${pkgs.stdenv.shell}
+    emacsclient -s /run/user/1000/emacs/org -n -F '((name . "capture") (width . 150) (height . 90))' -e '(org-capture)'
+  '';
+  myEmacs = pkgs.emacs27.override { inherit (pkgs) imagemagick; withXwidgets = true; };
+in
+{
+  home.file.".local/share/applications/org-protocol.desktop".source = ./emacs/org-protocol.desktop;
+  home.file.".local/share/applications/ec.desktop".source = ./emacs/ec.desktop;
+  home.file.".local/share/applications/capture.desktop".source = ./emacs/capture.desktop;
+  home.packages = with pkgs; [
+    ditaa
+    graphviz
+    pandoc
+    zip
+    # See if I can hide this under an option
+    capture
+  ];
+  home.sessionVariables = {
+    EDITOR = "et";
+    ALTERNATE_EDITOR = "et";
+  };
+  programs.emacs = {
+    enable = true;
+    package = myEmacs;
+    extraPackages = epkgs: with epkgs; [
+      ace-window
+      aggressive-indent
+      async
+      avy
+      bbdb
+      beginend
+      pkgs.bookmark-plus
+      company
+      company-emoji
+      company-go
+      dash
+      delight
+      dired-collapse
+      dired-git-info
+      dired-quick-sort
+      dired-narrow
+      dired-rsync
+      pkgs.dired-plus
+      direnv
+      dockerfile-mode
+      easy-kill
+      esup
+      expand-region
+      flycheck
+      flycheck-golangci-lint
+      git-annex
+      git-commit
+      gitattributes-mode
+      gitconfig-mode
+      gitignore-mode
+      github-review
+      goto-last-change
+      hardhat
+      helpful
+      highlight
+      highlight-indentation
+      highlight-numbers
+      ibuffer-vc
+      icomplete-vertical
+      iedit
+      json-mode
+      markdown-mode
+      mpdel
+      multiple-cursors
+      nixpkgs-fmt
+      no-littering
+      ob-async
+      ob-go
+      ob-http
+      orderless
+      orgit
+      org-plus-contrib
+      org-capture-pop-frame
+      org-gcal
+      org-ql
+      org-ref
+      org-super-agenda
+      org-web-tools
+      ox-pandoc
+      pandoc-mode
+      projectile
+      projectile-ripgrep
+      pdf-tools
+      python-mode
+      rainbow-delimiters
+      rainbow-mode
+      region-bindings-mode
+      ripgrep
+      rg
+      try
+      visual-fill-column
+      visual-regexp
+      web-mode
+      wgrep
+      with-editor
+      xterm-color
+      yaml-mode
+      darkroom
+      eshell-prompt-extras
+      esh-autosuggest
+      forge
+      go-mode
+      magit
+      magit-annex
+      magit-popup
+      magit-todos
+      minions
+      moody
+      mwim
+      nix-buffer
+      nix-mode
+      org-super-agenda
+      org-tree-slide
+      shr-tag-pre-highlight
+      ssh-config-mode
+      smartparens
+      symbol-overlay
+      undo-tree
+      use-package
+      # Highly experimental
+      vterm
+      gotest
+    ];
+  };
+  services.emacs-server = {
+    enable = true;
+    package = myEmacs;
+    name = "org";
+    shell = pkgs.zsh + "/bin/zsh -i -c";
+    # FIXME do this in the derivation :)
+    extraOptions = "--dump-file=${config.home.homeDirectory}/.config/emacs/emacs.pdmp";
+  };
+}
users/vincent/dev/go.nix
@@ -0,0 +1,37 @@
+{ pkgs, ... }:
+
+{
+  home.sessionVariables = {
+    GOPATH = "${config.home.homeDirectory}";
+  };
+  home.packages = with pkgs; [
+    gcc
+    go
+    godef
+    golangci-lint
+    golint
+    gopkgs
+    go-outline
+    go-symbols
+    delve
+    goimports
+    # vendoring tools
+    dep
+    # misc
+    protobuf
+    my.protobuild
+    my.ram
+    my.sec
+    my.esc
+    my.yaspell
+  ];
+  xdg.configFile."nr/dev.go" = {
+    text = builtins.toJSON [
+      { cmd = "pprof"; chan = "unstable"; }
+      { cmd = "vndr"; chan = "unstable"; }
+      { cmd = "go2nix"; }
+      { cmd = "dep2nix"; }
+    ];
+    onChange = "${pkgs.my.nr}/bin/nr dev.go";
+  };
+}
users/vincent/dev/mr.nix
@@ -0,0 +1,10 @@
+{ pkgs, ... }:
+
+{
+  xdg.configFile."mr".source = ./mr/lib.mr;
+  home.file."src/.mrconfig".source = ./mr/src.mr;
+  home.file."src/knative.dev/.mrconfig".source = ./mr/src.knative.dev.mr;
+  home.file."src/github.com/.mrconfig".source = ./mr/src.github.mr;
+  home.file."src/github.com/openshift/.mrconfig".source = ./mr/src.github.openshift.mr;
+  home.file."src/pkgs.devel.redhat.com/.mrconfig".source = ./mr/src.pkgs.devel.redhat.mr;
+}
users/vincent/dev/nix.nix
@@ -0,0 +1,16 @@
+{ pkgs, ... }:
+
+{
+  home.packages = with pkgs; [
+    niv
+    nixpkgs-fmt
+  ];
+  xdg.configFile."nr/dev.nix" = {
+    text = builtins.toJSON [
+      { cmd = "nix-review"; }
+      { cmd = "nix-prefetch-git"; pkg = "nix-prefetch-scripts"; }
+      { cmd = "nix-prefetch-hg"; pkg = "nix-prefetch-scripts"; }
+    ];
+    onChange = "${pkgs.my.nr}/bin/nr dev.nix";
+  };
+}
users/vincent/dev/python.nix
@@ -0,0 +1,11 @@
+{ pkgs, ... }:
+
+{
+  home.packages = with pkgs; [
+    python3
+    python36Packages.virtualenv
+    python36Packages.pip-tools
+    python36Packages.tox
+    pipenv
+  ];
+}