treewide. complete refactor

Lots of cleaning up, I cannot be arsed to commit everything one-by-one
This commit is contained in:
raf 2024-07-22 00:19:39 +03:00
parent a704a123ec
commit 5b7812600d
Signed by: NotAShelf
GPG key ID: AF26552424E53993
24 changed files with 631 additions and 464 deletions

View file

@ -11,12 +11,38 @@
};
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
outputs = {
nixpkgs,
flake-parts,
self,
...
} @ inputs: let
pins = import ./npins;
in
flake-parts.lib.mkFlake {inherit inputs self;} {
systems = ["x86_64-linux" "aarch64-linux"];
imports = [./pkgs];
imports = [flake-parts.flakeModules.easyOverlay];
perSystem = {
system,
config,
pkgs,
lib,
...
}: let
inherit (lib.filesystem) packagesFromDirectoryRecursive;
in {
_module.args.pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
overlayAttrs = config.packages;
packages = packagesFromDirectoryRecursive {
callPackage = lib.callPackageWith (pkgs // {inherit pins;});
directory = ./pkgs;
};
perSystem = {pkgs, ...}: {
formatter = pkgs.alejandra;
devShells.default = with pkgs; mkShell {buildInputs = [npins];};
};

View file

@ -0,0 +1,520 @@
From 0fdb0c51c1de1ceafcfdbbc3d339434b3a667095 Mon Sep 17 00:00:00 2001
From: Sofi <sofi+git@mailbox.org>
Date: Mon, 10 Jun 2024 16:28:23 +0200
Subject: [PATCH 1/2] feat: spaces around inline attr-sets
---
src/alejandra/src/rules/attr_set.rs | 4 ++++
src/alejandra/tests/cases/apply/out.nix | 16 ++++++++--------
src/alejandra/tests/cases/attr_set/out.nix | 8 ++++----
src/alejandra/tests/cases/idioms_nixos_1/out.nix | 4 ++--
src/alejandra/tests/cases/idioms_pkgs_2/out.nix | 4 ++--
src/alejandra/tests/cases/idioms_pkgs_3/out.nix | 4 ++--
src/alejandra/tests/cases/inherit/out.nix | 2 +-
src/alejandra/tests/cases/inherit_from/out.nix | 2 +-
src/alejandra/tests/cases/key_value/out.nix | 6 +++---
src/alejandra/tests/cases/with/out.nix | 8 ++++----
10 files changed, 31 insertions(+), 27 deletions(-)
diff --git a/src/alejandra/src/rules/attr_set.rs b/src/alejandra/src/rules/attr_set.rs
index 9459977..8b637a1 100644
--- a/src/alejandra/src/rules/attr_set.rs
+++ b/src/alejandra/src/rules/attr_set.rs
@@ -62,6 +62,8 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Format(child));
if vertical {
steps.push_back(crate::builder::Step::Indent);
+ } else if items_count >= 1 {
+ steps.push_back(crate::builder::Step::Whitespace);
}
let mut item_index: usize = 0;
@@ -120,6 +122,8 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Dedent);
steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad);
+ } else if items_count >= 1 {
+ steps.push_back(crate::builder::Step::Whitespace);
}
steps.push_back(crate::builder::Step::Format(child));
diff --git a/src/alejandra/tests/cases/apply/out.nix b/src/alejandra/tests/cases/apply/out.nix
index 77a7d97..7a0bd11 100644
--- a/src/alejandra/tests/cases/apply/out.nix
+++ b/src/alejandra/tests/cases/apply/out.nix
@@ -41,19 +41,19 @@
name1 =
function
arg
- {asdf = 1;};
+ { asdf = 1; };
name2 =
function
arg
- {asdf = 1;}
+ { asdf = 1; }
argument;
name3 =
function
arg
- {asdf = 1;}
- {qwer = 12345;}
+ { asdf = 1; }
+ { qwer = 12345; }
argument;
}
{
@@ -79,7 +79,7 @@
name4 =
function
arg
- {asdf = 1;}
+ { asdf = 1; }
{
qwer = 12345;
qwer2 = 54321;
@@ -88,21 +88,21 @@
}
{
option1 =
- function arg {asdf = 1;} {
+ function arg { asdf = 1; } {
qwer = 12345;
qwer2 = 54321;
}
lastArg;
option2 =
- function arg {asdf = 1;} {
+ function arg { asdf = 1; } {
qwer = 12345;
qwer2 = 54321;
}
lastArg;
option3 =
- function arg {asdf = 1;}
+ function arg { asdf = 1; }
{
qwer = 12345;
qwer2 = 54321;
diff --git a/src/alejandra/tests/cases/attr_set/out.nix b/src/alejandra/tests/cases/attr_set/out.nix
index 18e6026..e5ac999 100644
--- a/src/alejandra/tests/cases/attr_set/out.nix
+++ b/src/alejandra/tests/cases/attr_set/out.nix
@@ -5,12 +5,12 @@
a
*/
}
- {a = 1;}
+ { a = 1; }
{
a = 1;
}
- {b = 1;}
+ { b = 1; }
{
b = 1;
/*
@@ -33,7 +33,7 @@
*/
}
- rec {c = 1;}
+ rec { c = 1; }
rec {
c = 1;
/*
@@ -101,7 +101,7 @@
a = {
a = rec {
a = {
- a = rec {a = {a = rec {a = {a = rec {a = {};};};};};};
+ a = rec { a = { a = rec { a = { a = rec { a = {}; }; }; }; }; };
};
};
};
diff --git a/src/alejandra/tests/cases/idioms_nixos_1/out.nix b/src/alejandra/tests/cases/idioms_nixos_1/out.nix
index ae087c2..b2f555c 100644
--- a/src/alejandra/tests/cases/idioms_nixos_1/out.nix
+++ b/src/alejandra/tests/cases/idioms_nixos_1/out.nix
@@ -33,7 +33,7 @@ in {
boot.kernelPackages = mkOption {
default = pkgs.linuxPackages;
- type = types.unspecified // {merge = mergeEqualOption;};
+ type = types.unspecified // { merge = mergeEqualOption; };
apply = kernelPackages:
kernelPackages.extend (self: super: {
kernel = super.kernel.override (originalArgs: {
@@ -263,7 +263,7 @@ in {
})
(mkIf (!config.boot.isContainer) {
- system.build = {inherit kernel;};
+ system.build = { inherit kernel; };
system.modulesTree = [kernel] ++ config.boot.extraModulePackages;
diff --git a/src/alejandra/tests/cases/idioms_pkgs_2/out.nix b/src/alejandra/tests/cases/idioms_pkgs_2/out.nix
index dd0a2b5..befac3b 100644
--- a/src/alejandra/tests/cases/idioms_pkgs_2/out.nix
+++ b/src/alejandra/tests/cases/idioms_pkgs_2/out.nix
@@ -19,13 +19,13 @@ stdenv.mkDerivation rec {
doCheck = true;
passthru.tests = {
- version = testVersion {package = hello;};
+ version = testVersion { package = hello; };
invariant-under-noXlibs =
testEqualDerivation
"hello must not be rebuilt when environment.noXlibs is set."
hello
- (nixos {environment.noXlibs = true;}).pkgs.hello;
+ (nixos { environment.noXlibs = true; }).pkgs.hello;
};
meta = with lib; {
diff --git a/src/alejandra/tests/cases/idioms_pkgs_3/out.nix b/src/alejandra/tests/cases/idioms_pkgs_3/out.nix
index ae087c2..b2f555c 100644
--- a/src/alejandra/tests/cases/idioms_pkgs_3/out.nix
+++ b/src/alejandra/tests/cases/idioms_pkgs_3/out.nix
@@ -33,7 +33,7 @@ in {
boot.kernelPackages = mkOption {
default = pkgs.linuxPackages;
- type = types.unspecified // {merge = mergeEqualOption;};
+ type = types.unspecified // { merge = mergeEqualOption; };
apply = kernelPackages:
kernelPackages.extend (self: super: {
kernel = super.kernel.override (originalArgs: {
@@ -263,7 +263,7 @@ in {
})
(mkIf (!config.boot.isContainer) {
- system.build = {inherit kernel;};
+ system.build = { inherit kernel; };
system.modulesTree = [kernel] ++ config.boot.extraModulePackages;
diff --git a/src/alejandra/tests/cases/inherit/out.nix b/src/alejandra/tests/cases/inherit/out.nix
index c3b983d..65da28b 100644
--- a/src/alejandra/tests/cases/inherit/out.nix
+++ b/src/alejandra/tests/cases/inherit/out.nix
@@ -7,7 +7,7 @@
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
;
}
- {inherit b d;}
+ { inherit b d; }
{
inherit
b
diff --git a/src/alejandra/tests/cases/inherit_from/out.nix b/src/alejandra/tests/cases/inherit_from/out.nix
index 0155df5..7252bc4 100644
--- a/src/alejandra/tests/cases/inherit_from/out.nix
+++ b/src/alejandra/tests/cases/inherit_from/out.nix
@@ -1,5 +1,5 @@
[
- {inherit (c) f h;}
+ { inherit (c) f h; }
{
inherit
(c)
diff --git a/src/alejandra/tests/cases/key_value/out.nix b/src/alejandra/tests/cases/key_value/out.nix
index af2f520..f817892 100644
--- a/src/alejandra/tests/cases/key_value/out.nix
+++ b/src/alejandra/tests/cases/key_value/out.nix
@@ -4,7 +4,7 @@ rec
a = 4;
a = a: b;
- a = {a = 1;};
+ a = { a = 1; };
b = {
a =
@@ -79,7 +79,7 @@ rec
*/
;
};
- j = a: {b = 1;};
+ j = a: { b = 1; };
k = a: {
b = 1;
c = 2;
@@ -88,7 +88,7 @@ rec
/*
b
*/
- {b = 1;};
+ { b = 1; };
m = a:
/*
b
diff --git a/src/alejandra/tests/cases/with/out.nix b/src/alejandra/tests/cases/with/out.nix
index cd15509..b31b2f0 100644
--- a/src/alejandra/tests/cases/with/out.nix
+++ b/src/alejandra/tests/cases/with/out.nix
@@ -21,9 +21,9 @@
c)
(with b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc)
(with b; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc)
- {a = with b; 1;}
- {a = with b; 1 + 1;}
- {a = with b; {c = 1;};}
+ { a = with b; 1; }
+ { a = with b; 1 + 1; }
+ { a = with b; { c = 1; }; }
{
a = with b; {
c = 1;
@@ -40,7 +40,7 @@
a = with b; 1;
# comment
}
- (with a; with b; with c; {a = 1;})
+ (with a; with b; with c; { a = 1; })
(with a;
with b;
with c; {
From 694fe8098f97c7ff313087ca138f9da06718d978 Mon Sep 17 00:00:00 2001
From: Sofi <sofi+git@mailbox.org>
Date: Mon, 10 Jun 2024 16:36:28 +0200
Subject: [PATCH 2/2] feat: spaces around inline lists
---
src/alejandra/src/rules/list.rs | 6 +++++-
src/alejandra/tests/cases/idioms_lib_2/out.nix | 6 +++---
src/alejandra/tests/cases/idioms_nixos_1/out.nix | 16 ++++++++--------
src/alejandra/tests/cases/idioms_pkgs_1/out.nix | 2 +-
src/alejandra/tests/cases/idioms_pkgs_2/out.nix | 2 +-
src/alejandra/tests/cases/idioms_pkgs_3/out.nix | 16 ++++++++--------
src/alejandra/tests/cases/lists/out.nix | 4 ++--
src/alejandra/tests/cases/monsters_3/out.nix | 4 ++--
8 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/src/alejandra/src/rules/list.rs b/src/alejandra/src/rules/list.rs
index 3e33e14..df9b9e6 100644
--- a/src/alejandra/src/rules/list.rs
+++ b/src/alejandra/src/rules/list.rs
@@ -23,7 +23,9 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Format(child));
if vertical {
steps.push_back(crate::builder::Step::Indent);
- }
+ } else if items_count >= 1 {
+ steps.push_back(crate::builder::Step::Whitespace);
+ }
let mut item_index: usize = 0;
let mut inline_next_comment = false;
@@ -90,6 +92,8 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Dedent);
steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad);
+ } else if items_count >= 1 {
+ steps.push_back(crate::builder::Step::Whitespace);
}
steps.push_back(crate::builder::Step::Format(child));
diff --git a/src/alejandra/tests/cases/idioms_lib_2/out.nix b/src/alejandra/tests/cases/idioms_lib_2/out.nix
index 9911edf..2a3b2d8 100644
--- a/src/alejandra/tests/cases/idioms_lib_2/out.nix
+++ b/src/alejandra/tests/cases/idioms_lib_2/out.nix
@@ -387,7 +387,7 @@
Type: string -> a -> a
*/
warn =
- if lib.elem (builtins.getEnv "NIX_ABORT_ON_WARN") ["1" "true" "yes"]
+ if lib.elem (builtins.getEnv "NIX_ABORT_ON_WARN") [ "1" "true" "yes" ]
then msg: builtins.trace "[1;31mwarning: ${msg}[0m" (abort "NIX_ABORT_ON_WARN=true; warnings are treated as unrecoverable errors.")
else msg: builtins.trace "[1;31mwarning: ${msg}[0m";
@@ -526,12 +526,12 @@
toBaseDigits = base: i: let
go = i:
if i < base
- then [i]
+ then [ i ]
else let
r = i - ((i / base) * base);
q = (i - r) / base;
in
- [r] ++ go q;
+ [ r ] ++ go q;
in
assert (base >= 2);
assert (i >= 0);
diff --git a/src/alejandra/tests/cases/idioms_nixos_1/out.nix b/src/alejandra/tests/cases/idioms_nixos_1/out.nix
index b2f555c..27f0329 100644
--- a/src/alejandra/tests/cases/idioms_nixos_1/out.nix
+++ b/src/alejandra/tests/cases/idioms_nixos_1/out.nix
@@ -134,7 +134,7 @@ in {
boot.initrd.availableKernelModules = mkOption {
type = types.listOf types.str;
default = [];
- example = ["sata_nv" "ext3"];
+ example = [ "sata_nv" "ext3" ];
description = ''
The set of kernel modules in the initial ramdisk used during the
boot process. This set must include all modules necessary for
@@ -265,20 +265,20 @@ in {
(mkIf (!config.boot.isContainer) {
system.build = { inherit kernel; };
- system.modulesTree = [kernel] ++ config.boot.extraModulePackages;
+ system.modulesTree = [ kernel ] ++ config.boot.extraModulePackages;
# Implement consoleLogLevel both in early boot and using sysctl
# (so you don't need to reboot to have changes take effect).
boot.kernelParams =
- ["loglevel=${toString config.boot.consoleLogLevel}"]
- ++ optionals config.boot.vesa ["vga=0x317" "nomodeset"];
+ [ "loglevel=${toString config.boot.consoleLogLevel}" ]
+ ++ optionals config.boot.vesa [ "vga=0x317" "nomodeset" ];
boot.kernel.sysctl."kernel.printk" = mkDefault config.boot.consoleLogLevel;
- boot.kernelModules = ["loop" "atkbd"];
+ boot.kernelModules = [ "loop" "atkbd" ];
# The Linux kernel >= 2.6.27 provides firmware.
- hardware.firmware = [kernel];
+ hardware.firmware = [ kernel ];
# Create /etc/modules-load.d/nixos.conf, which is read by
# systemd-modules-load.service to load required kernel modules.
@@ -287,8 +287,8 @@ in {
};
systemd.services.systemd-modules-load = {
- wantedBy = ["multi-user.target"];
- restartTriggers = [kernelModulesConf];
+ wantedBy = [ "multi-user.target" ];
+ restartTriggers = [ kernelModulesConf ];
serviceConfig = {
# Ignore failed module loads. Typically some of the
# modules in boot.kernelModules are "nice to have but
diff --git a/src/alejandra/tests/cases/idioms_pkgs_1/out.nix b/src/alejandra/tests/cases/idioms_pkgs_1/out.nix
index dbee48d..129d59d 100644
--- a/src/alejandra/tests/cases/idioms_pkgs_1/out.nix
+++ b/src/alejandra/tests/cases/idioms_pkgs_1/out.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
url = "example/${version}";
};
meta = with lib; {
- maintainers = with maintainers; [someone];
+ maintainers = with maintainers; [ someone ];
description = "something";
};
}
diff --git a/src/alejandra/tests/cases/idioms_pkgs_2/out.nix b/src/alejandra/tests/cases/idioms_pkgs_2/out.nix
index befac3b..2448b6e 100644
--- a/src/alejandra/tests/cases/idioms_pkgs_2/out.nix
+++ b/src/alejandra/tests/cases/idioms_pkgs_2/out.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
homepage = "https://www.gnu.org/software/hello/manual/";
changelog = "https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}";
license = licenses.gpl3Plus;
- maintainers = [maintainers.eelco];
+ maintainers = [ maintainers.eelco ];
platforms = platforms.all;
};
}
diff --git a/src/alejandra/tests/cases/idioms_pkgs_3/out.nix b/src/alejandra/tests/cases/idioms_pkgs_3/out.nix
index b2f555c..27f0329 100644
--- a/src/alejandra/tests/cases/idioms_pkgs_3/out.nix
+++ b/src/alejandra/tests/cases/idioms_pkgs_3/out.nix
@@ -134,7 +134,7 @@ in {
boot.initrd.availableKernelModules = mkOption {
type = types.listOf types.str;
default = [];
- example = ["sata_nv" "ext3"];
+ example = [ "sata_nv" "ext3" ];
description = ''
The set of kernel modules in the initial ramdisk used during the
boot process. This set must include all modules necessary for
@@ -265,20 +265,20 @@ in {
(mkIf (!config.boot.isContainer) {
system.build = { inherit kernel; };
- system.modulesTree = [kernel] ++ config.boot.extraModulePackages;
+ system.modulesTree = [ kernel ] ++ config.boot.extraModulePackages;
# Implement consoleLogLevel both in early boot and using sysctl
# (so you don't need to reboot to have changes take effect).
boot.kernelParams =
- ["loglevel=${toString config.boot.consoleLogLevel}"]
- ++ optionals config.boot.vesa ["vga=0x317" "nomodeset"];
+ [ "loglevel=${toString config.boot.consoleLogLevel}" ]
+ ++ optionals config.boot.vesa [ "vga=0x317" "nomodeset" ];
boot.kernel.sysctl."kernel.printk" = mkDefault config.boot.consoleLogLevel;
- boot.kernelModules = ["loop" "atkbd"];
+ boot.kernelModules = [ "loop" "atkbd" ];
# The Linux kernel >= 2.6.27 provides firmware.
- hardware.firmware = [kernel];
+ hardware.firmware = [ kernel ];
# Create /etc/modules-load.d/nixos.conf, which is read by
# systemd-modules-load.service to load required kernel modules.
@@ -287,8 +287,8 @@ in {
};
systemd.services.systemd-modules-load = {
- wantedBy = ["multi-user.target"];
- restartTriggers = [kernelModulesConf];
+ wantedBy = [ "multi-user.target" ];
+ restartTriggers = [ kernelModulesConf ];
serviceConfig = {
# Ignore failed module loads. Typically some of the
# modules in boot.kernelModules are "nice to have but
diff --git a/src/alejandra/tests/cases/lists/out.nix b/src/alejandra/tests/cases/lists/out.nix
index dedee64..43a9de3 100644
--- a/src/alejandra/tests/cases/lists/out.nix
+++ b/src/alejandra/tests/cases/lists/out.nix
@@ -1,11 +1,11 @@
[
- [1]
+ [ 1 ]
[
1
]
- [b d]
+ [ b d ]
[
b
d
diff --git a/src/alejandra/tests/cases/monsters_3/out.nix b/src/alejandra/tests/cases/monsters_3/out.nix
index 25ff805..fd242fb 100644
--- a/src/alejandra/tests/cases/monsters_3/out.nix
+++ b/src/alejandra/tests/cases/monsters_3/out.nix
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
wrapGAppsHook4
glib # for glib-compile-resources
];
- buildInputs = [cairo glib gtk4 libadwaita pango];
+ buildInputs = [ cairo glib gtk4 libadwaita pango ];
postPatch = ''
patchShebangs build-aux/meson_post_install.py
# https://gitlab.gnome.org/World/design/contrast/-/merge_requests/23
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
description = "Checks whether the contrast between two colors meet the WCAG requirements";
homepage = "https://gitlab.gnome.org/World/design/contrast";
license = licenses.gpl3Plus;
- maintainers = with maintainers; [jtojnar];
+ maintainers = with maintainers; [ jtojnar ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,16 @@
{alejandra, ...}:
alejandra.overrideAttrs (prev: {
pname = "alejandra-custom";
version = "0-unstable-2024-07-21";
patches =
(prev.patches or [])
++ [
./0001-no-ads.patch
./0002-spaced-elements.patch # Courtesy of @soupglasses
];
meta.description = ''
Patched version of Alejandra that removes ads and adds spaces in attrsets & lists
'';
})

24
pkgs/ani-cli/package.nix Normal file
View file

@ -0,0 +1,24 @@
{
pins,
lib,
fetchFromGitHub,
ani-cli,
...
}:
ani-cli.overrideAttrs (let
pin = pins.ani-cli;
in {
pname = "ani-cli";
inherit (pin) version;
src = fetchFromGitHub {
inherit (pin.repository) owner repo;
sha256 = pin.hash;
rev = pin.revision;
};
meta = {
description = "An auto-upgrading version of ani-cli to ensure we are always up to date with scrapers";
maintainers = with lib.maintainers; [NotAShelf];
};
})

View file

@ -1,6 +0,0 @@
# ani-cli
ani-cli is already in nixpkgs. The sole reason it's been put in this overlay is so that
I can receive the updates _as they happen_ and not wait until a maintainer bumps it up.
The source for ani-cli is updated periodically.

View file

@ -1,43 +0,0 @@
{
fetchFromGitHub,
makeWrapper,
stdenvNoCC,
lib,
gnugrep,
gnused,
wget,
fzf,
mpv,
aria2,
pins,
}: let
pin = pins.ani-cli;
in
stdenvNoCC.mkDerivation {
pname = "ani-cli";
inherit (pin) version;
src = fetchFromGitHub {
inherit (pin.repository) owner repo;
sha256 = pin.hash;
rev = pin.revision;
};
nativeBuildInputs = [makeWrapper];
installPhase = ''
runHook preInstall
install -Dm755 ani-cli $out/bin/ani-cli
wrapProgram $out/bin/ani-cli \
--prefix PATH : ${lib.makeBinPath [gnugrep gnused wget fzf mpv aria2]}
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/pystardust/ani-cli";
description = "A cli tool to browse and play anime";
license = licenses.gpl3Plus;
maintainers = with maintainers; [NotAShelf];
platforms = platforms.unix;
};
}

View file

@ -1,69 +0,0 @@
{
lib,
fetchFromGitHub,
# python
python3,
# runtime dependencies
ffmpeg,
fzf,
mpv,
}:
python3.pkgs.buildPythonPackage {
pname = "mov-cli";
version = "2024-03-14-unstable";
pyproject = true;
src = fetchFromGitHub {
owner = "mov-cli";
repo = "mov-cli";
rev = "620c46a4426cedda1b8cd4739c8ab3faeccae187";
hash = "sha256-l2CwHbvtRZ+tktwF3+zJj4KM4tCN0sRf/o654FWs0C4=";
};
makeWrapperArgs = let
binPath = lib.makeBinPath [
ffmpeg
fzf
mpv
];
in [
"--prefix PATH : ${binPath}"
];
propagatedBuildInputs = with python3.pkgs; [
beautifulsoup4
click
colorama
httpx
krfzf-py
lxml
poetry-core
pycrypto
setuptools
six
tldextract
toml
inquirer
unidecode
];
build-system = [
python3.pkgs.setuptools-scm
];
nativeBuildInputs = [
python3.pkgs.pythonRelaxDepsHook
];
pythonRelaxDeps = [
"httpx"
"tldextract"
];
meta = {
homepage = "https://github.com/mov-cli/mov-cli";
description = "A cli tool to browse and watch movies";
license = lib.licenses.gpl3Only;
mainProgram = "mov-cli";
};
}

View file

@ -1,47 +0,0 @@
{
pins,
lib,
disableHardening ? true,
fetchFromGitHub,
stdenv,
unixtools,
}:
assert disableHardening -> lib.warn "nyxpkgs/rat disables hardening to avoid segfaults. You may want to consider overriding the package if this is undesirable" true; let
pin = pins.rat;
pname = "rat";
version = "2.0.1";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchFromGitHub {
inherit (pin.repository) owner repo;
sha256 = pin.hash;
rev = pin.revision;
};
# the code is so unsafe, it doesn't work with even one of hardening flags
# lol
hardeningDisable = lib.optionals disableHardening ["all"];
buildInputs = [unixtools.xxd];
buildPhase = ''
runHook preBuild
make linux_audio
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -Dm755 ./bin/rat -t "$out/bin/"
runHook postInstall
'';
meta = {
description = "rat";
homepage = "https://github.com/thinkingsand/rat";
maintainers = with lib.maintainers; [NotAShelf];
};
}

View file

@ -1,26 +0,0 @@
From 0eaef67b683683fb423fcb2d5096b3cdf9a4a9cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= <mkg20001@gmail.com>
Date: Sun, 22 Mar 2020 12:26:10 +0100
Subject: [PATCH] Patch plugindir to output
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 50edb74..639ee86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,7 +50,7 @@ PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.40 gio-unix-2.0 gmodule-2.0 ])
PKG_CHECK_MODULES([cairo], [cairo])
PKG_CHECK_MODULES([rofi], [rofi >= 1.5.4])
-[rofi_PLUGIN_INSTALL_DIR]="`$PKG_CONFIG --variable=pluginsdir rofi`"
+[rofi_PLUGIN_INSTALL_DIR]="`echo $out/lib/rofi`"
AC_SUBST([rofi_PLUGIN_INSTALL_DIR])
LT_INIT([disable-static])
--
2.25.1

View file

@ -1,56 +0,0 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
rofi-wayland-unwrapped,
libqalculate,
glib,
cairo,
gobject-introspection,
wrapGAppsHook,
pins,
...
}: let
pin = pins.rofi-calc;
in
stdenv.mkDerivation {
pname = "rofi-calc-wayland";
inherit (pin) version;
src = fetchFromGitHub {
inherit (pin.repository) owner repo;
sha256 = pin.hash;
rev = pin.revision;
};
nativeBuildInputs = [
autoreconfHook
pkg-config
gobject-introspection
wrapGAppsHook
];
buildInputs = [
rofi-wayland-unwrapped
libqalculate
glib
cairo
];
patches = [
../patches/0001-patch-plugin-dir.patch
];
postPatch = ''
sed "s|qalc_binary = \"qalc\"|qalc_binary = \"${libqalculate}/bin/qalc\"|" -i src/calc.c
'';
meta = with lib; {
description = "Do live calculations in rofi!";
homepage = "https://github.com/svenstaro/rofi-calc";
license = licenses.mit;
platforms = with platforms; linux;
};
}

View file

@ -1,65 +0,0 @@
{
stdenv,
lib,
fetchFromGitHub,
makeWrapper,
autoreconfHook,
pkg-config,
cairo,
glib,
libnotify,
rofi-wayland-unwrapped,
wl-clipboard,
wtype,
pins,
...
}: let
pin = pins.rofi-emoji;
in
stdenv.mkDerivation {
pname = "rofi-emoji-wayland";
inherit (pin) version;
src = fetchFromGitHub {
inherit (pin.repository) owner repo;
sha256 = pin.hash;
rev = pin.revision;
};
nativeBuildInputs = [
autoreconfHook
pkg-config
makeWrapper
];
buildInputs = [
cairo
glib
libnotify
rofi-wayland-unwrapped
wl-clipboard
wtype
];
patches = [
../patches/0001-patch-plugin-dir.patch
];
postPatch = ''
patchShebangs clipboard-adapter.sh
'';
postFixup = ''
chmod +x $out/share/rofi-emoji/clipboard-adapter.sh
wrapProgram $out/share/rofi-emoji/clipboard-adapter.sh \
--prefix PATH ":" ${lib.makeBinPath [libnotify wl-clipboard wtype]}
'';
meta = {
description = "An emoji selector plugin for Rofi";
homepage = "https://github.com/Mange/rofi-emoji";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [NotAShelf];
platforms = lib.platforms.linux;
};
}

View file

@ -1,36 +0,0 @@
{
stdenv,
fetchurl,
unzip,
lib,
}:
stdenv.mkDerivation rec {
pname = "headscale-ui";
version = "2023.01.30-beta-1";
src = fetchurl {
url = "https://github.com/gurucomputing/${pname}/releases/download/${version}/headscale-ui.zip";
sha256 = "sha256-6SUgtSTFvJWNdsWz6AiOfUM9p33+8EhDwyqHX7O2+NQ=";
};
buildInputs = [unzip];
dontStrip = true;
unpackPhase = ''
runHook preUnpack
unzip $src
runHook postUnpack
'';
installPhase = ''
mkdir -p $out/share/
cp -r web/ $out/share/
'';
meta = {
description = "A web frontend for the headscale Tailscale-compatible coordination server";
homepage = "https://github.com/gurucomputing/headscale-ui";
license = [lib.licenses.bsd3];
};
}

View file

@ -1,16 +0,0 @@
{
lib,
mpvScripts,
}:
mpvScripts.buildLua {
pname = "save-history";
version = "unstable-2024-03-18";
src = builtins.filterSource (path: type: type != "directory" || (!lib.hasSuffix path ".nix")) ./.;
meta = {
description = "Save history of played files";
homepage = "https://github.com/notashelf/nyxpkgs";
maintainers = [lib.maintainers.NotAShelf];
};
}

View file

@ -1,12 +0,0 @@
local HISTFILE = (os.getenv('XDG_DATA_HOME') or os.getenv('HOME')) .. '/mpv/history.log';
mp.register_event('file-loaded', function()
local title, fp;
title = mp.get_property('media-title');
title = (title == mp.get_property('filename') and "" or (' (%s)'):format(title));
fp = io.open(HISTFILE, 'a+');
fp:write(('[%s] %s%s\n'):format(os.date('%Y-%m-%d %X'), mp.get_property('path'), title));
fp:close();
end)

View file

@ -1,25 +0,0 @@
{inputs, ...}: {
systems = ["x86_64-linux"];
imports = [inputs.flake-parts.flakeModules.easyOverlay];
perSystem = {
config,
system,
pkgs,
...
}: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
packages = let
pins = import ../npins;
inherit (pkgs) callPackage;
mkPackage = path: {__functor = self: self.override;} // (callPackage path {inherit pins;});
in
import ./top-level.nix {inherit pkgs callPackage mkPackage;};
};
}

View file

@ -1,13 +0,0 @@
{gnome-control-center, ...}:
gnome-control-center.overrideAttrs (prev: let
gwrapperArgs = ''
# gnome-control-center does not start without XDG_CURRENT_DESKTOP=gnome
gappsWrapperArgs+=(
--set XDG_CURRENT_DESKTOP "gnome"
);
'';
in {
pname = "gnome-control-center-wrapped";
preFixup =
(prev.preFixup or "") + gwrapperArgs;
})

View file

@ -0,0 +1,26 @@
{
stdenv,
fetchzip,
lib,
}: let
pname = "headscale-ui";
version = "0-unstable-2024-02-24";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchzip {
url = "https://github.com/gurucomputing/headscale-ui/releases/download/2024.02.24-beta-1/headscale-ui.zip";
sha256 = "sha256-6SUgtSTFvJWNdsWz6AiOfUM9p33+8EhDwyqHX7O2+NQ=";
};
installPhase = ''
mkdir -p $out/share/
cp -r web/ $out/share/
'';
meta = {
description = "A web frontend for the headscale Tailscale-compatible coordination server";
homepage = "https://github.com/gurucomputing/headscale-ui";
license = [lib.licenses.bsd3];
};
}

View file

@ -5,30 +5,30 @@
...
}:
mastodon.overrideAttrs (_: {
mastodonModules = mastodon.mastodonModules.overrideAttrs (oldMods: let
mastodonModules = mastodon.mastodonModules.overrideAttrs (oldAttrs: let
# https://github.com/ronilaukkarinen/mastodon-bird-ui
birdui-version = "1.8.2";
birdui-version = "1.8.5";
birdui-single-column = fetchurl {
url = "https://raw.githubusercontent.com/ronilaukkarinen/mastodon-bird-ui/${birdui-version}/layout-single-column.css";
sha256 = "sha256-hzBWRRx9TjE8PdjL7WsNq46+W68kVG/4zPhUHOn0lnY=";
sha256 = "sha256-h3cb0ZiXIUEbx+8CDXPHqKe4u3ZquE90wUr/cmKkhK8=";
};
birdui-multi-column = fetchurl {
url = "https://raw.githubusercontent.com/ronilaukkarinen/mastodon-bird-ui/${birdui-version}/layout-multiple-columns.css";
sha256 = "sha256-MakviIcmIQxqQUCDtKbLXxBq4UDUSAyAo0fpcIec4HM=";
sha256 = "sha256-NMiBkJUR+HEf+ooJwoBIMiMOKna3odZYF6h4QLIdS84=";
};
in {
pname = "${oldMods.pname}+themes";
pname = "${oldAttrs.pname}+themes";
postPatch = ''
# Import theme
styleDir=$PWD/app/javascript/styles
birduiDir=$styleDir/mastodon-bird-ui
local styleDir=$PWD/app/javascript/styles
local birduiDir=$styleDir/mastodon-bird-ui
mkdir -p $birduiDir
cat ${birdui-single-column} >$birduiDir/layout-single-column.scss
cat ${birdui-multi-column} >$birduiDir/layout-multiple-columns.scss
cat ${birdui-single-column} > $birduiDir/layout-single-column.scss
cat ${birdui-multi-column} > $birduiDir/layout-multiple-columns.scss
sed -i 's/theme-contrast/theme-mastodon-bird-ui-contrast/g' $birduiDir/layout-single-column.scss
sed -i 's/theme-mastodon-light/theme-mastodon-bird-ui-light/g' $birduiDir/layout-single-column.scss
@ -43,9 +43,9 @@ mastodon.overrideAttrs (_: {
echo -e "@import 'application';\n@import 'mastodon-bird-ui/layout-single-column.scss';\n@import 'mastodon-bird-ui/layout-multiple-columns.scss';" >$styleDir/mastodon-bird-ui-dark.scss
# Build theme
echo "mastodon-bird-ui-dark: styles/mastodon-bird-ui-dark.scss" >>$PWD/config/themes.yml
echo "mastodon-bird-ui-light: styles/mastodon-bird-ui-light.scss" >>$PWD/config/themes.yml
echo "mastodon-bird-ui-contrast: styles/mastodon-bird-ui-contrast.scss" >>$PWD/config/themes.yml
echo "mastodon-bird-ui-dark: styles/mastodon-bird-ui-dark.scss" >> $PWD/config/themes.yml
echo "mastodon-bird-ui-light: styles/mastodon-bird-ui-light.scss" >> $PWD/config/themes.yml
echo "mastodon-bird-ui-contrast: styles/mastodon-bird-ui-contrast.scss" >> $PWD/config/themes.yml
'';
});
@ -53,9 +53,9 @@ mastodon.overrideAttrs (_: {
postBuild = ''
# Make theme available
echo "mastodon-bird-ui-dark: styles/mastodon-bird-ui-dark.scss" >>$PWD/config/themes.yml
echo "mastodon-bird-ui-light: styles/mastodon-bird-ui-light.scss" >>$PWD/config/themes.yml
echo "mastodon-bird-ui-contrast: styles/mastodon-bird-ui-contrast.scss" >>$PWD/config/themes.yml
echo "mastodon-bird-ui-dark: styles/mastodon-bird-ui-dark.scss" >> $PWD/config/themes.yml
echo "mastodon-bird-ui-light: styles/mastodon-bird-ui-light.scss" >> $PWD/config/themes.yml
echo "mastodon-bird-ui-contrast: styles/mastodon-bird-ui-contrast.scss" >> $PWD/config/themes.yml
yq -i '.en.themes.mastodon-bird-ui-dark = "Mastodon Bird UI (Dark)"' $PWD/config/locales/en.yml
yq -i '.en.themes.mastodon-bird-ui-light = "Mastodon Bird UI (Light)"' $PWD/config/locales/en.yml

View file

@ -1,4 +0,0 @@
{alejandra, ...}:
alejandra.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [./0001-no-ads.patch];
})

View file

@ -1,27 +0,0 @@
{
pkgs,
mkPackage,
callPackage,
...
}: {
# packages that follow npins entries
# they can be updated via npins
ani-cli = mkPackage ./applications/misc/ani-cli;
rat = mkPackage ./applications/misc/rat;
rofi-calc-wayland = mkPackage ./applications/misc/rofi-plugins/rofi-calc-wayland;
rofi-emoji-wayland = mkPackage ./applications/misc/rofi-plugins/rofi-emoji-wayland;
# static packages
# need manual intervention with each update
cloneit = callPackage ./applications/misc/cloneit {};
mov-cli = callPackage ./applications/misc/mov-cli {};
mpv-history = callPackage ./applications/video/mpv/scripts/save-history {};
mastodon-bird-ui = callPackage ./applications/social/mastodon-bird-ui {};
headscale-ui = callPackage ./applications/networking/headscale-ui {};
# patched packages
# those packages usually follow nixpkgs, so they need neither pinning
# nor manual intervention
foot-transparent = callPackage ./applications/terminal-emulators/foot-transparent {};
alejandra-no-ads = callPackage ./tools/nix/alejandra-no-ads {};
}