initial commit

This commit is contained in:
Youwen Wu 2024-07-11 03:56:19 -07:00
commit 23af9dd40e
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
6 changed files with 1035 additions and 0 deletions

198
configuration.nix Executable file
View file

@ -0,0 +1,198 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, inputs, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# select kernel
boot.kernelPackages = pkgs.linuxPackages_zen;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
};
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
# services.desktopManager.plasma6.enable = true;
# Configure keymap in X11
services.xserver = {
xkb.layout = "us";
xkb.variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.youwen = {
isNormalUser = true;
description = "Youwen Wu";
extraGroups = [ "networkmanager" "wheel" "nixos" ];
packages = with pkgs; [
kdePackages.kate
# thunderbird
];
};
nix.settings = {
trusted-users = [ "root" "youwen" ];
experimental-features = [ "nix-command" "flakes" ];
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
neovim
wget
git
curl
librewolf
gnumake
clang
gcc
cachix
nodejs_22
cargo
rustc
gnupg
openssh
python3
wl-clipboard
hyprlock
rofi-wayland
];
environment.variables.EDITOR = "nvim";
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# 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 = "24.05"; # Did you read the comment?
hardware.opengl = {
enable = true;
};
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
};
programs.zsh.enable = true;
users.users.youwen.shell = pkgs.zsh;
fonts = {
enableDefaultPackages = true;
fontconfig = {
defaultFonts = {
serif = [ "Noto Serif" ];
sansSerif = [ "Noto Sans" ];
};
};
packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
(nerdfonts.override { fonts = [ "CascadiaCode" ]; })
];
};
}

272
flake.lock Executable file
View file

@ -0,0 +1,272 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1720042825,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
},
"hyprcursor": {
"inputs": {
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1720108799,
"narHash": "sha256-AxRkTJlbB8r7aG6gvc7IaLhc2T9TO4/8uqanKRxukBQ=",
"owner": "hyprwm",
"repo": "hyprcursor",
"rev": "a5c0d57325c5f0814c39110a70ca19c070ae9486",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprcursor",
"type": "github"
}
},
"hyprland": {
"inputs": {
"hyprcursor": "hyprcursor",
"hyprlang": "hyprlang",
"hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs",
"systems": "systems",
"xdph": "xdph"
},
"locked": {
"lastModified": 1720453602,
"narHash": "sha256-7+PjJZn/jpqNkVKJ3AGVT9G601rVj/R8KkT+WWjhwyk=",
"ref": "refs/heads/main",
"rev": "b03f41efec14273cf25c42d4cef326acc36cb319",
"revCount": 4913,
"submodules": true,
"type": "git",
"url": "https://github.com/hyprwm/Hyprland"
},
"original": {
"submodules": true,
"type": "git",
"url": "https://github.com/hyprwm/Hyprland"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"xdph",
"nixpkgs"
],
"systems": [
"hyprland",
"xdph",
"systems"
]
},
"locked": {
"lastModified": 1718746314,
"narHash": "sha256-HUklK5u86w2Yh9dOkk4FdsL8eehcOZ95jPhLixGDRQY=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "1b61f0093afff20ab44d88ad707aed8bf2215290",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1720381373,
"narHash": "sha256-lyC/EZdHULsaAKVryK11lgHY9u6pXr7qR4irnxNWC7k=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "5df0174fd09de4ac5475233d65ffc703e89b82eb",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprutils": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1720203444,
"narHash": "sha256-lq2dPPPcwMHTLsFrQ2pRp4c2LwDZWoqzSyjuPdeJCP4=",
"owner": "hyprwm",
"repo": "hyprutils",
"rev": "a8c3a135701a7b64db0a88ec353a392f402d2a87",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprutils",
"type": "github"
}
},
"hyprwayland-scanner": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1720215857,
"narHash": "sha256-JPdL+Qul+jEueAn8CARfcWP83eJgwkhMejQYfDvrgvU=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "d5fa094ca27e0039be5e94c0a80ae433145af8bb",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1720031269,
"narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9f4128e00b0ae8ec65918efeba59db998750ead6",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1720553833,
"narHash": "sha256-IXMiHQMtdShDXcBW95ctA+m5Oq2kLxnBt7WlMxvDQXA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "249fbde2a178a2ea2638b65b9ecebd531b338cf9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"hyprland": "hyprland",
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1720194466,
"narHash": "sha256-Rizg9efi6ue95zOp0MeIV2ZedNo+5U9G2l6yirgBUnA=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "b9b97e5ba23fe7bd5fa4df54696102e8aa863cf6",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

29
flake.nix Executable file
View file

@ -0,0 +1,29 @@
{
description = "System configuration flake.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
};
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.youwen = import ./home.nix;
}
];
};
};
}

