chore: run nixfmt

This commit is contained in:
Youwen Wu 2024-07-21 19:02:10 -07:00
parent c72ff260db
commit 420d932dec
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
4 changed files with 149 additions and 172 deletions

View file

@ -5,10 +5,9 @@
{ config, inputs, pkgs, ... }: { config, inputs, pkgs, ... }:
{ {
imports = imports = [ # Include the results of the hardware scan.
[ # Include the results of the hardware scan. ./hardware-configuration.nix
./hardware-configuration.nix ];
];
# Bootloader. # Bootloader.
boot.loader = { boot.loader = {
@ -51,9 +50,7 @@
LC_TIME = "en_US.UTF-8"; LC_TIME = "en_US.UTF-8";
}; };
systemd.services = { systemd.services = { NetworkManager-wait-online.enable = false; };
NetworkManager-wait-online.enable = false;
};
# Enable the X11 windowing system. # Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session. # You can disable this if you're only using the Wayland session.
@ -66,7 +63,8 @@
programs.hyprland = { programs.hyprland = {
enable = true; enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; package =
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
}; };
# Enable the KDE Plasma Desktop Environment. # Enable the KDE Plasma Desktop Environment.
@ -117,8 +115,9 @@
nix.settings = { nix.settings = {
trusted-users = [ "root" "youwen" ]; trusted-users = [ "root" "youwen" ];
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
substituters = ["https://hyprland.cachix.org"]; substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; trusted-public-keys =
[ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
}; };
# Allow unfree packages # Allow unfree packages
@ -171,22 +170,22 @@
nixpkgs.config.packageOverrides = pkgs: { nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override { steam = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [ extraPkgs = pkgs:
xorg.libXcursor with pkgs; [
xorg.libXi xorg.libXcursor
xorg.libXinerama xorg.libXi
xorg.libXScrnSaver xorg.libXinerama
libpng xorg.libXScrnSaver
libpulseaudio libpng
libvorbis libpulseaudio
stdenv.cc.cc.lib libvorbis
libkrb5 stdenv.cc.cc.lib
keyutils libkrb5
]; keyutils
];
}; };
}; };
# List services that you want to enable: # List services that you want to enable:
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
@ -206,13 +205,11 @@
# (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 = "24.05"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?
hardware.opengl = { hardware.opengl = { enable = true; };
enable = true;
};
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
services.xserver.videoDrivers = ["nvidia"]; services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = { hardware.nvidia = {
modesetting.enable = true; modesetting.enable = true;

View file

@ -18,48 +18,47 @@
}; };
}; };
outputs = { self, nixpkgs, home-manager, catppuccin, zimfw, lanzaboote, ... }@inputs: { outputs = { self, nixpkgs, home-manager, catppuccin, zimfw, lanzaboote, ...
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { }@inputs: {
specialArgs = { inherit inputs; }; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
system = "x86_64-linux"; nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
modules = [ specialArgs = { inherit inputs; };
./configuration.nix system = "x86_64-linux";
modules = [
./configuration.nix
catppuccin.nixosModules.catppuccin catppuccin.nixosModules.catppuccin
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
({ pkgs, lib, ... }: { ({ pkgs, lib, ... }: {
environment.systemPackages = [ environment.systemPackages = [
# For debugging and troubleshooting Secure Boot. # For debugging and troubleshooting Secure Boot.
pkgs.sbctl pkgs.sbctl
];
# Lanzaboote currently replaces the systemd-boot module.
# This setting is usually set to true in configuration.nix
# generated at installation time. So we force it to false
# for now.
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
})
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.sharedModules = [ zimfw.homeManagerModules.zimfw ];
home-manager.users.youwen = {
imports = [
./home.nix
catppuccin.homeManagerModules.catppuccin
]; ];
};
} # Lanzaboote currently replaces the systemd-boot module.
]; # This setting is usually set to true in configuration.nix
# generated at installation time. So we force it to false
# for now.
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
})
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.sharedModules = [ zimfw.homeManagerModules.zimfw ];
home-manager.users.youwen = {
imports = [ ./home.nix catppuccin.homeManagerModules.catppuccin ];
};
}
];
};
}; };
};
} }

View file

@ -4,25 +4,24 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/2616d86c-aac2-4780-9527-7b11192e783f"; device = "/dev/disk/by-uuid/2616d86c-aac2-4780-9527-7b11192e783f";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/B826-E14B"; device = "/dev/disk/by-uuid/B826-E14B";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };
swapDevices = [ ]; swapDevices = [ ];
@ -35,5 +34,6 @@
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true; # networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

163
home.nix
View file

