diff --git a/home/codium.nix b/home/codium.nix deleted file mode 100644 index 04506d0..0000000 --- a/home/codium.nix +++ /dev/null @@ -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"; -} diff --git a/home/default.nix b/home/default.nix index 6310032..d28394d 100644 --- a/home/default.nix +++ b/home/default.nix @@ -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 = { - 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; + nix.registry = { + "system".to = { + type = "path"; + path = "/home/fabian/nix"; }; - - 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 - ]); + + "nixpkgs".flake = nixpkgs; }; - programs.git = { - enable = true; - userEmail = "fabian@cluster451.org"; - userName = "Fabián Montero"; - signing.key = "E77A808BF9A955D668EEEA6473FA9C9CB5F0249B"; + programs = { + home-manager.enable = true; + neovim.enable = true; + zsh = { + 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; } diff --git a/home/desktop/default.nix b/home/desktop/default.nix deleted file mode 100644 index 6b72197..0000000 --- a/home/desktop/default.nix +++ /dev/null @@ -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" ]; - }; - }; -} diff --git a/home/gui/default.nix b/home/gui/default.nix new file mode 100644 index 0000000..4cfdd52 --- /dev/null +++ b/home/gui/default.nix @@ -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" ]; + }; + }; + }; +} diff --git a/home/gui/desktop/default.nix b/home/gui/desktop/default.nix new file mode 100644 index 0000000..8fa13f9 --- /dev/null +++ b/home/gui/desktop/default.nix @@ -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; +} \ No newline at end of file diff --git a/home/kitty.conf.nix b/home/gui/desktop/kitty.conf.nix similarity index 100% rename from home/kitty.conf.nix rename to home/gui/desktop/kitty.conf.nix diff --git a/home/steam/default.nix b/home/gui/desktop/steam/default.nix similarity index 100% rename from home/steam/default.nix rename to home/gui/desktop/steam/default.nix diff --git a/home/steam/package.nix b/home/gui/desktop/steam/package.nix similarity index 100% rename from home/steam/package.nix rename to home/gui/desktop/steam/package.nix diff --git a/home/gui/desktop/terminal.nix b/home/gui/desktop/terminal.nix new file mode 100644 index 0000000..156ca94 --- /dev/null +++ b/home/gui/desktop/terminal.nix @@ -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" + ''; + }; + }; +} \ No newline at end of file diff --git a/home/gui/desktop/vscode.nix b/home/gui/desktop/vscode.nix new file mode 100644 index 0000000..42fc23b --- /dev/null +++ b/home/gui/desktop/vscode.nix @@ -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"; + }; + }; +} \ No newline at end of file diff --git a/home/desktop/i3.nix b/home/gui/i3.nix similarity index 96% rename from home/desktop/i3.nix rename to home/gui/i3.nix index d6fd12e..dbe4c8e 100644 --- a/home/desktop/i3.nix +++ b/home/gui/i3.nix @@ -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; diff --git a/home/desktop/polybar.nix b/home/gui/polybar.nix similarity index 99% rename from home/desktop/polybar.nix rename to home/gui/polybar.nix index 969d112..7c03e04 100644 --- a/home/desktop/polybar.nix +++ b/home/gui/polybar.nix @@ -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 = '' diff --git a/home/path.nix b/home/path.nix index 2d52163..73da771 100644 --- a/home/path.nix +++ b/home/path.nix @@ -1,54 +1,60 @@ -pkgs: with pkgs; [ - arandr - arduino - betterdiscordctl - blas - calc - cargo-edit - 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 - pandoc - pavucontrol - pdfarranger - polymc - protonup - rar - runelite - rust-analyzer - rustup - signal-desktop - spotify - tdesktop - teams - thunderbird - tree - tor - tor-browser-bundle-bin - usbutils - units - unzip - virt-manager - vlc - xclip - xournalpp - zip - zoom-us -] +{ 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 + blas + calc + cargo-edit + chromium + deluge + discord + firefox + gruvbox-dark-icons-gtk + htop + jetbrains.pycharm-professional + jellyfin-media-player + jq + maim + mpv + obs-studio + okular + pandoc + pavucontrol + pdfarranger + polymc + protonup + rar + runelite + rust-analyzer + rustup + signal-desktop + spotify + tdesktop + teams + thunderbird + tor + tor-browser-bundle-bin + usbutils + virt-manager + vlc + xclip + xournalpp + zoom-us + ]; +} diff --git a/home/systemd/default.nix b/home/systemd/default.nix index ccf9337..bd3dda7 100644 --- a/home/systemd/default.nix +++ b/home/systemd/default.nix @@ -1,2 +1,7 @@ -{ lib, pkgs, ... }: -with lib; {} +{ lib, pkgs, ... } : +with lib; +{ + systemd.user.tmpfiles.rules = [ + "d %t/tmp 0700 fabian fabian 24h" + ]; +}