mirror of
https://github.com/elkowar/eww.git
synced 2024-10-03 22:48:31 +03:00
fix: refactor and fix flake (#1038)
* fix: refactor flake * chore: update flake.lock * chore: update changelog * chore: update flake.lock * chore: update changelog
This commit is contained in:
parent
8397744f40
commit
acf57a8396
@ -4,6 +4,9 @@ All notable changes to eww will be listed here, starting at changes since versio
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixes
|
||||
- Fix and refactor nix flake (By: w-lfchen)
|
||||
|
||||
## [0.6.0] (21.04.2024)
|
||||
|
||||
### Fixes
|
||||
|
12
flake.lock
12
flake.lock
@ -36,11 +36,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1708407374,
|
||||
"narHash": "sha256-EECzarm+uqnNDCwaGg/ppXCO11qibZ1iigORShkkDf0=",
|
||||
"lastModified": 1709038661,
|
||||
"narHash": "sha256-Ys611iT6pChGv954aa4f8oKoDKJG3IXjJjPhnj6uaLY=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f33dd27a47ebdf11dc8a5eb05e7c8fbdaf89e73f",
|
||||
"rev": "8520c158aee718c6e87b56881105fc4223c3c723",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -65,11 +65,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1708395022,
|
||||
"narHash": "sha256-pxHZbfDsLAAcyWz+snbudxhQPlAnK2nWGAqRx11veac=",
|
||||
"lastModified": 1708999822,
|
||||
"narHash": "sha256-X55GxqI3oDEfqy38Pt7xyypYNly4bkd/RajFE+FGn+A=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "b4ae18c03af976549a0b6e396b2b5be56d275f8b",
|
||||
"rev": "1a618c62479a6896ac497aaa0d969c6bd8e24911",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
77
flake.nix
77
flake.nix
@ -13,46 +13,49 @@
|
||||
|
||||
outputs = { self, nixpkgs, rust-overlay, flake-compat }:
|
||||
let
|
||||
pkgsFor = system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default rust-overlay.overlays.default ];
|
||||
};
|
||||
overlays = [ (import rust-overlay) self.overlays.default ];
|
||||
pkgsFor = system: import nixpkgs { inherit system overlays; };
|
||||
|
||||
targetSystems = [ "aarch64-linux" "x86_64-linux" ];
|
||||
mkRustToolchain = pkgs:
|
||||
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
in {
|
||||
overlays.default = final: prev:
|
||||
let
|
||||
rust = mkRustToolchain final;
|
||||
overlays.default = final: prev: {
|
||||
inherit (self.packages.${prev.system}) eww eww-wayland;
|
||||
};
|
||||
|
||||
rustPlatform = prev.makeRustPlatform {
|
||||
packages = nixpkgs.lib.genAttrs targetSystems (system:
|
||||
let
|
||||
pkgs = pkgsFor system;
|
||||
rust = mkRustToolchain pkgs;
|
||||
rustPlatform = pkgs.makeRustPlatform {
|
||||
cargo = rust;
|
||||
rustc = rust;
|
||||
};
|
||||
in {
|
||||
eww = (prev.eww.override { inherit rustPlatform; }).overrideAttrs
|
||||
(old: {
|
||||
version = self.rev or "dirty";
|
||||
src = builtins.path {
|
||||
name = "eww";
|
||||
path = prev.lib.cleanSource ./.;
|
||||
};
|
||||
cargoDeps =
|
||||
rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
|
||||
patches = [ ];
|
||||
# remove this when nixpkgs includes it
|
||||
buildInputs = old.buildInputs ++ [ final.libdbusmenu-gtk3 ];
|
||||
});
|
||||
version = (builtins.fromTOML
|
||||
(builtins.readFile ./crates/eww/Cargo.toml)).package.version;
|
||||
in rec {
|
||||
eww = rustPlatform.buildRustPackage {
|
||||
version = "${version}-dirty";
|
||||
pname = "eww";
|
||||
|
||||
eww-wayland = final.eww;
|
||||
};
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
cargoBuildFlags = [ "--bin" "eww" ];
|
||||
|
||||
packages = nixpkgs.lib.genAttrs targetSystems (system:
|
||||
let pkgs = pkgsFor system;
|
||||
in (self.overlays.default pkgs pkgs) // {
|
||||
default = self.packages.${system}.eww;
|
||||
nativeBuildInputs = with pkgs; [ pkg-config wrapGAppsHook ];
|
||||
buildInputs = with pkgs; [
|
||||
gtk3
|
||||
librsvg
|
||||
gtk-layer-shell
|
||||
libdbusmenu-gtk3
|
||||
];
|
||||
};
|
||||
|
||||
eww-wayland = nixpkgs.lib.warn
|
||||
"`eww-wayland` is deprecated due to eww building with both X11 and wayland support by default. Use `eww` instead."
|
||||
eww;
|
||||
default = eww;
|
||||
});
|
||||
|
||||
devShells = nixpkgs.lib.genAttrs targetSystems (system:
|
||||
@ -61,20 +64,8 @@
|
||||
rust = mkRustToolchain pkgs;
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
rust
|
||||
rust-analyzer-unwrapped
|
||||
gcc
|
||||
glib
|
||||
gdk-pixbuf
|
||||
librsvg
|
||||
libdbusmenu-gtk3
|
||||
gtk3
|
||||
gtk-layer-shell
|
||||
pkg-config
|
||||
deno
|
||||
mdbook
|
||||
];
|
||||
inputsFrom = [ self.packages.${system}.eww ];
|
||||
packages = with pkgs; [ deno mdbook ];
|
||||
|
||||
RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user