refactor: correctly build darwin

This commit is contained in:
Youwen Wu 2024-08-05 03:15:48 -07:00
parent b1f250812d
commit 5a7a329829
5 changed files with 35 additions and 144 deletions

View file

@ -66,6 +66,7 @@
./modules/home-manager/linux/desktop.nix ./modules/home-manager/linux/desktop.nix
./modules/home-manager/linux/programs.nix ./modules/home-manager/linux/programs.nix
./modules/home-manager/common/core.nix ./modules/home-manager/common/core.nix
./modules/home-manager/common/catppuccin.nix
inputs.catppuccin.homeManagerModules.catppuccin inputs.catppuccin.homeManagerModules.catppuccin
]; ];
}; };
@ -78,7 +79,7 @@
darwinConfigurations."Youwens-MacBook-Pro" = nix-darwin.lib.darwinSystem { darwinConfigurations."Youwens-MacBook-Pro" = nix-darwin.lib.darwinSystem {
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./modules/common/fonts.nix ./modules/darwin/darwin-configuration.nix
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;

View file

@ -1,6 +1,6 @@
{ config, pkgs, self, ... }: { { config, pkgs, ... }: {
# Expose the package set, including overlays, for convenience. # Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."Youwens-MacBook-Pro".pkgs; # darwinPackages = config.self.darwinConfigurations."Youwens-MacBook-Pro".pkgs;
# List packages installed in system profile. To search by name, run: # List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget # $ nix-env -qaP | grep wget
@ -39,4 +39,14 @@
}; };
security.pam.enableSudoTouchIdAuth = true; 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

@ -12,10 +12,9 @@
programs.fzf = { programs.fzf = {
enable = true; enable = true;
catppuccin.enable = true;
}; };
programs.git = { programs.git = pkgs.lib.mkDefault {
enable = true; enable = true;
userName = "Youwen Wu"; userName = "Youwen Wu";
userEmail = "youwenw@gmail.com"; userEmail = "youwenw@gmail.com";
@ -29,8 +28,6 @@
programs.lazygit = { programs.lazygit = {
enable = true; enable = true;
catppuccin.enable = true;
catppuccin.flavor = "macchiato";
settings = { settings = {
git.paging = { git.paging = {
colorArg = "always"; colorArg = "always";
@ -40,10 +37,6 @@
}; };
programs.bat.enable = true; programs.bat.enable = true;
programs.bat.catppuccin = {
enable = true;
flavor = "macchiato";
};
programs.ripgrep.enable = true; programs.ripgrep.enable = true;
@ -74,8 +67,6 @@
programs.fish = { programs.fish = {
enable = true; enable = true;
catppuccin.enable = true;
catppuccin.flavor = "mocha";
shellAliases = { shellAliases = {
rebuild = "sudo nixos-rebuild switch"; rebuild = "sudo nixos-rebuild switch";
ls = "eza -l --icons=auto"; ls = "eza -l --icons=auto";

View file

@ -19,8 +19,8 @@
# xxx # xxx
# ''; # '';
home.file.".config/neofetch/config.conf".source = ./config/neofetch.conf; home.file.".config/neofetch/config.conf".source = ../../../config/neofetch.conf;
# Packages that should be installed to the user profile. # Packages that should be installed to the user profile.
home.packages = with pkgs; [ home.packages = with pkgs; [
neofetch neofetch
@ -46,8 +46,6 @@
rust-analyzer rust-analyzer
]; ];
programs.fzf = { enable = true; };
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Youwen Wu"; userName = "Youwen Wu";
@ -60,20 +58,6 @@
}; };
}; };
programs.lazygit = {
enable = true;
settings = {
git.paging = {
colorArg = "always";
pager = "delta --dark --paging=never";
};
};
};
programs.bat.enable = true;
programs.ripgrep.enable = true;
programs.kitty = { programs.kitty = {
enable = true; enable = true;
theme = "Tokyo Night"; theme = "Tokyo Night";
@ -88,23 +72,6 @@
}; };
}; };
programs.readline = {
enable = true;
extraConfig = "set editing-mode vi";
};
programs.zoxide = {
enable = true;
# enableZshIntegration = true;
enableFishIntegration = true;
enableNushellIntegration = true;
};
programs.gh = {
enable = true;
extensions = [ pkgs.github-copilot-cli ];
};
programs.oh-my-posh = { programs.oh-my-posh = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
@ -112,105 +79,9 @@
enableBashIntegration = true; enableBashIntegration = true;
useTheme = "gruvbox"; useTheme = "gruvbox";
}; };
programs.fish = {
enable = true;
shellAliases = {
rebuild = "sudo nixos-rebuild switch";
ls = "eza -l --icons=auto";
};
functions = {
update-nixos = {
description =
"Update the system flake and attempt to build and switch to the new configuration.";
body = ''
cd /etc/nixos
nix flake update
sudo nixos-rebuild switch
'';
};
};
interactiveShellInit = ''
fish_vi_key_bindings
set -g fish_greeting
'';
plugins = [
{
name = "autopair";
src = pkgs.fetchFromGitHub {
owner = "jorgebucaran";
repo = "autopair.fish";
rev = "4d1752ff5b39819ab58d7337c69220342e9de0e2";
hash = "sha256-qt3t1iKRRNuiLWiVoiAYOu+9E7jsyECyIqZJ/oRIT1A=";
};
}
{
name = "fzf";
src = pkgs.fetchFromGitHub {
owner = "PatrickF1";
repo = "fzf.fish";
rev = "8920367cf85eee5218cc25a11e209d46e2591e7a";
hash = "sha256-T8KYLA/r/gOKvAivKRoeqIwE2pINlxFQtZJHpOy9GMM=";
};
}
{
name = "sponge";
src = pkgs.fetchFromGitHub {
owner = "meaningful-ooo";
repo = "sponge";
rev = "384299545104d5256648cee9d8b117aaa9a6d7be";
hash = "sha256-MdcZUDRtNJdiyo2l9o5ma7nAX84xEJbGFhAVhK+Zm1w=";
};
}
{
name = "done";
src = pkgs.fetchFromGitHub {
owner = "franciscolourenco";
repo = "done";
rev = "eb32ade85c0f2c68cbfcff3036756bbf27a4f366";
hash = "sha256-DMIRKRAVOn7YEnuAtz4hIxrU93ULxNoQhW6juxCoh4o=";
};
}
];
};
programs.nushell = {
enable = true;
configFile.text = ''
$env.config = {
edit_mode: vi,
show_banner: false
}
'';
};
programs.fd.enable = true;
programs.btop = {
enable = true;
settings = {
color_theme = "tokyo-night";
vim_keys = true;
theme_background = false;
};
};
programs.eza = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
};
programs.bash.enable = true; programs.bash.enable = true;
programs.zsh.enable = true; programs.zsh.enable = true;
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
# This value determines the home Manager release that your # This value determines the home Manager release that your
# configuration is compatible with. This helps avoid breakage # configuration is compatible with. This helps avoid breakage
# when a new home Manager release introduces backwards # when a new home Manager release introduces backwards

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";
};
}