moved users/willifan to home-manager module

This commit is contained in:
willifan 2024-12-24 17:24:11 +01:00 committed by willifan
parent 2838549a4c
commit 184b0866d4
56 changed files with 243 additions and 276 deletions

View file

@ -1,13 +1,20 @@
{ hostname, ... }:
{
imports = [
./nixvim
./autoupdate.nix
./envvar.nix
./garbage-collect.nix
./keyd.nix
./locales.nix
./mimetype.nix
./optimise.nix
./packages.nix
./sops.nix
./stylix.nix
./syncthing.nix
./users.nix
];
networking = {

16
modules/common/envvar.nix Normal file
View file

@ -0,0 +1,16 @@
{ ... }:
{
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
# Not officially in the specification
#XDG_BIN_HOME = "$HOME/.local/bin";
#PATH = [
# "${XDG_BIN_HOME}"
#];
};
}

View file

@ -8,14 +8,14 @@
settings = {
main = {
rightalt = "overload(altgr, rightalt)";
capslock = "overload(control, esc)";
};
altgr = {
capslock = "overload(control, esc)";
};
altgr = {
a = ''macro(compose a ")'';
o = ''macro(compose o ")'';
u = ''macro(compose u ")'';
s = ''macro(compose s s)'';
};
u = ''macro(compose u ")'';
s = ''macro(compose s s)'';
};
};
};
};

View file

@ -0,0 +1,16 @@
{ ... }:
{
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
}

View file

@ -0,0 +1,12 @@
# Plugins
add cmp
try out nvimtree
add lualine
add autopairs
indent blankline??
todo comments
undo tree
bufferline?
startup?
KEYBINDS

View file

@ -0,0 +1,9 @@
{ ... }:
{
programs.nixvim.plugins.nvim-autopairs = {
enable = true;
settings = {
disable_filetype = ["TelescopePrompt" "vim"];
};
};
}

View file

@ -0,0 +1,49 @@
{ ... }:
{
programs.nixvim.plugins = {
cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = {ghost_text = false;};
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = {expand = "luasnip";};
formatting = {fields = ["kind" "abbr" "menu"];};
sources = [
{name = "git";}
{name = "nvim_lsp";}
{name = "emoji";}
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
keywordLength = 3;
}
{
name = "path"; # file system paths
keywordLength = 3;
}
{
name = "luasnip"; # snippets
keywordLength = 3;
}
];
window = {
completion = {border = "solid";};
documentation = {border = "solid";};
};
};
};
cmp-nvim-lsp = {enable = true;}; # lsp
cmp-buffer = {enable = true;};
cmp-path = {enable = true;}; # file system paths
cmp_luasnip = {enable = true;}; # snippets
cmp-cmdline = {enable = false;}; # autocomplete for cmdline
};
}

View file

@ -0,0 +1,24 @@
{ ... }:
{
programs.nixvim = {
enable = true;
defaultEditor = true;
};
imports = [
./autopairs.nix
./cmp.nix
./filetype.nix
./gitsigns.nix
./illuminate.nix
./lsp.nix
./navic.nix
./neotree.nix
./settings.nix
./treesitter.nix
./whichkey.nix
./yazi.nix
];
}

View file

@ -0,0 +1,14 @@
{ ... }:
{
programs.nixvim.files = {
"ftplugin/nix.lua" = {
opts = {
expandtab = true;
shiftwidth = 2;
tabstop = 2;
};
};
};
}

View file

@ -0,0 +1,28 @@
{ ... }:
{
programs.nixvim.plugins.gitsigns = {
enable = true;
settings = {
signs = {
add = {
text = " ";
};
change = {
text = " ";
};
delete = {
text = " ";
};
untracked = {
text = "";
};
topdelete = {
text = "󱂥 ";
};
changedelete = {
text = "󱂧 ";
};
};
};
};
}

View file

