Compare commits

..

7 Commits

9 changed files with 215 additions and 59 deletions

View File

@ -1071,6 +1071,24 @@
"type": "github" "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": { "root": {
"inputs": { "inputs": {
"actions-preview-nvim": "actions-preview-nvim", "actions-preview-nvim": "actions-preview-nvim",
@ -1099,6 +1117,7 @@
"nur": "nur", "nur": "nur",
"nvim-lspconfig": "nvim-lspconfig", "nvim-lspconfig": "nvim-lspconfig",
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
"river": "river",
"smartcolumn-nvim": "smartcolumn-nvim", "smartcolumn-nvim": "smartcolumn-nvim",
"stable": "stable", "stable": "stable",
"statuscol-nvim": "statuscol-nvim", "statuscol-nvim": "statuscol-nvim",

View File

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

View File

@ -21,16 +21,22 @@
impermanence.enable = true; impermanence.enable = true;
webis.enable = true; webis.enable = true;
}; };
programs.hyprland = { programs.river = {
enable = true;
nvidiaSupport = 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; programs.exercism.enable = true;
services.wallpaper.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; [ home-manager.users.moritz.home.packages = with pkgs; [
anki anki
calibre 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 = { home-manager.users.moritz = {
programs = { programs = {
fzf.colors = { fzf.colors = {

View File

@ -31,6 +31,20 @@ in
}; };
config = mkIf cfg.enable { 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 = { home-manager.users.moritz = {
services.polybar = { services.polybar = {
config = { config = {
@ -39,7 +53,7 @@ in
monitor = "\${env:MONITOR}"; monitor = "\${env:MONITOR}";
bottom = true; bottom = true;
width = "100%"; width = "100%";
heigth = 15; height = 15;
border-size = 2; border-size = 2;

View File

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

View File

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

View File

@ -17,11 +17,7 @@ in
description = "list of keyboard layouts"; description = "list of keyboard layouts";
default = [ "de" "us" ]; default = [ "de" "us" ];
}; };
monitors = mkOption { nvidiaSupport = mkEnableOption "nvidiaSupport";
type = types.listOf types.str;
description = "monitor settings";
default = [ ",preferred,auto,1" ];
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -30,23 +26,45 @@ in
programs = { programs = {
wallpaper.enable = true; wallpaper.enable = true;
foot.enable = true; foot.enable = true;
rofi.enable = true; tofi.enable = true;
}; };
wallpapers.enable = true; wallpapers.enable = true;
services = { services = {
dunst.enable = true; dunst.enable = true;
wallpaper = { wallpaper = {
enable = true; 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 = { home-manager.users.moritz = {
# enable home-manager module home.packages = with pkgs; [
rivercarro
];
services.kanshi = {
enable = true;
systemdTarget = "river-session.target";
};
wayland.windowManager.river = { wayland.windowManager.river = {
enable = true; 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 = { settings = {
border-width = 2; border-width = 2;
declare-mode = [ declare-mode = [
@ -57,11 +75,47 @@ in
map = { map = {
normal = { normal = {
"Super Q" = "close"; "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+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 # add waybar as a status bar
@ -71,7 +125,7 @@ in
# start using systemd service # start using systemd service
systemd = { systemd = {
enable = true; enable = true;
# target = "hyprland-session.target"; target = "river-session.target";
}; };
settings = { settings = {
@ -80,7 +134,7 @@ in
layer = "top"; layer = "top";
position = "top"; position = "top";
height = 20; height = 20;
modules-left = [ "river/mode" ]; modules-left = [ "river/tags" ];
modules-center = [ "river/window" ]; modules-center = [ "river/window" ];
modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; modules-right = [ "network" "memory" "cpu" "battery" "clock" ];
}; };
@ -120,7 +174,7 @@ in
command = "${pkgs.systemd}/bin/loginctl lock-session"; command = "${pkgs.systemd}/bin/loginctl lock-session";
} }
]; ];
# systemdTarget = "hyprland-session.target"; systemdTarget = "river-session.target";
}; };
}; };
@ -140,24 +194,30 @@ in
# additional environment variables # additional environment variables
# environment.sessionVariables = environment.sessionVariables =
# { {
# XDG_CURRENT_DESKTOP = "Hyprland"; XDG_CURRENT_DESKTOP = "river";
# XDG_SESSION_TYPE = "wayland"; XDG_SESSION_TYPE = "wayland";
# XDG_SESSION_DESKTOP = "Hyprland"; XDG_SESSION_DESKTOP = "river";
# QT_AUTO_SCREEN_SCALE_FACTOR = "1"; QT_AUTO_SCREEN_SCALE_FACTOR = "1";
# QT_QPA_PLATFORM = "wayland;xcb"; QT_QPA_PLATFORM = "wayland;xcb";
# QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
# QT_QPA_PLATFORMTHEME = "qt5ct"; QT_QPA_PLATFORMTHEME = "qt5ct";
# _JAVA_AWT_WM_NONEREPARENTING = "1"; _JAVA_AWT_WM_NONEREPARENTING = "1";
# } // (optionalAttrs cfg.nvidiaSupport } // (optionalAttrs cfg.nvidiaSupport
# { {
# LIBVA_DRIVER_NAME = "nvidia"; GBM_BACKEND = "nvidia-drm";
# GBM_BACKEND = "nvidia-drm"; GDK_BACKEND = "wayland";
# __GLX_VENDOR_LIBRARY_NAME = "nvidia"; LIBVA_DRIVER_NAME = "nvidia";
# WLR_NO_HARDWARE_CURSORS = "1"; MOZ_ENABLE_WAYLAND = "1";
# __GL_VRR_ALLOWED = "0"; 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 = { services = {
dbus.enable = true; dbus.enable = true;
@ -182,26 +242,26 @@ in
}; };
security.rtkit.enable = true; security.rtkit.enable = true;
# home-manager.users.moritz.systemd.user.services = home-manager.users.moritz.systemd.user.services =
# let let
# units = [ "waybar" ]; units = [ "waybar" ];
# mkAfter = _: { mkAfter = _: {
# Unit = { Unit = {
# After = [ "hyprland-session.target" ]; After = [ "river-session.target" ];
# Wants = [ "hyprland-session.target" ]; Wants = [ "river-session.target" ];
# }; };
# }; };
# in in
# genAttrs units mkAfter; genAttrs units mkAfter;
#
# systemd.user.services = systemd.user.services =
# let let
# units = [ "pipewire" "xdg-desktop-portal" "xdg-desktop-portal-hyprland" "wireplumber" ]; units = [ "pipewire" "xdg-desktop-portal" "wireplumber" ];
# mkAfter = _: { mkAfter = _: {
# after = [ "hyprland-session.target" ]; after = [ "river-session.target" ];
# wants = [ "hyprland-session.target" ]; wants = [ "river-session.target" ];
# }; };
# in in
# genAttrs units mkAfter; 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
'';
};
};
};
}