add keepalived conf?
This commit is contained in:
parent
6dc98e4ba3
commit
99a69bf1e9
1 changed files with 73 additions and 44 deletions
|
@ -3,16 +3,16 @@
|
|||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
# ./hardware-configuration.nix
|
||||
# Include the results of the hardware scan.
|
||||
# ./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
|
@ -25,12 +25,12 @@
|
|||
defaultGateway.address = "192.168.1.1";
|
||||
};
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
# environment.systemPackages = with pkgs; [
|
||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
# wget
|
||||
# ];
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
# environment.systemPackages = with pkgs; [
|
||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
# wget
|
||||
# ];
|
||||
|
||||
users = {
|
||||
users = {
|
||||
|
@ -39,24 +39,24 @@
|
|||
uid = 100000;
|
||||
group = "dockremap";
|
||||
subUidRanges = [
|
||||
{
|
||||
startUid = 100000;
|
||||
count = 65536;
|
||||
}
|
||||
{
|
||||
startUid = 100000;
|
||||
count = 65536;
|
||||
}
|
||||
];
|
||||
subGidRanges = [
|
||||
{
|
||||
startGid = 100000;
|
||||
count = 65536;
|
||||
}
|
||||
{
|
||||
startGid = 100000;
|
||||
count = 65536;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.
|
||||
programs = {
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
|
@ -76,7 +76,7 @@
|
|||
configure = {
|
||||
customRC = ''
|
||||
set number relativenumber
|
||||
'';
|
||||
'';
|
||||
};
|
||||
|
||||
defaultEditor = true;
|
||||
|
@ -90,25 +90,54 @@
|
|||
extraOptions = "--userns-remap=default";
|
||||
liveRestore = false; # NOTE: Incompatible with swarm
|
||||
};
|
||||
# List services that you want to enable:
|
||||
# List services that you want to enable:
|
||||
services.keepalived = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
extraConfig = ''
|
||||
vrrp_track_process track_traefik {
|
||||
process traefik
|
||||
weight 20
|
||||
delay 1
|
||||
}
|
||||
'';
|
||||
vrrpInstances = {
|
||||
VI_1 = {
|
||||
state = "BACKUP";
|
||||
interface = "enp0s31f6";
|
||||
virtualRouterId = 51;
|
||||
priority=100;
|
||||
virtualIps = [ {addr = "192.168.1.64";}];
|
||||
extraConfig = ''
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass 3141
|
||||
}
|
||||
track_process {
|
||||
track_traefik
|
||||
}
|
||||
advert_int 1
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
# Enable the OpenSSH daemon.
|
||||
# services.openssh.enable = true;
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
# services.openssh.enable = true;
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
# accidentally delete configuration.nix.
|
||||
# system.copySystemConfiguration = true;
|
||||
services.logind.lidSwitch = "ignore";
|
||||
systemd.targets.sleep.enable = false;
|
||||
systemd.targets.suspend.enable = false;
|
||||
systemd.targets.hibernate.enable = false;
|
||||
systemd.targets.hybrid-sleep.enable = false;
|
||||
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
# accidentally delete configuration.nix.
|
||||
# system.copySystemConfiguration = true;
|
||||
services.logind.lidSwitch = "ignore";
|
||||
systemd.targets.sleep.enable = false;
|
||||
systemd.targets.suspend.enable = false;
|
||||
systemd.targets.hibernate.enable = false;
|
||||
systemd.targets.hybrid-sleep.enable = false;
|
||||
|
||||
system.stateVersion = "24.05"; # Did you read the comment?
|
||||
}
|
||||
system.stateVersion = "24.05"; # Did you read the comment?
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue