mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-07-06 16:12:33 +02:00
from qutebrowser to helium..
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,459 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
bookmarkList =
|
||||
(import ./general.nix)
|
||||
++ (import ./tools.nix)
|
||||
++ (import ./entertainment.nix)
|
||||
++ (import ./infosec.nix)
|
||||
++ (import ./other.nix)
|
||||
++ (import ./jack.nix);
|
||||
|
||||
c = config.lib.stylix.colors;
|
||||
|
||||
stripProtocol = url: lib.removePrefix "https://" (lib.removePrefix "http://" url);
|
||||
stripDomain = url: builtins.head (lib.splitString "/" (stripProtocol url));
|
||||
|
||||
mkCard = item: let
|
||||
domain = stripDomain item.url;
|
||||
initial = builtins.substring 0 1 item.name;
|
||||
in ''
|
||||
<a href="${item.url}" class="card">
|
||||
<div class="favicon-wrapper">
|
||||
<img class="favicon" src="https://icons.duckduckgo.com/ip3/${domain}.ico" alt="" aria-hidden="true" loading="lazy" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'">
|
||||
<span class="favicon-fallback" style="display:none">${initial}</span>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<span class="card-name">${item.name}</span>
|
||||
<span class="card-url">${stripProtocol item.url}</span>
|
||||
</div>
|
||||
</a>'';
|
||||
|
||||
mkFolderContent = items: let
|
||||
step = acc: item:
|
||||
if item ? url
|
||||
then acc // {pending = acc.pending ++ [item];}
|
||||
else {
|
||||
chunks =
|
||||
acc.chunks
|
||||
++ lib.optional (acc.pending != []) {
|
||||
isCards = true;
|
||||
items = acc.pending;
|
||||
}
|
||||
++ [
|
||||
{
|
||||
isCards = false;
|
||||
folder = item;
|
||||
}
|
||||
];
|
||||
pending = [];
|
||||
};
|
||||
result =
|
||||
lib.foldl' step {
|
||||
chunks = [];
|
||||
pending = [];
|
||||
}
|
||||
items;
|
||||
chunks =
|
||||
result.chunks
|
||||
++ lib.optional (result.pending != []) {
|
||||
isCards = true;
|
||||
items = result.pending;
|
||||
};
|
||||
in
|
||||
lib.concatMapStrings (
|
||||
chunk:
|
||||
if chunk.isCards
|
||||
then ''
|
||||
<div class="cards">
|
||||
${lib.concatMapStrings mkCard chunk.items}
|
||||
</div>''
|
||||
else mkFolder chunk.folder
|
||||
)
|
||||
chunks;
|
||||
|
||||
mkFolder = folder: let
|
||||
iconHtml =
|
||||
if folder ? icon
|
||||
then ''<span class="material-symbols-outlined folder-icon" aria-hidden="true">${folder.icon}</span>''
|
||||
else "";
|
||||
in ''
|
||||
<details class="folder-section" open>
|
||||
<summary class="folder-title">
|
||||
${iconHtml}<span class="folder-name">${folder.name}</span>
|
||||
<svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
|
||||
</summary>
|
||||
<div class="folder-content">
|
||||
${mkFolderContent folder.bookmarks}
|
||||
</div>
|
||||
</details>'';
|
||||
|
||||
grouped = let
|
||||
step = acc: item:
|
||||
if item ? url
|
||||
then acc // {pending = acc.pending ++ [item];}
|
||||
else {
|
||||
groups =
|
||||
acc.groups
|
||||
++ lib.optional (acc.pending != []) {
|
||||
isRoot = true;
|
||||
items = acc.pending;
|
||||
}
|
||||
++ [
|
||||
{
|
||||
isRoot = false;
|
||||
inherit item;
|
||||
}
|
||||
];
|
||||
pending = [];
|
||||
};
|
||||
result =
|
||||
lib.foldl' step {
|
||||
groups = [];
|
||||
pending = [];
|
||||
}
|
||||
bookmarkList;
|
||||
in
|
||||
result.groups
|
||||
++ lib.optional (result.pending != []) {
|
||||
isRoot = true;
|
||||
items = result.pending;
|
||||
};
|
||||
|
||||
mkSection = group:
|
||||
if group.isRoot
|
||||
then ''
|
||||
<div class="root-section">
|
||||
<div class="cards">
|
||||
${lib.concatMapStrings mkCard group.items}
|
||||
</div>
|
||||
</div>''
|
||||
else mkFolder group.item;
|
||||
in {
|
||||
home.file.".local/share/helium-startpage/index.html".text = ''
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Bookmarks</title>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20,300,0,0">
|
||||
<style>
|
||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
background-color: #${c.base00};
|
||||
color: #${c.base05};
|
||||
font-family: 'Source Sans Pro', sans-serif;
|
||||
font-size: 14px;
|
||||
min-height: 100vh;
|
||||
padding: 2.5rem 2rem;
|
||||
}
|
||||
|
||||
.header {
|
||||
max-width: 1100px;
|
||||
margin: 0 auto 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 1.3rem;
|
||||
font-weight: 700;
|
||||
color: #${c.base0D};
|
||||
letter-spacing: -0.01em;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
flex: 1;
|
||||
background-color: #${c.base01};
|
||||
border: 1px solid #${c.base02};
|
||||
border-radius: 8px;
|
||||
color: #${c.base05};
|
||||
font-family: 'Source Sans Pro', sans-serif;
|
||||
font-size: 0.9rem;
|
||||
padding: 0.5rem 0.9rem;
|
||||
outline: none;
|
||||
transition: border-color 0.15s ease;
|
||||
}
|
||||
|
||||
.search-bar::placeholder { color: #${c.base03}; }
|
||||
.search-bar:focus { border-color: #${c.base0D}; }
|
||||
|
||||
.collapse-btn {
|
||||
flex-shrink: 0;
|
||||
background: none;
|
||||
border: 1px solid #${c.base02};
|
||||
border-radius: 8px;
|
||||
color: #${c.base03};
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.47rem;
|
||||
transition: color 0.15s ease, border-color 0.15s ease;
|
||||
}
|
||||
|
||||
.collapse-btn:hover {
|
||||
color: #${c.base0D};
|
||||
border-color: #${c.base0D};
|
||||
}
|
||||
|
||||
.collapse-btn svg { width: 16px; height: 16px; }
|
||||
|
||||
.bookmarks-container {
|
||||
max-width: 1100px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.root-section { margin-bottom: 1rem; }
|
||||
|
||||
details.folder-section { border-radius: 8px; }
|
||||
|
||||
details.folder-section > summary {
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.45rem 0.5rem;
|
||||
border-radius: 8px;
|
||||
user-select: none;
|
||||
transition: background-color 0.12s ease;
|
||||
}
|
||||
|
||||
details.folder-section > summary::-webkit-details-marker { display: none; }
|
||||
|
||||
details.folder-section > summary:hover {
|
||||
background-color: #${c.base01};
|
||||
color: #${c.base0D};
|
||||
}
|
||||
|
||||
details.folder-section > summary:hover .folder-name { color: #${c.base0D}; }
|
||||
details.folder-section > summary:hover .folder-icon { color: #${c.base0D}; }
|
||||
|
||||
.folder-icon {
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
color: #${c.base04};
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.folder-name {
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
color: #${c.base03};
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.chevron {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
color: #${c.base03};
|
||||
transition: transform 0.2s ease;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
details[open] > summary > .chevron { transform: rotate(180deg); }
|
||||
|
||||
.folder-content {
|
||||
padding: 0.4rem 0 0.5rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.folder-content > details.folder-section > summary { padding-left: 1.2rem; }
|
||||
.folder-content > details.folder-section > .folder-content { padding-left: 1rem; }
|
||||
|
||||
.cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.7rem;
|
||||
padding: 0.6rem 0.8rem;
|
||||
background-color: #${c.base01};
|
||||
border: 1px solid #${c.base02};
|
||||
border-radius: 10px;
|
||||
text-decoration: none;
|
||||
transition: background-color 0.12s ease, border-color 0.12s ease;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
background-color: #${c.base02};
|
||||
border-color: #${c.base0D};
|
||||
}
|
||||
|
||||
.favicon-wrapper { position: relative; width: 18px; height: 18px; flex-shrink: 0; }
|
||||
|
||||
.favicon {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.favicon-fallback {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #${c.base02};
|
||||
border-radius: 4px;
|
||||
color: #${c.base04};
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.05rem;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.card-name {
|
||||
color: #${c.base05};
|
||||
font-size: 0.86rem;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
transition: color 0.12s ease;
|
||||
}
|
||||
|
||||
.card:hover .card-name { color: #${c.base0D}; }
|
||||
|
||||
.card-url {
|
||||
color: #${c.base03};
|
||||
font-family: 'Maple Mono NF', monospace;
|
||||
font-size: 0.7rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.no-results {
|
||||
color: #${c.base03};
|
||||
font-size: 0.9rem;
|
||||
padding: 0.5rem 0.2rem;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1 class="page-title">Bookmarks</h1>
|
||||
<input id="search" class="search-bar" type="text" placeholder="Search…" autocomplete="off" spellcheck="false">
|
||||
<button id="collapse-btn" class="collapse-btn" title="Collapse all folders" aria-label="Collapse all folders">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="10" y1="14" x2="3" y2="21"/><line x1="21" y1="3" x2="14" y2="10"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="bookmarks-container">
|
||||
<p id="no-results" class="no-results">No results</p>
|
||||
${lib.concatMapStrings mkSection grouped}
|
||||
</div>
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
const input = document.getElementById('search');
|
||||
const noResults = document.getElementById('no-results');
|
||||
const collapseBtn = document.getElementById('collapse-btn');
|
||||
|
||||
input.focus();
|
||||
|
||||
collapseBtn.addEventListener('click', function () {
|
||||
document.querySelectorAll('details.folder-section').forEach(function (d) {
|
||||
d.open = false;
|
||||
});
|
||||
});
|
||||
|
||||
input.addEventListener('input', function () {
|
||||
const query = this.value.toLowerCase().trim();
|
||||
let anyVisible = false;
|
||||
|
||||
if (query) {
|
||||
document.querySelectorAll('details.folder-section').forEach(function (d) {
|
||||
d.open = true;
|
||||
});
|
||||
}
|
||||
|
||||
document.querySelectorAll('.folder-section, .root-section').forEach(function (section) {
|
||||
let sectionVisible = false;
|
||||
section.querySelectorAll('.card').forEach(function (card) {
|
||||
const name = card.querySelector('.card-name').textContent.toLowerCase();
|
||||
const url = card.querySelector('.card-url').textContent.toLowerCase();
|
||||
const match = !query || name.includes(query) || url.includes(query);
|
||||
card.style.display = match ? ''' : 'none';
|
||||
if (match) { sectionVisible = true; anyVisible = true; }
|
||||
});
|
||||
section.style.display = sectionVisible ? ''' : 'none';
|
||||
});
|
||||
|
||||
noResults.style.display = anyVisible || !query ? 'none' : 'block';
|
||||
});
|
||||
|
||||
input.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
const val = this.value.trim();
|
||||
const isUrl = /^https?:\/\//i.test(val) || /^[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})(\/.*)?$/.test(val);
|
||||
if (isUrl) {
|
||||
location.href = /^https?:\/\//i.test(val) ? val : 'https://' + val;
|
||||
} else {
|
||||
const first = document.querySelector('.card:not([style*="none"])');
|
||||
if (first) {
|
||||
location.href = first.href;
|
||||
} else {
|
||||
const q = encodeURIComponent(val);
|
||||
if (q) location.href = 'https://duckduckgo.com/?q=' + q;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.key === 'Escape') {
|
||||
this.value = ''';
|
||||
this.dispatchEvent(new Event('input'));
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
'';
|
||||
|
||||
systemd.user.services.helium-startpage = {
|
||||
Unit = {
|
||||
Description = "Helium startpage HTTP server";
|
||||
After = ["network.target"];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.darkhttpd}/bin/darkhttpd %h/.local/share/helium-startpage --port 8888 --addr 127.0.0.1 --no-listing";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
Install.WantedBy = ["default.target"];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
[
|
||||
{
|
||||
name = "Entertainment";
|
||||
icon = "movie";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Youtube";
|
||||
url = "https://youtube.com";
|
||||
}
|
||||
{
|
||||
name = "Jellyfin";
|
||||
url = "https://media.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Seerr";
|
||||
url = "https://demandemedia.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Social Media";
|
||||
icon = "group";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Medium";
|
||||
url = "https://medium.com";
|
||||
}
|
||||
{
|
||||
name = "Bluesky";
|
||||
url = "https://bsky.app";
|
||||
}
|
||||
{
|
||||
name = "Reddit";
|
||||
url = "https://reddit.com";
|
||||
}
|
||||
{
|
||||
name = "Instagram";
|
||||
url = "https://instagram.com";
|
||||
}
|
||||
{
|
||||
name = "Discord";
|
||||
url = "https://discord.com/channels/@me/";
|
||||
}
|
||||
{
|
||||
name = "Gitlab";
|
||||
url = "https://gitlab.com/";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
name = "Proton Mail";
|
||||
url = "https://mail.proton.me";
|
||||
}
|
||||
{
|
||||
name = "Proton Drive";
|
||||
url = "https://drive.proton.me";
|
||||
}
|
||||
{
|
||||
name = "Github";
|
||||
url = "https://github.com";
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,48 @@
|
||||
[
|
||||
{
|
||||
name = "Infosec";
|
||||
icon = "terminal";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Nix 4 Cyber";
|
||||
url = "https://n4c.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Cyberchef";
|
||||
url = "https://cyberchef.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "TryHackMe";
|
||||
url = "https://tryhackme.com";
|
||||
}
|
||||
{
|
||||
name = "Root-Me";
|
||||
url = "https://root-me.org";
|
||||
}
|
||||
{
|
||||
name = "Hack The Box";
|
||||
url = "https://hackthebox.com";
|
||||
}
|
||||
{
|
||||
name = "Iknowyou";
|
||||
url = "https://iknowyou-prod.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Exploit-DB";
|
||||
url = "https://exploit-db.com";
|
||||
}
|
||||
{
|
||||
name = "GTFOBins";
|
||||
url = "https://gtfobins.org/";
|
||||
}
|
||||
{
|
||||
name = "Crack Station";
|
||||
url = "https://crackstation.net";
|
||||
}
|
||||
{
|
||||
name = "Osint Tracker";
|
||||
url = "https://app.osintracker.com";
|
||||
}
|
||||
];
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,80 @@
|
||||
[
|
||||
{
|
||||
name = "Jack";
|
||||
icon = "dns";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Glance";
|
||||
url = "https://home.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Blog";
|
||||
url = "https://hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Gitea";
|
||||
url = "https://git.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Mealie";
|
||||
url = "https://mealie.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Wallpapers";
|
||||
url = "https://wallpapers.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Default Creds";
|
||||
url = "https://default-creds.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Media";
|
||||
icon = "subscriptions";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Radarr";
|
||||
url = "https://radarr.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Sonarr";
|
||||
url = "https://sonarr.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Bazarr";
|
||||
url = "https://bazarr.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Prowlarr";
|
||||
url = "https://prowlarr.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Transmission";
|
||||
url = "https://transmission.hadi.icu";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
name = "Infrastructure";
|
||||
icon = "construction";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "AdGuard";
|
||||
url = "https://adguard.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Umami";
|
||||
url = "https://umami.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Cloudflare";
|
||||
url = "https://dash.cloudflare.com";
|
||||
}
|
||||
{
|
||||
name = "Cloudflare Zero Trust";
|
||||
url = "https://one.dash.cloudflare.com";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,46 @@
|
||||
[
|
||||
{
|
||||
name = "Other";
|
||||
icon = "category";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Documentation";
|
||||
icon = "menu_book";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Hyprland Wiki";
|
||||
url = "https://wiki.hypr.land";
|
||||
}
|
||||
{
|
||||
name = "Stylix Wiki";
|
||||
url = "https://nix-community.github.io/stylix/";
|
||||
}
|
||||
{
|
||||
name = "Nixpkgs";
|
||||
url = "https://github.com/NixOS/nixpkgs";
|
||||
}
|
||||
{
|
||||
name = "tldr";
|
||||
url = "https://tldr.inbrowser.app/";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
name = "Startpage Config";
|
||||
url = "https://www.startpage.com/do/mypage.pl?prfe=45d331deb05471d659dba933e7400df51d952bb103da6f6125c0e769a6be1d65610456a479f495ceeee7e97311cf227d7c1bb198de0ceeb193d8cddf9c455c19a409cc35c3e3f542ee27bd7cecd3";
|
||||
}
|
||||
{
|
||||
name = "Feedly";
|
||||
url = "https://feedly.com";
|
||||
}
|
||||
{
|
||||
name = "MyNixOS";
|
||||
url = "https://mynixos.com";
|
||||
}
|
||||
{
|
||||
name = "Amazon";
|
||||
url = "https://amazon.fr";
|
||||
}
|
||||
];
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,48 @@
|
||||
[
|
||||
{
|
||||
name = "Tools";
|
||||
icon = "handyman";
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Maps";
|
||||
url = "https://maps.apple.com";
|
||||
}
|
||||
{
|
||||
name = "Excalidraw";
|
||||
url = "https://excalidraw.com";
|
||||
}
|
||||
{
|
||||
name = "Cobalt (downloader)";
|
||||
url = "https://cobalt.meowing.de";
|
||||
}
|
||||
{
|
||||
name = "Mazanoke (image)";
|
||||
url = "https://mazanoke.hadi.icu";
|
||||
}
|
||||
{
|
||||
name = "Vert";
|
||||
url = "https://vert.sh";
|
||||
}
|
||||
{
|
||||
name = "Markdown to PDF";
|
||||
url = "https://md2file.com";
|
||||
}
|
||||
{
|
||||
name = "Image to Vector";
|
||||
url = "https://www.vectorcascade.com/";
|
||||
}
|
||||
{
|
||||
name = "PrivateBin";
|
||||
url = "https://privatebin.net";
|
||||
}
|
||||
{
|
||||
name = "Claude";
|
||||
url = "https://claude.ai";
|
||||
}
|
||||
{
|
||||
name = "Gemini";
|
||||
url = "https://gemini.google.com";
|
||||
}
|
||||
];
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,142 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
c = config.lib.stylix.colors;
|
||||
rgb = base: map lib.strings.toInt [c."${base}-rgb-r" c."${base}-rgb-g" c."${base}-rgb-b"];
|
||||
|
||||
themeId = "abcadngacjlikcpkhleafekcdjmddegk";
|
||||
themeKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6t46VoE3mdV1QNMgybpmQLi5PtYHejnNrSj4DkBZyiTzMzs7Yyvg64f78w3QubZA5cTXSQ7FVhVHvv30I8ym/jNzsSN6reh1t4PtKsFjFRugAty8bfKJGD404HZLOFN2z3G9UPVLBBgzDH3DWbb/kcOq60Mlo/QDCIjsieZg0G3EYMl4efoThzYPWoyv0UEoiliwrE/AChxbgipQetUZ48bFhTCsmnYzCze7clssfTobzWtJJG0qFx76LauHKymRS5OTFfgsovKqHUSFJ202Q53vFdUPP/j8PjSPr1kZeg1NYc7Ba3MoA49EwtJf5ol9oYu05EEnSQ5+1AoYVmdE8QIDAQAB";
|
||||
|
||||
themeManifest = builtins.toJSON {
|
||||
manifest_version = 2;
|
||||
name = "Stylix Theme";
|
||||
version = "1.0";
|
||||
key = themeKey;
|
||||
theme.colors = {
|
||||
frame = rgb "base00";
|
||||
frame_inactive = rgb "base00";
|
||||
frame_incognito = rgb "base00";
|
||||
frame_incognito_inactive = rgb "base00";
|
||||
toolbar = rgb "base00";
|
||||
toolbar_button_icon = rgb "base05";
|
||||
control_background = rgb "base00";
|
||||
tab_text = rgb "base0D";
|
||||
background_tab = rgb "base00";
|
||||
tab_background_text = rgb "base04";
|
||||
tab_background_text_inactive = rgb "base04";
|
||||
ntp_background = rgb "base00";
|
||||
ntp_text = rgb "base05";
|
||||
};
|
||||
};
|
||||
|
||||
heliumFlags = [
|
||||
"--enable-features=UseOzonePlatform"
|
||||
"--ozone-platform=wayland"
|
||||
"--enable-accelerated-video-decode"
|
||||
"--enable-gpu-rasterization"
|
||||
"--enable-zero-copy"
|
||||
"--ignore-gpu-blocklist"
|
||||
"--enable-features=VaapiVideoDecoder"
|
||||
"--enable-features=VaapiVideoEncoder"
|
||||
"--enable-features=CanvasOopRasterization"
|
||||
"--disable-features=UseChromeOSDirectVideoDecoder"
|
||||
"--no-default-browser-check"
|
||||
"--show-avatar-button=never"
|
||||
"--disable-features=WaylandWpColorManagerV1"
|
||||
];
|
||||
|
||||
originalPkg = (inputs.helium-browser.packages.${pkgs.stdenv.hostPlatform.system}.helium).override {
|
||||
flags = heliumFlags;
|
||||
};
|
||||
|
||||
patchScript = pkgs.writeShellScript "helium-patch-prefs" ''
|
||||
PROFILE="$HOME/.config/net.imput.helium/Default"
|
||||
THEME_DIR="$PROFILE/Extensions/${themeId}/1.0_0"
|
||||
PREFS="$PROFILE/Preferences"
|
||||
|
||||
mkdir -p "$THEME_DIR"
|
||||
rm -f "$THEME_DIR/Cached Theme.pak"
|
||||
printf '%s' '${themeManifest}' > "$THEME_DIR/manifest.json"
|
||||
|
||||
if [ -f "$PREFS" ]; then
|
||||
tmp=$(mktemp)
|
||||
${lib.getExe pkgs.jq} \
|
||||
--arg id "${themeId}" \
|
||||
--slurpfile manifest "$THEME_DIR/manifest.json" \
|
||||
'
|
||||
.helium.browser.layout = 3 |
|
||||
.helium.browser.minimal_location_bar = true |
|
||||
.helium.browser.show_dynamic_new_tab_button = false |
|
||||
.bookmark_bar.show_tab_groups = false |
|
||||
.extensions.settings[$id] = {
|
||||
"active_permissions": {"api": [], "explicit_host": [], "manifest_permissions": [], "scriptable_host": []},
|
||||
"creation_flags": 0,
|
||||
"from_webstore": false,
|
||||
"install_time": "13300000000000000",
|
||||
"location": 1,
|
||||
"manifest": $manifest[0],
|
||||
"path": ($id + "/1.0_0"),
|
||||
"state": 1,
|
||||
"was_installed_by_default": false,
|
||||
"was_installed_by_oem": false
|
||||
} |
|
||||
.extensions.theme = {"id": $id, "use_system": false}
|
||||
' "$PREFS" > "$tmp" && mv "$tmp" "$PREFS"
|
||||
fi
|
||||
'';
|
||||
|
||||
baseWrapped = pkgs.symlinkJoin {
|
||||
name = "helium-wrapped";
|
||||
paths = [originalPkg];
|
||||
nativeBuildInputs = [pkgs.makeWrapper];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/helium \
|
||||
--run ${lib.escapeShellArg (toString patchScript)}
|
||||
'';
|
||||
};
|
||||
|
||||
wrappedPkg = baseWrapped // {override = _: baseWrapped;};
|
||||
in {
|
||||
imports = [
|
||||
inputs.helium-browser.homeModules.default
|
||||
./bookmarks
|
||||
];
|
||||
|
||||
programs.helium = {
|
||||
enable = true;
|
||||
package = lib.mkForce wrappedPkg;
|
||||
};
|
||||
|
||||
home.sessionVariables.BROWSER = "${config.programs.helium.package}/bin/helium";
|
||||
|
||||
xdg.desktopEntries.helium = {
|
||||
name = "Helium";
|
||||
genericName = "Navigateur Web";
|
||||
exec = "${config.programs.helium.package}/bin/helium %U";
|
||||
icon = "${config.programs.helium.package}/share/icons/hicolor/256x256/apps/helium.png";
|
||||
terminal = false;
|
||||
categories = ["Network" "WebBrowser"];
|
||||
mimeType = [
|
||||
"text/html"
|
||||
"text/xml"
|
||||
"application/xhtml+xml"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
"x-scheme-handler/ftp"
|
||||
];
|
||||
};
|
||||
|
||||
xdg.desktopEntries.helium-private = {
|
||||
name = "Helium (Private window)";
|
||||
genericName = "Navigateur Web";
|
||||
exec = "${config.programs.helium.package}/bin/helium --incognito %U";
|
||||
icon = "${config.programs.helium.package}/share/icons/hicolor/256x256/apps/helium.png";
|
||||
terminal = false;
|
||||
categories = ["Network" "WebBrowser"];
|
||||
mimeType = ["text/html" "text/xml" "application/xhtml+xml"];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{...}: let
|
||||
bookmarkList =
|
||||
(import ./bookmarks/general.nix)
|
||||
++ (import ./bookmarks/tools.nix)
|
||||
++ (import ./bookmarks/entertainment.nix)
|
||||
++ (import ./bookmarks/infosec.nix)
|
||||
++ (import ./bookmarks/other.nix)
|
||||
++ (import ./bookmarks/jack.nix);
|
||||
|
||||
toChromium = items:
|
||||
map (item:
|
||||
if item ? url
|
||||
then {inherit (item) name url;}
|
||||
else {
|
||||
name = item.name;
|
||||
children = toChromium item.bookmarks;
|
||||
})
|
||||
items;
|
||||
in {
|
||||
stylix.targets.chromium.enable = false;
|
||||
|
||||
programs.helium = {
|
||||
enable = true;
|
||||
|
||||
policies = {
|
||||
BrowserSignin = 0;
|
||||
SyncDisabled = true;
|
||||
SigninAllowed = false;
|
||||
|
||||
PasswordManagerEnabled = false;
|
||||
AutofillAddressEnabled = false;
|
||||
AutofillCreditCardEnabled = false;
|
||||
SafeBrowsingEnabled = false;
|
||||
MetricsReportingEnabled = false;
|
||||
SpellCheckServiceEnabled = false;
|
||||
DefaultCookiesSetting = 4;
|
||||
DefaultGeolocationSetting = 2;
|
||||
DefaultNotificationsSetting = 2;
|
||||
DefaultPopupsSetting = 2;
|
||||
|
||||
DefaultBrowserSettingEnabled = false;
|
||||
DeveloperToolsAvailability = 1;
|
||||
|
||||
DnsOverHttpsMode = "secure";
|
||||
DnsOverHttpsTemplates = "https://dns.quad9.net/dns-query";
|
||||
|
||||
DefaultSearchProviderEnabled = true;
|
||||
DefaultSearchProviderName = "Startpage";
|
||||
DefaultSearchProviderSearchURL = "https://www.startpage.com/do/search?q={searchTerms}";
|
||||
DefaultSearchProviderSuggestURL = "https://www.startpage.com/do/suggest?q={searchTerms}";
|
||||
|
||||
NewTabPageLocation = "http://127.0.0.1:8888";
|
||||
HomepageIsNewTabPage = false;
|
||||
HomepageLocation = "http://127.0.0.1:8888";
|
||||
ShowHomeButton = false;
|
||||
RestoreOnStartup = 4;
|
||||
|
||||
BookmarkBarEnabled = false;
|
||||
ManagedBookmarks = toChromium bookmarkList;
|
||||
|
||||
ExtensionInstallForcelist = [
|
||||
"dbepggeogbaibhgnhhndojpepiihcmeb" # Vimiu
|
||||
"gcknhkkoolaabfmlnjonogaaifnjlfnp" # FoxyProxy
|
||||
"ghmbeldphafepmbegfdlkpapadhbakde" # Proton Pass
|
||||
"mdjildafknihdffpkfmmpnpoiajfjnjd" # Consent-O-Matic
|
||||
"pkehgijcmpdhfbdbbnkijodmdjhbjlgp" # Privacy Badger
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user