refactor para nuevo sistema de shenvs

This commit is contained in:
Fabián Montero 2022-08-25 22:50:38 -06:00
parent 8f48524a76
commit d102de290e
14 changed files with 225 additions and 195 deletions

View file

@ -1,19 +0,0 @@
{
"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" = "simple-icons";
"workbench.editor.untitled.hint" = "hidden";
"editor.autoClosingDelete" = "never";
"editor.autoClosingOvertype" = "never";
"editor.autoClosingBrackets" = "never";
"editor.autoClosingQuotes" = "never";
}

View file

@ -1,23 +1,21 @@
# man page: https://rycee.gitlab.io/home-manager/options.html
{ nixpkgs, self, hm-isolation }: { nixpkgs, self, hm-isolation }:
{ config, pkgs, lib, ... }: with lib; { { config, pkgs, lib, ... } :
with lib;
nixpkgs.overlays = [ self.overlay ]; {
imports = [ imports = [
(hm-isolation.homeManagerModule) (hm-isolation.homeManagerModule)
./desktop ./gui
./isolation.nix ./isolation.nix
./steam ./path.nix
./systemd ./systemd
]; ];
nixpkgs.overlays = [ self.overlay ];
home = { home = {
stateVersion = "21.11"; # No tocar esto stateVersion = "21.11"; # No tocar esto
username = "fabian"; username = "fabian";
homeDirectory = "/home/fabian"; homeDirectory = "/home/fabian";
packages = import ./path.nix pkgs;
sessionVariables = { sessionVariables = {
"EDITOR" = "nvim"; "EDITOR" = "nvim";
"TERMINAL" = "kitty"; "TERMINAL" = "kitty";
@ -28,82 +26,29 @@
}; };
}; };
systemd.user.tmpfiles.rules = [ nix.registry = {
"d %t/tmp 0700 fabian fabian 24h" "system".to = {
]; type = "path";
path = "/home/fabian/nix";
nix.registry."system".to = {
type = "path";
path = "/home/fabian/nix";
};
nix.registry."nixpkgs".flake = nixpkgs;
nixpkgs.config.allowUnfree = true;
programs.home-manager.enable = true;
programs.neovim.enable = true;
programs.zsh = {
enable = true;
enableSyntaxHighlighting = true;
initExtra = import ./zshrc.nix pkgs;
};
programs.kitty = {
enable = true;
extraConfig = import ./kitty.conf.nix;
};
programs.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"
'';
};
# configurable = [ neovim keyboardlayout pulsaudio rofi ];
programs.vscode = {
enable = true;
package = pkgs.vscodium;
userSettings = import ./codium.nix;
haskell = {
enable = true;
hie.enable = false;
}; };
mutableExtensionsDir = false; "nixpkgs".flake = nixpkgs;
extensions = (with pkgs.vscode-extensions; [
bbenoist.nix
# justusadam.language-haskell
ms-toolsai.jupyter
ms-vscode.cpptools
# github.copilot
]) ++ (with pkgs.local.vscode-extensions; [
laurenttreguier.vscode-simple-icons
rust-lang.rust
sirtori.indenticator
]);
}; };
programs.git = { programs = {
enable = true; home-manager.enable = true;
userEmail = "fabian@cluster451.org"; neovim.enable = true;
userName = "Fabián Montero"; zsh = {
signing.key = "E77A808BF9A955D668EEEA6473FA9C9CB5F0249B"; enable = true;
enableSyntaxHighlighting = true;
initExtra = import ./zshrc.nix pkgs;
};
git = {
enable = true;
userEmail = "fabian@cluster451.org";
userName = "Fabián Montero";
signing.key = "E77A808BF9A955D668EEEA6473FA9C9CB5F0249B";
};
}; };
programs.steam.enable = true;
} }

View file

@ -1,34 +0,0 @@
{ config, pkgs, lib, ... }: with lib; {
imports = [ ./i3.nix ./polybar.nix ];
xsession.enable = true;
services.picom = {
enable = true;
};
services.dunst = {
enable = true;
};
services.betterlockscreen = {
enable = true;
};
xdg.mimeApps = {
enable = true;
defaultApplications = {
"application/pdf" = [ "org.kde.okular.desktop" ];
"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" ];
};
};
}

39
home/gui/default.nix Normal file
View file

