]> git.scottworley.com Git - auto-upgrade-with-pinch/commitdiff
Use polite-merge for merging
authorScott Worley <scottworley@scottworley.com>
Fri, 29 May 2020 21:56:10 +0000 (14:56 -0700)
committerScott Worley <scottworley@scottworley.com>
Sat, 30 May 2020 06:12:55 +0000 (23:12 -0700)
modules/auto-upgrade.nix
overlays/polite-merge.nix [new file with mode: 0644]

index 66d857f74a1d1f9ce7e21750a7ba3f84abceafe2..e52720d8af0d1777da12f50be1148786c39d2052 100644 (file)
@@ -28,7 +28,8 @@ let
         # Update channels
         (
           cd /etc/nixos
         # Update channels
         (
           cd /etc/nixos
-          ${pkgs.keyedgit cfg.keys}/bin/git pull --ff-only --verify-signatures
+          ${pkgs.git}/bin/git fetch
+          PATH="${pkgs.keyedgit cfg.keys}/bin:$PATH" ${pkgs.polite-merge}/bin/polite-merge --ff-only --verify-signatures
           ${pkgs.pinch}/bin/pinch update channels
         )
 
           ${pkgs.pinch}/bin/pinch update channels
         )
 
@@ -136,6 +137,7 @@ in {
     nixpkgs.overlays = [
       (import ../overlays/keyedgit.nix)
       (import ../overlays/pinch.nix)
     nixpkgs.overlays = [
       (import ../overlays/keyedgit.nix)
       (import ../overlays/pinch.nix)
+      (import ../overlays/polite-merge.nix)
       (self: super: {
         auto-upgrade = super.writeShellScriptBin "auto-upgrade" ''
           /run/wrappers/bin/sudo ${auto-upgrade-script}
       (self: super: {
         auto-upgrade = super.writeShellScriptBin "auto-upgrade" ''
           /run/wrappers/bin/sudo ${auto-upgrade-script}
diff --git a/overlays/polite-merge.nix b/overlays/polite-merge.nix
new file mode 100644 (file)
index 0000000..49d8d3b
--- /dev/null
@@ -0,0 +1,20 @@
+self: super: {
+  polite-merge = if builtins.hasAttr "polite-merge" super then
+    super.polite-merge
+  else
+    self.callPackage ({ fetchgit, git, stdenv, }:
+      stdenv.mkDerivation rec {
+        pname = "polite-merge";
+        version = "1.0";
+        src = fetchgit {
+          url = "https://scottworley.com/polite-merge.git";
+          rev = version;
+          sha256 = "1q3iya5ifpcnmmvxhaphlvvq674yzwkgi3cyr6i3yflqks7zf81p";
+        };
+        postUnpack = "patchShebangs .";
+        checkInputs = [ git ];
+        doCheck = true;
+        preInstall = "export prefix";
+      }) { };
+}
+