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;
|
enable = true;
|
||||||
config = {};
|
config = {};
|
||||||
style = "";
|
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;
|
mkRustToolchain = pkgs: pkgs.rust-bin.stable.latest.default;
|
||||||
|
# defaultFeatures = [
|
||||||
|
# "http"
|
||||||
|
# "config+all"
|
||||||
|
# "clock"
|
||||||
|
# "music+all"
|
||||||
|
# "sys_info"
|
||||||
|
# "tray"
|
||||||
|
# "workspaces+all"
|
||||||
|
# ];
|
||||||
in {
|
in {
|
||||||
overlays.default = final: prev: let
|
overlays.default = final: prev: let
|
||||||
rust = mkRustToolchain final;
|
rust = mkRustToolchain final;
|
||||||
@ -40,26 +49,33 @@
|
|||||||
rustc = rust;
|
rustc = rust;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
ironbar = rustPlatform.buildRustPackage {
|
ironbar = features:
|
||||||
pname = "ironbar";
|
rustPlatform.buildRustPackage {
|
||||||
version = self.rev or "dirty";
|
pname = "ironbar";
|
||||||
src = builtins.path {
|
version = self.rev or "dirty";
|
||||||
name = "ironbar";
|
src = builtins.path {
|
||||||
path = prev.lib.cleanSource ./.;
|
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 (
|
packages = genSystems (
|
||||||
system: let
|
system: let
|
||||||
pkgs = pkgsFor system;
|
pkgs = pkgsFor system;
|
||||||
in
|
in
|
||||||
(self.overlays.default pkgs pkgs)
|
(self.overlays.default pkgs pkgs)
|
||||||
// {
|
// {
|
||||||
default = self.packages.${system}.ironbar;
|
default = self.packages.${system}.ironbar [];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
devShells = genSystems (system: let
|
devShells = genSystems (system: let
|
||||||
@ -87,7 +103,7 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.programs.ironbar;
|
cfg = config.programs.ironbar;
|
||||||
defaultIronbarPackage = self.packages.${pkgs.hostPlatform.system}.default;
|
defaultIronbarPackage = self.packages.${pkgs.hostPlatform.system}.default [];
|
||||||
jsonFormat = pkgs.formats.json {};
|
jsonFormat = pkgs.formats.json {};
|
||||||
in {
|
in {
|
||||||
options.programs.ironbar = {
|
options.programs.ironbar = {
|
||||||
|
Loading…
Reference in New Issue
Block a user