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