Merge branch 'fix-nixos'

This commit is contained in:
Youwen Wu 2024-08-06 00:19:43 -07:00
commit c28597bc1a
15 changed files with 409 additions and 68 deletions

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
fonts = {
enableDefaultPackages = true;
fontconfig = {

View file

@ -1,4 +1,7 @@
{ config, pkgs, ... }: {
{ inputs, config, pkgs, ... }: {
# Expose the package set, including overlays, for convenience.
# darwinPackages = inputs.self.darwinConfigurations."Youwens-MacBook-Pro".pkgs;
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [ ];
@ -36,4 +39,14 @@
};
security.pam.enableSudoTouchIdAuth = true;
fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
(nerdfonts.override { fonts = [ "CascadiaCode" ]; })
(google-fonts.override { fonts = [ "Lora" ]; })
];
};
}

View file

@ -0,0 +1,14 @@
{ inputs, ... }: {
nix-homebrew = {
enable = true;
enableRosetta = true;
user = "youwen";
taps = {
"homebrew/homebrew-core" = inputs.homebrew-core;
"homebrew/homebrew-cask" = inputs.homebrew-cask;
};
mutableTaps = false;
};
}

30
modules/darwin/yabai.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, pkgs, ... }: {
services.yabai = {
enable = true;
enableScriptingAddition = true;
config = {
focus_follows_mouse = "autoraise";
mouse_follows_focus = "on";
window_placement = "second_child";
window_opacity = "off";
top_padding = 12;
bottom_padding = 12;
left_padding = 12;
right_padding = 12;
window_gap = 10;
split_ratio = 0.5;
split_type = "auto";
layout = "bsp";
mouse_modifier = "fn";
mouse_action1 = "move";
mouse_action2 = "resize";
mouse_drop_action = "swap";
};
};
services.skhd = { enable = true; };
services.jankyborders = {
enable = true;
hidpi = true;
};
}

View file

