Skip to content

Commit

Permalink
Add NixOS support (#91)
Browse files Browse the repository at this point in the history
- Adds a `flake.nix` and `flake.lock`
- Updates docs on how to use them
  • Loading branch information
JasonGrace2282 authored Jan 8, 2025
1 parent 93af349 commit 9e906c1
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/source/contributing/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,22 @@ Now you're all set! Try running the development server
Head on over to `http://127.0.0.1:8000 <http://127.0.0.1:8000>`_, and login
as ``admin`` and the password you just entered.



NixOS Setup
-----------
A ``flake.nix`` file is provided for NixOS users. To use it, first enable the redis service globally.
Place the following in your ``/etc/nixos/configuration.nix``::

services.redis.server."".enable = true

This will start a systemd service called ``redis``. After that, you can start the flake with::

nix develop

You can then install dependencies, setup the database, and run the development server as described above.

.. tip::

You may also need to set ``nix.settings.experimental-features = ["nix-command" "flakes"];`` in your ``configuration.nix``.
62 changes: 62 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
description = "A flake for running Tin";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.pyenv
pkgs.pipenv
pkgs.python3
];
};
});
}

0 comments on commit 9e906c1

Please sign in to comment.