reestructuración

This commit is contained in:
Fabián Montero 2022-11-29 21:29:21 -06:00
parent 576b7c5798
commit b29950097c
33 changed files with 1054 additions and 913 deletions

27
home/apps/default.nix Normal file
View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ...} :
with lib;
let
cfg = config.local.apps;
in
{
options.local.apps.enable = mkEnableOption "Applications and tools";
imports = [
./docs.nix
./editors
./messaging.nix
./multimedia.nix
./steam
./terminal
./virtmanager.nix
./web.nix
];
config.local.apps = mkIf cfg.enable {
docs.enable = mkDefault true;
editors.enable = mkDefault true;
messaging.enable = mkDefault true;
multimedia.enable = mkDefault true;
terminal.enable = mkDefault true;
web.enable = mkDefault true;
};
}

20
home/apps/docs.nix Normal file
View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... } :
with lib;
let
cfg = config.local.apps.docs;
in
{
options.local.apps.docs.enable = mkEnableOption "Doc management tools";
config = mkIf cfg.enable {
home.packages = with pkgs; [
libreoffice-fresh
okular
pdfarranger
xournal
];
xdg.mimeApps.defaultApplications = {
"application/pdf" = [ "org.kde.okular.desktop" ];
};
};
}

View file

@ -0,0 +1,18 @@
{ config, lib, pkgs, ... } :
with lib;
let
cfg = config.local.apps.editors;
in
{
options.local.apps.editors.enable = mkEnableOption "Text editors";
imports = [ ./vscode ];
config = mkIf cfg.enable {
local.apps.editors.vscode = mkDefault true;
neovim.enable = true;
helix.enable = true;
};
}

View file

@ -0,0 +1,19 @@
{config, lib, pkgs, ...} :
with lib;
let
cfg = config.local.apps.editors.vscode;
in
{
options.local.apps.editors.vscode.enable = mkEnableOption "VSCodium";
config = mkIf cfg.enable {
home.packages = [ rust-analyzer ];
programs.vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = false;
extensions = attrValues (pkgs.callPackage ./extensions.nix {}).extensions;
userSettings = import ./settings.nix
};
};
}

View file

@ -0,0 +1,208 @@
{ lib, vscode-utils, vscode-extensions }: with vscode-utils; {
extensions = {
inherit (vscode-extensions.bbenoist) nix;
inherit (vscode-extensions.ms-vscode) cpptools;
rust = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "rust-lang";
name = "rust";
version = "0.7.8";
sha256 = "sha256-Y33agSNMVmaVCQdYd5mzwjiK5JTZTtzTkmSGTQrSNg0=";
};
meta.license = lib.licenses.mit;
};
indenticator = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "sirtori";
name = "indenticator";
version = "0.7.0";
sha256 = "sha256-J5iNO6V5US+GFyNjNNA5u9H2pKPozWKjQWcLAhl+BjY=";
};
meta.license = lib.licenses.mit;
};
matlab = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "Gimly81";
name = "matlab";
version = "2.3.1";
sha256 = "sha256-0vx5L9efxvubb+JFunJJKaPvSxfgmYZkDJOxpXAV6xs=";
};
meta.license = lib.licenses.mit;
};
octave = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "toasty-technologies";
name = "octave";
version = "0.0.3";
sha256 = "sha256-tbqblaBX+wqgasfGLsFp49xYxXi5CF39YPYs0QyANt0=";
};
};
riscv = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "zhwu95";
name = "riscv";
version = "0.0.8";
sha256 = "sha256-PXaHSEXoN0ZboHIoDg37tZ+Gv6xFXP4wGBS3YS/53TY=";
};
};
pdf = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "tomoki1207";
name = "pdf";
version = "1.2.0";
sha256 = "sha256-/2u2yfAmSVBvfXIMt2VokkeYH8q8Y9Ca9YSDuwwpkq0=";
};
};
vscode-icons = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "vscode-icons-team";
name = "vscode-icons";
version = "12.0.0";
sha256 = "sha256-TQ/GPxNgbMBVlp+KNRd+M0vMxFSAjld/CCbVS9C1DuA=";
};
};
arm = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "dan-c-underwood";
name = "arm";
version = "1.7.4";
sha256 = "sha256-gZBM980AoD+0wnfHXJK9sqCuuLtRY08JnO3Qdq/TRfc=";
};
};
verilogHDL = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "mshr-h";
name = "VerilogHDL";
version = "1.5.4";
sha256 = "sha256-WxVEP37Z+hATTOZSozYSSGtDUSMKAO/nA6ORXbpjGMU=";
};
};
tcl = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "rashwell";
name = "tcl";
version = "0.1.0";
sha256 = "sha256-k8I/W3g98r/YCyIURgm7hh+0Bm0lg4Mdh/r8HsPSoX0=";
};
};
txt-syntax = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "xshrim";
name = "txt-syntax";
version = "0.2.1";
sha256 = "sha256-5MOHyTHAefD4X9dpMCJ1ArxBqvHRLfFjENXkIPmAw4M=";
};
};
linkerscript = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "ZixuanWang";
name = "linkerscript";
version = "1.0.2";
sha256 = "sha256-J6j4tXJ+gQWGJnMiqoIqJT2kGs/m8Njjm9pX9NCvJWc=";
};
};
vscode-drawio = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "hediet";
name = "vscode-drawio";
version = "1.6.4";
sha256 = "sha256-+VYdFk9VCp3KnvOASJ+jJSb1NBwykBlnd8EuSKw8sKI=";
};
};
better-comments = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "aaron-bond";
name = "better-comments";
version = "3.0.2";
sha256 = "sha256-hQmA8PWjf2Nd60v5EAuqqD8LIEu7slrNs8luc3ePgZc=";
};
};
code-spell-checker = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "streetsidesoftware";
name = "code-spell-checker";
version = "2.10.1";
sha256 = "sha256-FeYkSML6QYtuIHIbAovOqlPwkKfNkHr7IdMCWwkynQ0=";
};
};
vscode-todo-highlight = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "wayou";
name = "vscode-todo-highlight";
version = "1.0.5";
sha256 = "sha256-CQVtMdt/fZcNIbH/KybJixnLqCsz5iF1U0k+GfL65Ok=";
};
};
clang-format = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "xaver";
name = "clang-format";
version = "1.9.0";
sha256 = "sha256-q9DvkXbv+GTyeMVIyUQDK49Njsl9msbnOD1gyS4ljC8=";
};
};
markdown-all-in-one = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "yzhang";
name = "markdown-all-in-one";
version = "3.4.4";
sha256 = "sha256-2lZfWP+yk0Dp8INLjlJY5ROGu0sLaWhb4fT+O9xGg0s=";
};
};
path-intellisense = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "christian-kohler";
name = "path-intellisense";
version = "2.8.1";
sha256 = "sha256-lTKzMphkGgOG2XWqz3TW2G9sISBc/kG7oXqcIH8l+Mg=";
};
};
wav-preview = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "sukumo28";
name = "wav-preview";
version = "2.0.4";
sha256 = "sha256-N7Scz3vjDws4oTMqrM3mSANeW85GGpBUY2xfZx+WezY=";
};
};
indent-rainbow = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "oderwat";
name = "indent-rainbow";
version = "8.3.1";
sha256 = "sha256-dOicya0B2sriTcDSdCyhtp0Mcx5b6TUaFKVb0YU3jUc=";
};
};
python = buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "ms-python";
name = "python";
version = "2022.19.13141010";
sha256 = "sha256-8LbjpXLAAwK/oEPwpX+N1sWkSFNzQfWAkaBEQr49SQk=";
};
};
};
}
# para obtener el sha: lib.fakeSha256

