Compare commits
4 commits
5851a73bbe
...
bc1a7c4092
Author | SHA1 | Date | |
---|---|---|---|
|
bc1a7c4092 | ||
|
ca9b9f6222 | ||
|
fbd3a669fd | ||
|
7f80d5a263 |
|
@ -34,6 +34,48 @@ let
|
||||||
1password&
|
1password&
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# clipsync = pkgs.writeShellScriptBin "clipsync" ''
|
||||||
|
# insert() {
|
||||||
|
# # Read all the piped input into variable.
|
||||||
|
# value=$(cat)
|
||||||
|
# wValue="$(wl-paste)"
|
||||||
|
# xValue="$(xclip -o -selection clipboard)"
|
||||||
|
|
||||||
|
# notify() {
|
||||||
|
# notify-send -u low -c clipboard "$1" "$value"
|
||||||
|
# }
|
||||||
|
|
||||||
|
# if [ "$value" != "$wValue" ]; then
|
||||||
|
# notify "Wayland"
|
||||||
|
# echo -n "$value" | wl-copy
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# if [ "$value" != "$xValue" ]; then
|
||||||
|
# notify "X11"
|
||||||
|
# echo -n "$value" | xclip -selection clipboard
|
||||||
|
# fi
|
||||||
|
# }
|
||||||
|
|
||||||
|
# watch() {
|
||||||
|
# # Wayland -> X11
|
||||||
|
# wl-paste --type text --watch clipsync insert &
|
||||||
|
|
||||||
|
# # X11 -> Wayland
|
||||||
|
# while clipnotify; do
|
||||||
|
# xclip -o -selection clipboard | clipsync insert
|
||||||
|
# done &
|
||||||
|
# }
|
||||||
|
|
||||||
|
# kill() {
|
||||||
|
# pkill wl-paste
|
||||||
|
# pkill clipnotify
|
||||||
|
# pkill xclip
|
||||||
|
# pkill clipsync
|
||||||
|
# }
|
||||||
|
# "$@"
|
||||||
|
# '';
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.${namespace}.desktop.hyprland = {
|
options.${namespace}.desktop.hyprland = {
|
||||||
|
@ -54,9 +96,14 @@ in
|
||||||
libnotify
|
libnotify
|
||||||
|
|
||||||
# Wayland Utilities
|
# Wayland Utilities
|
||||||
wl-clipboard
|
|
||||||
wlr-randr
|
wlr-randr
|
||||||
|
|
||||||
|
# Clipboard Stuff
|
||||||
|
wl-clipboard
|
||||||
|
xclip
|
||||||
|
clipnotify
|
||||||
|
# clipsync
|
||||||
|
|
||||||
# Screenshot Utility
|
# Screenshot Utility
|
||||||
grimblast
|
grimblast
|
||||||
|
|
||||||
|
@ -128,6 +175,8 @@ in
|
||||||
"[workspace 8 silent] vesktop"
|
"[workspace 8 silent] vesktop"
|
||||||
"[workspace 9 silent] 1password"
|
"[workspace 9 silent] 1password"
|
||||||
"[workspace 1 silent] zen"
|
"[workspace 1 silent] zen"
|
||||||
|
|
||||||
|
"${pkgs.xorg.xhost}/bin/xhost +"
|
||||||
];
|
];
|
||||||
|
|
||||||
windowrulev2 = [
|
windowrulev2 = [
|
||||||
|
|
29
modules/nixos/services/openssh/default.nix
Normal file
29
modules/nixos/services/openssh/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
namespace,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.${namespace}.services.openssh;
|
||||||
|
inherit (lib) mkIf mkEnableOption;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.${namespace}.services.openssh = {
|
||||||
|
enable = mkEnableOption "Enable SSH";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
KbdInteractiveAuthentication = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.fail2ban = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
48
modules/nixos/services/remotebuild/default.nix
Normal file
48
modules/nixos/services/remotebuild/default.nix
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
namespace,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.${namespace}.services.remotebuild;
|
||||||
|
inherit (lib) mkIf mkEnableOption;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.${namespace}.services.remotebuild = {
|
||||||
|
enable = mkEnableOption "Enable remotebuild";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
users.users.remotebuild = {
|
||||||
|
isNormalUser = true;
|
||||||
|
createHome = false;
|
||||||
|
group = "remotebuild";
|
||||||
|
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZjG+XPNoVHVdCel5MK4mwvtoFCqDY1WMI1yoU71Rd root@yggdrasil"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.remotebuild = { };
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
nrBuildUsers = 64;
|
||||||
|
settings = {
|
||||||
|
trusted-users = [ "remotebuild" ];
|
||||||
|
|
||||||
|
min-free = 10 * 1024 * 1024;
|
||||||
|
max-free = 200 * 1024 * 1024;
|
||||||
|
|
||||||
|
max-jobs = "auto";
|
||||||
|
cores = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.nix-daemon.serviceConfig = {
|
||||||
|
MemoryAccounting = true;
|
||||||
|
MemoryMax = "90%";
|
||||||
|
OOMScoreAdjust = 500;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -19,38 +19,6 @@ in
|
||||||
raspberry-pi-5
|
raspberry-pi-5
|
||||||
];
|
];
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
|
||||||
users.users.remotebuild = {
|
|
||||||
isNormalUser = true;
|
|
||||||
createHome = false;
|
|
||||||
group = "remotebuild";
|
|
||||||
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZjG+XPNoVHVdCel5MK4mwvtoFCqDY1WMI1yoU71Rd root@yggdrasil"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.remotebuild = { };
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
nrBuildUsers = 64;
|
|
||||||
settings = {
|
|
||||||
trusted-users = [ "remotebuild" ];
|
|
||||||
|
|
||||||
min-free = 10 * 1024 * 1024;
|
|
||||||
max-free = 200 * 1024 * 1024;
|
|
||||||
|
|
||||||
max-jobs = "auto";
|
|
||||||
cores = 0;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.nix-daemon.serviceConfig = {
|
|
||||||
MemoryAccounting = true;
|
|
||||||
MemoryMax = "90%";
|
|
||||||
OOMScoreAdjust = 500;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
interfaces.wlan0 = {
|
interfaces.wlan0 = {
|
||||||
ipv4.addresses = [
|
ipv4.addresses = [
|
||||||
|
@ -74,16 +42,15 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
networking.firewall = {
|
53
|
||||||
allowedTCPPorts = [
|
80
|
||||||
53
|
];
|
||||||
80
|
allowedUDPPorts = [
|
||||||
];
|
53
|
||||||
allowedUDPPorts = [
|
];
|
||||||
53
|
};
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.adguardhome = {
|
services.adguardhome = {
|
||||||
|
@ -126,6 +93,10 @@ in
|
||||||
"https://adguardteam.github.io/HostlistsRegistry/assets/filter_47.txt"
|
"https://adguardteam.github.io/HostlistsRegistry/assets/filter_47.txt"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
statistics = {
|
||||||
|
enabled = true;
|
||||||
|
interval = "8760h";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -156,17 +127,14 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
PasswordAuthentication = false;
|
|
||||||
KbdInteractiveAuthentication = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
${namespace} = {
|
${namespace} = {
|
||||||
submodules.basics = enabled;
|
submodules.basics = enabled;
|
||||||
|
|
||||||
|
services = {
|
||||||
|
openssh = enabled;
|
||||||
|
remotebuild = enabled;
|
||||||
|
};
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
# cachemiss for webkit gtk
|
# cachemiss for webkit gtk
|
||||||
hardware.networking.enable = mkForce false;
|
hardware.networking.enable = mkForce false;
|
||||||
|
|
|
@ -29,18 +29,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
PasswordAuthentication = false;
|
|
||||||
KbdInteractiveAuthentication = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.fail2ban = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
|
@ -101,6 +89,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit sopsFile;
|
inherit sopsFile;
|
||||||
};
|
};
|
||||||
|
openssh = enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
security = {
|
security = {
|
||||||
|
|
|
@ -80,9 +80,10 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
exec-once = [
|
exec-once = [
|
||||||
"xrandr --output DP-2 --primary"
|
|
||||||
"[workspace 1 silent] obsidian --disabled-gpu"
|
"[workspace 1 silent] obsidian --disabled-gpu"
|
||||||
"[workspace 9 silent] git-butler"
|
"[workspace 9 silent] git-butler"
|
||||||
|
|
||||||
|
"${pkgs.xorg.xrandr}/bin/xrandr --output DP-2 --primary"
|
||||||
];
|
];
|
||||||
|
|
||||||
workspace = [
|
workspace = [
|
||||||
|
|
Loading…
Reference in a new issue