Initial commit

This commit is contained in:
Andrey0189
2024-04-17 05:52:14 +05:00
commit b51f9bc101
43 changed files with 1721 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
{
imports = [
./hardware-configuration.nix
./packages.nix
./modules/bundle.nix
];
disabledModules = [
./modules/xserver.nix
];
networking.hostName = "nixos"; # Define your hostname.
time.timeZone = "Asia/Tashkent"; # Set your time zone.
i18n.defaultLocale = "en_US.UTF-8"; # Select internationalisation properties.
nix.settings.experimental-features = [ "nix-command" "flakes" ]; # Enabling flakes
system.stateVersion = "23.05"; # Don't change it bro
}
+37
View File
@@ -0,0 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/c3c28b79-eb8b-4a45-8ee2-5576e82cb4e5";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/3e9f0c85-9a78-44ad-a29c-84afc3b257cc"; }
{ device = "/dev/disk/by-uuid/d80806ff-1b8c-4cac-b7f8-593e030abcda"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.virbr0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+6
View File
@@ -0,0 +1,6 @@
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelParams = [ "psmouse.synaptics_intertouch=0" ];
}
+15
View File
@@ -0,0 +1,15 @@
{
imports = [
./bootloader.nix
./sound.nix
./zram.nix
./env.nix
./user.nix
./xserver.nix
./nm.nix
./virtmanager.nix
./hyprland.nix
./trim.nix
./nixvim/nixvim.nix
];
}
+8
View File
@@ -0,0 +1,8 @@
{
environment.variables = {
EDITOR = "nvim";
RANGER_LOAD_DEFAULT_RC = "FALSE";
QT_QPA_PLATFORMTHEME = "qt5ct";
GSETTINGS_BACKEND = "keyfile";
};
}
+3
View File
@@ -0,0 +1,3 @@
{
programs.hyprland.enable = true;
}
+10
View File
@@ -0,0 +1,10 @@
{
programs.nixvim = {
autoCmd = [
{
event = [ "VimEnter" ];
command = ":TransparentEnable";
}
];
};
}
+15
View File
@@ -0,0 +1,15 @@
{
programs.nixvim = {
globals = {
mapleader = "\\";
maplocalleader = "\\";
};
keymaps = [
{
key = "<leader>n";
action = "<cmd>Neotree<CR>";
}
];
};
}
+16
View File
@@ -0,0 +1,16 @@
{
imports = [
./opts.nix
./keymaps.nix
./autocmds.nix
./plugins/plugins-bundle.nix
];
programs.nixvim = {
enable = true;
defaultEditor = true;
colorschemes.oxocarbon.enable = true;
};
}
+64
View File
@@ -0,0 +1,64 @@
{
programs.nixvim = {
clipboard = {
register = "unnamedplus";
providers.wl-copy.enable = true;
};
opts = {
updatetime = 100; # Faster completion
relativenumber = true; # Relative line numbers
number = true; # Display the absolute line number of the current line
hidden = true; # Keep closed buffer open in the background
mouse = "a"; # Enable mouse control
mousemodel = "extend"; # Mouse right-click extends the current selection
splitbelow = true; # A new window is put below the current one
splitright = true; # A new window is put right of the current one
swapfile = false; # Disable the swap file
modeline = true; # Tags such as 'vim:ft=sh'
modelines = 100; # Sets the type of modelines
undofile = true; # Automatically save and restore undo history
incsearch = true; # Incremental search: show match for partly typed search command
inccommand = "split"; # Search and replace: preview changes in quickfix list
ignorecase = true; # When the search query is lower-case, match both lower and upper-case
smartcase = true; # Override the 'ignorecase' option if the search pattern contains upper
scrolloff = 12; # Number of screen lines to show around the cursor
cursorline = false; # Highlight the screen line of the cursor
cursorcolumn = false; # Highlight the screen column of the cursor
signcolumn = "yes"; # Whether to show the signcolumn
colorcolumn = "100"; # Columns to highlight
laststatus = 3; # When to use a status line for the last window
fileencoding = "utf-8"; # File-content encoding for the current buffer
termguicolors = false; # Disables 24-bit RGB color in the |TUI|
spell = false; # Highlight spelling mistakes (local to window)
wrap = false; # Prevent text from wrapping
tabstop = 2; # Number of spaces a <Tab> in the text stands for (local to buffer)
shiftwidth = 2; # Number of spaces used for each step of (auto)indent (local to buffer)
expandtab = true; # Expand <Tab> to spaces in Insert mode (local to buffer)
autoindent = true; # Do clever autoindenting
textwidth = 0; # Maximum width of text that is being inserted. A longer line will be
foldlevel = 99; # Folds with a level higher than this number will be closed
completeopt = ["menu" "menuone" "noselect"]; # For CMP plugin
};
};
}
+12
View File
@@ -0,0 +1,12 @@
{
programs.nixvim.plugins.barbar = {
enable = true;
keymaps = {
silent = true;
next = "<TAB>";
previous = "<S-TAB>";
close = "<C-q>";
};
};
}
+32
View File
@@ -0,0 +1,32 @@
{
programs.nixvim.plugins.cmp = {
enable = true;
settings = {
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
mapping = {
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = true })";
};
sources = [
{name = "path";}
{name = "nvim_lsp";}
{name = "cmp_tabby";}
{name = "luasnip";}
{
name = "buffer";
# Words from other open buffers can also be suggested.
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
{name = "neorg";}
];
};
};
}
+10
View File
@@ -0,0 +1,10 @@
{
programs.nixvim.plugins.comment = {
enable = true;
settings = {
opleader.line = "gcc";
toggler.line = "gcc";
};
};
}
+12
View File
@@ -0,0 +1,12 @@
{
programs.nixvim.plugins.floaterm = {
enable = true;
width = 0.8;
height = 0.8;
title = "";
keymaps.toggle = "<C-b>";
};
}
+46
View File
@@ -0,0 +1,46 @@
{
programs.nixvim.plugins = {
treesitter = {
enable = true;
nixvimInjections = true;
folding = true;
indent = true;
};
treesitter-refactor = {
enable = true;
highlightDefinitions = {
enable = true;
# Set to false if you have an `updatetime` of ~100.
clearOnCursorMove = false;
};
};
hmts.enable = true;
# lspkind = {
# enable = true;
#
# cmp = {
# enable = true;
# menu = {
# nvim_lsp = "[LSP]";
# nvim_lua = "[api]";
# path = "[path]";
# luasnip = "[snip]";
# buffer = "[buffer]";
# neorg = "[neorg]";
# cmp_tabby = "[Tabby]";
# };
# };
# };
lsp = {
enable = true;
servers = {
nil_ls.enable = true;
};
};
};
}
+47
View File
@@ -0,0 +1,47 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
globalstatus = true;
# +-------------------------------------------------+
# | A | B | C X | Y | Z |
# +-------------------------------------------------+
sections = {
lualine_a = ["mode"];
lualine_b = ["branch"];
lualine_c = ["filename" "diff"];
lualine_x = [
"diagnostics"
# Show active language server
{
name.__raw = ''
function()
local msg = ""
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end
'';
icon = " ";
# color.fg = "#ffffff";
}
"encoding"
"fileformat"
"filetype"
];
};
};
}
+20
View File
@@ -0,0 +1,20 @@
{
programs.nixvim.plugins.mini = {
enable = true;
modules = {
align = {};
basics = {
options.extra_ui = true;
};
clue = {};
cursorword = {};
doc = {};
extra = {};
indentscope = {};
trailspace = {};
misc = {};
surround = {};
};
};
}
+7
View File
@@ -0,0 +1,7 @@
{
programs.nixvim.plugins.neo-tree = {
enable = true;
filesystem.followCurrentFile.enabled = true;
closeIfLastWindow = true;
};
}
+3
View File
@@ -0,0 +1,3 @@
{
programs.nixvim.plugins.nix.enable = true;
}
@@ -0,0 +1,15 @@
{
imports = [
./lualine.nix
./transparent.nix
./neotree.nix
./mini.nix
./comment.nix
./floaterm.nix
./telescope.nix
./barbar.nix
./nix.nix
./lsp.nix
./cmp.nix
];
}
@@ -0,0 +1,29 @@
{
programs.nixvim.plugins.telescope = {
enable = true;
keymaps = {
"<leader>ff" = "find_files";
"<leader>b" = "buffers";
"<leader>fh" = "help_tags";
"<leader>gf" = "git_files";
"<leader>of" = "oldfiles";
# "<leader>fg" = "live_grep";
# "<leader>fd" = "diagnostics";
};
keymapsSilent = true;
settings.defaults = {
file_ignore_patterns = [
"^.git/"
"^.mypy_cache/"
"^__pycache__/"
"^output/"
"^data/"
"%.ipynb"
];
set_env.COLORTERM = "truecolor";
};
};
}
@@ -0,0 +1,3 @@
{
programs.nixvim.plugins.transparent.enable = true;
}
+3
View File
@@ -0,0 +1,3 @@
{
networking.networkmanager.enable = true;
}
+18
View File
@@ -0,0 +1,18 @@
{
hardware.pulseaudio.enable = false;
sound.enable = true;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
}
+3
View File
@@ -0,0 +1,3 @@
{
services.fstrim.enable = true;
}
+17
View File
@@ -0,0 +1,17 @@
{ pkgs, ... }: {
programs.zsh.enable = true;
users = {
defaultUserShell = pkgs.zsh;
users.amper = {
isNormalUser = true;
description = "Ampersand";
extraGroups = [ "networkmanager" "wheel" "input" "libvirtd" ];
packages = with pkgs; [];
};
};
# Enable automatic login for the user.
services.getty.autologinUser = "amper";
}
+8
View File
@@ -0,0 +1,8 @@
{ pkgs-stable, ... }: {
virtualisation.libvirtd.enable = true;
programs.virt-manager = {
enable = true;
package = pkgs-stable.virt-manager;
};
}
+26
View File
@@ -0,0 +1,26 @@
{
services.xserver = {
enable = true;
windowManager.herbstluftwm.enable = true;
# displayManager = {
# autoLogin.enable = true;
# autoLogin.user = "amper";
# lightdm.enable = true;
# };
layout = "us";
xkbVariant = "";
libinput = {
enable = true;
mouse.accelProfile = "flat";
touchpad.accelProfile = "flat";
};
videoDrivers = [ "amdgpu" ];
deviceSection = ''Option "TearFree" "True"'';
#displayManager.gdm.enable = true;
#desktopManager.gnome.enable = true;
};
}
+8
View File
@@ -0,0 +1,8 @@
{
zramSwap = {
enable = true;
algorithm = "lz4";
memoryPercent = 100;
priority = 999;
};
}
+116
View File
@@ -0,0 +1,116 @@
{ pkgs, ... }: {
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = ["python-2.7.18.8" "electron-25.9.0"];
};
environment.systemPackages = with pkgs; [
# Desktop apps
chromium
telegram-desktop
alacritty
obs-studio
rofi
wofi
mpv
kdenlive
discord
gparted
obsidian
zoom-us
pcmanfm-qt
# Coding stuff
gnumake
gcc
nodejs
python
(python3.withPackages (ps: with ps; [ requests ]))
# CLI utils
neofetch
file
tree
wget
git
fastfetch
htop
nix-index
unzip
scrot
ffmpeg
light
lux
mediainfo
ranger
zram-generator
cava
zip
ntfs3g
yt-dlp
brightnessctl
swww
openssl
# GUI utils
feh
imv
dmenu
screenkey
mako
gromit-mpx
# Xorg stuff
#xterm
#xclip
#xorg.xbacklight
# Wayland stuff
xwayland
wl-clipboard
cliphist
# WMs and stuff
herbstluftwm
hyprland
seatd
xdg-desktop-portal-hyprland
polybar
waybar
# Sound
pipewire
pulseaudio
pamixer
# GPU stuff
amdvlk
rocm-opencl-icd
glaxnimate
# Screenshotting
grim
grimblast
slurp
flameshot
swappy
# Other
home-manager
spice-vdagent
libsForQt5.qtstyleplugin-kvantum
libsForQt5.qt5ct
papirus-nord
];
fonts.packages = with pkgs; [
jetbrains-mono
noto-fonts
noto-fonts-emoji
twemoji-color-font
font-awesome
powerline-fonts
powerline-symbols
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
];
}