From c7397129f03f0e2c0988a542fd48a9afdbc91764 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Tue, 18 Jul 2023 19:01:45 +0800 Subject: [PATCH] git: removing all warnings about the gpgPath migration It simply cannot be done, if signing continues to be a submodule and NixOS/nixpkgs#96006 continues to be a problem. --- format | 3 +-- modules/programs/git.nix | 7 +---- ...t-with-signing-key-id-legacy-expected.conf | 10 ------- .../git/git-with-signing-key-id-legacy.nix | 27 ------------------- 4 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 tests/modules/programs/git/git-with-signing-key-id-legacy-expected.conf delete mode 100644 tests/modules/programs/git/git-with-signing-key-id-legacy.nix diff --git a/format b/format index 10f7c473d3ed..ff4b32e4761a 100755 --- a/format +++ b/format @@ -1,6 +1,5 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash -p git gnugrep gnused findutils nixfmt -#1 nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6616de389ed55fba6eeba60377fc04732d5a207c.tar.gz -i bash -p git gnugrep gnused findutils nixfmt +#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6616de389ed55fba6eeba60377fc04732d5a207c.tar.gz -i bash -p git gnugrep gnused findutils nixfmt nixfmt_args=() files=() diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 0666a0c6621f..e720a2b8b5c4 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -56,7 +56,6 @@ let in attrsOf supersectionType; signModule = types.submodule { - imports = [ (mkRenamedOptionModule [ "gpgPath" ] [ "program" ]) ]; options = { signByDefault = mkOption { type = types.bool; @@ -425,6 +424,7 @@ in { config = mkIf cfg.enable (mkMerge [ { home.packages = [ cfg.package ]; + assertions = [ (assertAtMostOneIsSet cfg (builtins.map (tool: [ tool "enable" ]) [ "delta" @@ -432,11 +432,6 @@ in { "difftastic" ])) ]; - warnings = if (cfg.signing.gpgPath or "") != "" then ['' - `programs.git.signing.gpgPath` has been deprecated. - Please use `programs.git.signing.program` instead. - ''] else - [ ]; programs.git.iniContent.user = { name = mkIf (cfg.userName != null) cfg.userName; diff --git a/tests/modules/programs/git/git-with-signing-key-id-legacy-expected.conf b/tests/modules/programs/git/git-with-signing-key-id-legacy-expected.conf deleted file mode 100644 index fef615376465..000000000000 --- a/tests/modules/programs/git/git-with-signing-key-id-legacy-expected.conf +++ /dev/null @@ -1,10 +0,0 @@ -[commit] - gpgSign = true - -[tag] - gpgSign = true - -[user] - email = "user@example.org" - name = "John Doe" - signingKey = "00112233445566778899AABBCCDDEEFF" diff --git a/tests/modules/programs/git/git-with-signing-key-id-legacy.nix b/tests/modules/programs/git/git-with-signing-key-id-legacy.nix deleted file mode 100644 index 1ae4fd71c0f1..000000000000 --- a/tests/modules/programs/git/git-with-signing-key-id-legacy.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ pkgs, ... }: { - config = { - test.asserts.warnings.expected = ['' - `programs.git.signing.gpgPath` has been deprecated. - Please use `programs.git.signing.program` instead. - '']; - - programs.git = { - enable = true; - userName = "John Doe"; - userEmail = "user@example.org"; - - signing = { - gpgPath = "path-to-gpg"; - key = "00112233445566778899AABBCCDDEEFF"; - signByDefault = true; - }; - }; - - nmt.script = '' - assertFileExists home-files/.config/git/config - assertFileContent home-files/.config/git/config ${ - ./git-with-signing-key-id-legacy-expected.conf - } - ''; - }; -}