How to Install Mealie on NixOS Latest

Requirements:

Before we start with the installation process, make sure you have the following requirements:

  • A computer with NixOS installed
  • An active internet connection

Steps to Install Mealie:

Follow the steps below to install Mealie on NixOS Latest:

  1. Open the terminal on your NixOS machine.

  2. Update your NixOS system by running the following command:

sudo nix-channel --update
sudo nix-env -u
  1. Install Git to download the latest Mealie package. Run the following command in the terminal:
sudo nix-env -i git
  1. Clone the Mealie repository from Github. Run the following command:
git clone https://github.com/hay-kot/mealie.git
  1. Navigate to the cloned Mealie directory:
cd mealie/
  1. Create a default.nix file in the cloned directory using the following command:
nano default.nix
  1. Add the following configuration to the default.nix file:
with import <nixpkgs> {};

let
  pyDeps = [
    python3
    python3Packaging
    python3Tornado
    python3SQLAlchemy
    python3PyMySQL
    python3nvchecker
    python3passlib
  ];

in python3.pkgs.buildPythonPackage rec {
  pname = "mealie";
  version = "latest";
  src = builtins.fetchGit {
          url = "https://github.com/hay-kot/mealie";
          rev = "latest";
        };
  pythonPath = "${python3Packages}:${pythonDeps}";
  buildInputs = [
    python3
    python3Packages.setuptools
    python3Packages.wheel
  ] ++ pyDeps;

  meta = with stdenv.lib; {
    description = "Recipe Manager and Meal Planner Application";
    homepage = https://hay-kot.github.io/mealie/;
    license = pkgs.lib.licenses.mit;
    maintainers = with maintainers; [ ];
  };
}
  1. Save and exit the file by pressing Ctrl+X, then press Y and then Enter.

  2. Build Mealie by running the following command in the terminal:

nix-build
  1. After the build is complete, you will find the Mealie package in the result/ directory.

  2. To install Mealie, run the following command:

sudo nix-env -i ./result
  1. After the installation is complete, start the Mealie server using the following command:
mealie serve
  1. Access Mealie by going to http://localhost:9000/ in your web browser.

Conclusion:

That’s it! By following these simple steps, you can install Mealie on NixOS Latest. Enjoy using Mealie and managing your meal plans and recipes!