Simplify the Sway config files
This commit is contained in:
parent
9299782075
commit
bbd3d080b5
|
@ -24,5 +24,5 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "bomberman";
|
networking.hostName = "bomberman";
|
||||||
networking.wireguard.interfaces."${config.ips.wgInt}".ips = [ "${config.ips.wgSpan}.19/24" ];
|
networking.wireguard.interfaces.wgc.ips = [ "10.100.0.19/24" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway.config = {
|
||||||
config = {
|
|
||||||
bars = [ {command = "waybar";} ];
|
bars = [ {command = "waybar";} ];
|
||||||
|
|
||||||
startup = [
|
startup = [
|
||||||
|
@ -27,5 +26,4 @@
|
||||||
{command = "thunderbird";}
|
{command = "thunderbird";}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,33 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway.config = {
|
||||||
config = {
|
|
||||||
# Define monitors
|
# Define monitors
|
||||||
output = {
|
output = {
|
||||||
${config.displays.d1} = {
|
${config.displays.d1} = {
|
||||||
pos = "1920 405";
|
pos = "3840 405";
|
||||||
mode = "1920x1080@143.980Hz";
|
mode = "1920x1080@143.980Hz";
|
||||||
max_render_time = "3";
|
max_render_time = "3";
|
||||||
bg = "~/.assets/wallpapers/1.png fill";
|
bg = "~/.assets/wallpapers/1.png fill";
|
||||||
adaptive_sync = "on";
|
adaptive_sync = "on";
|
||||||
};
|
};
|
||||||
${config.displays.d2} = {
|
${config.displays.d2} = {
|
||||||
pos = "0 405";
|
pos = "1920 405";
|
||||||
mode = "1920x1080@60Hz";
|
mode = "1920x1080@60Hz";
|
||||||
max_render_time = "3";
|
max_render_time = "3";
|
||||||
bg = "~/.assets/wallpapers/2.png fill";
|
bg = "~/.assets/wallpapers/2.png fill";
|
||||||
};
|
};
|
||||||
${config.displays.d3} = {
|
${config.displays.d3} = {
|
||||||
pos = "3840 0";
|
pos = "5760 0";
|
||||||
mode = "1680x1050@59.883Hz";
|
mode = "1680x1050@59.883Hz";
|
||||||
transform = "270";
|
transform = "270";
|
||||||
max_render_time = "3";
|
max_render_time = "3";
|
||||||
bg = "~/.assets/wallpapers/3.png fill";
|
bg = "~/.assets/wallpapers/3.png fill";
|
||||||
};
|
};
|
||||||
|
${config.displays.d4} = {
|
||||||
|
pos = "0 405";
|
||||||
|
mode = "1920x1080@60Hz";
|
||||||
|
max_render_time = "3";
|
||||||
|
};
|
||||||
"*" = {
|
"*" = {
|
||||||
bg = "~/.assets/wallpapers/1.png fill";
|
bg = "~/.assets/wallpapers/1.png fill";
|
||||||
};
|
};
|
||||||
|
@ -47,5 +51,4 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway.config = let
|
||||||
config = let
|
|
||||||
# Set default modifier and variables
|
# Set default modifier and variables
|
||||||
primeMod = "Mod4";
|
primeMod = "Mod4";
|
||||||
secMod = "Mod1";
|
secMod = "Mod1";
|
||||||
|
@ -224,5 +223,4 @@
|
||||||
"${primeMod}+Shift+Backslash" = ''[app_id="com.github.wwmm.easyeffects"] scratchpad show, move position center, resize set 1000 800'';
|
"${primeMod}+Shift+Backslash" = ''[app_id="com.github.wwmm.easyeffects"] scratchpad show, move position center, resize set 1000 800'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway.config = {
|
||||||
config = {
|
|
||||||
# Assign workspaces to config
|
# Assign workspaces to config
|
||||||
workspaceOutputAssign = let
|
workspaceOutputAssign = let
|
||||||
workspaces1 = [
|
workspaces1 = [
|
||||||
|
@ -137,5 +136,4 @@
|
||||||
};
|
};
|
||||||
focus.newWindow = "focus";
|
focus.newWindow = "focus";
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway.config = {
|
||||||
config = {
|
|
||||||
colors = {
|
colors = {
|
||||||
focused = {
|
focused = {
|
||||||
border = "#${config.look.colors.prime}";
|
border = "#${config.look.colors.prime}";
|
||||||
|
@ -41,5 +40,4 @@
|
||||||
smartGaps = true;
|
smartGaps = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
allowPing = false;
|
allowPing = false;
|
||||||
extraInputRules = ''
|
extraInputRules = ''
|
||||||
${lib.optionalString (!config.system.firewall.server.enable) ''
|
${lib.optionalString (!config.system.firewall.server.enable) ''
|
||||||
ip saddr { ${config.ips.server}, ${config.ips.wgSpan}.1 } accept comment "Accept Server"
|
ip saddr { ${config.ips.server}, 10.100.0.1 } accept comment "Accept Server"
|
||||||
''}
|
''}
|
||||||
${lib.optionalString config.system.firewall.server.enable ''
|
${lib.optionalString config.system.firewall.server.enable ''
|
||||||
ip saddr { ${config.ips.localSpan}.0/24, ${config.ips.wgSpan}.0/24 } tcp dport 2049 accept comment "Accept NFS"
|
ip saddr { ${config.ips.localSpan}.0/24, 10.100.0.0/24 } tcp dport 2049 accept comment "Accept NFS"
|
||||||
ip saddr { ${config.ips.pc}, ${config.secrets.lunaIP}, ${config.secrets.cornIP} } tcp dport { 1935, 1945 } accept comment "Accept RTMP"
|
ip saddr { ${config.ips.pc}, ${config.secrets.lunaIP}, ${config.secrets.cornIP} } tcp dport { 1935, 1945 } accept comment "Accept RTMP"
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
chain PREROUTING {
|
chain PREROUTING {
|
||||||
type nat hook prerouting priority dstnat; policy accept;
|
type nat hook prerouting priority dstnat; policy accept;
|
||||||
tcp dport 2211 dnat to ${config.ips.pc}:22 comment "SSH to PC"
|
tcp dport 2211 dnat to ${config.ips.pc}:22 comment "SSH to PC"
|
||||||
tcp dport 2222 dnat to ${config.ips.wgSpan}.19:22 comment "SSH to Oracle VM"
|
tcp dport 2222 dnat to 10.100.0.19:22 comment "SSH to Oracle VM"
|
||||||
|
|
||||||
udp dport { 27005, 27015, 7777 } dnat to ${config.ips.pc} comment "PC Hosted Games"
|
udp dport { 27005, 27015, 7777 } dnat to ${config.ips.pc} comment "PC Hosted Games"
|
||||||
|
|
||||||
|
|
|
@ -24,36 +24,36 @@
|
||||||
nat = {
|
nat = {
|
||||||
enable = config.system.wireguard.server.enable;
|
enable = config.system.wireguard.server.enable;
|
||||||
externalInterface = "${config.ips.netInt}";
|
externalInterface = "${config.ips.netInt}";
|
||||||
internalInterfaces = [ "${config.ips.wgInt}" ];
|
internalInterfaces = [ "wgs" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
wireguard.interfaces = {
|
wireguard.interfaces = {
|
||||||
"wgc" = lib.mkIf config.system.wireguard.client.enable {
|
wgc = lib.mkIf config.system.wireguard.client.enable {
|
||||||
# Define IP of client in per device config
|
# Define IP of client in per device config
|
||||||
listenPort = 51820;
|
listenPort = 51820;
|
||||||
privateKey = config.secrets.wgClientPriv;
|
privateKey = config.secrets.wgClientPriv;
|
||||||
peers = [
|
peers = [
|
||||||
{ # NixOS Server
|
{ # NixOS Server
|
||||||
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
|
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
|
||||||
allowedIPs = [ "${config.ips.wgSpan}.0/24" ];
|
allowedIPs = [ "10.100.0.0/24" ];
|
||||||
endpoint = "sv.${config.domains.jim1}:51820";
|
endpoint = "sv.${config.domains.jim1}:51820";
|
||||||
persistentKeepalive = 25;
|
persistentKeepalive = 25;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"wgs" = lib.mkIf config.system.wireguard.server.enable {
|
wgs = lib.mkIf config.system.wireguard.server.enable {
|
||||||
ips = [ "${config.ips.wgSpan}.1/24" ];
|
ips = [ "10.100.0.1/24" ];
|
||||||
listenPort = 51820;
|
listenPort = 51820;
|
||||||
privateKey = config.secrets.wgServerPriv;
|
privateKey = config.secrets.wgServerPriv;
|
||||||
peers = [
|
peers = [
|
||||||
{ # NixOS
|
{ # NixOS
|
||||||
publicKey = "OKUH/h6YSURI4vgeTZKQD15QsqaygdbTn1mAWzQp9S0=";
|
publicKey = "OKUH/h6YSURI4vgeTZKQD15QsqaygdbTn1mAWzQp9S0=";
|
||||||
allowedIPs = [ "${config.ips.wgSpan}.16/28" ];
|
allowedIPs = [ "10.100.0.16/28" ];
|
||||||
}
|
}
|
||||||
{ # Pixel 9
|
{ # Pixel 9
|
||||||
publicKey = "dPCtjm67adMZCnyL1O2L+uUOk0RbjA9T/tht1r+qcE4=";
|
publicKey = "dPCtjm67adMZCnyL1O2L+uUOk0RbjA9T/tht1r+qcE4=";
|
||||||
allowedIPs = [ "${config.ips.wgSpan}.2/32" ];
|
allowedIPs = [ "10.100.0.2/32" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,9 +6,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
config.displays = {
|
config.displays = {
|
||||||
d1 = "DP-3";
|
d1 = "DP-2";
|
||||||
d2 = "DP-1";
|
d2 = "DP-3";
|
||||||
d3 = "DP-2";
|
d3 = "DP-1";
|
||||||
|
d4 = "HDMI-A-1";
|
||||||
dI = "eDP-1";
|
dI = "eDP-1";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,5 @@
|
||||||
pc = "${localSpan}.3";
|
pc = "${localSpan}.3";
|
||||||
vm = "${localSpan}.4";
|
vm = "${localSpan}.4";
|
||||||
hx = "${localSpan}.70";
|
hx = "${localSpan}.70";
|
||||||
|
|
||||||
wgInt = "wg0";
|
|
||||||
wgSpan = "10.100.0";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue