feat: simplify flake.nix

This commit is contained in:
Ryan Yin
2023-07-26 20:07:42 +08:00
parent eebbb9f5e6
commit 204cb03922
70 changed files with 1183 additions and 1165 deletions
+74 -71
View File
@@ -1,9 +1,8 @@
{ pkgs, ... }:
{pkgs, ...}:
###########################################################
#
# Alacritty Configuration
#
#
# Useful Hot Keys for macOS:
# 1. Multi-Window: `command + N`
# 2. Increase Font Size: `command + =` | `command + +`
@@ -18,80 +17,84 @@
# Note: Alacritty do not have support for Tabs, and any graphic protocol.
#
###########################################################
{
programs.alacritty = {
enable = true;
};
xdg.configFile."alacritty/alacritty.yml".text = ''
import:
# all alacritty themes can be found at
# https://github.com/alacritty/alacritty-theme
- ~/.config/alacritty/theme_catppuccino.yml
window:
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
opacity: 0.95
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
startup_mode: Windowed
# Allow terminal applications to change Alacritty's window title.
dynamic_title: true
# Make `Option` key behave as `Alt` (macOS only):
# - OnlyLeft
# - OnlyRight
# - Both
# - None (default)
option_as_alt: Both
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
bold:
family: JetBrainsMono Nerd Font
italic:
family: JetBrainsMono Nerd Font
normal:
family: JetBrainsMono Nerd Font
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: JetBrainsMono Nerd Font
'' + (if pkgs.stdenv.isDarwin then ''
# Point size
size: 14
shell: # force nushell as default shell on macOS
program: /run/current-system/sw/bin/nu
'' else ''
# holder identation
# Point size
size: 13
'');
xdg.configFile."alacritty/alacritty.yml".text =
''
import:
# all alacritty themes can be found at
# https://github.com/alacritty/alacritty-theme
- ~/.config/alacritty/theme_catppuccino.yml
window:
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
opacity: 0.95
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
startup_mode: Windowed
# Allow terminal applications to change Alacritty's window title.
dynamic_title: true
# Make `Option` key behave as `Alt` (macOS only):
# - OnlyLeft
# - OnlyRight
# - Both
# - None (default)
option_as_alt: Both
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
bold:
family: JetBrainsMono Nerd Font
italic:
family: JetBrainsMono Nerd Font
normal:
family: JetBrainsMono Nerd Font
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: JetBrainsMono Nerd Font
''
+ (
if pkgs.stdenv.isDarwin
then ''
# Point size
size: 14
shell: # force nushell as default shell on macOS
program: /run/current-system/sw/bin/nu
''
else ''
# holder identation
# Point size
size: 13
''
);
xdg.configFile."alacritty/theme_catppuccino.yml".source = ./theme_catppuccino.yml;
}
+2 -4
View File
@@ -1,14 +1,12 @@
{ ... }:
{
{...}: {
imports = [
./alacritty
../server
./neovim
./development.nix
./kitty.nix
./media.nix
./shell.nix
];
}
+13 -10
View File
@@ -1,10 +1,12 @@
{ pkgs, pkgs-unstable, ... }:
{
pkgs,
pkgs-unstable,
...
}: {
#############################################################
#
# Basic settings for development environment
#
#
# Please avoid to install language specific packages here(globally),
# instead, install them independently using dev-templates:
# https://github.com/the-nix-way/dev-templates
@@ -36,13 +38,14 @@
gnumake # used by this repo, to simplify the deployment
# python
(python311.withPackages (ps: with ps; [
ipython
pandas
requests
pyquery
pyyaml
]))
(python311.withPackages (ps:
with ps; [
ipython
pandas
requests
pyquery
pyyaml
]))
# db related
dbeaver
+26 -14
View File
@@ -1,9 +1,12 @@
{ lib, pkgs, ... }:
{
lib,
pkgs,
...
}:
###########################################################
#
# Kitty Configuration
#
#
# Useful Hot Keys for macOS:
# 1. New Tab: `command + t`
# 2. Close Tab: `command + w`
@@ -28,20 +31,29 @@
font = {
name = "JetBrainsMono Nerd Font";
# use different font size on macOS
size = if pkgs.stdenv.isDarwin then 14 else 13;
size =
if pkgs.stdenv.isDarwin
then 14
else 13;
};
settings = {
background_opacity = "0.95";
macos_option_as_alt = true; # Option key acts as Alt on macOS
scrollback_lines = 10000;
enable_audio_bell = false;
} // (if pkgs.stdenv.isDarwin then {
# macOS specific settings, force kitty to use nushell as default shell
shell = "/run/current-system/sw/bin/nu";
} else {});
settings =
{
background_opacity = "0.95";
macos_option_as_alt = true; # Option key acts as Alt on macOS
scrollback_lines = 10000;
enable_audio_bell = false;
}
// (
if pkgs.stdenv.isDarwin
then {
# macOS specific settings, force kitty to use nushell as default shell
shell = "/run/current-system/sw/bin/nu";
}
else {}
);
# macOS specific settings
darwinLaunchOptions = [ "--start-as=fullscreen" ];
darwinLaunchOptions = ["--start-as=fullscreen"];
};
}
+5 -4
View File
@@ -1,6 +1,7 @@
{ pkgs
, config
, ...
{
pkgs,
config,
...
}:
# processing audio/video
{
@@ -8,7 +9,7 @@
ffmpeg-full
# images
viu # Terminal image viewer with native support for iTerm and Kitty
viu # Terminal image viewer with native support for iTerm and Kitty
imagemagick
graphviz
];
+34 -33
View File
@@ -1,5 +1,8 @@
{ pkgs, astronvim, ... }:
{
pkgs,
astronvim,
...
}:
###############################################################################
#
# AstroNvim's configuration and all its dependencies
@@ -70,7 +73,7 @@
#
# Joining a Selection of Lines With Space: `:join`
# Joining without spaces: `:join!`
#
#
# Toggle text's case: `~`
# Convert to uppercase: `U`
# Convert to lowercase: `u`
@@ -93,7 +96,7 @@
"nvim" = {
# update AstroNvim
onChange = "${pkgs.neovim}/bin/nvim --headless +quitall";
source = astronvim;
source = astronvim;
};
# my cusotom astronvim config, astronvim will load it after base config
# https://github.com/AstroNvim/AstroNvim/blob/v3.32.0/lua/astronvim/bootstrap.lua#L15-L16
@@ -117,16 +120,15 @@
viAlias = false;
vimAlias = true;
withPython3 = true;
withNodeJs = true;
extraPackages = [];
# currently we use lazy.nvim as neovim's package manager, so comment this one.
plugins = with pkgs.vimPlugins;[
plugins = with pkgs.vimPlugins; [
# search all the plugins using https://search.nixos.org/packages
luasnip
];
};
};
@@ -144,14 +146,14 @@
#-- python
nodePackages.pyright # python language server
python311Packages.black # python formatter
python311Packages.black # python formatter
python311Packages.ruff-lsp
#-- rust
rust-analyzer
cargo # rust package manager
cargo # rust package manager
rustfmt
#-- zig
zls
@@ -159,18 +161,18 @@
nil
rnix-lsp
# nixd
statix # Lints and suggestions for the nix programming language
deadnix # Find and remove unused code in .nix source files
alejandra # Nix Code Formatter
statix # Lints and suggestions for the nix programming language
deadnix # Find and remove unused code in .nix source files
alejandra # Nix Code Formatter
#-- golang
go
gomodifytags
iferr # generate error handling code for go
impl # generate function implementation for go
gotools # contains tools like: godoc, goimports, etc.
gopls # go language server
delve # go debugger
iferr # generate error handling code for go
impl # generate function implementation for go
gotools # contains tools like: godoc, goimports, etc.
gopls # go language server
delve # go debugger
#-- lua
stylua
@@ -180,7 +182,7 @@
nodePackages.bash-language-server
shellcheck
shfmt
#-- javascript/typescript --#
nodePackages.typescript
nodePackages.typescript-language-server
@@ -194,26 +196,25 @@
terraform-ls
jsonnet
jsonnet-language-server
hadolint # Dockerfile linter
hadolint # Dockerfile linter
#-- Others
taplo # TOML language server / formatter / validator
taplo # TOML language server / formatter / validator
nodePackages.yaml-language-server
sqlfluff # SQL linter
actionlint # GitHub Actions linter
buf # protoc plugin for linting and formatting
proselint # English prose linter
sqlfluff # SQL linter
actionlint # GitHub Actions linter
buf # protoc plugin for linting and formatting
proselint # English prose linter
#-- Misc
tree-sitter # common language parser/highlighter
nodePackages.prettier # common code formatter
marksman # language server for markdown
glow # markdown previewer
tree-sitter # common language parser/highlighter
nodePackages.prettier # common code formatter
marksman # language server for markdown
glow # markdown previewer
#-- Optional Requirements:
gdu # disk usage analyzer, required by AstroNvim
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
gdu # disk usage analyzer, required by AstroNvim
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
];
};
}
+1 -3
View File
@@ -1,5 +1,4 @@
{ ... }: {
{...}: {
programs.bash = {
# load the alias file for work
bashrcExtra = ''
@@ -22,5 +21,4 @@
source /etc/agenix/alias-for-work.nushell
'';
};
}