Compare commits

...

7 commits

9 changed files with 215 additions and 59 deletions

View file

@ -1071,6 +1071,24 @@
"type": "github"
}
},
"river": {
"flake": false,
"locked": {
"lastModified": 1711107438,
"narHash": "sha256-4nvFniKdJX+ZsoliFmWSzIAtZefekBCxmGS9xonHQN8=",
"ref": "refs/heads/master",
"rev": "b77b42f0d640457411204bbae346df1d1a0c4f44",
"revCount": 1214,
"submodules": true,
"type": "git",
"url": "https://github.com/riverwm/river"
},
"original": {
"submodules": true,
"type": "git",
"url": "https://github.com/riverwm/river"
}
},
"root": {
"inputs": {
"actions-preview-nvim": "actions-preview-nvim",
@ -1099,6 +1117,7 @@
"nur": "nur",
"nvim-lspconfig": "nvim-lspconfig",
"pre-commit-hooks": "pre-commit-hooks",
"river": "river",
"smartcolumn-nvim": "smartcolumn-nvim",
"stable": "stable",
"statuscol-nvim": "statuscol-nvim",

View file

@ -48,6 +48,10 @@
hawtkeys-nvim.flake = false;
hawtkeys-nvim.url = "github:tris203/hawtkeys.nvim";
# river
river.url = "git+https://github.com/riverwm/river?submodules=1";
river.flake = false;
# Hyprland
hypr-contrib.url = "github:hyprwm/contrib";
hyprland.url = "github:hyprwm/Hyprland";

View file

@ -21,16 +21,22 @@
impermanence.enable = true;
webis.enable = true;
};
programs.hyprland = {
programs.river = {
enable = true;
nvidiaSupport = true;
monitors = [ "HDMI-A-1,3840x2160,auto,1.2" ",preferred,auto,1" ];
extraConfig = "exec=hyprctl keyword monitor HDMI-A-1,3840x2160@120,auto,1.2";
keyboardLayouts = [ "us" "de" ];
};
programs.hyprland.enable = false;
programs.exercism.enable = true;
services.wallpaper.enable = true;
};
home-manager.users.moritz.services.kanshi.profiles = {
default = {
outputs = [
{ criteria = "HDMI-A-1"; mode = "3840x2160@60"; scale = 1.2; }
];
};
};
home-manager.users.moritz.home.packages = with pkgs; [
anki
calibre

View file

@ -31,6 +31,12 @@
}:
{
my.programs.tofi.settings = {
text-color = "#${text}";
prompt-color = "#${red}";
selection-color = "#${yellow}";
background-color = "#${base}";
};
home-manager.users.moritz = {
programs = {
fzf.colors = {

View file

@ -31,6 +31,20 @@ in
};
config = mkIf cfg.enable {
my.programs.tofi.settings = {
font-size = "20";
font =
let
fontBasePath = pkgs.nerdfonts.override {
fonts = [ "FiraCode" ];
};
in
"${fontBasePath}/share/fonts/truetype/NerdFonts/FiraCodeNerdFont-Regular.ttf";
height = "360";
width = "720";
outline-width = "0";
border-width = "0";
};
home-manager.users.moritz = {
services.polybar = {
config = {
@ -39,7 +53,7 @@ in
monitor = "\${env:MONITOR}";
bottom = true;
width = "100%";
heigth = 15;
height = 15;
border-size = 2;

View file

@ -54,6 +54,7 @@ in
".local/share/nvim"
".local/share/zoxide"
".local/state/nvim"
".local/state/tofi-history"
".mozilla"
"Documents"
"Downloads"

View file

@ -20,8 +20,10 @@ in
settings = {
main = {
term = "xterm-256color";
font = "FiraCode Nerd Font:size=8";
dpi-aware = true;
font = "FiraCode Nerd Font:size=10";
};
colors = {
alpha = 0.98;
};
};
};

View file

@ -17,11 +17,7 @@ in
description = "list of keyboard layouts";
default = [ "de" "us" ];
};
monitors = mkOption {
type = types.listOf types.str;
description = "monitor settings";
default = [ ",preferred,auto,1" ];
};
nvidiaSupport = mkEnableOption "nvidiaSupport";
};
config = mkIf cfg.enable {
@ -30,23 +26,45 @@ in
programs = {
wallpaper.enable = true;
foot.enable = true;
rofi.enable = true;
tofi.enable = true;
};
wallpapers.enable = true;
services = {
dunst.enable = true;
wallpaper = {
enable = true;
# target = "hyprland-session.target";
target = "river-session.target";
};
# spotify-player.target = "hyprland-session.target";
spotify-player.target = "river-session.target";
};
};
home-manager.users.moritz = {
# enable home-manager module
home.packages = with pkgs; [
rivercarro
];
services.kanshi = {
enable = true;
systemdTarget = "river-session.target";
};
wayland.windowManager.river = {
enable = true;
package = pkgs.river.overrideAttrs (old: {
src = inputs.river;
version = lib.my.mkVersionInput inputs.river;
# HACK: to change wlroots to 0.17.x
buildInputs = with pkgs; [
libGL
libevdev
libinput
libxkbcommon
pixman
udev
wayland-protocols
wlroots_0_17
xorg.libX11
];
});
settings = {
border-width = 2;
declare-mode = [
@ -57,11 +75,47 @@ in
map = {
normal = {
"Super Q" = "close";
"Super Return" = "spawn footclient";
"Super Return" = ''spawn "systemctl --user is-active --quiet foot && footclient --no-wait || foot"'';
"Super+Shift Return" = "spawn foot";
"Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' '';
"Super W" = ''spawn "pkill -USR1 waybar"'';
"Super+Shift R" = "spawn ~/.config/river/init";
# Focus view
"Super J" = "focus-view next";
"Super K" = "focus-view previous";
# swap the focused view
"Super+Shift J" = "swap next";
"Super+Shift K" = "swap previous";
# focus output
"Super Period" = "focus-output next";
"Super Comma" = "focus-output previous";
# send to output
"Super+Shift Period" = "send-to-output next";
"Super+Shift Comma" = "send-to-output previous";
# bump in layout stack
"Super Z" = "zoom";
};
};
map-pointer = {
normal = {
"Super BTN_LEFT" = "move-view";
"Super BTN_RIGHT" = "resize-view";
"Super BTN_MIDDLE" = "toggle-float";
};
};
};
extraConfig = /* bash */ ''
riverctl default-layout rivercarro
rivercarro_pid="$(pidof rivercarro)"
if [[ -z $rivercarro_pid ]]; then
rivercarro -inner-gaps 4 -outer-gaps 4
fi
'';
};
# add waybar as a status bar
@ -71,7 +125,7 @@ in
# start using systemd service
systemd = {
enable = true;
# target = "hyprland-session.target";
target = "river-session.target";
};
settings = {
@ -80,7 +134,7 @@ in
layer = "top";
position = "top";
height = 20;
modules-left = [ "river/mode" ];
modules-left = [ "river/tags" ];
modules-center = [ "river/window" ];
modules-right = [ "network" "memory" "cpu" "battery" "clock" ];
};
@ -120,7 +174,7 @@ in
command = "${pkgs.systemd}/bin/loginctl lock-session";
}
];
# systemdTarget = "hyprland-session.target";
systemdTarget = "river-session.target";
};
};
@ -140,24 +194,30 @@ in
# additional environment variables
# environment.sessionVariables =
# {
# XDG_CURRENT_DESKTOP = "Hyprland";
# XDG_SESSION_TYPE = "wayland";
# XDG_SESSION_DESKTOP = "Hyprland";
# QT_AUTO_SCREEN_SCALE_FACTOR = "1";
# QT_QPA_PLATFORM = "wayland;xcb";
# QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
# QT_QPA_PLATFORMTHEME = "qt5ct";
# _JAVA_AWT_WM_NONEREPARENTING = "1";
# } // (optionalAttrs cfg.nvidiaSupport
# {
# LIBVA_DRIVER_NAME = "nvidia";
# GBM_BACKEND = "nvidia-drm";
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
# WLR_NO_HARDWARE_CURSORS = "1";
# __GL_VRR_ALLOWED = "0";
# });
environment.sessionVariables =
{
XDG_CURRENT_DESKTOP = "river";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "river";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
QT_QPA_PLATFORM = "wayland;xcb";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_QPA_PLATFORMTHEME = "qt5ct";
_JAVA_AWT_WM_NONEREPARENTING = "1";
} // (optionalAttrs cfg.nvidiaSupport
{
GBM_BACKEND = "nvidia-drm";
GDK_BACKEND = "wayland";
LIBVA_DRIVER_NAME = "nvidia";
MOZ_ENABLE_WAYLAND = "1";
WLR_DRM_DEVICES = "/dev/dri/card0";
WLR_DRM_NO_ATOMIC = "1";
WLR_NO_HARDWARE_CURSORS = "1";
XDG_CURRENT_DESKTOP = "river";
_GL_GSYNC_ALLOWED = "0";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
__GL_VRR_ALLOWED = "0";
});
services = {
dbus.enable = true;
@ -182,26 +242,26 @@ in
};
security.rtkit.enable = true;
# home-manager.users.moritz.systemd.user.services =
# let
# units = [ "waybar" ];
# mkAfter = _: {
# Unit = {
# After = [ "hyprland-session.target" ];
# Wants = [ "hyprland-session.target" ];
# };
# };
# in
# genAttrs units mkAfter;
#
# systemd.user.services =
# let
# units = [ "pipewire" "xdg-desktop-portal" "xdg-desktop-portal-hyprland" "wireplumber" ];
# mkAfter = _: {
# after = [ "hyprland-session.target" ];
# wants = [ "hyprland-session.target" ];
# };
# in
# genAttrs units mkAfter;
home-manager.users.moritz.systemd.user.services =
let
units = [ "waybar" ];
mkAfter = _: {
Unit = {
After = [ "river-session.target" ];
Wants = [ "river-session.target" ];
};
};
in
genAttrs units mkAfter;
systemd.user.services =
let
units = [ "pipewire" "xdg-desktop-portal" "wireplumber" ];
mkAfter = _: {
after = [ "river-session.target" ];
wants = [ "river-session.target" ];
};
in
genAttrs units mkAfter;
};
}

44
modules/programs/tofi.nix Normal file
View file

@ -0,0 +1,44 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.tofi;
configText =
let
settingsStrings = mapAttrsToList (name: value: "${name} = ${value}") cfg.settings;
in
concatLines settingsStrings;
in
{
options.my.programs.tofi = {
enable = mkEnableOption "tofi";
settings = mkOption {
type = with types; attrsOf str;
default = { };
};
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
(lib.mkIf config.networking.networkmanager.enable networkmanager_dmenu)
# (lib.mkIf config.hardware.bluetooth.enable rofi-bluetooth)
# rofi-power-menu
];
home-manager.users.moritz = {
home.packages = with pkgs; [ tofi ];
xdg = {
enable = true;
configFile."tofi/config".text = configText;
configFile."networkmanager-dmenu/config.ini".text = ''
[dmenu]
dmenu_command = tofi
'';
};
};
};
}