diff options
author | Arie Middelkoop <amiddelk@gmail.com> | 2012-02-01 22:06:49 +0000 |
---|---|---|
committer | Arie Middelkoop <amiddelk@gmail.com> | 2012-02-01 22:06:49 +0000 |
commit | acda2c1967274b710d922d783ed7ab0d14acaffd (patch) | |
tree | a44e62495b5cc553d012521082e7c766fa5be20b /pkgs | |
parent | 4b45a0bfc395451bcaafebeae2eeba1d5a2235a3 (diff) | |
download | nixpkgs-acda2c1967274b710d922d783ed7ab0d14acaffd.tar nixpkgs-acda2c1967274b710d922d783ed7ab0d14acaffd.tar.gz nixpkgs-acda2c1967274b710d922d783ed7ab0d14acaffd.tar.bz2 nixpkgs-acda2c1967274b710d922d783ed7ab0d14acaffd.tar.lz nixpkgs-acda2c1967274b710d922d783ed7ab0d14acaffd.tar.xz nixpkgs-acda2c1967274b710d922d783ed7ab0d14acaffd.tar.zst nixpkgs-acda2c1967274b710d922d783ed7ab0d14acaffd.zip |
Makes a .desktop startup item from a .desktop menu entry.
svn path=/nixpkgs/trunk/; revision=31958
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/make-startupitem/default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/build-support/make-startupitem/default.nix b/pkgs/build-support/make-startupitem/default.nix new file mode 100644 index 00000000000..07cdee600d4 --- /dev/null +++ b/pkgs/build-support/make-startupitem/default.nix @@ -0,0 +1,34 @@ +# given a pakcage with a $name.desktop file, makes a copy +# as autostart item. + +{stdenv, lib}: +{ name # name of the desktop file (without .desktop) +, package # package where the desktop file resides in +, after ? null +, condition ? null +, phase ? "2" +}: + +# the builder requires that +# $package/share/applications/$name.desktop +# exists as file. + +stdenv.mkDerivation { + name = "autostart-${name}"; + priority = 5; + + buildCommand = '' + ensureDir $out/share/autostart + target=${name}.desktop + cp ${package}/share/applications/${name}.desktop $target + chmod +rw $target + echo "X-KDE-autostart-phase=${phase}" >> $target + ${lib.optionalString (after != null) ''echo "${after}" >> $target''} + ${lib.optionalString (condition != null) ''echo "${condition}" >> $target''} + cp $target $out/share/autostart + ''; + + # this will automatically put 'package' in the environment when you + # put its startup item in there. + propagatedBuildInputs = [ package ]; +} \ No newline at end of file |