diff --git a/modules/user/jopejoe1/default.nix b/modules/user/jopejoe1/default.nix index 09bda4c..3be9bf6 100644 --- a/modules/user/jopejoe1/default.nix +++ b/modules/user/jopejoe1/default.nix @@ -10,6 +10,7 @@ in }; config = mkIf cfg.enable { + imports = [ ./home.nix ]; users.users.jopejoe1 = { isNormalUser = true; description = "jopejoe1 🚫"; @@ -25,7 +26,5 @@ in ark ]; }; - - home-manager.users.jopejoe1 = import ./home.nix; }; } diff --git a/modules/user/jopejoe1/home.nix b/modules/user/jopejoe1/home.nix index 6e8c460..1646502 100644 --- a/modules/user/jopejoe1/home.nix +++ b/modules/user/jopejoe1/home.nix @@ -1,244 +1,248 @@ { config, pkgs, ... }: +let cfg = config.home-manager.users.jopejoe1; +in { - home = { - # Basic information for home-manager - username = "jopejoe1"; - homeDirectory = "/home/${config.home.username}"; + home-manager.users.jopejoe1 = { + home = { + # Basic information for home-manager + username = "jopejoe1"; + homeDirectory = "/home/${cfg.home.username}"; - # Enviroment variables - sessionVariables = { - XCOMPOSECACHE = "${config.xdg.cacheHome}/X11/xcompos"; - XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; + # Enviroment variables + sessionVariables = { + XCOMPOSECACHE = "${cfg.xdg.cacheHome}/X11/xcompos"; + XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; + }; + + stateVersion = config.system.stateVersion; }; - stateVersion = config.system.stateVersion; - }; - - accounts.email.accounts = { - main = { - address = "johannes@joens.email"; - flavor = "gmail.com"; - primary = true; - realName = "Johannes Joens"; - thunderbird.enable = true; - }; - }; - - # XDG base dirs - xdg = { - enable = true; - mime.enable = true; - cacheHome = "${config.home.homeDirectory}/.cache"; - configHome = "${config.home.homeDirectory}/.config"; - dataHome = "${config.home.homeDirectory}/.local/share"; - stateHome = "${config.home.homeDirectory}/.local/state"; - userDirs = { - enable = true; - createDirectories = false; - desktop = "${config.home.homeDirectory}/Desktop"; - documents = "${config.home.homeDirectory}/Documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/Music"; - pictures = "${config.home.homeDirectory}/Pictures"; - publicShare = "${config.home.homeDirectory}/Public"; - templates = "${config.home.homeDirectory}/Templates"; - videos = "${config.home.homeDirectory}/Videos"; - }; - }; - - gtk = { - enable = true; - gtk2 = { - configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - }; - gtk3 = { - extraConfig = { - gtk-application-prefer-dark-theme = true; - gtk-button-images = true; - gtk-decoration-layout = "icon:minimize,maximize,close"; - gtk-enable-animations = true; - gtk-menu-images = true; - gtk-modules = "colorreload-gtk-module"; - gtk-primary-button-warps-slider = false; - gtk-toolbar-style = 3; + accounts.email.accounts = { + main = { + address = "johannes@joens.email"; + flavor = "gmail.com"; + primary = true; + realName = "Johannes Joens"; + thunderbird.enable = true; }; }; - gtk4 = { - extraConfig = { - gtk-application-prefer-dark-theme = true; - gtk-decoration-layout = "icon:minimize,maximize,close"; - gtk-enable-animations = true; - gtk-primary-button-warps-slider = false; - }; - }; - cursorTheme = { - package = pkgs.libsForQt5.breeze-icons; - name = "breeze_cursors"; - size = 24; - }; - font = { - package = pkgs.noto-fonts; - name = "Noto Sans"; - size = 10; - }; - theme = { - package = pkgs.libsForQt5.breeze-gtk; - name = "breeze-dark"; - }; - iconTheme = { - package = pkgs.tela-icon-theme; - name = "Tela-purple"; - }; - }; - # Let Home Manager install and manage itself. - programs = { - home-manager.enable = true; - git = { + # XDG base dirs + xdg = { enable = true; - package = pkgs.gitAndTools.gitFull; - userEmail = "johannes@joens.email"; - userName = "jopejoe1"; - }; - bash = { - enable = true; - historyFile = "${config.xdg.stateHome}/bash/history"; - shellAliases = { - gc = "sudo nix store gc"; - rb = "sudo git -C /etc/nixos pull && sudo nix flake update /etc/nixos/ && sudo nixos-rebuild switch && sudo git -C /etc/nixos add . && sudo git -C /etc/nixos commit -m 'Updated flake.lock' && sudo git -C /etc/nixos push"; + mime.enable = true; + cacheHome = "${cfg.home.homeDirectory}/.cache"; + configHome = "${cfg.home.homeDirectory}/.config"; + dataHome = "${cfg.home.homeDirectory}/.local/share"; + stateHome = "${cfg.home.homeDirectory}/.local/state"; + userDirs = { + enable = true; + createDirectories = false; + desktop = "${cfg.home.homeDirectory}/Desktop"; + documents = "${cfg.home.homeDirectory}/Documents"; + download = "${cfg.home.homeDirectory}/Downloads"; + music = "${cfg.home.homeDirectory}/Music"; + pictures = "${cfg.home.homeDirectory}/Pictures"; + publicShare = "${cfg.home.homeDirectory}/Public"; + templates = "${cfg.home.homeDirectory}/Templates"; + videos = "${cfg.home.homeDirectory}/Videos"; }; }; - zsh = { + + gtk = { enable = true; - shellAliases = config.programs.bash.shellAliases; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - enableVteIntegration = true; - dotDir = ".config/zsh"; - }; - fish.shellAbbrs = config.programs.bash.shellAliases; - thunderbird = { - enable = false; - profiles = { - default = { - isDefault = true; + gtk2 = { + configLocation = "${cfg.xdg.configHome}/gtk-2.0/gtkrc"; + }; + gtk3 = { + extraConfig = { + gtk-application-prefer-dark-theme = true; + gtk-button-images = true; + gtk-decoration-layout = "icon:minimize,maximize,close"; + gtk-enable-animations = true; + gtk-menu-images = true; + gtk-modules = "colorreload-gtk-module"; + gtk-primary-button-warps-slider = false; + gtk-toolbar-style = 3; }; }; + gtk4 = { + extraConfig = { + gtk-application-prefer-dark-theme = true; + gtk-decoration-layout = "icon:minimize,maximize,close"; + gtk-enable-animations = true; + gtk-primary-button-warps-slider = false; + }; + }; + cursorTheme = { + package = pkgs.libsForQt5.breeze-icons; + name = "breeze_cursors"; + size = 24; + }; + font = { + package = pkgs.noto-fonts; + name = "Noto Sans"; + size = 10; + }; + theme = { + package = pkgs.libsForQt5.breeze-gtk; + name = "breeze-dark"; + }; + iconTheme = { + package = pkgs.tela-icon-theme; + name = "Tela-purple"; + }; }; - firefox = { - enable = true; - package = pkgs.wrapFirefox pkgs.firefox-unwrapped { - extraPolicies = { - AppAutoUpdate = false; - BackgroundAppUpdate = false; - DisableAppUpdate = true; - CaptivePortal = false; - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - DisableFirefoxAccounts = true; - DisableFormHistory = true; - DefaultDownloadDirectory = "${config.xdg.userDirs.download}"; - DontCheckDefaultBrowser = true; - ExtensionUpdate = false; - NoDefaultBookmarks = true; - PasswordManagerEnabled = false; - OfferToSaveLogins = false; - OfferToSaveLoginsDefault = false; - EnableTrackingProtection = { - Value = true; - Cryptomining = true; - Fingerprinting = true; - }; - FirefoxHome = { - Search = true; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - TopSites = true; - SponsoredTopSites = false; - Highlights = false; - }; - UserMessaging = { - ExtensionRecommendations = false; - SkipOnboarding = true; + + # Let Home Manager install and manage itself. + programs = { + home-manager.enable = true; + git = { + enable = true; + package = pkgs.gitAndTools.gitFull; + userEmail = "johannes@joens.email"; + userName = "jopejoe1"; + }; + bash = { + enable = true; + historyFile = "${cfg.xdg.stateHome}/bash/history"; + shellAliases = { + gc = "sudo nix store gc"; + rb = "sudo git -C /etc/nixos pull && sudo nix flake update /etc/nixos/ && sudo nixos-rebuild switch && sudo git -C /etc/nixos add . && sudo git -C /etc/nixos commit -m 'Updated flake.lock' && sudo git -C /etc/nixos push"; + }; + }; + zsh = { + enable = true; + shellAliases = cfg.programs.bash.shellAliases; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + enableVteIntegration = true; + dotDir = ".config/zsh"; + }; + fish.shellAbbrs = cfg.programs.bash.shellAliases; + thunderbird = { + enable = false; + profiles = { + default = { + isDefault = true; }; }; }; - profiles = { - default = { - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin - privacy-badger - bitwarden - clearurls - decentraleyes - duckduckgo-privacy-essentials - ghostery - libredirect - privacy-badger - languagetool - fastforward - return-youtube-dislikes - sponsorblock - augmented-steam - steam-database - refined-github - plasma-integration - #bypass-paywalls-clean - lovely-forks - search-by-image - skip-redirect - terms-of-service-didnt-read - unpaywall - wappalyzer - wayback-machine - modrinthify - ]; - id = 0; - isDefault = true; - name = "default"; - search = { - default = "DuckDuckGo"; - force = true; - engines = { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - "NixOS Wiki" = { - urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; - icon = "${config.programs.firefox.profiles.default.search.engines."Nix Packages".icon}"; - definedAliases = [ "@nw" ]; - }; - "Bing".metaData.hidden = true; - "Google".metaData.hidden = true; - "eBay".metaData.hidden = true; - "Amazon.de".metaData.hidden = true; - "Wikipedia (en)".metaData.alias = "@wiki"; + firefox = { + enable = true; + package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + extraPolicies = { + AppAutoUpdate = false; + BackgroundAppUpdate = false; + DisableAppUpdate = true; + CaptivePortal = false; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + DisableFirefoxAccounts = true; + DisableFormHistory = true; + DefaultDownloadDirectory = "${cfg.xdg.userDirs.download}"; + DontCheckDefaultBrowser = true; + ExtensionUpdate = false; + NoDefaultBookmarks = true; + PasswordManagerEnabled = false; + OfferToSaveLogins = false; + OfferToSaveLoginsDefault = false; + EnableTrackingProtection = { + Value = true; + Cryptomining = true; + Fingerprinting = true; + }; + FirefoxHome = { + Search = true; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + TopSites = true; + SponsoredTopSites = false; + Highlights = false; + }; + UserMessaging = { + ExtensionRecommendations = false; + SkipOnboarding = true; }; }; - settings = { - "privacy.resistFingerprinting" = true; - "privacy.trackingprotection.fingerprinting.enabled" = true; - "privacy.trackingprotection.cryptomining.enabled" = true; - "dom.event.clipboardevents.enabled" = false; - "dom.battery.enabled" = false; - "browser.safebrowsing.phishing.enabled" = false; - "browser.safebrowsing.malware.enabled" = false; - "browser.zoom.siteSpecific" = true; - "config.trim_on_minimize" = true; - "pdfjs.annotationEditorMode" = 0; - "pdfjs.annotationmode" = 2; + }; + profiles = { + default = { + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + privacy-badger + bitwarden + clearurls + decentraleyes + duckduckgo-privacy-essentials + ghostery + libredirect + privacy-badger + languagetool + fastforward + return-youtube-dislikes + sponsorblock + augmented-steam + steam-database + refined-github + plasma-integration + #bypass-paywalls-clean + lovely-forks + search-by-image + skip-redirect + terms-of-service-didnt-read + unpaywall + wappalyzer + wayback-machine + modrinthify + ]; + id = 0; + isDefault = true; + name = "default"; + search = { + default = "DuckDuckGo"; + force = true; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "NixOS Wiki" = { + urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; + icon = "${cfg.programs.firefox.profiles.default.search.engines."Nix Packages".icon}"; + definedAliases = [ "@nw" ]; + }; + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "eBay".metaData.hidden = true; + "Amazon.de".metaData.hidden = true; + "Wikipedia (en)".metaData.alias = "@wiki"; + }; + }; + settings = { + "privacy.resistFingerprinting" = true; + "privacy.trackingprotection.fingerprinting.enabled" = true; + "privacy.trackingprotection.cryptomining.enabled" = true; + "dom.event.clipboardevents.enabled" = false; + "dom.battery.enabled" = false; + "browser.safebrowsing.phishing.enabled" = false; + "browser.safebrowsing.malware.enabled" = false; + "browser.zoom.siteSpecific" = true; + "config.trim_on_minimize" = true; + "pdfjs.annotationEditorMode" = 0; + "pdfjs.annotationmode" = 2; + }; }; }; }; diff --git a/modules/user/root/default.nix b/modules/user/root/default.nix index 72562e8..6a37471 100644 --- a/modules/user/root/default.nix +++ b/modules/user/root/default.nix @@ -10,7 +10,6 @@ in }; config = mkIf cfg.enable { - - home-manager.users.root = import ./home.nix; + imports = [ ./home.nix ]; }; } diff --git a/modules/user/root/home.nix b/modules/user/root/home.nix index 94df087..fde330a 100644 --- a/modules/user/root/home.nix +++ b/modules/user/root/home.nix @@ -1,58 +1,62 @@ { config, pkgs, ... }: +let cfg = config.home-manager.users.root; +in { - home = { - # Basic information for home-manager - username = "root"; - homeDirectory = "/${config.home.username}"; + home-manager.users.root = { + home = { + # Basic information for home-manager + username = "root"; + homeDirectory = "/${cfg.home.username}"; - # Enviroment variables - sessionVariables = { - XCOMPOSECACHE = "${config.xdg.cacheHome}/X11/xcompos"; - XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; + # Enviroment variables + sessionVariables = { + XCOMPOSECACHE = "${cfg.xdg.cacheHome}/X11/xcompos"; + XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; + }; + + stateVersion = config.system.stateVersion; }; - stateVersion = config.system.stateVersion; - }; - - xdg = { - enable = true; - mime.enable = true; - cacheHome = "${config.home.homeDirectory}/.cache"; - configHome = "${config.home.homeDirectory}/.config"; - dataHome = "${config.home.homeDirectory}/.local/share"; - stateHome = "${config.home.homeDirectory}/.local/state"; - userDirs = { + xdg = { enable = true; - createDirectories = false; - desktop = "${config.home.homeDirectory}/Desktop"; - documents = "${config.home.homeDirectory}/Documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/Music"; - pictures = "${config.home.homeDirectory}/Pictures"; - publicShare = "${config.home.homeDirectory}/Public"; - templates = "${config.home.homeDirectory}/Templates"; - videos = "${config.home.homeDirectory}/Videos"; - }; - }; - - programs = { - home-manager.enable = true; - git = { - enable = true; - package = pkgs.gitAndTools.gitFull; - userEmail = "johannes@joens.email"; - userName = "jopejoe1"; - }; - bash = { - enable = true; - historyFile = "${config.xdg.stateHome}/bash/history"; - shellAliases = { - gc = "sudo nix store gc"; - rb = "sudo nix flake update /etc/nixos/ && sudo nixos-rebuild switch"; + mime.enable = true; + cacheHome = "${cfg.home.homeDirectory}/.cache"; + configHome = "${cfg.home.homeDirectory}/.config"; + dataHome = "${cfg.home.homeDirectory}/.local/share"; + stateHome = "${cfg.home.homeDirectory}/.local/state"; + userDirs = { + enable = true; + createDirectories = false; + desktop = "${cfg.home.homeDirectory}/Desktop"; + documents = "${cfg.home.homeDirectory}/Documents"; + download = "${cfg.home.homeDirectory}/Downloads"; + music = "${cfg.home.homeDirectory}/Music"; + pictures = "${cfg.home.homeDirectory}/Pictures"; + publicShare = "${cfg.home.homeDirectory}/Public"; + templates = "${cfg.home.homeDirectory}/Templates"; + videos = "${cfg.home.homeDirectory}/Videos"; }; }; - zsh.shellAliases = config.programs.bash.shellAliases; - fish.shellAbbrs = config.programs.bash.shellAliases; + + programs = { + home-manager.enable = true; + git = { + enable = true; + package = pkgs.gitAndTools.gitFull; + userEmail = "johannes@joens.email"; + userName = "jopejoe1"; + }; + bash = { + enable = true; + historyFile = "${cfg.xdg.stateHome}/bash/history"; + shellAliases = { + gc = "sudo nix store gc"; + rb = "sudo nix flake update /etc/nixos/ && sudo nixos-rebuild switch"; + }; + }; + zsh.shellAliases = cfg.programs.bash.shellAliases; + fish.shellAbbrs = cfg.programs.bash.shellAliases; + }; }; }