Refactored configurations for better readability
This commit is contained in:
parent
6f45bb36cb
commit
3ce33993be
9 changed files with 192 additions and 89 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
nextcloud/adminpass
|
||||
|
||||
nixos/imports/nextcloud-admin-pass
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
|
||||
|
||||
|
||||
[?25l[0m [38;2;3;77;118;48;2;3;92;142m▌[38;2;3;104;160;48;2;3;112;173m▌[38;2;2;118;182;48;2;3;121;186m▌[38;2;3;121;187;48;2;2;118;183m▌[38;2;2;113;174;48;2;3;104;161m▌[38;2;3;93;143;48;2;3;78;120m▌[0m [0m
|
||||
[7m[38;2;3;78;120m▌[0m[38;2;3;96;148;48;2;3;108;167m▌[38;2;2;115;178;48;2;1;118;182m▌[38;2;2;117;180;48;2;3;112;172m▌[38;2;2;101;156;48;2;3;86;132m▌[0m [38;2;4;95;146;48;2;2;127;196m▌[38;2;0;129;200;48;2;0;129;200m░[38;2;3;106;163;48;2;3;75;115m▌[0m [38;2;3;74;113;48;2;3;104;160m▌[38;2;0;129;200;48;2;1;129;199m▒[38;2;1;128;197;48;2;4;98;151m▌[0m [38;2;3;86;132;48;2;2;101;156m▌[38;2;3;112;172;48;2;2;117;181m▌[38;2;1;118;182;48;2;2;115;178m▌[38;2;3;108;167;48;2;3;96;148m▌[0m[38;2;3;78;121m▌[0m [0m
|
||||
[38;2;8;84;127;48;2;1;129;199m▌[38;2;0;129;200;48;2;0;129;200m░[0m[38;2;4;112;173m▌[0m [38;2;5;85;130;48;2;0;129;200m▌[38;2;0;129;200m░[38;2;4;121;187m▌[38;2;0;129;200m░[0m[38;2;5;118;181m▌[0m [7m[38;2;4;115;176m▌[0m[38;2;0;129;200;48;2;0;129;200m░[48;2;3;124;191m▌[48;2;0;129;200m░[48;2;5;86;132m▌[0m [7m[38;2;4;112;173m▌[0m[38;2;0;129;200;48;2;0;129;200m░[38;2;1;129;199;48;2;8;85;129m▌[0m
|
||||
|
@ -5,3 +8,5 @@
|
|||
[7m[38;2;3;78;120m▌[0m[38;2;3;96;148;48;2;3;108;167m▌[38;2;2;115;178;48;2;1;118;182m▌[38;2;2;117;181;48;2;3;112;173m▌[38;2;2;101;156;48;2;3;86;133m▌[0m [38;2;4;94;145;48;2;2;126;196m▌[38;2;0;129;200;48;2;0;129;200m░[38;2;3;106;163;48;2;3;75;115m▌[0m [38;2;3;74;113;48;2;4;104;160m▌[38;2;2;128;199;48;2;0;129;200m░[38;2;1;127;197;48;2;4;97;150m▌[0m [38;2;3;85;130;48;2;2;100;154m▌[38;2;3;110;170;48;2;2;115;178m▌[38;2;2;117;180;48;2;2;114;176m▌[38;2;3;107;164;48;2;3;94;145m▌[0m[38;2;3;76;118m▌[0m [0m
|
||||
[38;2;3;77;118;48;2;3;92;142m▌[38;2;3;104;160;48;2;2;112;173m▌[38;2;2;118;182;48;2;3;121;186m▌[38;2;3;121;186;48;2;2;118;182m▌[38;2;2;113;174;48;2;3;104;161m▌[38;2;3;93;143;48;2;3;78;120m▌[0m [0m
|
||||
[?25h
|
||||
|
||||
|
||||
|
|
|
@ -6,19 +6,7 @@
|
|||
logo = {
|
||||
# Created with Chafa
|
||||
# chafa -s 26x13 -w 9 --symbols vhalf --view-size 26x13 cloud.png > cloud.txt
|
||||
source = ''
|
||||
|
||||
|
||||
[?25l[0m [38;2;3;77;118;48;2;3;92;142m▌[38;2;3;104;160;48;2;3;112;173m▌[38;2;2;118;182;48;2;3;121;186m▌[38;2;3;121;187;48;2;2;118;183m▌[38;2;2;113;174;48;2;3;104;161m▌[38;2;3;93;143;48;2;3;78;120m▌[0m [0m
|
||||
[7m[38;2;3;78;120m▌[0m[38;2;3;96;148;48;2;3;108;167m▌[38;2;2;115;178;48;2;1;118;182m▌[38;2;2;117;180;48;2;3;112;172m▌[38;2;2;101;156;48;2;3;86;132m▌[0m [38;2;4;95;146;48;2;2;127;196m▌[38;2;0;129;200;48;2;0;129;200m░[38;2;3;106;163;48;2;3;75;115m▌[0m [38;2;3;74;113;48;2;3;104;160m▌[38;2;0;129;200;48;2;1;129;199m▒[38;2;1;128;197;48;2;4;98;151m▌[0m [38;2;3;86;132;48;2;2;101;156m▌[38;2;3;112;172;48;2;2;117;181m▌[38;2;1;118;182;48;2;2;115;178m▌[38;2;3;108;167;48;2;3;96;148m▌[0m[38;2;3;78;121m▌[0m [0m
|
||||
[38;2;8;84;127;48;2;1;129;199m▌[38;2;0;129;200;48;2;0;129;200m░[0m[38;2;4;112;173m▌[0m [38;2;5;85;130;48;2;0;129;200m▌[38;2;0;129;200m░[38;2;4;121;187m▌[38;2;0;129;200m░[0m[38;2;5;118;181m▌[0m [7m[38;2;4;115;176m▌[0m[38;2;0;129;200;48;2;0;129;200m░[48;2;3;124;191m▌[48;2;0;129;200m░[48;2;5;86;132m▌[0m [7m[38;2;4;112;173m▌[0m[38;2;0;129;200;48;2;0;129;200m░[38;2;1;129;199;48;2;8;85;129m▌[0m
|
||||
[38;2;8;84;127;48;2;1;129;199m▌[38;2;0;129;200;48;2;0;129;200m░[0m[38;2;4;112;173m▌[0m [38;2;5;85;130;48;2;0;129;200m▌[38;2;0;129;200m░[38;2;4;122;187m▌[38;2;0;129;200m░[0m[38;2;5;118;181m▌[0m [7m[38;2;4;115;176m▌[0m[38;2;0;129;200;48;2;0;129;200m░[48;2;3;123;190m▌[48;2;0;129;200m░[48;2;5;85;130m▌[0m [7m[38;2;4;112;173m▌[0m[38;2;0;129;200;48;2;0;129;200m░[38;2;1;128;199;48;2;8;82;125m▌[0m
|
||||
[7m[38;2;3;78;120m▌[0m[38;2;3;96;148;48;2;3;108;167m▌[38;2;2;115;178;48;2;1;118;182m▌[38;2;2;117;181;48;2;3;112;173m▌[38;2;2;101;156;48;2;3;86;133m▌[0m [38;2;4;94;145;48;2;2;126;196m▌[38;2;0;129;200;48;2;0;129;200m░[38;2;3;106;163;48;2;3;75;115m▌[0m [38;2;3;74;113;48;2;4;104;160m▌[38;2;2;128;199;48;2;0;129;200m░[38;2;1;127;197;48;2;4;97;150m▌[0m [38;2;3;85;130;48;2;2;100;154m▌[38;2;3;110;170;48;2;2;115;178m▌[38;2;2;117;180;48;2;2;114;176m▌[38;2;3;107;164;48;2;3;94;145m▌[0m[38;2;3;76;118m▌[0m [0m
|
||||
[38;2;3;77;118;48;2;3;92;142m▌[38;2;3;104;160;48;2;2;112;173m▌[38;2;2;118;182;48;2;3;121;186m▌[38;2;3;121;186;48;2;2;118;182m▌[38;2;2;113;174;48;2;3;104;161m▌[38;2;3;93;143;48;2;3;78;120m▌[0m [0m
|
||||
[?25h
|
||||
|
||||
|
||||
'';
|
||||
source = builtins.readFile ./cloud.txt;
|
||||
type = "data";
|
||||
position = "left";
|
||||
padding = {
|
||||
|
|
|
@ -10,16 +10,18 @@ in {
|
|||
[
|
||||
# Include the default lxc/lxd configuration.
|
||||
"${modulesPath}/virtualisation/lxc-container.nix"
|
||||
# Include the container-specific autogenerated configuration.
|
||||
#./lxd.nix - this has to be commented out from the system tarball
|
||||
|
||||
# Nginx
|
||||
./imports/nginx.nix
|
||||
# Nextcloud
|
||||
./imports/nextcloud.nix
|
||||
# Snapraid-runner
|
||||
./imports/snapraid-runner.nix
|
||||
|
||||
./imports/snapraid.nix
|
||||
# Import hardware configuration.
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# OVERLAYS for custom packages.
|
||||
nixpkgs.overlays = [ (import ./overlays) ];
|
||||
|
||||
# NETWORKING
|
||||
|
@ -46,11 +48,6 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "chris@toph.cc";
|
||||
};
|
||||
|
||||
# LOCALE
|
||||
time.timeZone = timeZone;
|
||||
i18n.defaultLocale = defaultLocale;
|
||||
|
@ -104,13 +101,6 @@ in {
|
|||
# PROGRAMS & SERVICES
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
# Nextcloud
|
||||
environment.etc."nextcloud-admin-pass".text = "snYBkSxkFZ6a7Y";
|
||||
services.nextcloud = import ./imports/nextcloud.nix { inherit pkgs config; };
|
||||
|
||||
# Nginx
|
||||
services.nginx = import ./imports/nginx.nix;
|
||||
|
||||
# Shells
|
||||
environment.shells = with pkgs; [ bash fish ];
|
||||
programs.fish.enable = true;
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# The Nextcloud admin password is stored in a separate file to avoid
|
||||
environment.etc."nextcloud-admin-pass".text = builtins.readFile ./nextcloud-admin-pass;
|
||||
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
hostName = "cloud.ryot.foo";
|
||||
|
||||
|
@ -42,4 +46,5 @@
|
|||
adminuser = "admin";
|
||||
adminpassFile = "/etc/nextcloud-admin-pass";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,14 @@
|
|||
{
|
||||
# letsencrypt this wont do shit but allows things to work
|
||||
# i take care of this on dockge lxc
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "chris@toph.cc";
|
||||
};
|
||||
|
||||
# Nginx
|
||||
services.nginx = {
|
||||
|
||||
enable = true;
|
||||
|
||||
# Use recommended settings
|
||||
|
@ -20,4 +30,5 @@
|
|||
enableACME = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.etc."snapraid-runner.conf".text = builtins.readFile ../pkgs/snapraid-runner/snapraid-runner.conf;
|
||||
}
|
96
nixos/imports/snapraid.conf
Normal file
96
nixos/imports/snapraid.conf
Normal file
|
@ -0,0 +1,96 @@
|
|||
## /etc/snapraid.conf ##
|
||||
|
||||
# Example configuration for snapraid
|
||||
|
||||
# Defines the file to use as parity storage
|
||||
# It must NOT be in a data disk
|
||||
# Format: "parity FILE [,FILE] ..."
|
||||
parity /mnt/parity/snapraid.parity
|
||||
|
||||
# Defines the files to use as additional parity storage.
|
||||
# If specified, they enable the multiple failures protection
|
||||
# from two to six level of parity.
|
||||
# To enable, uncomment one parity file for each level of extra
|
||||
# protection required. Start from 2-parity, and follow in order.
|
||||
# It must NOT be in a data disk
|
||||
# Format: "X-parity FILE [,FILE] ..."
|
||||
#2-parity /mnt/parity2/snapraid.2-parity
|
||||
#3-parity /mnt/diskr/snapraid.3-parity
|
||||
#4-parity /mnt/disks/snapraid.4-parity
|
||||
#5-parity /mnt/diskt/snapraid.5-parity
|
||||
#6-parity /mnt/disku/snapraid.6-parity
|
||||
|
||||
# Defines the files to use as content list
|
||||
# You can use multiple specification to store more copies
|
||||
# You must have least one copy for each parity file plus one. Some more don't hurt
|
||||
# They can be in the disks used for data, parity or boot,
|
||||
# but each file must be in a different disk
|
||||
# Format: "content FILE"
|
||||
content /var/snapraid.content
|
||||
content /mnt/drive1/snapraid.content
|
||||
content /mnt/drive2/snapraid.content
|
||||
content /mnt/drive3/snapraid.content
|
||||
content /mnt/parity/snapraid.content
|
||||
|
||||
# Defines the data disks to use
|
||||
# The name and mount point association is relevant for parity, do not change it
|
||||
# WARNING: Adding here your /home, /var or /tmp disks is NOT a good idea!
|
||||
# SnapRAID is better suited for files that rarely changes!
|
||||
# Format: "data DISK_NAME DISK_MOUNT_POINT"
|
||||
data d1 /mnt/drive1/
|
||||
data d2 /mnt/drive2/
|
||||
data d3 /mnt/drive3/
|
||||
|
||||
# Excludes hidden files and directories (uncomment to enable).
|
||||
#nohidden
|
||||
|
||||
# Defines files and directories to exclude
|
||||
# Remember that all the paths are relative at the mount points
|
||||
# Format: "exclude FILE"
|
||||
# Format: "exclude DIR/"
|
||||
# Format: "exclude /PATH/FILE"
|
||||
# Format: "exclude /PATH/DIR/"
|
||||
exclude *.unrecoverable
|
||||
exclude /tmp/
|
||||
exclude /lost+found/
|
||||
|
||||
# Defines the block size in kibi bytes (1024 bytes) (uncomment to enable).
|
||||
# WARNING: Changing this value is for experts only!
|
||||
# Default value is 256 -> 256 kibi bytes -> 262144 bytes
|
||||
# Format: "blocksize SIZE_IN_KiB"
|
||||
#blocksize 256
|
||||
|
||||
# Defines the hash size in bytes (uncomment to enable).
|
||||
# WARNING: Changing this value is for experts only!
|
||||
# Default value is 16 -> 128 bits
|
||||
# Format: "hashsize SIZE_IN_BYTES"
|
||||
#hashsize 16
|
||||
|
||||
# Automatically save the state when syncing after the specified amount
|
||||
# of GB processed (uncomment to enable).
|
||||
# This option is useful to avoid to restart from scratch long 'sync'
|
||||
# commands interrupted by a machine crash.
|
||||
# It also improves the recovering if a disk break during a 'sync'.
|
||||
# Default value is 0, meaning disabled.
|
||||
# Format: "autosave SIZE_IN_GB"
|
||||
#autosave 500
|
||||
|
||||
# Defines the pooling directory where the virtual view of the disk
|
||||
# array is created using the "pool" command (uncomment to enable).
|
||||
# The files are not really copied here, but just linked using
|
||||
# symbolic links.
|
||||
# This directory must be outside the array.
|
||||
# Format: "pool DIR"
|
||||
#pool /pool
|
||||
|
||||
# Defines a custom smartctl command to obtain the SMART attributes
|
||||
# for each disk. This may be required for RAID controllers and for
|
||||
# some USB disk that cannot be autodetected.
|
||||
# In the specified options, the "%s" string is replaced by the device name.
|
||||
# Refers at the smartmontools documentation about the possible options:
|
||||
# RAID -> https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
# USB -> https://www.smartmontools.org/wiki/Supported_USB-Devices
|
||||
#smartctl d1 -d sat %s
|
||||
#smartctl d2 -d usbjmicron %s
|
||||
#smartctl parity -d areca,1/1 /dev/sg0
|
||||
#smartctl 2-parity -d areca,2/1 /dev/sg0
|
12
nixos/imports/snapraid.nix
Normal file
12
nixos/imports/snapraid.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.etc."snapraid-runner.conf".text = builtins.readFile ../pkgs/snapraid-runner/snapraid-runner.conf;
|
||||
environment.etc."snapraid.conf".text = builtins.readFile ./snapraid.conf;
|
||||
|
||||
# Enable the SnapRAID service
|
||||
# services.snapraid = {
|
||||
# enable = true;
|
||||
# configFile = "/etc/snapraid.conf";
|
||||
# };
|
||||
}
|
Loading…
Add table
Reference in a new issue