Sha256: c00c9622fd1343defd7186b3a8bbe05ea5e4a4ac0ad5a44ec52affa4fdc4950e

Contents?: true

Size: 806 Bytes

Versions: 30

Compression:

Stored size: 806 Bytes

Contents

module SpecInfra
  module Command
    class NixOS < Linux
      def check_enabled(service,level=3)
        level = "multi-user.target" if level == 3
        "systemctl --plain list-dependencies #{escape(level)} | grep '#{escape(service)}.service$'"
      end

      def check_installed(package, version=nil)
        if version
          "nix-store -q --references /var/run/current-system/sw | grep #{escape(package)}-#{escape(version)}"
        else
          "nix-store -q --references /var/run/current-system/sw | grep #{escape(package)}"
        end
      end

      alias :check_installed_by_nix :check_installed

      def check_running(service)
        "systemctl is-active #{escape(service)}.service"
      end

      def install(package)
        "nix-env -i #{package}"
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
specinfra-1.27.5 lib/specinfra/command/nixos.rb
specinfra-1.27.4 lib/specinfra/command/nixos.rb
specinfra-1.27.3 lib/specinfra/command/nixos.rb
specinfra-1.27.2 lib/specinfra/command/nixos.rb
specinfra-1.27.1 lib/specinfra/command/nixos.rb
specinfra-1.27.0 lib/specinfra/command/nixos.rb
specinfra-1.26.0 lib/specinfra/command/nixos.rb
specinfra-1.25.8 lib/specinfra/command/nixos.rb
specinfra-1.25.7 lib/specinfra/command/nixos.rb
specinfra-1.25.6 lib/specinfra/command/nixos.rb
specinfra-1.25.5 lib/specinfra/command/nixos.rb
specinfra-1.25.4 lib/specinfra/command/nixos.rb
specinfra-1.25.3 lib/specinfra/command/nixos.rb
specinfra-1.25.2 lib/specinfra/command/nixos.rb
specinfra-1.25.1 lib/specinfra/command/nixos.rb
specinfra-1.25.0 lib/specinfra/command/nixos.rb
specinfra-1.24.0 lib/specinfra/command/nixos.rb
specinfra-1.23.1 lib/specinfra/command/nixos.rb
specinfra-1.23.0 lib/specinfra/command/nixos.rb
specinfra-1.22.1 lib/specinfra/command/nixos.rb