server and other shit

This commit is contained in:
martyTF 2026-04-11 17:21:28 +02:00
parent 270e1a0be4
commit 804371bf96
65 changed files with 1428 additions and 619 deletions

View file

@ -7,6 +7,8 @@
{
imports = [
./internet
./sync
./terminal
];
}

View file

@ -7,10 +7,8 @@
{
imports = [
./librewolf.nix
./zen-browser.nix
./tor.nix
./mail.nix
./rss.nix
./messaging.nix
./zen-browser.nix
];
}

View file

@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
osConfig,
...
}:
{
programs = {
thunderbird =
if osConfig.apps.internet.mail.enable then
{
enable = true;
profiles."default" = {
isDefault = true;
};
}
else
{ };
};
services = {
protonmail-bridge =
if osConfig.apps.internet.mail.providers.protonmail.enable then
{
enable = true;
package = pkgs.protonmail-bridge;
extraPackages = with pkgs; [
gnome-keyring
];
}
else
{ };
};
}

View file

@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
osConfig,
...
}:
{
programs = {
element-desktop =
if osConfig.apps.messaging.element.enable then
{
enable = true;
settings = {
default_server_config = {
"m.homeserver" = {
base_url =
if osConfig.apps.messaging.element.selfhosted then
"https://${osConfig.server.synapse.subdomain}.${osConfig.networking.domain}"
else
"https://matrix-client.matrix.org";
server_name =
if osConfig.apps.messaging.element.selfhosted then
"${osConfig.server.synapse.subdomain}.${osConfig.networking.domain}"
else
"matrix.org";
};
"m.identity_server" = {
base_url = "https://vector.im";
};
};
default_theme = "dark";
disable_custom_urls = false;
disable_guests = false;
disable_login_language_selector = false;
disable_3pid_login = false;
force_verification = false;
brand = "Element";
integrations_ui_url = "https://scalar.vector.im/";
integrations_rest_url = "https://scalar.vector.im/api";
};
}
else
{ };
};
}

View file

@ -3,6 +3,7 @@
lib,
pkgs,
inputs,
osConfig,
...
}:
let
@ -58,41 +59,44 @@ let
in
{
options = {
internet.browsers = {
zen-browser = {
enable = lib.mkEnableOption "enable zen-browser";
};
};
};
config = lib.mkIf config.internet.browsers.zen-browser.enable {
home.packages = [
(pkgs.wrapFirefox
inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.zen-browser-unwrapped
{
extraPrefs = lib.concatLines (
lib.mapAttrsToList (
name: value: ''lockPref(${lib.strings.toJSON name}, ${lib.strings.toJSON value});''
) prefs
);
extraPolicies = {
DisableTelemetry = true;
ExtensionSettings = builtins.listToAttrs extensions;
config =
if osConfig.apps.internet.browsers.zen-browser.enable then
{
home.packages = [
(pkgs.wrapFirefox
inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.zen-browser-unwrapped
{
extraPrefs = lib.concatLines (
lib.mapAttrsToList (
name: value: "lockPref(${lib.strings.toJSON name}, ${lib.strings.toJSON value});"
) prefs
);
extraPolicies = {
DisableTelemetry = true;
ExtensionSettings = builtins.listToAttrs extensions;
SearchEngines = {
Default = "MartyTF's Series of Tubes";
Add = [
{
Name = "MartyTF's Series of Tubes";
URLTemplate = "https://search.marty.tf/?q={searchTerms}";
IconURL = "https://wiki.nixos.org/favicon.ico";
Alias = "@sgx";
}
];
};
};
}
)
];
};
SearchEngines = {
Default = "kagi";
Add = [
{
Name = "MartyTF's Series of Tubes";
URLTemplate = "https://search.marty.tf/?q={searchTerms}";
IconURL = "https://wiki.nixos.org/favicon.ico";
Alias = "@sgx";
}
{
Name = "kagi";
URLTemplate = "https://kagi.com/search?q={searchTerms}";
IconURL = "https://kagi.com/asset/597c5c3/kagi_assets/logos/search.png?v=679b1c5d38deac3ff084fc704aa36694454572a2";
Alias = "@k";
}
];
};
};
}
)
];
}
else
{ };
}

View file

@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
osConfig,
...
}:
{
services = {
kdeconnect = {
enable = osConfig.apps.sync.kde-connect.enable;
indicator = osConfig.apps.sync.kde-connect.enable;
};
nextcloud-client = {
enable = osConfig.apps.sync.nextcloud.enable;
startInBackground = osConfig.apps.sync.nextcloud.enable;
};
};
}

View file

