Commit dd4ffcd2d174

Vincent Demeester <vincent@sbr.pm>
2020-05-11 19:22:36
nixpkgsfmt 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 63a42b6
modules/hardware/sane-extra-config.nixos.nix
@@ -9,18 +9,20 @@ let
     else pkgs.sane-backends;
   backends = [ pkg ] ++ cfg.extraBackends;
   saneConfig = pkgs.mkSaneConfig { paths = backends; };
-  saneExtraConfig = pkgs.runCommand "sane-extra-config" { } ''
+  saneExtraConfig = pkgs.runCommand "sane-extra-config"
+    { } ''
     cp -Lr '${pkgs.mkSaneConfig { paths = [ pkgs.sane-backends ]; }}'/etc/sane.d $out
     chmod +w $out
     ${concatMapStrings
       (
-          c: ''
-            f="$out/${c.name}.conf"
-            [ ! -e "$f" ] || chmod +w "$f"
-            cat ${builtins.toFile "" (c.value + "\n")} >>"$f"
-            chmod -w "$f"
-          ''
-        ) (mapAttrsToList nameValuePair cfg.extraConfig)}
+      c: ''
+        f="$out/${c.name}.conf"
+        [ ! -e "$f" ] || chmod +w "$f"
+        cat ${builtins.toFile "" (c.value + "\n")} >>"$f"
+        chmod -w "$f"
+      ''
+      )
+      (mapAttrsToList nameValuePair cfg.extraConfig)}
     chmod -w $out
   '';
 in
modules/profiles/audio.nix
@@ -18,42 +18,39 @@ in
       };
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      services.shairport-sync.enable = cfg.shairport-sync;
+    }
     (
-      mkMerge [
-        {
-          services.shairport-sync.enable = cfg.shairport-sync;
-        }
-        (
-          mkIf cfg.mpd.enable {
-            services.mpd = {
-              enable = true;
-              musicDirectory = cfg.mpd.musicDir;
-              network.listenAddress = "any";
-              extraConfig = ''
-                audio_output {
-                  type    "pulse"
-                  name    "Local MPD"
-                }
-              '';
-            };
-            services.mpdris2 = {
-              enable = true;
-              mpd.host = "127.0.0.1";
-            };
-            home.packages = with pkgs; [
-              mpc_cli
-              ncmpcpp
-            ];
-          }
-        )
-        (
-          mkIf (cfg.mpd.enable && config.profiles.desktop.enable) {
-            home.packages = with pkgs; [
-              ario
-            ];
-          }
-        )
-      ]
-    );
+      mkIf cfg.mpd.enable {
+        services.mpd = {
+          enable = true;
+          musicDirectory = cfg.mpd.musicDir;
+          network.listenAddress = "any";
+          extraConfig = ''
+            audio_output {
+              type    "pulse"
+              name    "Local MPD"
+            }
+          '';
+        };
+        services.mpdris2 = {
+          enable = true;
+          mpd.host = "127.0.0.1";
+        };
+        home.packages = with pkgs; [
+          mpc_cli
+          ncmpcpp
+        ];
+      }
+    )
+    (
+      mkIf (cfg.mpd.enable && config.profiles.desktop.enable) {
+        home.packages = with pkgs; [
+          ario
+        ];
+      }
+    )
+  ]);
 }
modules/profiles/dev.go.nix
@@ -10,55 +10,52 @@ in
       enable = mkEnableOption "Enable go development profile";
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      home.sessionVariables = {
+        GOPATH = "${config.home.homeDirectory}";
+      };
+      profiles.dev.enable = true;
+      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/go" = {
+        text = builtins.toJSON [
+          { cmd = "pprof"; chan = "unstable"; }
+          { cmd = "vndr"; chan = "unstable"; }
+          { cmd = "go2nix"; }
+          { cmd = "dep2nix"; }
+        ];
+        onChange = "${pkgs.my.nr}/bin/nr go";
+      };
+    }
     (
-      mkMerge [
-        {
-          home.sessionVariables = {
-            GOPATH = "${config.home.homeDirectory}";
-          };
-          profiles.dev.enable = true;
-          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/go" = {
-            text = builtins.toJSON [
-              { cmd = "pprof"; chan = "unstable"; }
-              { cmd = "vndr"; chan = "unstable"; }
-              { cmd = "go2nix"; }
-              { cmd = "dep2nix"; }
-            ];
-            onChange = "${pkgs.my.nr}/bin/nr go";
-          };
-        }
-        (
-          mkIf config.profiles.fish.enable {
-            xdg.configFile."fish/conf.d/go.fish".source = ./assets/fish/go.fish;
-            programs.fish.shellAbbrs = {
-              got = "go test -v";
-              gob = "go build -v";
-              gol = "golangci-lint run";
-            };
-          }
-        )
-      ]
-    );
+      mkIf config.profiles.fish.enable {
+        xdg.configFile."fish/conf.d/go.fish".source = ./assets/fish/go.fish;
+        programs.fish.shellAbbrs = {
+          got = "go test -v";
+          gob = "go build -v";
+          gol = "golangci-lint run";
+        };
+      }
+    )
+  ]);
 }
modules/profiles/dev.java.nix
@@ -16,21 +16,18 @@ in
       idea = mkEnableOption "Install intellij idea";
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      profiles.dev.enable = true;
+      home.packages = with pkgs; [
+        cfg.javaPackage
+        gradle
+      ];
+    }
     (
-      mkMerge [
-        {
-          profiles.dev.enable = true;
-          home.packages = with pkgs; [
-            cfg.javaPackage
-            gradle
-          ];
-        }
-        (
-          mkIf cfg.idea {
-            home.packages = with pkgs; [ jetbrains.idea-ultimate ];
-          }
-        )
-      ]
-    );
+      mkIf cfg.idea {
+        home.packages = with pkgs; [ jetbrains.idea-ultimate ];
+      }
+    )
+  ]);
 }
modules/profiles/dev.js.nix
@@ -10,25 +10,22 @@ in
       enable = mkEnableOption "Enable js development profile";
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      home.file.".npmrc".text = ''
+        prefix = ${config.home.homeDirectory}/.local/npm
+      '';
+      home.packages = with pkgs; [
+        nodejs-10_x
+        yarn
+      ];
+    }
     (
-      mkMerge [
-        {
-          home.file.".npmrc".text = ''
-            prefix = ${config.home.homeDirectory}/.local/npm
-          '';
-          home.packages = with pkgs; [
-            nodejs-10_x
-            yarn
-          ];
-        }
-        (
-          mkIf config.profiles.fish.enable {
-            xdg.configFile."fish/conf.d/js.fish".text = ''
-              set -gx PATH ${config.home.homeDirectory}/.local/npm/bin $PATH
-            '';
-          }
-        )
-      ]
-    );
+      mkIf config.profiles.fish.enable {
+        xdg.configFile."fish/conf.d/js.fish".text = ''
+          set -gx PATH ${config.home.homeDirectory}/.local/npm/bin $PATH
+        '';
+      }
+    )
+  ]);
 }
modules/profiles/dev.nix
@@ -10,51 +10,48 @@ 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
-          '';
-          xdg.configFile."mr".source = ./assets/lib.mr;
-          home.file."src/.mrconfig".source = ./assets/src.mr;
-          home.file."src/knative.dev/.mrconfig".source = ./assets/src.knative.dev.mr;
-          home.file."src/github.com/.mrconfig".source = ./assets/src.github.mr;
-          home.file."src/github.com/openshift/.mrconfig".source = ./assets/src.github.openshift.mr;
-          home.file."src/pkgs.devel.redhat.com/.mrconfig".source = ./assets/src.pkgs.devel.redhat.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.my.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/knative.dev/.mrconfig".source = ./assets/src.knative.dev.mr;
+      home.file."src/github.com/.mrconfig".source = ./assets/src.github.mr;
+      home.file."src/github.com/openshift/.mrconfig".source = ./assets/src.github.openshift.mr;
+      home.file."src/pkgs.devel.redhat.com/.mrconfig".source = ./assets/src.pkgs.devel.redhat.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.my.nr}/bin/nr dev";
+      };
+      services.lorri.enable = true;
+    }
+  ]);
 }
