darwin rebuilding

This commit is contained in:
lsoriano-mcm
2025-08-07 12:01:20 -05:00
parent 12dbe7536f
commit b86646816b
12 changed files with 247 additions and 25 deletions
+17
View File
@@ -0,0 +1,17 @@
{
myConfig = {
General = {
terminal = {
size = 18;
font = "JetBrainsMono Nerd Font";
shell = "fish"; # or zsh
aliases = {};
};
};
NixOS = {
};
Darwin = {
username = "lsoriano";
};
};
}
+15 -25
View File
@@ -3,6 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
@@ -14,7 +15,10 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils.url = "github:numtide/flake-utils"; nixovim = {
url = "git+https://git.sakamoto.dev/kenji/nixovim.git";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { outputs = {
@@ -31,28 +35,26 @@
config.allowUnfree = true; config.allowUnfree = true;
}; };
homeManagerModule = { args = {inherit system pkgs;};
home.stateVersion = "24.05";
}; config = ./config.nix;
in { in {
nixosConfigurations = { nixosConfigurations = {
"hakase" = nixpkgs.lib.nixosSystem { "hakase" = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
config
./hosts/nixos/my-nixos-desktop/configuration.nix ./hosts/nixos/my-nixos-desktop/configuration.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.youruser = homeManagerModule; home-manager.users.youruser = import ./home/youruser/home.nix;
# home-manager.users.youruser = import ./home/youruser/home.nix;
} }
]; ];
specialArgs = { specialArgs = args;
inherit self pkgs;
};
}; };
}; };
@@ -60,11 +62,9 @@
"kenji" = home-manager.lib.homeManagerConfiguration { "kenji" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
homeManagerModule config
./home/kenji/home.nix ./home/kenji/home.nix
]; ];
# specialArgs = { inherit self; };
}; };
}; };
@@ -72,20 +72,10 @@
"my-macbook-pro" = nix-darwin.lib.darwinSystem { "my-macbook-pro" = nix-darwin.lib.darwinSystem {
inherit system; inherit system;
modules = [ modules = [
./hosts/darwin/my-macbook-pro/configuration.nix config
./hosts/darwin/macbook-air/configuration.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.youruser = homeManagerModule;
# home-manager.users.youruser = import ./home/youruser/home.nix;
}
]; ];
specialArgs = args;
specialArgs = {
inherit self pkgs;
};
}; };
}; };
}); });
+6
View File
@@ -0,0 +1,6 @@
{}: {
imports = [
../../modules/home/terminal.nix
];
home.stateVersion = "25.11";
}
+4
View File
@@ -0,0 +1,4 @@
{inputs, ...}: {
imports = [
];
}
@@ -0,0 +1,37 @@
{
inputs,
myConfig,
pkgs,
system,
...
}: {
imports = [
inputs.home-manager.darwinModules.home-manager
];
nix.settings.experimental-features = "nix-command flakes";
programs = {
zsh.enable = true;
fish.enable = true;
home-manager.enable = true;
};
nixpkgs.hostPlatform = "aarch64-darwin";
security.pam.services.sudo_local.touchIdAuth = true;
users.users.${myConfig.Darwin.username} = {
name = "${myConfig.Darwin.username}";
home = "/Users/${myConfig.Darwin.username}";
# shell = pkgs.${myConfig.general.terminal.Shell}; # no support for nix-darwin, but can be changed via chsh.
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {inherit pkgs system;};
users.${myConfig.Darwin.username} = import ../../../home/darwin/home.nix;
};
system.stateVersion = 5;
}
+15
View File
@@ -0,0 +1,15 @@
{}: {
programs = {
kitty.enable = true;
zsh.enable = true;
starship.enable = true;
};
imports = [
../../pkgs/fish/home.nix
../../pkgs/kitty/home.nix
../../pkgs/fonts/home.nix
../../pkgs/neovim/home.nix
../../pkgs/starship/home.nix
];
}
+14
View File
@@ -0,0 +1,14 @@
{
pkgs,
myConfig,
...
}: {
programs.fish = {
interactiveShellInit = ''
set fish_greeting
fish_vi_key_bindings
zoxide init fish | source
'';
};
}
+8
View File
@@ -0,0 +1,8 @@
{pkgs, ...}: {
fonts = {
fontconfig.enable = true;
};
home.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
}
+28
View File
@@ -0,0 +1,28 @@
{
myConfig,
pkgs,
...
}: {
programs.kitty = {
themeFile = "kanagawa";
settings = {
confirm_os_window_close = 0;
window_padding_width = 10;
font_size = myConfig.General.terminal.size;
font_family = myConfig.General.terminal.font;
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
shell = "${pkgs.${myConfig.General.terminal.shell}}/bin/${myConfig.General.terminal.shell}";
# optimization
input_delay = 0;
repaint_delay = 2;
sync_to_monitor = false;
wayland_enable_ime = false;
allow_remote_control = true;
};
# extraConfig = "include colors.conf";
};
}
+9
View File
@@ -0,0 +1,9 @@
{
inputs,
system,
...
}: {
imports = [
inputs.nixovim.packages.${system}.fullNvim
];
}
+61
View File
@@ -0,0 +1,61 @@
{lib, ...}: {
programs.starship = {
settings = {
format = lib.concatStrings [
"$username"
"$hostname"
"$directory"
"$git_branch"
"$git_state"
"$git_status"
"$cmd_duration"
"$line_break"
"$python"
"$character"
];
directory = {
style = "blue";
};
character = {
success_symbol = "[](purple)";
error_symbol = "[](red)";
vimcmd_symbol = "[](green)";
};
git_branch = {
format = "[$branch]($style)";
style = "bright-black";
};
git_status = {
format = "[(*$conflicted$untracked$modified$staged$renamed$deleted) $ahead_behind$stashed]($style)";
style = "cyan";
conflicted = "";
untracked = "";
modified = "";
staged = "";
renamed = "";
deleted = "";
stashed = "";
};
git_state = {
format = "([$state( $progress_current/$progress_total)]($style)) ";
style = "bright-black";
};
cmd_duration = {
format = "[$duration]($style) ";
style = "yellow";
};
python = {
format = "[$virtualenv]($style) ";
style = "bright-black";
};
};
};
# home.file.".config/starship.toml" = {
# source = builtins.toPath ./pure.toml;
# };
}
+33
View File
@@ -0,0 +1,33 @@
{
pkgs,
myConfig,
...
}: {
programs.zsh = {
enableCompletion = false;
syntaxHighlighting.enable = false;
# shellAliases = myConfig.general.Terminal.aliases;
history.size = 10000;
antidote = {
enable = true;
plugins = [
"MichaelAquilina/zsh-autoswitch-virtualenv"
"jeffreytse/zsh-vi-mode"
"zdharma-continuum/fast-syntax-highlighting kind:defer"
"zsh-users/zsh-autosuggestions kind:defer"
"zsh-users/zsh-history-substring-search kind:defer"
];
};
initContent = ''
# zsh-autocomplete
# bindkey -M menuselect '^M' .accept-line # run code when selected completion
autoload -Uz compinit
if [ "$(date +'%j')" != "$(stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)" ]; then
compinit
else
compinit -C
fi
'';
};
}