@ -13,9 +13,9 @@
enable = true;
enableGitIntegration = true;
shellIntegration = {
enableFishIntegration = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = osConfig.programs.fish.enable;
enableBashIntegration = osConfig.programs.bash.enable;
enableZshIntegration = osConfig.programs.zsh.enable;
};
font = {
name = "FiraCode Nerd Font";

View file

@ -26,7 +26,7 @@
vcs_backend_git = "enabled";
vcs_msg_length = 50;
preview_images = true;
preview_images_method = lib.mkIf config.terminal.kitty.enable "kitty";
preview_images_method = lib.mkIf osConfig.apps.terminal.kitty.enable "kitty";
preview_files = true;
preview_directories = true;
collapse_preview = false;

View file

@ -20,6 +20,34 @@
if osConfig.desktop.shell.noctalia.enable then
{
enable = true;
settings = {
bar = {
density = "compact";
position = "center";
showCapsule = true;
widgets = {
left = [
{
id = "ControlCenter";
useDistroLogo = true;
}
{
id = "Network";
}
{
id = "Bluetooth";
}
];
center = [
{
id = "Workspace";
labelMode = "none";
hideUnoccupied = false;
}
];
};
};
};
}
else
{ };

View file

@ -6,6 +6,16 @@
}:
{
options = {
desktop.window-managers = {
monitors = {
name = lib.mkOption {
default = "";
};
};
};
};
imports = [
./hyprland.nix
./niri.nix

View file

@ -11,7 +11,6 @@
options = {
desktop = {
hyprland = {
enable = lib.mkEnableOption "enable hyprland";
monitors = lib.mkOption {
default = [
",preferred,auto,1"
@ -81,12 +80,13 @@
];
exec-once = [
(lib.mkIf (osConfig.desktop.shell.walker.enable) "elephant")
(lib.mkIf (osConfig.desktop.shell.walker.enable) "walker --gapplication-service")
(lib.mkIf (osConfig.desktop.shell.waybar.enable) "waybar")
(lib.mkIf (osConfig.desktop.shell.noctalia.enable) "noctalia-shell")
(lib.mkIf (osConfig.desktop.shell.noctalia.enable) "noctalia-shell ipc call wallpaper random")
(lib.mkIf (osConfig.desktop.shell.swww.enable) "waypaper --restore --random")
(lib.mkIf (osConfig.gaming.steam.enable) "adwaita-steam-gtk -u; steam -silent")
(lib.mkIf (osConfig.internet.mail.providers.protonmail.enable) "protonmail-bridge -n")
(lib.mkIf (osConfig.apps.gaming.steam.enable) "adwaita-steam-gtk -u; steam -silent")
(lib.mkIf (osConfig.apps.internet.mail.providers.protonmail.enable) "protonmail-bridge -n")
"echo $HYPRLAND_INSTANCE_SIGNATURE > ~/.config/hypr/instance_signature"
];
"$mod" = "SUPER";
@ -98,7 +98,7 @@
(lib.mkIf (osConfig.desktop.shell.rofi.enable) "$mod, D, exec, rofi -show drun")
"$mod, return, exec, ${osConfig.apps.terminal.binary}"
(lib.mkIf (osConfig.desktop.utilities.grimblast.enable) ", print, exec, GRIMBLAST_EDITOR=gradia grimblast edit area")
(lib.mkIf (osConfig.desktop.shell.walker.enable && osConfig.misc.bitwarden.enable)
(lib.mkIf (osConfig.desktop.shell.walker.enable && osConfig.apps.misc.bitwarden.enable)
"$mod, B, exec, rbw unlocked || kitty --class kitty-floating -e rbw unlock; selected=$(rbw list | walker -d); wl-copy $(rbw get \"$selected\"); sleep 30; rbw lock"
)
"$mod, F, fullscreen, 1"

View file

@ -17,91 +17,94 @@ in
if osConfig.desktop.window-managers.niri.enable then
{
home.file = {
"~/.config/niri/config.kdl" = ''
input {
"~/.config/niri/config.kdl" = {
target = ".config/niri/config.kdl";
text = ''
input {
keyboard {
xkb {
layout "${kb-layout}"
}
repeat-delay 600
repeat-rate 20
track-layout "global"
}
touchpad {
tap
dwt
accel-profile "flat"
accel-speed 0.0
scroll-method "two-finger"
keyboard {
xkb {
layout "${kb-layout}"
}
repeat-delay 600
repeat-rate 20
track-layout "global"
}
touchpad {
tap
dwt
accel-profile "flat"
accel-speed 0.0
scroll-method "two-finger"
}
mouse {
accel-speed 0.5
accel-profile "flat"
}
mouse {
accel-speed 0.5
accel-profile "flat"
}
}
}
}
gestures {
hot-corners {
off
}
gestures {
hot-corners {
off
}
}
}
cursor {
hide-when-typing
hide-after-inactive-ms 2000
}
cursor {
hide-when-typing
hide-after-inactive-ms 2000
}
xwayland-satellite {
path "xwayland-satellite"
}
xwayland-satellite {
path "xwayland-satellite"
}
hotkey-overlay {
hide-not-bound
}
hotkey-overlay {
hide-not-bound
}
binds {
${modifier}+Down cooldown-ms=150 { focus-workspace-down; }
${modifier}+Up cooldown-ms=150 { focus-workspace-up; }
${modifier}+${osConfig.keybinds.hotkeys.terminal} { spawn "${osConfig.terminal.binary}";}
${modifier}+Left {focus-column-left; }
${modifier}+Right {focus-column-right; }
${modifier}+${osConfig.keybinds.hotkeys.browser} { spawn "${osConfig.apps.browser.default}";}
${modifier}+${osConfig.keybinds.hotkeys.launcher} { spawn "${osConfig.desktop.window-managers.shell.launcher.default}";}
Print { screenshot;}
${modifier}+Shift+${osConfig.keybinds.hotkeys.close-window} { close-window; }
${modifier}+Shift+${osConfig.keybinds.hotkeys.editor} { spawn "${osConfig.apps.development.editor.default}";}
}
binds {
${modifier}+Down cooldown-ms=150 { focus-workspace-down; }
${modifier}+Up cooldown-ms=150 { focus-workspace-up; }
${modifier}+${osConfig.keybinds.hotkeys.terminal} { spawn "${osConfig.apps.terminal.binary}";}
${modifier}+Left {focus-column-left; }
${modifier}+Right {focus-column-right; }
${modifier}+${osConfig.keybinds.hotkeys.browser} { spawn "${osConfig.apps.internet.browsers.default}";}
${modifier}+${osConfig.keybinds.hotkeys.launcher} { spawn "${osConfig.desktop.shell.launcher}";}
Print { screenshot;}
${modifier}+Shift+${osConfig.keybinds.hotkeys.close-window} { close-window; }
${modifier}+Shift+${osConfig.keybinds.hotkeys.editor} { spawn "${osConfig.apps.development.editor.default}";}
}
spawn-at-startup "elephant"
spawn-at-startup "noctalia-shell"
spawn-at-startup "elephant"
spawn-at-startup "noctalia-shell"
spawn-at-startup "walker --gapplication-service"
layout {
gaps 20
focus-ring {
width 5
}
border {
off
}
}
window-rule {
geometry-corner-radius 20
clip-to-geometry true
}
layout {
gaps 20
focus-ring {
width 5
}
border {
off
}
}
window-rule {
geometry-corner-radius 20
clip-to-geometry true
}
prefer-no-csd
include "noctalia.kdl"
prefer-no-csd
include "noctalia.kdl"
'';
'';
};
};
}
else

View file

@ -60,7 +60,7 @@
};
};
defaultWorkspace = "workspace number 1";
terminal = osConfig.desktop.defaults.terminal.binary;
terminal = osConfig.apps.terminal.binary;
};
checkConfig = false;
};

View file

@ -1,20 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
bluetooth = {
enable = lib.mkEnableOption "enable bluetooth";
};
};
config = lib.mkIf config.bluetooth.enable {
home.packages = with pkgs; [
bluez
bluetuith
];
};
}

View file

@ -1,21 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
internet.browsers = {
librewolf = {
enable = lib.mkEnableOption "enable librewolf";
};
};
};
config = lib.mkIf config.internet.browsers.librewolf.enable {
home.packages = with pkgs; [
librewolf
];
};
}

