fuck it
This commit is contained in:
parent
b1cce6ca82
commit
3501857f2a
78 changed files with 1383 additions and 913 deletions
16
modules/home-manager/default.nix
Normal file
16
modules/home-manager/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
# Import all home-manager modules
|
||||
imports = [
|
||||
./programs
|
||||
./services
|
||||
];
|
||||
|
||||
# Basic home-manager configuration
|
||||
home.sessionVariables = {
|
||||
EDITOR = lib.mkDefault "nvim";
|
||||
};
|
||||
|
||||
# Enable basic programs that most users want
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
18
modules/home-manager/programs/alacritty.nix
Normal file
18
modules/home-manager/programs/alacritty.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
programs.alacritty = {
|
||||
enable = lib.mkDefault false;
|
||||
settings = {
|
||||
window = {
|
||||
opacity = 0.95;
|
||||
padding = {
|
||||
x = 10;
|
||||
y = 10;
|
||||
};
|
||||
};
|
||||
font = {
|
||||
size = 11.0;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/home-manager/programs/bash.nix
Normal file
10
modules/home-manager/programs/bash.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
bashrcExtra = ''
|
||||
if [ "dumb" == "$TERM" ] ; then
|
||||
export TERM=xterm-256color
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
16
modules/home-manager/programs/default.nix
Normal file
16
modules/home-manager/programs/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./fish.nix
|
||||
./starship.nix
|
||||
./git.nix
|
||||
./tmux.nix
|
||||
./zoxide.nix
|
||||
./direnv.nix
|
||||
./alacritty.nix
|
||||
./ghostty.nix
|
||||
./wezterm.nix
|
||||
./firefox.nix
|
||||
./mpv.nix
|
||||
];
|
||||
}
|
||||
6
modules/home-manager/programs/direnv.nix
Normal file
6
modules/home-manager/programs/direnv.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
||||
104
modules/home-manager/programs/firefox.nix
Normal file
104
modules/home-manager/programs/firefox.nix
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.enableFirefox = lib.mkEnableOption "enableFirefox";
|
||||
config = {
|
||||
programs.firefox = {
|
||||
enable = config.enableFirefox;
|
||||
languagePacks = [
|
||||
"ja"
|
||||
"tr"
|
||||
"en-US"
|
||||
];
|
||||
policies = {
|
||||
DisableTelemetry = true;
|
||||
DisableFirefoxStudies = true;
|
||||
EnableTrackingProtection = {
|
||||
Value = true;
|
||||
Locked = true;
|
||||
Cryptomining = true;
|
||||
Fingerprinting = true;
|
||||
};
|
||||
# DisablePocket = true;
|
||||
DisableFirefoxAccounts = true;
|
||||
DisableAccounts = true;
|
||||
DisableFirefoxScreenshots = true;
|
||||
StartPage = "previous-session";
|
||||
# OverrideFirstRunPage = "";
|
||||
# OverridePostUpdatePage = "";
|
||||
# DontCheckDefaultBrowser = true;
|
||||
DisplayBookmarksToolbar = "always"; # alternatives: "never" or "newtab"
|
||||
# DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on"
|
||||
# SearchBar = "unified"; # alternat
|
||||
ExtensionSettings =
|
||||
with builtins;
|
||||
let
|
||||
extension = shortId: uuid: {
|
||||
name = uuid;
|
||||
value = {
|
||||
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
|
||||
installation_mode = "normal_installed";
|
||||
};
|
||||
};
|
||||
in
|
||||
listToAttrs [
|
||||
(extension "tree-style-tab" "treestyletab@piro.sakura.ne.jp")
|
||||
(extension "ublock-origin" "uBlock0@raymondhill.net")
|
||||
(extension "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}")
|
||||
(extension "motivation-new-tab" "")
|
||||
(extension "return-youtube-dislikes" "{762f9885-5a13-4abd-9c77-433dcd38b8fd}")
|
||||
(extension "violentmonkey" "{aecec67f-0d10-4fa7-b7c7-609a2db280cf}")
|
||||
(extension "vimium-ff" "{d7742d87-e61d-4b78-b8a1-b469842139fa}")
|
||||
(extension "i-dont-care-about-cookies" "jid1-KKzOGWgsW3Ao4Q@jetpack")
|
||||
# (extension "tabliss" "extension@tabliss.io")
|
||||
# (extension "umatrix" "uMatrix@raymondhill.net")
|
||||
# (extension "libredirect" "7esoorv3@alefvanoon.anonaddy.me")
|
||||
(extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}")
|
||||
(extension "youtube-shorts-block" "")
|
||||
];
|
||||
# To add additional extensions, find it on addons.mozilla.org, find
|
||||
# the short ID in the url (like https://addons.mozilla.org/en-US/firefox/addon/!SHORT_ID!/)
|
||||
# Then, download the XPI by filling it in to the install_url template, unzip it,
|
||||
# run `jq .browser_specific_settings.gecko.id manifest.json` or
|
||||
# `jq .applications.gecko.id manifest.json` to get the UUID
|
||||
};
|
||||
profiles.default = {
|
||||
id = 0;
|
||||
name = "osbm";
|
||||
|
||||
userChrome = ''
|
||||
#tabbrowser-tabs {
|
||||
visibility: collapse;
|
||||
}
|
||||
'';
|
||||
settings = {
|
||||
# "Open previous windows and tabs"
|
||||
"browser.startup.page" = 3;
|
||||
"browser.contentblocking.category" = true;
|
||||
"extensions.pocket.enabled" = false;
|
||||
"extensions.screenshots.disabled" = true;
|
||||
"browser.topsites.contile.enabled" = false;
|
||||
"browser.formfill.enable" = false;
|
||||
"browser.search.suggest.enabled" = false;
|
||||
"browser.search.suggest.enabled.private" = false;
|
||||
"browser.urlbar.suggest.searches" = false;
|
||||
"browser.urlbar.showSearchSuggestionsFirst" = false;
|
||||
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
|
||||
"browser.newtabpage.activity-stream.feeds.snippets" = false;
|
||||
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
|
||||
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false;
|
||||
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false;
|
||||
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = false;
|
||||
"browser.newtabpage.activity-stream.showSponsored" = false;
|
||||
"browser.newtabpage.activity-stream.system.showSponsored" = false;
|
||||
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
"ui.key.menuAccessKeyFocuses" = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
25
modules/home-manager/programs/fish.nix
Normal file
25
modules/home-manager/programs/fish.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set -g fish_greeting
|
||||
'';
|
||||
shellAliases = {
|
||||
c = "code .";
|
||||
l = "eza --all --long --git --icons --sort size --header --group-directories-first";
|
||||
ll = "eza --all --long --git --icons --sort name --header --group-directories-first";
|
||||
free = "free -h";
|
||||
df = "df -h";
|
||||
du = "du -h";
|
||||
lg = "lazygit";
|
||||
onefetch = "onefetch -T prose -T programming -T data";
|
||||
};
|
||||
functions = {
|
||||
gitu = ''
|
||||
git add --all
|
||||
git commit -m "$argv"
|
||||
git push
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
7
modules/home-manager/programs/ghostty.nix
Normal file
7
modules/home-manager/programs/ghostty.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
programs.ghostty = {
|
||||
enable = lib.mkDefault false;
|
||||
# Configuration can be added as needed
|
||||
};
|
||||
}
|
||||
52
modules/home-manager/programs/git.nix
Normal file
52
modules/home-manager/programs/git.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userEmail = "osbm@osbm.dev";
|
||||
userName = "osbm";
|
||||
signing = {
|
||||
format = "openpgp";
|
||||
};
|
||||
ignores = [
|
||||
"*.pyc" # python
|
||||
"*.swp" # vim
|
||||
"__pycache__" # python
|
||||
".DS_Store" # macOS
|
||||
"result" # nix
|
||||
"node_modules" # node
|
||||
];
|
||||
extraConfig = {
|
||||
credential = {
|
||||
helper = "store";
|
||||
};
|
||||
core = {
|
||||
editor = "vim";
|
||||
pager = "cat";
|
||||
};
|
||||
diff = {
|
||||
wsErrorHighlight = "all";
|
||||
};
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
http = {
|
||||
postBuffer = 1048576000;
|
||||
};
|
||||
https = {
|
||||
postBuffer = 1048576000;
|
||||
};
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
filter.lfs = {
|
||||
clean = "git-lfs clean -- %f";
|
||||
smudge = "git-lfs smudge -- %f";
|
||||
process = "git-lfs filter-process";
|
||||
required = true;
|
||||
};
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = "3A264839184185CF";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/home-manager/programs/mpv.nix
Normal file
10
modules/home-manager/programs/mpv.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
programs.mpv = {
|
||||
enable = lib.mkDefault false;
|
||||
config = {
|
||||
hwdec = "auto";
|
||||
vo = "gpu";
|
||||
};
|
||||
};
|
||||
}
|
||||
49
modules/home-manager/programs/ssh.nix
Normal file
49
modules/home-manager/programs/ssh.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{ ... }:
|
||||
let
|
||||
# define a block that just takes a hostname and returns attrset to not repeat the same fields
|
||||
sshBlock = hostname: {
|
||||
hostname = hostname;
|
||||
user = "osbm";
|
||||
identityFile = "~/.ssh/id_ed25519";
|
||||
extraOptions = {
|
||||
# [ERROR] - (starship::print): Under a 'dumb' terminal (TERM=dumb).
|
||||
"RemoteCommand" = "fish";
|
||||
"RequestTTY" = "force";
|
||||
};
|
||||
hashKnownHosts = true;
|
||||
compression = true;
|
||||
};
|
||||
# sshBlockAtreus is the same as sshBlock but with 8090 as the port
|
||||
sshBlockAtreus = hostname: {
|
||||
hostname = hostname;
|
||||
user = "osbm";
|
||||
identityFile = "~/.ssh/id_ed25519";
|
||||
port = 8022;
|
||||
hashKnownHosts = true;
|
||||
compression = true;
|
||||
# fish not found error ???
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
|
||||
matchBlocks = {
|
||||
ymir = sshBlock "192.168.0.2";
|
||||
ymir-ts = sshBlock "ymir.curl-boga.ts.net";
|
||||
atreus = sshBlockAtreus "192.168.0.3";
|
||||
atreus-ts = sshBlockAtreus "atreus.curl-boga.ts.net";
|
||||
tartarus = sshBlock "192.168.0.4";
|
||||
tartarus-ts = sshBlock "tartarus.curl-boga.ts.net";
|
||||
pochita = sshBlock "192.168.0.9";
|
||||
pochita-ts = sshBlock "pochita.curl-boga.ts.net";
|
||||
harmonica = sshBlock "192.168.0.11";
|
||||
harmonica-ts = sshBlock "harmonica.curl-boga.ts.net";
|
||||
wallfacer = sshBlock "192.168.0.5";
|
||||
wallfacer-ts = sshBlock "wallfacer.curl-boga.ts.net";
|
||||
prometheus = sshBlock "192.168.0.12";
|
||||
prometheus-ts = sshBlock "prometheus.curl-boga.ts.net";
|
||||
};
|
||||
};
|
||||
}
|
||||
18
modules/home-manager/programs/starship.nix
Normal file
18
modules/home-manager/programs/starship.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
settings = {
|
||||
add_newline = false;
|
||||
dart.disabled = true;
|
||||
python.disabled = true;
|
||||
nodejs.disabled = true;
|
||||
c.disabled = true;
|
||||
gradle.disabled = true;
|
||||
java.disabled = true;
|
||||
ruby.disabled = true;
|
||||
rust.disabled = true;
|
||||
typst.disabled = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
94
modules/home-manager/programs/tlrc.nix
Normal file
94
modules/home-manager/programs/tlrc.nix
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
# stolen from https://github.com/dmarcoux/dotfiles
|
||||
{
|
||||
home.packages = [ pkgs.tlrc ];
|
||||
xdg.configFile."tlrc/config.toml".text = ''
|
||||
[cache]
|
||||
dir = "${config.xdg.cacheHome}/tlrc"
|
||||
mirror = "https://github.com/tldr-pages/tldr/releases/latest/download"
|
||||
auto_update = true
|
||||
max_age = 336
|
||||
languages = ["en", "tr", "ja"]
|
||||
|
||||
[output]
|
||||
show_title = false
|
||||
platform_title = false
|
||||
show_hyphens = false
|
||||
example_prefix = "- "
|
||||
compact = true
|
||||
raw_markdown = false
|
||||
|
||||
[indent]
|
||||
title = 2
|
||||
description = 2
|
||||
bullet = 2
|
||||
example = 4
|
||||
|
||||
[style.title]
|
||||
color = "magenta"
|
||||
background = "default"
|
||||
bold = true
|
||||
underline = false
|
||||
italic = false
|
||||
dim = false
|
||||
strikethrough = false
|
||||
|
||||
[style.description]
|
||||
color = "magenta"
|
||||
background = "default"
|
||||
bold = false
|
||||
underline = false
|
||||
italic = false
|
||||
dim = false
|
||||
strikethrough = false
|
||||
|
||||
[style.bullet]
|
||||
color = "green"
|
||||
background = "default"
|
||||
bold = false
|
||||
underline = false
|
||||
italic = false
|
||||
dim = false
|
||||
strikethrough = false
|
||||
|
||||
[style.example]
|
||||
color = "cyan"
|
||||
background = "default"
|
||||
bold = false
|
||||
underline = false
|
||||
italic = false
|
||||
dim = false
|
||||
strikethrough = false
|
||||
|
||||
[style.url]
|
||||
color = "red"
|
||||
background = "default"
|
||||
bold = false
|
||||
underline = false
|
||||
italic = true
|
||||
dim = false
|
||||
strikethrough = false
|
||||
|
||||
[style.inline_code]
|
||||
color = "yellow"
|
||||
background = "default"
|
||||
bold = false
|
||||
underline = false
|
||||
italic = true
|
||||
dim = false
|
||||
strikethrough = false
|
||||
|
||||
[style.placeholder]
|
||||
color = "red"
|
||||
background = "default"
|
||||
bold = false
|
||||
underline = false
|
||||
italic = true
|
||||
dim = false
|
||||
strikethrough = false
|
||||
'';
|
||||
}
|
||||
38
modules/home-manager/programs/tmux.nix
Normal file
38
modules/home-manager/programs/tmux.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
historyLimit = 100000;
|
||||
baseIndex = 1;
|
||||
shortcut = "s";
|
||||
mouse = true;
|
||||
shell = lib.getExe pkgs.fish;
|
||||
plugins = with pkgs; [
|
||||
tmuxPlugins.sensible
|
||||
tmuxPlugins.better-mouse-mode
|
||||
{
|
||||
plugin = tmuxPlugins.dracula;
|
||||
extraConfig = ''
|
||||
set -g @dracula-plugins "cpu-usage ram-usage gpu-usage battery"
|
||||
set -g @dracula-show-left-icon hostname
|
||||
set -g @dracula-git-show-current-symbol ✓
|
||||
set -g @dracula-git-no-repo-message "no-git"
|
||||
set -g @dracula-show-timezone false
|
||||
set -g @dracula-ignore-lspci true
|
||||
'';
|
||||
}
|
||||
];
|
||||
extraConfig = ''
|
||||
# Automatically renumber windows
|
||||
set -g renumber-windows on
|
||||
set -g allow-passthrough on
|
||||
set -ga update-environment TERM
|
||||
set -ga update-environment TERM_PROGRAM
|
||||
set-option -g default-command "${lib.getExe pkgs.fish} -l"
|
||||
'';
|
||||
};
|
||||
}
|
||||
32
modules/home-manager/programs/wezterm.nix
Normal file
32
modules/home-manager/programs/wezterm.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.enableWezterm = lib.mkEnableOption "Wezterm terminal emulator";
|
||||
config = {
|
||||
programs.wezterm = {
|
||||
enable = config.enableWezterm;
|
||||
extraConfig = ''
|
||||
_G.shells = {
|
||||
fish = '${lib.getExe pkgs.fish}'
|
||||
};
|
||||
|
||||
wezterm.on('gui-startup', function(cmd)
|
||||
local tab, pane, window = wezterm.mux.spawn_window(cmd or {})
|
||||
window:gui_window():maximize()
|
||||
end)
|
||||
|
||||
|
||||
return {
|
||||
default_prog = { _G.shells.fish },
|
||||
window_decorations = "NONE",
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
enable_wayland = false,
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/home-manager/programs/zoxide.nix
Normal file
6
modules/home-manager/programs/zoxide.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue