json = lib.importJSON path;
in rec {
version = json.tag;
- name = "${json.meta.name}-${version}";
+ pname = json.meta.name;
+ name = "${pname}-${version}";
src = fetchFromGitHub json.github;
};
json = lib.importJSON path;
in rec {
version = json.tag;
- name = "${json.meta.name}-${version}";
+ pname = json.meta.name;
+ name = "${pname}-${version}";
src = fetchgit json.git;
};
json = lib.importJSON path;
in rec {
version = json.tag;
- name = "${json.meta.name}-${version}";
+ pname = json.meta.name;
+ name = "${pname}-${version}";
src = builtins.fetchGit {
url = json.git.url;
ref = "master";
rev = json.git.rev;
};
};
-
- wrap = { paths ? [], vars ? {}, file ? null, script ? null, name ? "wrap" }:
- assert file != null || script != null ||
- abort "wrap needs 'file' or 'script' argument";
- with rec {
- set = n: v: "--set ${pkgs.lib.escapeShellArg n} " +
- "${pkgs.lib.escapeShellArg v}";
- args = (map (p: "--prefix PATH : ${p}/bin") paths) ++
- (builtins.attrValues (pkgs.lib.mapAttrs set vars));
- };
- runCommand name
- {
- f = if file == null then writeScript name script else file;
- buildInputs = [ makeWrapper ];
- }
- ''
- makeWrapper "$f" "$out" ${toString args}
- '';
-
} // (if builtins.pathExists ./private then callPackage ./private {} else {})
};
system.activationScripts.gitolite = let
- gitolite_ldap_groups = pkgs.mylibs.wrap {
- name = "gitolite_ldap_groups.sh";
- file = ./gitolite_ldap_groups.sh;
- vars = {
- LDAP_PASS = config.myEnv.tools.gitolite.ldap.password;
- };
- paths = [ pkgs.openldap pkgs.stdenv.shellPackage pkgs.gnugrep pkgs.coreutils ];
- };
+ deps = [ pkgs.openldap pkgs.stdenv.shellPackage pkgs.gnugrep pkgs.coreutils ];
+ gitolite_ldap_groups = pkgs.runCommand "gitolite_ldap_groups.sh" {
+ buildInputs = [ pkgs.makeWrapper ];
+ } ''
+ makeWrapper "${./gitolite_ldap_groups.sh}" "$out" \
+ --prefix PATH : ${lib.makeBinPath deps} \
+ --set LDAP_PASS ${pkgs.lib.escapeShellArg config.myEnv.tools.gitolite.ldap.password}
+ '';
in {
deps = [ "users" ];
text = ''
substituteAll ${./ldap_authorized_keys.sh} $out
chmod a+x $out
'';
- ldap_authorized_keys =
- pkgs.mylibs.wrap {
- name = "ldap_authorized_keys";
- file = fullScript;
- paths = deps;
- };
+ ldap_authorized_keys = pkgs.runCommand "ldap_authorized_keys" {
+ buildInputs = [ pkgs.makeWrapper ];
+ } ''
+ makeWrapper "${fullScript}" "$out" --prefix PATH : ${lib.makeBinPath deps}
+ '';
in {
enable = true;
mode = "0755";