modules/profiles/dev.rust.nix
@@ -10,23 +10,20 @@ in
       enable = mkEnableOption "Enable rust development profile";
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      profiles.dev.enable = true;
+      home.packages = with pkgs; [
+        gcc
+        rustup
+      ];
+    }
     (
-      mkMerge [
-        {
-          profiles.dev.enable = true;
-          home.packages = with pkgs; [
-            gcc
-            rustup
-          ];
-        }
-        (
-          mkIf config.profiles.emacs.enable {
-            home.packages = with pkgs; [
-              rustracer
-            ];
-          }
-        )
-      ]
-    );
+      mkIf config.profiles.emacs.enable {
+        home.packages = with pkgs; [
+          rustracer
+        ];
+      }
+    )
+  ]);
 }
modules/profiles/direnv.nix
@@ -14,39 +14,36 @@ in
       };
     };
   };
-  config = mkIf cfg.enable
-    (
-      mkMerge [
-        {
-          programs.direnv = {
-            enable = true;
-            config = {
-              whitelist = {
-                prefix = [
-                  "${config.home.homeDirectory}/src/github.com/knative"
-                  "${config.home.homeDirectory}/src/github.com/openshift"
-                  "${config.home.homeDirectory}/src/github.com/tektoncd"
-                  "${config.home.homeDirectory}/src/github.com/vdemeester"
-                ];
-              };
-            };
+  config = mkIf cfg.enable (mkMerge [
+    {
+      programs.direnv = {
+        enable = true;
+        config = {
+          whitelist = {
+            prefix = [
+              "${config.home.homeDirectory}/src/github.com/knative"
+              "${config.home.homeDirectory}/src/github.com/openshift"
+              "${config.home.homeDirectory}/src/github.com/tektoncd"
+              "${config.home.homeDirectory}/src/github.com/vdemeester"
+            ];
           };
-        }
-        (
-          mkIf config.profiles.fish.enable {
-            programs.direnv.enableFishIntegration = true;
-          }
-        )
-        (
-          mkIf config.profiles.zsh.enable {
-            programs.direnv.enableZshIntegration = true;
-          }
-        )
-        (
-          mkIf config.profiles.bash.enable {
-            programs.direnv.enableBashIntegration = true;
-          }
-        )
-      ]
-    );
+        };
+      };
+    }
+    (
+      mkIf config.profiles.fish.enable {
+        programs.direnv.enableFishIntegration = true;
+      }
+    )
+    (
+      mkIf config.profiles.zsh.enable {
+        programs.direnv.enableZshIntegration = true;
+      }
+    )
+    (
+      mkIf config.profiles.bash.enable {
+        programs.direnv.enableBashIntegration = true;
+      }
+    )
+  ]);
 }
modules/profiles/docker.nix
@@ -10,25 +10,22 @@ in
       enable = mkEnableOption "Enable docker profile";
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      home.packages = with pkgs; [
+        docker
+        docker-machine
+        docker-machine-kvm
+        docker-machine-kvm2
+        docker-compose
+      ];
+    }
     (
-      mkMerge [
-        {
-          home.packages = with pkgs; [
-            docker
-            docker-machine
-            docker-machine-kvm
-            docker-machine-kvm2
-            docker-compose
-          ];
-        }
-        (
-          mkIf config.profiles.fish.enable {
-            xdg.configFile."fish/conf.d/docker.fish".text = ''
-              # set -gx DOCKER_BUILDKIT 1
-            '';
-          }
-        )
-      ]
-    );
+      mkIf config.profiles.fish.enable {
+        xdg.configFile."fish/conf.d/docker.fish".text = ''
+          # set -gx DOCKER_BUILDKIT 1
+        '';
+      }
+    )
+  ]);
 }
modules/profiles/git.nix
@@ -11,213 +11,210 @@ in
       enable = mkEnableOption "Enable git profile";
     };
   };
