emaaaaaaaaaaaaaaaaaaacs

This commit is contained in:
2025-02-25 19:18:25 +01:00
parent bcc7dc04a0
commit f550b29fb6
2 changed files with 775 additions and 734 deletions

198
home.nix
View File

@@ -1,16 +1,15 @@
{ config, pkgs, inputs, ... }:
let
lock-false = {
lock-false = {
Value = false;
Status = "locked";
};
lock-true = {
};
lock-true = {
Value = true;
Status = "locked";
};
in
{
};
in {
home.username = "fredrikr";
home.homeDirectory = "/home/fredrikr";
@@ -20,8 +19,8 @@ in
htop
dmenu
alacritty
# discord
# firefox
# discord
# firefox
scrot
brightnessctl
python3
@@ -50,21 +49,44 @@ in
unityhub
dotnet-sdk
omnisharp-roslyn
# emacs
fd
shellcheck
cmigemo
nodejs_22
cmake
clang-tools
glslang
csharpier
haskell-language-server
haskellPackages.hoogle
cabal-cli
nixfmt
black
python312Packages.pyflakes
isort
pipenv
python312Packages.nose2
python312Packages.pytest
python312Packages.setuptools
shfmt
libtool
tinymist
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
".config/alacritty".source = home/config/alacritty;
".config/xmonad".source = home/config/xmonad;
".xmobarrc".source = home/.xmobarrc;
@@ -73,11 +95,13 @@ in
recursive = true;
};
".config/gdb/gdbinit".source = home/config/gdb/gdbinit;
# ".emacs.d".source = home/emacs.d;
# ".config/emacs".source = home/config/emacs;
};
home.sessionVariables = {
EDITOR = "nvim";
};
home.sessionVariables = { EDITOR = "nvim"; };
home.sessionPath = [ "/home/fredrikr/.config/emacs/bin/" ];
programs.firefox = {
enable = true;
@@ -87,7 +111,7 @@ in
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value= true;
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
@@ -100,40 +124,49 @@ in
OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true;
DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab"
DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on"
DisplayMenuBar =
"default-off"; # alternatives: "always", "never" or "default-on"
SearchBar = "unified"; # alternative: "separate"
# about:support
ExtensionSettings = {
"*".installation_mode = "blocked"; # blocks all addons except the ones specified below
"*".installation_mode =
"blocked"; # blocks all addons except the ones specified below
# uBlock Origin:
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
# dark reader
"addon@darkreader.org" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi";
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi";
installation_mode = "force_installed";
};
# kagi
"search@kagi.com" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/kagi-search-for-firefox/latest.xpi";
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/kagi-search-for-firefox/latest.xpi";
installation_mode = "force_installed";
};
# vimium
"vimium-store@googlegroups.com" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi";
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi";
installation_mode = "force_installed";
};
};
# about:config
Preferences = {
"browser.contentblocking.category" = { Value = "strict"; Status = "locked"; };
"browser.contentblocking.category" = {
Value = "strict";
Status = "locked";
};
"extensions.pocket.enabled" = lock-false;
"extensions.screenshots.disabled" = lock-true;
"browser.topsites.contile.enabled" = lock-false;
@@ -142,12 +175,17 @@ in
"browser.search.suggest.enabled.private" = lock-false;
"browser.urlbar.suggest.searches" = lock-false;
"browser.urlbar.showSearchSuggestionsFirst" = lock-false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
"browser.newtabpage.activity-stream.feeds.section.topstories" =
lock-false;
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" =
lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" =
lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" =
lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" =
lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
@@ -166,9 +204,7 @@ in
key = "jk";
action = "<esc>";
mode = [ "i" ];
options = {
noremap = true;
};
options = { noremap = true; };
}
{
@@ -237,9 +273,7 @@ in
viAlias = true;
vimAlias = true;
globals = {
mapleader = " ";
};
globals = { mapleader = " "; };
opts = {
termguicolors = true;
@@ -287,15 +321,15 @@ in
};
formattersByFt = {
typst = ["typstyle "]; #"typstfmt"];
python = ["black"];
markdown = ["prettier"];
typst = [ "typstyle " ]; # "typstfmt"];
python = [ "black" ];
markdown = [ "prettier" ];
};
formatters = {
prettier = {
command = "prettier";
filetypes = ["markdown"];
filetypes = [ "markdown" ];
};
# typstfmt = {
# command = "typstfmt";
@@ -303,11 +337,11 @@ in
# };
typstyle = {
command = "typstyle";
filetypes = ["typst"];
filetypes = [ "typst" ];
};
black = {
command = "black";
filetypes = ["python"];
filetypes = [ "python" ];
};
};
};
@@ -320,18 +354,18 @@ in
enable = true;
settings = {
autoEnableSources = true;
experimental = {ghost_text = true;};
experimental = { ghost_text = true; };
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = {expand = "luasnip";};
formatting = {fields = ["kind" "abbr" "menu"];};
snippet = { expand = "luasnip"; };
formatting = { fields = [ "kind" "abbr" "menu" ]; };
sources = [
{name = "git";}
{name = "nvim_lsp";}
{name = "emoji";}
{ name = "git"; }
{ name = "nvim_lsp"; }
{ name = "emoji"; }
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
@@ -349,7 +383,8 @@ in
window = {
completion = {
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
winhighlight =
"FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
scrollbar = false;
sidePadding = 0;
border = [ "" "" "" "" "" "" "" "" ];
@@ -357,13 +392,15 @@ in
settings.documentation = {
border = [ "" "" "" "" "" "" "" "" ];
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
winhighlight =
"FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
};
};
mapping = {
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<S-Tab>" =
"cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_prev_item()";
"<C-e>" = "cmp.mapping.abort()";
@@ -371,16 +408,17 @@ in
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
"<S-CR>" =
"cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
};
};
};
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 = true;}; # autocomplete for cmdline
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 = true; }; # autocomplete for cmdline
lsp-format.enable = true;
@@ -444,8 +482,8 @@ in
fontPaths = [
"$dir/"
"./"
"$\{workspaceFolder}/fonts"
"$\{workspaceFolder}/"
"\${workspaceFolder}/fonts"
"\${workspaceFolder}/"
];
# formatterMode = "typstfmt";
formatterMode = "typstyle";
@@ -476,9 +514,7 @@ in
};
};
treesitter = {
enable = true;
};
treesitter = { enable = true; };
undotree.enable = true;
@@ -514,7 +550,6 @@ in
};
};
sleuth.enable = true;
# hardtime.enable = true; # the dark souls of vim
@@ -524,9 +559,7 @@ in
view.mergeTool.layout = "diff3_mixed";
};
markview = {
enable = true;
};
markview = { enable = true; };
};
extraConfigLua = ''
luasnip = require("luasnip")
@@ -581,9 +614,10 @@ in
zplug = {
enable = true;
plugins = [
{ name = "dracula/zsh"; tags = [ "as:theme" ]; }
];
plugins = [{
name = "dracula/zsh";
tags = [ "as:theme" ];
}];
};
shellAliases = {
@@ -592,6 +626,7 @@ in
logout = "sudo pkill -u fredrikr";
lock = "/home/fredrikr/.logout.sh";
n = "nvim";
e = "emacsclient -c -a 'emacs'";
};
defaultKeymap = "viins";
@@ -603,7 +638,7 @@ in
zsh-abbr.enable = true;
syntaxHighlighting = {
highlighters = ["main" "cursor"];
highlighters = [ "main" "cursor" ];
styles = { # dracula
"comment" = "fg=#6272A4";
"alias" = "fg=#50FA7B";
@@ -667,9 +702,7 @@ in
# package = pkgs.jdk21;
};
programs.direnv = {
enable = true;
};
programs.direnv = { enable = true; };
services.redshift = {
enable = true;
@@ -702,7 +735,6 @@ in
# ];
};
programs.kitty = {
enable = true;
settings = {
@@ -745,4 +777,12 @@ in
shellIntegration.enableZshIntegration = true;
theme = "Dracula";
};
programs.emacs = {
enable = true;
# defaultEditor = true;
package = pkgs.emacs-gtk;
# extraConfig = "home/config/emacs/.doomrc";
};
services.emacs.enable = true;
}

View File

@@ -77,6 +77,7 @@ myConfig = let
, ((0, xF86XK_MonBrightnessUp ), spawn "brightnessctl set 5%+")
, ((0, xF86XK_MonBrightnessDown ), spawn "brightnessctl set 5%-")
, ((modm .|. shiftMask, xK_Return), spawn terminal)
, ((modm, xK_e), spawn "emacsclient -c -a emacs")
]
++
[((m .|. modm, k), windows $ f i)