@ -48,12 +48,12 @@
# networking tools # networking tools
mtr # A network diagnostic tool mtr # A network diagnostic tool
iperf3 iperf3
dnsutils # `dig` + `nslookup` dnsutils # `dig` + `nslookup`
ldns # replacement of `dig`, it provide the command `drill` ldns # replacement of `dig`, it provide the command `drill`
aria2 # A lightweight multi-protocol & multi-source command-line download utility aria2 # A lightweight multi-protocol & multi-source command-line download utility
socat # replacement of openbsd-netcat socat # replacement of openbsd-netcat
nmap # A utility for network discovery and security auditing nmap # A utility for network discovery and security auditing
ipcalc # it is a calculator for the IPv4/v6 addresses ipcalc # it is a calculator for the IPv4/v6 addresses
# misc # misc
cowsay cowsay
@ -76,7 +76,7 @@
hugo # static site generator hugo # static site generator
glow # markdown previewer in terminal glow # markdown previewer in terminal
btop # replacement of htop/nmon btop # replacement of htop/nmon
iotop # io monitoring iotop # io monitoring
iftop # network monitoring iftop # network monitoring
@ -130,89 +130,82 @@
}; };
}; };
services.easyeffects = { services.easyeffects = { enable = true; };
enable = true;
};
programs.fzf = { programs.fzf = {
enable = true; enable = true;
catppuccin.enable = true; catppuccin.enable = true;
}; };
programs.wlogout = { programs.wlogout = { enable = true; };
enable = true;
};
wayland.windowManager.hyprland.enable = true; wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
exec-once = exec-once = [ "waybar" "waypaper --restore" ];
[
"waybar"
"waypaper --restore"
];
"$mod" = "SUPER"; "$mod" = "SUPER";
"$Left" = "Y"; "$Left" = "Y";
"$Right" = "O"; "$Right" = "O";
"$Up" = "I"; "$Up" = "I";
"$Down" = "U"; "$Down" = "U";
env = [ env = [
"HYPRCURSOR_THEME,Bibata-Modern-Ice" "HYPRCURSOR_SIZE,26" "HYPRCURSOR_THEME,Bibata-Modern-Ice"
"XCURSOR_THEME,Bibata-Modern-Ice" "XCURSOR_SIZE,26" "HYPRCURSOR_SIZE,26"
"XCURSOR_THEME,Bibata-Modern-Ice"
"XCURSOR_SIZE,26"
]; ];
bind = bind = [
[ # Application Keybinds
# Application Keybinds "$mod, F, exec, librewolf"
"$mod, F, exec, librewolf" "$mod, T, exec, kitty"
"$mod, T, exec, kitty" "$mod, E, exec, dolphin"
"$mod, E, exec, dolphin" "$mod, R, exec, pavucontrol"
"$mod, R, exec, pavucontrol"
# Window actions # Window actions
"$mod, Q, killactive" "$mod, Q, killactive"
"$mod, W, togglefloating" "$mod, W, togglefloating"
"$mod, J, togglesplit" "$mod, J, togglesplit"
"$mod, Return, fullscreen" "$mod, Return, fullscreen"
# Move around # Move around
"$mod, $Left, movefocus, l" "$mod, $Left, movefocus, l"
"$mod, $Right, movefocus, r" "$mod, $Right, movefocus, r"
"$mod, $Up, movefocus, u" "$mod, $Up, movefocus, u"
"$mod, $Down, movefocus, d" "$mod, $Down, movefocus, d"
"$mod, 1, workspace, 1" "$mod, 1, workspace, 1"
"$mod, 2, workspace, 2" "$mod, 2, workspace, 2"
"$mod, 3, workspace, 3" "$mod, 3, workspace, 3"
"$mod, 4, workspace, 4" "$mod, 4, workspace, 4"
"$mod, 5, workspace, 5" "$mod, 5, workspace, 5"
"$mod, 6, workspace, 6" "$mod, 6, workspace, 6"
"$mod, 7, workspace, 7" "$mod, 7, workspace, 7"
"$mod, 8, workspace, 8" "$mod, 8, workspace, 8"
"$mod, 9, workspace, 9" "$mod, 9, workspace, 9"
"$mod, 0, workspace, 10" "$mod, 0, workspace, 10"
"$mod, S, togglespecialworkspace" "$mod, S, togglespecialworkspace"
# Move windows around # Move windows around
"$mod+Shift+Ctrl, $Left, movewindow, l" "$mod+Shift+Ctrl, $Left, movewindow, l"
"$mod+Shift+Ctrl, $Right, movewindow, r" "$mod+Shift+Ctrl, $Right, movewindow, r"
"$mod+Shift+Ctrl, $Up, movewindow, u" "$mod+Shift+Ctrl, $Up, movewindow, u"
"$mod+Shift+Ctrl, $Down, movewindow, d" "$mod+Shift+Ctrl, $Down, movewindow, d"
"$mod+Ctrl+Alt, $Right, movetoworkspace, r+1" "$mod+Ctrl+Alt, $Right, movetoworkspace, r+1"
"$mod+Ctrl+Alt, $Left, movetoworkspace, r-1" "$mod+Ctrl+Alt, $Left, movetoworkspace, r-1"
"$mod+Ctrl, $Right, workspace, r+1" "$mod+Ctrl, $Right, workspace, r+1"
"$mod+Ctrl, $Left, workspace, r-1" "$mod+Ctrl, $Left, workspace, r-1"
"$mod+Alt, S, movetoworkspacesilent, special" "$mod+Alt, S, movetoworkspacesilent, special"
# Utilities # Utilities
"$mod, Space, exec, pkill -x rofi || rofi -show drun" # Run rofi "$mod, Space, exec, pkill -x rofi || rofi -show drun" # Run rofi
"$mod, P, exec, grim -g \"$(slurp)\" - | swappy -f -" # Screenshot ''$mod, P, exec, grim -g "$(slurp)" - | swappy -f -'' # Screenshot
"$mod, Backspace, exec, wlogout" # Screenshot "$mod, Backspace, exec, wlogout" # Screenshot
]; ];
bindm = [ bindm = [
"$mod, mouse:272, movewindow" "$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow" "$mod, mouse:273, resizewindow"
@ -298,10 +291,8 @@
"ignorezero,swaync-control-center" "ignorezero,swaync-control-center"
"blur,logout_dialog" "blur,logout_dialog"
]; ];
monitor = [ monitor =
"DP-1,2560x1440@165,1920x0,auto" [ "DP-1,2560x1440@165,1920x0,auto" "HDMI-A-1,1920x1080@60,0x0,1" ];
"HDMI-A-1,1920x1080@60,0x0,1"
];
dwindle = { dwindle = {
pseudotile = "yes"; pseudotile = "yes";
preserve_split = "yes"; preserve_split = "yes";
@ -342,13 +333,13 @@
drop_shadow = "false"; drop_shadow = "false";
dim_special = "0.3"; dim_special = "0.3";
blur = { blur = {
enabled = "yes"; enabled = "yes";
size = "6"; size = "6";
passes = "3"; passes = "3";
new_optimizations = "on"; new_optimizations = "on";
ignore_opacity = "on"; ignore_opacity = "on";
xray = "false"; xray = "false";
special = true; special = true;
}; };
}; };
}; };
@ -394,9 +385,7 @@
name = "Bibata-Modern-Ice"; name = "Bibata-Modern-Ice";
size = 26; size = 26;
}; };
iconTheme = { iconTheme = { name = "Papirus-Dark"; };
name = "Papirus-Dark";
};
}; };
qt = { qt = {
@ -411,7 +400,8 @@
theme=GraphiteNordDark theme=GraphiteNordDark
''; '';
"Kvantum/GraphiteNord".source = "${pkgs.graphite-kde-theme}/share/Kvantum/GraphiteNord"; "Kvantum/GraphiteNord".source =
"${pkgs.graphite-kde-theme}/share/Kvantum/GraphiteNord";
}; };
programs.waybar = { programs.waybar = {
@ -450,7 +440,7 @@
}; };
"custom/weather" = { "custom/weather" = {
orientation = "horizontal"; orientation = "horizontal";
exec = "curl wttr.in/?format=\"%l:%20%t\""; exec = ''curl wttr.in/?format="%l:%20%t"'';
interval = 10; interval = 10;
}; };
cpu = { cpu = {
@ -466,12 +456,8 @@
# format-paused = " 󰏤 {title} "; # format-paused = " 󰏤 {title} ";
# format-stopped = "Nothing Playing"; # format-stopped = "Nothing Playing";
# }; # };
tray = { tray = { spacing = 10; };
spacing = 10; clock = { format = "{:%a %b %d, %I:%M %p} "; };
};
clock = {
format = "{:%a %b %d, %I:%M %p} ";
};
backlight = { backlight = {
device = "intel_backlight"; device = "intel_backlight";
format = "{percent}% {icon}"; format = "{percent}% {icon}";
@ -486,9 +472,7 @@
format = "{capacity}% {icon}"; format = "{capacity}% {icon}";
format-icons = [ "󰁻" "󰁽" "󰁿" "󰂀" "󰁹" ]; format-icons = [ "󰁻" "󰁽" "󰁿" "󰂀" "󰁹" ];
}; };
"hyprland/window" = { "hyprland/window" = { format = "{class}"; };
format = "{class}";
};
network = { network = {
format-wifi = "{essid} "; format-wifi = "{essid} ";
format-linked = "{ifname} (No IP) "; format-linked = "{ifname} (No IP) ";
@ -502,9 +486,7 @@
format-muted = " {format_source}"; format-muted = " {format_source}";
format-source = "{volume}% "; format-source = "{volume}% ";
format-source-muted = ""; format-source-muted = "";
format-icons = { format-icons = { default = [ "" "" "" ]; };
default = [ "" "" "" ];
};
}; };
}; };
}; };
@ -525,7 +507,8 @@
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
enableBashIntegration = true; enableBashIntegration = true;
settings = with builtins; fromJSON (unsafeDiscardStringContext (readFile ./prompt.omp.json)); settings = with builtins;
fromJSON (unsafeDiscardStringContext (readFile ./prompt.omp.json));
}; };
programs.zsh = { programs.zsh = {
@ -557,9 +540,7 @@
}; };
}; };
programs.bash = { programs.bash = { enable = true; };
enable = true;
};
programs.librewolf = { programs.librewolf = {
enable = true; enable = true;