-  config = mkIf cfg.enable
-    (
-      mkMerge [
-        {
-          home.packages = with pkgs; [
-            gist
-            git-lfs
-            gitAndTools.git-annex
-            gitAndTools.hub
-            mr
-            my.prm
-            my.ape
-          ];
-          programs.git = {
-            enable = true;
-            package = pkgs.gitAndTools.gitFull;
+  config = mkIf cfg.enable (mkMerge [
+    {
+      home.packages = with pkgs; [
+        gist
+        git-lfs
+        gitAndTools.git-annex
+        gitAndTools.hub
+        mr
+        my.prm
+        my.ape
+      ];
+      programs.git = {
+        enable = true;
+        package = pkgs.gitAndTools.gitFull;
 
-            userName = "Vincent Demeester";
-            userEmail = "vincent@sbr.pm";
+        userName = "Vincent Demeester";
+        userEmail = "vincent@sbr.pm";
 
-            signing = {
-              key = "6EB699A3";
-              signByDefault = false;
-            };
+        signing = {
+          key = "6EB699A3";
+          signByDefault = false;
+        };
 
-            aliases = {
-              b = "branch --color -v";
-              br = "branch";
-              ci = "commit --signoff";
-              co = "checkout";
-              conflicts = "!git ls-files --unmerged | cut -c51- | sort -u | xargs $EDITOR";
-              ca = "commit --amend";
-              wdiff = "diff --color-words";
-              unstage = "reset HEAD";
-              lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative";
-              lga = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --branches --remotes";
-              lol = "log --pretty=oneline --abbrev-commit --graph --decorate";
-              ls-ignored = "ls-files --exclude-standard --ignored --others";
-              resolve = "!git ls-files --unmerged | cut -c51- | sort -u | xargs git add";
-              su = "submodule update --init --recursive";
-              st = "status";
-              w = "status -sb";
-            };
-            attributes = [
-              "*.org   diff=org"
-            ];
-            extraConfig = {
-              core = {
-                editor = "${pkgs.emacs}/bin/emacsclient -t";
-              };
-              color = {
-                status = "auto";
-                diff = "auto";
-                branch = "auto";
-                interactive = "auto";
-                ui = "auto";
-                sh = "auto";
-              };
-              "color.branch" = {
-                current = "cyan reverse";
-                local = "cyan";
-                remote = "green";
-              };
-              "color.diff" = {
-                current = "white reverse";
-                frag = "magenta reverse";
-                old = "red";
-                new = "green";
-              };
-              "color.status" = {
-                added = "green";
-                changed = "yellow";
-                untracked = "red";
-              };
-              "diff.org" = {
-                xfuncname = "\"^\\\\*+.*\"";
-              };
-              forge = {
-                remote = "upstream";
-              };
-              hub = {
-                protocol = true;
-              };
-              pull = {
-                rebase = true;
-              };
-              push = {
-                default = "upstream";
-                recurseSubmodules = "check";
-              };
-              rebase = {
-                autosquash = true;
-              };
-              advice = {
-                statusHints = false;
-                pushNonFastForward = false;
-              };
-              http = {
-                sslCAinfo = "${ca-bundle_crt}";
-                sslverify = true;
-              };
-              github.user = "vdemeester";
-              "filter \"lfs\"" = {
-                clean = "${pkgs.git-lfs}/bin/git-lfs clean -- %f";
-                smudge = "${pkgs.git-lfs}/bin/git-lfs smudge --skip -- %f";
-                required = true;
-              };
-              "url \"git@github.com:\"".insteadOf = "git://github.com/";
-            };
-
-            includes = [
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/github.com/kubernetes/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/k8s.io/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/github.com/knative/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/github.com/tektoncd/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir/i:${config.home.homeDirectory}/src/github.com/google**";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/k8s.io/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/github.com/minishift/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/github.com/operator-framework/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/github.com/openshift**";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/github.com/redhat**";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/github.com/containers/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/gitlab.cee.redhat.com/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/gitlab.corp.redhat.com/";
-              }
-              {
-                path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
-                condition = "gitdir:${config.home.homeDirectory}/src/pkg.devel.redhat.com/";
-              }
-            ];
-            ignores = [
-              "*.elc"
-              "*.vo"
-              "*.aux"
-              "*.v.d"
-              "*.o"
-              "*.a"
-              "*.la"
-              "*.so"
-              "*.dylib"
-              "*.pyc"
-              "*.pyo"
-              ".idea"
-              "*.iml"
-              "*~"
-              "#*#"
-              ".makefile"
-              ".clean"
-            ];
+        aliases = {
+          b = "branch --color -v";
+          br = "branch";
+          ci = "commit --signoff";
+          co = "checkout";
+          conflicts = "!git ls-files --unmerged | cut -c51- | sort -u | xargs $EDITOR";
+          ca = "commit --amend";
+          wdiff = "diff --color-words";
+          unstage = "reset HEAD";
+          lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative";
+          lga = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --branches --remotes";
+          lol = "log --pretty=oneline --abbrev-commit --graph --decorate";
+          ls-ignored = "ls-files --exclude-standard --ignored --others";
+          resolve = "!git ls-files --unmerged | cut -c51- | sort -u | xargs git add";
+          su = "submodule update --init --recursive";
+          st = "status";
+          w = "status -sb";
+        };
+        attributes = [
+          "*.org   diff=org"
+        ];
+        extraConfig = {
+          core = {
+            editor = "${pkgs.emacs}/bin/emacsclient -t";
           };
-          xdg.configFile."git/config.d/redhat.gitconfig".source = ./assets/git/redhat.gitconfig;
-          xdg.configFile."nr/git" = {
-            text = builtins.toJSON [
-              { cmd = "tig"; }
-              { cmd = "grv"; pkg = "gitAndTools.grv"; }
-              { cmd = "git-appraise"; pkg = "gitAndTools.git-appraise"; chan = "unstable"; }
-            ];
-            onChange = "${pkgs.my.nr}/bin/nr git";
+          color = {
+            status = "auto";
+            diff = "auto";
+            branch = "auto";
+            interactive = "auto";
+            ui = "auto";
+            sh = "auto";
           };
-        }
-        (
-          mkIf config.profiles.fish.enable {
-            programs.fish.shellAbbrs = {
-              gs = "git status";
-              gb = "git b";
-              gfr = "git fetch -p --all;and git rebase -S --autostash";
-            };
+          "color.branch" = {
+            current = "cyan reverse";
+            local = "cyan";
+            remote = "green";
+          };
+          "color.diff" = {
+            current = "white reverse";
+            frag = "magenta reverse";
+            old = "red";
+            new = "green";
+          };
+          "color.status" = {
+            added = "green";
+            changed = "yellow";
+            untracked = "red";
+          };
+          "diff.org" = {
+            xfuncname = "\"^\\\\*+.*\"";
+          };
+          forge = {
+            remote = "upstream";
+          };
+          hub = {
+            protocol = true;
+          };
+          pull = {
+            rebase = true;
+          };
+          push = {
+            default = "upstream";
+            recurseSubmodules = "check";
+          };
+          rebase = {
+            autosquash = true;
+          };
+          advice = {
+            statusHints = false;
+            pushNonFastForward = false;
+          };
+          http = {
+            sslCAinfo = "${ca-bundle_crt}";
+            sslverify = true;
+          };
+          github.user = "vdemeester";
+          "filter \"lfs\"" = {
+            clean = "${pkgs.git-lfs}/bin/git-lfs clean -- %f";
+            smudge = "${pkgs.git-lfs}/bin/git-lfs smudge --skip -- %f";
+            required = true;
+          };
+          "url \"git@github.com:\"".insteadOf = "git://github.com/";
+        };
+
+        includes = [
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/github.com/kubernetes/";
           }
-        )
-      ]
-    );
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/k8s.io/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/github.com/knative/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/github.com/tektoncd/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir/i:${config.home.homeDirectory}/src/github.com/google**";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/k8s.io/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/github.com/minishift/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/github.com/operator-framework/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/github.com/openshift**";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/github.com/redhat**";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/github.com/containers/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/gitlab.cee.redhat.com/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/gitlab.corp.redhat.com/";
+          }
+          {
+            path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig";
+            condition = "gitdir:${config.home.homeDirectory}/src/pkg.devel.redhat.com/";
+          }
+        ];
+        ignores = [
+          "*.elc"
+          "*.vo"
+          "*.aux"
+          "*.v.d"
+          "*.o"
+          "*.a"
+          "*.la"
+          "*.so"
+          "*.dylib"
+          "*.pyc"
+          "*.pyo"
+          ".idea"
+          "*.iml"
+          "*~"
+          "#*#"
+          ".makefile"
+          ".clean"
+        ];
+      };
+      xdg.configFile."git/config.d/redhat.gitconfig".source = ./assets/git/redhat.gitconfig;
+      xdg.configFile."nr/git" = {
+        text = builtins.toJSON [
+          { cmd = "tig"; }
+          { cmd = "grv"; pkg = "gitAndTools.grv"; }
+          { cmd = "git-appraise"; pkg = "gitAndTools.git-appraise"; chan = "unstable"; }
+        ];
+        onChange = "${pkgs.my.nr}/bin/nr git";
+      };
+    }
+    (
+      mkIf config.profiles.fish.enable {
+        programs.fish.shellAbbrs = {
+          gs = "git status";
+          gb = "git b";
+          gfr = "git fetch -p --all;and git rebase -S --autostash";
+        };
+      }
+    )
+  ]);
 }
modules/profiles/kubernetes.nix
@@ -26,66 +26,63 @@ in
       };
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      home.file.".local/share/applications/chos4.desktop".source = ../../assets/chos4.desktop;
+      profiles.containers.enable = cfg.containers;
+      home.packages = with pkgs; [
+        #cri-tools
+        kail
+        kustomize
+        kube-prompt
+        kubectx
+        my.oc
+        #my.openshift-install
+        my.operator-sdk
+        my.ko
+        my.kss
+        my.kubernix
+      ];
+    }
     (
-      mkMerge [
-        {
-          home.file.".local/share/applications/chos4.desktop".source = ../../assets/chos4.desktop;
-          profiles.containers.enable = cfg.containers;
-          home.packages = with pkgs; [
-            #cri-tools
-            kail
-            kustomize
-            kube-prompt
-            kubectx
-            my.oc
-            #my.openshift-install
-            my.operator-sdk
-            my.ko
-            my.kss
-            my.kubernix
+      mkIf cfg.nr {
+        xdg.configFile."nr/kubernetes" = {
+          text = builtins.toJSON [
+            { cmd = "kubectl"; }
           ];
-        }
-        (
-          mkIf cfg.nr {
-            xdg.configFile."nr/kubernetes" = {
-              text = builtins.toJSON [
-                { cmd = "kubectl"; }
-              ];
-              onChange = "${pkgs.my.nr}/bin/nr -force kubernetes";
-            };
-          }
-        )
-        (
-          mkIf cfg.krew {
-            home.packages = with pkgs; [ my.krew ];
-          }
-        )
-        (
-          mkIf config.profiles.zsh.enable {
-            home.file."${config.programs.zsh.dotDir}/functions/_kubectl".source = ./assets/zsh/_kubectl;
-          }
-        )
-        (
-          mkIf cfg.minikube.enable {
-            home.packages = with pkgs; [
-              cfg.minikube.package
-              docker-machine-kvm2
-            ];
-          }
-        )
-        (
-          mkIf cfg.kind {
-            home.packages = with pkgs; [
-              kind
-            ];
-          }
-        )
-        (
-          mkIf (!config.profiles.containers.openshift.enable) {
-            home.packages = with pkgs; [ kubectl ];
-          }
-        )
-      ]
-    );
+          onChange = "${pkgs.my.nr}/bin/nr -force kubernetes";
+        };
+      }
+    )
+    (
+      mkIf cfg.krew {
+        home.packages = with pkgs; [ my.krew ];
+      }
+    )
+    (
+      mkIf config.profiles.zsh.enable {
+        home.file."${config.programs.zsh.dotDir}/functions/_kubectl".source = ./assets/zsh/_kubectl;
+      }
+    )
+    (
+      mkIf cfg.minikube.enable {
+        home.packages = with pkgs; [
+          cfg.minikube.package
+          docker-machine-kvm2
+        ];
+      }
+    )
+    (
+      mkIf cfg.kind {
+        home.packages = with pkgs; [
+          kind
+        ];
+      }
+    )
+    (
+      mkIf (!config.profiles.containers.openshift.enable) {
+        home.packages = with pkgs; [ kubectl ];
+      }
+    )
+  ]);
 }
