refactor: move to hyprland

This commit is contained in:
2025-12-22 15:59:25 -05:00
parent b713f0f3d9
commit 14a58df894
31 changed files with 1331 additions and 104 deletions

View File

@@ -1,4 +1,4 @@
{ inputs, ... }: {
{ ... }: {
time.timeZone = "America/New_York";
# security.sudo.wheelNeedsPassword = false;

View File

@@ -0,0 +1,16 @@
{ ... }:
{
imports = [
./hyprland/font.nix
./hyprland/cursor.nix
./hyprland/packages.nix
./hyprland/greeter.nix
./hyprland/hyprlock.nix
];
programs.hyprland = {
enable = true;
withUWSM = true;
xwayland.enable = true;
};
}

View File

@@ -0,0 +1,10 @@
{ pkgs, lib, ... }:
{
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"apple_cursor"
];
environment.systemPackages = with pkgs; [
apple-cursor
];
}

View File

@@ -0,0 +1,28 @@
{ pkgs, apple-fonts, ... }: {
fonts = {
fontconfig.defaultFonts = {
sansSerif = [ "SF Pro" ];
serif = [ "SF Pro" ];
monospace = [ "JetBrainsMono Nerd Font" ];
};
packages = with pkgs; [
monocraft
noto-fonts-cjk-sans
nerd-fonts.jetbrains-mono
(apple-fonts.packages.${pkgs.system}.sf-pro)
(stdenv.mkDerivation {
name = "apple-color-emoji";
src = fetchurl {
url =
"https://github.com/samuelngs/apple-emoji-linux/releases/download/v17.4/AppleColorEmoji.ttf";
sha256 = "1wahjmbfm1xgm58madvl21451a04gxham5vz67gqz1cvpi0cjva8";
};
dontUnpack = true;
installPhase = ''
install -Dm644 $src $out/share/fonts/truetype/AppleColorEmoji.ttf
'';
})
];
};
}

View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd 'uwsm start hyprland-uwsm.desktop'";
user = "greeter";
};
};
};
}

View File

@@ -0,0 +1,4 @@
{ ... }:
{
security.pam.services.hyprlock = {};
}

View File

@@ -0,0 +1,22 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
hyprpaper
hypridle
hyprpicker
hyprsunset
hyprshot
waybar
walker
swayosd
playerctl
brightnessctl
wl-clipboard
wdisplays
bluetui
kdePackages.dolphin
];
}

View File

@@ -26,3 +26,4 @@
wl-clipboard # Command-line copy/paste utilities for Wayland
];
}

View File

@@ -1,19 +0,0 @@
{ pkgs, ... }: {
fonts.packages = with pkgs; [
monocraft
noto-fonts-cjk-sans
(stdenv.mkDerivation {
name = "apple-color-emoji";
src = fetchurl {
url =
"https://github.com/samuelngs/apple-emoji-linux/releases/download/v17.4/AppleColorEmoji.ttf";
sha256 = "1wahjmbfm1xgm58madvl21451a04gxham5vz67gqz1cvpi0cjva8";
};
dontUnpack = true;
installPhase = ''
install -Dm644 $src $out/share/fonts/truetype/AppleColorEmoji.ttf
'';
})
];
}

View File

@@ -7,7 +7,7 @@
fcitx5.addons = with pkgs; [
# fcitx5-gtk # alternatively, kdePackages.fcitx5-qt
kdePackages.fcitx5-qt # alternatively, kdePackages.fcitx5-qt
fcitx5-chinese-addons # table input method support
qt6Packages.fcitx5-chinese-addons # table input method support
fcitx5-nord # a color theme
];
};

View File

@@ -1,4 +1,4 @@
{ pkgs, config, pkgs-unstable, ... }:
{ pkgs, config, pkgs-unstable, lib, ... }:
let
openconnect-sso-src = builtins.fetchTree {
type = "github";
@@ -16,11 +16,13 @@ in
./work.nix
./sops.nix
../common/optional/desktop/hyprland.nix
../common/optional/yubikey.nix
../common/optional/browser.nix
../common/optional/desktop.nix
../common/optional/fonts.nix
../common/optional/locale.nix
../common/optional/email.nix
@@ -37,16 +39,14 @@ in
hardware = {
asahi = {
peripheralFirmwareDirectory = ./firmware;
useExperimentalGPUDriver = true;
experimentalGPUInstallMode = "replace";
# useExperimentalGPUDriver = true;
# experimentalGPUInstallMode = "replace";
setupAsahiSound = true;
};
};
# networking.hostName = "nixos"; # Define your hostname.
# Pick only one of the below networking options.
networking.networkmanager.enable =
true; # Easiest to use and most distros use this by default.
networking.networkmanager.enable = true;
# networking.wireless.iwd.enable = true;
hardware.bluetooth = {
enable = true;
@@ -66,6 +66,8 @@ in
programs.kdeconnect.enable = true;
environment.systemPackages = with pkgs; [
networkmanager
vim
git
wget
@@ -77,12 +79,12 @@ in
libreoffice-qt
# ncmpcpp
pkgs-unstable.signal-desktop
pkgs-unstable.signal-desktop-bin
gnupg
(pass.withExtensions (exts: [ exts.pass-otp ]))
pinentry
# pinentry
pinentry-curses
pinentry-qt
@@ -129,7 +131,7 @@ in
fi
'')
(pkgs.callPackage "${openconnect-sso-src}/nix" {}).openconnect-sso
# (pkgs.callPackage "${openconnect-sso-src}/nix" {}).openconnect-sso
];
programs.zsh.enable = true;
@@ -141,20 +143,20 @@ in
};
services.keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ];
settings = {
main = {
pageup = "leftmouse";
pagedown = "rightmouse";
};
};
};
};
# services.keyd = {
# enable = true;
#
# keyboards.default = {
# ids = [ "*" ];
#
# settings = {
# main = {
# pageup = "leftmouse";
# pagedown = "rightmouse";
# };
# };
# };
# };
system.stateVersion = "25.05";

