From 395f15f18100c1aacb3131270cdc851edada18dc Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 27 May 2021 19:57:31 +0200 Subject: [PATCH 1/4] pkgs: add volantes-cursors --- pkgs/default.nix | 2 ++ pkgs/volantes-cursors/default.nix | 44 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/volantes-cursors/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 380ee0b..7419501 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -18,6 +18,8 @@ rec { vimix-cursors = pkgs.callPackage ./vimix-cursors { }; + volantes-cursors = pkgs.callPackage ./volantes-cursors { }; + unbound-zones-adblock = pkgs.callPackage ./unbound-zones-adblock { inherit unified-hosts-lists; }; diff --git a/pkgs/volantes-cursors/default.nix b/pkgs/volantes-cursors/default.nix new file mode 100644 index 0000000..08cec66 --- /dev/null +++ b/pkgs/volantes-cursors/default.nix @@ -0,0 +1,44 @@ +{ fetchFromGitHub, inkscape, lib, stdenvNoCC, xcursorgen }: +stdenvNoCC.mkDerivation rec { + pname = "volantes-cursors"; + version = "unstable-2020-06-06"; + + src = fetchFromGitHub { + owner = "varlesh"; + repo = pname; + rev = "d1d290ff42cc4fa643716551bd0b02582b90fd2f"; + sha256 = "sha256-irMN/enoo90nYLfvSOScZoYdvhZKvqqp+grZB2BQD9o="; + }; + + nativeBuildInputs = [ + inkscape + xcursorgen + ]; + + postPatch = '' + patchShebangs . + # The script tries to build in its source directory... + substituteInPlace build.sh --replace \ + ': "''${BUILD_DIR:="$SCRIPT_DIR"/build}"' \ + "BUILD_DIR=$(pwd)/build" + substituteInPlace build.sh --replace \ + ': "''${OUT_DIR:="$SCRIPT_DIR"/dist}"' \ + "OUT_DIR=$(pwd)/dist" + ''; + + buildPhase = '' + HOME="$NIX_BUILD_ROOT" ./build.sh + ''; + + installPhase = '' + make install PREFIX= DESTDIR=$out/ + ''; + + meta = with lib; { + description = "Classic cursor with a flying style"; + homepage = "https://github.com/varlesh/volantes-cursors"; + license = licenses.gpl2Only; + platforms = platforms.linux; + maintainers = with maintainers; [ ambroisie ]; + }; +} From da21e7a6f292c34170591a2cc4fc2d256e4c88b8 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 27 May 2021 21:37:29 +0200 Subject: [PATCH 2/4] pkgs: comma: allow override which nixpkgs is used This is useful for me to use my pinned `pkgs` instead. --- pkgs/comma/comma | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/comma/comma b/pkgs/comma/comma index 5c347d6..ba5c6ae 100755 --- a/pkgs/comma/comma +++ b/pkgs/comma/comma @@ -30,4 +30,4 @@ if [ -z "$PROGRAM" ]; then exit 1 fi -nix shell "nixpkgs#$PROGRAM" -c "$@" +nix shell "${COMMA_PKGS_FLAKE:-nixpkgs}#$PROGRAM" -c "$@" From 60749582923d6cfa6aca389a56e56065968ce897 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 27 May 2021 21:49:24 +0200 Subject: [PATCH 3/4] home: extract 'comma' into its own module --- home/comma.nix | 15 +++++++++++++++ home/default.nix | 1 + home/packages.nix | 1 - 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 home/comma.nix diff --git a/home/comma.nix b/home/comma.nix new file mode 100644 index 0000000..60de863 --- /dev/null +++ b/home/comma.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.home.comma; +in +{ + options.my.home.comma = with lib; { + enable = my.mkDisableOption "comma configuration"; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + ambroisie.comma + ]; + }; +} diff --git a/home/default.nix b/home/default.nix index 8b638aa..efc4a81 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,6 +3,7 @@ imports = [ ./bat.nix ./bluetooth.nix + ./comma.nix ./direnv.nix ./documentation.nix ./feh.nix diff --git a/home/packages.nix b/home/packages.nix index 90111a2..0d57840 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -18,7 +18,6 @@ in }; config.home.packages = with pkgs; lib.mkIf cfg.enable ([ - ambroisie.comma file gitAndTools.git-absorb gitAndTools.git-revise From 1ac9f0cc8cade78fdb73d010546dfc8ec88901c0 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 27 May 2021 21:50:14 +0200 Subject: [PATCH 4/4] home: comma: configure custom 'nixpkgs' flake This makes use of my pinned `pkgs` flake from the registry by default. --- home/comma.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/home/comma.nix b/home/comma.nix index 60de863..cc6a0ad 100644 --- a/home/comma.nix +++ b/home/comma.nix @@ -5,11 +5,25 @@ in { options.my.home.comma = with lib; { enable = my.mkDisableOption "comma configuration"; + + pkgsFlake = mkOption { + type = types.str; + default = "pkgs"; + example = "nixpkgs"; + description = '' + Which flake from the registry should be used with + nix shell. + ''; + }; }; config = lib.mkIf cfg.enable { home.packages = with pkgs; [ ambroisie.comma ]; + + home.sessionVariables = { + COMMA_PKGS_FLAKE = cfg.pkgsFlake; + }; }; }