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 }:
{ config, pkgs, lib, ... }: with lib; {
nixpkgs.overlays = [ self.overlay ];
{ config, pkgs, lib, ... } :
with lib;
{
imports = [
(hm-isolation.homeManagerModule)
./desktop
./gui
./isolation.nix
./steam
./path.nix
./systemd
];
nixpkgs.overlays = [ self.overlay ];
home = {
stateVersion = "21.11"; # No tocar esto
username = "fabian";
homeDirectory = "/home/fabian";
packages = import ./path.nix pkgs;
sessionVariables = {
"EDITOR" = "nvim";
"TERMINAL" = "kitty";
@ -28,82 +26,29 @@
};
};
systemd.user.tmpfiles.rules = [
"d %t/tmp 0700 fabian fabian 24h"
];
nix.registry."system".to = {
nix.registry = {
"system".to = {
type = "path";
path = "/home/fabian/nix";
};
nix.registry."nixpkgs".flake = nixpkgs;
"nixpkgs".flake = nixpkgs;
};
nixpkgs.config.allowUnfree = true;
programs.home-manager.enable = true;
programs.neovim.enable = true;
programs.zsh = {
programs = {
home-manager.enable = true;
neovim.enable = true;
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;
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 = {
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;
package = pkgs.i3-gaps;

View file

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

View file

@ -1,4 +1,20 @@
pkgs: with pkgs; [
{ config, lib, pkgs, ... } :
with lib;
{
home.packages = with pkgs;
[
file
gcc
helix
killall
libsForQt5.breeze-gtk
man-pages
man-pages-posix
tree
units
unzip
zip
] ++ optionals ( !config.home.isolation.active ) [
arandr
arduino
betterdiscordctl
@ -8,20 +24,13 @@ pkgs: with pkgs; [
chromium
deluge
discord
file
firefox
gcc
gruvbox-dark-icons-gtk
helix
htop
jetbrains.pycharm-professional
jellyfin-media-player
jq
killall
libsForQt5.breeze-gtk
maim
man-pages
man-pages-posix
mpv
obs-studio
okular
@ -39,16 +48,13 @@ pkgs: with pkgs; [
tdesktop
teams
thunderbird
tree
tor
tor-browser-bundle-bin
usbutils
units
unzip
virt-manager
vlc
xclip
xournalpp
zip
zoom-us
]
];
}

View file

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