lol

yadm: use resholvePackage (#154190)

authored by

Travis A. Everett and committed by
GitHub
360829c7 807a2f26

+97 -5
+97 -5
pkgs/applications/version-management/yadm/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, git, gnupg, installShellFiles }: 1 + { lib 2 + , stdenv 3 + , resholvePackage 4 + , fetchFromGitHub 5 + , git 6 + , bash 7 + , openssl 8 + , gawk 9 + /* 10 + TODO: yadm can use git-crypt and transcrypt 11 + but it does so in a way that resholve 0.6.0 12 + can't yet do anything smart about. It looks 13 + like these are for interactive use, so the 14 + main impact should just be that users still 15 + need both of these packages in their profile 16 + to support their use in yadm. 17 + */ 18 + # , git-crypt 19 + # , transcrypt 20 + , j2cli 21 + , esh 22 + , gnupg 23 + , coreutils 24 + , gnutar 25 + , installShellFiles 26 + , runCommand 27 + , yadm 28 + }: 2 29 3 - stdenv.mkDerivation rec { 30 + resholvePackage rec { 4 31 pname = "yadm"; 5 32 version = "3.1.1"; 6 33 7 - buildInputs = [ git gnupg ]; 8 - 9 34 nativeBuildInputs = [ installShellFiles ]; 10 35 11 36 src = fetchFromGitHub { 12 37 owner = "TheLocehiliosan"; 13 38 repo = "yadm"; 14 39 rev = version; 15 - sha256 = "sha256-bgiRBlqEjDq0gQ0+aUWpFDeE2piFX3Gy2gEAXgChAOk="; 40 + hash = "sha256-bgiRBlqEjDq0gQ0+aUWpFDeE2piFX3Gy2gEAXgChAOk="; 16 41 }; 17 42 18 43 dontConfigure = true; ··· 31 56 --bash completion/bash/yadm 32 57 ''; 33 58 59 + solutions = { 60 + yadm = { 61 + scripts = [ "bin/yadm" ]; 62 + interpreter = "${bash}/bin/sh"; 63 + inputs = [ 64 + git 65 + gnupg 66 + openssl 67 + gawk 68 + # see head comment 69 + # git-crypt 70 + # transcrypt 71 + j2cli 72 + esh 73 + bash 74 + coreutils 75 + gnutar 76 + ]; 77 + fake = { 78 + external = if stdenv.isCygwin then [ ] else [ "cygpath" ]; 79 + }; 80 + fix = { 81 + "$GPG_PROGRAM" = [ "gpg" ]; 82 + "$OPENSSL_PROGRAM" = [ "openssl" ]; 83 + "$GIT_PROGRAM" = [ "git" ]; 84 + "$AWK_PROGRAM" = [ "awk" ]; 85 + # see head comment 86 + # "$GIT_CRYPT_PROGRAM" = [ "git-crypt" ]; 87 + # "$TRANSCRYPT_PROGRAM" = [ "transcrypt" ]; 88 + "$J2CLI_PROGRAM" = [ "j2" ]; 89 + "$ESH_PROGRAM" = [ "esh" ]; 90 + # not in nixpkgs (yet) 91 + # "$ENVTPL_PROGRAM" = [ "envtpl" ]; 92 + # "$LSB_RELEASE_PROGRAM" = [ "lsb_release" ]; 93 + }; 94 + keep = { 95 + "$YADM_COMMAND" = true; # internal cmds 96 + "$template_cmd" = true; # dynamic, template-engine 97 + "$SHELL" = true; # probably user env? unsure 98 + "$hook_command" = true; # ~git hooks? 99 + "exec" = [ "$YADM_BOOTSTRAP" ]; # yadm bootstrap script 100 + 101 + # not in nixpkgs 102 + "$ENVTPL_PROGRAM" = true; 103 + "$LSB_RELEASE_PROGRAM" = true; 104 + }; 105 + /* 106 + TODO: these should be dropped as fast as they can be dealt 107 + with properly in binlore and/or resholve. 108 + */ 109 + execer = [ 110 + "cannot:${j2cli}/bin/j2" 111 + "cannot:${esh}/bin/esh" 112 + "cannot:${git}/bin/git" 113 + "cannot:${gnupg}/bin/gpg" 114 + ]; 115 + }; 116 + }; 117 + 118 + passthru.tests = { 119 + minimal = runCommand "${pname}-test" {} '' 120 + export HOME=$out 121 + ${yadm}/bin/yadm init 122 + ''; 123 + }; 124 + 34 125 meta = { 35 126 homepage = "https://github.com/TheLocehiliosan/yadm"; 36 127 description = "Yet Another Dotfiles Manager"; ··· 40 131 * Provides a way to use alternate files on a specific OS or host. 41 132 * Supplies a method of encrypting confidential data so it can safely be stored in your repository. 42 133 ''; 134 + changelog = "https://github.com/TheLocehiliosan/yadm/blob/${version}/CHANGES"; 43 135 license = lib.licenses.gpl3Plus; 44 136 maintainers = with lib.maintainers; [ abathur ]; 45 137 platforms = lib.platforms.unix;