@ -0,0 +1,18 @@
{ ... }:
{
programs.nixvim.plugins = {
illuminate = {
enable = true;
underCursor = false;
filetypesDenylist = [
"Outline"
"TelescopePrompt"
"alpha"
"harpoon"
"reason"
];
};
};
}

View file

@ -0,0 +1,80 @@
{ ... }:
{
programs.nixvim = {
plugins = {
lsp-lines = {enable = true;};
lsp-format = {enable = true;};
lsp = {
enable = true;
inlayHints = true;
servers = {
clangd = {enable = true;};
html = {enable = true;};
lua_ls = {enable = true;};
nixd = {enable = true;};
pyright = {enable = true;};
gopls = {enable = true;};
jsonls = {enable = true;};
rust_analyzer = {
enable = true;
installCargo = true;
installRustc = true;
};
yamlls = {enable = true;};
};
keymaps = {
silent = true;
lspBuf = {
gd = {
action = "definition";
desc = "Goto Definition";
};
gr = {
action = "references";
desc = "Goto References";
};
gD = {
action = "declaration";
desc = "Goto Declaration";
};
gI = {
action = "implementation";
desc = "Goto Implementation";
};
gT = {
action = "type_definition";
desc = "Type Definition";
};
K = {
action = "hover";
desc = "Hover";
};
"<leader>cw" = {
action = "workspace_symbol";
desc = "Workspace Symbol";
};
"<leader>cr" = {
action = "rename";
desc = "Rename";
};
};
diagnostic = {
"<leader>cd" = {
action = "open_float";
desc = "Line Diagnostics";
};
"[d" = {
action = "goto_next";
desc = "Next Diagnostic";
};
"]d" = {
action = "goto_prev";
desc = "Previous Diagnostic";
};
};
};
};
};
};
}

View file

@ -0,0 +1,42 @@
{ ... }:
{
programs.nixvim.plugins = {
navic = {
enable = true;
settings = {
separator = " ";
highlight = true;
lsp = {
autoAttach = true;
};
icons = {
Array = "󱃵 ";
Boolean = " ";
Class = " ";
Constant = " ";
Constructor = " ";
Enum = " ";
EnumMember = " ";
Event = " ";
Field = "󰽏 ";
File = " ";
Function = "󰡱 ";
Interface = " ";
Key = " ";
Method = " ";
Module = "󰕳 ";
Namespace = " ";
Null = "󰟢 ";
Number = " ";
Object = " ";
Operator = " ";
Package = "󰏖 ";
String = " ";
Struct = " ";
TypeParameter = " ";
Variable = " ";
};
};
};
};
}

View file

@ -0,0 +1,42 @@
{ ... }:
{
programs.nixvim = {
plugins = {
neo-tree = {
enable = true;
sources = ["filesystem" "buffers" "git_status" "document_symbols"];
addBlankLineAtTop = false;
filesystem = {
bindToCwd = false;
followCurrentFile = {
enabled = true;
};
};
defaultComponentConfigs = {
indent = {
withExpanders = true;
expanderCollapsed = "󰅂";
expanderExpanded = "󰅀";
expanderHighlight = "NeoTreeExpander";
};
gitStatus = {
symbols = {
added = " ";
conflict = "󰩌 ";
deleted = "󱂥";
ignored = " ";
modified = " ";
renamed = "󰑕";
staged = "󰩍";
unstaged = "";
untracked = " ";
};
};
};
};
};
};
}

View file

