mirror of
https://github.com/JakeStanger/ironbar.git
synced 2024-11-26 09:02:26 +03:00
Merge pull request #66 from yavko/add-nix-flags
Add initial nix flags impl
This commit is contained in:
commit
1d37e010c8
@ -70,6 +70,7 @@ Here is an example nix flake that uses Ironbar.
|
||||
enable = true;
|
||||
config = {};
|
||||
style = "";
|
||||
package = inputs.ironbar.packageBuilder ["feature" "another_feature"];
|
||||
};
|
||||
}
|
||||
];
|
||||
|
42
flake.nix
42
flake.nix
@ -31,6 +31,15 @@
|
||||
];
|
||||
};
|
||||
mkRustToolchain = pkgs: pkgs.rust-bin.stable.latest.default;
|
||||
# defaultFeatures = [
|
||||
# "http"
|
||||
# "config+all"
|
||||
# "clock"
|
||||
# "music+all"
|
||||
# "sys_info"
|
||||
# "tray"
|
||||
# "workspaces+all"
|
||||
# ];
|
||||
in {
|
||||
overlays.default = final: prev: let
|
||||
rust = mkRustToolchain final;
|
||||
@ -40,26 +49,33 @@
|
||||
rustc = rust;
|
||||
};
|
||||
in {
|
||||
ironbar = rustPlatform.buildRustPackage {
|
||||
pname = "ironbar";
|
||||
version = self.rev or "dirty";
|
||||
src = builtins.path {
|
||||
name = "ironbar";
|
||||
path = prev.lib.cleanSource ./.;
|
||||
ironbar = features:
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "ironbar";
|
||||
version = self.rev or "dirty";
|
||||
src = builtins.path {
|
||||
name = "ironbar";
|
||||
path = prev.lib.cleanSource ./.;
|
||||
};
|
||||
buildNoDefaultFeatures =
|
||||
if features == []
|
||||
then false
|
||||
else true;
|
||||
buildFeatures = features;
|
||||
cargoDeps = rustPlatform.importCargoLock {lockFile = ./Cargo.lock;};
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
nativeBuildInputs = with prev; [pkg-config];
|
||||
buildInputs = with prev; [gtk3 gdk-pixbuf gtk-layer-shell libxkbcommon openssl];
|
||||
};
|
||||
cargoDeps = rustPlatform.importCargoLock {lockFile = ./Cargo.lock;};
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
nativeBuildInputs = with prev; [pkg-config];
|
||||
buildInputs = with prev; [gtk3 gdk-pixbuf gtk-layer-shell libxkbcommon openssl];
|
||||
};
|
||||
};
|
||||
packageBuilder = genSystems (system: self.packages.${system}.ironbar);
|
||||
packages = genSystems (
|
||||
system: let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
(self.overlays.default pkgs pkgs)
|
||||
// {
|
||||
default = self.packages.${system}.ironbar;
|
||||
default = self.packages.${system}.ironbar [];
|
||||
}
|
||||
);
|
||||
devShells = genSystems (system: let
|
||||
@ -87,7 +103,7 @@
|
||||
...
|
||||
}: let
|
||||
cfg = config.programs.ironbar;
|
||||
defaultIronbarPackage = self.packages.${pkgs.hostPlatform.system}.default;
|
||||
defaultIronbarPackage = self.packages.${pkgs.hostPlatform.system}.default [];
|
||||
jsonFormat = pkgs.formats.json {};
|
||||
in {
|
||||
options.programs.ironbar = {
|
||||
|
Loading…
Reference in New Issue
Block a user