Create NIXOS_INSTALL.md

This commit is contained in:
Syahrial Agni Prasetya 2021-05-17 14:41:58 +07:00 committed by GitHub
parent 28b1123a0c
commit d025be66e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

55
NIXOS_INSTALL.md Normal file
View File

@ -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)