restore hyprland dotfiles from backups
This commit is contained in:
parent
5dc6c8a77c
commit
4dd1504a4c
12 changed files with 397 additions and 30 deletions
|
|
@ -1,5 +1,45 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hyprPkgs = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
in
|
||||
{
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = hyprPkgs.hyprland;
|
||||
portalPackage = hyprPkgs.xdg-desktop-portal-hyprland;
|
||||
xwayland.enable = true;
|
||||
configType = "lua";
|
||||
systemd = {
|
||||
enable = true;
|
||||
variables = [ "--all" ];
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
local hypr_config = os.getenv("XDG_CONFIG_HOME") or "${config.xdg.configHome}"
|
||||
package.path = hypr_config .. "/hypr/?.lua;"
|
||||
.. hypr_config .. "/hypr/?/init.lua;"
|
||||
.. package.path
|
||||
|
||||
require("conf.variables")
|
||||
require("conf.binding")
|
||||
require("conf.env")
|
||||
require("conf.input")
|
||||
require("conf.others")
|
||||
require("conf.monitor")
|
||||
require("conf.startup")
|
||||
require("conf.style")
|
||||
require("conf.windowrules")
|
||||
require("conf.workspace")
|
||||
'';
|
||||
};
|
||||
|
||||
services.hyprpolkitagent.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
hyprpaper
|
||||
hyprlock
|
||||
|
|
|
|||
|
|
@ -1,22 +1,270 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.niri = {
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# Stylix expose sa palette base16 ici (pas `config.colorScheme`, qui vient de
|
||||
# nix-colors et n'existe pas dans cette config).
|
||||
c = config.lib.stylix.colors.withHashtag;
|
||||
|
||||
wallpaper = "${config.home.homeDirectory}/nixos-config/dotfiles/hypr/wallpaper/nix-wallpaper.png";
|
||||
in
|
||||
{
|
||||
wayland.windowManager.niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri;
|
||||
|
||||
# xwayland-satellite dans le PATH suffit : niri démarre XWayland à la demande
|
||||
xwaylandSatellitePackage = pkgs.xwayland-satellite;
|
||||
|
||||
# niri recommande le portail gnome (screencast, file chooser)
|
||||
portalPackage = pkgs.xdg-desktop-portal-gnome;
|
||||
|
||||
# valide le KDL généré au moment du build : les erreurs de config
|
||||
# apparaissent pendant `nixos-rebuild`, pas au premier login
|
||||
checkConfig = true;
|
||||
|
||||
settings = {
|
||||
prefer-no-csd = true;
|
||||
input.keyboard.xkb = {
|
||||
layout = "us";
|
||||
variant = "intl";
|
||||
prefer-no-csd = { };
|
||||
screenshot-path = "~/Screenshots/%Y-%m-%d %H-%M-%S.png";
|
||||
hotkey-overlay.skip-at-startup = { };
|
||||
|
||||
# --- entrées -------------------------------------------------------
|
||||
input = {
|
||||
keyboard.xkb.layout = "fr";
|
||||
keyboard.numlock = { };
|
||||
touchpad = {
|
||||
tap = { };
|
||||
dwt = { };
|
||||
accel-profile = "adaptive";
|
||||
scroll-factor = 1.2;
|
||||
};
|
||||
mouse = {
|
||||
accel-profile = "adaptive";
|
||||
accel-speed = -0.3;
|
||||
};
|
||||
focus-follows-mouse = { };
|
||||
};
|
||||
|
||||
# --- disposition ---------------------------------------------------
|
||||
layout = {
|
||||
gaps = 4;
|
||||
gaps = 8;
|
||||
center-focused-column = "never";
|
||||
|
||||
default-column-width.proportion = 0.5;
|
||||
preset-column-widths._children = [
|
||||
{ proportion = 0.33333; }
|
||||
{ proportion = 0.5; }
|
||||
{ proportion = 0.66667; }
|
||||
];
|
||||
|
||||
focus-ring = {
|
||||
enable = true;
|
||||
width = 2;
|
||||
active.color = "#${config.colorScheme.palette.base0D}ff";
|
||||
inactive.color = "#${config.colorScheme.palette.base03}ff";
|
||||
active-color = c.base0D;
|
||||
inactive-color = c.base03;
|
||||
};
|
||||
border.off = { };
|
||||
};
|
||||
|
||||
# --- raccourcis ----------------------------------------------------
|
||||
# calqués sur conf/binding.lua pour garder les réflexes.
|
||||
# NB : dans niri `Mod` = Super. J/K reprennent ton inversion Hyprland
|
||||
# (J = haut, K = bas).
|
||||
binds = {
|
||||
"Mod+Shift+Slash".show-hotkey-overlay = { };
|
||||
|
||||
# session
|
||||
"Ctrl+Alt+M".quit = { };
|
||||
"Ctrl+Alt+L".spawn = [ "hyprlock" ];
|
||||
|
||||
# lanceurs
|
||||
"Alt+Q".spawn = [ "kitty" ];
|
||||
"Alt+N".spawn = [
|
||||
"kitty"
|
||||
"-e"
|
||||
"nvim"
|
||||
];
|
||||
"Alt+D".spawn = [ "dolphin" ];
|
||||
"Alt+F".spawn = [ "zen-beta" ];
|
||||
"Alt+Z".spawn = [ "zotero" ];
|
||||
"Alt+T".spawn = [ "thunderbird" ];
|
||||
"Alt+W".spawn = [
|
||||
"rofi"
|
||||
"-show"
|
||||
"drun"
|
||||
];
|
||||
"Alt+X".spawn = [
|
||||
"rofi"
|
||||
"-show"
|
||||
"window"
|
||||
];
|
||||
"Alt+C".spawn = [
|
||||
"rofi"
|
||||
"-show"
|
||||
"filebrowser"
|
||||
];
|
||||
"Super+V".spawn = [
|
||||
"sh"
|
||||
"-c"
|
||||
"cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy"
|
||||
];
|
||||
|
||||
# fenêtres
|
||||
"Alt+F4".close-window = { };
|
||||
"Alt+V".toggle-window-floating = { };
|
||||
"Alt+M".maximize-column = { };
|
||||
"Alt+Shift+F".fullscreen-window = { };
|
||||
|
||||
# focus (colonnes = gauche/droite, fenêtres dans la colonne = haut/bas)
|
||||
"Alt+H".focus-column-left = { };
|
||||
"Alt+L".focus-column-right = { };
|
||||
"Alt+J".focus-window-up = { };
|
||||
"Alt+K".focus-window-down = { };
|
||||
|
||||
# déplacement de fenêtre
|
||||
"Ctrl+Super+H".move-column-left = { };
|
||||
"Ctrl+Super+L".move-column-right = { };
|
||||
"Ctrl+Super+J".move-window-up = { };
|
||||
"Ctrl+Super+K".move-window-down = { };
|
||||
|
||||
# espaces de travail (verticaux dans niri)
|
||||
"Super+L".focus-workspace-down = { };
|
||||
"Super+H".focus-workspace-up = { };
|
||||
"Super+K".move-column-to-workspace-down = { };
|
||||
"Super+J".move-column-to-workspace-up = { };
|
||||
|
||||
# écrans
|
||||
"Alt+A".focus-monitor-left = { };
|
||||
"Alt+B".focus-monitor-right = { };
|
||||
"Ctrl+Super+A".move-column-to-monitor-left = { };
|
||||
"Ctrl+Super+B".move-column-to-monitor-right = { };
|
||||
|
||||
# largeur de colonne
|
||||
"Alt+R".switch-preset-column-width = { };
|
||||
"Alt+Minus".set-column-width = [ "-10%" ];
|
||||
"Alt+Equal".set-column-width = [ "+10%" ];
|
||||
|
||||
# captures d'écran (intégrées à niri, pas besoin de grim/slurp)
|
||||
"Print".screenshot = { };
|
||||
"Ctrl+Print".screenshot-screen = { };
|
||||
"Alt+Print".screenshot-window = { };
|
||||
|
||||
# multimédia / luminosité
|
||||
"XF86MonBrightnessUp" = {
|
||||
_props.allow-when-locked = true;
|
||||
spawn = [
|
||||
"brightnessctl"
|
||||
"-e4"
|
||||
"-n2"
|
||||
"set"
|
||||
"5%+"
|
||||
];
|
||||
};
|
||||
"XF86MonBrightnessDown" = {
|
||||
_props.allow-when-locked = true;
|
||||
spawn = [
|
||||
"brightnessctl"
|
||||
"-e4"
|
||||
"-n2"
|
||||
"set"
|
||||
"5%-"
|
||||
];
|
||||
};
|
||||
"XF86AudioRaiseVolume" = {
|
||||
_props.allow-when-locked = true;
|
||||
spawn = [
|
||||
"wpctl"
|
||||
"set-volume"
|
||||
"-l"
|
||||
"1"
|
||||
"@DEFAULT_AUDIO_SINK@"
|
||||
"5%+"
|
||||
];
|
||||
};
|
||||
"XF86AudioLowerVolume" = {
|
||||
_props.allow-when-locked = true;
|
||||
spawn = [
|
||||
"wpctl"
|
||||
"set-volume"
|
||||
"@DEFAULT_AUDIO_SINK@"
|
||||
"5%-"
|
||||
];
|
||||
};
|
||||
"XF86AudioMute" = {
|
||||
_props.allow-when-locked = true;
|
||||
spawn = [
|
||||
"wpctl"
|
||||
"set-mute"
|
||||
"@DEFAULT_AUDIO_SINK@"
|
||||
"toggle"
|
||||
];
|
||||
};
|
||||
"XF86AudioMicMute" = {
|
||||
_props.allow-when-locked = true;
|
||||
spawn = [
|
||||
"wpctl"
|
||||
"set-mute"
|
||||
"@DEFAULT_AUDIO_SOURCE@"
|
||||
"toggle"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# --- nœuds répétés / paramétrés ------------------------------------
|
||||
_children = [
|
||||
# écrans : niri prend le mode « preferred » si on ne précise rien
|
||||
{
|
||||
output = {
|
||||
_args = [ "eDP-1" ];
|
||||
scale = 1.0;
|
||||
position._props = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
};
|
||||
}
|
||||
{ output._args = [ "HDMI-A-1" ]; }
|
||||
|
||||
# démarrage
|
||||
{
|
||||
spawn-at-startup._args = [
|
||||
"swaybg"
|
||||
"-i"
|
||||
wallpaper
|
||||
"-m"
|
||||
"fill"
|
||||
];
|
||||
}
|
||||
{ spawn-at-startup._args = [ "mako" ]; }
|
||||
{
|
||||
spawn-at-startup._args = [
|
||||
"sh"
|
||||
"-c"
|
||||
"wl-paste --type text --watch cliphist store"
|
||||
];
|
||||
}
|
||||
{
|
||||
spawn-at-startup._args = [
|
||||
"sh"
|
||||
"-c"
|
||||
"wl-paste --type image --watch cliphist store"
|
||||
];
|
||||
}
|
||||
|
||||
# règles de fenêtres : exemple, à étoffer au fur et à mesure
|
||||
{
|
||||
window-rule._children = [
|
||||
{ match._props.app-id = "^org\\.keepassxc\\.KeePassXC$"; }
|
||||
{ block-out-from = "screen-capture"; }
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
swaybg # niri n'a pas de gestionnaire de fond d'écran intégré
|
||||
xwayland-satellite
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue