Compare commits

..

3 Commits

Author SHA1 Message Date
Lennart J. Kurzweg (Nx2)
c381580cca fix hyprland-autoname-workspaces 2025-01-04 13:53:06 +01:00
Lennart J. Kurzweg (Nx2)
aea641cd9c no helix bg 2025-01-04 13:52:34 +01:00
Lennart J. Kurzweg (Nx2)
2179dbf1d8 calendar 2025-01-04 13:52:21 +01:00
14 changed files with 167 additions and 149 deletions

View File

@@ -1,4 +1,4 @@
{ pkgs, inputs, host, ... }:
{ pkgs, inputs, lib, host, ... }:
{
imports = ([
inputs.sops-nix.nixosModules.sops
@@ -43,8 +43,6 @@
./system-modules/postgres.nix
./system-modules/nx2site/proxy.nix
./system-modules/nx2site/gitea.nix
./system-modules/nx2site/radicale.nix
# ./system-modules/nx2site/nextcloud.nix
./system-modules/nx2site/vaultwarden.nix
./system-modules/nx2site/paperless.nix
] else []);

Binary file not shown.

81
home-modules/calendar.nix Normal file
View File

@@ -0,0 +1,81 @@
{ config, lib, user, secrets, domain, ... }: let
calendars = [
{
name = "Preservation";
primary = true;
url = "https://dav.${domain}/nx2/preservation/";
color = "#dddddd";
}
{
name = "Effort";
primary = false;
url = "https://dav.${domain}/nx2/effort/";
color = "#dd2222";
}
{
name = "Experience";
primary = false;
url = "https://dav.${domain}/nx2/experience/";
color = "#2222dd";
}
{
name = "Exposure";
primary = false;
url = "https://dav.${domain}/nx2/exposure/";
color = "#22aa22";
}
{
name = "Engagement";
primary = false;
url = "https://dav.${domain}/nx2/engagement/";
color = "#8800CC";
}
];
in {
accounts.calendar.accounts = let
makeCalendar = url: primary: color: {
inherit primary;
remote = {
type = "caldav";
userName = user;
inherit url;
};
};
m = cc: lib.attrsets.mergeAttrsList ( map (c: { "${c.name}" = makeCalendar c.url c.primary c.color;}) cc );
in m calendars;
# TODO: Replace this once https://github.com/nix-community/home-manager/pull/5484 is merged.
# Make sure it works, though, including the order of calendars.
programs.thunderbird.settings = let
makeThunderbirdCalendar = cal: let
calendarAccountSafeName = (builtins.replaceStrings ["."] ["-"]) cal.name;
in {
"calendar.registry.${calendarAccountSafeName}.cache.enabled" = true;
"calendar.registry.${calendarAccountSafeName}.calendar-main-default" = cal.primary;
"calendar.registry.${calendarAccountSafeName}.calendar-main-in-composite" = true;
"calendar.registry.${calendarAccountSafeName}.color" = cal.color;
"calendar.registry.${calendarAccountSafeName}.name" = cal.name;
"calendar.registry.${calendarAccountSafeName}.type" = "caldav";
"calendar.registry.${calendarAccountSafeName}.uri" = config.accounts.calendar.accounts.${cal.name}.remote.url;
"calendar.registry.${calendarAccountSafeName}.username" = config.accounts.calendar.accounts.${cal.name}.remote.userName;
};
in lib.attrsets.mergeAttrsList (
map (cal: makeThunderbirdCalendar cal) calendars
) // {
"calendar.registry.sleep-as-android.cache.enabled" = true;
"calendar.registry.sleep-as-android.calendar-main-in-composite" = true;
"calendar.registry.sleep-as-android.color" = "#222233";
"calendar.registry.sleep-as-android.name" = "Sleep As Android";
"calendar.registry.sleep-as-android.type" = "ics";
"calendar.registry.sleep-as-android.readOnly" = true;
"calendar.registry.sleep-as-android.uri" = secrets.calendar.sleep-as-android-url;
"calendar.list.sortOrder" = lib.fold (cal: acc: cal.name + " " + acc) "" calendars;
# Keep these after removing the above.
"calendar.week.start" = 1;
};
}

View File