@ -0,0 +1,39 @@
{ config, pkgs, lib, ... } :
with lib;
{
imports = [ ./i3.nix ./polybar.nix ./desktop ];
config = mkIf ( !config.home.isolation.active ) {
xsession.enable = true;
services.picom = {
enable = true;
};
services.dunst = {
enable = true;
};
services.betterlockscreen = {
enable = true;
};
xdg.mimeApps = {
enable = true;
defaultApplications = {
"application/pdf" = [ "org.kde.okular.desktop" ];
"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" ];
};
};
};
}

View file

@ -0,0 +1,13 @@
{ config, lib, pkgs, ...} :
with lib;
{
imports = [
./terminal.nix
./steam
./vscode.nix
];
# el sistema de shenvs detecta
# que esto solo va para mi home,
# no para las shenvs
programs.steam.enable = !config.home.isolation.active;
}

View file

@ -0,0 +1,28 @@
{config, lib, pkgs, ...} :
with lib;
{
programs = mkIf ( !config.home.isolation.active ) {
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,43 @@
{config, lib, pkgs, ...} :
with lib;
{
programs.vscode = mkIf ( !config.home.isolation.active ) {
enable = true;
package = pkgs.vscodium;
haskell = {
enable = true;
hie.enable = false;
};
mutableExtensionsDir = false;
extensions = (with pkgs.vscode-extensions; [
bbenoist.nix
# justusadam.language-haskell
ms-toolsai.jupyter
ms-vscode.cpptools
# github.copilot
]) ++ (with pkgs.local.vscode-extensions; [
laurenttreguier.vscode-simple-icons
rust-lang.rust
sirtori.indenticator
]);
userSettings = {
"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" = "simple-icons";
"workbench.editor.untitled.hint" = "hidden";
"editor.autoClosingDelete" = "never";
"editor.autoClosingOvertype" = "never";
"editor.autoClosingBrackets" = "never";
"editor.autoClosingQuotes" = "never";
};
};
}

View file

@ -1,6 +1,8 @@
{ config, pkgs, lib, ... }: with lib; { { config, pkgs, lib, ... } :
with lib;
{
xsession.windowManager.i3 = { xsession.windowManager.i3 = mkIf ( !config.home.isolation.active ) {
enable = true; enable = true;
package = pkgs.i3-gaps; package = pkgs.i3-gaps;

View file

@ -1,5 +1,7 @@
{ config, pkgs, lib, ... }: with lib; { { config, pkgs, lib, ... } :
services.polybar = { with lib;
{
services.polybar = mkIf ( !config.home.isolation.active ) {
enable = true; enable = true;
package = pkgs.polybarFull; package = pkgs.polybarFull;
script = '' script = ''

View file

@ -1,54 +1,60 @@
pkgs: with pkgs; [ { config, lib, pkgs, ... } :
arandr with lib;
arduino {
betterdiscordctl home.packages = with pkgs;
blas [
calc file
cargo-edit gcc
chromium helix
deluge killall
discord libsForQt5.breeze-gtk
file man-pages
firefox man-pages-posix
gcc tree
gruvbox-dark-icons-gtk units
helix unzip
htop zip
jetbrains.pycharm-professional ] ++ optionals ( !config.home.isolation.active ) [
jellyfin-media-player arandr
jq arduino
killall betterdiscordctl
libsForQt5.breeze-gtk blas
maim calc
man-pages cargo-edit
man-pages-posix chromium
mpv deluge
obs-studio discord
okular firefox
pandoc gruvbox-dark-icons-gtk
pavucontrol htop
pdfarranger jetbrains.pycharm-professional
polymc jellyfin-media-player
protonup jq
rar maim
runelite mpv
rust-analyzer obs-studio
rustup okular
signal-desktop pandoc
spotify pavucontrol
tdesktop pdfarranger
teams polymc
thunderbird protonup
tree rar
tor runelite
tor-browser-bundle-bin rust-analyzer
usbutils rustup
units signal-desktop
unzip spotify
virt-manager tdesktop
vlc teams
xclip thunderbird
xournalpp tor
zip tor-browser-bundle-bin
zoom-us usbutils
] virt-manager
vlc
xclip
xournalpp
zoom-us
];
}

View file

@ -1,2 +1,7 @@
{ lib, pkgs, ... }: { lib, pkgs, ... } :
with lib; {} with lib;
{
systemd.user.tmpfiles.rules = [
"d %t/tmp 0700 fabian fabian 24h"
];
}