Compare commits
5 Commits
cc95668f6d
...
nftables_t
| Author | SHA1 | Date | |
|---|---|---|---|
|
a624cbcfd1
|
|||
|
f7246dc661
|
|||
|
5fc1e89975
|
|||
|
071ee11601
|
|||
|
e4b6972c36
|
18
flake.lock
generated
18
flake.lock
generated
@@ -126,11 +126,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737672001,
|
"lastModified": 1738574474,
|
||||||
"narHash": "sha256-YnHJJ19wqmibLQdUeq9xzE6CjrMA568KN/lFPuSVs4I=",
|
"narHash": "sha256-rvyfF49e/k6vkrRTV4ILrWd92W+nmBDfRYZgctOyolQ=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "035f8c0853c2977b24ffc4d0a42c74f00b182cd8",
|
"rev": "fecfeb86328381268e29e998ddd3ebc70bbd7f7c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -243,11 +243,11 @@
|
|||||||
"nixpkgs-24_11": "nixpkgs-24_11"
|
"nixpkgs-24_11": "nixpkgs-24_11"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737201600,
|
"lastModified": 1737736848,
|
||||||
"narHash": "sha256-JBh5+g8oQteQdQqbO07dGHBRQo/NGI61JPlTjdfQ1pk=",
|
"narHash": "sha256-VrUfCXBXYV+YmQ2OvVTeML9EnmaPRtH+POrNIcJp6yo=",
|
||||||
"owner": "simple-nixos-mailserver",
|
"owner": "simple-nixos-mailserver",
|
||||||
"repo": "nixos-mailserver",
|
"repo": "nixos-mailserver",
|
||||||
"rev": "ade37b2765032f83d2d4bd50b6204a40a4c05eb4",
|
"rev": "6b425d13f5a9d73cb63973d3609acacef4d1e261",
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -263,11 +263,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737411508,
|
"lastModified": 1738291974,
|
||||||
"narHash": "sha256-j9IdflJwRtqo9WpM0OfAZml47eBblUHGNQTe62OUqTw=",
|
"narHash": "sha256-wkwYJc8cKmmQWUloyS9KwttBnja2ONRuJQDEsmef320=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "015d461c16678fc02a2f405eb453abb509d4e1d4",
|
"rev": "4c1251904d8a08c86ac6bc0d72cc09975e89aef7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -155,6 +155,7 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
magpie = nixpkgs.lib.nixosSystem rec {
|
magpie = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
|
|||||||
@@ -254,6 +254,7 @@ in
|
|||||||
TMP_FILE=$(${pkgs.coreutils}/bin/mktemp /tmp/.swaylock_ss_XXXXXX.jpg)
|
TMP_FILE=$(${pkgs.coreutils}/bin/mktemp /tmp/.swaylock_ss_XXXXXX.jpg)
|
||||||
${lib.getExe pkgs.grim} -t ppm - | ${pkgs.imagemagick}/bin/convert - -blur 0x12 "$TMP_FILE"
|
${lib.getExe pkgs.grim} -t ppm - | ${pkgs.imagemagick}/bin/convert - -blur 0x12 "$TMP_FILE"
|
||||||
${lib.getExe pkgs.swaylock} -f -i "$TMP_FILE"
|
${lib.getExe pkgs.swaylock} -f -i "$TMP_FILE"
|
||||||
|
${pkgs.coreutils}/bin/shred "$TMP_FILE"
|
||||||
${pkgs.coreutils}/bin/rm "$TMP_FILE"
|
${pkgs.coreutils}/bin/rm "$TMP_FILE"
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
@@ -298,14 +299,17 @@ in
|
|||||||
profile.outputs = [
|
profile.outputs = [
|
||||||
{
|
{
|
||||||
criteria = "eDP-1";
|
criteria = "eDP-1";
|
||||||
|
position = "3840,0";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
criteria = "Philips Consumer Electronics Company PHL 272S1 UHB2347026536";
|
criteria = "Philips Consumer Electronics Company PHL 272S1 UHB2347026536";
|
||||||
mode = "1920x1080@74.973Hz";
|
mode = "1920x1080@74.973Hz";
|
||||||
|
position = "5760,0";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
criteria = "Philips Consumer Electronics Company PHL 272S1 UHB2347026535";
|
criteria = "Philips Consumer Electronics Company PHL 272S1 UHB2347026535";
|
||||||
mode = "1920x1080@74.973Hz";
|
mode = "1920x1080@74.973Hz";
|
||||||
|
position = "7680,0";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
programs.z-lua = {
|
programs.z-lua = {
|
||||||
enableAliases = true;
|
enableAliases = true;
|
||||||
@@ -11,13 +11,13 @@
|
|||||||
defaultKeymap = "viins";
|
defaultKeymap = "viins";
|
||||||
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
cfind = "cscope -C -R -L1";
|
cfind = "${pkgs.cscope}/bin/cscope -C -R -L1";
|
||||||
chmod = "chmod -v";
|
chmod = "chmod -v";
|
||||||
chown = "chown -v";
|
chown = "chown -v";
|
||||||
cp = "cp -v";
|
cp = "cp -v";
|
||||||
rm = "rm -v";
|
rm = "rm -v";
|
||||||
ip = "ip --color=auto";
|
ip = "ip --color=auto";
|
||||||
f = "''$(pay-respects zsh)";
|
f = "''$(${lib.getExe pkgs.pay-respects} zsh)";
|
||||||
};
|
};
|
||||||
|
|
||||||
history = {
|
history = {
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||||
|
|
||||||
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
|
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
|
||||||
TMUX_EXE="${pkgs.tmux}/bin/tmux"
|
TMUX_EXE="${lib.getExe pkgs.tmux}"
|
||||||
systemd-run --scope --user $TMUX_EXE attach-session -t $USER || systemd-run --scope --user $TMUX_EXE new-session -s $USER
|
systemd-run --scope --user $TMUX_EXE attach-session -t $USER || systemd-run --scope --user $TMUX_EXE new-session -s $USER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -333,24 +333,28 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = "magpie";
|
networking.hostName = "magpie";
|
||||||
|
networking.firewall = {
|
||||||
networking.firewall.enable = true;
|
nftables.enable = true;
|
||||||
networking.firewall.allowedTCPPorts = [
|
enable = true;
|
||||||
|
allowedTCPPorts = [
|
||||||
80
|
80
|
||||||
443
|
443
|
||||||
587
|
587
|
||||||
2049
|
2049
|
||||||
]; # http, mail, mail, nfs
|
]; # http, mail, mail, nfs
|
||||||
networking.firewall.allowedUDPPorts = [
|
allowedUDPPorts = [
|
||||||
443
|
443
|
||||||
51820
|
51820
|
||||||
]; # mail, wireguard
|
]; # mail, wireguard
|
||||||
networking.firewall.allowPing = true;
|
allowPing = true;
|
||||||
networking.firewall.logRefusedConnections = lib.mkDefault false;
|
logRefusedConnections = lib.mkDefault false;
|
||||||
|
};
|
||||||
|
|
||||||
networking.nat.enable = true;
|
networking.nat = {
|
||||||
networking.nat.externalInterface = "enp1s0";
|
enable = true;
|
||||||
networking.nat.internalInterfaces = [ "wg0" ];
|
externalInterface = "enp1s0";
|
||||||
|
internalInterfaces = [ "wg0" ];
|
||||||
|
};
|
||||||
|
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
networking.wireless.enable = false;
|
networking.wireless.enable = false;
|
||||||
@@ -363,11 +367,11 @@
|
|||||||
# This allows the wireguard server to route your traffic to the internet and hence be like a VPN
|
# This allows the wireguard server to route your traffic to the internet and hence be like a VPN
|
||||||
# For this to work you have to set the dnsserver IP of your router (or dnsserver of choice) in your clients
|
# For this to work you have to set the dnsserver IP of your router (or dnsserver of choice) in your clients
|
||||||
postSetup = ''
|
postSetup = ''
|
||||||
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
|
${pkgs.nftables}/bin/nft add rule ip nat POSTROUTING oifname "eth0" ip saddr 10.100.0.0/24 counter masquerade
|
||||||
'';
|
'';
|
||||||
# This undoes the above command
|
# This undoes the above command, TODO fix command below to be more specific
|
||||||
postShutdown = ''
|
postShutdown = ''
|
||||||
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
|
${pkgs.nftables}/bin/nft flush table ip nat
|
||||||
'';
|
'';
|
||||||
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user