From 52f2d8711f6e7a27d92959d8ed49be1c2f37d152 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 1 Dec 2023 03:42:56 -0500 Subject: [PATCH] refactor(overlays): change dir structure --- common/default.nix | 1 + .../{blueberry.nix => blueberry/default.nix} | 2 +- .../{patches => blueberry}/wayland.patch | 0 common/overlays/default.nix | 24 ++++--------------- .../default.nix} | 4 ++-- .../dracula-plymouth.patch | 0 common/overlays/patches/swayosd.patch | 21 ---------------- .../regreet.patch => regreet/crash-fix.patch} | 0 .../{regreet.nix => regreet/default.nix} | 2 +- .../default.nix} | 4 +--- .../remove-panel.patch | 0 common/{overlays => }/pkgs/coloryou/LICENSE | 0 .../{overlays => }/pkgs/coloryou/coloryou.py | 0 .../{overlays => }/pkgs/coloryou/default.nix | 0 .../pkgs/coloryou/requirements.txt | 0 common/{overlays => }/pkgs/coloryou/setup.py | 0 common/{overlays => }/pkgs/coloryou/shell.nix | 0 common/pkgs/default.nix | 12 ++++++++++ .../input-emulator/default.nix} | 0 .../pam-fprint-grosshack/default.nix} | 0 .../spotifywm/default.nix} | 0 21 files changed, 22 insertions(+), 48 deletions(-) rename common/overlays/{blueberry.nix => blueberry/default.nix} (87%) rename common/overlays/{patches => blueberry}/wayland.patch (100%) rename common/overlays/{dracula-theme.nix => dracula-theme/default.nix} (98%) rename common/overlays/{patches => dracula-theme}/dracula-plymouth.patch (100%) delete mode 100644 common/overlays/patches/swayosd.patch rename common/overlays/{patches/regreet.patch => regreet/crash-fix.patch} (100%) rename common/overlays/{regreet.nix => regreet/default.nix} (93%) rename common/overlays/{squeekboard.nix => squeekboard/default.nix} (66%) rename common/overlays/{patches => squeekboard}/remove-panel.patch (100%) rename common/{overlays => }/pkgs/coloryou/LICENSE (100%) rename common/{overlays => }/pkgs/coloryou/coloryou.py (100%) rename common/{overlays => }/pkgs/coloryou/default.nix (100%) rename common/{overlays => }/pkgs/coloryou/requirements.txt (100%) rename common/{overlays => }/pkgs/coloryou/setup.py (100%) rename common/{overlays => }/pkgs/coloryou/shell.nix (100%) create mode 100644 common/pkgs/default.nix rename common/{overlays/pkgs/input-emulator.nix => pkgs/input-emulator/default.nix} (100%) rename common/{overlays/pkgs/pam-fprint-grosshack.nix => pkgs/pam-fprint-grosshack/default.nix} (100%) rename common/{overlays/pkgs/spotifywm.nix => pkgs/spotifywm/default.nix} (100%) diff --git a/common/default.nix b/common/default.nix index 3ffa786b..0da761f8 100644 --- a/common/default.nix +++ b/common/default.nix @@ -14,6 +14,7 @@ ./modules ./overlays + ./pkgs nur.nixosModules.nur nh.nixosModules.default diff --git a/common/overlays/blueberry.nix b/common/overlays/blueberry/default.nix similarity index 87% rename from common/overlays/blueberry.nix rename to common/overlays/blueberry/default.nix index 27a5dedd..efc81ba7 100644 --- a/common/overlays/blueberry.nix +++ b/common/overlays/blueberry/default.nix @@ -3,7 +3,7 @@ final: prev: { patches = (o.patches or []) ++ [ - ./patches/wayland.patch + ./wayland.patch ]; buildInputs = (o.buildInputs or []) diff --git a/common/overlays/patches/wayland.patch b/common/overlays/blueberry/wayland.patch similarity index 100% rename from common/overlays/patches/wayland.patch rename to common/overlays/blueberry/wayland.patch diff --git a/common/overlays/default.nix b/common/overlays/default.nix index 3fa92ac4..d1a76df9 100644 --- a/common/overlays/default.nix +++ b/common/overlays/default.nix @@ -1,30 +1,14 @@ {neovim-flake, nixpkgs-wayland, ...}: { imports = [ - ./dracula-theme.nix - ./regreet.nix + ./dracula-theme + ./regreet ]; nixpkgs.overlays = [ - (import ./blueberry.nix) - (import ./squeekboard.nix) + (import ./blueberry) + (import ./squeekboard) neovim-flake.overlay nixpkgs-wayland.overlay - - (final: prev: { - spotifywm = final.callPackage ./pkgs/spotifywm.nix {}; - }) - - (final: prev: { - input-emulator = final.callPackage ./pkgs/input-emulator.nix {}; - }) - - (final: prev: { - pam-fprint-grosshack = final.callPackage ./pkgs/pam-fprint-grosshack.nix {}; - }) - - (final: prev: { - coloryou = final.callPackage ./pkgs/coloryou/default.nix {}; - }) ]; } diff --git a/common/overlays/dracula-theme.nix b/common/overlays/dracula-theme/default.nix similarity index 98% rename from common/overlays/dracula-theme.nix rename to common/overlays/dracula-theme/default.nix index c821c407..72cebe53 100644 --- a/common/overlays/dracula-theme.nix +++ b/common/overlays/dracula-theme/default.nix @@ -6,7 +6,7 @@ hash = "sha256-7YwkBzkAND9lfH2ewuwna1zUkQStBBx4JHGw3/+svhA="; }; - dracula-script = ./patches/dracula-plymouth.patch; + dracula-script = ./dracula-plymouth.patch; git-colors = pkgs.fetchFromGitHub { owner = "dracula"; @@ -29,7 +29,7 @@ in { nixpkgs.overlays = [ (final: prev: { - dracula-theme = prev.dracula-theme.overrideAttrs (oldAttrs: rec { + dracula-theme = prev.dracula-theme.overrideAttrs (oldAttrs: { src = prev.fetchFromGitHub { owner = "dracula"; repo = "gtk"; diff --git a/common/overlays/patches/dracula-plymouth.patch b/common/overlays/dracula-theme/dracula-plymouth.patch similarity index 100% rename from common/overlays/patches/dracula-plymouth.patch rename to common/overlays/dracula-theme/dracula-plymouth.patch diff --git a/common/overlays/patches/swayosd.patch b/common/overlays/patches/swayosd.patch deleted file mode 100644 index cf5f893c..00000000 --- a/common/overlays/patches/swayosd.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/data/meson.build b/data/meson.build -index 1ceaa11..68decdf 100644 ---- a/data/meson.build -+++ b/data/meson.build -@@ -42,11 +42,7 @@ - configure_file( - - # Systemd service unit - systemd = dependency('systemd', required: false) --if systemd.found() -- systemd_service_install_dir = systemd.get_variable(pkgconfig :'systemdsystemunitdir') --else -- systemd_service_install_dir = join_paths(libdir, 'systemd', 'system') --endif -+systemd_service_install_dir = join_paths(libdir, 'systemd', 'system') - - configure_file( - configuration: conf_data, --- -2.41.0 - diff --git a/common/overlays/patches/regreet.patch b/common/overlays/regreet/crash-fix.patch similarity index 100% rename from common/overlays/patches/regreet.patch rename to common/overlays/regreet/crash-fix.patch diff --git a/common/overlays/regreet.nix b/common/overlays/regreet/default.nix similarity index 93% rename from common/overlays/regreet.nix rename to common/overlays/regreet/default.nix index a6632fe1..1867c7ca 100644 --- a/common/overlays/regreet.nix +++ b/common/overlays/regreet/default.nix @@ -14,7 +14,7 @@ }); # temp fix until https://github.com/rharish101/ReGreet/issues/32 is solved - patches = [./patches/regreet.patch]; + patches = [./crash-fix.patch]; }); }; } diff --git a/common/overlays/squeekboard.nix b/common/overlays/squeekboard/default.nix similarity index 66% rename from common/overlays/squeekboard.nix rename to common/overlays/squeekboard/default.nix index 8f8a4eb9..a310c984 100644 --- a/common/overlays/squeekboard.nix +++ b/common/overlays/squeekboard/default.nix @@ -2,8 +2,6 @@ final: prev: { squeekboard = prev.squeekboard.overrideAttrs (o: { patches = (o.patches or []) - ++ [ - ./patches/remove-panel.patch - ]; + ++ [./remove-panel.patch]; }); } diff --git a/common/overlays/patches/remove-panel.patch b/common/overlays/squeekboard/remove-panel.patch similarity index 100% rename from common/overlays/patches/remove-panel.patch rename to common/overlays/squeekboard/remove-panel.patch diff --git a/common/overlays/pkgs/coloryou/LICENSE b/common/pkgs/coloryou/LICENSE similarity index 100% rename from common/overlays/pkgs/coloryou/LICENSE rename to common/pkgs/coloryou/LICENSE diff --git a/common/overlays/pkgs/coloryou/coloryou.py b/common/pkgs/coloryou/coloryou.py similarity index 100% rename from common/overlays/pkgs/coloryou/coloryou.py rename to common/pkgs/coloryou/coloryou.py diff --git a/common/overlays/pkgs/coloryou/default.nix b/common/pkgs/coloryou/default.nix similarity index 100% rename from common/overlays/pkgs/coloryou/default.nix rename to common/pkgs/coloryou/default.nix diff --git a/common/overlays/pkgs/coloryou/requirements.txt b/common/pkgs/coloryou/requirements.txt similarity index 100% rename from common/overlays/pkgs/coloryou/requirements.txt rename to common/pkgs/coloryou/requirements.txt diff --git a/common/overlays/pkgs/coloryou/setup.py b/common/pkgs/coloryou/setup.py similarity index 100% rename from common/overlays/pkgs/coloryou/setup.py rename to common/pkgs/coloryou/setup.py diff --git a/common/overlays/pkgs/coloryou/shell.nix b/common/pkgs/coloryou/shell.nix similarity index 100% rename from common/overlays/pkgs/coloryou/shell.nix rename to common/pkgs/coloryou/shell.nix diff --git a/common/pkgs/default.nix b/common/pkgs/default.nix new file mode 100644 index 00000000..d7541556 --- /dev/null +++ b/common/pkgs/default.nix @@ -0,0 +1,12 @@ +{...}: let + mkPackage = name: (final: prev: { + ${name} = final.callPackage ./${name} {}; + }); +in { + nixpkgs.overlays = [ + (mkPackage "coloryou") + (mkPackage "input-emulator") + (mkPackage "pam-fprint-grosshack") + (mkPackage "spotifywm") + ]; +} diff --git a/common/overlays/pkgs/input-emulator.nix b/common/pkgs/input-emulator/default.nix similarity index 100% rename from common/overlays/pkgs/input-emulator.nix rename to common/pkgs/input-emulator/default.nix diff --git a/common/overlays/pkgs/pam-fprint-grosshack.nix b/common/pkgs/pam-fprint-grosshack/default.nix similarity index 100% rename from common/overlays/pkgs/pam-fprint-grosshack.nix rename to common/pkgs/pam-fprint-grosshack/default.nix diff --git a/common/overlays/pkgs/spotifywm.nix b/common/pkgs/spotifywm/default.nix similarity index 100% rename from common/overlays/pkgs/spotifywm.nix rename to common/pkgs/spotifywm/default.nix