modules/profiles/mails.nix
@@ -20,194 +20,196 @@ in
     };
   };
 
-  config = mkIf cfg.enable
-    (
-      mkMerge [
-        {
+  config =
+    mkIf
+      cfg.enable
+      (
+        mkMerge [
+          {
 
-          accounts.email = {
-            maildirBasePath = "desktop/mails";
-            accounts = {
-              "redhat" = {
-                address = "vdemeest@redhat.com";
-                userName = "vdemeest@redhat.com";
-                realName = "Vincent Demeester";
-                passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/rh.pass -d ${config.home.homeDirectory}/desktop/documents/rh.pass.gpg";
-                imap.host = "imap.gmail.com";
-                smtp.host = "smtp.gmail.com";
-                mbsync = {
-                  enable = true;
-                  create = "both";
-                  expunge = "both";
-                  patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
-                  extraConfig = {
-                    channel = {
-                      Sync = "All";
-                    };
-                    account = {
-                      Timeout = 120;
-                      PipelineDepth = 1;
+            accounts.email = {
+              maildirBasePath = "desktop/mails";
+              accounts = {
+                "redhat" = {
+                  address = "vdemeest@redhat.com";
+                  userName = "vdemeest@redhat.com";
+                  realName = "Vincent Demeester";
+                  passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/rh.pass -d ${config.home.homeDirectory}/desktop/documents/rh.pass.gpg";
+                  imap.host = "imap.gmail.com";
+                  smtp.host = "smtp.gmail.com";
+                  mbsync = {
+                    enable = true;
+                    create = "both";
+                    expunge = "both";
+                    patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
+                    extraConfig = {
+                      channel = {
+                        Sync = "All";
+                      };
+                      account = {
+                        Timeout = 120;
+                        PipelineDepth = 1;
+                      };
                     };
                   };
+                  notmuch.enable = cfg.sync;
+                  astroid.enable = cfg.sync;
+                  msmtp.enable = true;
                 };
-                notmuch.enable = cfg.sync;
-                astroid.enable = cfg.sync;
-                msmtp.enable = true;
-              };
-              "perso" = {
-                address = "vinc.demeester@gmail.com";
-                userName = "vinc.demeester@gmail.com";
-                realName = "Vincent Demeester";
-                passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/perso.pass -d ${config.home.homeDirectory}/desktop/documents/perso.pass.gpg";
-                imap.host = "imap.gmail.com";
-                smtp.host = "smtp.gmail.com";
-                mbsync = {
-                  enable = true;
-                  create = "both";
-                  expunge = "both";
-                  patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
-                  extraConfig = {
-                    channel = {
-                      Sync = "All";
-                    };
-                    account = {
-                      Timeout = 120;
-                      PipelineDepth = 1;
+                "perso" = {
+                  address = "vinc.demeester@gmail.com";
+                  userName = "vinc.demeester@gmail.com";
+                  realName = "Vincent Demeester";
+                  passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/perso.pass -d ${config.home.homeDirectory}/desktop/documents/perso.pass.gpg";
+                  imap.host = "imap.gmail.com";
+                  smtp.host = "smtp.gmail.com";
+                  mbsync = {
+                    enable = true;
+                    create = "both";
+                    expunge = "both";
+                    patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ];
+                    extraConfig = {
+                      channel = {
+                        Sync = "All";
+                      };
+                      account = {
+                        Timeout = 120;
+                        PipelineDepth = 1;
+                      };
                     };
                   };
+                  notmuch.enable = cfg.sync;
+                  astroid.enable = cfg.sync;
+                  msmtp.enable = true;
                 };
-                notmuch.enable = cfg.sync;
-                astroid.enable = cfg.sync;
-                msmtp.enable = true;
-              };
-              "prv" = {
-                primary = true;
-                address = "vincent@demeester.fr";
-                userName = "vincent@demeester.fr";
-                realName = "Vincent Demeester";
-                passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/prv.pass -d ${config.home.homeDirectory}/desktop/documents/prv.pass.gpg";
-                imap.host = "mail.gandi.net";
-                smtp.host = "mail.gandi.net";
-                mbsync = {
-                  enable = true;
-                  create = "both";
-                  expunge = "both";
-                  patterns = [ "*" ];
-                  extraConfig = {
-                    channel = {
-                      Sync = "All";
-                    };
-                    account = {
-                      Timeout = 120;
-                      PipelineDepth = 1;
+                "prv" = {
+                  primary = true;
+                  address = "vincent@demeester.fr";
+                  userName = "vincent@demeester.fr";
+                  realName = "Vincent Demeester";
+                  passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/prv.pass -d ${config.home.homeDirectory}/desktop/documents/prv.pass.gpg";
+                  imap.host = "mail.gandi.net";
+                  smtp.host = "mail.gandi.net";
+                  mbsync = {
+                    enable = true;
+                    create = "both";
+                    expunge = "both";
+                    patterns = [ "*" ];
+                    extraConfig = {
+                      channel = {
+                        Sync = "All";
+                      };
+                      account = {
+                        Timeout = 120;
+                        PipelineDepth = 1;
+                      };
                     };
                   };
+                  notmuch.enable = cfg.sync;
+                  astroid.enable = cfg.sync;
+                  msmtp.enable = true;
                 };
-                notmuch.enable = cfg.sync;
-                astroid.enable = cfg.sync;
-                msmtp.enable = true;
               };
             };
-          };
 
-          home.file."bin/msmtp" = {
-            text = ''
-              #!${pkgs.stdenv.shell}
-              ${pkgs.libnotify}/bin/notify-send "Sending mail ✉️"
-              ${pkgs.msmtp}/bin/msmtp --read-envelope-from $@
-            '';
-            executable = true;
-          };
-
-          programs.msmtp.enable = true;
-
-        }
-
-        (
-          mkIf cfg.sync {
-
-            services.mbsync = {
-              enable = true;
-              preExec = "${config.xdg.configHome}/mbsync/preExec";
-              postExec = "${config.xdg.configHome}/mbsync/postExec";
-              frequency = cfg.frequency;
-            };
-
-            xdg.configFile."mbsync/preExec" = {
+            home.file."bin/msmtp" = {
               text = ''
                 #!${pkgs.stdenv.shell}
-
-                export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc
-                export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug
-
-                ${pkgs.coreutils}/bin/mkdir -p ${config.home.homeDirectory}/desktop/mails/redhat ${config.home.homeDirectory}/desktop/mails/perso
-                ${pkgs.afew}/bin/afew -C  ${config.xdg.configHome}/notmuch/notmuchrc -m -v
+                ${pkgs.libnotify}/bin/notify-send "Sending mail ✉️"
+                ${pkgs.msmtp}/bin/msmtp --read-envelope-from $@
               '';
               executable = true;
             };
 
-            xdg.configFile."mbsync/postExec" = {
-              text = ''
-                #!${pkgs.stdenv.shell}
-
-                export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc
-                export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug
-
-                ${pkgs.notmuch}/bin/notmuch new
-                ${pkgs.afew}/bin/afew -C ${config.xdg.configHome}/notmuch/notmuchrc --tag --new -v
-                # Remove inbox (lower-case)
-                ${pkgs.notmuch}/bin/notmuch tag -inbox -- tag:inbox
-                # Remove Inbox tagged message that are not in an Inbox
-                ${pkgs.notmuch}/bin/notmuch tag -Inbox -- not folder:redhat/Inbox and not folder:perso/Inbox and tag:Inbox
-                ${pkgs.libnotify}/bin/notify-send "Mails synced 📬"
-              '';
-              executable = true;
-            };
-
-            home.file."bin/msync" = {
-              text = ''
-                #!${pkgs.stdenv.shell}
-                ${pkgs.libnotify}/bin/notify-send "Syncing mails 📫️"
-                systemctl --user start mbsync
-              '';
-              executable = true;
-            };
-
-            programs.mbsync.enable = true;
-            programs.notmuch.enable = true;
-
-            programs.afew = {
-              enable = true;
-              extraConfig = ''
-                [SpamFilter]
-                [KillThreadsFilter]
-                [ListMailsFilter]
-                [ArchiveSentMailsFilter]
-                [FolderNameFilter]
-                maildir_separator = /
-
-                [MailMover]
-                folders = perso/Inbox redhat/Inbox
-                rename = true
-
-                perso/Inbox = 'NOT tag:Inbox':"perso/[Gmail]/All Mail"
-                redhat/Inbox = 'NOT tag:Inbox':"redhat/[Gmail]/All Mail"
-              '';
-            };
-
-            programs.astroid = {
-              enable = true;
-              externalEditor = "emacsclient -c";
-              extraConfig = {
-                startup.queries.inbox = "tag:Inbox";
-                startup.queries.inbox_perso = "folder:perso/Inbox";
-                startup.queries.inbox_redhat = "folder:redhat/Inbox";
-              };
-            };
+            programs.msmtp.enable = true;
 
           }
-        )
 
-      ]
-    );
+          (
+            mkIf cfg.sync {
+
+              services.mbsync = {
+                enable = true;
+                preExec = "${config.xdg.configHome}/mbsync/preExec";
+                postExec = "${config.xdg.configHome}/mbsync/postExec";
+                frequency = cfg.frequency;
+              };
+
+              xdg.configFile."mbsync/preExec" = {
+                text = ''
+                  #!${pkgs.stdenv.shell}
+
+                  export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc
+                  export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug
+
+                  ${pkgs.coreutils}/bin/mkdir -p ${config.home.homeDirectory}/desktop/mails/redhat ${config.home.homeDirectory}/desktop/mails/perso
+                  ${pkgs.afew}/bin/afew -C  ${config.xdg.configHome}/notmuch/notmuchrc -m -v
+                '';
+                executable = true;
+              };
+
+              xdg.configFile."mbsync/postExec" = {
+                text = ''
+                  #!${pkgs.stdenv.shell}
+
+                  export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc
+                  export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug
+
+                  ${pkgs.notmuch}/bin/notmuch new
+                  ${pkgs.afew}/bin/afew -C ${config.xdg.configHome}/notmuch/notmuchrc --tag --new -v
+                  # Remove inbox (lower-case)
+                  ${pkgs.notmuch}/bin/notmuch tag -inbox -- tag:inbox
+                  # Remove Inbox tagged message that are not in an Inbox
+                  ${pkgs.notmuch}/bin/notmuch tag -Inbox -- not folder:redhat/Inbox and not folder:perso/Inbox and tag:Inbox
+                  ${pkgs.libnotify}/bin/notify-send "Mails synced 📬"
+                '';
+                executable = true;
+              };
+
+              home.file."bin/msync" = {
+                text = ''
+                  #!${pkgs.stdenv.shell}
+                  ${pkgs.libnotify}/bin/notify-send "Syncing mails 📫️"
+                  systemctl --user start mbsync
+                '';
+                executable = true;
+              };
+
+              programs.mbsync.enable = true;
+              programs.notmuch.enable = true;
+
+              programs.afew = {
+                enable = true;
+                extraConfig = ''
+                  [SpamFilter]
+                  [KillThreadsFilter]
+                  [ListMailsFilter]
+                  [ArchiveSentMailsFilter]
+                  [FolderNameFilter]
+                  maildir_separator = /
+
+                  [MailMover]
+                  folders = perso/Inbox redhat/Inbox
+                  rename = true
+
+                  perso/Inbox = 'NOT tag:Inbox':"perso/[Gmail]/All Mail"
+                  redhat/Inbox = 'NOT tag:Inbox':"redhat/[Gmail]/All Mail"
+                '';
+              };
+
+              programs.astroid = {
+                enable = true;
+                externalEditor = "emacsclient -c";
+                extraConfig = {
+                  startup.queries.inbox = "tag:Inbox";
+                  startup.queries.inbox_perso = "folder:perso/Inbox";
+                  startup.queries.inbox_redhat = "folder:redhat/Inbox";
+                };
+              };
+
+            }
+          )
+
+        ]
+      );
 }
modules/profiles/media.nix
@@ -10,17 +10,14 @@ in
       enable = mkEnableOption "Enable media configuration";
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      home.packages = with pkgs; [ youtube-dl ];
+    }
     (
-      mkMerge [
-        {
-          home.packages = with pkgs; [ youtube-dl ];
-        }
-        (
-          mkIf config.profiles.desktop.enable {
-            home.packages = with pkgs; [ spotify ];
-          }
-        )
-      ]
-    );
+      mkIf config.profiles.desktop.enable {
+        home.packages = with pkgs; [ spotify ];
+      }
+    )
+  ]);
 }
modules/profiles/openshift.nix
@@ -23,25 +23,22 @@ in
       };
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      profiles.containers.kubernetes.enable = true;
+      home.packages = with pkgs; [
+        my.s2i
+        cfg.package
+      ];
+    }
     (
-      mkMerge [
-        {
-          profiles.containers.kubernetes.enable = true;
-          home.packages = with pkgs; [
-            my.s2i
-            cfg.package
-          ];
-        }
-        (
-          mkIf cfg.minishift.enable {
-            home.packages = with pkgs; [
-              cfg.minishift.package
-              docker-machine-kvm
-              docker-machine-kvm2
-            ];
-          }
-        )
-      ]
-    );
+      mkIf cfg.minishift.enable {
+        home.packages = with pkgs; [
+          cfg.minishift.package
+          docker-machine-kvm
+          docker-machine-kvm2
+        ];
+      }
+    )
+  ]);
 }
