From a18f813eb349e4eb364156dda4598780402ac259 Mon Sep 17 00:00:00 2001 From: tristan Date: Thu, 25 May 2023 09:12:37 +0100 Subject: [PATCH] add wm module and other stuff --- lib/home.nix | 10 +++++++--- lib/modules/wayland.nix | 4 ++-- system/global/home.nix | 17 ++++++++++++++--- system/global/system.nix | 19 ++++--------------- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/lib/home.nix b/lib/home.nix index d56b678..8182179 100644 --- a/lib/home.nix +++ b/lib/home.nix @@ -2,10 +2,11 @@ , name , hyprland , work ? false -, displays ? [] +, displays ? [ ] , userName -, ... }: -{ config, pkgs, ...}: +, ... +}: +{ config, pkgs, ... }: { imports = [ (import ./modules/terminal.nix { inherit user; }) @@ -21,12 +22,15 @@ (import ./modules/dev.nix { inherit user; }) (import ./modules/personal.nix { inherit user; }) (import ./modules/gamer.nix { inherit user; }) + (import ./modules/wayland.nix { inherit user; }) ./scripts.nix ../system/global/system.nix ../system/${name}/system.nix ../hardware/${name}.nix ]; + windowManager.hyprland = true; + home-manager.users.${user}.imports = [ ../system/global/home.nix ../system/${name}/home.nix diff --git a/lib/modules/wayland.nix b/lib/modules/wayland.nix index 67fd6e5..9389a7b 100644 --- a/lib/modules/wayland.nix +++ b/lib/modules/wayland.nix @@ -8,8 +8,8 @@ in hyprland = mkEnableOption "hyprland"; sway = mkEnableOption "sway"; }; - - config = { + + config = mkIf (cfg.sway || cfg.hyprland) { services.greetd = { enable = true; settings = rec { diff --git a/system/global/home.nix b/system/global/home.nix index 6a65742..a173958 100644 --- a/system/global/home.nix +++ b/system/global/home.nix @@ -99,7 +99,7 @@ in extraConfig = '' ## global hyprland configuration env = GDK_BACKEND,wayland,x11 - env = QT_QPA_PLATFORM,wayland;xcb + env = QT_QPA_PLATFORM,xcb env = SDL_VIDEODRIVER,wayland env = CLUTTER_BACKEND,wayland env = XDG_CURRENT_DESKTOP,Hyprland @@ -481,7 +481,7 @@ in ffmpegthumbnailer -i "$1" -o "$CACHE.jpg" -s 0 -q 5 image "$CACHE.jpg" "$2" "$3" "$4" "$5" ;; - *.bmp|*.jpg|*.jpeg|*.png|*.xpm|*.webp|*.gif|*.jfif) + *.bmp|*.jpg|*.jpeg|*.png|*.xpm|*.webp|*.jfif) image "$1" "$2" "$3" "$4" "$5" ;; *.svg) @@ -780,6 +780,7 @@ color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a- }; wayland.windowManager.sway = { + enable = true; config = { modifier = "Mod4"; input = { @@ -853,7 +854,7 @@ color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a- } ''; }; - + programs.neovim = { enable = true; coc = { @@ -884,5 +885,15 @@ color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a- }; }; + programs.pandoc = { + enable = true; + defaults = { + metadata = { + author = "Tristan Beedell"; + }; + pdf-engine = "xelatex"; + }; + }; + } diff --git a/system/global/system.nix b/system/global/system.nix index b1e4bdb..ea7c5fd 100644 --- a/system/global/system.nix +++ b/system/global/system.nix @@ -41,6 +41,10 @@ # kde connect networking.firewall.allowedTCPPortRanges = [{ from = 1714; to = 1764; }]; networking.firewall.allowedUDPPortRanges = [{ from = 1714; to = 1764; }]; + + networking.firewall.interfaces.tailscale0 = { + allowedTCPPortRanges = [{ from = 0; to = 65535; }]; + }; services.avahi.enable = true; @@ -68,21 +72,6 @@ xkbOptions = "caps:escape"; }; - services.greetd = { - enable = true; - settings = rec { - hypr_session = { - command = "Hyprland"; - user = "tristan"; - }; - sway_session = { - command = "sway"; - user = "tristan"; - }; - default_session = hypr_session; - }; - }; - qt.enable = true; qt.platformTheme = "gtk2"; qt.style = "gtk2";