View File

@@ -7,7 +7,9 @@
./home/git.nix
./home/browser.nix
./home/desktop.nix
../../home/common/optional/desktop/hyprland.nix
./home/nvim.nix
./home/terminal.nix
./home/zathura.nix

View File

@@ -1,5 +1,35 @@
{ config, ... }:
{
xdg.mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = "zen-beta.desktop";
"x-scheme-handler/https" = "zen-beta.desktop";
"x-scheme-handler/chrome" = "zen-beta.desktop";
"text/html" = "zen-beta.desktop";
"application/x-extension-htm" = "zen-beta.desktop";
"application/x-extension-html" = "zen-beta.desktop";
"application/x-extension-shtml" = "zen-beta.desktop";
"application/xhtml+xml" = "zen-beta.desktop";
"application/x-extension-xhtml" = "zen-beta.desktop";
"application/x-extension-xht" = "zen-beta.desktop";
};
associations.added = {
"x-scheme-handler/http" = [ "zen-beta.desktop" ];
"x-scheme-handler/https" = [ "zen-beta.desktop" ];
"x-scheme-handler/chrome" = [ "zen-beta.desktop" ];
"text/html" = [ "zen-beta.desktop" ];
"application/x-extension-htm" = [ "zen-beta.desktop" ];
"application/x-extension-html" = [ "zen-beta.desktop" ];
"application/x-extension-shtml" = [ "zen-beta.desktop" ];
"application/xhtml+xml" = [ "zen-beta.desktop" ];
"application/x-extension-xhtml" = [ "zen-beta.desktop" ];
"application/x-extension-xht" = [ "zen-beta.desktop" ];
};
};
programs.zen-browser = {
enable = true;
profiles."default" = {

View File

@@ -1,15 +0,0 @@
{ lib, ... }: {
programs.plasma = {
enable = true;
workspace = { wallpaper = "/home/max/bg.jpg"; };
kwin = { virtualDesktops = { number = 4; }; };
input = {
keyboard = {
options = [ "caps:escape" ];
layouts = [ { layout = "us"; } { layout = "cn"; } ];
};
};
};
}

View File

@@ -6,14 +6,15 @@ in
{
programs.git = {
enable = true;
userName = "Max Koon";
userEmail = publicGitEmail;
extraConfig = {
settings = {
init.defaultBranch = "main";
push.autoSetupRemote = true;
commit.gpgsign = true;
gpg.format = "ssh";
user.name = "Max Koon";
user.email = publicGitEmail;
user.signing.key = publicKey;
gpg.ssh.allowedSignersFile = "/home/max/.ssh/allowed_signers";
};

View File

@@ -2,7 +2,7 @@
programs.nixvim = {
enable = true;
colorschemes.one.enable = true;
colorschemes.tokyonight.enable = true;
globals = {
mapleader = " ";
@@ -15,7 +15,7 @@
};
opts = {
background = "light";
background = "dark";
relativenumber = true;
cursorline = true;
number = true;
@@ -29,6 +29,25 @@
};
highlight = {
Normal = {
bg = "NONE";
ctermbg = "NONE";
};
NormalFloat = {
bg = "NONE";
ctermbg = "NONE";
};
SignColumn = {
bg = "NONE";
ctermbg = "NONE";
};
EndOfBuffer = {
bg = "NONE";
ctermbg = "NONE";
};
};
extraConfigLua = ''
require('stay-centered').setup({ enable = true })
require('mini.ai').setup()
@@ -238,7 +257,7 @@
};
neo-tree = {
enable = true;
extraOptions = {
settings = {
filesystem = {
filtered_items = {
visible = true;
@@ -252,7 +271,7 @@
bullets.enable = true;
spider = {
enable = true;
extraOptions = {
settings = {
subwordMovement = true;
skipInsignificantPunctuation = false;
};

View File

@@ -1,12 +1,19 @@
{ pkgs, ... }: {
{ pkgs, config, ... }: {
programs.alacritty = {
enable = true;
theme = "one_light";
theme = "tokyo_night";
settings = {
window = {
padding = { x = 14; y = 14; };
};
font = {
normal.family = "Monocraft";
normal.family = "JetBrainsMono Nerd Font";
size = 10;
};
keyboard.bindings = [
{ key = "Insert"; mods = "Shift"; action = "Paste"; }
{ key = "Insert"; mods = "Control"; action = "Copy"; }
];
};
};
@@ -18,12 +25,15 @@
keyMode = "vi";
shell = "${pkgs.zsh}/bin/zsh";
extraConfig = ''
set -g status-style bg=white
set -g status-style bg=default
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",alacritty:Tc"
'';
};
@@ -35,7 +45,7 @@
highlight = "fg=#bbbbbb";
};
syntaxHighlighting.enable = true;
dotDir = ".config/zsh";
dotDir = "${config.home.homeDirectory}/.config/zsh";
autocd = true;
initContent = ''

View File

@@ -6,8 +6,17 @@
users.users.max = {
isNormalUser = true;
hashedPasswordFile = config.sops.secrets.max-password.path;
extraGroups = [ "wheel" "networkmanager" "video" "wireshark" "kvm" ];
extraGroups = [ "wheel" "networkmanager" "video" "kvm" "docker" ];
packages = with pkgs; [ tree ];
shell = pkgs.zsh;
};
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
}