%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/nix.pyc |
� ���^c @@ s d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z e j e � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e e d � Z d � Z d � Z d S( u� Work with Nix packages ====================== .. versionadded:: 2017.7.0 Does not require the machine to be Nixos, just have Nix installed and available to use for the user running this command. Their profile must be located in their home, under ``$HOME/.nix-profile/``, and the nix store, unless specially set up, should be in ``/nix``. To easily use this with multiple users or a root user, set up the `nix-daemon`_. This module exposes most of the common nix operations. Currently not meant to be run as a ``pkg`` module, but explicitly as ``nix.*``. For more information on nix, see the `nix documentation`_. .. _`nix documentation`: https://nixos.org/nix/manual/ .. _`nix-daemon`: https://nixos.org/nix/manual/#ssec-multi-user i ( t absolute_importt print_functiont unicode_literalsN( t zipc C@ s� t j j t j j d j t d � � d � } t j j j t j j | d � � rz t j j j t j j | d � � rz t St d f Sd S( u6 This only works if we have access to nix-env u ~{0}u useru .nix-profile/bin/u nix-envu nix-collect-garbageu] The `nix` binaries required cannot be found or are not installed. (`nix-store` and `nix-env`)N( t ost patht joint expandusert formatt __opts__t saltt utilst whicht Truet False( t nixhome( ( s4 /usr/lib/python2.7/site-packages/salt/modules/nix.pyt __virtual__$ s .Hc C@ s4 t d | d i t j j d j t d � � d 6�S( uJ Just a convenience function for ``__salt__['cmd.run_all'](cmd)`` u cmd.run_allt envu ~{0}u useru HOME( t __salt__R R R R R ( t cmd( ( s4 /usr/lib/python2.7/site-packages/salt/modules/nix.pyt _run/ s c C@ sD t j j t j j d j t d � � d � } t j j | d � g S( u� nix-env with quiet option. By default, nix is extremely verbose and prints the build log of every package to stderr. This tells nix to only show changes. u ~{0}u useru .nix-profile/bin/u nix-env( R R R R R R ( R ( ( s4 /usr/lib/python2.7/site-packages/salt/modules/nix.pyt _nix_env6 s .c C@ sD t j j t j j d j t d � � d � } t j j | d � g S( u4 Make sure we get the right nix-store, too. u ~{0}u useru .nix-profile/bin/u nix-collect-garbage( R R R R R R ( R ( ( s4 /usr/lib/python2.7/site-packages/salt/modules/nix.pyt _nix_collect_garbage? s .c C@ s t � } | j d � | S( u� nix-env with quiet option. By default, nix is extremely verbose and prints the build log of every package to stderr. This tells nix to only show changes. u --no-build-output( R t append( t p( ( s4 /usr/lib/python2.7/site-packages/salt/modules/nix.pyt _quietnixG s c C@ s"