diff --git a/flake.lock b/flake.lock index 66f4bd1..71634b1 100644 --- a/flake.lock +++ b/flake.lock @@ -307,6 +307,21 @@ "type": "github" } }, + "import-tree": { + "locked": { + "lastModified": 1745565707, + "narHash": "sha256-ccFeWWQ9RLgCd1k+xwV/ASUkJ7AGTTaGDhlRWZgytxY=", + "owner": "vic", + "repo": "import-tree", + "rev": "ed504db425c363b13f13d5ca52f1a2600c4a7703", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, "mnw": { "locked": { "lastModified": 1748710831, @@ -511,6 +526,7 @@ "flake-utils-plus": "flake-utils-plus", "home-manager": "home-manager", "impermanence": "impermanence", + "import-tree": "import-tree", "mnw": "mnw", "nil": "nil", "nix-index-database": "nix-index-database", diff --git a/flake.nix b/flake.nix index d24e5cb..fbf13c1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { inputs = { + import-tree.url = "github:vic/import-tree"; rrvsh-nixpkgs.url = "github:rrvsh/nixpkgs/librechat-module"; crane.url = "github:ipetkov/crane"; disko.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/homes/x86_64-linux/rafiq/default.nix b/homes/x86_64-linux/rafiq/default.nix index 1b707c8..8e19cdc 100644 --- a/homes/x86_64-linux/rafiq/default.nix +++ b/homes/x86_64-linux/rafiq/default.nix @@ -3,11 +3,11 @@ inputs, osConfig, lib, - system, ... }: let - inherit (lib) mkMerge mkIf; + inherit (lib) optional; + inherit (inputs) import-tree; mkEmailAccount = address: { inherit address; maildir.path = address; @@ -22,99 +22,65 @@ let host = "smtp.forwardemail.net"; port = 465; }; - thunderbird.enable = true; + thunderbird.enable = osConfig.desktop.enable; }; in { - config = mkMerge [ - (mkIf osConfig.desktop.enable ( - import ./desktop { - inherit - lib - inputs - system - pkgs - osConfig - ; - } - )) - (mkIf osConfig.desktop.enable { - home.persistence."/persist/home/rafiq".directories = [ - "docs" - "repos" - "vids" - "tmp" - ".tor project" - ".local/share/PrismLauncher" - ]; - programs = { - obs-studio.enable = true; - thunderbird.enable = true; - thunderbird.profiles.rafiq.isDefault = true; - }; - home.packages = with pkgs; [ - stremio - tor-browser - prismlauncher - ]; - }) - { - accounts = { - email = { - maildirBasePath = "mail"; - accounts = { - "rafiq@rrv.sh" = { - primary = true; - } // mkEmailAccount "rafiq@rrv.sh"; - "mohammadrafiq@rrv.sh" = mkEmailAccount "mohammadrafiq@rrv.sh"; - }; - }; - }; - cli = { - shell = "zsh"; - finder = "fzf"; - screensaver.enable = true; - screensaver.timeout = "100"; - screensaver.command = "cbonsai -S -w 0.1 -L 40 -M 2 -b 2"; - editor = "nvf"; - file-browser = "yazi"; - multiplexer = "zellij"; - fetch = "hyfetch"; - git.name = "Mohammad Rafiq"; - git.email = "rafiq@rrv.sh"; - git.defaultBranch = "prime"; - }; - home = { - shellAliases = { - v = "nvim"; - e = "edit"; - }; + imports = optional osConfig.desktop.enable (import-tree ./desktop); - packages = with pkgs; [ - cbonsai - ripgrep - devenv - pantheon.rebuild - pantheon.deploy - pantheon.edit - pantheon.commit - pantheon.check - inputs.nixspect.packages."x86_64-linux".nixspect - ]; - - persistence."/persist/home/rafiq".directories = [ - ]; - }; - programs = { - nh.enable = true; - tealdeer.enable = true; - tealdeer.settings.updates.auto_update = true; - pay-respects.enable = true; - direnv = { - enable = true; - nix-direnv.enable = true; + config = { + accounts = { + email = { + maildirBasePath = "mail"; + accounts = { + "rafiq@rrv.sh" = { + primary = true; + } // mkEmailAccount "rafiq@rrv.sh"; + "mohammadrafiq@rrv.sh" = mkEmailAccount "mohammadrafiq@rrv.sh"; }; }; - } - ]; + }; + cli = { + shell = "zsh"; + finder = "fzf"; + screensaver.enable = true; + screensaver.timeout = "100"; + screensaver.command = "cbonsai -S -w 0.1 -L 40 -M 2 -b 2"; + editor = "nvf"; + file-browser = "yazi"; + multiplexer = "zellij"; + fetch = "hyfetch"; + git.name = "Mohammad Rafiq"; + git.email = "rafiq@rrv.sh"; + git.defaultBranch = "prime"; + }; + home = { + shellAliases = { + v = "nvim"; + e = "edit"; + }; + + packages = with pkgs; [ + cbonsai + ripgrep + devenv + pantheon.rebuild + pantheon.deploy + pantheon.edit + pantheon.commit + pantheon.check + inputs.nixspect.packages."x86_64-linux".nixspect + ]; + }; + programs = { + nh.enable = true; + tealdeer.enable = true; + tealdeer.settings.updates.auto_update = true; + pay-respects.enable = true; + direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; + }; } diff --git a/homes/x86_64-linux/rafiq/desktop/browser.nix b/homes/x86_64-linux/rafiq/desktop/browser.nix index e156c8a..7fa9677 100644 --- a/homes/x86_64-linux/rafiq/desktop/browser.nix +++ b/homes/x86_64-linux/rafiq/desktop/browser.nix @@ -2,6 +2,7 @@ lib, inputs, system, + ... }: let inherit (builtins) map listToAttrs; diff --git a/homes/x86_64-linux/rafiq/desktop/default.nix b/homes/x86_64-linux/rafiq/desktop/default.nix deleted file mode 100644 index 5e8befb..0000000 --- a/homes/x86_64-linux/rafiq/desktop/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - pkgs, - lib, - inputs, - system, - osConfig, - ... -}: -let - inherit (lib) mkMerge; -in -mkMerge [ - (import ./browser.nix { inherit lib inputs system; }) - (import ./lockscreen.nix) - (import ./launcher.nix) - (import ./media-player.nix) - (import ./status-bar.nix { inherit pkgs; }) - (import ./terminal.nix) - (import ./window-manager { inherit pkgs osConfig lib; }) -] diff --git a/homes/x86_64-linux/rafiq/desktop/misc.nix b/homes/x86_64-linux/rafiq/desktop/misc.nix new file mode 100644 index 0000000..69dc92c --- /dev/null +++ b/homes/x86_64-linux/rafiq/desktop/misc.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + persistDirs = [ + "docs" + "repos" + "vids" + "tmp" + ".tor project" + ".local/share/PrismLauncher" + ]; + programs = { + obs-studio.enable = true; + thunderbird.enable = true; + thunderbird.profiles.rafiq.isDefault = true; + }; + home.packages = with pkgs; [ + stremio + tor-browser + prismlauncher + ]; +} diff --git a/homes/x86_64-linux/rafiq/desktop/window-manager/hyprland/decoration.nix b/homes/x86_64-linux/rafiq/desktop/window-manager/_hyprland/decoration.nix similarity index 100% rename from homes/x86_64-linux/rafiq/desktop/window-manager/hyprland/decoration.nix rename to homes/x86_64-linux/rafiq/desktop/window-manager/_hyprland/decoration.nix diff --git a/homes/x86_64-linux/rafiq/desktop/window-manager/hyprland/keybinds.nix b/homes/x86_64-linux/rafiq/desktop/window-manager/_hyprland/keybinds.nix similarity index 100% rename from homes/x86_64-linux/rafiq/desktop/window-manager/hyprland/keybinds.nix rename to homes/x86_64-linux/rafiq/desktop/window-manager/_hyprland/keybinds.nix diff --git a/homes/x86_64-linux/rafiq/desktop/window-manager/hyprland/settings.nix b/homes/x86_64-linux/rafiq/desktop/window-manager/_hyprland/settings.nix similarity index 100% rename from homes/x86_64-linux/rafiq/desktop/window-manager/hyprland/settings.nix rename to homes/x86_64-linux/rafiq/desktop/window-manager/_hyprland/settings.nix diff --git a/homes/x86_64-linux/rafiq/desktop/window-manager/default.nix b/homes/x86_64-linux/rafiq/desktop/window-manager/default.nix index 44b9a6f..47d2954 100644 --- a/homes/x86_64-linux/rafiq/desktop/window-manager/default.nix +++ b/homes/x86_64-linux/rafiq/desktop/window-manager/default.nix @@ -5,7 +5,7 @@ ... }: { - wayland.windowManager.hyprland.settings = import ./hyprland/settings.nix { + wayland.windowManager.hyprland.settings = import ./_hyprland/settings.nix { inherit pkgs osConfig lib; }; }