Various changes
- `hs` host - cam subdomain behind reverse proxy - dynamic dns updater script - `pc` host - ext4 instead of btrfs - ca-derivations experimental feature - nix from unstable channel (2.8) - cura from stable (unstable went broken) - Emacs - company-nixos-options - helm-nixos-options - nix-modeline - disable format hook on save for nix mode - nix from master (only in overlay, not used) - bat (alias for cat) - batman (alias for batman) - disabled weird extra options for nix I couldn't even remember of - Fira Code for sway/waybar - New plain style for waybar
This commit is contained in:
parent
23b4989e7f
commit
8b80ba24c2
13 changed files with 105 additions and 183 deletions
|
@ -210,9 +210,7 @@
|
|||
'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
|
||||
'';
|
||||
virtualHosts = {
|
||||
|
||||
"torrent.ccr.ydns.eu" = {
|
||||
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
@ -252,10 +250,55 @@
|
|||
proxyPass = "http://192.168.1.71:80";
|
||||
};
|
||||
};
|
||||
|
||||
"cam.ccr.ydns.eu" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://192.168.1.80:80";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
systemd.services.ydns =
|
||||
let
|
||||
ydnsUpdater = pkgs.writeScriptBin "ydnsUpdater" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
USER="andrea.ciceri@autistici.org"
|
||||
PASSWORD=$(${pkgs.stdenv}/bin/cat /home/ccr/.ydns-password)
|
||||
DOMAIN="ccr.ydns.eu"
|
||||
|
||||
for SUBDOMAIN in "books" "music" "sync" "torrent" "gate" "cam"
|
||||
do
|
||||
HOST="$SUBDOMAIN.$DOMAIN"
|
||||
${pkgs.curl}/bin/curl --basic -u "$USER:$PASSWORD" --silent https://ydns.io/api/v1/update/?host=$HOST
|
||||
done
|
||||
${pkgs.curl}/bin/curl --basic -u "$USER:$PASSWORD" --silent https://ydns.io/api/v1/update/?host=$DOMAIN
|
||||
'';
|
||||
in
|
||||
{
|
||||
description = "YDNS IP updater";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
User = "ccr";
|
||||
Type = "oneshot";
|
||||
ExecStart = "${ydnsUpdater}/bin/ydnsUpdater";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.timers.ydnsUpdater = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
partOf = [ "ydnsUpdater.service" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* *:00:00"; # hourly
|
||||
Unit = "ydnsUpdater.service";
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowPing = true;
|
||||
|
|
|
@ -38,7 +38,13 @@
|
|||
fileSystems."/" =
|
||||
{
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "btrfs";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{
|
||||
device = "/dev/disk/by-label/home";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
|
@ -49,15 +55,16 @@
|
|||
automatic = true;
|
||||
options = "--delete-older-than 3d";
|
||||
};
|
||||
# package = pkgs.nixFromMaster;
|
||||
package = pkgs.nix; # currently from unstable through an overlay
|
||||
extraOptions = ''
|
||||
experimental-features = ca-derivations
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowPing = true;
|
||||
allowedTCPPorts = [
|
||||
5900 # vnc
|
||||
];
|
||||
};
|
||||
|
||||
# TODO: disable, only for playing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue