Installing OCS Inventory NG on NixOS Latest

This tutorial outlines the steps for installing OCS Inventory NG on NixOS Latest. OCS Inventory NG is a free and open-source computer and software inventory system.

Prerequisites

Before proceeding with the installation, you need to ensure that your NixOS Latest system is up-to-date and that the following packages are installed:

Installation

  1. Clone the OCS Inventory NG repository
git clone --depth 1 https://github.com/OCSInventory-NG/OCSInventory-ocsreports.git
  1. Move the cloned folder to the nginx directory
mv OCSInventory-ocsreports /var/www/ocsinventory
  1. Change the ownership of the ocsinventory folder to www-data
chown www-data:www-data /var/www/ocsinventory -R
  1. Configure nginx for OCS Inventory NG by creating a new server block
nano /etc/nginx/sites-available/ocsinventory.conf
  1. Add the following configuration to the file:
server {
    listen       80;
    server_name  inventory.localhost;

    root /var/www/ocsinventory/ocsreports;

    access_log /var/log/nginx/access.OCS.log;
    error_log  /var/log/nginx/error.OCS.log;

    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~* \.(php)$ {
        include fastcgi_params;
        fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}
  1. Save and exit the file.

  2. Create a symbolic link to enable the new server block configuration.

ln -s /etc/nginx/sites-available/ocsinventory.conf /etc/nginx/sites-enabled/ocsinventory.conf
  1. Restart nginx
systemctl restart nginx.service
  1. Start php-fpm
systemctl start php-fpm.service
  1. Navigate to http://inventory.localhost in your web browser to access OCS Inventory NG.

Congratulations! You have successfully installed OCS Inventory NG on your NixOS Latest system.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!