View file

@ -1,34 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
internet = {
mail.enable = lib.mkEnableOption "enable e-mail";
mail.providers.protonmail.enable = lib.mkEnableOption "enable protonmail";
};
};
config = {
programs = {
thunderbird = lib.mkIf config.internet.mail.enable {
enable = true;
profiles."default" = {
isDefault = true;
};
};
};
services = {
protonmail-bridge = lib.mkIf config.internet.mail.providers.protonmail.enable {
enable = true;
package = pkgs.protonmail-bridge;
extraPackages = with pkgs; [
gnome-keyring
];
};
};
};
}

View file

@ -1,19 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
internet = {
rss.enable = lib.mkEnableOption "enable rss";
};
};
config = {
home.packages = with pkgs; [
(lib.mkIf (config.internet.rss.enable) newsflash)
];
};
}

View file

@ -1,21 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
internet = {
tor.enable = lib.mkEnableOption "enable tor";
browsers.tor-browser.enable = lib.mkEnableOption "enable tor-browser";
};
};
config = {
home.packages = with pkgs; [
(lib.mkIf (config.internet.browsers.tor-browser.enable) tor-browser)
(lib.mkIf (config.internet.tor.enable) oniux)
];
};
}

View file

@ -1,15 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./messaging
];
home.packages = with pkgs; [
fedistar
];
}

View file

@ -1,31 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
messaging = {
enable = lib.mkEnableOption "enable all messaging";
element.enable = lib.mkEnableOption "enable element";
signal.enable = lib.mkEnableOption "enable signal";
};
};
config = {
messaging = lib.mkIf config.messaging.enable {
element.enable = lib.mkDefault true;
signal.enable = lib.mkDefault true;
};
home.packages = with pkgs; [
(lib.mkIf (config.messaging.signal.enable) signal-desktop)
];
programs = {
element-desktop = lib.mkIf config.messaging.element.enable {
enable = true;
};
};
};
}