From d4d5a54e63742aa96320f1468bc76e47aef7d6be Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 8 Jan 2024 09:37:48 -0600 Subject: [PATCH 1/3] chore: flake lock update --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 4bf02e17..25f12644 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1701253981, - "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", + "lastModified": 1704538339, + "narHash": "sha256-1734d3mQuux9ySvwf6axRWZRBhtcZA9Q8eftD6EZg6U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", + "rev": "46ae0210ce163b3cba6c7da08840c1d63de9c701", "type": "github" }, "original": { From b90af74d15d913c62de01b04bf7469e4bb3cf544 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 8 Jan 2024 09:38:05 -0600 Subject: [PATCH 2/3] feat: enable direnv and fix flake devshell output --- .envrc.sample => .envrc | 0 flake.nix | 46 +++++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 20 deletions(-) rename .envrc.sample => .envrc (100%) diff --git a/.envrc.sample b/.envrc similarity index 100% rename from .envrc.sample rename to .envrc diff --git a/flake.nix b/flake.nix index cc830c7e..ebaeb81f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Highly customizable Wayland bar for Sway and Wlroots based compositors."; + description = "Highly customizable Wayland bar for Sway and Wlroots based compositors"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -15,7 +15,8 @@ genSystems = func: lib.genAttrs [ "x86_64-linux" "aarch64-linux" - ] (system: func (import nixpkgs { inherit system; })); + ] + (system: func (import nixpkgs { inherit system; })); mkDate = longDate: (lib.concatStringsSep "-" [ (builtins.substring 0 4 longDate) @@ -24,6 +25,27 @@ ]); in { + devShells = genSystems + (pkgs: + { + default = + pkgs.mkShell + { + name = "waybar-shell"; + + # inherit attributes from upstream nixpkgs derivation + inherit (pkgs.waybar) buildInputs depsBuildBuild depsBuildBuildPropagated depsBuildTarget + depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget + depsTargetTargetPropagated propagatedBuildInputs propagatedNativeBuildInputs strictDeps; + + # overrides for local development + nativeBuildInputs = pkgs.waybar.nativeBuildInputs ++ (with pkgs; [ + clang-tools + gdb + ]); + }; + }); + overlays.default = final: prev: { waybar = final.callPackage ./nix/default.nix { # take the first "version: '...'" from meson.build @@ -35,27 +57,11 @@ + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); }; }; + packages = genSystems (pkgs: let packages = self.overlays.default pkgs pkgs; in packages // { default = packages.waybar; }); - } // - genSystems (pkgs: { - devShells.default = - pkgs.mkShell { - name = "waybar-shell"; - - # most of these aren't actually used in the waybar derivation, this is just in case - # they will ever start being used - inherit (pkgs.waybar) buildInputs depsBuildBuild depsBuildBuildPropagated depsBuildTarget - depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget - depsTargetTargetPropagated propagatedBuildInputs propagatedNativeBuildInputs strictDeps; - - nativeBuildInputs = pkgs.waybar.nativeBuildInputs ++ (with pkgs; [ - clang-tools - gdb - ]); - }; - }); + }; } From b239c77d7418fa9c6488a095f7e722bb5d13586a Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 10 Jan 2024 12:17:46 -0600 Subject: [PATCH 3/3] fix: temporary catch2_3 override until upstreamed to nixpkgs --- nix/default.nix | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index 5efa5da4..e2643084 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,9 +1,20 @@ { lib +, pkgs , waybar , version }: - -waybar.overrideAttrs (prev: { +let + catch2_3 = { + src = pkgs.fetchFromGitHub + { + owner = "catchorg"; + repo = "Catch2"; + rev = "v3.5.1"; + hash = "sha256-OyYNUfnu6h1+MfCF8O+awQ4Usad0qrdCtdZhYgOY+Vw="; + }; + }; +in +(waybar.overrideAttrs (oldAttrs: rec { inherit version; src = lib.cleanSourceWith { @@ -11,3 +22,9 @@ waybar.overrideAttrs (prev: { src = lib.cleanSource ../.; }; }) +).override { + catch2_3 = pkgs.catch2_3.overrideAttrs (oldAttrs: { + version = "3.5.1"; + src = catch2_3.src; + }); +}