feat: nix fmt

This commit is contained in:
Ryan Yin
2023-12-18 00:36:59 +08:00
parent a04a058077
commit b2f75a37dc
50 changed files with 293 additions and 269 deletions

View File

@@ -1,25 +1,28 @@
{
pkgs,
...
}: {
home.packages = with pkgs; [
# general tools
pulumi
pulumictl
# istioctl
{pkgs, ...}: {
home.packages = with pkgs;
[
# general tools
pulumi
pulumictl
# istioctl
# aws
awscli2
ssm-session-manager-plugin # Amazon SSM Session Manager Plugin
aws-iam-authenticator
eksctl
istioctl
# aws
awscli2
ssm-session-manager-plugin # Amazon SSM Session Manager Plugin
aws-iam-authenticator
eksctl
istioctl
# aliyun
aliyun-cli
] ++ (if pkgs.stdenv.isLinux then [
# cloud tools that nix do not have cache for.
terraform
terraformer # generate terraform configs from existing cloud resources
] else []);
# aliyun
aliyun-cli
]
++ (
if pkgs.stdenv.isLinux
then [
# cloud tools that nix do not have cache for.
terraform
terraformer # generate terraform configs from existing cloud resources
]
else []
);
}

View File

@@ -7,7 +7,7 @@
skopeo
docker-compose
dive # explore docker layers
];
];
programs = {
};

View File

