Skip to content

Commit

Permalink
Save before switch
Browse files Browse the repository at this point in the history
  • Loading branch information
yousiki committed Mar 20, 2024
1 parent c787657 commit d8e679e
Show file tree
Hide file tree
Showing 13 changed files with 865 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cells/common/profiles/core.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ in {
# Basic packages for both NixOS and Darwin.
environment.systemPackages = with pkgs; [
alejandra
cachix
curl
du-dust
duf
eza
fd
Expand All @@ -67,15 +69,20 @@ in {
htop
jq
man
mc
neofetch
nodejs
nvfetcher
rclone
ripgrep
rsync
statix
thefuck
tmux
vim
wget
zellij
zoxide
];

programs.fish.enable = true;
Expand Down
10 changes: 10 additions & 0 deletions cells/home/homeProfiles.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
inputs,
cell,
}: let
inherit (inputs.cells.common.lib) importProfiles;
in
importProfiles {
src = ./profiles;
args = {inherit inputs cell;};
}
10 changes: 10 additions & 0 deletions cells/home/profiles/base.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
inputs,
cell,
}: {pkgs, ...}: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {inherit inputs cell;};
};
}
130 changes: 130 additions & 0 deletions cells/home/profiles/catppuccin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
inputs,
cell,
}: {
config,
pkgs,
lib,
...
}: let
l = builtins // lib;

sources = pkgs.callPackage "${inputs.self}/nvfetcher/generated.nix" {};

catppuccin-fzf-colors = {
latte = {
"bg+" = "#ccd0da";
"bg" = "#eff1f5";
"spinner" = "#dc8a78";
"hl" = "#d20f39";
"fg" = "#4c4f69";
"header" = "#d20f39";
"info" = "#8839ef";
"pointer" = "#dc8a78";
"marker" = "#dc8a78";
"fg+" = "#4c4f69";
"prompt" = "#8839ef";
"hl+" = "#d20f39";
};
frappe = {
"bg+" = "#414559";
"bg" = "#303446";
"spinner" = "#f2d5cf";
"hl" = "#e78284";
"fg" = "#c6d0f5";
"header" = "#e78284";
"info" = "#ca9ee6";
"pointer" = "#f2d5cf";
"marker" = "#f2d5cf";
"fg+" = "#c6d0f5";
"prompt" = "#ca9ee6";
"hl+" = "#e78284";
};
macchiato = {
"bg+" = "#363a4f";
"bg" = "#24273a";
"spinner" = "#f4dbd6";
"hl" = "#ed8796";
"fg" = "#cad3f5";
"header" = "#ed8796";
"info" = "#c6a0f6";
"pointer" = "#f4dbd6";
"marker" = "#f4dbd6";
"fg+" = "#cad3f5";
"prompt" = "#c6a0f6";
"hl+" = "#ed8796";
};
mocha = {
"bg+" = "#313244";
"bg" = "#1e1e2e";
"spinner" = "#f5e0dc";
"hl" = "#f38ba8";
"fg" = "#cdd6f4";
"header" = "#f38ba8";
"info" = "#cba6f7";
"pointer" = "#f5e0dc";
"marker" = "#f5e0dc";
"fg+" = "#cdd6f4";
"prompt" = "#cba6f7";
"hl+" = "#f38ba8";
};
};
in {
options = {
bee.home-catppuccin.flavor = l.mkOption {
type = lib.types.enum [
"latte"
"frappe"
"macchiato"
"mocha"
];
default = "mocha";
description = ''
The color scheme to use for catppuccin theme.
'';
};
};

config = let
flavor = config.bee.home-catppuccin.flavor;
flavors = ["latte" "frappe" "macchiato" "mocha"];
in {
programs.bat = {
config.theme = "catppuccin-${flavor}";
themes = l.genAttrs flavors (n: {
src = sources.catppuccin-bat.src;
file = "Catppuccin-${n}.tmTheme";
});
};

programs.bottom.settings = l.fromTOML (
l.readFile "${sources.catppuccin-bottom.src}/themes/${flavor}.toml"
);

programs.btop.settings.color_scheme = "catppuccin-${flavor}";
home.file =
l.pipe
flavors
[
(l.map (
n:
l.nameValuePair
".config/btop/themes/catppuccin-${n}.theme"
{source = "${sources.catppuccin-btop.src}/themes/catppuccin_${n}.theme";}
))
l.listToAttrs
];

programs.fzf.colors = catppuccin-fzf-colors."${flavor}";

programs.gitui.theme = l.readFile "${sources.catppuccin-gitui.src}/theme/${flavor}.ron";

programs.helix.settings.theme = "catppuccin_${flavor}";

programs.starship.settings =
{palette = "catppuccin_${flavor}";}
// l.fromTOML (l.readFile "${sources.catppuccin-starship.src}/palettes/${flavor}.toml");

programs.zellij.settings.theme = "catppuccin-${flavor}";
};
}
19 changes: 19 additions & 0 deletions cells/home/profiles/core.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
inputs,
cell,
}: {
config,
pkgs,
lib,
...
}: let
l = builtins // lib;
in {
home.homeDirectory = l.mkDefault (
if pkgs.stdenv.isDarwin
then "/Users/${config.home.username}"
else "/home/${config.home.username}"
);

home.stateVersion = "23.05";
}
102 changes: 102 additions & 0 deletions cells/home/profiles/languages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
inputs,
cell,
}: {
config,
pkgs,
lib,
...
}: let
l = builtins // lib;
in {
options = {
bee.home-languages = l.mkOption {
type = l.types.listOf l.types.str;
default = ["nix"];
description = "List of programming languages to enable.";
};
};

config = l.mkMerge [
(
l.mkIf (l.elem "c" config.bee.home-languages) {
home.packages = with pkgs; [
clang-tools
cmake
gcc
gnumake
ninja
];
}
)
(
l.mkIf (l.elem "latex" config.bee.home-languages) {
home.packages = with pkgs; [
tectonic
texliveFull
];
}
)
(
l.mkIf (l.elem "nix" config.bee.home-languages) {
home.packages = with pkgs; [
alejandra
cachix
deadnix
nil
statix
];
}
)
(
l.mkIf (l.elem "python" config.bee.home-languages) {
home.packages = with pkgs; [
black
isort
poetry
python3
ruff
yapf
];

home.file.".condarc".text = ''
channels:
- defaults
changeps1: false
show_channel_urls: true
auto_activate_base: false
default_channels:
- https://mirrors.pku.edu.cn/anaconda/pkgs/main
- https://mirrors.pku.edu.cn/anaconda/pkgs/r
custom_channels:
Paddle: https://mirrors.pku.edu.cn/anaconda/cloud
bioconda: https://mirrors.pku.edu.cn/anaconda/cloud
conda-forge: https://mirrors.pku.edu.cn/anaconda/cloud
intel: https://mirrors.pku.edu.cn/anaconda/cloud
numba: https://mirrors.pku.edu.cn/anaconda/cloud
pytorch3d: https://mirrors.pku.edu.cn/anaconda/cloud
pytorch: https://mirrors.pku.edu.cn/anaconda/cloud
rapidsai: https://mirrors.pku.edu.cn/anaconda/cloud
'';

home.file.".config/pip/pip.conf".text = ''
[global]
index-url = https://mirrors.pku.edu.cn/pypi/web/simple
'';

programs.zsh.initExtra = ''
if [[ -x "$(command -v conda)" ]]; then
eval "$(conda "shell.$(basename "$SHELL")" hook)"
fi
'';
}
)
(
l.mkIf (l.elem "rust" config.bee.home-languages) {
home.packages = with pkgs; [
fenix.stable.toolchain
];
}
)
];
}
Loading

0 comments on commit d8e679e

Please sign in to comment.