From 6a6fc0dbeab9b9948343e977bc11c6b3d9a59a43 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Fri, 25 Jul 2025 15:42:16 +0530 Subject: [PATCH] feat: Added icons for homepage --- flake.nix | 4 +- home/default.nix | 1 - home/linux/default.nix | 29 ------------ home/programs/default.nix | 28 +++++------ home/programs/ncpamixer.nix | 10 ++++ home/{linux => services}/anyrun.nix | 2 +- home/services/default.nix | 9 +++- home/{linux => services}/device.nix | 0 home/{linux => services}/eww.nix | 0 home/{linux => services}/gtk.nix | 0 home/{linux => services}/gui.nix | 4 +- home/{linux => services}/hyprland.nix | 0 home/{linux => services}/ironbar/default.nix | 0 home/{linux => services}/ironbar/ironbar.css | 0 home/services/kdeconnect.nix | 4 ++ home/services/swaync.nix | 2 +- home/services/swayosd.nix | 2 +- nixos/mirai/services/homepage.nix | 49 ++++++++++++++++++++ nixos/mirai/services/searxng.nix | 41 ++++++++++------ 19 files changed, 119 insertions(+), 66 deletions(-) delete mode 100644 home/linux/default.nix create mode 100644 home/programs/ncpamixer.nix rename home/{linux => services}/anyrun.nix (98%) rename home/{linux => services}/device.nix (100%) rename home/{linux => services}/eww.nix (100%) rename home/{linux => services}/gtk.nix (100%) rename home/{linux => services}/gui.nix (82%) rename home/{linux => services}/hyprland.nix (100%) rename home/{linux => services}/ironbar/default.nix (100%) rename home/{linux => services}/ironbar/ironbar.css (100%) create mode 100644 home/services/kdeconnect.nix diff --git a/flake.nix b/flake.nix index f601801d..b9d5428e 100644 --- a/flake.nix +++ b/flake.nix @@ -261,7 +261,7 @@ }; }; - mkDevice = device: { + mkDevice = device: rec { isLinux = !isNull (builtins.match ".*-linux" device.system); isServer = if (builtins.hasAttr "isServer" device) @@ -273,6 +273,7 @@ else false; isDarwin = !isNull (builtins.match ".*-darwin" device.system); isArm = !isNull (builtins.match "aarch64-.*" device.system); + isDesktopLinux = isLinux && hasGui; hasGui = if (builtins.hasAttr "hasGui" device) then device.hasGui @@ -284,6 +285,7 @@ system = device.system; name = device.name; user = device.user; + is = name: device.name == name; }; nixos_devices = nixpkgs.lib.attrsets.filterAttrs (n: x: x.isNix) devices; diff --git a/home/default.nix b/home/default.nix index c8e1e235..c7347469 100644 --- a/home/default.nix +++ b/home/default.nix @@ -11,7 +11,6 @@ ../modules ./apps ./auth.nix - ./linux ./programs ./scripts.nix ./services diff --git a/home/linux/default.nix b/home/linux/default.nix deleted file mode 100644 index f11ea915..00000000 --- a/home/linux/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - pkgs, - device, - ... -}: let - linux_gui = device.hasGui && pkgs.stdenv.isLinux; -in { - imports = [ - ./hyprland.nix - ./gtk.nix - ./anyrun.nix - ./ironbar - ./gui.nix - ./eww.nix - ]; - - services.kdeconnect.enable = linux_gui; - services.kdeconnect.indicator = linux_gui; - home.packages = with pkgs; - lib.optionals linux_gui [ - ncpamixer - ]; - # services.swayosd.enable = linux_gui; - # services.swaync.enable = linux_gui; - # services.nextcloud-client = { - # enable = device.hasGui; - # startInBackground = true; - # }; -} diff --git a/home/programs/default.nix b/home/programs/default.nix index 1a04f7d9..60ba24f4 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -9,45 +9,45 @@ ./atuin.nix ./bat.nix ./carapace.nix + ./ddcbacklight.nix ./direnv.nix ./eza.nix ./fish.nix ./fzf.nix ./gh.nix ./git.nix - # ./goread.nix - # ./helix.nix ./mpd.nix - # ./newsboat.nix + ./ncpamixer.nix ./nh.nix ./nix-index.nix ./nushell.nix + ./omnix.nix + ./ryujinx.nix ./sops.nix ./ssh.nix ./starship.nix ./tmux.nix ./tuifeed.nix ./yazi.nix - ./zoxide.nix - ./omnix.nix ./yt-dlp.nix - ./ryujinx.nix - ./ddcbacklight.nix - # ./neovim.nix - # ./mpris-scrobbler.nix + ./zoxide.nix + + # ./goread.nix + # ./helix.nix # ./magika.nix + # ./mpris-scrobbler.nix # ./ncmpcpp.nix # ./neomutt.nix + # ./neovim.nix + # ./newsboat.nix + # ./template.nix # ./zellij.nix - #./template.nix ]; home.packages = with pkgs; [ - aria2 - nb - (nixvim.makeNixvim (import ../../neovim)) _1password-cli alejandra + aria2 ast-grep bottom btop @@ -62,6 +62,8 @@ jq just macchina + nb + (nixvim.makeNixvim (import ../../neovim)) p7zip pandoc pfetch-rs diff --git a/home/programs/ncpamixer.nix b/home/programs/ncpamixer.nix new file mode 100644 index 00000000..ec4f69a5 --- /dev/null +++ b/home/programs/ncpamixer.nix @@ -0,0 +1,10 @@ +{ + pkgs, + lib, + device, + ... +}: { + home.packages = lib.optionals (device.is "ryu") [ + pkgs.ncpamixer + ]; +} diff --git a/home/linux/anyrun.nix b/home/services/anyrun.nix similarity index 98% rename from home/linux/anyrun.nix rename to home/services/anyrun.nix index e0c4a54b..1207030b 100644 --- a/home/linux/anyrun.nix +++ b/home/services/anyrun.nix @@ -7,7 +7,7 @@ }: { # imports = [inputs.anyrun.homeManagerModules.default]; programs.anyrun = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.isDesktopLinux; config = { plugins = with inputs.anyrun.packages.${pkgs.system}; [ inputs.anyrun-nixos-options.packages.${pkgs.system}.default diff --git a/home/services/default.nix b/home/services/default.nix index 50adeb98..51dd15b6 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -1,8 +1,13 @@ {...}: { imports = [ - # ./syncthing.nix - # ./command-runner.nix ./swaync.nix ./swayosd.nix + ./kdeconnect.nix + ./hyprland.nix + ./gtk.nix + ./anyrun.nix + ./ironbar + ./gui.nix + ./eww.nix ]; } diff --git a/home/linux/device.nix b/home/services/device.nix similarity index 100% rename from home/linux/device.nix rename to home/services/device.nix diff --git a/home/linux/eww.nix b/home/services/eww.nix similarity index 100% rename from home/linux/eww.nix rename to home/services/eww.nix diff --git a/home/linux/gtk.nix b/home/services/gtk.nix similarity index 100% rename from home/linux/gtk.nix rename to home/services/gtk.nix diff --git a/home/linux/gui.nix b/home/services/gui.nix similarity index 82% rename from home/linux/gui.nix rename to home/services/gui.nix index 8d920e9e..1a9c77ff 100644 --- a/home/linux/gui.nix +++ b/home/services/gui.nix @@ -4,7 +4,7 @@ lib, ... }: { - systemd.user.services.onepassword-gui = lib.optionalAttrs (pkgs.stdenv.isLinux && device.hasGui) { + systemd.user.services.onepassword-gui = lib.optionalAttrs (device.is "ryu") { Unit = { Description = "1Password GUI"; BindsTo = ["graphical-session.target"]; @@ -20,7 +20,7 @@ }; }; home.packages = with pkgs; - lib.optionals (pkgs.stdenv.isLinux && device.hasGui) [ + lib.optionals (device.is "ryu") [ nautilus totem ffmpegthumbnailer diff --git a/home/linux/hyprland.nix b/home/services/hyprland.nix similarity index 100% rename from home/linux/hyprland.nix rename to home/services/hyprland.nix diff --git a/home/linux/ironbar/default.nix b/home/services/ironbar/default.nix similarity index 100% rename from home/linux/ironbar/default.nix rename to home/services/ironbar/default.nix diff --git a/home/linux/ironbar/ironbar.css b/home/services/ironbar/ironbar.css similarity index 100% rename from home/linux/ironbar/ironbar.css rename to home/services/ironbar/ironbar.css diff --git a/home/services/kdeconnect.nix b/home/services/kdeconnect.nix new file mode 100644 index 00000000..d99e89d2 --- /dev/null +++ b/home/services/kdeconnect.nix @@ -0,0 +1,4 @@ +{device, ...}: { + services.kdeconnect.enable = device.is "ryu"; + services.kdeconnect.indicator = device.is "ryu"; +} diff --git a/home/services/swaync.nix b/home/services/swaync.nix index 0b0c49b7..1b5c3a25 100644 --- a/home/services/swaync.nix +++ b/home/services/swaync.nix @@ -1,6 +1,6 @@ {device, ...}: { services.swaync = { - enable = device.name == "ryu"; + enable = device.is "ryu"; settings = { notification-inline-replies = true; cssPriority = "user"; diff --git a/home/services/swayosd.nix b/home/services/swayosd.nix index 64ba225a..1351b3d0 100644 --- a/home/services/swayosd.nix +++ b/home/services/swayosd.nix @@ -1,3 +1,3 @@ {device, ...}: { - services.swayosd.enable = device.name == "ryu"; + services.swayosd.enable = device.is "ryu"; } diff --git a/nixos/mirai/services/homepage.nix b/nixos/mirai/services/homepage.nix index 656858a2..d2f73443 100644 --- a/nixos/mirai/services/homepage.nix +++ b/nixos/mirai/services/homepage.nix @@ -21,48 +21,56 @@ "Tsuba" = [ { "Jellyfin" = { + icon = "jellyfin.png"; description = "Jellyfin Media Server"; href = "https://jellyfin.tsuba.darksailor.dev"; }; } { "Jellyseerr" = { + icon = "jellyseerr.png"; description = "Jellyseerr Media Server"; href = "https://jellyseerr.tsuba.darksailor.dev"; }; } { "Sonarr" = { + icon = "sonarr.png"; description = "Sonarr"; href = "https://sonarr.tsuba.darksailor.dev"; }; } { "Lidarr" = { + icon = "lidarr.png"; description = "Lidarr"; href = "https://lidarr.tsuba.darksailor.dev"; }; } { "Radarr" = { + icon = "radarr.png"; description = "Radarr"; href = "https://radarr.tsuba.darksailor.dev"; }; } { "Deluge" = { + icon = "deluge.png"; description = "Deluge"; href = "https://deluge.tsuba.darksailor.dev"; }; } { "Prowlarr" = { + icon = "prowlarr.png"; description = "Prowlarr"; href = "https://prowlarr.tsuba.darksailor.dev"; }; } { "Home Assistant" = { + icon = "home-assistant.png"; description = "Home Automation"; href = "https://home.darksailor.dev"; }; @@ -73,18 +81,21 @@ "Mirai" = [ { "Gitea" = { + icon = "gitea.png"; description = "Gitea Code Hosting"; href = "https://git.darksailor.dev"; }; } { "Nextcloud" = { + icon = "nextcloud.png"; description = "Nextcloud Suite"; href = "https://cloud.darksailor.dev"; }; } { "Open WebUI" = { + icon = "open-webui.png"; description = "Open WebUI for self hosted llms"; href = "https://llama.darksailor.dev"; }; @@ -92,6 +103,44 @@ ]; } ]; + bookmarks = [ + { + "Nix" = [ + { + "Nixpkgs" = [ + { + abbr = "pkgs"; + href = "https://search.nixos.org/packages?channel=unstable"; + } + ]; + } + { + "NixOS" = [ + { + abbr = "nixos"; + href = "https://search.nixos.org/options?channel=unstable"; + } + ]; + } + { + "Home Manager" = [ + { + abbr = "hm"; + href = "https://home-manager-options.extranix.com"; + } + ]; + } + { + "NixVim" = [ + { + abbr = "nixvim"; + href = "https://nix-community.github.io/nixvim/search"; + } + ]; + } + ]; + } + ]; }; caddy = { virtualHosts."dashboard.darksailor.dev".extraConfig = '' diff --git a/nixos/mirai/services/searxng.nix b/nixos/mirai/services/searxng.nix index 709e57bf..77368b2a 100644 --- a/nixos/mirai/services/searxng.nix +++ b/nixos/mirai/services/searxng.nix @@ -1,20 +1,31 @@ -{config, ...}: { - services.searx = { - enable = true; - # configureUwsgi = true; - # uwsgiConfig = { - # socket = "/run/searx/searx.sock"; - # chmod-socket = "660"; - # }; - settings = { - server = { - port = "8889"; - secret_key = "foobar"; - base_url = "https://search.darksailor.dev"; - }; +{ + config, + pkgs, + ... +}: { + systemd.services.websurfx = { + description = "Websurfx"; + wantedBy = ["multi-user.target"]; + after = ["network.target"]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.websurfx}/bin/websurfx"; + Restart = "always"; + RestartSec = 5; + User = "websurfx"; + Group = "websurfx"; }; }; + users.users.websurfx = { + group = "websurfx"; + home = "/var/lib/websurfx"; + isSystemUser = true; + # uid = config.ids.uids.websurfx; + }; + users.groups.websurfx = { + # gid = config.ids.gids.websurfx; + }; services.caddy.virtualHosts."search.darksailor.dev".extraConfig = '' - reverse_proxy localhost:8889 + reverse_proxy localhost:8080 ''; }