mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-19 15:53:46 +01:00
feat: nix fmt
This commit is contained in:
@@ -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 []
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
skopeo
|
||||
docker-compose
|
||||
dive # explore docker layers
|
||||
];
|
||||
];
|
||||
|
||||
programs = {
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
{...}: {
|
||||
imports = [
|
||||
./container.nix
|
||||
./kubernetes.nix
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ nushell-scripts, ...}: {
|
||||
{nushell-scripts, ...}: {
|
||||
programs.bash = {
|
||||
# load the alias file for work
|
||||
bashrcExtra = ''
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ catppuccin-bat, ...}: {
|
||||
{catppuccin-bat, ...}: {
|
||||
# a cat(1) clone with syntax highlighting and Git integration.
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ catppuccin-btop, ... }:
|
||||
|
||||
{
|
||||
{catppuccin-btop, ...}: {
|
||||
# https://github.com/catppuccin/btop/blob/main/themes/catppuccin_mocha.theme
|
||||
home.file.".config/btop/themes".source = "${catppuccin-btop}/themes";
|
||||
|
||||
@@ -8,8 +6,8 @@
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
settings = {
|
||||
color_theme = "catppuccin_mocha";
|
||||
theme_background = false; # make btop transparent
|
||||
color_theme = "catppuccin_mocha";
|
||||
theme_background = false; # make btop transparent
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,15 +19,14 @@
|
||||
nmap # A utility for network discovery and security auditing
|
||||
ipcalc # it is a calculator for the IPv4/v6 addresses
|
||||
|
||||
|
||||
# Text Processing
|
||||
# Docs: https://github.com/learnbyexample/Command-line-text-processing
|
||||
gnugrep # GNU grep, provides `grep`/`egrep`/`fgrep`
|
||||
gnused # GNU sed, very powerful(mainly for replacing text in files)
|
||||
gawk # GNU awk, a pattern scanning and processing language
|
||||
gnugrep # GNU grep, provides `grep`/`egrep`/`fgrep`
|
||||
gnused # GNU sed, very powerful(mainly for replacing text in files)
|
||||
gawk # GNU awk, a pattern scanning and processing language
|
||||
ripgrep # recursively searches directories for a regex pattern
|
||||
sad # CLI search and replace, with diff preview, really useful!!!
|
||||
delta # A viewer for git and diff output
|
||||
sad # CLI search and replace, with diff preview, really useful!!!
|
||||
delta # A viewer for git and diff output
|
||||
# A fast and polyglot tool for code searching, linting, rewriting at large scale
|
||||
# supported languages: only some mainstream languages currently(do not support nix/nginx/yaml/toml/...)
|
||||
ast-grep
|
||||
@@ -80,7 +79,7 @@
|
||||
# https://github.com/catppuccin/fzf
|
||||
# catppuccin-mocha
|
||||
colors = {
|
||||
"bg+" = "#313244";
|
||||
"bg+" = "#313244";
|
||||
"bg" = "#1e1e2e";
|
||||
"spinner" = "#f5e0dc";
|
||||
"hl" = "#f38ba8";
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
|
||||
userfullname,
|
||||
useremail,
|
||||
...
|
||||
@@ -76,15 +75,15 @@
|
||||
st = "status";
|
||||
ls = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate";
|
||||
ll = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate --numstat";
|
||||
cm = "commit -m"; # commit via `git cm <message>`
|
||||
ca = "commit -am"; # commit all changes via `git ca <message>`
|
||||
cm = "commit -m"; # commit via `git cm <message>`
|
||||
ca = "commit -am"; # commit all changes via `git ca <message>`
|
||||
dc = "diff --cached";
|
||||
|
||||
amend = "commit --amend -m"; # amend commit message via `git amend <message>`
|
||||
unstage = "reset HEAD --"; # unstage file via `git unstage <file>`
|
||||
merged = "branch --merged"; # list merged(into HEAD) branches via `git merged`
|
||||
unmerged = "branch --no-merged"; # list unmerged(into HEAD) branches via `git unmerged`
|
||||
nonexist = "remote prune origin --dry-run"; # list non-exist(remote) branches via `git nonexist`
|
||||
amend = "commit --amend -m"; # amend commit message via `git amend <message>`
|
||||
unstage = "reset HEAD --"; # unstage file via `git unstage <file>`
|
||||
merged = "branch --merged"; # list merged(into HEAD) branches via `git merged`
|
||||
unmerged = "branch --no-merged"; # list unmerged(into HEAD) branches via `git unmerged`
|
||||
nonexist = "remote prune origin --dry-run"; # list non-exist(remote) branches via `git nonexist`
|
||||
|
||||
# delete merged branches except master & dev & staging
|
||||
# `!` indicates it's a shell script, not a git subcommand
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ config, ...}: {
|
||||
{config, ...}: {
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
configFile.source = ./config.nu;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ catppuccin-starship, ...}: {
|
||||
{catppuccin-starship, ...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
|
||||
@@ -6,22 +6,24 @@
|
||||
enableZshIntegration = true;
|
||||
enableNushellIntegration = true;
|
||||
|
||||
settings = {
|
||||
character = {
|
||||
success_symbol = "[›](bold green)";
|
||||
error_symbol = "[›](bold red)";
|
||||
};
|
||||
aws = {
|
||||
symbol = "🅰 ";
|
||||
};
|
||||
gcloud = {
|
||||
# do not show the account/project's info
|
||||
# to avoid the leak of sensitive information when sharing the terminal
|
||||
format = "on [$symbol$active(\($region\))]($style) ";
|
||||
symbol = "🅶 ️";
|
||||
};
|
||||
settings =
|
||||
{
|
||||
character = {
|
||||
success_symbol = "[›](bold green)";
|
||||
error_symbol = "[›](bold red)";
|
||||
};
|
||||
aws = {
|
||||
symbol = "🅰 ";
|
||||
};
|
||||
gcloud = {
|
||||
# do not show the account/project's info
|
||||
# to avoid the leak of sensitive information when sharing the terminal
|
||||
format = "on [$symbol$active(\($region\))]($style) ";
|
||||
symbol = "🅶 ️";
|
||||
};
|
||||
|
||||
palette = "catppuccin_mocha";
|
||||
} // builtins.fromTOML (builtins.readFile "${catppuccin-starship}/palettes/mocha.toml");
|
||||
palette = "catppuccin_mocha";
|
||||
}
|
||||
// builtins.fromTOML (builtins.readFile "${catppuccin-starship}/palettes/mocha.toml");
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
|
||||
./proxychains
|
||||
|
||||
./core.nix
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{config, nushell-scripts, ...}: let
|
||||
{
|
||||
config,
|
||||
nushell-scripts,
|
||||
...
|
||||
}: let
|
||||
d = config.xdg.dataHome;
|
||||
c = config.xdg.configHome;
|
||||
cache = config.xdg.cacheHome;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
strace # system call monitoring
|
||||
ltrace # library call monitoring
|
||||
bpftrace # powerful tracing tool
|
||||
tcpdump # network sniffer
|
||||
tcpdump # network sniffer
|
||||
lsof # list open files
|
||||
|
||||
# system tools
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
# creative
|
||||
blender # 3d modeling
|
||||
blender # 3d modeling
|
||||
# gimp # image editing, I prefer using figma in browser instead of this one
|
||||
inkscape # vector graphics
|
||||
krita # digital painting
|
||||
@@ -22,7 +22,7 @@
|
||||
pkgs-unstable.yosys # fpga synthesis
|
||||
pkgs-unstable.nextpnr # fpga place and route
|
||||
pkgs-unstable.openfpgaloader # fpga programming
|
||||
nur-ryan4yin.packages.${pkgs.system}.gowin-eda-edu-ide # app: `gowin-env` => `gw_ide` / `gw_pack` / ...
|
||||
nur-ryan4yin.packages.${pkgs.system}.gowin-eda-edu-ide # app: `gowin-env` => `gw_ide` / `gw_pack` / ...
|
||||
];
|
||||
|
||||
programs = {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
# misc
|
||||
flameshot
|
||||
ventoy # multi-boot usb creator
|
||||
ventoy # multi-boot usb creator
|
||||
];
|
||||
|
||||
# GitHub CLI tool
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{ pkgs, lib, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
# Adjust the color temperature(& brightness) of your screen according to
|
||||
# your surroundings. This may help your eyes hurt less if you are
|
||||
# working in front of the screen at night.
|
||||
@@ -18,7 +22,7 @@
|
||||
# https://gitlab.com/chinstrap/gammastep/-/blob/master/gammastep.conf.sample?ref_type=heads
|
||||
settings = {
|
||||
general = {
|
||||
fade = "1"; # gradually apply the new screen temperature/brightness over a couple of seconds.
|
||||
fade = "1"; # gradually apply the new screen temperature/brightness over a couple of seconds.
|
||||
# it is a fake brightness adjustment obtained by manipulating the gamma ramps,
|
||||
# which means that it does not reduce the backlight of the screen.
|
||||
# Preferably only use it if your normal backlight adjustment is too coarse-grained.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}: {
|
||||
# If your themes for mouse cursor, icons or windows don’t load correctly,
|
||||
# try setting them with home.pointerCursor and gtk.theme,
|
||||
# try setting them with home.pointerCursor and gtk.theme,
|
||||
# which enable a bunch of compatibility options that should make the themes load in all situations.
|
||||
|
||||
home.pointerCursor = {
|
||||
@@ -23,7 +23,7 @@
|
||||
"*.dpi" = 150;
|
||||
};
|
||||
|
||||
# gtk's theme settings, generate files:
|
||||
# gtk's theme settings, generate files:
|
||||
# 1. ~/.gtkrc-2.0
|
||||
# 2. ~/.config/gtk-3.0/settings.ini
|
||||
# 3. ~/.config/gtk-4.0/settings.ini
|
||||
@@ -48,7 +48,7 @@
|
||||
name = "Catppuccin-Macchiato-Compact-Pink-dark";
|
||||
package = pkgs.catppuccin-gtk.override {
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/data/themes/catppuccin-gtk/default.nix
|
||||
accents = [ "pink" ];
|
||||
accents = ["pink"];
|
||||
size = "compact";
|
||||
variant = "mocha";
|
||||
};
|
||||
|
||||
@@ -24,9 +24,11 @@
|
||||
];
|
||||
|
||||
# https://github.com/catppuccin/cava
|
||||
home.file.".config/cava/config".text = ''
|
||||
# custom cava config
|
||||
'' + builtins.readFile "${catppuccin-cava}/mocha.cava";
|
||||
home.file.".config/cava/config".text =
|
||||
''
|
||||
# custom cava config
|
||||
''
|
||||
+ builtins.readFile "${catppuccin-cava}/mocha.cava";
|
||||
|
||||
programs = {
|
||||
mpv = {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ wallpapers, ... }:
|
||||
|
||||
{
|
||||
{wallpapers, ...}: {
|
||||
# https://github.com/ryan4yin/wallpapers
|
||||
home.file.".config/wallpapers".source = wallpapers;
|
||||
home.file.".local/bin/wallpaper_random" = {
|
||||
|
||||
@@ -62,10 +62,9 @@
|
||||
"image/webp" = ["imv.desktop"];
|
||||
};
|
||||
|
||||
associations.removed =
|
||||
{
|
||||
# ......
|
||||
};
|
||||
associations.removed = {
|
||||
# ......
|
||||
};
|
||||
};
|
||||
|
||||
userDirs = {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{ pkgs, anyrun, ... }:
|
||||
|
||||
{
|
||||
pkgs,
|
||||
anyrun,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
anyrun.homeManagerModules.default
|
||||
];
|
||||
@@ -83,5 +85,4 @@
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ...}: {
|
||||
{pkgs, ...}: {
|
||||
# i3 window manager's config, based on https://github.com/endeavouros-team/endeavouros-i3wm-setup
|
||||
|
||||
imports = [
|
||||
@@ -43,5 +43,4 @@
|
||||
"GBM_BACKEND" = "nvidia-drm";
|
||||
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
../base/server
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... } @ args:
|
||||
{username, ...} @ args:
|
||||
#############################################################
|
||||
#
|
||||
# Harmonica - my MacBook Pro 2020 13-inch, mainly for business.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
|
||||
@@ -18,14 +18,13 @@
|
||||
boot.loader.efi.efiSysMountPoint = "/boot";
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
|
||||
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
|
||||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
|
||||
boot.kernelParams = ["nvidia.NVreg_PreserveVideoMemoryAllocations=1"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||
@@ -41,7 +40,6 @@
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
|
||||
boot.initrd = {
|
||||
# unlocked luks devices via a keyfile or prompt a passphrase.
|
||||
luks.devices."crypted-nixos" = {
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#
|
||||
# See also https://grahamc.com/blog/erase-your-darlings/
|
||||
|
||||
|
||||
# NOTE: impermanence only mounts the directory/file list below to /persistent
|
||||
# If the directory/file already exists in the root filesystem, you should
|
||||
# move those files/directories to /persistent first!
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
# secrets are not supported well on riscv64, I nned to create this file manually.
|
||||
# Format: "PSK_WEMEET_PRIVATE_WIFI=your_password"
|
||||
environmentFile = "/etc/wpa_supplicant.env";
|
||||
# The network definitions to automatically connect to when wpa_supplicant is running.
|
||||
# The network definitions to automatically connect to when wpa_supplicant is running.
|
||||
networks = {
|
||||
# read WPAPSK from environmentFile
|
||||
"shadow_light_ryan".psk = "@PSK_WEMEET_PRIVATE_WIFI@";
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
# secrets are not supported well on riscv64, I nned to create this file manually.
|
||||
# Format: "PSK_WEMEET_PRIVATE_WIFI=your_password"
|
||||
environmentFile = "/etc/wpa_supplicant.env";
|
||||
# The network definitions to automatically connect to when wpa_supplicant is running.
|
||||
# The network definitions to automatically connect to when wpa_supplicant is running.
|
||||
networks = {
|
||||
# read WPAPSK from environmentFile
|
||||
"shadow_light_ryan".psk = "@PSK_WEMEET_PRIVATE_WIFI@";
|
||||
|
||||
@@ -10,9 +10,13 @@
|
||||
}: let
|
||||
username = specialArgs.username;
|
||||
in
|
||||
{ name, nodes, ... }: {
|
||||
{
|
||||
name,
|
||||
nodes,
|
||||
...
|
||||
}: {
|
||||
deployment = {
|
||||
targetHost = name; # hostName or IP address
|
||||
targetHost = name; # hostName or IP address
|
||||
targetUser = targetUser;
|
||||
tags = host_tags;
|
||||
};
|
||||
@@ -23,16 +27,21 @@ in
|
||||
{
|
||||
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
nix.channel.enable = false; # disable nix-channel, we use flakes instead.
|
||||
nix.channel.enable = false; # disable nix-channel, we use flakes instead.
|
||||
}
|
||||
] ++ (if (home-module != null) then [
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
]
|
||||
++ (
|
||||
if (home-module != null)
|
||||
then [
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users."${username}" = home-module;
|
||||
}
|
||||
] else []);
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users."${username}" = home-module;
|
||||
}
|
||||
]
|
||||
else []
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ in
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users."${username}" = home-module;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
{
|
||||
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
nix.channel.enable = false; # disable nix-channel, we use flakes instead.
|
||||
nix.channel.enable = false; # disable nix-channel, we use flakes instead.
|
||||
}
|
||||
|
||||
nixos-generators.nixosModules.all-formats
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{pkgs, config, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
##########################################################################
|
||||
#
|
||||
# Install all apps and packages here.
|
||||
@@ -20,12 +24,12 @@
|
||||
neovim
|
||||
git
|
||||
nushell # my custom shell
|
||||
gnugrep # replacee macos's grep
|
||||
gnugrep # replacee macos's grep
|
||||
gnutar # replacee macos's tar
|
||||
];
|
||||
environment.variables = {
|
||||
# Fix https://github.com/LnL7/nix-darwin/wiki/Terminfo-issues
|
||||
TERMINFO_DIRS = map (path: path + "/share/terminfo") config.environment.profiles ++ [ "/usr/share/terminfo" ];
|
||||
TERMINFO_DIRS = map (path: path + "/share/terminfo") config.environment.profiles ++ ["/usr/share/terminfo"];
|
||||
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
|
||||
# customize dock
|
||||
dock = {
|
||||
autohide = true; # automatically hide and show the dock
|
||||
autohide = true; # automatically hide and show the dock
|
||||
show-recents = false; # do not show recent apps in dock
|
||||
# do not automatically rearrange spaces based on most recent use.
|
||||
mru-spaces = false;
|
||||
# do not automatically rearrange spaces based on most recent use.
|
||||
mru-spaces = false;
|
||||
|
||||
# customize Hot Corners(触发角, 鼠标移动到屏幕角落时触发的动作)
|
||||
wvous-tl-corner = 2; # top-left - Mission Control
|
||||
@@ -158,7 +158,7 @@
|
||||
# will change to `fonts.packages` after this PR is merged:
|
||||
# https://github.com/LnL7/nix-darwin/pull/754
|
||||
fonts = with pkgs; [
|
||||
# packages = with pkgs; [
|
||||
# packages = with pkgs; [
|
||||
# icon fonts
|
||||
material-design-icons
|
||||
font-awesome
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{ username, ... }:
|
||||
{
|
||||
{username, ...}: {
|
||||
####################################################################
|
||||
#
|
||||
# NixOS's Configuration for Remote Building / Distributed Building
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ username, ... }:
|
||||
|
||||
{
|
||||
{username, ...}: {
|
||||
# Don't allow mutation of users outside the config.
|
||||
users.mutableUsers = false;
|
||||
|
||||
@@ -9,7 +7,7 @@
|
||||
docker = {};
|
||||
wireshark = {};
|
||||
# for android platform tools's udev rules
|
||||
adbusers ={};
|
||||
adbusers = {};
|
||||
dialout = {};
|
||||
# for openocd (embedded system development)
|
||||
plugdev = {};
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session = {
|
||||
user = "ryan"; # Hyprland is installed only for user ryan via home-manager!
|
||||
command = "Hyprland"; # start Hyprland directly without a login manager
|
||||
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland"; # start Hyprland with a TUI login manager
|
||||
user = "ryan"; # Hyprland is installed only for user ryan via home-manager!
|
||||
command = "Hyprland"; # start Hyprland directly without a login manager
|
||||
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland"; # start Hyprland with a TUI login manager
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# https://github.com/NixOS/nixpkgs/issues/118655
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = [ username ];
|
||||
users = [username];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{pkgs, ...}: {
|
||||
|
||||
# =========================================================================
|
||||
# Base NixOS Configuration
|
||||
# =========================================================================
|
||||
@@ -27,12 +26,12 @@
|
||||
neovim
|
||||
|
||||
# networking
|
||||
mtr # A network diagnostic tool
|
||||
iperf3 # A tool for measuring TCP and UDP bandwidth performance
|
||||
nmap # A utility for network discovery and security auditing
|
||||
ldns # replacement of dig, it provide the command `drill`
|
||||
socat # replacement of openbsd-netcat
|
||||
tcpdump # A powerful command-line packet analyzer
|
||||
mtr # A network diagnostic tool
|
||||
iperf3 # A tool for measuring TCP and UDP bandwidth performance
|
||||
nmap # A utility for network discovery and security auditing
|
||||
ldns # replacement of dig, it provide the command `drill`
|
||||
socat # replacement of openbsd-netcat
|
||||
tcpdump # A powerful command-line packet analyzer
|
||||
|
||||
# archives
|
||||
zip
|
||||
@@ -66,7 +65,7 @@
|
||||
enable = true;
|
||||
settings = {
|
||||
X11Forwarding = true;
|
||||
PermitRootLogin = "prohibit-password"; # disable root login with password
|
||||
PermitRootLogin = "prohibit-password"; # disable root login with password
|
||||
PasswordAuthentication = false; # disable password login
|
||||
};
|
||||
openFirewall = true;
|
||||
|
||||
@@ -5,8 +5,10 @@ builtins.map
|
||||
|
||||
(builtins.filter # find all overlay files in the current directory
|
||||
|
||||
(f:
|
||||
f != "default.nix" # ignore default.nix
|
||||
&& f != "README.md" # ignore README.md
|
||||
(
|
||||
f:
|
||||
f
|
||||
!= "default.nix" # ignore default.nix
|
||||
&& f != "README.md" # ignore README.md
|
||||
)
|
||||
(builtins.attrNames (builtins.readDir ./.)))
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
pkgs,
|
||||
agenix,
|
||||
mysecrets,
|
||||
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
pkgs,
|
||||
agenix,
|
||||
mysecrets,
|
||||
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user