39
hardware-configuration.nix Executable file
View file

@ -0,0 +1,39 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/2616d86c-aac2-4780-9527-7b11192e783f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/B826-E14B";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

430
home.nix Executable file
View file

@ -0,0 +1,430 @@
{ config, pkgs, ... }:
{
home.username = "youwen";
home.homeDirectory = "/home/youwen";
# link the configuration file in current directory to the specified location in home directory
# home.file.".config/i3/wallpaper.jpg".source = ./wallpaper.jpg;
# link all files in `./scripts` to `~/.config/i3/scripts`
# home.file.".config/i3/scripts" = {
# source = ./scripts;
# recursive = true; # link recursively
# executable = true; # make all files executable
# };
# encode the file content in nix configuration file directly
# home.file.".xxx".text = ''
# xxx
# '';
# Packages that should be installed to the user profile.
home.packages = with pkgs; [
# here is some command line tools I use frequently
# feel free to add your own or remove some of them
neofetch
dolphin
bitwarden-desktop
# archives
zip
xz
unzip
p7zip
# utils
ripgrep # recursively searches directories for a regex pattern
jq # A lightweight and flexible command-line JSON processor
yq-go # yaml processor https://github.com/mikefarah/yq
eza # A modern replacement for ls
fzf # A command-line fuzzy finder
oh-my-posh
# networking tools
mtr # A network diagnostic tool
iperf3
dnsutils # `dig` + `nslookup`
ldns # replacement of `dig`, it provide the command `drill`
aria2 # A lightweight multi-protocol & multi-source command-line download utility
socat # replacement of openbsd-netcat
nmap # A utility for network discovery and security auditing
ipcalc # it is a calculator for the IPv4/v6 addresses
# misc
cowsay
file
which
tree
gnused
gnutar
gawk
zstd
gnupg
# nix related
#
# it provides the command `nom` works just like `nix`
# with more details log output
nix-output-monitor
# productivity
hugo # static site generator
glow # markdown previewer in terminal
btop # replacement of htop/nmon
iotop # io monitoring
iftop # network monitoring
# system call monitoring
strace # system call monitoring
ltrace # library call monitoring
lsof # list open files
# system tools
sysstat
lm_sensors # for `sensors` command
ethtool
pciutils # lspci
usbutils # lsusb
# messaging apps
vesktop
signal-desktop
nodePackages_latest.pnpm
rustfmt
rust-analyzer
gh
zoxide
dunst
swww
waypaper
delta
lazygit
];
services.dunst.enable = true;
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = {
exec-once =
[
"waybar"
];
"$mod" = "SUPER";
"$Left" = "Y";
"$Right" = "O";
"$Up" = "I";
"$Down" = "U";
bind =
[
"$mod, F, exec, librewolf"
"$mod, T, exec, kitty"
"$mod, E, exec, dolphin"
"$mod, Q, killactive"
"$mod, W, togglefloating"
"$mod, $Left, movefocus, l"
"$mod, $Right, movefocus, r"
"$mod, $Up, movefocus, u"
"$mod, $Down, movefocus, d"
"$mod+Shift+Ctrl, $Left, movewindow, l"
"$mod+Shift+Ctrl, $Right, movewindow, r"
"$mod+Shift+Ctrl, $Up, movewindow, u"
"$mod+Shift+Ctrl, $Down, movewindow, d"
"$mod, J, togglesplit"
"$mod+Ctrl+Alt, $Right, movetoworkspace, r+1"
"$mod+Ctrl+Alt, $Left, movetoworkspace, r-1"
"$mod+Ctrl, $Right, workspace, r+1"
"$mod+Ctrl, $Left, workspace, r-1"
"$mod+Alt, S, movetoworkspacesilent, special"
"$mod, S, togglespecialworkspace"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$mod, A, exec, pkill -x rofi || rofi -show drun"
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod, Z, movewindow"
"$mod, X, resizewindow"
];
windowrulev2 = [
"opacity 0.90 0.90,class:^(librewolf)$"
"opacity 0.90 0.90,class:^(Brave-browser)$"
"opacity 0.80 0.80,class:^(Steam)$"
"opacity 0.80 0.80,class:^(steam)$"
"opacity 0.80 0.80,class:^(steamwebhelper)$"
"opacity 0.80 0.80,class:^(Spotify)$"
"opacity 0.80 0.80,initialTitle:^(Spotify Free)$"
"opacity 0.80 0.80,class:^(code-oss)$"
"opacity 0.80 0.80,class:^(Code)$"
"opacity 0.80 0.80,class:^(code-url-handler)$"
"opacity 0.80 0.80,class:^(code-insiders-url-handler)$"
"opacity 0.80 0.80,class:^(kitty)$"
"opacity 0.80 0.80,class:^(org.kde.dolphin)$"
"opacity 0.80 0.80,class:^(org.kde.ark)$"
"opacity 0.80 0.80,class:^(nwg-look)$"
"opacity 0.80 0.80,class:^(qt5ct)$"
"opacity 0.80 0.80,class:^(qt6ct)$"
"opacity 0.80 0.80,class:^(kvantummanager)$"
"opacity 0.90 0.90,class:^(com.github.rafostar.Clapper)$ # Clapper-Gtk"
"opacity 0.80 0.80,class:^(com.github.tchx84.Flatseal)$ # Flatseal-Gtk"
"opacity 0.80 0.80,class:^(hu.kramo.Cartridges)$ # Cartridges-Gtk"
"opacity 0.80 0.80,class:^(com.obsproject.Studio)$ # Obs-Qt"
"opacity 0.80 0.80,class:^(gnome-boxes)$ # Boxes-Gtk"
"opacity 0.80 0.80,class:^(discord)$ # Discord-Electron"
"opacity 0.80 0.80,class:^(WebCord)$ # WebCord-Electron"
"opacity 0.80 0.80,class:^(ArmCord)$ # ArmCord-Electron"
"opacity 0.80 0.80,class:^(app.drey.Warp)$ # Warp-Gtk"
"opacity 0.80 0.80,class:^(net.davidotek.pupgui2)$ # ProtonUp-Qt"
"opacity 0.80 0.80,class:^(yad)$ # Protontricks-Gtk"
"opacity 0.80 0.80,class:^(Signal)$ # Signal-Gtk"
"opacity 0.80 0.80,class:^(io.github.alainm23.planify)$ # planify-Gtk"
"opacity 0.80 0.80,class:^(io.gitlab.theevilskeleton.Upscaler)$ # Upscaler-Gtk"
"opacity 0.80 0.80,class:^(com.github.unrud.VideoDownloader)$ # VideoDownloader-Gtk"
"opacity 0.80 0.70,class:^(pavucontrol)$"
"opacity 0.80 0.70,class:^(blueman-manager)$"
"opacity 0.80 0.70,class:^(nm-applet)$"
"opacity 0.80 0.70,class:^(nm-connection-editor)$"
"opacity 0.80 0.70,class:^(org.kde.polkit-kde-authentication-agent-1)$"
"float,class:^(org.kde.dolphin)$,title:^(Progress Dialog Dolphin)$"
"float,class:^(org.kde.dolphin)$,title:^(Copying Dolphin)$"
"float,title:^(Picture-in-Picture)$"
"float,class:^(firefox)$,title:^(Library)$"
"float,class:^(vlc)$"
"float,class:^(kvantummanager)$"
"float,class:^(qt5ct)$"
"float,class:^(qt6ct)$"
"float,class:^(nwg-look)$"
"float,class:^(org.kde.ark)$"
"float,class:^(Signal)$ # Signal-Gtk"
"float,class:^(com.github.rafostar.Clapper)$ # Clapper-Gtk"
"float,class:^(app.drey.Warp)$ # Warp-Gtk"
"float,class:^(net.davidotek.pupgui2)$ # ProtonUp-Qt"
"float,class:^(yad)$ # Protontricks-Gtk"
"float,class:^(eog)$ # Imageviewer-Gtk"
"float,class:^(io.github.alainm23.planify)$ # planify-Gtk"
"float,class:^(io.gitlab.theevilskeleton.Upscaler)$ # Upscaler-Gtk"
"float,class:^(com.github.unrud.VideoDownloader)$ # VideoDownloader-Gkk"
"float,class:^(pavucontrol)$"
"float,class:^(blueman-manager)$"
"float,class:^(nm-applet)$"
"float,class:^(nm-connection-editor)$"
"float,class:^(org.kde.polkit-kde-authentication-agent-1)$"
"opacity 0.80 0.80,class:^(org.freedesktop.impl.portal.desktop.gtk)$"
"opacity 0.80 0.80,class:^(org.freedesktop.impl.portal.desktop.hyprland)$"
];
layerrule = [
"blur,rofi"
"ignorezero,rofi"
"blur,notifications"
"ignorezero,notifications"
"blur,swaync-notification-window"
"ignorezero,swaync-notification-window"
"blur,swaync-control-center"
"ignorezero,swaync-control-center"
"blur,logout_dialog"
"blur,waybar"
];
monitor = [
"DP-1,2560x1440@165,1920x0,auto"
"HDMI-A-1,1920x1080@60,0x0,1"
];
dwindle = {
pseudotile = "yes";
preserve_split = "yes";
};
animations = {
enabled = "yes";
bezier = [
"wind, 0.05, 0.9, 0.1, 1.05"
"winIn, 0.1, 1.1, 0.1, 1.1"
"winOut, 0.3, -0.3, 0, 1"
"liner, 1, 1, 1, 1"
];
animation = [
"windows, 1, 6, wind, slide"
"windowsIn, 1, 6, winIn, slide"
"windowsOut, 1, 5, winOut, slide"
"windowsMove, 1, 5, wind, slide"
"border, 1, 1, liner"
"borderangle, 1, 30, liner, loop"
"fade, 1, 10, default"
"workspaces, 1, 5, wind"
];
};
general = {
gaps_in = "3";
gaps_out = "8";
border_size = "2";
#
# the dot is a hyprland name, not nix syntax, so we escape it
"col.active_border" = "rgba(ca9ee6ff) rgba(f2d5cfff) 45deg";
"col.inactive_border" = "rgba(b4befecc) rgba(6c7086cc) 45deg";
layout = "dwindle";
resize_on_border = "true";
};
decoration = {
rounding = "10";
drop_shadow = "false";
dim_special = "0.3";
blur = {
enabled = "yes";
size = "6";
passes = "3";
new_optimizations = "on";
ignore_opacity = "on";
xray = "false";
special = true;
};
};
};
# basic configuration of git, please change to your own
programs.git = {
enable = true;
userName = "Youwen Wu";
userEmail = "youwenw@gmail.com";
delta.enable = true;
extraConfig = {
init.defaultBranch = "main";
};
};
programs.lazygit.enable = true;
programs.kitty = {
enable = true;
theme = "Tokyo Night";
font.name = "CaskaydiaCove Nerd Font";
settings = {
font_size = 12;
window_padding_width = "8 8 0";
confirm_os_window_close = -1;
shell_integration = "enabled";
};
};
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 30;
output = [
"DP-1"
"HDMI-A-1"
];
modules-left = [ "hyprland/workspaces" "sway/submap" "wlr/taskbar" ];
modules-center = [ "hyprland/window" "custom/hello-from-waybar" ];
modules-right = [ "mpd" "custom/mymodule#with-css-id" "temperature" ];
"hyprland/workspaces" = {
disable-scroll = true;
all-outputs = true;
};
"custom/hello-from-waybar" = {
format = "hello {}";
max-length = 40;
interval = "once";
exec = pkgs.writeShellScript "hello-from-waybar" ''
echo "from within waybar"
'';
};
};
};
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ls = "eza -l --icons=auto";
update = "sudo nixos-rebuild switch";
};
initExtra = "eval \"$(oh-my-posh init zsh --config \"/etc/nixos/prompt.omp.json\")\"";
defaultKeymap = "viins";
antidote = {
enable = true;
plugins = [
"zimfw/environment"
"zimfw/input"
"zimfw/archive"
"zimfw/fzf"
"zimfw/magic-enter"
"zimfw/utility"
];
};
};
programs.bash = {
enable = true;
};
programs.librewolf = {
enable = true;
settings = {
"webgl.disabled" = false;
"privacy.resistFingerprinting" = false;
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.cookies" = false;
"network.cookie.lifetimePolicy" = 0;
};
};
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
# This value determines the home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new home Manager release introduces backwards
# incompatible changes.
home.stateVersion = "24.05";
#
# 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.
# Let home Manager install and manage itself.
programs.home-manager.enable = true;
}