@ -0,0 +1,101 @@
{ ... }:
{
programs.nixvim = {
config = {
extraConfigLuaPre =
# lua
''
vim.fn.sign_define("diagnosticsignerror", { text = " ", texthl = "diagnosticerror", linehl = "", numhl = "" })
vim.fn.sign_define("diagnosticsignwarn", { text = " ", texthl = "diagnosticwarn", linehl = "", numhl = "" })
vim.fn.sign_define("diagnosticsignhint", { text = "󰌵", texthl = "diagnostichint", linehl = "", numhl = "" })
vim.fn.sign_define("diagnosticsigninfo", { text = " ", texthl = "diagnosticinfo", linehl = "", numhl = "" })
'';
clipboard = {
providers.wl-copy.enable = true;
};
opts = {
# Show line numbers
number = true;
# Show relative line numbers
relativenumber = true;
# Use the system clipboard
clipboard = "unnamedplus";
# Number of spaces that represent a <TAB>
tabstop = 2;
softtabstop = 2;
# Show tabline always
showtabline = 2;
# Use spaces instead of tabs
expandtab = true;
# Enable smart indentation
smartindent = true;
# Number of spaces to use for each step of (auto)indent
shiftwidth = 2;
# Enable break indent
breakindent = true;
# Highlight the screen line of the cursor
cursorline = true;
# Minimum number of screen lines to keep above and below the cursor
scrolloff = 8;
# Enable mouse support
mouse = "a";
# Set folding method to manual
foldmethod = "manual";
# Disable folding by default
foldenable = false;
# Wrap long lines at a character in 'breakat'
linebreak = true;
# Disable spell checking
spell = false;
# Disable swap file creation
swapfile = false;
# Time in milliseconds to wait for a mapped sequence to complete
timeoutlen = 300;
# Enable 24-bit RGB color in the TUI
termguicolors = true;
# Don't show mode in the command line
showmode = false;
# Open new split below the current window
splitbelow = true;
# Keep the screen when splitting
splitkeep = "screen";
# Open new split to the right of the current window
splitright = true;
# Hide command line unless needed
cmdheight = 0;
# Remove EOB
fillchars = {
eob = " ";
};
};
};
};
}

View file