modules/profiles/virtualization.nixos.nix
@@ -24,47 +24,44 @@ in
       };
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      virtualisation.libvirtd = {
+        enable = true;
+      };
+      environment.systemPackages = with pkgs; [
+        qemu
+        vde2
+        libosinfo
+      ];
+    }
     (
-      mkMerge [
-        {
-          virtualisation.libvirtd = {
-            enable = true;
-          };
-          environment.systemPackages = with pkgs; [
-            qemu
-            vde2
-            libosinfo
-          ];
-        }
-        (
-          mkIf cfg.nested {
-            environment.etc."modprobe.d/kvm.conf".text = ''
-              options kvm_intel nested=1
-            '';
-          }
-        )
-        (
-          mkIf config.profiles.desktop.enable {
-            environment.systemPackages = with pkgs; [ virtmanager ];
-          }
-        )
-        (
-          mkIf cfg.listenTCP {
-            boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
-            virtualisation.libvirtd = {
-              allowedBridges = [ "br1" ];
-              extraConfig = ''
-                listen_tls = 0
-                listen_tcp = 1
-                auth_tcp="none"
-                tcp_port = "16509"
-              '';
-              # extraOptions = [ "--listen" ];
-            };
-            networking.firewall.allowedTCPPorts = [ 16509 ];
-          }
-        )
-      ]
-    );
+      mkIf cfg.nested {
+        environment.etc."modprobe.d/kvm.conf".text = ''
+          options kvm_intel nested=1
+        '';
+      }
+    )
+    (
+      mkIf config.profiles.desktop.enable {
+        environment.systemPackages = with pkgs; [ virtmanager ];
+      }
+    )
+    (
+      mkIf cfg.listenTCP {
+        boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
+        virtualisation.libvirtd = {
+          allowedBridges = [ "br1" ];
+          extraConfig = ''
+            listen_tls = 0
+            listen_tcp = 1
+            auth_tcp="none"
+            tcp_port = "16509"
+          '';
+          # extraOptions = [ "--listen" ];
+        };
+        networking.firewall.allowedTCPPorts = [ 16509 ];
+      }
+    )
+  ]);
 }