67
prompt.omp.json Executable file
View file

@ -0,0 +1,67 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"palette": {
"os": "#ACB0BE",
"closer": "p:os",
"pink": "#F5BDE6",
"lavender": "#B7BDF8",
"blue": "#8AADF4"
},
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "p:os",
"style": "plain",
"template": "{{.Icon}} ",
"type": "os"
},
{
"foreground": "p:blue",
"style": "plain",
"template": "{{ .UserName }}@{{ .HostName }} ",
"type": "session"
},
{
"foreground": "p:pink",
"properties": {
"folder_icon": "..\ue5fe..",
"home_icon": "~",
"style": "agnoster_short"
},
"style": "plain",
"template": "{{ .Path }} ",
"type": "path"
},
{
"foreground": "p:lavender",
"properties": {
"branch_icon": "\ue725 ",
"cherry_pick_icon": "\ue29b ",
"commit_icon": "\uf417 ",
"fetch_status": false,
"fetch_upstream_icon": false,
"merge_icon": "\ue727 ",
"no_commits_icon": "\uf0c3 ",
"rebase_icon": "\ue728 ",
"revert_icon": "\uf0e2 ",
"tag_icon": "\uf412 "
},
"template": "{{ .HEAD }} ",
"style": "plain",
"type": "git"
},
{
"style": "plain",
"foreground": "p:closer",
"template": "\uf105",
"type": "text"
}
],
"type": "prompt"
}
],
"final_space": true,
"version": 2
}