mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 08:58:26 +02:00
feat: upgrade system.stateVersion
feat: autologin - hyprland / i3 feat: 256color for console tty
This commit is contained in:
@@ -306,7 +306,6 @@
|
|||||||
|
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
|
|
||||||
# modern window compositor
|
|
||||||
hyprland.url = "github:hyprwm/Hyprland/v0.33.1";
|
hyprland.url = "github:hyprwm/Hyprland/v0.33.1";
|
||||||
# community wayland nixpkgs
|
# community wayland nixpkgs
|
||||||
# nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
# nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
||||||
|
|||||||
@@ -3,12 +3,16 @@
|
|||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
# If your themes for mouse cursor, icons or windows don’t load correctly,
|
||||||
|
# try setting them with home.pointerCursor and gtk.theme,
|
||||||
|
# which enable a bunch of compatibility options that should make the themes load in all situations.
|
||||||
|
|
||||||
home.pointerCursor = {
|
home.pointerCursor = {
|
||||||
|
gtk.enable = true;
|
||||||
|
x11.enable = true;
|
||||||
package = pkgs.bibata-cursors;
|
package = pkgs.bibata-cursors;
|
||||||
name = "Bibata-Modern-Classic";
|
name = "Bibata-Modern-Classic";
|
||||||
size = 24;
|
size = 24;
|
||||||
gtk.enable = true;
|
|
||||||
x11.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# set dpi for 4k monitor
|
# set dpi for 4k monitor
|
||||||
@@ -27,8 +31,9 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
font = {
|
font = {
|
||||||
name = "Roboto";
|
name = "Noto Sans";
|
||||||
package = pkgs.roboto;
|
package = pkgs.noto-fonts;
|
||||||
|
size = 11;
|
||||||
};
|
};
|
||||||
|
|
||||||
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||||
|
|||||||
@@ -1,23 +1,25 @@
|
|||||||
{pkgs, hyprland, catppuccin-hyprland, ...}: {
|
{
|
||||||
|
catppuccin-hyprland,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
# hyprland.homeManagerModules.default
|
|
||||||
|
|
||||||
./anyrun.nix
|
./anyrun.nix
|
||||||
./wayland-apps.nix
|
./wayland-apps.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# wayland.windowManager.hyprland.enable = true;
|
|
||||||
|
|
||||||
# hyprland configs, based on https://github.com/notwidow/hyprland
|
# hyprland configs, based on https://github.com/notwidow/hyprland
|
||||||
home.file.".config/hypr" = {
|
xdg.configFile."hypr" = {
|
||||||
source = ./hypr-conf;
|
source = ./hypr-conf;
|
||||||
# copy the scripts directory recursively
|
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
home.file.".config/hypr/themes".source = "${catppuccin-hyprland}/themes";
|
|
||||||
|
xdg.configFile."hypr/themes" = {
|
||||||
|
source = "${catppuccin-hyprland}/themes";
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
|
||||||
# music player - mpd
|
# music player - mpd
|
||||||
home.file.".config/mpd" = {
|
xdg.configFile."mpd" = {
|
||||||
source = ./mpd;
|
source = ./mpd;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
@@ -38,5 +40,4 @@
|
|||||||
"WLR_NO_HARDWARE_CURSORS" = "1";
|
"WLR_NO_HARDWARE_CURSORS" = "1";
|
||||||
"WLR_EGL_NO_MODIFIRES" = "1";
|
"WLR_EGL_NO_MODIFIRES" = "1";
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,7 +218,15 @@ exec-once = hyprctl setcursor "Bibata-Modern-Ice" 24
|
|||||||
# 相比较一开始的方案输入法字体大小也正确了.唯一有点问题的可能是 xwayland 窗口下的鼠标指针大小不对
|
# 相比较一开始的方案输入法字体大小也正确了.唯一有点问题的可能是 xwayland 窗口下的鼠标指针大小不对
|
||||||
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
|
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
|
||||||
|
|
||||||
exec-once = xrdb -merge ~/.Xresources
|
-- Fix HiDPI - xwayland
|
||||||
# env = GDK_SCALE,2
|
# change monitor to high resolution, the last argument is the scale factor
|
||||||
env = XCURSOR_SIZE,48
|
monitor=,highres,auto,2
|
||||||
env = XCURSOR_THEME,"Bibata-Modern-Ice"
|
|
||||||
|
# unscale XWayland
|
||||||
|
xwayland {
|
||||||
|
force_zero_scaling = true
|
||||||
|
}
|
||||||
|
|
||||||
|
# toolkit-specific scale
|
||||||
|
env = GDK_SCALE,2
|
||||||
|
env = XCURSOR_SIZE,32
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
# You can update Home Manager without changing this value. See
|
# You can update Home Manager without changing this value. See
|
||||||
# the Home Manager release notes for a list of state version
|
# the Home Manager release notes for a list of state version
|
||||||
# changes in each release.
|
# changes in each release.
|
||||||
stateVersion = "23.05";
|
stateVersion = "23.11";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
|
|||||||
@@ -58,5 +58,5 @@
|
|||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,11 +60,7 @@
|
|||||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||||
# package = config.boot.kernelPackages.nvidiaPackages.stable;
|
# package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
|
|
||||||
# Modesetting is needed for most Wayland compositors
|
modesetting.enable = false;
|
||||||
modesetting.enable = true;
|
|
||||||
# Use the open source version of the kernel module
|
|
||||||
# Only available on driver 515.43.04+
|
|
||||||
open = false;
|
|
||||||
|
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,5 +60,5 @@
|
|||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,5 +60,5 @@
|
|||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,5 +65,5 @@
|
|||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,5 +98,5 @@
|
|||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,5 +98,5 @@
|
|||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,6 +209,19 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.kmscon = {
|
||||||
|
# Use kmscon as the virtual console instead of gettys.
|
||||||
|
# kmscon is a kms/dri-based userspace virtual terminal implementation.
|
||||||
|
# It supports a richer feature set than the standard linux console VT,
|
||||||
|
# including full unicode support, and when the video card supports drm should be much faster.
|
||||||
|
enable = true;
|
||||||
|
fonts = [ { name = "Source Code Pro"; package = pkgs.source-code-pro; } ];
|
||||||
|
extraOptions = "--term xterm-256color";
|
||||||
|
extraConfig = "font-size=12";
|
||||||
|
# Whether to use 3D hardware acceleration to render the console.
|
||||||
|
hwRender = true;
|
||||||
|
};
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
# fix https://github.com/NixOS/nixpkgs/issues/238025
|
# fix https://github.com/NixOS/nixpkgs/issues/238025
|
||||||
TZ = "${config.time.timeZone}";
|
TZ = "${config.time.timeZone}";
|
||||||
|
|||||||
@@ -1,18 +1,12 @@
|
|||||||
{pkgs, hyprland, ...}: {
|
{pkgs, hyprland, ...}: {
|
||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
#
|
#
|
||||||
# NixOS's Configuration for Hyprland Window Manager
|
# NixOS's Configuration for Wayland based Window Manager
|
||||||
#
|
#
|
||||||
# i3wm: old and stable, only support X11
|
|
||||||
# sway: compatible with i3wm, support Wayland. do not support Nvidia GPU officially.
|
|
||||||
# hyprland: project starts from 2022, support Wayland, envolving fast, good looking, support Nvidia GPU.
|
# hyprland: project starts from 2022, support Wayland, envolving fast, good looking, support Nvidia GPU.
|
||||||
#
|
#
|
||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
|
|
||||||
imports = [
|
|
||||||
# hyprland.nixosModules.default
|
|
||||||
];
|
|
||||||
|
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wlr.enable = true;
|
wlr.enable = true;
|
||||||
@@ -46,22 +40,21 @@
|
|||||||
programs = {
|
programs = {
|
||||||
hyprland = {
|
hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = hyprland.packages.${pkgs.system}.hyprland.override {
|
||||||
xwayland = {
|
enableXWayland = true; # whether to enable XWayland
|
||||||
enable = true;
|
legacyRenderer = false; # whether to use the legacy renderer (for old GPUs)
|
||||||
|
withSystemd = true; # whether to build with systemd support
|
||||||
};
|
};
|
||||||
|
|
||||||
enableNvidiaPatches = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# monitor backlight control
|
|
||||||
light.enable = true;
|
|
||||||
|
|
||||||
# thunar file manager(part of xfce) related options
|
# thunar file manager(part of xfce) related options
|
||||||
thunar.plugins = with pkgs.xfce; [
|
thunar = {
|
||||||
thunar-archive-plugin
|
enable = true;
|
||||||
thunar-volman
|
plugins = with pkgs.xfce; [
|
||||||
];
|
thunar-archive-plugin
|
||||||
|
thunar-volman
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
# List packages installed in system profile. To search, run:
|
||||||
@@ -73,7 +66,7 @@
|
|||||||
swaylock # locking the screen
|
swaylock # locking the screen
|
||||||
wlogout # logout menu
|
wlogout # logout menu
|
||||||
wl-clipboard # copying and pasting
|
wl-clipboard # copying and pasting
|
||||||
hyprpicker # color picker
|
hyprpicker # color picker
|
||||||
|
|
||||||
wf-recorder # creen recording
|
wf-recorder # creen recording
|
||||||
grim # taking screenshots
|
grim # taking screenshots
|
||||||
@@ -90,8 +83,6 @@
|
|||||||
mpc-cli # command-line mpd client
|
mpc-cli # command-line mpd client
|
||||||
ncmpcpp # a mpd client with a UI
|
ncmpcpp # a mpd client with a UI
|
||||||
networkmanagerapplet # provide GUI app: nm-connection-editor
|
networkmanagerapplet # provide GUI app: nm-connection-editor
|
||||||
|
|
||||||
xfce.thunar # xfce4's file manager
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# fix https://github.com/ryan4yin/nix-config/issues/10
|
# fix https://github.com/ryan4yin/nix-config/issues/10
|
||||||
|
|||||||
@@ -5,22 +5,38 @@
|
|||||||
#
|
#
|
||||||
####################################################################
|
####################################################################
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
# thunar file manager(part of xfce) related options
|
||||||
|
thunar = {
|
||||||
|
enable = true;
|
||||||
|
plugins = with pkgs.xfce; [
|
||||||
|
thunar-archive-plugin
|
||||||
|
thunar-volman
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# i3 related options
|
# i3 related options
|
||||||
environment.pathsToLink = ["/libexec"]; # links /libexec from derivations to /run/current-system/sw
|
|
||||||
services = {
|
services = {
|
||||||
gvfs.enable = true; # Mount, trash, and other functionalities
|
gvfs.enable = true; # Mount, trash, and other functionalities
|
||||||
tumbler.enable = true; # Thumbnail support for images
|
tumbler.enable = true; # Thumbnail support for images
|
||||||
xserver = {
|
xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
# Configure keymap in X11
|
||||||
|
xkb.layout = "us";
|
||||||
|
|
||||||
desktopManager = {
|
desktopManager = {
|
||||||
xterm.enable = false;
|
xterm.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
displayManager = {
|
displayManager = {
|
||||||
|
lightdm.enable = true;
|
||||||
|
autoLogin = {
|
||||||
|
enable = true;
|
||||||
|
user = "ryan";
|
||||||
|
};
|
||||||
defaultSession = "none+i3";
|
defaultSession = "none+i3";
|
||||||
lightdm.enable = false;
|
|
||||||
gdm.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
windowManager.i3 = {
|
windowManager.i3 = {
|
||||||
@@ -35,7 +51,7 @@
|
|||||||
i3-gaps # i3 with gaps
|
i3-gaps # i3 with gaps
|
||||||
picom # transparency and shadows
|
picom # transparency and shadows
|
||||||
feh # set wallpaper
|
feh # set wallpaper
|
||||||
xcolor # color picker
|
xcolor # color picker
|
||||||
|
|
||||||
acpi # battery information
|
acpi # battery information
|
||||||
arandr # screen layout manager
|
arandr # screen layout manager
|
||||||
@@ -46,20 +62,8 @@
|
|||||||
scrot # minimal screen capture tool, used by i3 blur lock to take a screenshot
|
scrot # minimal screen capture tool, used by i3 blur lock to take a screenshot
|
||||||
sysstat # get system information
|
sysstat # get system information
|
||||||
alsa-utils # provides amixer/alsamixer/...
|
alsa-utils # provides amixer/alsamixer/...
|
||||||
|
|
||||||
xfce.thunar # xfce4's file manager
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configure keymap in X11
|
|
||||||
layout = "us";
|
|
||||||
xkbVariant = "";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# thunar file manager(part of xfce) related options
|
|
||||||
programs.thunar.plugins = with pkgs.xfce; [
|
|
||||||
thunar-archive-plugin
|
|
||||||
thunar-volman
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user