From f475b7b4ab2779d2184d7fa7b6c023dcbbe2b9ae Mon Sep 17 00:00:00 2001 From: Timo Boomers Date: Fri, 20 Jun 2025 16:34:19 +0200 Subject: [PATCH] added niri and samba share --- hosts/ti-clt-lpt01/configuration.nix | 24 +++++++++ .../desktop-environments/hyprland/default.nix | 2 +- .../desktop-environments/niri/default.nix | 27 ++++++++-- .../home/desktop-environments/niri/waybar.nix | 49 +++++++++++++++++++ 4 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 modules/home/desktop-environments/niri/waybar.nix diff --git a/hosts/ti-clt-lpt01/configuration.nix b/hosts/ti-clt-lpt01/configuration.nix index 74aeb7a..3ca1bc1 100644 --- a/hosts/ti-clt-lpt01/configuration.nix +++ b/hosts/ti-clt-lpt01/configuration.nix @@ -73,6 +73,30 @@ ]; }; + # Create samba share + services.samba = { + enable = true; + securityType = "user"; + openFirewall = true; + settings = { + "public" = { + "path" = "/home/xeovalyte/Public"; + "browseable" = "yes"; + "read only" = "no"; + "guest ok" = "yes"; + "create mask" = "0644"; + "directory mask" = "0755"; + "force user" = "xeovalyte"; + "force group" = "xeovalyte"; + }; + }; + }; + + services.samba-wsdd = { + enable = true; + openFirewall = true; + }; + networking.firewall = { enable = true; allowedTCPPorts = [ 22 80 443 53 ]; diff --git a/modules/home/desktop-environments/hyprland/default.nix b/modules/home/desktop-environments/hyprland/default.nix index 0926746..99fcb76 100644 --- a/modules/home/desktop-environments/hyprland/default.nix +++ b/modules/home/desktop-environments/hyprland/default.nix @@ -15,7 +15,7 @@ in { }; imports = [ - ./waybar.nix + # ./waybar.nix ./fixes.nix ./dunst.nix ./rofi.nix diff --git a/modules/home/desktop-environments/niri/default.nix b/modules/home/desktop-environments/niri/default.nix index 7190dcf..3272117 100644 --- a/modules/home/desktop-environments/niri/default.nix +++ b/modules/home/desktop-environments/niri/default.nix @@ -17,14 +17,21 @@ in { imports = [ inputs.niri.homeModules.niri + ./waybar.nix ]; config = mkIf cfg.enable { home.packages = with pkgs; [ - alacritty fuzzel ]; + programs.alacritty = { + enable = true; + settings = { + window.decorations = "None"; + }; + }; + programs.niri.enable = true; programs.niri.package = pkgs.unstable.niri; @@ -40,6 +47,10 @@ in { }; programs.niri.settings.layout = { + gaps = 8; + focus-ring = { + width = 2; + }; preset-column-widths = [ { proportion = 1. / 3.; } { proportion = 1. / 2.; } @@ -47,19 +58,28 @@ in { ]; }; + programs.niri.settings.workspaces = { + "gen" = { open-on-output = "DP-1"; }; + "web" = { open-on-output = "HDMI-A-1"; }; + "com" = { open-on-output = "HDMI-A-1"; }; + "dev" = { open-on-output = "DP-1"; }; + "mus" = { open-on-output = "HDMI-A-1"; }; + }; + programs.niri.settings.binds = with config.lib.niri.actions; { "Mod+Shift+Slash".action = show-hotkey-overlay; # Spawn applications "Mod+Space".action = spawn "fuzzel"; "Mod+T".action = spawn "alacritty"; + "Mod+B".action = spawn "firefox"; # Volume controls "XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; "XF86AudioLowerVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; "XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK" "toggle"; - # Medila controls + # Media controls "XF86AudioPlay".action = spawn "playerctl" "play-pause"; "XF86AudioNext".action = spawn "playerctl" "next"; "XF86AudioPrev".action = spawn "playerctl" "previous"; @@ -68,12 +88,13 @@ in { "Mod+Q".action = close-window; "Mod+C".action = center-column; "Mod+R".action = switch-preset-column-width; + "Mod+Escape".action = quit; # Sizing "Mod+Minus".action = set-column-width "-10%"; "Mod+Equal".action = set-column-width "+10%"; - # Full screein + # Full screen "Mod+F".action = maximize-column; "Mod+Shift+F".action = fullscreen-window; "Mod+Ctrl+F".action = expand-column-to-available-width; diff --git a/modules/home/desktop-environments/niri/waybar.nix b/modules/home/desktop-environments/niri/waybar.nix new file mode 100644 index 0000000..61078cd --- /dev/null +++ b/modules/home/desktop-environments/niri/waybar.nix @@ -0,0 +1,49 @@ +{ config, pkgs, lib, inputs, ... }: + +with lib; + +let + cfg = config.settings.desktop-environments.niri.waybar; +in { + options = { + settings.desktop-environments.niri.waybar.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable waybar configuration for configuration + ''; + default = config.settings.desktop-environments.niri.enable; + }; + }; + + config = mkIf cfg.enable { + stylix.targets.waybar.addCss = false; + + programs.waybar = { + enable = true; + systemd.enable = true; + }; + + programs.waybar.settings = { + main = { + layer = "top"; + position = "top"; + modules-left = [ + "niri/workspaces" + "niri/window" + ]; + modules-center = [ + "clock" + ]; + modules-right = [ + "tray" + "network" + "pulseaudio" + ]; + }; + }; + + programs.waybar.style = '' + + ''; + }; +}