Modified directory creation process

This commit is contained in:
Illia Chub 2020-12-21 15:18:22 +02:00
parent b2ccc9be90
commit 2c25fbdf10

View file

@ -9,6 +9,13 @@ makeConf() {
[[ -e /etc/nixos/configuration.nix ]] && return 0
# NB <<"EOF" quotes / $ ` in heredocs, <<EOF does not
mkdir -p /etc/nixos
mkdir -p /etc/nixos/mailserver/system
mkdir -p /etc/nixos/letsencrypt
mkdir /etc/nixos/backup
mkdir /etc/nixos/passmgr/
mkdir /etc/nixos/nginx
mkdir /etc/nixos/git
# Prevent grep for sending error code 1 (and halting execution) when no lines are selected : https://www.unix.com/man-page/posix/1P/grep
local IFS=$'\n'
for trypath in /root/.ssh/authorized_keys $HOME/.ssh/authorized_keys; do
@ -56,8 +63,6 @@ EOF
}
EOF
mkdir -p /etc/nixos/mailserver/system
mkdir /etc/nixos/mailserver/
cat > /etc/nixos/mailserver/system/mailserver.nix << EOF
{ config, pkgs, lib, ... }:
{
@ -133,7 +138,6 @@ EOF
}
EOF
mkdir -p /etc/nixos/letsencrypt
cat > /etc/nixos/letsencrypt/acme.nix << EOF
{ pkgs, ... }:
{
@ -167,7 +171,6 @@ EOF
}
EOF
mkdir -p /etc/nixos/letsencrypt
cat > /etc/nixos/letsencrypt/certbot.nix << EOF
{ pkgs, ... }:
{
@ -190,7 +193,6 @@ EOF
}
EOF
mkdir /etc/nixos/backup
cat > /etc/nixos/backup/restic.nix << EOF
{ pkgs, ... }:
{
@ -225,7 +227,6 @@ AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
}
EOF
mkdir /etc/nixos/passmgr/
cat > /etc/nixos/passmgr/bitwarden.nix << EOF
{ pkgs, ... }:
{
@ -243,7 +244,6 @@ EOF
}
EOF
mkdir /etc/nixos/nginx
cat > /etc/nixos/nginx/nginx.nix << EOF
{ pkgs, ... }:
{
@ -358,7 +358,6 @@ cat > /etc/nixos/backup/nextcloud.nix << EOF
}
EOF
mkdir /etc/nixos/git
cat > /etc/nixos/git/gitea.nix << EOF
{ pkgs, ... }:
{