Skip to content

Commit 9e906c1

Browse files
Add NixOS support (#91)
- Adds a `flake.nix` and `flake.lock` - Updates docs on how to use them
1 parent 93af349 commit 9e906c1

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed

docs/source/contributing/setup.rst

+19
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,22 @@ Now you're all set! Try running the development server
4242
4343
Head on over to `http://127.0.0.1:8000 <http://127.0.0.1:8000>`_, and login
4444
as ``admin`` and the password you just entered.
45+
46+
47+
48+
NixOS Setup
49+
-----------
50+
A ``flake.nix`` file is provided for NixOS users. To use it, first enable the redis service globally.
51+
Place the following in your ``/etc/nixos/configuration.nix``::
52+
53+
services.redis.server."".enable = true
54+
55+
This will start a systemd service called ``redis``. After that, you can start the flake with::
56+
57+
nix develop
58+
59+
You can then install dependencies, setup the database, and run the development server as described above.
60+
61+
.. tip::
62+
63+
You may also need to set ``nix.settings.experimental-features = ["nix-command" "flakes"];`` in your ``configuration.nix``.

flake.lock

+62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
description = "A flake for running Tin";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils, ... }:
10+
flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
11+
let
12+
pkgs = nixpkgs.legacyPackages.${system};
13+
in
14+
{
15+
devShells.default = pkgs.mkShell {
16+
buildInputs = [
17+
pkgs.pyenv
18+
pkgs.pipenv
19+
pkgs.python3
20+
];
21+
};
22+
});
23+
}

0 commit comments

Comments
 (0)