From 2d50d11150e8b5271447c911f1eefadd2312b761 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Tue, 8 Oct 2024 10:10:30 +0200 Subject: [PATCH] feat: `anyrun` as flake --- common/home.nix | 50 +++++++++++++++++++++++++++++++++++++++-- flake.lock | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++------ 3 files changed, 122 insertions(+), 9 deletions(-) diff --git a/common/home.nix b/common/home.nix index ae28605..a1dcee4 100644 --- a/common/home.nix +++ b/common/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: { home.username = "ahurac"; @@ -12,7 +12,6 @@ wl-clipboard swayosd prismlauncher - anyrun noto-fonts libreoffice mosh @@ -370,4 +369,51 @@ }; }; }; + + programs.anyrun = { + enable = true; + # package = pkgs.anyrun; + config = { + plugins = [ inputs.anyrun.packages.${pkgs.system}.applications ]; + x.fraction = 0.5; + y.absolute = 0; + width.absolute = 800; + height.absolute = 0; + hideIcons = false; + ignoreExclusiveZones = false; + layer = "overlay"; + hidePluginInfo = false; + closeOnClick = false; + showResultsImmediately = false; + maxEntries = null; + }; + extraCss = '' + #window { + background-color: rgba(0, 0, 0, 0); + } + + box#main { + border-radius: 10px; + background-color: @theme_bg_color; + margin-top: 20px; + } + + list#main { + background-color: rgba(0, 0, 0, 0); + border-radius: 10px; + } + + list#plugin { + background-color: rgba(0, 0, 0, 0); + } + + label#match-desc { + font-size: 10px; + } + + label#plugin { + font-size: 14px; + } + ''; + }; } diff --git a/flake.lock b/flake.lock index c7467aa..6eb1ae7 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" + } + }, "flatpaks": { "locked": { "lastModified": 1721549352, @@ -55,10 +98,26 @@ }, "root": { "inputs": { + "anyrun": "anyrun", "flatpaks": "flatpaks", "home-manager": "home-manager", "nixpkgs": "nixpkgs" } + }, + "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 dbd0b40..858bb82 100644 --- a/flake.nix +++ b/flake.nix @@ -6,9 +6,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; flatpaks.url = "github:gmodena/nix-flatpak/main"; + anyrun.url = "github:anyrun-org/anyrun"; + anyrun.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, home-manager, flatpaks, ... }@inputs: { + outputs = { self, nixpkgs, home-manager, flatpaks, anyrun, ... }@inputs: { nixosConfigurations.ahrc-pc = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ @@ -17,9 +19,12 @@ { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.extraSpecialArgs.flake-inputs = inputs; - home-manager.users.ahurac.imports = - [ flatpaks.homeManagerModules.nix-flatpak ./ahrc-pc/home.nix ]; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.ahurac.imports = [ + flatpaks.homeManagerModules.nix-flatpak + anyrun.homeManagerModules.default + ./ahrc-pc/home.nix + ]; } ]; }; @@ -32,9 +37,12 @@ { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.extraSpecialArgs.flake-inputs = inputs; - home-manager.users.ahurac.imports = - [ flatpaks.homeManagerModules.nix-flatpak ./ahrc-laptop/home.nix ]; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.ahurac.imports = [ + flatpaks.homeManagerModules.nix-flatpak + anyrun.homeManagerModules.default + ./ahrc-laptop/home.nix + ]; } ]; };