splitted up config

This commit is contained in:
Thilo Billerbeck 2023-05-02 22:47:01 +02:00
parent 21b25cb158
commit 019399b34a
28 changed files with 321 additions and 811 deletions

68
programs/alacritty.nix Normal file
View file

@ -0,0 +1,68 @@
{ config, pkgs, lib, ... }:
let
nixgl = import <nixgl> { };
nixGLWrap = pkg:
pkgs.runCommand "${pkg.name}-nixgl-wrapper" { } ''
mkdir $out
ln -s ${pkg}/* $out
rm $out/bin
mkdir $out/bin
for bin in ${pkg}/bin/*; do
wrapped_bin=$out/bin/$(basename $bin)
echo -e "#!/bin/bash\nexec ${lib.getExe nixgl.auto.nixGLDefault} $bin \$@" > $wrapped_bin
chmod +x $wrapped_bin
done
'';
in {
programs.alacritty = {
enable = true;
package = (nixGLWrap pkgs.alacritty);
settings = {
window = {
decorations = "full";
dynamic_title = true;
gtk_theme_variant = "None";
};
window.opacity = 1;
font = {
normal = {
family = "JetbrainsMono NFM";
style = "Regular";
};
bold = {
family = "JetbrainsMono NFM";
style = "Bold";
};
size = 14;
};
cursor.style.shape = "Beam";
colors = {
primary = {
background = "0x282a36";
foreground = "0xeff0eb";
};
normal = {
black = "0x282a36";
red = "0xff5c57";
green = "0x5af78e";
yellow = "0xf3f99d";
blue = "0x57c7ff";
magenta = "0xff6ac1";
cyan = "0x9aedfe";
white = "0xf1f1f0";
};
bright = {
black = "0x686868";
red = "0xff5c57";
green = "0x5af78e";
yellow = "0xf3f99d";
blue = "0x57c7ff";
magenta = "0xff6ac1";
cyan = "0x9aedfe";
white = "0xf1f1f0";
};
};
};
};
}

29
programs/beets.nix Normal file
View file

@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }:
{
programs.beets = {
enable = true;
settings = {
directory = "~/Music/dj/Library";
library = "~/Music/dj/library.db";
plugins = "spotify acousticbrainz badfiles duplicates fetchart";
import = {
write = "yes";
copy = "yes";
resume = "no";
duplicate_action = "ask";
default_action = "apply";
};
badfiles = {
check_on_import = "yes";
};
match = {
max_rec = {
track_length = "strong";
track_title = "strong";
track_artist = "strong";
};
};
};
};
}

8
programs/direnv.nix Normal file
View file

@ -0,0 +1,8 @@
{ config, pkgs, lib, ... }:
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

29
programs/git.nix Normal file
View file

@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }:
{
programs.git = {
enable = true;
lfs.enable = true;
userEmail = "thilo.billerbeck@officerent.de";
userName = "Thilo Billerbeck";
extraConfig = {
color = {
diff = "auto";
status = "auto";
branch = "auto";
interactive = "auto";
ui = true;
pager = true;
};
log = { date = "short"; };
rerere = { enabled = "1"; };
core = {
whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
excludesfile = "~/.gitignore-rab";
autocrlf = "input";
};
apply = { whitespace = "nowarn"; };
branch = { autosetuprebase = "always"; };
};
};
}

46
programs/htop.nix Normal file
View file

@ -0,0 +1,46 @@
{ config, pkgs, lib, ... }:
{
programs.htop = {
enable = true;
settings = {
fields="0 48 17 18 38 39 40 2 46 47 49 1";
sort_key="46";
sort_direction="1";
tree_sort_key="0";
tree_sort_direction="1";
hide_kernel_threads="1";
hide_userland_threads="0";
shadow_other_users="0";
show_thread_names="0";
show_program_path="1";
highlight_base_name="0";
highlight_megabytes="1";
highlight_threads="1";
highlight_changes="0";
highlight_changes_delay_secs="5";
find_comm_in_cmdline="1";
strip_exe_from_cmdline="1";
show_merged_command="0";
tree_view="1";
tree_view_always_by_pid="0";
header_margin="1";
detailed_cpu_time="0";
cpu_count_from_one="0";
show_cpu_usage="1";
show_cpu_frequency="0";
show_cpu_temperature="0";
degree_fahrenheit="0";
update_process_names="0";
account_guest_in_cpu_meter="0";
color_scheme="0";
enable_mouse="1";
delay="15";
left_meters="LeftCPUs2 CPU Memory DiskIO NetworkIO";
left_meter_modes="1 1 1 2 2";
right_meters="RightCPUs2 Tasks LoadAverage Uptime Battery";
right_meter_modes="1 2 2 2 2";
hide_function_bar="0";
};
};
}

33
programs/neovim.nix Normal file
View file

@ -0,0 +1,33 @@
{ config, pkgs, lib, ... }:
{
programs.neovim = {
defaultEditor = true;
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
coc = { enable = true; };
extraConfig = ''
set title
set number
set relativenumber
set cursorline
set mouse=a
syntax enable
let g:NERDTreeShowHidden = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeIgnore = [ '.git/' ]
let g:NERDTreeStatusline = ""
let g:NERDTreeMouseMode = 2
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
nnoremap <silent> <C-b> :NERDTreeToggle<CR>
'';
plugins = with pkgs.vimPlugins; [
nerdtree
vim-devicons
# fzf
ale
];
};
}

12
programs/starship.nix Normal file
View file

@ -0,0 +1,12 @@
{ config, pkgs, lib, ... }:
{
programs.starship = {
enable = true;
settings = {
add_newline = false;
character = { success_symbol = "[](bold white)"; };
package = { disabled = true; };
};
};
}

16
programs/topgrade.nix Normal file
View file

@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
{
programs.topgrade = {
enable = true;
settings = {
assume_yes = true;
ignore_failures = [ "git_repos" ];
no_retry = true;
pre_sudo = false;
cleanup = true;
skip_notify = true;
firmware = { upgrade = true; };
};
};
}

26
programs/vscode.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, pkgs, lib, ... }:
let
nixgl = import <nixgl> { };
nixGLWrap = pkg:
pkgs.runCommand "${pkg.name}-nixgl-wrapper" { } ''
mkdir $out
ln -s ${pkg}/* $out
rm $out/bin
mkdir $out/bin
for bin in ${pkg}/bin/*; do
wrapped_bin=$out/bin/$(basename $bin)
echo -e "#!/bin/bash\nexec ${lib.getExe nixgl.auto.nixGLDefault} $bin \$@" > $wrapped_bin
chmod +x $wrapped_bin
done
'';
in {
programs = {
vscode = {
enable = true;
package = (nixGLWrap (pkgs.vscode.override {
commandLineArgs =
"--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --gtk-version=4";
}));
};
};
}

9
programs/yt-dlp.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, pkgs, lib, ... }:
{
programs.yt-dlp = {
enable = true;
};
}

42
programs/zsh.nix Normal file
View file

@ -0,0 +1,42 @@
{ config, pkgs, lib, ... }:
{
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
enableSyntaxHighlighting = true;
enableVteIntegration = true;
shellAliases = {
pub-ipv4 = "curl ip4.clerie.de";
serve = "python -m SimpleHTTPServer 8080";
week = "date +%V";
path = "echo -e \${PATH//:/\\n}";
distro = "cat /etc/*-release";
reload = "source ~/.zshrc";
undo-git-reset-head = "git reset 'HEAD@{1}'";
update-local = "bash $HOME/.dotfiles/install";
};
zplug = {
enable = true;
plugins = [
{
name = "plugins/git";
tags = [ from:oh-my-zsh ];
}
{
name = "plugins/archlinux";
tags = [ from:oh-my-zsh ];
}
{
name = "plugins/composer";
tags = [ from:oh-my-zsh ];
}
{
name = "plugins/colored-man-pages";
tags = [ from:oh-my-zsh ];
}
];
};
};
}