mirror of
https://github.com/NotAShelf/nyxexprs.git
synced 2026-01-17 15:49:09 +00:00
Compare commits
No commits in common. "a2ffe642ef0432d4e9c340c291a14a16ef04188a" and "7329b2ad7ba40472bf5ad03fac7713e9b32512a3" have entirely different histories.
a2ffe642ef
...
7329b2ad7b
14 changed files with 446 additions and 329 deletions
152
README.md
152
README.md
|
|
@ -1,28 +1,25 @@
|
||||||
# 🌙 nyxexprs
|
# 🌙 nyxexprs
|
||||||
|
|
||||||
My personal package overlay for sharing my most commonly used derivations. Kept
|
My personal package overlay for sharing my most commonly used derivations.
|
||||||
up to date with Github workflows and npins. Contributions welcome.
|
|
||||||
|
## 📦 Packages
|
||||||
|
|
||||||
|
There are several packages exposed by this flake. Each directory in `pkgs`
|
||||||
|
contains a description of the package inside its README.
|
||||||
|
|
||||||
|
| Package | Description |
|
||||||
|
| :--------------- | :----------------------------------------------------------------------------------------------: |
|
||||||
|
| alejandra-custom | A patched version of the **Alejandra** Nix formatter, without the pesky ads and spacing patches |
|
||||||
|
| ani-cli | An up-to-date, auto updated version of ani-cli following auto-updated pins |
|
||||||
|
| cloneit | A CLI tool to download specific GitHub directories or files |
|
||||||
|
| foot-transparent | A patched version of the Foot terminal emulator that brings back fullscreen transparency[^1] |
|
||||||
|
| fuzzel-git | Patched version of Fuzzel that tracks the latest git revision |
|
||||||
|
| headscale-ui | A web frontend for the headscale Tailscale-compatible coordination server |
|
||||||
|
| mastodon-bird-ui | Mastodon web UI, but strongly inspired by Twitter. |
|
||||||
|
| zsh-stripped | ZSH with newinstall scripts removed, and patches to handle special characters such as `^` or `#` |
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
All packages in Nyxexprs are exposed in the flake outputs.
|
|
||||||
|
|
||||||
### Flakes
|
|
||||||
|
|
||||||
```nix
|
|
||||||
# flake.nix
|
|
||||||
inputs = {
|
|
||||||
# Add an input as such. Avoid adding "follows" lines if you would
|
|
||||||
# like to benefit from the binary cache.
|
|
||||||
nyxexprs.url = "github:notashelf/nyxexprs";
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
If you are using Nix on a non-NixOS distro, you may nix run to try out packages,
|
|
||||||
or `nix profile install` to install them on your system profile. If using
|
|
||||||
home-manager on non-NixOS, I recommend using `home.packages` instead.
|
|
||||||
|
|
||||||
### Binary Cache
|
### Binary Cache
|
||||||
|
|
||||||
Regardless of your setup,you may want to add the
|
Regardless of your setup,you may want to add the
|
||||||
|
|
@ -45,15 +42,112 @@ nix.settings = {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### NixOS/Home-manager (flakes)
|
||||||
|
|
||||||
|
It is as simple as adding a new entry to your inputs with the correct url.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
# flake.nix
|
||||||
|
inputs = {
|
||||||
|
# ...
|
||||||
|
nyxexprs.url = "github:notashelf/nyxexprs";
|
||||||
|
# ...
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
After adding the input, you can consume the [exposed packages](#-packages) in
|
||||||
|
your system configuration. An example `flake.nix` would be as follows:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
# flake.nix
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
|
|
||||||
|
# ↓ add nyxexprs as a flake input
|
||||||
|
nyxexprs.url = "github:notashelf/nyxexprs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = inputs @ {self, nixpkgs, ...}: {
|
||||||
|
# set up for NixOS
|
||||||
|
nixosConfigurations.<yourHostName> = nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {inherit inputs;};
|
||||||
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
|
# ...
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# or for Home Manager
|
||||||
|
homeConfigurations.<yourHostName> = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
extraSpecialArgs = {inherit inputs;};
|
||||||
|
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
./home.nix
|
||||||
|
# ...
|
||||||
|
];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Where you can then add the relevant package to your `environment.systemPackages`
|
||||||
|
or `home.packages`
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{pkgs, inputs, ...}: {
|
||||||
|
# in case of home-manager, this will be home.packages
|
||||||
|
environment.systemPackages = [
|
||||||
|
inputs.nyxexprs.packages.${pkgs.system}.<packageName> # installs a package
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Nix
|
||||||
|
|
||||||
|
If you are using Nix on a non-NixOS distro, you may `nix run` to try out
|
||||||
|
packages, or `nix profile install` to install them on your system profile. If
|
||||||
|
using home-manager on non-NixOS, I recommend using `home.packages` instead.
|
||||||
|
|
||||||
|
```console
|
||||||
|
nix profile install github:notashelf/nyxexprs#<package>
|
||||||
|
```
|
||||||
|
|
||||||
|
### NixOS/Home-manager (no flakes)
|
||||||
|
|
||||||
|
If you are not using flakes, the above instructions will not apply. You may
|
||||||
|
obtain the source as a tarball to consume in your system configuration as
|
||||||
|
follows:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{pkgs, ...}: let
|
||||||
|
nyxexprs = import (builtins.fetchTarball "https://github.com/notashelf/nyxexprs/archive/main.tar.gz");
|
||||||
|
in {
|
||||||
|
# install packages
|
||||||
|
# this can also be home.packages if you are using home-manager
|
||||||
|
environment.systemPackages = [
|
||||||
|
nyxexprs.packages.${pkgs.hostPlatform.system}.<packageName>
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔧 Contributing
|
||||||
|
|
||||||
|
PRs are always welcome.
|
||||||
|
|
||||||
## 🫂 Credits
|
## 🫂 Credits
|
||||||
|
|
||||||
[@fufexan]: https://github.com/fufexan
|
The repository structure is mostly borrowed from
|
||||||
[nix-gaming]: https://github.com/fufexan/nix-gaming
|
[@fufexan](https://github.com/fufexan)'s
|
||||||
|
[nix-gaming](https://github.com/fufexan/nix-gaming).
|
||||||
|
|
||||||
The repository structure is mostly borrowed from [@fufexan] 's [nix-gaming]
|
[^1]:
|
||||||
repository. Thank you fuf!
|
Foot has broken fullscreen transparency on 1.15, which looks **really**
|
||||||
|
ugly with padding. The author is dead set on not fixing it, because it's broken
|
||||||
## 📜 License
|
on one wayland compositor that a total of 7 people use.
|
||||||
|
|
||||||
This repository (Nix, patches, ettc.) is released under EUPL v1.2. Please see
|
|
||||||
the [license file](./LICENSE) for more details.
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,7 @@
|
||||||
in
|
in
|
||||||
fetchTarball {
|
fetchTarball {
|
||||||
url =
|
url =
|
||||||
lock.nodes.${
|
lock.nodes.${nodeName}.locked.url
|
||||||
nodeName
|
|
||||||
}.locked.url
|
|
||||||
or "https://github.com/edolstra/flake-compat/archive/${
|
or "https://github.com/edolstra/flake-compat/archive/${
|
||||||
lock.nodes.${nodeName}.locked.rev
|
lock.nodes.${nodeName}.locked.rev
|
||||||
}.tar.gz";
|
}.tar.gz";
|
||||||
|
|
|
||||||
BIN
flake.lock
generated
BIN
flake.lock
generated
Binary file not shown.
|
|
@ -13,10 +13,8 @@ let
|
||||||
version = data.version;
|
version = data.version;
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
|
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
|
||||||
range = first: last:
|
range =
|
||||||
if first > last
|
first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1);
|
||||||
then []
|
|
||||||
else builtins.genList (n: first + n) (last - first + 1);
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
|
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
|
||||||
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
|
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
|
||||||
|
|
@ -29,44 +27,47 @@ let
|
||||||
# If the environment variable NPINS_OVERRIDE_${name} is set, then use
|
# If the environment variable NPINS_OVERRIDE_${name} is set, then use
|
||||||
# the path directly as opposed to the fetched source.
|
# the path directly as opposed to the fetched source.
|
||||||
# (Taken from Niv for compatibility)
|
# (Taken from Niv for compatibility)
|
||||||
mayOverride = name: path: let
|
mayOverride =
|
||||||
|
name: path:
|
||||||
|
let
|
||||||
envVarName = "NPINS_OVERRIDE_${saneName}";
|
envVarName = "NPINS_OVERRIDE_${saneName}";
|
||||||
saneName = stringAsChars (c:
|
saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name;
|
||||||
if (builtins.match "[a-zA-Z0-9]" c) == null
|
|
||||||
then "_"
|
|
||||||
else c)
|
|
||||||
name;
|
|
||||||
ersatz = builtins.getEnv envVarName;
|
ersatz = builtins.getEnv envVarName;
|
||||||
in
|
in
|
||||||
if ersatz == ""
|
if ersatz == "" then
|
||||||
then path
|
path
|
||||||
else
|
else
|
||||||
# this turns the string into an actual Nix path (for both absolute and
|
# this turns the string into an actual Nix path (for both absolute and
|
||||||
# relative paths)
|
# relative paths)
|
||||||
builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" (
|
builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" (
|
||||||
if builtins.substring 0 1 ersatz == "/"
|
if builtins.substring 0 1 ersatz == "/" then
|
||||||
then /. + ersatz
|
/. + ersatz
|
||||||
else /. + builtins.getEnv "PWD" + "/${ersatz}"
|
else
|
||||||
|
/. + builtins.getEnv "PWD" + "/${ersatz}"
|
||||||
);
|
);
|
||||||
|
|
||||||
mkSource = name: spec:
|
mkSource =
|
||||||
assert spec ? type; let
|
name: spec:
|
||||||
|
assert spec ? type;
|
||||||
|
let
|
||||||
path =
|
path =
|
||||||
if spec.type == "Git"
|
if spec.type == "Git" then
|
||||||
then mkGitSource spec
|
mkGitSource spec
|
||||||
else if spec.type == "GitRelease"
|
else if spec.type == "GitRelease" then
|
||||||
then mkGitSource spec
|
mkGitSource spec
|
||||||
else if spec.type == "PyPi"
|
else if spec.type == "PyPi" then
|
||||||
then mkPyPiSource spec
|
mkPyPiSource spec
|
||||||
else if spec.type == "Channel"
|
else if spec.type == "Channel" then
|
||||||
then mkChannelSource spec
|
mkChannelSource spec
|
||||||
else if spec.type == "Tarball"
|
else if spec.type == "Tarball" then
|
||||||
then mkTarballSource spec
|
mkTarballSource spec
|
||||||
else builtins.throw "Unknown source type ${spec.type}";
|
else
|
||||||
|
builtins.throw "Unknown source type ${spec.type}";
|
||||||
in
|
in
|
||||||
spec // { outPath = mayOverride name path; };
|
spec // { outPath = mayOverride name path; };
|
||||||
|
|
||||||
mkGitSource = {
|
mkGitSource =
|
||||||
|
{
|
||||||
repository,
|
repository,
|
||||||
revision,
|
revision,
|
||||||
url ? null,
|
url ? null,
|
||||||
|
|
@ -78,35 +79,32 @@ let
|
||||||
assert repository ? type;
|
assert repository ? type;
|
||||||
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
|
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
|
||||||
# In the latter case, there we will always be an url to the tarball
|
# In the latter case, there we will always be an url to the tarball
|
||||||
if url != null && !submodules
|
if url != null && !submodules then
|
||||||
then
|
|
||||||
builtins.fetchTarball {
|
builtins.fetchTarball {
|
||||||
inherit url;
|
inherit url;
|
||||||
sha256 = hash; # FIXME: check nix version & use SRI hashes
|
sha256 = hash; # FIXME: check nix version & use SRI hashes
|
||||||
}
|
}
|
||||||
else let
|
else
|
||||||
|
let
|
||||||
url =
|
url =
|
||||||
if repository.type == "Git"
|
if repository.type == "Git" then
|
||||||
then repository.url
|
repository.url
|
||||||
else if repository.type == "GitHub"
|
else if repository.type == "GitHub" then
|
||||||
then "https://github.com/${repository.owner}/${repository.repo}.git"
|
"https://github.com/${repository.owner}/${repository.repo}.git"
|
||||||
else if repository.type == "GitLab"
|
else if repository.type == "GitLab" then
|
||||||
then "${repository.server}/${repository.repo_path}.git"
|
"${repository.server}/${repository.repo_path}.git"
|
||||||
else throw "Unrecognized repository type ${repository.type}";
|
else
|
||||||
urlToName = url: rev: let
|
throw "Unrecognized repository type ${repository.type}";
|
||||||
|
urlToName =
|
||||||
|
url: rev:
|
||||||
|
let
|
||||||
matched = builtins.match "^.*/([^/]*)(\\.git)?$" url;
|
matched = builtins.match "^.*/([^/]*)(\\.git)?$" url;
|
||||||
|
|
||||||
short = builtins.substring 0 7 rev;
|
short = builtins.substring 0 7 rev;
|
||||||
|
|
||||||
appendShort =
|
appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else "";
|
||||||
if (builtins.match "[a-f0-9]*" rev) != null
|
in
|
||||||
then "-${short}"
|
"${if matched == null then "source" else builtins.head matched}${appendShort}";
|
||||||
else "";
|
|
||||||
in "${
|
|
||||||
if matched == null
|
|
||||||
then "source"
|
|
||||||
else builtins.head matched
|
|
||||||
}${appendShort}";
|
|
||||||
name = urlToName url revision;
|
name = urlToName url revision;
|
||||||
in
|
in
|
||||||
builtins.fetchGit {
|
builtins.fetchGit {
|
||||||
|
|
@ -116,27 +114,22 @@ let
|
||||||
inherit url submodules;
|
inherit url submodules;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkPyPiSource = {
|
mkPyPiSource =
|
||||||
url,
|
{ url, hash, ... }:
|
||||||
hash,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
builtins.fetchurl {
|
builtins.fetchurl {
|
||||||
inherit url;
|
inherit url;
|
||||||
sha256 = hash;
|
sha256 = hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkChannelSource = {
|
mkChannelSource =
|
||||||
url,
|
{ url, hash, ... }:
|
||||||
hash,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
builtins.fetchTarball {
|
builtins.fetchTarball {
|
||||||
inherit url;
|
inherit url;
|
||||||
sha256 = hash;
|
sha256 = hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkTarballSource = {
|
mkTarballSource =
|
||||||
|
{
|
||||||
url,
|
url,
|
||||||
locked_url ? url,
|
locked_url ? url,
|
||||||
hash,
|
hash,
|
||||||
|
|
@ -147,6 +140,7 @@ let
|
||||||
sha256 = hash;
|
sha256 = hash;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
if version == 5
|
if version == 5 then
|
||||||
then builtins.mapAttrs mkSource data.pins
|
builtins.mapAttrs mkSource data.pins
|
||||||
else throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
|
else
|
||||||
|
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,5 @@
|
||||||
{
|
{
|
||||||
"pins": {
|
"pins": {
|
||||||
"ai-robots-txt": {
|
|
||||||
"type": "GitRelease",
|
|
||||||
"repository": {
|
|
||||||
"type": "GitHub",
|
|
||||||
"owner": "ai-robots-txt",
|
|
||||||
"repo": "ai.robots.txt"
|
|
||||||
},
|
|
||||||
"pre_releases": false,
|
|
||||||
"version_upper_bound": null,
|
|
||||||
"release_prefix": null,
|
|
||||||
"submodules": false,
|
|
||||||
"version": "v1.28",
|
|
||||||
"revision": "e0cdb278fbd243f554579fe5050850f124b286a8",
|
|
||||||
"url": "https://api.github.com/repos/ai-robots-txt/ai.robots.txt/tarball/v1.28",
|
|
||||||
"hash": "1lv5alddyk2wcqnsnb2x7i0n9m127mjmaa083im14a4hygw7d7r7"
|
|
||||||
},
|
|
||||||
"ani-cli": {
|
"ani-cli": {
|
||||||
"type": "GitRelease",
|
"type": "GitRelease",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
@ -75,22 +59,6 @@
|
||||||
"url": null,
|
"url": null,
|
||||||
"hash": "037psx1j608hkl8d3d84ybyvh8fky82i1ihkpa0xnavqagnjc0fr"
|
"hash": "037psx1j608hkl8d3d84ybyvh8fky82i1ihkpa0xnavqagnjc0fr"
|
||||||
},
|
},
|
||||||
"headscale-ui": {
|
|
||||||
"type": "GitRelease",
|
|
||||||
"repository": {
|
|
||||||
"type": "GitHub",
|
|
||||||
"owner": "gurucomputing",
|
|
||||||
"repo": "headscale-ui"
|
|
||||||
},
|
|
||||||
"pre_releases": false,
|
|
||||||
"version_upper_bound": null,
|
|
||||||
"release_prefix": null,
|
|
||||||
"submodules": false,
|
|
||||||
"version": "2025.03.21",
|
|
||||||
"revision": "84aec5f45a64d5537237f2fccdf86581df42726b",
|
|
||||||
"url": "https://api.github.com/repos/gurucomputing/headscale-ui/tarball/2025.03.21",
|
|
||||||
"hash": "1zs6f5da9d0a8vin98alfsdyip1av624yyl43kjyw88dicw78y3n"
|
|
||||||
},
|
|
||||||
"mov-cli": {
|
"mov-cli": {
|
||||||
"type": "GitRelease",
|
"type": "GitRelease",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
stdenvNoCC,
|
|
||||||
fetchurl,
|
|
||||||
pins,
|
|
||||||
}: let
|
|
||||||
pin = pins.ai-robots-txt;
|
|
||||||
in
|
|
||||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
||||||
pname = "ai-robots-txt";
|
|
||||||
inherit (pin) version;
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://github.com/ai-robots-txt/ai.robots.txt/releases/download/${finalAttrs.version}/robots.txt";
|
|
||||||
hash = "sha256-Cx01MI5Rss08lLgzwoppou0nqD0HxvfUbsa1NRVp8eQ=";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
dontConfigure = true;
|
|
||||||
dontBuild = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/share
|
|
||||||
cp $src $out/share/robots.txt
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "List of AI agents and robots to block";
|
|
||||||
homepage = "https://github.com/ai-robots-txt/ai.robots.txt";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
maintainers = with lib.maintainers; [NotAShelf];
|
|
||||||
platforms = lib.platforms.all;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
32
pkgs/cloneit/package.nix
Normal file
32
pkgs/cloneit/package.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
rustPlatform,
|
||||||
|
fetchFromGitHub,
|
||||||
|
pkg-config,
|
||||||
|
openssl,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
rustPlatform.buildRustPackage {
|
||||||
|
pname = "cloneit";
|
||||||
|
version = "0-unstable-2024-06-28";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "alok8bb";
|
||||||
|
repo = "cloneit";
|
||||||
|
rev = "6198556e810d964cc5938c446ef42fc21b55fe0b";
|
||||||
|
sha256 = "sha256-RP0/kquAlSwRMeB6cjvS5JB9qfdkT8IKLVxaxrmzJ+0=";
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoHash = "sha256-XXcqmDPEQUm4YBqY5+06X55ym3o3RqE7fNSiR4n+iyc=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [pkg-config];
|
||||||
|
buildInputs = [openssl];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "CLI tool to download specific GitHub directories or files";
|
||||||
|
homepage = "https://github.com/alok8bb/cloneit";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [NotAShelf];
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
withAlphaPatch ? true,
|
|
||||||
lib,
|
|
||||||
fetchFromGitea,
|
|
||||||
foot,
|
|
||||||
pins,
|
|
||||||
date,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
foot.overrideAttrs (oldAttrs: let
|
|
||||||
pin = pins.foot;
|
|
||||||
in {
|
|
||||||
pname = "foot-transparent";
|
|
||||||
version = "0-unstable-${date}";
|
|
||||||
|
|
||||||
src = fetchFromGitea {
|
|
||||||
domain = "codeberg.org";
|
|
||||||
owner = "dnkl";
|
|
||||||
repo = "foot";
|
|
||||||
rev = pin.revision;
|
|
||||||
sha256 = pin.hash;
|
|
||||||
};
|
|
||||||
|
|
||||||
patches =
|
|
||||||
(oldAttrs.patches or [])
|
|
||||||
++ (lib.optionals withAlphaPatch [
|
|
||||||
# Thank you fazzi :)
|
|
||||||
# <https://codeberg.org/fazzi/foot/commit/bebc6f0ffd0d767f560ee50825a0b0fba197c90f.patch>
|
|
||||||
./patches/foot_fullscreen_alpha.patch
|
|
||||||
]);
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "An auto-upgrading version of FOot to ensure we are always up to dates";
|
|
||||||
mainProgram = "foot";
|
|
||||||
maintainers = with lib.maintainers; [NotAShelf];
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
From bebc6f0ffd0d767f560ee50825a0b0fba197c90f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Fazzi <faaris.ansari@proton.me>
|
|
||||||
Date: Fri, 18 Apr 2025 21:15:19 +0100
|
|
||||||
Subject: [PATCH] config: add transparent_fullscreen option
|
|
||||||
|
|
||||||
---
|
|
||||||
config.c | 5 +++++
|
|
||||||
config.h | 2 ++
|
|
||||||
render.c | 8 +++++---
|
|
||||||
3 files changed, 12 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/config.c b/config.c
|
|
||||||
index 347cc1ec..fa081ce7 100644
|
|
||||||
--- a/config.c
|
|
||||||
+++ b/config.c
|
|
||||||
@@ -1095,6 +1095,10 @@ parse_section_main(struct context *ctx)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ else if (streq(key, "transparent-fullscreen")) {
|
|
||||||
+ return value_to_bool(ctx, &conf->transparent_fullscreen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
else {
|
|
||||||
LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
|
|
||||||
return false;
|
|
||||||
@@ -3347,6 +3351,7 @@ config_load(struct config *conf, const char *conf_path,
|
|
||||||
},
|
|
||||||
.multiplier = 3.,
|
|
||||||
},
|
|
||||||
+ .transparent_fullscreen = false,
|
|
||||||
.colors = {
|
|
||||||
.fg = default_foreground,
|
|
||||||
.bg = default_background,
|
|
||||||
diff --git a/config.h b/config.h
|
|
||||||
index 2dec82c1..542e22e6 100644
|
|
||||||
--- a/config.h
|
|
||||||
+++ b/config.h
|
|
||||||
@@ -167,6 +167,8 @@ struct config {
|
|
||||||
|
|
||||||
enum { STARTUP_WINDOWED, STARTUP_MAXIMIZED, STARTUP_FULLSCREEN } startup_mode;
|
|
||||||
|
|
||||||
+ bool transparent_fullscreen;
|
|
||||||
+
|
|
||||||
bool dpi_aware;
|
|
||||||
enum {GAMMA_CORRECT_DISABLED,
|
|
||||||
GAMMA_CORRECT_ENABLED,
|
|
||||||
diff --git a/render.c b/render.c
|
|
||||||
index 0e403949..2040d5be 100644
|
|
||||||
--- a/render.c
|
|
||||||
+++ b/render.c
|
|
||||||
@@ -744,7 +744,8 @@ render_cell(struct terminal *term, pixman_image_t *pix,
|
|
||||||
_bg = swap;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (!term->window->is_fullscreen && term->colors.alpha != 0xffff) {
|
|
||||||
+ if ((!term->window->is_fullscreen || term->conf->transparent_fullscreen)
|
|
||||||
+ && term->colors.alpha != 0xffff) {
|
|
||||||
switch (term->conf->colors.alpha_mode) {
|
|
||||||
case ALPHA_MODE_DEFAULT: {
|
|
||||||
if (cell->attrs.bg_src == COLOR_DEFAULT) {
|
|
||||||
@@ -1215,7 +1216,7 @@ render_margin(struct terminal *term, struct buffer *buf,
|
|
||||||
const uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg;
|
|
||||||
uint16_t alpha = term->colors.alpha;
|
|
||||||
|
|
||||||
- if (term->window->is_fullscreen) {
|
|
||||||
+ if (term->window->is_fullscreen && !term->conf->transparent_fullscreen) {
|
|
||||||
/* Disable alpha in fullscreen - see render_cell() for details */
|
|
||||||
alpha = 0xffff;
|
|
||||||
}
|
|
||||||
@@ -3244,7 +3245,8 @@ grid_render(struct terminal *term)
|
|
||||||
xassert(term->height > 0);
|
|
||||||
|
|
||||||
struct buffer_chain *chain = term->render.chains.grid;
|
|
||||||
- bool use_alpha = !term->window->is_fullscreen &&
|
|
||||||
+ bool use_alpha = (!term->window->is_fullscreen ||
|
|
||||||
+ term->conf->transparent_fullscreen) &&
|
|
||||||
term->colors.alpha != 0xffff;
|
|
||||||
struct buffer *buf = shm_get_buffer(
|
|
||||||
chain, term->width, term->height, use_alpha);
|
|
||||||
113
pkgs/foot-transparent/0001-fullscreen-transparency.patch
Normal file
113
pkgs/foot-transparent/0001-fullscreen-transparency.patch
Normal file
|
|
@ -0,0 +1,113 @@
|
||||||
|
diff --git a/CHANGELOG.md b/CHANGELOG.md
|
||||||
|
index 7ed4bd7a..013ff1be 100644
|
||||||
|
--- a/CHANGELOG.md
|
||||||
|
+++ b/CHANGELOG.md
|
||||||
|
@@ -913,7 +913,7 @@
|
||||||
|
instead of the one least recently.
|
||||||
|
* Starlight theme (the default theme) updated to [V4][starlight-v4]
|
||||||
|
* Background transparency (alpha) is now disabled in fullscreened
|
||||||
|
- windows ([#1416][1416]).
|
||||||
|
+ windows ([#1416][1416]) by default but can be enabled with `fullscreen_alpha`.
|
||||||
|
* Foot server systemd units now use the standard
|
||||||
|
graphical-session.target ([#1281][1281]).
|
||||||
|
* If `$XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock` does not exist,
|
||||||
|
diff --git a/INSTALL.md b/INSTALL.md
|
||||||
|
index 7df8d0b8..0f7f1aef 100644
|
||||||
|
--- a/INSTALL.md
|
||||||
|
+++ b/INSTALL.md
|
||||||
|
@@ -148,6 +148,7 @@ Available compile-time options:
|
||||||
|
| `-Ddocs` | feature | `auto` | Builds and install documentation | scdoc |
|
||||||
|
| `-Dtests` | bool | `true` | Build tests (adds a `ninja test` build target) | None |
|
||||||
|
| `-Dime` | bool | `true` | Enables IME support | None |
|
||||||
|
+| `-Dfullscreen-alpha` | bool | `false` | Enables transparency on fullscreen windows | None |
|
||||||
|
| `-Dgrapheme-clustering` | feature | `auto` | Enables grapheme clustering | libutf8proc |
|
||||||
|
| `-Dterminfo` | feature | `enabled` | Build and install terminfo files | tic (ncurses) |
|
||||||
|
| `-Ddefault-terminfo` | string | `foot` | Default value of `TERM` | None |
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index e85d95e5..bf9b021a 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -82,6 +82,9 @@ add_project_arguments(
|
||||||
|
(get_option('b_pgo') == 'use'
|
||||||
|
? ['-DFOOT_PGO_ENABLED=1']
|
||||||
|
: []) +
|
||||||
|
+ (get_option('fullscreen-alpha')
|
||||||
|
+ ? ['-DFOOT_FULLSCREEN_ALPHA_ENABLED=1']
|
||||||
|
+ : []) +
|
||||||
|
cc.get_supported_arguments(
|
||||||
|
['-pedantic',
|
||||||
|
'-fstrict-aliasing',
|
||||||
|
@@ -414,6 +417,7 @@ summary(
|
||||||
|
'Documentation': scdoc.found(),
|
||||||
|
'Themes': get_option('themes'),
|
||||||
|
'IME': get_option('ime'),
|
||||||
|
+ 'Fullscreen alpha': get_option('fullscreen-alpha'),
|
||||||
|
'Grapheme clustering': utf8proc.found(),
|
||||||
|
'utmp backend': utmp_backend,
|
||||||
|
'utmp helper default path': utmp_default_helper_path,
|
||||||
|
diff --git a/meson_options.txt b/meson_options.txt
|
||||||
|
index ab7a07be..30078102 100644
|
||||||
|
--- a/meson_options.txt
|
||||||
|
+++ b/meson_options.txt
|
||||||
|
@@ -7,6 +7,9 @@ option('themes', type: 'boolean', value: true,
|
||||||
|
option('ime', type: 'boolean', value: true,
|
||||||
|
description: 'IME (Input Method Editor) support')
|
||||||
|
|
||||||
|
+option('fullscreen-alpha', type: 'boolean', value: false,
|
||||||
|
+ description: 'Enables transparency on fullscreen windows')
|
||||||
|
+
|
||||||
|
option('grapheme-clustering', type: 'feature',
|
||||||
|
description: 'Enables grapheme clustering using libutf8proc. Requires fcft with harfbuzz support to be useful.')
|
||||||
|
|
||||||
|
diff --git a/render.c b/render.c
|
||||||
|
index 4975394f..eddf465a 100644
|
||||||
|
--- a/render.c
|
||||||
|
+++ b/render.c
|
||||||
|
@@ -746,6 +746,13 @@ render_cell(struct terminal *term, pixman_image_t *pix,
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (cell->attrs.bg_src == COLOR_DEFAULT) {
|
||||||
|
+#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED
|
||||||
|
+ /*
|
||||||
|
+ * Note: I don't care about the stupid ass wayland
|
||||||
|
+ * protocol I want transparent fullscreen windows.
|
||||||
|
+ */
|
||||||
|
+ alpha = term->colors.alpha;
|
||||||
|
+#else
|
||||||
|
if (term->window->is_fullscreen) {
|
||||||
|
/*
|
||||||
|
* Note: disable transparency when fullscreened.
|
||||||
|
@@ -783,6 +790,7 @@ render_cell(struct terminal *term, pixman_image_t *pix,
|
||||||
|
} else {
|
||||||
|
alpha = term->colors.alpha;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1191,10 +1199,12 @@ render_margin(struct terminal *term, struct buffer *buf,
|
||||||
|
const uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg;
|
||||||
|
uint16_t alpha = term->colors.alpha;
|
||||||
|
|
||||||
|
+#if !defined(FOOT_FULLSCREEN_ALPHA_ENABLED) || !FOOT_FULLSCREEN_ALPHA_ENABLED
|
||||||
|
if (term->window->is_fullscreen) {
|
||||||
|
/* Disable alpha in fullscreen - see render_cell() for details */
|
||||||
|
alpha = 0xffff;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, alpha, gamma_correct);
|
||||||
|
|
||||||
|
@@ -3220,8 +3230,12 @@ grid_render(struct terminal *term)
|
||||||
|
xassert(term->height > 0);
|
||||||
|
|
||||||
|
struct buffer_chain *chain = term->render.chains.grid;
|
||||||
|
+#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED
|
||||||
|
+ bool use_alpha = term->colors.alpha != 0xffff;
|
||||||
|
+#else
|
||||||
|
bool use_alpha = !term->window->is_fullscreen &&
|
||||||
|
term->colors.alpha != 0xffff;
|
||||||
|
+#endif
|
||||||
|
struct buffer *buf = shm_get_buffer(
|
||||||
|
chain, term->width, term->height, use_alpha);
|
||||||
|
|
||||||
45
pkgs/foot-transparent/package.nix
Normal file
45
pkgs/foot-transparent/package.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitea,
|
||||||
|
fcft,
|
||||||
|
foot,
|
||||||
|
pins,
|
||||||
|
date,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
foot.overrideAttrs (prev: let
|
||||||
|
pin = pins.foot;
|
||||||
|
in {
|
||||||
|
pname = "foot-transparent";
|
||||||
|
version = "0-unstable-${date}";
|
||||||
|
|
||||||
|
src = fetchFromGitea {
|
||||||
|
domain = "codeberg.org";
|
||||||
|
owner = "dnkl";
|
||||||
|
repo = "foot";
|
||||||
|
rev = pin.revision;
|
||||||
|
sha256 = pin.hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = (prev.patches or []) ++ [./0001-fullscreen-transparency.patch];
|
||||||
|
mesonFlags = (prev.mesonFlags or []) ++ ["-Dfullscreen-alpha=true"];
|
||||||
|
nativeBuildInputs =
|
||||||
|
(prev.nativeBuildInputs or [])
|
||||||
|
++ [
|
||||||
|
(fcft.overrideAttrs {
|
||||||
|
src = fetchFromGitea {
|
||||||
|
domain = "codeberg.org";
|
||||||
|
owner = "dnkl";
|
||||||
|
repo = "fcft";
|
||||||
|
tag = "3.3.1";
|
||||||
|
hash = "sha256-qgNNowWQhiu6pr9bmWbBo3mHgdkmNpDHDBeTidk32SE=";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Patched version of Foor terminal emulator that brings back fullscreen transparency";
|
||||||
|
mainProgram = "foot";
|
||||||
|
maintainers = with lib.maintainers; [NotAShelf];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
@ -1,27 +1,22 @@
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
fetchzip,
|
fetchzip,
|
||||||
pins,
|
lib,
|
||||||
}: let
|
}: let
|
||||||
pin = pins.headscale-ui;
|
|
||||||
in
|
|
||||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
||||||
pname = "headscale-ui";
|
pname = "headscale-ui";
|
||||||
inherit (pin) version;
|
version = "0-unstable-2024-02-24";
|
||||||
|
in
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
inherit pname version;
|
||||||
src = fetchzip {
|
src = fetchzip {
|
||||||
url = "https://github.com/gurucomputing/headscale-ui/releases/download/${finalAttrs.version}/headscale-ui.zip";
|
url = "https://github.com/gurucomputing/headscale-ui/releases/download/2024.02.24-beta1/headscale-ui.zip";
|
||||||
sha256 = "sha256-Autk8D9G1Ott2ahbgJ7mGZKDChsSDgfrOhnurNiIdsQ=";
|
sha256 = "sha256-HHzxGlAtVXs0jfNJ/khbNA/aQsGKvii1Hm+8hlJQYYY=";
|
||||||
};
|
};
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
ls -lah
|
|
||||||
mkdir -p $out/share
|
mkdir -p $out/share
|
||||||
cp -rvf ./* $out/share
|
cp -r ./* $out/share
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
@ -31,4 +26,4 @@ in
|
||||||
license = [lib.licenses.bsd3];
|
license = [lib.licenses.bsd3];
|
||||||
maintainers = with lib.maintainers; [NotAShelf];
|
maintainers = with lib.maintainers; [NotAShelf];
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
|
|
||||||
33
pkgs/robots-ai-txt/package.nix
Normal file
33
pkgs/robots-ai-txt/package.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenvNoCC,
|
||||||
|
fetchurl,
|
||||||
|
}:
|
||||||
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||||
|
pname = "ai-robots-txt";
|
||||||
|
version = "1.25";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://github.com/ai-robots-txt/ai.robots.txt/releases/download/v${finalAttrs.version}/robots.txt";
|
||||||
|
hash = "sha256-r4C+RDNpzfokBkvTG1v1D9gbu5zpC91+onQFYw05lZE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
dontConfigure = true;
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
cp $src $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "List of AI agents and robots to block";
|
||||||
|
homepage = "https://github.com/ai-robots-txt/ai.robots.txt";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
maintainers = with lib.maintainers; [NotAShelf];
|
||||||
|
platforms = lib.platforms.all;
|
||||||
|
};
|
||||||
|
})
|
||||||
Loading…
Add table
Add a link
Reference in a new issue