modules/profiles/zsh.nix
@@ -14,164 +14,161 @@ in
       };
     };
   };
-  config = mkIf cfg.enable
+  config = mkIf cfg.enable (mkMerge [
+    {
+      home.packages = with pkgs; [
+        zsh-syntax-highlighting
+        nix-zsh-completions
+      ];
+      home.file."${config.programs.zsh.dotDir}/completion.zsh".source = ./assets/zsh/completion.zsh;
+      home.file."${config.programs.zsh.dotDir}/prompt.zsh".source = ./assets/zsh/prompt.zsh;
+      home.file."${config.programs.zsh.dotDir}/functions/j".source = ./assets/zsh/j;
+      programs.zsh = {
+        enable = true;
+        dotDir = ".config/zsh";
+        autocd = true;
+        defaultKeymap = "emacs";
+        enableAutosuggestions = true;
+        history = {
+          size = 100000;
+          expireDuplicatesFirst = true;
+          ignoreDups = true;
+        };
+        localVariables = {
+          EMOJI_CLI_KEYBIND = "^n";
+          EMOJI_CLI_USE_EMOJI = "yes";
+          ZSH_HIGHLIGHT_HIGHLIGHTERS = [ "main" "brackets" "pattern" ];
+        };
+        shellAliases = import ./aliases.shell.nix;
+        plugins = [
+          {
+            name = "emoji-cli";
+            src = pkgs.fetchFromGitHub {
+              owner = "b4b4r07";
+              repo = "emoji-cli";
+              rev = "26e2d67d566bfcc741891c8e063a00e0674abc92";
+              sha256 = "0n88w4k5vaz1iyikpmlzdrrkxmfn91x5s4q405k1fxargr1w6bmx";
+            };
+          }
+          {
+            name = "zsh-z";
+            src = pkgs.fetchFromGitHub {
+              owner = "agkozak";
+              repo = "zsh-z";
+              rev = "5b903f8f5489783ee2a4af668a941b7d9a02efc9";
+              sha256 = "07h6ksiqgqyf5m84hv5xf4jcqrl8q1cj8wd4z52cjmy82kk10fkn";
+            };
+          }
+          {
+            name = "async";
+            src = pkgs.fetchFromGitHub {
+              owner = "mafredri";
+              repo = "zsh-async";
+              rev = "v1.7.0";
+              sha256 = "1jbbypgn0r4pilhv2s2p11vbkkvlnf75wrhxfcvr7bfjpzyp9wbc";
+            };
+          }
+          {
+            name = "zsh-completions";
+            src = pkgs.fetchFromGitHub {
+              owner = "zsh-users";
+              repo = "zsh-completions";
+              rev = "922eee0706acb111e9678ac62ee77801941d6df2";
+              sha256 = "04skzxv8j06f1snsx62qnca5f2183w0wfs5kz78rs8hkcyd6g89w";
+            };
+          }
+          {
+            name = "powerlevel10k";
+            src = pkgs.fetchFromGitHub {
+              owner = "romkatv";
+              repo = "powerlevel10k";
+              rev = "700910cd0421a7d25d2800cefa76eb6d80dc62a8";
+              sha256 = "011ja4r3a8vbcs42js9nri4p8pi8z4ccqxl2qyf52pn3pfnidigj";
+            };
+          }
+          {
+            name = "zsh-nix-shell";
+            src = pkgs.fetchFromGitHub {
+              owner = "chisui";
+              repo = "zsh-nix-shell";
+              rev = "v0.1.0";
+              sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx";
+            };
+          }
+        ];
+        envExtra = ''
+          export GOPATH=${config.home.homeDirectory}
+          export WEBKIT_DISABLE_COMPOSITING_MODE=1;
+          export PATH=$HOME/bin:$PATH
+          if [ -d $HOME/.krew/bin ]; then
+            export PATH=$HOME/.krew/bin:$PATH
+          fi
+        '';
+        loginExtra = ''
+          export GOPATH=${config.home.homeDirectory}
+        '';
+        initExtra = ''
+          path+="$HOME/${config.programs.zsh.dotDir}/functions"
+          fpath+="$HOME/.nix-profile/share/zsh/site-functions"
+          fpath+="$HOME/${config.programs.zsh.dotDir}/functions"
+          for func ($HOME/${config.programs.zsh.dotDir}/functions) autoload -U $func/*(x:t)
+          autoload -Uz select-word-style; select-word-style bash
+          if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi
+          #if [ -n "$INSIDE_EMACS" ]; then
+          #  chpwd() { print -P "\033AnSiTc %d" }
+          #  print -P "\033AnSiTu %n"
+          #  print -P "\033AnSiTc %d"
+          #fi
+          if [[ "$TERM" == "dumb" || "$TERM" == "emacs" ]]
+          then
+            TERM=eterm-color
+            unsetopt zle
+            unsetopt prompt_cr
+            unsetopt prompt_subst
+            unfunction precmd
+            unfunction preexec
+            PS1='$ '
+            return
+          fi
+          # make sure navigation using emacs keybindings works on all non-alphanumerics
+          # syntax highlighting
+          source $HOME/${config.programs.zsh.dotDir}/plugins/zsh-nix-shell/nix-shell.plugin.zsh
+          source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+          ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
+          ZSH_HIGHLIGHT_PATTERNS+=('rm -fR *' 'fg=white,bold,bg=red')
+          ZSH_HIGHLIGHT_PATTERNS+=('rm -fr *' 'fg=white,bold,bg=red')
+          source $HOME/${config.programs.zsh.dotDir}/completion.zsh
+          source $HOME/${config.programs.zsh.dotDir}/plugins/powerlevel10k/powerlevel10k.zsh-theme
+          source $HOME/${config.programs.zsh.dotDir}/prompt.zsh
+          setopt hist_ignore_space
+          alias -g L="|less"
+          alias -g EEL=' 2>&1 | less'
+          alias -g GB='`git rev-parse --abbrev-ref HEAD`'
+          alias -g GR='`git rev-parse --show-toplevel`'
+          (( $+commands[jq] )) && alias -g MJ="| jq -C '.'"  || alias -g MJ="| ${pkgs.python3}/bin/python -mjson.tool"
+        '';
+        profileExtra = ''
+          if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi
+          export NIX_PATH=$HOME/.nix-defexpr/channels:$NIX_PATH
+        '';
+      };
+      programs.fzf = {
+        enable = true;
+        enableZshIntegration = true;
+        defaultOptions = [ "--bind=ctrl-j:accept" ];
+      };
+    }
     (
-      mkMerge [
-        {
-          home.packages = with pkgs; [
-            zsh-syntax-highlighting
-            nix-zsh-completions
-          ];
-          home.file."${config.programs.zsh.dotDir}/completion.zsh".source = ./assets/zsh/completion.zsh;
-          home.file."${config.programs.zsh.dotDir}/prompt.zsh".source = ./assets/zsh/prompt.zsh;
-          home.file."${config.programs.zsh.dotDir}/functions/j".source = ./assets/zsh/j;
-          programs.zsh = {
-            enable = true;
-            dotDir = ".config/zsh";
-            autocd = true;
-            defaultKeymap = "emacs";
-            enableAutosuggestions = true;
-            history = {
-              size = 100000;
-              expireDuplicatesFirst = true;
-              ignoreDups = true;
-            };
-            localVariables = {
-              EMOJI_CLI_KEYBIND = "^n";
-              EMOJI_CLI_USE_EMOJI = "yes";
-              ZSH_HIGHLIGHT_HIGHLIGHTERS = [ "main" "brackets" "pattern" ];
-            };
-            shellAliases = import ./aliases.shell.nix;
-            plugins = [
-              {
-                name = "emoji-cli";
-                src = pkgs.fetchFromGitHub {
-                  owner = "b4b4r07";
-                  repo = "emoji-cli";
-                  rev = "26e2d67d566bfcc741891c8e063a00e0674abc92";
-                  sha256 = "0n88w4k5vaz1iyikpmlzdrrkxmfn91x5s4q405k1fxargr1w6bmx";
-                };
-              }
-              {
-                name = "zsh-z";
-                src = pkgs.fetchFromGitHub {
-                  owner = "agkozak";
-                  repo = "zsh-z";
-                  rev = "5b903f8f5489783ee2a4af668a941b7d9a02efc9";
-                  sha256 = "07h6ksiqgqyf5m84hv5xf4jcqrl8q1cj8wd4z52cjmy82kk10fkn";
-                };
-              }
-              {
-                name = "async";
-                src = pkgs.fetchFromGitHub {
-                  owner = "mafredri";
-                  repo = "zsh-async";
-                  rev = "v1.7.0";
-                  sha256 = "1jbbypgn0r4pilhv2s2p11vbkkvlnf75wrhxfcvr7bfjpzyp9wbc";
-                };
-              }
-              {
-                name = "zsh-completions";
-                src = pkgs.fetchFromGitHub {
-                  owner = "zsh-users";
-                  repo = "zsh-completions";
-                  rev = "922eee0706acb111e9678ac62ee77801941d6df2";
-                  sha256 = "04skzxv8j06f1snsx62qnca5f2183w0wfs5kz78rs8hkcyd6g89w";
-                };
-              }
-              {
-                name = "powerlevel10k";
-                src = pkgs.fetchFromGitHub {
-                  owner = "romkatv";
-                  repo = "powerlevel10k";
-                  rev = "700910cd0421a7d25d2800cefa76eb6d80dc62a8";
-                  sha256 = "011ja4r3a8vbcs42js9nri4p8pi8z4ccqxl2qyf52pn3pfnidigj";
-                };
-              }
-              {
-                name = "zsh-nix-shell";
-                src = pkgs.fetchFromGitHub {
-                  owner = "chisui";
-                  repo = "zsh-nix-shell";
-                  rev = "v0.1.0";
-                  sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx";
-                };
-              }
-            ];
-            envExtra = ''
-              export GOPATH=${config.home.homeDirectory}
-              export WEBKIT_DISABLE_COMPOSITING_MODE=1;
-              export PATH=$HOME/bin:$PATH
-              if [ -d $HOME/.krew/bin ]; then
-                export PATH=$HOME/.krew/bin:$PATH
-              fi
-            '';
-            loginExtra = ''
-              export GOPATH=${config.home.homeDirectory}
-            '';
-            initExtra = ''
-              path+="$HOME/${config.programs.zsh.dotDir}/functions"
-              fpath+="$HOME/.nix-profile/share/zsh/site-functions"
-              fpath+="$HOME/${config.programs.zsh.dotDir}/functions"
-              for func ($HOME/${config.programs.zsh.dotDir}/functions) autoload -U $func/*(x:t)
-              autoload -Uz select-word-style; select-word-style bash
-              if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi
-              #if [ -n "$INSIDE_EMACS" ]; then
-              #  chpwd() { print -P "\033AnSiTc %d" }
-              #  print -P "\033AnSiTu %n"
-              #  print -P "\033AnSiTc %d"
-              #fi
-              if [[ "$TERM" == "dumb" || "$TERM" == "emacs" ]]
-              then
-                TERM=eterm-color
-                unsetopt zle
-                unsetopt prompt_cr
-                unsetopt prompt_subst
-                unfunction precmd
-                unfunction preexec
-                PS1='$ '
-                return
-              fi
-              # make sure navigation using emacs keybindings works on all non-alphanumerics
-              # syntax highlighting
-              source $HOME/${config.programs.zsh.dotDir}/plugins/zsh-nix-shell/nix-shell.plugin.zsh
-              source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-              ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
-              ZSH_HIGHLIGHT_PATTERNS+=('rm -fR *' 'fg=white,bold,bg=red')
-              ZSH_HIGHLIGHT_PATTERNS+=('rm -fr *' 'fg=white,bold,bg=red')
-              source $HOME/${config.programs.zsh.dotDir}/completion.zsh
-              source $HOME/${config.programs.zsh.dotDir}/plugins/powerlevel10k/powerlevel10k.zsh-theme
-              source $HOME/${config.programs.zsh.dotDir}/prompt.zsh
-              setopt hist_ignore_space
-              alias -g L="|less"
-              alias -g EEL=' 2>&1 | less'
-              alias -g GB='`git rev-parse --abbrev-ref HEAD`'
-              alias -g GR='`git rev-parse --show-toplevel`'
-              (( $+commands[jq] )) && alias -g MJ="| jq -C '.'"  || alias -g MJ="| ${pkgs.python3}/bin/python -mjson.tool"
-            '';
-            profileExtra = ''
-              if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi
-              export NIX_PATH=$HOME/.nix-defexpr/channels:$NIX_PATH
-            '';
-          };
-          programs.fzf = {
-            enable = true;
-            enableZshIntegration = true;
-            defaultOptions = [ "--bind=ctrl-j:accept" ];
-          };
-        }
-        (
-          mkIf config.profiles.emacs.enable {
-            /*programs.zsh.initExtra = ''
-              export EDITOR=et
-            '';*/
-          }
-        )
-        (
-          mkIf config.machine.home-manager {
-            home.packages = with pkgs; [ hello ];
-          }
-        )
-      ]
-    );
+      mkIf config.profiles.emacs.enable {
+        /*programs.zsh.initExtra = ''
+          export EDITOR=et
+        '';*/
+      }
+    )
+    (
+      mkIf config.machine.home-manager {
+        home.packages = with pkgs; [ hello ];
+      }
+    )
+  ]);
 }
