Skip to content

Commit

Permalink
Rename almost everything to Shabitica
Browse files Browse the repository at this point in the history
I have just announced[1] this on the NixOS Discourse, so before users
start to actually use this, let's rename the NixOS options and all the
attributes accordingly, as well as the Hydra jobsets (we have two now,
one for NixOS 18.03 and one for NixOS Unstable).

This was long overdue and the repository has this name already. It
probably would have been wiser to do this *prior* to the announcement,
so I could do this without hurry. But well...

I only evaluated the tests but didn't build them, if they fail to build
it's not a big deal as we can fix this within the next few minutes and
it's more important to have the now attribute names in place.

[1]: https://discourse.nixos.org/t/self-hosted-habitica/735

Signed-off-by: aszlig <[email protected]>
  • Loading branch information
aszlig committed Aug 22, 2018
1 parent aba5c23 commit 5c01922
Show file tree
Hide file tree
Showing 28 changed files with 325 additions and 311 deletions.
32 changes: 22 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 26,38 @@ making the client more mobile-friendly could be a viable alternative.
Getting started on NixOS
------------------------

The easiest way is to just add the channel by issuing:
The easiest way is to just add the channel and reference it via your NixOS
configuration.

Adding the channel on NixOS 18.03
`````````````````````````````````

.. code-block:: sh-session
# nix-channel --add https://headcounter.org/hydra/channel/custom/shabitica/nixos-18.03/shabitica
# nix-channel --update shabitica
Adding the channel on NixOS Unstable
````````````````````````````````````

.. code-block:: sh-session
# nix-channel --add https://headcounter.org/hydra/channel/custom/headcounter/habitica/habitica
# nix-channel --update habitica
# nix-channel --add https://headcounter.org/hydra/channel/custom/shabitica/nixos-18.03/shabitica
# nix-channel --update shabitica
You can add the service to your `NixOS configuration`_ (typically
``/etc/nixos/configuration.nix``) by just importing ``<habitica>``, like this:
``/etc/nixos/configuration.nix``) by just importing ``<shabitica>``, like this:

.. code-block:: nix
{
imports = [ <habitica> ];
habitica.hostName = "habitica.example.org";
habitica.adminMailAddress = "[email protected]";
habitica.senderMailAddress = "habitica@example.org";
imports = [ <shabitica> ];
shabitica.hostName = "shabitica.example.org";
shabitica.adminMailAddress = "[email protected]";
shabitica.senderMailAddress = "shabitica@example.org";
}
This configures `Habitica`_ to run on ``habitica.example.org`` with an `NGINX
This configures Shabitica to run on ``shabitica.example.org`` with an `NGINX
reverse proxy`_. If you don't provide any options, it will run on your local
machine only.

Expand All @@ -71,5 83,5 @@ Ideas
.. _Nix: https://nixos.org/nix/
.. _NixOS configuration: https://nixos.org/nixos/manual/index.html#sec-configuration-file
.. _NixOS: https://nixos.org/
.. _manual: https://headcounter.org/hydra/job/headcounter/habitica/manual/latest/download
.. _manual: https://headcounter.org/hydra/job/shabitica/nixos-18.03/manual/latest/download
.. _NGINX reverse proxy: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
10 changes: 5 additions & 5 deletions build-vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 44,10 @@ let
in {
imports = [ ./. zshModule ];

habitica.hostName = "localhost";
habitica.baseURL = "http://localhost:3000";
habitica.config.ENABLE_CONSOLE_LOGS_IN_PROD = "true";
habitica.insecureDB = true;
shabitica.hostName = "localhost";
shabitica.baseURL = "http://localhost:3000";
shabitica.config.ENABLE_CONSOLE_LOGS_IN_PROD = "true";
shabitica.insecureDB = true;

environment.systemPackages = [
pkgs.htop pkgs.mongodb-tools
Expand Down Expand Up @@ -75,7 75,7 @@ let
users.defaultUserShell = "/var/run/current-system/sw/bin/zsh";
time.timeZone = "Europe/Berlin";

networking.hostName = "habitica-dev";
networking.hostName = "shabitica-dev";
networking.firewall.enable = false;

services.postfix.enable = true;
Expand Down
8 changes: 4 additions & 4 deletions dbtools.nix
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
{ runCommand, mongodb-tools, mongodb, makeWrapper

, socketPath ? "/run/habitica/db.sock"
, socketPath ? "/run/shabitica/db.sock"
}:

let
Expand All @@ -12,15 12,15 @@ let
'';
});

in runCommand "habitica-db-tools" {
in runCommand "shabitica-db-tools" {
nativeBuildInputs = [ makeWrapper ];
inherit socketPath;
} ''
mkdir -p "$out/bin"
for i in dump restore export import; do
makeWrapper "${patchedTools}/bin/mongo$i" "$out/bin/habitica-db-$i"
makeWrapper "${patchedTools}/bin/mongo$i" "$out/bin/shabitica-db-$i"
done
makeWrapper "${mongodb}/bin/mongo" "$out/bin/habitica-db-shell" \
makeWrapper "${mongodb}/bin/mongo" "$out/bin/shabitica-db-shell" \
--add-flags "mongodb://$socketPath/admin"
''
Loading

0 comments on commit 5c01922

Please sign in to comment.