From 54b0859e401acc4c0f78aa55b53c79f852b07632 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Sun, 13 Mar 2022 13:43:29 +0100 Subject: [PATCH] fix(nix): fix `makeDesktopItem` (#1215) --- default.nix | 24 ++++++++++++------------ nix/crate2nix.nix | 35 ++++++++++++++++++----------------- nix/default.nix | 31 +++++++++++++++---------------- shell.nix | 24 ++++++++++++------------ 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/default.nix b/default.nix index 78bc3a1f..0205bc89 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,14 @@ (import -( - let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); - in - fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; - sha256 = lock.nodes.flake-compat.locked.narHash; - } -) -{ - src = ./.; -}) + ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { + src = ./.; + }) .defaultNix diff --git a/nix/crate2nix.nix b/nix/crate2nix.nix index fc2ce4eb..c343fca9 100644 --- a/nix/crate2nix.nix +++ b/nix/crate2nix.nix @@ -13,23 +13,24 @@ generatedCargoNix ; - project = import - (generatedCargoNix { - inherit name src; - }) - { - inherit pkgs; - buildRustCrateForPkgs = pkgs: - pkgs.buildRustCrate.override { - defaultCrateOverrides = - pkgs.defaultCrateOverrides - // { - # Crate dependency overrides go here - zellij = attrs: { - inherit postInstall desktopItems meta name nativeBuildInputs; + project = + import + (generatedCargoNix { + inherit name src; + }) + { + inherit pkgs; + buildRustCrateForPkgs = pkgs: + pkgs.buildRustCrate.override { + defaultCrateOverrides = + pkgs.defaultCrateOverrides + // { + # Crate dependency overrides go here + zellij = attrs: { + inherit postInstall desktopItems meta name nativeBuildInputs; + }; }; - }; - }; - }; + }; + }; in project.workspaceMembers.zellij.build diff --git a/nix/default.nix b/nix/default.nix index 18f56f84..a05d9130 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -38,10 +38,10 @@ flake-utils.lib.eachSystem [ rustToolchainToml = pkgs.rust-bin.fromRustupToolchainFile ../rust-toolchain; cargoLock = { - lockFile = (builtins.path { + lockFile = builtins.path { path = ../Cargo.lock; name = "Cargo.lock"; - }); + }; }; cargo = rustToolchainToml; rustc = rustToolchainToml; @@ -107,7 +107,7 @@ flake-utils.lib.eachSystem [ comment = "Manage your terminal applications"; exec = "zellij"; icon = "zellij"; - categories = ["ConsoleOnly;System"]; + categories = ["ConsoleOnly"]; }) ]; meta = with pkgs.lib; { @@ -130,19 +130,18 @@ in rec { }; # native nixpkgs support - keep supported - packages.zellij-native = - (pkgs.makeRustPlatform {inherit cargo rustc;}).buildRustPackage { - inherit - src - name - cargoLock - buildInputs - nativeBuildInputs - postInstall - desktopItems - meta - ; - }; + packages.zellij-native = (pkgs.makeRustPlatform {inherit cargo rustc;}).buildRustPackage { + inherit + src + name + cargoLock + buildInputs + nativeBuildInputs + postInstall + desktopItems + meta + ; + }; defaultPackage = packages.zellij; diff --git a/shell.nix b/shell.nix index a3b4d760..b847c560 100644 --- a/shell.nix +++ b/shell.nix @@ -1,14 +1,14 @@ (import -( - let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); - in - fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; - sha256 = lock.nodes.flake-compat.locked.narHash; - } -) -{ - src = ./.; -}) + ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { + src = ./.; + }) .shellNix