From e1d94eefba00214b36c1a587fb8cfedd96ed7a28 Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Fri, 23 Aug 2024 13:15:06 +0100 Subject: [PATCH] add extraSpecialArgs to use flake inputs in home.nix and add anyrun as a launcher --- flake.lock | 59 ++++++++++++++++++++++++++++ flake.nix | 5 +++ home-manager/home.nix | 36 +++++++++++++++++ hosts/gabbielaptop/configuration.nix | 3 +- 4 files changed, 101 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index df80270..280db11 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,48 @@ { "nodes": { + "anyrun": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1721135360, + "narHash": "sha256-ZhSA0e45UxiOAjEVqkym/aULh0Dt+KHJLNda7bjx9UI=", + "owner": "anyrun-org", + "repo": "anyrun", + "rev": "c6101a31a80b51e32e96f6a77616b609770172e0", + "type": "github" + }, + "original": { + "owner": "anyrun-org", + "repo": "anyrun", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "anyrun", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -38,6 +81,7 @@ }, "root": { "inputs": { + "anyrun": "anyrun", "home-manager": "home-manager", "nixpkgs": "nixpkgs", "stablepkgs": "stablepkgs" @@ -58,6 +102,21 @@ "repo": "nixpkgs", "type": "github" } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 9d9dc4a..4ff7194 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,10 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + anyrun = { + url = "github:anyrun-org/anyrun"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, stablepkgs, home-manager, ... } @ inputs: @@ -28,6 +32,7 @@ ./modules/nh.nix ./modules/environment.nix ./modules/waydroid.nix + home-manager.nixosModules.default ]; }; }; diff --git a/home-manager/home.nix b/home-manager/home.nix index a08905e..a620bf8 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -236,5 +236,41 @@ ]; }; }; + + programs.anyrun = { + enable = true; + config = { + plugins = [ + # An array of all the plugins you want, which either can be paths to the .so files, or their packages + inputs.anyrun.packages.${pkgs.system}.applications +# ./some_plugin.so +# "${inputs.anyrun.packages.${pkgs.system}.anyrun-with-all-plugins}/lib/kidex" + ]; + x = { fraction = 0.5; }; + y = { fraction = 0.3; }; + width = { fraction = 0.3; }; + hideIcons = false; + ignoreExclusiveZones = false; + layer = "overlay"; + hidePluginInfo = false; + closeOnClick = false; + showResultsImmediately = false; + maxEntries = null; + }; + extraCss = '' + .some_class { + background: red; + } + ''; + + extraConfigFiles."some-plugin.ron".text = '' + Config( + // for any other plugin + // this file will be put in ~/.config/anyrun/some-plugin.ron + // refer to docs of xdg.configFile for available options + ) + ''; + }; + services.blueman-applet.enable = true; } diff --git a/hosts/gabbielaptop/configuration.nix b/hosts/gabbielaptop/configuration.nix index b410c90..f28ee16 100644 --- a/hosts/gabbielaptop/configuration.nix +++ b/hosts/gabbielaptop/configuration.nix @@ -9,7 +9,6 @@ imports = [ ./hardware-configuration.nix - inputs.home-manager.nixosModules.default ]; # Bootloader. @@ -107,7 +106,7 @@ }; home-manager = { -# extraSpeicalArgs = { inherit inputs; }; + extraSpeicalArgs = { inherit inputs; }; users = { "blue" = import ../../home-manager/home.nix; };