View file

@ -0,0 +1,26 @@
{
"files.autoSave" = "onFocusChange";
"explorer.confirmDelete" = false;
"explorer.confirmDragAndDrop" = false;
"security.workspace.trust.enabled" = false;
"workbench.startupEditor" = "none";
"workbench.colorTheme" = "Default High Contrast";
"editor.mouseWheelZoom" = true;
"editor.cursorSmoothCaretAnimation" = true;
"workbench.list.smoothScrolling" = true;
"editor.smoothScrolling" = true;
"editor.rulers" = [80 120];
"workbench.iconTheme" = "vscode-icons";
"workbench.editor.untitled.hint" = "hidden";
"editor.autoClosingDelete" = "never";
"editor.autoClosingOvertype" = "never";
"editor.autoClosingBrackets" = "never";
"editor.autoClosingQuotes" = "never";
"indentRainbow.colors" = [
"rgba(255,255,64,0.2)"
"rgba(127,255,127,0.2)"
"rgba(255,127,255,0.2)"
"rgba(79,236,236,0.2)"
];
"hediet.vscode-drawio.theme" = "dark";
}

18
home/apps/messaging.nix Normal file
View file

@ -0,0 +1,18 @@
{ config, lib, pkgs, ... } :
with lib;
let
cfg = config.local.apps.messaging;
in
{
options.local.apps.messaging.enable = mkEnableOption "Messaging apps";
config = mkIf cfg.enable {
home.packages = with pkgs; [
discord
signal-desktop
tdesktop
teams
thunderbird
zoom-us
];
};
}

18
home/apps/multimedia.nix Normal file
View file

@ -0,0 +1,18 @@
{ config, lib, pkgs, ... } :
with lib;
let
cfg = config.local.apps.multimedia;
in
{
options.local.apps.multimedia.enable = mkEnableOption "Video and audio tools";
config = mkIf cfg.enable {
home.packages = with pkgs; [
deluge
mpv
obs-studio
pavucontrol
spotify
vlc
];
};
}

View file

@ -0,0 +1,12 @@
{pkgs, lib, config, ...}:
with lib; let
cfg = config.local.apps.steam;
in {
options.local.apps.steam.enable = mkEnableOption "Steam";
config = mkIf cfg.enable {
home.packages = [
(pkgs.callPackage ./package.nix {})
protonup
];
};
}