@ -1,7 +1,6 @@
{ pkgs, ... }:
{
programs.bash.enable = true;
programs.nushell = {
{ pkgs, ... }: {
programs.bash.enable = pkgs.lib.mkDefault true;
programs.nushell = pkgs.lib.mkDefault {
enable = true;
configFile.text = ''
$env.config = {
@ -11,12 +10,9 @@
'';
};
programs.fzf = {
enable = true;
catppuccin.enable = true;
};
programs.fzf = pkgs.lib.mkDefault { enable = true; };
programs.git = {
programs.git = pkgs.lib.mkDefault {
enable = true;
userName = "Youwen Wu";
userEmail = "youwenw@gmail.com";
@ -28,10 +24,8 @@
};
};
programs.lazygit = {
programs.lazygit = pkgs.lib.mkDefault {
enable = true;
catppuccin.enable = true;
catppuccin.flavor = "macchiato";
settings = {
git.paging = {
colorArg = "always";
@ -40,32 +34,28 @@
};
};
programs.bat.enable = true;
programs.bat.catppuccin = {
enable = true;
flavor = "macchiato";
};
programs.bat.enable = pkgs.lib.mkDefault true;
programs.ripgrep.enable = true;
programs.ripgrep.enable = pkgs.lib.mkDefault true;
programs.readline = {
enable = true;
extraConfig = "set editing-mode vi";
};
programs.zoxide = {
programs.zoxide = pkgs.lib.mkDefault {
enable = true;
# enableZshIntegration = true;
enableFishIntegration = true;
enableNushellIntegration = true;
};
programs.gh = {
programs.gh = pkgs.lib.mkDefault {
enable = true;
extensions = [ pkgs.github-copilot-cli ];
};
programs.oh-my-posh = {
programs.oh-my-posh = pkgs.lib.mkDefault {
enable = true;
# enableZshIntegration = true;
enableFishIntegration = true;
@ -75,8 +65,6 @@
programs.fish = pkgs.lib.mkDefault {
enable = true;
catppuccin.enable = true;
catppuccin.flavor = "mocha";
shellAliases = {
rebuild = "sudo nixos-rebuild switch";
ls = "eza -l --icons=auto";
@ -136,10 +124,9 @@
];
};
programs.fd.enable = pkgs.lib.mkDefault true;
programs.fd.enable = true;
programs.btop = {
programs.btop = pkgs.lib.mkDefault {
enable = true;
settings = {
color_theme = "tokyo-night";
@ -148,13 +135,13 @@
};
};
programs.eza = {
programs.eza = pkgs.lib.mkDefault {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
};
programs.neovim = {
programs.neovim = pkgs.lib.mkDefault {
enable = true;
defaultEditor = true;
viAlias = true;

View file

@ -0,0 +1,70 @@
{ inputs, config, pkgs, ... }:
{
home.username = "youwen";
home.homeDirectory = "/Users/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
# '';
home.file.".config/neofetch/config.conf".source =
../../../config/neofetch.conf;
# Packages that should be installed to the user profile.
home.packages = with pkgs; [
neofetch
# archives
zip
xz
unzip
p7zip
# utils
nurl # helps fetch git data for nixpkgs
# nix related
#
# it provides the command `nom` works just like `nix`
# with more details log output
nix-output-monitor
# dev tools
nodePackages_latest.pnpm
rustfmt
rust-analyzer
];
programs.git.extraConfig.commit.gpgsign = "false";
programs.oh-my-posh.enableZshIntegration = true;
programs.bash.enable = true;
programs.zsh.enable = 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;
}

View file

@ -0,0 +1,18 @@
{
programs.fzf.catppuccin = {
enable = true;
flavor = "macchiato";
};
programs.lazygit.catppuccin = {
enable = true;
flavor = "macchiato";
};
programs.bat.catppuccin = {
enable = true;
flavor = "macchiato";
};
programs.fish.catppuccin = {
enable = true;
flavor = "mocha";
};
}

View file

@ -1,5 +1,4 @@
{ pkgs, ...}:
{
{ pkgs, ... }: {
wayland.windowManager.hyprland = import ./hyprland-conf.nix;
# Audio effects and EQ tool

View file

@ -0,0 +1,97 @@
{ 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
# '';
home.file.".config/neofetch/config.conf".source =
../../../config/neofetch.conf;
home.file.".wallpapers" = {
source = ../../../wallpapers;
recursive = true;
};
# Packages that should be installed to the user profile.
home.packages = with pkgs; [
neofetch
# archives
zip
xz
unzip
p7zip
# utils
nurl # helps fetch git data for nixpkgs
# nix related
#
# it provides the command `nom` works just like `nix`
# with more details log output
nix-output-monitor
# system tools
pciutils # lspci
usbutils # lsusb
# desktop utils
wl-clipboard
grim
slurp
swappy
pavucontrol
swww
waypaper
# desktop apps
dolphin
bitwarden-desktop
thunderbird
spotify
vesktop
signal-desktop
modrinth-app
lutris
wine
# dev tools
nodePackages_latest.pnpm
rustfmt
rust-analyzer
# desktop ricing
bibata-cursors
libsForQt5.qtstyleplugin-kvantum
libsForQt5.qt5ct
papirus-icon-theme
libsForQt5.qt5ct
];
# 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;
}

View file

@ -5,9 +5,9 @@
{ config, inputs, pkgs, ... }:
{
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# imports = [ # Include the results of the hardware scan.
# ./hardware-configuration.nix
# ];
# Bootloader.
boot.loader = {
@ -80,7 +80,6 @@
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;

View file

@ -1,5 +1,4 @@
{ config, ... }:
{
{ config, ... }: {
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;

View file

@ -1,17 +1,17 @@
({ pkgs, lib, ... }: {
environment.systemPackages = [
# For debugging and troubleshooting Secure Boot.
pkgs.sbctl
];
({ pkgs, lib, ... }: {
environment.systemPackages = [
# For debugging and troubleshooting Secure Boot.
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;
# 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";
};
})
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
})