flake: rewrite to use flake-parts

This commit is contained in:
Infinidoge 2023-07-28 15:30:10 -04:00
parent 728a071b52
commit 50debb5dec
21 changed files with 445 additions and 760 deletions

View file

@ -1,22 +0,0 @@
{
"qtile": {
"cargoLocks": null,
"date": "2023-03-31",
"extract": null,
"name": "qtile",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "qtile",
"repo": "qtile",
"rev": "e88537fbcce9e8e0de3349c566de4fda9a225e96",
"sha256": "sha256-FEiI7T4whhClb8nCrk+CxlihyMVuM3c6EcnmttPszAU=",
"type": "github"
},
"version": "e88537fbcce9e8e0de3349c566de4fda9a225e96"
}
}

View file

@ -1,16 +0,0 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
{
qtile = {
pname = "qtile";
version = "e88537fbcce9e8e0de3349c566de4fda9a225e96";
src = fetchFromGitHub ({
owner = "qtile";
repo = "qtile";
rev = "e88537fbcce9e8e0de3349c566de4fda9a225e96";
fetchSubmodules = false;
sha256 = "sha256-FEiI7T4whhClb8nCrk+CxlihyMVuM3c6EcnmttPszAU=";
});
date = "2023-03-31";
};
}

11
pkgs/all-packages.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs }:
{
hexagon = pkgs.callPackage ./hexagon.nix { };
mcaselector = pkgs.callPackage ./mcaselector.nix { };
nix-modrinth-prefetch = pkgs.callPackage ./nix-modrinth-prefetch.nix { };
olympus = pkgs.callPackage ./olympus.nix { };
setris = pkgs.callPackage ./setris.nix { };
sim65 = pkgs.callPackage ./sim65.nix { };
substituteSubset = pkgs.callPackage ./substitute-subset.nix { };
unbted = pkgs.callPackage ./unbted.nix { };
}

View file

@ -1,15 +1,13 @@
final: prev: {
# keep sources this first
sources = prev.callPackage (import ./_sources/generated.nix) { };
# then, call packages with `final.callPackage`
{ self, lib, ... }:
{
perSystem = { pkgs, ... }:
let
allPackages = import ./all-packages.nix { inherit pkgs; };
in
{
packages = lib.filterAttrs (_: v: lib.isDerivation v) allPackages;
legacyPackages = lib.filterAttrs (_: v: !(lib.isDerivation v)) allPackages;
};
hexagon = final.callPackage ./hexagon.nix { };
mcaselector = final.callPackage ./mcaselector.nix { };
nix-modrinth-prefetch = final.callPackage ./nix-modrinth-prefetch.nix { };
olympus = final.callPackage ./olympus.nix { };
qtile-unstable = final.callPackage ./qtile.nix { source = final.sources.qtile; };
setris = final.callPackage ./setris.nix { };
sim65 = final.callPackage ./sim65.nix { };
substituteSubset = final.callPackage ./substitute-subset.nix { };
unbted = final.callPackage ./unbted.nix { };
flake.overlays.packages = final: prev: (import ./all-packages.nix { pkgs = prev; });
}

View file

@ -30,7 +30,7 @@ let
};
in
buildFHSUserEnv {
name = "olympus";
inherit (olympus) name;
runScript = "${olympus}/opt/olympus/olympus";
targetPkgs = pkgs: [
pkgs.freetype

View file

@ -1,22 +0,0 @@
diff --git a/libqtile/core/lifecycle.py b/libqtile/core/lifecycle.py
index 0d4d119d..c37d1799 100644
--- a/libqtile/core/lifecycle.py
+++ b/libqtile/core/lifecycle.py
@@ -25,7 +25,7 @@ class LifeCycle:
def _atexit(self) -> None:
if self.behavior is Behavior.RESTART:
- argv = [sys.executable] + sys.argv
+ argv = sys.argv
if "--no-spawn" not in argv:
argv.append("--no-spawn")
argv = [s for s in argv if not s.startswith("--with-state")]
@@ -33,7 +33,7 @@ class LifeCycle:
argv.append("--with-state=" + self.state_file)
logger.warning("Restarting Qtile with os.execv(...)")
# No other code will execute after the following line does
- os.execv(sys.executable, argv)
+ os.execv(sys.argv[0], argv)
elif self.behavior is Behavior.TERMINATE:
logger.warning("Qtile will now terminate")
elif self.behavior is Behavior.NONE:

View file

@ -1,90 +0,0 @@
{ lib
, fetchFromGitHub
, python3
, python3Packages
, mypy
, glib
, pango
, pkg-config
, libinput
, libxkbcommon
, wayland
, wlroots
, xcbutilcursor
, source
}:
let
unwrapped = python3Packages.buildPythonPackage rec {
inherit (source) pname src;
version = "0.0.0+${source.version}";
patches = [
./patches/qtile-fix-restart.patch # https://github.com/NixOS/nixpkgs/issues/139568
];
postPatch = ''
substituteInPlace libqtile/pangocffi.py \
--replace libgobject-2.0.so.0 ${glib.out}/lib/libgobject-2.0.so.0 \
--replace libpangocairo-1.0.so.0 ${pango.out}/lib/libpangocairo-1.0.so.0 \
--replace libpango-1.0.so.0 ${pango.out}/lib/libpango-1.0.so.0
substituteInPlace libqtile/backend/x11/xcursors.py \
--replace libxcb-cursor.so.0 ${xcbutilcursor.out}/lib/libxcb-cursor.so.0
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [
pkg-config
] ++ (with python3Packages; [
setuptools-scm
]);
propagatedBuildInputs = with python3Packages; [
xcffib
(cairocffi.override { withXcffib = true; })
setuptools
python-dateutil
dbus-python
dbus-next
mpd2
psutil
pyxdg
pygobject3
pywayland
pywlroots
xkbcommon
];
buildInputs = [
libinput
wayland
wlroots
libxkbcommon
];
# for `qtile check`, needs `stubtest` and `mypy` commands
makeWrapperArgs = [
"--suffix PATH : ${lib.makeBinPath [ mypy ]}"
];
doCheck = false; # Requires X server #TODO this can be worked out with the existing NixOS testing infrastructure.
meta = with lib; {
homepage = "http://www.qtile.org/";
license = licenses.mit;
description = "A small, flexible, scriptable tiling window manager written in Python";
platforms = platforms.linux;
maintainers = with maintainers; [ kamilchm ];
};
};
in
(python3.withPackages (_: [ unwrapped ])).overrideAttrs (_: {
# otherwise will be exported as "env", this restores `nix search` behavior
name = "${unwrapped.pname}-${unwrapped.version}";
# export underlying qtile package
passthru = { inherit unwrapped; };
# restore original qtile attrs
inherit (unwrapped) pname version meta;
})

View file

@ -1,4 +0,0 @@
# nvfetcher toml
[qtile]
src.git = "https://github.com/qtile/qtile.git"
fetch.github = "qtile/qtile"