feat: upgrade system.stateVersion

feat: autologin - hyprland / i3
feat: 256color for console tty
This commit is contained in:
Ryan Yin
2023-12-17 00:26:15 +08:00
parent 1cf34add85
commit 7d03e63bdd
15 changed files with 86 additions and 69 deletions

View File

@@ -306,7 +306,6 @@
impermanence.url = "github:nix-community/impermanence";
# modern window compositor
hyprland.url = "github:hyprwm/Hyprland/v0.33.1";
# community wayland nixpkgs
# nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";

View File

@@ -3,12 +3,16 @@
config,
...
}: {
# If your themes for mouse cursor, icons or windows dont 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 = {
gtk.enable = true;
x11.enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
gtk.enable = true;
x11.enable = true;
};
# set dpi for 4k monitor
@@ -27,8 +31,9 @@
enable = true;
font = {
name = "Roboto";
package = pkgs.roboto;
name = "Noto Sans";
package = pkgs.noto-fonts;
size = 11;
};
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";

View File

@@ -1,23 +1,25 @@
{pkgs, hyprland, catppuccin-hyprland, ...}: {
{
catppuccin-hyprland,
...
}: {
imports = [
# hyprland.homeManagerModules.default
./anyrun.nix
./wayland-apps.nix
];
# wayland.windowManager.hyprland.enable = true;
# hyprland configs, based on https://github.com/notwidow/hyprland
home.file.".config/hypr" = {
xdg.configFile."hypr" = {
source = ./hypr-conf;
# copy the scripts directory recursively
recursive = true;
};
home.file.".config/hypr/themes".source = "${catppuccin-hyprland}/themes";
xdg.configFile."hypr/themes" = {
source = "${catppuccin-hyprland}/themes";
recursive = true;
};
# music player - mpd
home.file.".config/mpd" = {
xdg.configFile."mpd" = {
source = ./mpd;
recursive = true;
};
@@ -38,5 +40,4 @@
"WLR_NO_HARDWARE_CURSORS" = "1";
"WLR_EGL_NO_MODIFIRES" = "1";
};
}

View File

@@ -218,7 +218,15 @@ exec-once = hyprctl setcursor "Bibata-Modern-Ice" 24
# 相比较一开始的方案输入法字体大小也正确了.唯一有点问题的可能是 xwayland 窗口下的鼠标指针大小不对
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
exec-once = xrdb -merge ~/.Xresources
# env = GDK_SCALE,2
env = XCURSOR_SIZE,48
env = XCURSOR_THEME,"Bibata-Modern-Ice"
-- Fix HiDPI - xwayland
# change monitor to high resolution, the last argument is the scale factor
monitor=,highres,auto,2
# unscale XWayland
xwayland {
force_zero_scaling = true
}
# toolkit-specific scale
env = GDK_SCALE,2
env = XCURSOR_SIZE,32

View File

@@ -16,7 +16,7 @@
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
stateVersion = "23.05";
stateVersion = "23.11";
};
# Let Home Manager install and manage itself.

View File

@@ -58,5 +58,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (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?
}

View File

@@ -60,11 +60,7 @@
# Optionally, you may need to select the appropriate driver version for your specific GPU.
# package = config.boot.kernelPackages.nvidiaPackages.stable;
# Modesetting is needed for most Wayland compositors
modesetting.enable = true;
# Use the open source version of the kernel module
# Only available on driver 515.43.04+
open = false;
modesetting.enable = false;
powerManagement.enable = true;
};

View File

@@ -60,5 +60,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (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?
}

View File

@@ -60,5 +60,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (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?
}

View File

@@ -65,5 +65,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (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?
}

View File

@@ -98,5 +98,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (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?
}

View File

@@ -98,5 +98,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (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?
}

View File

@@ -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 = {
# fix https://github.com/NixOS/nixpkgs/issues/238025
TZ = "${config.time.timeZone}";

View File

@@ -1,18 +1,12 @@
{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.
#
##########################################################################################################
imports = [
# hyprland.nixosModules.default
];
xdg.portal = {
enable = true;
wlr.enable = true;
@@ -46,22 +40,21 @@
programs = {
hyprland = {
enable = true;
xwayland = {
enable = true;
package = hyprland.packages.${pkgs.system}.hyprland.override {
enableXWayland = true; # whether to enable XWayland
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.plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
};
# List packages installed in system profile. To search, run:
@@ -73,7 +66,7 @@
swaylock # locking the screen
wlogout # logout menu
wl-clipboard # copying and pasting
hyprpicker # color picker
hyprpicker # color picker
wf-recorder # creen recording
grim # taking screenshots
@@ -90,8 +83,6 @@
mpc-cli # command-line mpd client
ncmpcpp # a mpd client with a UI
networkmanagerapplet # provide GUI app: nm-connection-editor
xfce.thunar # xfce4's file manager
];
# fix https://github.com/ryan4yin/nix-config/issues/10

View File

@@ -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
environment.pathsToLink = ["/libexec"]; # links /libexec from derivations to /run/current-system/sw
services = {
gvfs.enable = true; # Mount, trash, and other functionalities
tumbler.enable = true; # Thumbnail support for images
xserver = {
enable = true;
# Configure keymap in X11
xkb.layout = "us";
desktopManager = {
xterm.enable = false;
};
displayManager = {
lightdm.enable = true;
autoLogin = {
enable = true;
user = "ryan";
};
defaultSession = "none+i3";
lightdm.enable = false;
gdm.enable = true;
};
windowManager.i3 = {
@@ -35,7 +51,7 @@
i3-gaps # i3 with gaps
picom # transparency and shadows
feh # set wallpaper
xcolor # color picker
xcolor # color picker
acpi # battery information
arandr # screen layout manager
@@ -46,20 +62,8 @@
scrot # minimal screen capture tool, used by i3 blur lock to take a screenshot
sysstat # get system information
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
];
}