View file

@ -0,0 +1,4 @@
{ writeShellScriptBin, steam-run, steam, ... }:
writeShellScriptBin "steam" ''
exec ${steam-run}/bin/steam-run ${steam}/bin/steam
''

View file

@ -0,0 +1,32 @@
{config, lib, pkgs, ...} :
with lib;
let
cfg = config.local.apps.terminal;
in
{
options.local.apps.terminal.enable = mkEnableOption "Terminal emulator settings";
config.programs = mkIf cfg.enable {
kitty = {
enable = true;
extraConfig = import ./kitty.conf.nix;
};
tmux = {
enable = true;
aggressiveResize = true;
clock24 = true;
escapeTime = 10;
terminal = "xterm-256color";
keyMode = "emacs";
extraConfig = ''
set -g mouse on
set -ga update-environment " LIFT_PID"
set -g set-titles on
set -g renumber-windows on
set -sa terminal-overrides ',xterm-termite:RGB'
set -g status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,} %H:%M %d-%b-%y"
'';
};
};
}

View file

@ -0,0 +1,87 @@
''
# Fonts
font_family JetBrains Mono Medium
bold_font JetBrains Mono Bold
italic_font JetBrains Mono Italic
bold_italic_font JetBrains Mono Bold Italic
font_size 15
disable_ligatures cursor
initial_window_width 1200
initial_window_height 600
# Cursor
cursor_shape beam
cursor_beam_thickness 1.9
cursor_stop_blinking_after 0
# Audio
enable_audio_bell no
# Tabs
tab_bar_style separator
tab_separator " | "
tab_title_template "{index}: {title}"
# Color
# special
foreground #ffffff
foreground_bold #ffffff
cursor #ffffff
background #000000
background_opacity 1
# Shortcuts
map ctrl+shift+c copy_to_clipboard
map ctrl+shift+v paste_from_clipboard
map ctrl+shift+s paste_from_selection
map shift+insert paste_from_selection
map ctrl+shift+up scroll_line_up
map ctrl+shift+down scroll_line_down
map ctrl+shift+page_up scroll_page_up
map ctrl+shift+page_down scroll_page_down
map ctrl+shift+home scroll_home
map ctrl+shift+end scroll_end
map ctrl+shift+enter new_window
map ctrl+alt+enter launch --cwd=current
map ctrl+shift+w close_window
map ctrl+shift+] next_window
map ctrl+shift+[ previous_window
map ctrl+shift+1 first_window
map ctrl+shift+2 second_window
map ctrl+shift+3 third_window
map ctrl+shift+4 fourth_window
map ctrl+shift+5 fifth_window
map ctrl+shift+6 sixth_window
map ctrl+shift+7 seventh_window
map ctrl+shift+8 eighth_window
map ctrl+shift+9 ninth_window
map ctrl+shift+0 tenth_window
map ctrl+shift+right next_tab
map ctrl+shift+left previous_tab
map ctrl+shift+t new_tab
map ctrl+shift+q close_tab
map ctrl+shift+. move_tab_forward
map ctrl+shift+, move_tab_backward
map ctrl+shift+alt+t set_tab_title
map ctrl+alt+1 goto_tab 1
map ctrl+alt+2 goto_tab 2
map ctrl+alt+3 goto_tab 3
map ctrl+alt+4 goto_tab 4
map ctrl+alt+5 goto_tab 5
map ctrl+alt+6 goto_tab 6
map ctrl+alt+7 goto_tab 7
map ctrl+alt+8 goto_tab 8
map ctrl+alt+9 goto_tab 9
map ctrl+alt+0 goto_tab 10
map ctrl+shift+equal change_font_size all +1.0
map ctrl+shift+minus change_font_size all -1.0
map ctrl+shift+backspace change_font_size all 0
map ctrl+shift+delete clear_terminal reset active
''

13
home/apps/virtmanager.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, lib, pkgs, ... } :
with lib;
let
cfg = config.local.apps.virtmanager;
in
{
options.local.apps.virtmanager.enable = mkEnableOption "Virtmanager";
config = mkIf cfg.enable {
home.packages = with pkgs; [
virt-manager
];
};
}

26
home/apps/web.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... } :
with lib;
let
cfg = config.local.apps.web;
in
{
options.local.apps.web.enable = mkEnableOption "Browsers";
config = mkIf cfg.enable {
home.packages = with pkgs; [
chromium
firefox
];
xdg.mimeApps.defaultApplications = {
"application/x-extension-htm" = [ "firefox.desktop" ];
"application/x-extension-html" = [ "firefox.desktop" ];
"application/x-extension-shtml" = [ "firefox.desktop" ];
"application/x-extension-xht" = [ "firefox.desktop" ];
"application/x-extension-xhtml" = [ "firefox.desktop" ];
"application/xhtml+xml" = [ "firefox.desktop" ];
"text/html" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ];
};
};
}