From 26d4a7290187c83c54df4515da95d84e750a2aff Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 4 Jun 2024 19:21:46 +0300 Subject: [PATCH] nix: inherit self from destructured args; get rid of rec --- flake.nix | 12 +++++++++--- nix/default.nix | 19 ++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 4b68473..5025388 100644 --- a/flake.nix +++ b/flake.nix @@ -10,10 +10,16 @@ }; }; - outputs = inputs @ {flake-parts, ...}: + outputs = { + self, + flake-parts, + nixpkgs, + systems, + ... + } @ inputs: flake-parts.lib.mkFlake {inherit inputs;} { imports = [flake-parts.flakeModules.easyOverlay]; - systems = import inputs.systems; + systems = import systems; perSystem = { self', @@ -80,7 +86,7 @@ overlayAttrs = config.packages; }; - flake = {self, ...}: { + flake = { homeManagerModules = { anyrun = import ./nix/hm-module.nix self; default = self.homeManagerModules.anyrun; diff --git a/nix/default.nix b/nix/default.nix index 08b6a99..3cdd6b0 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,7 +1,9 @@ { lib, - glib, makeWrapper, + lockFile, + # Dependencies for Anyrun + glib, rustPlatform, atk, gtk3, @@ -11,16 +13,19 @@ rustfmt, cargo, rustc, - lockFile, + # Additional configuration arguments for the + # derivation. By default, we should not build + # any of the plugins. dontBuildPlugins ? true, ... }: let - cargoToml = builtins.fromTOML (builtins.readFile ../anyrun/Cargo.toml); + inherit (builtins) fromTOML readFile; + cargoToml = fromTOML (readFile ../anyrun/Cargo.toml); + pname = cargoToml.package.name; + version = cargoToml.package.version; in - rustPlatform.buildRustPackage rec { - pname = cargoToml.package.name; - version = cargoToml.package.version; - + rustPlatform.buildRustPackage { + inherit pname version; src = ../.; buildInputs = [