From 6f8c9d78362ad4207a846608da8e82eb0d4d675c Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Sun, 23 Jun 2024 14:19:45 +0200 Subject: [PATCH] Update --- docs/TODO.md | 17 +- home/programs/qutebrowser/default.nix | 91 +++++- .../programs/qutebrowser/homepage/default.nix | 297 ------------------ hosts/server/modules/vaultwarden.nix | 2 +- .../modules/www/home.anotherhadi.com.nix | 10 +- .../modules/www/start.anotherhadi.com.nix | 10 +- hosts/themes/catppuccin.nix | 2 +- 7 files changed, 98 insertions(+), 331 deletions(-) delete mode 100644 home/programs/qutebrowser/homepage/default.nix diff --git a/docs/TODO.md b/docs/TODO.md index 0c6e3c3..d1cc3b8 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -3,21 +3,16 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md)) - [ ] Nixy - - [ ] Nixy script v2 (with nixosConfiguration's name variable) - - [ ] Installation script - - [ ] Themes - - [ ] Upload new wallpapers - - [ ] MacOS theme + - [ ] Installation script + - [ ] Themes + - [ ] Upload new wallpapers + - [ ] MacOS theme - [ ] Hyprland - [ ] Make hyprcursor work - - [ ] Animations based on app name - -- [ ] Homepage (web) v2 - - [ ] Manifest & favicon + - [ ] Animations based on app name (Is it possible?) - [ ] Nixvim - - [ ] Nerdfont pluggins to search and paste in the code - [ ] Telescope shortcut for file content - [ ] Markdown snippets - [ ] Make whichkey better @@ -25,8 +20,6 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md)) - [ ] Backup system for some folders ($home/dev, $home/pictures, ...) - [ ] Exclude file pattern (nodes modules, ...) -- [ ] Nextcloud exclude file pattern (nodes modules, ...) - - [ ] Automount USB Key (And notify-send when it's done) - [ ] Usb security for laptop & server, variable in variables.nix, disable for guest diff --git a/home/programs/qutebrowser/default.nix b/home/programs/qutebrowser/default.nix index 662084c..065a4cd 100644 --- a/home/programs/qutebrowser/default.nix +++ b/home/programs/qutebrowser/default.nix @@ -1,6 +1,78 @@ -{ config, ... }: { +{ pkgs, config, ... }: +let + settings = '' + { + "config": { + "title" : "Welcome Home", + "openLinksInNewTab": false, + "locale": "fr-FR", + "colors": { + "primary": "#${config.var.theme.colors.accent}", + "background": "#${config.var.theme.colors.bg}", + "foreground": "#${config.var.theme.colors.fg}", + "muted": "#${config.var.theme.colors.c8}" + }, + "folders": [ + { + "name": "Bookmarks", + "links": [ + {"title": "Github", "url": "https://github.com", "icon": ""}, + {"title": "Proton", "url": "https://mail.proton.me/u/0/inbox", "icon": ""}, + {"title": "Cloudflare One", "url": "https://one.dash.cloudflare.com/", "icon": ""}, + {"title": "Chat GPT", "url": "https://chat.openai.com/", "icon": "󰭹"}, + {"title": "Nixvim", "url": "https://nix-community.github.io/nixvim/", "icon": ""}, + {"title": "Hyprland Wiki", "url": "https://wiki.hyprland.org/", "icon": "󰖬"}, + {"title": "Nerdfont", "url": "https://www.nerdfonts.com/cheat-sheet", "icon": ""}, + {"title": "Youtube", "url": "https://youtube.com", "icon": "󰗃"}, + {"title": "Server", "url": "https://home.anotherhadi.com", "icon": ""} + ] + }, + { + "name": "Work", + "links": [ + {"title": "Outlook", "url": "https://outlook.office.com/mail/", "icon": "󰴢"}, + {"title": "Office", "url": "https://www.office.com/?auth=2", "icon": "󰏆"}, + {"title": "Teams", "url": "https://teams.microsoft.com/_", "icon": "󰊻"} + ] + } + ] + } + } + ''; - imports = [ ./duckduckgo-colorscheme.nix ./homepage ]; + homepage = pkgs.buildNpmPackage { + pname = "homepage"; + version = "0.0.0"; + + src = pkgs.fetchFromGitHub { + owner = "anotherhadi"; + repo = "homepage"; + rev = "19f56771ae7ac04e2710cbde763f70bb097eb250"; + hash = "sha256-8IzXcQ/hm2ZDzFKUL4B3501PoWoEOiKIN7rP2UrvG84="; + }; + + # npmDepsHash = lib.fakeHash; + npmDepsHash = "sha256-bG+CHTq2Rst3JMxsjAC81KhK+G7WwsTVD1eyP87g0z4="; + + buildPhase = '' + npm install + cp ${ + pkgs.writeText "src/routes/config.json" settings + } src/routes/config.json + npm run build + mkdir $out + mv build $out + ''; + + meta = { + description = "homepage"; + homepage = "https://github.com/anotherhadi/homepage"; + }; + }; + +in { + + imports = [ ./duckduckgo-colorscheme.nix ]; programs.qutebrowser = { enable = true; @@ -18,8 +90,9 @@ }; quickmarks = { - home = "${config.var.homeDirectory}/.config/startpage/index.html"; - server = "${config.var.homeDirectory}/.config/serverpage/index.html"; + home = "${homepage}/build/index.html"; + server = "https://home.anotherhadi.com"; + jack = "https://home.anotherhadi.com"; mynixos = "https://mynixos.com"; github = "https://github.com"; outlook = "https://outlook.office.com/mail/"; @@ -38,10 +111,8 @@ settings = { url = { - default_page = - "${config.var.homeDirectory}/.config/startpage/index.html"; - start_pages = - [ "${config.var.homeDirectory}/.config/startpage/index.html" ]; + default_page = "${homepage}/build/index.html"; + start_pages = [ "${homepage}/build/index.html" ]; }; colors = { @@ -184,8 +255,8 @@ keyBindings = { normal = { - "gh" = "open ${config.var.homeDirectory}/.config/startpage/index.html"; - "gs" = "open ${config.var.homeDirectory}/.config/serverpage/index.html"; + "gh" = "open ${homepage}/build/index.html"; + "gs" = "open https://home.anotherhadi.com"; " p" = "tab-move -"; " n" = "tab-move +"; diff --git a/home/programs/qutebrowser/homepage/default.nix b/home/programs/qutebrowser/homepage/default.nix deleted file mode 100644 index ad35042..0000000 --- a/home/programs/qutebrowser/homepage/default.nix +++ /dev/null @@ -1,297 +0,0 @@ -{ config, ... }: -let - bookmarks = '' - Bookmarks: [ - {text: "MyNixOs", url: "https://mynixos.com", icon: "󱄅"}, - {text: "Github", url: "https://github.com", icon: ""}, - {text: "Proton", url: "https://mail.proton.me/u/0/inbox", icon: ""}, - {text: "Cloudflare One", url: "https://one.dash.cloudflare.com/", icon: ""}, - {text: "Chat GPT", url: "https://chat.openai.com/", icon: "󰭹"}, - {text: "Nixvim", url: "https://nix-community.github.io/nixvim/", icon: ""}, - {text: "Hyprland Wiki", url: "https://wiki.hyprland.org/", icon: "󰖬"}, - {text: "Nerdfont", url: "https://www.nerdfonts.com/cheat-sheet", icon: ""}, - {text: "Youtube", url: "https://youtube.com", icon: "󰗃"}, - ], - Home: [ - {text: "Casa", url: "http://192.168.2.16:8081/#/", icon: "󰋜"}, - {text: "Plex", url: "http://192.168.2.16:32400", icon: "󰚺"}, - {text: "Nextcloud", url: "http://192.168.2.16:10081", icon: ""}, - ], - Work: [ - {text: "Outlook", url: "https://outlook.office.com/mail/", icon: "󰴢"}, - {text: "Office", url: "https://www.office.com/?auth=2", icon: "󰏆"}, - {text: "Teams", url: "https://teams.microsoft.com/_", icon: "󰊻"}, - ], - ''; -in { - - xdg.configFile."startpage/index.html".text = '' - - - - - - - Homepage - - - - -
-
-

-

-
-
-

-
- -
- - - - - ''; -} diff --git a/hosts/server/modules/vaultwarden.nix b/hosts/server/modules/vaultwarden.nix index 9ca0c3c..d823e3a 100644 --- a/hosts/server/modules/vaultwarden.nix +++ b/hosts/server/modules/vaultwarden.nix @@ -8,7 +8,7 @@ in { enable = true; config = { DOMAIN = url; - SIGNUPS_ALLOWED = false; + SIGNUPS_ALLOWED = true; ROCKET_ADDRESS = "127.0.0.1"; ROCKET_PORT = port; ROCKET_LOG = "critical"; diff --git a/hosts/server/modules/www/home.anotherhadi.com.nix b/hosts/server/modules/www/home.anotherhadi.com.nix index 73e0a3f..8cd9489 100644 --- a/hosts/server/modules/www/home.anotherhadi.com.nix +++ b/hosts/server/modules/www/home.anotherhadi.com.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, config, ... }: let settings = '' { @@ -7,10 +7,10 @@ let "openLinksInNewTab": false, "locale": "fr-FR", "colors": { - "primary": "#89b4fa", - "background": "#01010b", - "foreground": "#cdd6f4", - "muted": "#313244" + "primary": "#${config.var.theme.colors.accent}", + "background": "#${config.var.theme.colors.bg}", + "foreground": "#${config.var.theme.colors.fg}", + "muted": "#${config.var.theme.colors.c8}" }, "folders": [ { diff --git a/hosts/server/modules/www/start.anotherhadi.com.nix b/hosts/server/modules/www/start.anotherhadi.com.nix index 6c8a260..571faf8 100644 --- a/hosts/server/modules/www/start.anotherhadi.com.nix +++ b/hosts/server/modules/www/start.anotherhadi.com.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, config, ... }: let settings = '' { @@ -7,10 +7,10 @@ let "openLinksInNewTab": false, "locale": "fr-FR", "colors": { - "primary": "#89b4fa", - "background": "#01010b", - "foreground": "#cdd6f4", - "muted": "#313244" + "primary": "#${config.var.theme.colors.accent}", + "background": "#${config.var.theme.colors.bg}", + "foreground": "#${config.var.theme.colors.fg}", + "muted": "#${config.var.theme.colors.c8}" }, "folders": [ { diff --git a/hosts/themes/catppuccin.nix b/hosts/themes/catppuccin.nix index c70659e..d06f329 100644 --- a/hosts/themes/catppuccin.nix +++ b/hosts/themes/catppuccin.nix @@ -10,7 +10,7 @@ gaps-out = 15 * 2; border-size = 5; animation-speed = "medium"; # "fast" | "medium" | "slow" - fetch = "neofetch"; # "nerdfetch" | "neofetch" | "pfetch" | "none" + fetch = "none"; # "nerdfetch" | "neofetch" | "pfetch" | "none" waybar = { transparent = true;