dotfiles/configuration.nix
2026-08-03 21:26:27 +03:00

180 lines
5.6 KiB
Nix

{ config, pkgs, ... }:
{
imports = [
# Подключение файла описания конфигурации устройств.
# Например, описание разбиения дисков.
./hardware-configuration.nix
];
# Использование grub
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
# Установка имени хоста
networking.hostName = "thek4n.ru";
# Использование NetworkManager
networking.networkmanager.enable = true;
# Установка временной зоны
time.timeZone = "Europe/Moscow";
i18n.defaultLocale = "en_US.UTF-8";
# Включение демона CUPS для печати докуметов
services.printing.enable = true;
# Включение сервисов звука
services.pulseaudio.enable = true;
services.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
services.openssh.enable = true;
users.user."thek4n" = {
isNormalUser = true;
description = "thek4n";
extraGroups = [ "networkmanager" "wheel" ];
# Установка пользовательских пакетов
packages = with pkgs; [
# thunderbird
];
};
# Сырая установка бинарников в глобальное окружение
environment.systemPackages = with pkgs; [
wget
fzf
bat
less
sway
swaybg
kanshi
wtype
swaylock
swayidle
wl-clipboard
ydotool
grim
slurp
mako
wlr-randr
rofi
jq
brightnessctl
fd
zoxide
tmux
waybar
man
lesspipe
mpv
socat
npm
ctags
glow
tree-sitter
tree-sitter-cli
highlight
ttf-joypixels
noto-fonts-emoji
ueberzug
poppler
yazi
ffmpeg
7zip
jq
fd
ripgrep
zoxide
resvg
imagemagick
];
# Активация модуля nixos, устанавливает программу и конфиги для нее
programs.firefox.enable = true;
programs.neovim = {
enable = true;
viAlias = true;
defaultEditor = true;
};
programs.zsh.enable = true;
programs.git = {
enabled = true;
userName = "thek4n";
userEmail = "thek4n@yandex.ru";
aliases = {
a = "!ga";
u = "!git diff --name-only --cached | fzf -1 -0 -m --bind load:last --preview 'git diff --staged --color=always {1}' | xargs -r git restore --staged";
msg = "log -1 --pretty=%B";
d = "diff";
di = "diff";
ds = "diff --staged";
dno = "diff --name-only";
dw = "diff --word-diff=color";
sw = "switch";
swl = "switch -";
swb = "switch -c";
swc = "switch -c";
co = "checkout";
col = "checkout @{-1}";
cob = "checkout -b";
ci = "commit";
cia = "commit --all";
amend = "commit --amend --no-edit";
amenda = "commit --all --amend --no-edit";
fuck = "commit --amend";
uncommit = "reset --soft HEAD~1";
untrack = "rm --cache --";
cim = "!_m() { git commit -m \"$*\"; }; _m";
cima = "!_m() { git commit -am \"$*\"; }; _m";
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
pst = "!git push origin --tags";
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
pr = "pull --rebase";
s = "status";
st = "status";
br = "branch";
bm = "branch --merged";
bn = "branch --no-merged";
hist = "log --pretty=format:'%Cgreen%h %Creset%cd %Cblue[%cn](%G?) %Creset%s%C(yellow)%d%C(reset)' --graph --date=relative --decorate --color=always";
history = "hist --all";
hs = "hist -n 10";
hsa = "hist -n 10 --all";
last = "log -1 HEAD";
lastd = "diff HEAD^ HEAD";
today = "hist --since=midnight";
df = "!_m() { git log --pretty=format:'%h %cd [%cn] %s%d' --date=relative | fzf --bind \"enter:execute(git diff --color=always $@ {1}^ {1} | ${PAGER})\" --preview-window=65% --preview=\"git diff --color=always $@ {1}^ {1}\"; }; _m";
type = "cat-file -t";
dump = "cat-file -p";
unstage = "reset HEAD --";
count = "rev-list --count --all";
tags = "for-each-ref --sort=-creatordate --format '%(refname:strip=2)' refs/tags";
initci = "commit --allow-empty -m 'Initial commit'";
# edit conflicted file on merge
edit-unmerged = "!$EDITOR $(git ls-files --unmerged | cut -f2 | sort -u)";
# add conflicted file on merge
add-unmerged = "!git add $(git ls-files --unmerged | cut -f2 | sort -u)";
remove-remote-tag = "!f() { git tag -d $1 && git push origin :refs/tags/$1 }; f";
aliases = "!git config -l | grep '^alias\\.' | cut -d. -f2-";
# git clone git://localhost/
serve = "daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/";
};
};
# Указание версии NixOs
system.stateVersion = "26.05";
}