@@ -235,7 +235,7 @@
};
"ui.background" = { # general background of the editor window
"bg" = background;
# "bg" = background;
};
"ui.bufferline" = { # the top line ("tab"-line)
"fg" = accent.base;

View File

@@ -2,61 +2,78 @@
{
home = {
packages = with pkgs; [ hyprland-autoname-workspaces ];
file.".config/hyprland-autoname-workspaces/config.toml".text = ''
version = "1.1.14"
file.".config/hyprland-autoname-workspaces/config.toml".text = let
icons = /* toml */ ''
DEFAULT = "{class}"
"Alacritty" = ""
"Bitwarden" = ""
"blueman-manager" = "󰂯"
"chatterino" = ""
"Chromium" = ""
"code" = "󰨞"
"code-oss" = "󰨞"
"codium" = "󰨞"
"codium-url-handler" = "󰨞"
"com.mitchellh.ghostty" = "󰊠"
"com.obsproject.Studio" = ""
"discord" = "󰙯"
"Element" = "󰘨"
"epicgameslauncher.exe" = "󰯷"
".*.exe" = ""
"firefox" = "󰈹"
"galaxyclient.exe" = "󰮡"
"Gimp-.*" = ""
"KiCad" = ""
"kitty" = ""
"libreoffice-calc" = ""
"libreoffice-writer" = ""
"lutris" = "󰊗"
"mpv" = ""
"obsidian" = "󰠮"
"org.inkscape.Inkscape" = "󰕙"
"org.remmina.Remmina" = "󰢹"
"pavucontrol" = "󰕾"
"pcbnew" = ""
"Signal" = "󱅵"
"spotify" = ""
"Spotify" = ""
"steam" = "󰓓"
"thunar" = ""
"thunderbird" = ""
"Tor Browser" = "󰾔"
"vesktop" = "󰙯"
"virt-manager" = ""
"VirtualBox" = ""
"VirtualBox Machine" = ""
"VirtualBox Manager" = ""
"VSCodium" = "󰨞"
"zathura" = "󰈦"
"zoom" = "󰬡"
'';
in /* toml */ ''
version = "1.1.15"
[format]
dedup = false
dedup_inactive_fullscreen = false
delim = " "
workspace = "{id}:{clients}"
workspace_empty = "{id}"
client = "{icon}"
client_fullscreen = "F{icon}"
client_active = "<u>{icon}</u>"
client_dup = "{icon}x{counter}"
client_dup_active = "<u>{icon}</u>{delim}{icon}x{counter_unfocused}"
client_dup_fullscreen = "F{icon}{delim}{icon}x{counter_unfocused}"
[exclude]
"steam" = "^(Friends List.*)?$"
"fcitx" = ".*"
[class]
VirtualBox = ""
steam = "󰓓"
"VirtualBox Manager" = ""
"com.obsproject.Studio" = ""
"[Ff]irefox" = "󰈹"
"[Tt]hunderbird" = ""
pcbnew = ""
".*.exe" = ""
Element = "󰘨"
Signal = "󱅵"
Gimp = ""
VSCodium = "󰨞"
"[sS]potify" = ""
virt-manager = ""
lutris = "󰊗"
DEFAULT = "{class}"
"epicgameslauncher.exe" = "󰯷"
"[Cc]ode" = "󰨞"
"galaxyclient.exe" = "󰮡"
pavucontrol = "󰕾"
"Tor Browser" = "󰾔"
mpv = ""
chatterino = ""
libreoffice-writer = ""
kitty = ""
"com.michellh.ghostty" = "󰊠"
"cyberpunk2077.exe" = "󰾲"
KiCad = ""
"[tT]hunar" = ""
"riotclientux.exe" = "󰰌"
libreoffice-calc = ""
"org.remmina.Remmina" = "󰢹"
"org.inkscape.Inkscape" = "󰕙"
"VirtualBox Machine" = ""
Bitwarden = ""
"[gG]imp-.*" = ""
Chromium = ""
obsidian = "󰠮"
"leagueclientux.exe" = "󰰌"
zathura = "󰈦"
code-oss = "󰨞"
codium-url-handler = "󰨞"
discord = "󰙯"
vesktop = "󰙯"
blueman-manager = "󰂯"
Alacritty = ""
zoom = "󰬡"
spotify = ""
${icons}
[class_active]
"(?i)ExampleOneTerm" = "icon"
[initial_class]
@@ -74,35 +91,11 @@
[initial_title_in_class]
[initial_title]
"Spotify Premium" = ""
[initial_title_in_class_active]
[initial_title_in_initial_class]
[initial_title_in_initial_class_active]
[exclude]
aProgram = "^$"
"" = "^$"
"(?i)fcitx" = ".*"
"[Ss]team" = "^(Friends List.*)?$"
"explorer.exe" = ".*"
"(?i)TestApp" = ""
[format]
dedup = false
dedup_inactive_fullscreen = false
delim = " "
workspace = "{id}:{clients}"
workspace_empty = "{id}"
client = "{icon}"
client_fullscreen = "{icon}"
client_active = "{icon}"
client_dup = "{icon}{counter_sup}"
client_dup_active = "*{icon}*{delim}{icon}{counter_unfocused_sup}"
client_dup_fullscreen = "[{icon}]{delim}{icon}{counter_unfocused_sup}"
'';
};
}

View File

@@ -343,8 +343,8 @@ in {
# "SUPER, F4,"
"SUPER, F5, exec, nx_gcal_event force-lookup"
"SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate"
"SUPER, F6, exec, ${terminal} -e 'htop'"
"SUPER, F7, exec, ${terminal} -e 'nmtui'"
"SUPER, F6, exec, ${terminal-exec}'htop'"
"SUPER, F7, exec, ${terminal-exec}'nmtui'"
''SUPER, F8, exec, find ~/Pictures/wallpapers/* -type f -not -path "~/Pictures/wallpapers/.git/*" | sort -R | head -n 1 | xargs -d '\n' swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 --transition-duration 2''
"SUPER, F9, execr, waybar_mode set '󰸉 '"
"SUPER, F9, submap, color"
@@ -352,7 +352,7 @@ in {
"SUPER, F11, exec, waybar"
"SUPER SHIFT, F11, exec, pkill waybar "
"SUPER, F12, exec, hyprland-autoname-workspaces"
"SUPER SHIFT, F12, exec, pkill -9 hyprland-autoname-workspaces "
"SUPER SHIFT, F12, exec, pkill -9 hyprland-aut"
###########################################################################
## ROW 1:
@@ -399,7 +399,7 @@ in {
# "SUPER, T, exec, alacritty"
# "SUPER SHIFT, T, exec, alacritty -e sh -c "ssh nxace""
"SUPER, T, exec, SESSION_FROM_DE=TRUE ${terminal}"
"SUPER SHIFT, T, exec, ${terminal-exec} sh -c 'ssh nxace'"
"SUPER SHIFT, T, exec, ${terminal-exec}'ssh nxace'"
"SUPER, Z, exec, waybar_mode set ' '"
"SUPER, Z, submap, tuda"
"SUPER, U, exec, thunderbird "

View File

@@ -4,6 +4,7 @@
./home-modules/auto-mount.nix
./home-modules/bash.nix
./home-modules/bitwarden.nix
./home-modules/calendar.nix
./home-modules/chatterino.nix
./home-modules/color-pallete.nix
./home-modules/direnv.nix
@@ -99,7 +100,6 @@
ghostscript
inputs.zen-browser.packages."${system}".default
gnome-calendar
] ++ (with pkgs-unstable; [
obsidian

File diff suppressed because one or more lines are too long

View File

@@ -118,7 +118,6 @@ in
efiSupport = true;
};
};
kernelPackages = pkgs-unstable.linuxPackages_6_11;
};
};
}

View File

@@ -1,26 +0,0 @@
{ config, domain, ... }:
{
sops.secrets = {
"nx2site/nextcloud/admin-pass" = { owner = "nextcloud"; };
"nx2site/nextcloud/db-pass" = { owner = "nextcloud"; };
# "nx2site/nextcloud/users-pass/nx2" = { owner = "nextcloud"; };
};
services = {
nextcloud = {
enable = true;
hostName = "nc.${domain}";
https = true;
configureRedis = true;
config = {
adminpassFile = config.sops.secrets."nx2site/nextcloud/admin-pass".path;
adminuser = "nx2";
dbtype = "pgsql";
# dbhost = config.services.postgresql.settings.port; # using usix socket
dbname = "nextcloud";
dbpassFile = config.sops.secrets."nx2site/nextcloud/db-pass".path;
};
};
};
}

View File

@@ -136,13 +136,6 @@
listen = dl;
locations = { "/" = { proxyPass = "http://127.0.0.1:8441"; }; };
};
"dav.${domain}" = lib.mkIf config.services.radicale.enable (vh // {
listen = dl;
locations = { "/" = { proxyPass = "http://127.0.0.1:5232"; }; };
});
"nc.${domain}" = vh // {
# directly to nc
};
"~^(.*).${domain}$" = {
listen = dl;
root = "/var/nginx/webroot";

View File

@@ -1,28 +1,18 @@
{ config, domain, ... }:
{
sops.secrets = {
"nx2site/radicale-htpasswd" = {
owner = "radicale";
};
"nx2site/radicale-htpasswd" = {};
};
services = {
radicale = {
# is run by user radicale
enable = true;
settings = {
server.hosts = let
port = builtins.toString 5232;
in [
"0.0.0.0:${port}"
"${domain}:${port}"
# "192.168.178.32:${port}"
];
auth = {
type = "htpasswd";
htpasswd_filename = config.sops.secrets."nx2site/radicale-htpasswd".path;
htpasswd_encryption = "bcrypt";
};
server.hosts = let
port = builtins.toString 5232;
in [ "192.168.178.32:${port}" ];
auth = {
type = "htpasswd";
htpasswd_filename = config.sops.secrets."nx2site/radicale-htpasswd".path;
htpasswd_encryption = "bcrypt";
};
};
};

View File

@@ -26,7 +26,6 @@
ensureDatabases = [
"gitea"
"vaultwarden"
"nextcloud"
];
settings = {
port = 5432; # default
@@ -45,10 +44,6 @@
name = "vaultwarden";
ensureDBOwnership = true;
}
{
name = "nextcloud";
ensureDBOwnership = true;
}
];
};
postgresqlBackup = {

View File

@@ -20,8 +20,6 @@
"nginx"
"adbusers"
"postgres"
"radicale"
"nextcloud"
];
useDefaultShell = true;
openssh.authorizedKeys.keys = [