1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2026-01-27 04:06:28 +01:00

refactor: add lots of programs

This commit is contained in:
Ryan Cao 2024-01-18 14:45:11 +08:00
parent 661ff3f1a0
commit da6ce75ba9
Signed by: ryanccn
SSH key fingerprint: SHA256:NtP/BlVhoQq4xU6BEcZeT8nIPvHntkJ3lIc2yB+F09E
14 changed files with 99 additions and 82 deletions

64
flake.lock generated
View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704040339, "lastModified": 1705399930,
"narHash": "sha256-xCwZkcTUu8L7IzE/0mBp680ozv+wXtS2Vij9PklOuOU=", "narHash": "sha256-JZG+pAe78RYnp9dYegalSwUTZqbNcSRmJjPnDZRl+JI=",
"owner": "ryanccn", "owner": "ryanccn",
"repo": "am", "repo": "am",
"rev": "d5a98e91f814a75494df39ade989f5f5ffe06b16", "rev": "a68d35ca256622db496e1e5d8165c6dfd08d2469",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +22,11 @@
}, },
"catppuccin": { "catppuccin": {
"locked": { "locked": {
"lastModified": 1702771919, "lastModified": 1705010618,
"narHash": "sha256-l6zkit3WPXuukWrQDpaNVNEQ2Y0lq1K+7OQmvtqFIJU=", "narHash": "sha256-7mFUoNL0Ty/akEcXtAKueZbYbeDy0IOAS02w7ufgslU=",
"owner": "Stonks3141", "owner": "Stonks3141",
"repo": "ctp-nix", "repo": "ctp-nix",
"rev": "4a76ba2815b6db301597630d14e4e40f4fb5fb0f", "rev": "310ab70d9e690b641005ceafc6582305195c8711",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -78,11 +78,11 @@
"rust-analyzer-src": "rust-analyzer-src" "rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1704954214, "lastModified": 1705472611,
"narHash": "sha256-1irsqIeIfSnNJnbmev9YE0tVG4l0aSG4HjTJqWb5LxE=", "narHash": "sha256-o9zxn4OPM6ltNmsiIK4Fl1k6aIF73x2wELGeCQYdO0k=",
"owner": "nix-community", "owner": "nix-community",
"repo": "fenix", "repo": "fenix",
"rev": "4c6dd8a90b53dc9606d35c59b68168c3768fde2c", "rev": "39ef99bcc06101639781bdb5dd69155b7033badd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -140,11 +140,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1701680307, "lastModified": 1705309234,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -160,11 +160,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704809957, "lastModified": 1705535278,
"narHash": "sha256-Z8sBeoeeY2O+BNqh5C+4Z1h1F1wQ2mij7yPZ2GY397M=", "narHash": "sha256-V5+XKfNbiY0bLKLQlH+AXyhHttEL7XcZBH9iSbxxexA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e13aa9e287b3365473e5897e3667ea80a899cdfb", "rev": "b84191db127c16a92cbdf7f7b9969d58bb456699",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -220,11 +220,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704277720, "lastModified": 1705452289,
"narHash": "sha256-meAKNgmh3goankLGWqqpw73pm9IvXjEENJloF0coskE=", "narHash": "sha256-i/WodLabBcmRr9hdSv5jzDigL1hRYuI8vNh+xTbGt+g=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "0dd382b70c351f528561f71a0a7df82c9d2be9a4", "rev": "74ab0227ee495e526f2dd57ea684b34f6396445a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -235,11 +235,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1704842529, "lastModified": 1705466837,
"narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", "narHash": "sha256-iYVxjZqKd9Si4wuf5GO9aNKxqAn9P3bNN38vflIooHY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", "rev": "757637581797f148c50977b6127147c5d298f9e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -276,12 +276,12 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1700223519, "lastModified": 1705150397,
"narHash": "sha256-0VfyAcEgCKJ/pvJeytixYFmGN7Mb9Qa7MeGCYzu+y+A=", "narHash": "sha256-vanzV4QLle7AbXywX7x50YWYZZhtWzKa4IZl4u1CRis=",
"rev": "cdd9d44fa16bbf2df7cd5c13a39d5c1aa0cddd26", "rev": "0a0d471e476bda2c6b031e291c4192712d9fbe31",
"revCount": 152, "revCount": 159,
"type": "tarball", "type": "tarball",
"url": "https://api.flakehub.com/f/pinned/ryanccn/nyoom/0.7.3/018bdd38-edc7-7c28-9e0d-ba2a299c953b/source.tar.gz" "url": "https://api.flakehub.com/f/pinned/ryanccn/nyoom/0.7.4/018d02e2-e4be-79a2-9e02-33bd5e483d6c/source.tar.gz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
@ -291,11 +291,11 @@
"ohmyzsh": { "ohmyzsh": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1704919303, "lastModified": 1705507783,
"narHash": "sha256-9W602NxDDCARVDHAO3yAwgTTwV/MnSfXjeydZiQbBmk=", "narHash": "sha256-JnzujZDN7Jv6mHLBARyMAHdREv5EKDPLG8qeQJKGV8k=",
"owner": "ohmyzsh", "owner": "ohmyzsh",
"repo": "ohmyzsh", "repo": "ohmyzsh",
"rev": "1c8dee848dad169c9eb1a7b0148842b48a99cad1", "rev": "486e56aba890e143dd02265bcd05ae32751eb55b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -328,11 +328,11 @@
"rust-analyzer-src": { "rust-analyzer-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1704895810, "lastModified": 1705432736,
"narHash": "sha256-kPFrPV6wgGF2beB+nkDI+nb4l9uC9oS4b4V6iUz/ZDw=", "narHash": "sha256-uUS5B8ypVevvhjA/2smEOu5s8zK3MBJU5tH0Tze3Kok=",
"owner": "rust-lang", "owner": "rust-lang",
"repo": "rust-analyzer", "repo": "rust-analyzer",
"rev": "e4344f5fce3b4ca12d51bf27b9a0bd29297be3ea", "rev": "03336460fcb25a86675aaff9694998f5910ff747",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,7 +3,7 @@
inputs, inputs,
... ...
}: { }: {
home.stateVersion = "23.05"; programs.home-manager.enable = true;
imports = [ imports = [
inputs.catppuccin.homeManagerModules.catppuccin inputs.catppuccin.homeManagerModules.catppuccin
@ -17,6 +17,9 @@
./programs/zsh.nix ./programs/zsh.nix
./programs/fish.nix ./programs/fish.nix
./programs/starship.nix ./programs/starship.nix
./programs/fzf.nix
./programs/zoxide.nix
./programs/direnv.nix
./programs/git.nix ./programs/git.nix
./programs/bat.nix ./programs/bat.nix
@ -25,14 +28,15 @@
./programs/eza.nix ./programs/eza.nix
./programs/rust.nix ./programs/rust.nix
./programs/glamour.nix ./programs/glamour.nix
./programs/tealdeer.nix
]; ];
programs.home-manager.enable = true;
services.am-discord-rich-presence = { services.am-discord-rich-presence = {
enable = false; enable = false;
logFile = "${config.home.homeDirectory}/Library/Logs/am-discord-rich-presence.log"; logFile = "${config.home.homeDirectory}/Library/Logs/am-discord-rich-presence.log";
}; };
catppuccin.flavour = "frappe"; catppuccin.flavour = "frappe";
home.stateVersion = "23.05";
} }

11
home/programs/direnv.nix Normal file
View file

@ -0,0 +1,11 @@
_: {
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
# enableFishIntegration = true;
nix-direnv.enable = true;
};
}

View file

@ -4,9 +4,6 @@ set -x LS_COLORS (vivid generate catppuccin-frappe)
# 1Password SSH # 1Password SSH
set -x SSH_AUTH_SOCK "$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" set -x SSH_AUTH_SOCK "$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
# Homebrew
/opt/homebrew/bin/brew shellenv | source
# Nix # Nix
fish_add_path -Pm /etc/profiles/per-user/$USER/bin /run/current-system/sw/bin fish_add_path -Pm /etc/profiles/per-user/$USER/bin /run/current-system/sw/bin

View file

@ -1,18 +1,7 @@
if status is-interactive if status is-interactive
# starship
starship init fish | source
# zoxide
zoxide init fish | source
# direnv
direnv hook fish | source
# nix-your-shell # nix-your-shell
nix-your-shell fish | source nix-your-shell fish | source
set -x FZF_DEFAULT_OPTS " \
--color=bg+:#414559,bg:#303446,spinner:#f2d5cf,hl:#e78284 \
--color=fg:#c6d0f5,header:#e78284,info:#ca9ee6,pointer:#f2d5cf \
--color=marker:#f2d5cf,fg+:#c6d0f5,prompt:#ca9ee6,hl+:#e78284"
if test -e "$HOME/.iterm2_shell_integration.fish" if test -e "$HOME/.iterm2_shell_integration.fish"
source "$HOME/.iterm2_shell_integration.fish" source "$HOME/.iterm2_shell_integration.fish"
end end

24
home/programs/fzf.nix Normal file
View file

@ -0,0 +1,24 @@
_: {
programs.fzf = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
colors = {
"bg+" = "#414559";
bg = "#303446";
"fg+" = "#c6d0f5";
fg = "#c6d0f5";
"hl+" = "#e78284";
hl = "#e78284";
spinner = "#f2d5cf";
header = "#e78284";
info = "#ca9ee6";
pointer = "#f2d5cf";
marker = "#f2d5cf";
prompt = "#ca9ee6";
};
};
}

View file

@ -1,6 +1,11 @@
_: { _: {
programs.starship = { programs.starship = {
enable = true; enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
settings = { settings = {
command_timeout = 1000; command_timeout = 1000;

View file

@ -0,0 +1,9 @@
_: {
programs.tealdeer = {
enable = true;
settings = {
display.compact = true;
updates.auto_update = true;
};
};
}

9
home/programs/zoxide.nix Normal file
View file

@ -0,0 +1,9 @@
_: {
programs.zoxide = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
}

View file

@ -14,7 +14,7 @@ in {
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
envExtra = builtins.readFile ./zsh/envExtra.zsh; envExtra = builtins.readFile ./zsh/envExtra.zsh;
initExtraBeforeCompInit = builtins.readFile ./zsh/initExtraBeforeCompInit.zsh; # initExtraBeforeCompInit = builtins.readFile ./zsh/initExtraBeforeCompInit.zsh;
initExtra = builtins.readFile ./zsh/initExtra.zsh; initExtra = builtins.readFile ./zsh/initExtra.zsh;
inherit shellAliases; inherit shellAliases;

View file

@ -1,9 +1,6 @@
# 1Password SSH # 1Password SSH
export SSH_AUTH_SOCK="$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" export SSH_AUTH_SOCK="$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
# Homebrew shell
eval "$(/opt/homebrew/bin/brew shellenv)"
# fnm shell env # fnm shell env
eval "$(fnm env --use-on-cd)" eval "$(fnm env --use-on-cd)"

View file

@ -1,9 +1,3 @@
# environment variables
export FZF_DEFAULT_OPTS=" \
--color=bg+:#414559,bg:#303446,spinner:#f2d5cf,hl:#e78284 \
--color=fg:#c6d0f5,header:#e78284,info:#ca9ee6,pointer:#f2d5cf \
--color=marker:#f2d5cf,fg+:#c6d0f5,prompt:#ca9ee6,hl+:#e78284"
# zsh options # zsh options
setopt interactivecomments setopt interactivecomments
unsetopt menu_complete unsetopt menu_complete
@ -34,18 +28,6 @@ function clean_vscode_workspace_storage() {
done done
} }
# starship
eval "$(starship init zsh)"
# fzf
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# zoxide
eval "$(zoxide init zsh)"
# direnv
command -v direnv &> /dev/null && eval "$(direnv hook zsh)"
# nix-your-shell # nix-your-shell
eval "$(nix-your-shell zsh)" eval "$(nix-your-shell zsh)"

View file

@ -1,5 +0,0 @@
if command -v brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:$FPATH"
fi
FPATH="$HOME/.zfunc:$FPATH"

View file

@ -13,7 +13,6 @@
nix-your-shell nix-your-shell
nix-melt nix-melt
direnv
fh fh
(fenix.combine ( (fenix.combine (
@ -51,14 +50,12 @@
flyctl flyctl
pscale pscale
btop # btop
doggo doggo
doppler doppler
du-dust du-dust
fd fd
ffmpeg ffmpeg
fzf
gh
gen-license gen-license
gum gum
hyperfine hyperfine
@ -67,13 +64,11 @@
mkcert mkcert
nerdfix nerdfix
ripgrep ripgrep
tealdeer
tokei tokei
vhs vhs
vivid vivid
watchexec watchexec
xh xh
zoxide
typst typst