overlays/emacs/builder.nix
@@ -15,8 +15,7 @@ stdenv.mkDerivation {
   buildInputs = [ emacs ] ++ buildInputs;
   buildPhase = ''
     ${preBuild}
-    ARGS=$(find ${stdenv.lib.concatStrings
-      (builtins.map (arg: arg + "/share/emacs/site-lisp ") buildInputs)} \
+    ARGS=$(find ${stdenv.lib.concatStrings (builtins.map (arg: arg + "/share/emacs/site-lisp ") buildInputs)} \
                  -type d -exec echo -L {} \;)
     mkdir $out
     export HOME=$out
overlays/sbr.nix
@@ -21,23 +21,22 @@ rec {
 
   my = import ../pkgs { };
 
-  emacs27 = (self.emacs.override { srcRepo = true; }).overrideAttrs
-    (
-      old: {
-        name = "emacs-dev";
-        version = "27.0.91";
-        src = super.fetchFromGitHub {
-          owner = "emacs-mirror";
-          repo = "emacs";
-          rev = "emacs-27.0.91";
-          sha256 = "0mlrg2npy1r79laahkgzhxd1qassfcdz8qk1cpw7mqgf6y5x505h";
-        };
-        buildInputs = old.buildInputs ++ [ super.jansson ];
-        patches = [
-          ./patches/clean-env.patch
-        ];
-      }
-    );
+  emacs27 = (self.emacs.override { srcRepo = true; }).overrideAttrs (
+    old: {
+      name = "emacs-dev";
+      version = "27.0.91";
+      src = super.fetchFromGitHub {
+        owner = "emacs-mirror";
+        repo = "emacs";
+        rev = "emacs-27.0.91";
+        sha256 = "0mlrg2npy1r79laahkgzhxd1qassfcdz8qk1cpw7mqgf6y5x505h";
+      };
+      buildInputs = old.buildInputs ++ [ super.jansson ];
+      patches = [
+        ./patches/clean-env.patch
+      ];
+    }
+  );
 
   bookmark-plus = compileEmacsFiles {
     name = "bookmark-plus";
pkgs/vscodeliveshare/default.nix
@@ -33,61 +33,60 @@ in
       sha256 = "1y24q5id9hkgdndh2v8z1rpw736bi16yk66n260s44qd3w5yss8r";
     };
   }
-).overrideAttrs
-  (
-    attrs:
-    {
-      buildInputs = attrs.buildInputs
-        ++ [ autoPatchelfHook ]
-        ++ [ icu curl lttng-ust xorg.libX11 ];
+).overrideAttrs (
+  attrs:
+  {
+    buildInputs = attrs.buildInputs
+      ++ [ autoPatchelfHook ]
+      ++ [ icu curl lttng-ust xorg.libX11 ];
 
-      installPhase = attrs.installPhase + ''
+    installPhase = attrs.installPhase + ''
 
     runHook postInstall
     '';
 
-      postInstall = ''
-        bash -s <<ENDSUBSHELL
-        shopt -s extglob
-        cd $out/share/*/extensions/*
-        cp \
-            "${runtime}"/shared/Microsoft.NETCore.App/2.1.1/* \
-            dotnet_modules/runtimes/linux-x64/!(native) \
-            dotnet_modules/runtimes/linux-x64/native/* \
-            dotnet_modules/runtimes/unix/lib/netstandard1.3/* \
-            "dotnet_modules"
-        chmod +x \
-            dotnet_modules/vsls-agent \
-            dotnet_modules/Microsoft.Cascade.VSCodeAdapter \
-            dotnet_modules/createdump \
-            dotnet_modules/Microsoft.Cascade.VSCodeHostAdapter \
-            dotnet_modules/runtimes/linux-x64/vsls-agent \
-            dotnet_modules/runtimes/linux-x64/Microsoft.Cascade.VSCodeHostAdapter \
-            dotnet_modules/runtimes/linux-x64/Microsoft.Cascade.VSCodeAdapter \
+    postInstall = ''
+      bash -s <<ENDSUBSHELL
+      shopt -s extglob
+      cd $out/share/*/extensions/*
+      cp \
+          "${runtime}"/shared/Microsoft.NETCore.App/2.1.1/* \
+          dotnet_modules/runtimes/linux-x64/!(native) \
+          dotnet_modules/runtimes/linux-x64/native/* \
+          dotnet_modules/runtimes/unix/lib/netstandard1.3/* \
+          "dotnet_modules"
+      chmod +x \
+          dotnet_modules/vsls-agent \
+          dotnet_modules/Microsoft.Cascade.VSCodeAdapter \
+          dotnet_modules/createdump \
+          dotnet_modules/Microsoft.Cascade.VSCodeHostAdapter \
+          dotnet_modules/runtimes/linux-x64/vsls-agent \
+          dotnet_modules/runtimes/linux-x64/Microsoft.Cascade.VSCodeHostAdapter \
+          dotnet_modules/runtimes/linux-x64/Microsoft.Cascade.VSCodeAdapter \
 
-        touch "install.Lock"
-        cat <<EOF > dotnet_modules/.version
-        ${runtimeHash}
-        ${runtimeVersion}
-        EOF
-        sed -i out/src/launcher.js \
-            -e "s|path.join(Launcher.extensionRootPath, 'cascade.json')|'/tmp/cascade.json'|"
-        sed -i out/src/extension.js \
-            -e "s|yield downloader_1.ExternalDownloader.ensureRuntimeDependenciesAsync(liveShareExtension)|downloader_1.EnsureRuntimeDependenciesResult.Success|" \
-            -e "s|yield downloader_1.isInstallCorrupt(traceSource_1.traceSource)|false|"
-        sed -i out/src/internalConfig.js \
-            -e "s|path.join(__dirname, '..', '..', 'modifiedInternalSettings.json')|'/tmp/modifiedInternalSettings.json'|"
-        ENDSUBSHELL
-      '';
+      touch "install.Lock"
+      cat <<EOF > dotnet_modules/.version
+      ${runtimeHash}
+      ${runtimeVersion}
+      EOF
+      sed -i out/src/launcher.js \
+          -e "s|path.join(Launcher.extensionRootPath, 'cascade.json')|'/tmp/cascade.json'|"
+      sed -i out/src/extension.js \
+          -e "s|yield downloader_1.ExternalDownloader.ensureRuntimeDependenciesAsync(liveShareExtension)|downloader_1.EnsureRuntimeDependenciesResult.Success|" \
+          -e "s|yield downloader_1.isInstallCorrupt(traceSource_1.traceSource)|false|"
+      sed -i out/src/internalConfig.js \
+          -e "s|path.join(__dirname, '..', '..', 'modifiedInternalSettings.json')|'/tmp/modifiedInternalSettings.json'|"
+      ENDSUBSHELL
+    '';
 
-      #-e "s|launcher_1.Launcher.safelyDeleteCascadeUrlFile();||" \
-      #-e "s|yield launcher_1.Launcher.readCascadeURL()|void 0|" \
+    #-e "s|launcher_1.Launcher.safelyDeleteCascadeUrlFile();||" \
+    #-e "s|yield launcher_1.Launcher.readCascadeURL()|void 0|" \
 
-      postFixup = ''
-        cd $out/share/*/extensions/*
-        find . -iname '*.so' -ls -exec patchelf --set-rpath ${rpath} '{}' \;
-      '';
+    postFixup = ''
+      cd $out/share/*/extensions/*
+      find . -iname '*.so' -ls -exec patchelf --set-rpath ${rpath} '{}' \;
+    '';
 
-      propagatedBuildInputs = with gnome3; [ gnome-keyring ];
-    }
-  )
+    propagatedBuildInputs = with gnome3; [ gnome-keyring ];
+  }
+)
tmp/channels.nix
@@ -1,9 +1,9 @@
 let
-  mapAttrs = f: set: builtins.listToAttrs
-    (
-      map (attr: { name = attr; value = f set.${attr}; })
-        (builtins.attrNames set)
-    );
+  mapAttrs = f: set: builtins.listToAttrs (
+    map
+      (attr: { name = attr; value = f set.${attr}; })
+      (builtins.attrNames set)
+  );
   channels = {
     aardvark = "13.10";
     baboon = "14.04";
ci.nix
@@ -31,17 +31,17 @@ let
   outputsOf = p: map (o: p.${o}) p.outputs;
   nurAttrs = import ./pkgs/default.nix { inherit pkgs; };
   nurPkgs =
-    flattenPkgs
-      (
-        listToAttrs
+    flattenPkgs (
+      listToAttrs (
+        map
+          (n: nameValuePair n nurAttrs.${n})
           (
-            map (n: nameValuePair n nurAttrs.${n})
-              (
-                filter (n: !isReserved n)
-                  (attrNames nurAttrs)
-              )
+            filter
+              (n: !isReserved n)
+              (attrNames nurAttrs)
           )
-      );
+      )
+    );
 in
 rec {
   buildPkgs = filter isBuildable nurPkgs;