@ -0,0 +1,13 @@
{ ... }:
{
programs.nixvim.plugins = {
treesitter = {
enable = true;
settings = {
indent.enable = true;
highlight.enable = true;
};
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim.plugins = {
which-key = {
enable = true;
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim.plugins = {
yazi = {
enable = true;
};
};
}

View file

@ -0,0 +1,8 @@
{ pkgs, ...}:
{
environment.systemPackages = with pkgs; [
tealdeer
];
}

33
modules/common/stylix.nix Normal file
View file

@ -0,0 +1,33 @@
{ pkgs, ... }:
let
wallpaper = pkgs.fetchurl {
url = "https://files.huwe.mooo.com/Oneshot.png";
hash = "sha256-LaIzLCW86sbldE9lk7psbYKaTCjwaPLcoD3il6FalTw=";
};
plymouth_logo = pkgs.fetchurl {
url = "https://files.huwe.mooo.com/outlinenobackground.png";
hash = "sha256-HdErySgSwNSPEHyBywLyZCAss4vUhsY8BvCPe5hST6Q=";
};
in
{
stylix = {
enable = true;
autoEnable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/pasque.yaml";
override = {
base0D = "F3196E";
base0F = "CFAACF";
};
image = wallpaper;
polarity = "dark";
targets.plymouth.logo = plymouth_logo;
};
}

10
modules/common/users.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
users.users.willifan = {
isNormalUser = true;
description = "willifan";
extraGroups = [ "networkmanager" "wheel" "syncthing" ];
shell = pkgs.bash;
};
}

View file

@ -0,0 +1,16 @@
{ ... }:
{
home-manager.users.willifan = {
imports = [
./shell
./tmux
./utils
./git.nix
./stylix.nix
];
home.stateVersion = "23.11";
};
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
programs.git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
userName = "willifan";
userEmail = "willifan@pm.me";
extraConfig = {
init.defaultBranch = "main";
};
};
}

View file

@ -0,0 +1,20 @@
{ ... }:
{
programs = {
bash = {
enable = true;
shellAliases = {
ls = "eza";
};
};
starship = {
enableBashIntegration = true;
};
};
# programs.bash.blesh.enable = true;
}

View file

@ -0,0 +1,15 @@
{ pkgs, ... }:
{
imports = [
./bash.nix
./eza.nix
./hyfetch.nix
./nushell.nix
./ssh.nix
./starship.nix
./zoxide.nix
];
}

View file

@ -0,0 +1,8 @@
{ ... }:
{
programs.eza = {
enable = true;
};
}

View file

@ -0,0 +1,53 @@
{ ... }:
{
programs.hyfetch = {
enable = true;
settings = {
preset = "transgender";
mode = "rgb";
light_dark = "dark";
lightness = 0.69;
color_align = {
mode = "horizontal";
custom_colors = [];
fore_back = null;
};
backend = "fastfetch";
args = null;
distro = null;
pride_month_shown = [];
pride_month_disable = false;
};
};
programs.fastfetch = {
enable = true;
settings = {
modules = [
"title"
"separator"
"os"
"host"
{
type = "localip";
showIpv6 = false;
showMac = false;
showSpeed = false;
showMtu = false;
showLoop = false;
showFlags = false;
}
"kernel"
"uptime"
"packages"
"shell"
"wm"
"cpu"
"gpu"
"memory"
"break"
"colors"
];
};
};
}

View file

@ -0,0 +1,13 @@
{ ... }:
{
programs = {
nushell = {
enable = true;
};
starship = {
enableNushellIntegration = true;
};
};
}

View file

@ -0,0 +1,3 @@
{ ... }:
{
}

View file

@ -0,0 +1,159 @@
{ lib, config, ... }:
{
programs.starship = {
enable = true;
settings = {
format = lib.concatStrings [
"[ ](fg:twelve bg:trans_blue)"
"[ ](bg:trans_blue)[ ](fg:trans_blue bg:trans_pink)"
"$hostname"
"[ ](bg:trans_pink)[ ](fg:trans_pink bg:trans_white)"
"$directory"
"[ ](bg:trans_white)[ ](fg:trans_white bg:trans_pink)"
"("
"$git_branch"
"$git_status"
")"
"[ ](bg:trans_pink)[ ](fg:trans_pink bg:trans_blue)"
"$character"
];
right_format = lib.concatStrings [
"$cmd_duration"
"("
"$python"
"$conda"
"$c"
"$cmake"
"$golang"
"$haskell"
"$rust"
")"
];
palette = "stylix";
# Disables the blank line at the start of the prompt
add_newline = true;
palettes.stylix = {
first = config.lib.stylix.colors.withHashtag.base00;
second = config.lib.stylix.colors.withHashtag.base01;
third = config.lib.stylix.colors.withHashtag.base02;
fourth = config.lib.stylix.colors.withHashtag.base03;
fifth = config.lib.stylix.colors.withHashtag.base04;
sixth = config.lib.stylix.colors.withHashtag.base05;
seventh = config.lib.stylix.colors.withHashtag.base06;
eighth = config.lib.stylix.colors.withHashtag.base07;
baseeight = config.lib.stylix.colors.withHashtag.base08;
basenine = config.lib.stylix.colors.withHashtag.base09;
ten = config.lib.stylix.colors.withHashtag.base0A;
eleven = config.lib.stylix.colors.withHashtag.base0B;
twelve = config.lib.stylix.colors.withHashtag.base0C;
thirteen = config.lib.stylix.colors.withHashtag.base0D;
fourteen = config.lib.stylix.colors.withHashtag.base0E;
fifteen = config.lib.stylix.colors.withHashtag.base0F;
trans_blue = "#55CDFD";
trans_pink = "#F6AAB7";
trans_white = "#FFFFFF";
pride_red = "#FF1E26";
pride_orange = "#FE941E";
pride_yellow = "#FFFF00";
pride_green = "#06BD00";
pride_blue = "#001A98";
pride_violet = "#760088";
# Text color:
black = "#272D37";
white = "#CBF4F8";
github = "#B02B10";
};
hostname = {
ssh_only = false;
style = "bg:trans_pink fg:twelve";
format = "[$hostname](bold $style)";
};
directory = {
style = "bg:trans_white fg:twelve";
format = "[ $path](bold $style)($style)[$read_only](bold $style)";
truncation_symbol = "/";
truncate_to_repo = true;
read_only =" ";
};
c = {
symbol = " ";
version_format = "\${raw}";
style = "bg:fourth fg:white";
format = "[$symbol($version) ]($style)";
};
cmake = {
symbol = " ";
version_format = "\${raw}";
style = "bg:fourth fg:white";
format = "[$symbol($version) ]($style)";
};
golang = {
symbol = " ";
version_format = "\${raw}";
style = "bg:fourth fg:white";
format = "[$symbol($version) ]($style)";
};
python = {
symbol = " ";
version_format = "\${raw}";
style = "bg:fourth fg:white";
python_binary = ["./venv/bin/python" "./env/Scripts/python" "python" "python3" "python2"];
format = "[$symbol($version)]($style)[ (\($virtualenv\)) ](bg:fourth fg:white)";
};
conda = {
symbol = " ";
style = "bg:fourth fg:white";
ignore_base = false;
format = "[$symbol ($environment) ]($style)";
};
haskell = {
symbol = " ";
version_format = "\${raw}";
style = "bg:fourth fg:white";
format = "[$symbol($version) ]($style)";
};
rust = {
symbol = " ";
version_format = "\${raw}";
style = "bg:fourth fg:white";
format = "[$symbol($version) ]($style)";
};
git_branch = {
symbol = " ";
style = "bg:trans_pink fg:twelve";
format = "[$symbol $branch ](bold $style)";
};
git_status = {
style = "bold bg:trans_pink fg:twelve";
format = "([\($all_status$ahead_behind\)](bold $style))";
};
cmd_duration = {
style = "bg:eighth fg:twelve";
format = "[ $duration ](bold $style)";
};
character = {
success_symbol = "[:3 ](bold fg:twelve bg:trans_blue)[](fg:trans_blue)";
error_symbol = "[:o ](bold fg:twelve bg:trans_blue)[](fg:trans_blue)";
};
};
};
}

View file

@ -0,0 +1,11 @@
{ ... }:
{
programs.zoxide = {
enable = true;
options = [
"--cmd cd"
];
};
}

View file

@ -0,0 +1,66 @@
{ pkgs, ... }:
let
wallpaper = pkgs.fetchurl {
url = "https://files.huwe.mooo.com/Oneshot.png";
hash = "sha256-LaIzLCW86sbldE9lk7psbYKaTCjwaPLcoD3il6FalTw=";
};
in
{
stylix = {
enable = true;
autoEnable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/pasque.yaml";
override = {
base0D = "F3196E";
base0F = "CFAACF";
};
cursor = {
name = "Bibata-Modern-Classic";
package = pkgs.bibata-cursors;
size = 18;
};
fonts = {
# packages = [ pkgs.nerdfonts ];
# emoji = {
# package = pkgs.;
# name = "";
# };
monospace = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrainsMono Nerd Font";
};
# sansSerif = {
# package = pkgs.;
# name = "";
# };
# serif = {
# package = pkgs.;
# name = "";
# };
};
image = wallpaper;
opacity = {
applications = 0.9;
desktop = 0.9;
popups = 0.9;
terminal = 0.9;
};
polarity = "dark";
iconTheme = {
enable = true;
dark = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
};
}

View file

@ -0,0 +1,8 @@
{ ... }:
{
programs.tmux = {
enable = true;
};
}

View file

@ -0,0 +1,9 @@
{ ... }:
{
services.avizo.enable = true;
programs.bat.enable = true;
programs.btop.enable = true;
programs.yazi.enable = true;
}