@@ -1,4 +1,4 @@
{ ... }: {
{...}: {
imports = [
./container.nix
./kubernetes.nix

View File

@@ -12,20 +12,20 @@
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. "default" means transparent in k9s skin.
(pkgs.runCommandNoCC "get-skin-json" {} ''
cat ${skin_file} \
| sed -E 's@(base: &base ).+@\1 "default"@g' \
| ${pkgs.yj}/bin/yj > $out
'')
);
in
skin_attr;
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. "default" means transparent in k9s skin.
(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

@@ -14,59 +14,65 @@
#
#############################################################
home.packages = with pkgs; [
(python3.withPackages (
ps:
with ps; [
ipython
pandas
requests
pyquery
pyyaml
]
))
home.packages = with pkgs;
[
(python3.withPackages (
ps:
with ps; [
ipython
pandas
requests
pyquery
pyyaml
]
))
cargo # rust package manager
go
jdk17
guile # scheme language
cargo # rust package manager
go
jdk17
guile # scheme language
# db related
dbeaver
mycli
pgcli
mongosh
sqlite
# db related
dbeaver
mycli
pgcli
mongosh
sqlite
# embedded development
minicom
# embedded development
minicom
# ai related
python311Packages.huggingface-hub # huggingface-cli
# ai related
python311Packages.huggingface-hub # huggingface-cli
# misc
pkgs-unstable.devbox
glow # markdown previewer
fzf
gdu # disk usage analyzer, required by AstroNvim
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
bfg-repo-cleaner # remove large files from git history
k6 # load testing tool
protobuf # protocol buffer compiler
] ++ (if pkgs.stdenv.isLinux then [
# Automatically trims your branches whose tracking remote refs are merged or gone
# It's really useful when you work on a project for a long time.
git-trim
# misc
pkgs-unstable.devbox
glow # markdown previewer
fzf
gdu # disk usage analyzer, required by AstroNvim
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
bfg-repo-cleaner # remove large files from git history
k6 # load testing tool
protobuf # protocol buffer compiler
]
++ (
if pkgs.stdenv.isLinux
then [
# Automatically trims your branches whose tracking remote refs are merged or gone
# It's really useful when you work on a project for a long time.
git-trim
# need to run `conda-install` before using it
# need to run `conda-shell` before using command `conda`
# conda is not available for MacOS
conda
# need to run `conda-install` before using it
# need to run `conda-shell` before using command `conda`
# conda is not available for MacOS
conda
mitmproxy # http/https proxy tool
insomnia # REST client
wireshark # network analyzer
] else []);
mitmproxy # http/https proxy tool
insomnia # REST client
wireshark # network analyzer
]
else []
);
programs = {
direnv = {

View File

@@ -1,6 +1,8 @@
{ pkgs, catppuccin-helix, ... }:
{
pkgs,
catppuccin-helix,
...
}: {
# https://github.com/catppuccin/helix
xdg.configFile."helix/themes".source = "${catppuccin-helix}/themes/default";
@@ -25,7 +27,7 @@
space.space = "file_picker";
space.w = ":w";
space.q = ":q";
esc = [ "collapse_selection" "keep_primary_selection" ];
esc = ["collapse_selection" "keep_primary_selection"];
};
};
};

View File

@@ -1,4 +1,4 @@
{ nushell-scripts, ...}: {
{nushell-scripts, ...}: {
programs.bash = {
# load the alias file for work
bashrcExtra = ''

View File

@@ -1,4 +1,8 @@
{pkgs, catppuccin-alacritty, ...}:
{
pkgs,
catppuccin-alacritty,
...
}:
###########################################################
#
# Alacritty Configuration
@@ -97,8 +101,8 @@
+ (
if pkgs.stdenv.isDarwin
then ''
# Point size
size: 14
# Point size
size: 14
''
else ''
# holder identation

View File

@@ -25,72 +25,71 @@
if pkgs.stdenv.isDarwin
then "14.0"
else "13.0";
in
''
-- Pull in the wezterm API
local wezterm = require 'wezterm'
in ''
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This table will hold the configuration.
local config = {}
-- 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()
-- 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
wezterm.on('toggle-opacity', function(window, pane)
local overrides = window:get_config_overrides() or {}
if not overrides.window_background_opacity then
overrides.window_background_opacity = 0.93
else
overrides.window_background_opacity = nil
end
window:set_config_overrides(overrides)
end)
wezterm.on('toggle-opacity', function(window, pane)
local overrides = window:get_config_overrides() or {}
if not overrides.window_background_opacity then
overrides.window_background_opacity = 0.93
else
overrides.window_background_opacity = nil
end
window:set_config_overrides(overrides)
end)
wezterm.on('toggle-maximize', function(window, pane)
window:maximize()
end)
wezterm.on('toggle-maximize', function(window, pane)
window:maximize()
end)
-- This is where you actually apply your config choices
config.color_scheme = "Catppuccin Mocha"
config.font = wezterm.font_with_fallback {
"JetBrainsMono Nerd Font",
"FiraCode Nerd Font",
-- This is where you actually apply your config choices
config.color_scheme = "Catppuccin Mocha"
config.font = wezterm.font_with_fallback {
"JetBrainsMono Nerd Font",
"FiraCode Nerd Font",
-- To avoid 'Chinese characters displayed as variant (Japanese) glyphs'
"Source Han Sans SC",
"Source Han Sans TC"
}
-- To avoid 'Chinese characters displayed as variant (Japanese) glyphs'
"Source Han Sans SC",
"Source Han Sans TC"
}
config.hide_tab_bar_if_only_one_tab = true
config.scrollback_lines = 10000
config.enable_scroll_bar = true
config.hide_tab_bar_if_only_one_tab = true
config.scrollback_lines = 10000
config.enable_scroll_bar = true
config.keys = {
-- toggle opacity(CTRL + SHIFT + B)
{
key = 'B',
mods = 'CTRL',
action = wezterm.action.EmitEvent 'toggle-opacity',
},
{
key = 'M',
mods = 'CTRL',
action = wezterm.action.EmitEvent 'toggle-maximize',
},
}
config.font_size = ${fontsize}
config.keys = {
-- toggle opacity(CTRL + SHIFT + B)
{
key = 'B',
mods = 'CTRL',
action = wezterm.action.EmitEvent 'toggle-opacity',
},
{
key = 'M',
mods = 'CTRL',
action = wezterm.action.EmitEvent 'toggle-maximize',
},
}
config.font_size = ${fontsize}
-- To resolve issues:
-- 1. https://github.com/ryan4yin/nix-config/issues/26
-- 2. https://github.com/ryan4yin/nix-config/issues/8
-- Spawn a nushell in login mode via `bash`
config.default_prog = { '${pkgs.bash}/bin/bash', '--login', '-c', 'nu --login --interactive' }
-- To resolve issues:
-- 1. https://github.com/ryan4yin/nix-config/issues/26
-- 2. https://github.com/ryan4yin/nix-config/issues/8
-- Spawn a nushell in login mode via `bash`
config.default_prog = { '${pkgs.bash}/bin/bash', '--login', '-c', 'nu --login --interactive' }
return config
'';
return config
'';
}
// (
if pkgs.stdenv.isDarwin