run most containers and back them up at home
* switch backup from wasabi-s3 to btrfs via ssh * add srv0 at home * run webserver and syncthing at home
This commit is contained in:
parent
2a2715d447
commit
406ab7be7e
12 changed files with 330 additions and 123 deletions
8
nix/os/devices/srv0.home-ch.stefanjunker.de/boot.nix
Normal file
8
nix/os/devices/srv0.home-ch.stefanjunker.de/boot.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ lib
|
||||
, ...
|
||||
}:
|
||||
|
||||
{
|
||||
boot.loader.grub.efiSupport = true;
|
||||
boot.extraModulePackages = [ ];
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
disabledModules = [
|
||||
];
|
||||
imports = [
|
||||
../../profiles/common/configuration.nix
|
||||
../../modules/opinionatedDisk.nix
|
||||
|
||||
./system.nix
|
||||
./hw.nix
|
||||
./pkg.nix
|
||||
./boot.nix
|
||||
];
|
||||
}
|
31
nix/os/devices/srv0.home-ch.stefanjunker.de/hw.nix
Normal file
31
nix/os/devices/srv0.home-ch.stefanjunker.de/hw.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ ... }:
|
||||
|
||||
let
|
||||
stage1Modules = [
|
||||
"aesni_intel"
|
||||
"kvm-intel"
|
||||
"aes_x86_64"
|
||||
|
||||
"virtio_balloon"
|
||||
"virtio_scsi"
|
||||
"virtio_net"
|
||||
"virtio_pci"
|
||||
"virtio_ring"
|
||||
"virtio"
|
||||
"scsi_mod"
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
# TASK: new device
|
||||
hardware.opinionatedDisk = {
|
||||
enable = true;
|
||||
encrypted = false;
|
||||
diskId = "ata-Crucial_CT750MX300SSD1_16161311C7A6";
|
||||
};
|
||||
|
||||
boot.initrd.availableKernelModules = stage1Modules;
|
||||
boot.initrd.kernelModules = stage1Modules;
|
||||
boot.extraModprobeConfig = ''
|
||||
'';
|
||||
}
|
53
nix/os/devices/srv0.home-ch.stefanjunker.de/pkg.nix
Normal file
53
nix/os/devices/srv0.home-ch.stefanjunker.de/pkg.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{ config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
||||
{
|
||||
nixpkgs.config.packageOverrides = pkgs: with pkgs; {
|
||||
nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath;
|
||||
};
|
||||
home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; };
|
||||
|
||||
nix.buildMachines = [
|
||||
{ hostName = "localhost";
|
||||
system = "x86_64-linux";
|
||||
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"];
|
||||
maxJobs = 4;
|
||||
}
|
||||
];
|
||||
|
||||
# services.hydra = {
|
||||
# enable = false;
|
||||
# hydraURL = "http://localhost:3000"; # externally visible URL
|
||||
# notificationSender = "hydra@${config.networking.hostName}.stefanjunker.de"; # e-mail of hydra service
|
||||
# # a standalone hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines
|
||||
# buildMachinesFiles = [];
|
||||
# # you will probably also want, otherwise *everything* will be built from scratch
|
||||
# useSubstitutes = true;
|
||||
# };
|
||||
|
||||
# services.gitlab-runner = {
|
||||
# enable = false;
|
||||
|
||||
# extraPackages = with pkgs; [
|
||||
# bash
|
||||
# gitlab-runner
|
||||
# nix
|
||||
# gitFull
|
||||
# git-crypt
|
||||
# ];
|
||||
|
||||
# concurrent = 2;
|
||||
# checkInterval = 0;
|
||||
# services = {
|
||||
# nixRunner = {
|
||||
# executor = "shell";
|
||||
# runUntagged = true;
|
||||
# registrationConfigFile = "/etc/secrets/gitlab-runner/nix-runner.registration";
|
||||
# tagList = [ "nix" ];
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
}
|
93
nix/os/devices/srv0.home-ch.stefanjunker.de/system.nix
Normal file
93
nix/os/devices/srv0.home-ch.stefanjunker.de/system.nix
Normal file
|
@ -0,0 +1,93 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ... }:
|
||||
|
||||
let
|
||||
keys = import ../../../variables/keys.nix;
|
||||
|
||||
in {
|
||||
# TASK: new device
|
||||
networking.hostName = "srv0"; # Define your hostname.
|
||||
# networking.domain = "home-ch.stefanjunker.de";
|
||||
|
||||
networking.firewall.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
# iperf3
|
||||
5201
|
||||
];
|
||||
networking.firewall.logRefusedConnections = false;
|
||||
|
||||
networking.usePredictableInterfaceNames = false;
|
||||
networking.dhcpcd = {
|
||||
enable = true;
|
||||
persistent = true;
|
||||
};
|
||||
|
||||
networking.interfaces.eth0 = {
|
||||
useDHCP = true;
|
||||
# ipv6.addresses = [
|
||||
# { address = "2a02:c207:3003:2387::1"; prefixLength = 64; }
|
||||
# ];
|
||||
};
|
||||
|
||||
# networking.defaultGateway6 = {
|
||||
# address = "fe80::1";
|
||||
# interface = "eth0";
|
||||
# };
|
||||
|
||||
networking.nat = {
|
||||
enable = true;
|
||||
internalInterfaces = [ "ve-+" ];
|
||||
externalInterface = "eth0";
|
||||
};
|
||||
|
||||
# Kubernetes
|
||||
# services.kubernetes.roles = ["master" "node"];
|
||||
|
||||
# virtualization
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
};
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
};
|
||||
|
||||
networking.useHostResolvConf = true;
|
||||
|
||||
containers = {
|
||||
webserver = import ../../containers/webserver.nix {
|
||||
hostAddress = "192.168.100.12";
|
||||
localAddress = "192.168.100.13";
|
||||
|
||||
httpsPort = 443;
|
||||
};
|
||||
|
||||
syncthing = import ../../containers/syncthing.nix {
|
||||
hostAddress = "192.168.100.14";
|
||||
localAddress = "192.168.100.15";
|
||||
|
||||
syncthingPort = 22000;
|
||||
};
|
||||
|
||||
backup = import ../../containers/backup.nix {
|
||||
inherit config;
|
||||
hostAddress = "192.168.100.16";
|
||||
localAddress = "192.168.100.17";
|
||||
subvolumes = [
|
||||
"webserver"
|
||||
"backup"
|
||||
"syncthing"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "20.03"; # Did you read the comment?
|
||||
}
|
37
nix/os/devices/srv0.home-ch.stefanjunker.de/versions.nix
Normal file
37
nix/os/devices/srv0.home-ch.stefanjunker.de/versions.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
let
|
||||
nixpkgs = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "nixos-20.09";
|
||||
rev = "51aaa3fa1b69559456f9bd4968bd5b179a784f67";
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
inherit nixpkgs;
|
||||
"channels-nixos-stable" = nixpkgs;
|
||||
"channels-nixos-20.03" = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "nixos-20.03";
|
||||
rev = "ff6fda61600cc60404bab5cb6b18b8636785b7bc";
|
||||
};
|
||||
"channels-nixos-19.09" = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "nixos-19.09";
|
||||
rev = "75f4ba05c63be3f147bcc2f7bd4ba1f029cedcb1";
|
||||
};
|
||||
"channels-nixos-unstable" = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "nixos-unstable";
|
||||
rev = "24c9b05ac53e422f1af81a156f1fd58499eb27fb";
|
||||
};
|
||||
"nixpkgs-master" = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "master";
|
||||
rev = "9b3e35d991ea6a43f256069dcb2e006006730d05";
|
||||
};
|
||||
"home-manager-module" = {
|
||||
url = "https://github.com/nix-community/home-manager";
|
||||
ref = "release-20.09";
|
||||
rev = "7339784e07217ed0232e08d1ea33b610c94657d8";
|
||||
};
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
let
|
||||
nixpkgs = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "nixos-20.09";
|
||||
rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d '\n' -%>";
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
inherit nixpkgs;
|
||||
"channels-nixos-stable" = nixpkgs;
|
||||
"channels-nixos-20.03" = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "nixos-20.03";
|
||||
rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.03 | awk '{ print $1 }' | tr -d '\n' -%>";
|
||||
};
|
||||
"channels-nixos-19.09" = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "nixos-19.09";
|
||||
rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-19.09 | awk '{ print $1 }' | tr -d '\n' -%>";
|
||||
};
|
||||
"channels-nixos-unstable" = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "nixos-unstable";
|
||||
rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>";
|
||||
};
|
||||
"nixpkgs-master" = {
|
||||
url = "https://github.com/NixOS/nixpkgs/";
|
||||
ref = "master";
|
||||
rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>";
|
||||
};
|
||||
"home-manager-module" = {
|
||||
url = "https://github.com/nix-community/home-manager";
|
||||
ref = "release-20.09";
|
||||
rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-20.09 | awk '{ print $1 }' | tr -d '\n' -%>";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue