refactor: development environment

This commit is contained in:
Ryan Yin
2023-08-03 23:16:12 +08:00
parent 79a866a287
commit 4a988dbce7
13 changed files with 182 additions and 21 deletions

34
flake.lock generated
View File

@@ -187,6 +187,38 @@
"type": "github"
}
},
"catppuccin-wezterm": {
"flake": false,
"locked": {
"lastModified": 1681259790,
"narHash": "sha256-McSWoZaJeK+oqdK/0vjiRxZGuLBpEB10Zg4+7p5dIGY=",
"owner": "catppuccin",
"repo": "wezterm",
"rev": "b1a81bae74d66eaae16457f2d8f151b5bd4fe5da",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "wezterm",
"type": "github"
}
},
"cattppuccin-k9s": {
"flake": false,
"locked": {
"lastModified": 1690140445,
"narHash": "sha256-PtBJRBNbLkj7D2ko7ebpEjbfK9Ywjs7zbE+Y8FQVEfA=",
"owner": "catppuccin",
"repo": "k9s",
"rev": "516f44dd1a6680357cb30d96f7e656b653aa5059",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "k9s",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
@@ -659,6 +691,8 @@
"catppuccin-helix": "catppuccin-helix",
"catppuccin-hyprland": "catppuccin-hyprland",
"catppuccin-starship": "catppuccin-starship",
"catppuccin-wezterm": "catppuccin-wezterm",
"cattppuccin-k9s": "cattppuccin-k9s",
"home-manager": "home-manager_2",
"hyprland": "hyprland",
"mysecrets": "mysecrets",

View File

@@ -247,6 +247,10 @@
url = "github:catppuccin/alacritty";
flake = false;
};
catppuccin-wezterm = {
url = "github:catppuccin/wezterm";
flake = false;
};
catppuccin-helix = {
url = "github:catppuccin/helix";
flake = false;
@@ -263,6 +267,10 @@
url = "github:catppuccin/cava";
flake = false;
};
cattppuccin-k9s = {
url = "github:catppuccin/k9s";
flake = false;
};
};

View File

@@ -0,0 +1,22 @@
{
pkgs,
pkgs-unstable,
...
}: {
home.packages = with pkgs; [
# general tools
terraform
# terraformer # generate terraform configs from existing cloud resources
pulumi
pulumictl
# istioctl
# aws
awscli2
aws-iam-authenticator
eksctl
];
programs = {
};
}

View File

@@ -0,0 +1,14 @@
{
pkgs,
pkgs-unstable,
...
}: {
home.packages = with pkgs; [
skopeo
docker-compose
dive # explore docker layers
];
programs = {
};
}

View File

@@ -0,0 +1,6 @@
{ ... }: {
imports = [
./container.nix
./kubernetes.nix
];
}

View File

@@ -0,0 +1,31 @@
{
pkgs,
pkgs-unstable,
cattppuccin-k9s,
...
}: {
home.packages = with pkgs; [
kubectl
kubernetes-helm
];
programs = {
k9s = {
enable = true;
skin =
let
skin_file = "${cattppuccin-k9s}/dist/mocha.yml"; # theme - cattppuccin mocha
skin_attr = builtins.fromJSON (builtins.readFile
# replace 'base: &base "#1e1e2e"' with 'base: &base "default"'
# to make fg/bg color transparent
(pkgs.runCommandNoCC "get-skin-json" {} ''
cat ${skin_file} \
| sed -E 's@(base: &base ).+@\1 "default"@g' \
| ${pkgs.yj}/bin/yj > $out
'')
);
in
skin_attr;
};
};
}

View File

@@ -2,12 +2,13 @@
imports = [
../server
./cloud
./container
./neovim
./terminal
./alacritty.nix
./development.nix
./helix.nix
./kitty.nix
./media.nix
./shell.nix
];

View File

@@ -16,24 +16,6 @@
home.packages = with pkgs; [
pkgs-unstable.devbox
# cloud native
skopeo
docker-compose
dive # explore docker layers
kubectl
kubernetes-helm
terraform
# terraformer # generate terraform configs from existing cloud resources
pulumi
pulumictl
k9s
# istioctl
# cloud provider
awscli2
aws-iam-authenticator
eksctl
# DO NOT install build tools for C/C++ and others, set it per project by devShell instead
gnumake # used by this repo, to simplify the deployment
jdk17 # used to run some java based tools(.jar)

View File

@@ -0,0 +1,7 @@
{...}: {
imports = [
./alacritty.nix
./kitty.nix
./wezterm.nix
];
}

View File

@@ -30,7 +30,10 @@
{
programs.kitty = {
enable = true;
theme = "Catppuccin-Mocha"; # kitty has catppuccin theme built-in
# kitty has catppuccin theme built-in,
# all the built-in themes are packaged into an extra package named `kitty-themes`
# and it's installed by home-manager if `theme` is specified.
theme = "Catppuccin-Mocha";
font = {
name = "JetBrainsMono Nerd Font";
# use different font size on macOS

View File

@@ -0,0 +1,52 @@
{
lib,
pkgs,
catppuccin-wezterm,
...
}:
###########################################################
#
# Wezterm Configuration
#
###########################################################
{
# wezterm has catppuccin theme built-in,
# it's not necessary to install it separately.
# xdg.configFile."wezterm/colors".source = "${catppuccin-wezterm}/dist";
programs.wezterm = {
enable = true;
extraConfig =
let
fontsize = if pkgs.stdenv.isDarwin then "14.0" else "13.0";
in
''
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This table will hold the configuration.
local config = {}
-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end
-- This is where you actually apply your config choices
config.color_scheme = "Catppuccin Mocha"
config.font = wezterm.font("JetBrains Mono")
config.hide_tab_bar_if_only_one_tab = true
config.scrollback_lines = 10000
config.enable_scroll_bar = true
config.font_size = ${fontsize}
'' + (if pkgs.stdenv.isDarwin then ''
-- Spawn a fish shell in login mod
config.default_prog = { '/run/current-system/sw/bin/nu', '-l' }
'' else "") + ''
return config
'';
};
}

View File

@@ -25,6 +25,7 @@
ipcalc # it is a calculator for the IPv4/v6 addresses
# misc
tldr
cowsay
file
which