From d025be66e6645e346fb0f90a619bc0e40b150a66 Mon Sep 17 00:00:00 2001 From: Syahrial Agni Prasetya Date: Mon, 17 May 2021 14:41:58 +0700 Subject: [PATCH] Create NIXOS_INSTALL.md --- NIXOS_INSTALL.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 NIXOS_INSTALL.md diff --git a/NIXOS_INSTALL.md b/NIXOS_INSTALL.md new file mode 100644 index 0000000..864acab --- /dev/null +++ b/NIXOS_INSTALL.md @@ -0,0 +1,55 @@ +# Installation (NixOS) +## Install methods +### Declarative Nix +To install with nix, create a `.nix` file like this and import it to your `configuration.nix` : +```nix +{ config, pkgs, ... }: + +let + archbox = pkgs.stdenv.mkDerivation rec { + name = "archbox"; + src = pkgs.fetchFromGitHub { + owner = "your_user_here"; + repo = "archbox"; + rev = "rev_here"; + sha256 = "rev_sha256_here"; + }; + sourceRoot = "."; + installPhase = '' + mkdir -p $out + cd source + export FORCE_INSTALL_CONFIG=1 + export ETC_DIR=$out/etc + export PREFIX=$out + export ARCHBOX_USER=your_user_here + export MOUNT_RUN=no + ${pkgs.bash}/bin/bash install.sh + ''; + }; +in +{ + environment.systemPackages = [ archbox ]; + environment.etc = { + "archbox.conf" = { + source = "${archbox}/etc/archbox.conf"; + }; + }; +} +``` +Configuration can be done by modifying `installPhase` e.g. : +```sh +mkdir -p $out +cd source +export FORCE_INSTALL_CONFIG=1 +export ETC_DIR=$out/etc +export PREFIX=$out +export ARCHBOX_USER=lemni +export MOUNT_RUN=no +export ENV_VAR="TERM=foot" +export SHARED_FOLDER=( /home /var/www ) +${pkgs.bash}/bin/bash install.sh +``` +### Regular Installation +See [INSTALL.md](INSTALL.md) +## Issues +See [issues](https://github.com/lemniskett/archbox/#nixos-specific-issues)