mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 17:58:30 +02:00
refactor(home/linux/desktop): home/linux/desktop => home/linux/gui
This commit is contained in:
84
home/linux/gui/hyprland/values/anyrun.nix
Normal file
84
home/linux/gui/hyprland/values/anyrun.nix
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
pkgs,
|
||||
anyrun,
|
||||
...
|
||||
}: {
|
||||
programs.anyrun = {
|
||||
enable = true;
|
||||
config = {
|
||||
plugins = with anyrun.packages.${pkgs.system}; [
|
||||
applications
|
||||
randr
|
||||
rink
|
||||
shell
|
||||
symbols
|
||||
translate
|
||||
];
|
||||
|
||||
width.fraction = 0.3;
|
||||
y.absolute = 15;
|
||||
hidePluginInfo = true;
|
||||
closeOnClick = true;
|
||||
};
|
||||
|
||||
# custom css for anyrun, based on catppuccin-mocha
|
||||
extraCss = ''
|
||||
@define-color bg-col rgba(30, 30, 46, 0.7);
|
||||
@define-color bg-col-light rgba(150, 220, 235, 0.7);
|
||||
@define-color border-col rgba(30, 30, 46, 0.7);
|
||||
@define-color selected-col rgba(150, 205, 251, 0.7);
|
||||
@define-color fg-col #D9E0EE;
|
||||
@define-color fg-col2 #F28FAD;
|
||||
|
||||
* {
|
||||
transition: 200ms ease;
|
||||
font-family: "JetBrainsMono Nerd Font";
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
|
||||
#window {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#plugin,
|
||||
#main {
|
||||
border: 3px solid @border-col;
|
||||
color: @fg-col;
|
||||
background-color: @bg-col;
|
||||
}
|
||||
/* anyrun's input window - Text */
|
||||
#entry {
|
||||
color: @fg-col;
|
||||
background-color: @bg-col;
|
||||
}
|
||||
|
||||
/* anyrun's ouput matches entries - Base */
|
||||
#match {
|
||||
color: @fg-col;
|
||||
background: @bg-col;
|
||||
}
|
||||
|
||||
/* anyrun's selected entry - Red */
|
||||
#match:selected {
|
||||
color: @fg-col2;
|
||||
background: @selected-col;
|
||||
}
|
||||
|
||||
#match {
|
||||
padding: 3px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
#entry, #plugin:hover {
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
box#main {
|
||||
background: rgba(30, 30, 46, 0.7);
|
||||
border: 1px solid @border-col;
|
||||
border-radius: 15px;
|
||||
padding: 5px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
4
home/linux/gui/hyprland/values/default.nix
Normal file
4
home/linux/gui/hyprland/values/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{mylib, ...} @ args:
|
||||
map
|
||||
(path: import path args)
|
||||
(mylib.scanPaths ./.)
|
||||
66
home/linux/gui/hyprland/values/hyprland.nix
Normal file
66
home/linux/gui/hyprland/values/hyprland.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
hyprland,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}: {
|
||||
# NOTE:
|
||||
# We have to enable hyprland/i3's systemd user service in home-manager,
|
||||
# so that gammastep/wallpaper-switcher's user service can be start correctly!
|
||||
# they are all depending on hyprland/i3's user graphical-session
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
settings = {
|
||||
source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-hyprland}/themes/mocha.conf";
|
||||
env = [
|
||||
"NIXOS_OZONE_WL,1" # for any ozone-based browser & electron apps to run on wayland
|
||||
"MOZ_ENABLE_WAYLAND,1" # for firefox to run on wayland
|
||||
"MOZ_WEBRENDER,1"
|
||||
# misc
|
||||
"_JAVA_AWT_WM_NONREPARENTING,1"
|
||||
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
||||
"QT_QPA_PLATFORM,wayland"
|
||||
"SDL_VIDEODRIVER,wayland"
|
||||
"GDK_BACKEND,wayland"
|
||||
];
|
||||
};
|
||||
package = hyprland.packages.${pkgs.system}.hyprland;
|
||||
extraConfig = builtins.readFile ../conf/hyprland.conf;
|
||||
# gammastep/wallpaper-switcher need this to be enabled.
|
||||
systemd.enable = true;
|
||||
};
|
||||
|
||||
# NOTE: this executable is used by greetd to start a wayland session when system boot up
|
||||
# with such a vendor-no-locking script, we can switch to another wayland compositor without modifying greetd's config in NixOS module
|
||||
home.file.".wayland-session" = {
|
||||
source = "${pkgs.hyprland}/bin/Hyprland";
|
||||
executable = true;
|
||||
};
|
||||
|
||||
# hyprland configs, based on https://github.com/notwidow/hyprland
|
||||
xdg.configFile = {
|
||||
"hypr/mako" = {
|
||||
source = ../conf/mako;
|
||||
recursive = true;
|
||||
};
|
||||
"hypr/scripts" = {
|
||||
source = ../conf/scripts;
|
||||
recursive = true;
|
||||
};
|
||||
"hypr/waybar" = {
|
||||
source = ../conf/waybar;
|
||||
recursive = true;
|
||||
};
|
||||
"hypr/wlogout" = {
|
||||
source = ../conf/wlogout;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
# music player - mpd
|
||||
"mpd" = {
|
||||
source = ../conf/mpd;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
31
home/linux/gui/hyprland/values/packages.nix
Normal file
31
home/linux/gui/hyprland/values/packages.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
waybar # the status bar
|
||||
swaybg # the wallpaper
|
||||
swayidle # the idle timeout
|
||||
swaylock # locking the screen
|
||||
wlogout # logout menu
|
||||
wl-clipboard # copying and pasting
|
||||
hyprpicker # color picker
|
||||
|
||||
pkgs-unstable.hyprshot # screen shot
|
||||
grim # taking screenshots
|
||||
slurp # selecting a region to screenshot
|
||||
wf-recorder # screen recording
|
||||
|
||||
mako # the notification daemon, the same as dunst
|
||||
|
||||
yad # a fork of zenity, for creating dialogs
|
||||
|
||||
# audio
|
||||
alsa-utils # provides amixer/alsamixer/...
|
||||
mpd # for playing system sounds
|
||||
mpc-cli # command-line mpd client
|
||||
ncmpcpp # a mpd client with a UI
|
||||
networkmanagerapplet # provide GUI app: nm-connection-editor
|
||||
];
|
||||
}
|
||||
96
home/linux/gui/hyprland/values/wayland-apps.nix
Normal file
96
home/linux/gui/hyprland/values/wayland-apps.nix
Normal file
@@ -0,0 +1,96 @@
|
||||
{
|
||||
pkgs,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}: {
|
||||
# refer to https://codeberg.org/dnkl/foot/src/branch/master/foot.ini
|
||||
xdg.configFile."foot/foot.ini".text =
|
||||
''
|
||||
[main]
|
||||
dpi-aware=yes
|
||||
font=JetBrainsMono Nerd Font:size=13
|
||||
shell=${pkgs.bash}/bin/bash --login -c 'nu --login --interactive'
|
||||
term=foot
|
||||
initial-window-size-pixels=3840x2160
|
||||
initial-window-mode=windowed
|
||||
pad=0x0 # optionally append 'center'
|
||||
resize-delay-ms=10
|
||||
|
||||
[mouse]
|
||||
hide-when-typing=yes
|
||||
''
|
||||
+ (builtins.readFile "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-foot}/catppuccin-mocha.conf");
|
||||
|
||||
programs = {
|
||||
# a wayland only terminal emulator
|
||||
foot = {
|
||||
enable = true;
|
||||
# foot can also be run in a server mode. In this mode, one process hosts multiple windows.
|
||||
# All Wayland communication, VT parsing and rendering is done in the server process.
|
||||
# New windows are opened by running footclient, which remains running until the terminal window is closed.
|
||||
#
|
||||
# Advantages to run foot in server mode including reduced memory footprint and startup time.
|
||||
# The downside is a performance penalty. If one window is very busy with, for example, producing output,
|
||||
# then other windows will suffer. Also, should the server process crash, all windows will be gone.
|
||||
server.enable = true;
|
||||
};
|
||||
|
||||
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
||||
google-chrome = {
|
||||
enable = true;
|
||||
|
||||
# https://wiki.archlinux.org/title/Chromium#Native_Wayland_support
|
||||
commandLineArgs = [
|
||||
"--ozone-platform-hint=auto"
|
||||
"--ozone-platform=wayland"
|
||||
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
|
||||
# (only supported by chromium/chrome at this time, not electron)
|
||||
"--gtk-version=4"
|
||||
# make it use text-input-v1, which works for kwin 5.27 and weston
|
||||
"--enable-wayland-ime"
|
||||
|
||||
# enable hardware acceleration - vulkan api
|
||||
# "--enable-features=Vulkan"
|
||||
];
|
||||
};
|
||||
|
||||
firefox = {
|
||||
enable = true;
|
||||
enableGnomeExtensions = false;
|
||||
package = pkgs.firefox-wayland; # firefox with wayland support
|
||||
};
|
||||
|
||||
vscode = {
|
||||
enable = true;
|
||||
# let vscode sync and update its configuration & extensions across devices, using github account.
|
||||
userSettings = {};
|
||||
package =
|
||||
(pkgs.vscode.override
|
||||
{
|
||||
isInsiders = true;
|
||||
# https://wiki.archlinux.org/title/Wayland#Electron
|
||||
commandLineArgs = [
|
||||
"--ozone-platform-hint=auto"
|
||||
"--ozone-platform=wayland"
|
||||
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
|
||||
# (only supported by chromium/chrome at this time, not electron)
|
||||
"--gtk-version=4"
|
||||
# make it use text-input-v1, which works for kwin 5.27 and weston
|
||||
"--enable-wayland-ime"
|
||||
|
||||
# TODO: fix https://github.com/microsoft/vscode/issues/187436
|
||||
# still not works...
|
||||
"--password-store=gnome" # use gnome-keyring as password store
|
||||
];
|
||||
})
|
||||
.overrideAttrs (oldAttrs: rec {
|
||||
# Use VSCode Insiders to fix crash: https://github.com/NixOS/nixpkgs/issues/246509
|
||||
src = builtins.fetchTarball {
|
||||
url = "https://update.code.visualstudio.com/latest/linux-x64/insider";
|
||||
sha256 = "0k2sh7rb6mrx9d6bkk2744ry4g17d13xpnhcisk4akl4x7dn6a83";
|
||||
};
|
||||
version = "latest";
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user