Merge pull request #9 from NotAShelf/follow-nixpkgs-structure

treewide: transition to nixpkgs-like repo structure
This commit is contained in:
raf 2024-03-18 17:12:06 +03:00 committed by GitHub
commit c62945563c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 112 additions and 68 deletions

View file

@ -12,16 +12,16 @@ jobs:
strategy: strategy:
matrix: matrix:
package: package:
- foot-transparent - alejandra-no-ads
- ani-cli
- cloneit - cloneit
- foot-transparent
- mov-cli - mov-cli
- rat - rat
- ani-cli
- rofi-calc-wayland - rofi-calc-wayland
- rofi-emoji-wayland - rofi-emoji-wayland
- headscale-ui - headscale-ui
- mastodon-bird-ui - mastodon-bird-ui
- mastodon-bird-ui
uses: ./.github/workflows/nix.yml uses: ./.github/workflows/nix.yml
with: with:

View file

@ -23,3 +23,4 @@ index 50edb74..639ee86 100644
-- --
2.25.1 2.25.1

View file

@ -40,7 +40,7 @@ in
]; ];
patches = [ patches = [
../../patches/0002-patch-plugin-dir.patch ../patches/0001-patch-plugin-dir.patch
]; ];
postPatch = '' postPatch = ''

View file

@ -42,7 +42,7 @@ in
]; ];
patches = [ patches = [
../../patches/0002-patch-plugin-dir.patch ../patches/0001-patch-plugin-dir.patch
]; ];
postPatch = '' postPatch = ''

View file

@ -108,3 +108,4 @@ index 91472027..847984a9 100644
struct buffer *buf = shm_get_buffer( struct buffer *buf = shm_get_buffer(
chain, term->width, term->height, use_alpha); chain, term->width, term->height, use_alpha);

View file

@ -0,0 +1,26 @@
{
lib,
fetchFromGitea,
foot,
...
}:
foot.overrideAttrs (prev: let
version = "2024-03-14-unstable";
in {
inherit version;
src = fetchFromGitea {
domain = "codeberg.org";
owner = "dnkl";
repo = "foot";
rev = "dd3bb13d97b405495465357f7b7b17c9f2bba3c2";
hash = "sha256-Pp3/cNELRYmTOQrJgHX6c+t0QkxEjoly0TLMKVj3H0E=";
};
patches = (prev.patches or []) ++ [./0001-fullscreen-transparency.patch];
mesonFlags = (prev.mesonFlags or []) ++ ["-Dfullscreen_alpha=true"];
meta = {
mainProgram = "foot";
maintainers = with lib.maintainers; [NotAShelf];
};
})

View file

@ -0,0 +1,16 @@
{
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

@ -0,0 +1,12 @@
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

@ -15,71 +15,11 @@
}; };
packages = let packages = let
inherit (pkgs) callPackage fetchFromGitea foot alejandra;
pins = import ../npins; pins = import ../npins;
inherit (pkgs) callPackage;
mkPackage = path: {__functor = self: self.override;} // (callPackage path {inherit pins;}); mkPackage = path: {__functor = self: self.override;} // (callPackage path {inherit pins;});
in { in
/* import ./top-level.nix {inherit pkgs callPackage mkPackage;};
packages that follow npins entries
they can be updated via npins
*/
ani-cli = mkPackage ./ani-cli;
rat = mkPackage ./rat;
rofi-calc-wayland = mkPackage ./rofi-calc-wayland;
rofi-emoji-wayland = mkPackage ./rofi-emoji-wayland;
/*
static packages
need manual intervention with each update
*/
mov-cli = callPackage ./mov-cli {};
cloneit = callPackage ./cloneit {};
headscale-ui = callPackage ./headscale-ui {};
mastodon-bird-ui = callPackage ./mastodon-bird-ui {};
reposilite-bin = callPackage ./reposilite-bin {
javaJdk = pkgs.openjdk_headless;
};
/*
patched packages
patches packages take a package from nixpkgs and patch it to suit my own needs
*/
foot-transparent = foot.overrideAttrs (prev: let
version = "2024-03-14-unstable";
in {
inherit version;
src = fetchFromGitea {
domain = "codeberg.org";
owner = "dnkl";
repo = "foot";
rev = "dd3bb13d97b405495465357f7b7b17c9f2bba3c2";
hash = "sha256-Pp3/cNELRYmTOQrJgHX6c+t0QkxEjoly0TLMKVj3H0E=";
};
patches = (prev.patches or []) ++ [../patches/0001-foot-transparent.patch];
mesonFlags = (prev.mesonFlags or []) ++ ["-Dfullscreen_alpha=true"];
meta.mainProgram = "foot";
});
alejandra-no-ads = alejandra.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [../patches/0003-alejandra-remove-ads.patch];
});
# override gnome-control-center to trick it into thinking we're running gnome
# <https://github.com/NixOS/nixpkgs/issues/230493>
# <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/736>
gccn-wrapped = pkgs.gnome.gnome-control-center.overrideAttrs (prev: {
# gnome-control-center does not start without XDG_CURRENT_DESKTOP=gnome
preFixup =
''
gappsWrapperArgs+=(
--set XDG_CURRENT_DESKTOP "gnome"
);
''
+ prev.preFixup;
});
};
}; };
} }

View file

@ -0,0 +1,13 @@
{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

@ -41,3 +41,4 @@ index fd49ce8..258f656 100644
mod find; mod find;
mod verbosity; mod verbosity;

View file

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

30
pkgs/top-level.nix Normal file
View file

@ -0,0 +1,30 @@
{
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 {};
reposilite-bin = callPackage ./applications/networking/reposilite-bin {
javaJdk = pkgs.openjdk_headless;
};
# 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 {};
}