-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
180 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env bash | ||
use nix | ||
use flake |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
description = "A work in progress notification daemon made with rust and gtk."; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-parts = { | ||
url = "github:hercules-ci/flake-parts"; | ||
inputs.nixpkgs-lib.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = inputs @ { flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
systems = [ "x86_64-linux" "aarch64-linux" ]; | ||
|
||
perSystem = | ||
{ config | ||
, self' | ||
, inputs' | ||
, pkgs | ||
, system | ||
, ... | ||
}: | ||
{ | ||
devShells.default = pkgs.mkShell { | ||
inputsFrom = builtins.attrValues self'.packages; | ||
packages = with pkgs; [ | ||
cargo | ||
rustc | ||
]; | ||
}; | ||
|
||
packages = | ||
let | ||
lockFile = ./Cargo.lock; | ||
in | ||
rec { | ||
oxinoti = pkgs.callPackage ./nix/default.nix { inherit inputs lockFile; }; | ||
default = oxinoti; | ||
}; | ||
}; | ||
flake = _: rec { | ||
nixosModules.home-manager = homeManagerModules.default; | ||
homeManagerModules = rec { | ||
oxinoti = import ./nix/hm.nix inputs.self; | ||
default = oxinoti; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ rustPlatform | ||
, pkg-config | ||
, wrapGAppsHook4 | ||
, gtk3 | ||
, gtk-layer-shell | ||
, dbus | ||
, lib | ||
, lockFile | ||
, cargo | ||
, rustc | ||
, ... | ||
}: | ||
let | ||
cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml); | ||
in | ||
rustPlatform.buildRustPackage rec { | ||
pname = cargoToml.package.name; | ||
version = cargoToml.package.version; | ||
|
||
src = ../.; | ||
|
||
buildInputs = [ | ||
pkg-config | ||
gtk3 | ||
gtk-layer-shell | ||
dbus | ||
]; | ||
|
||
cargoLock = { | ||
inherit lockFile; | ||
}; | ||
|
||
checkInputs = [ cargo rustc ]; | ||
|
||
nativeBuildInputs = [ | ||
pkg-config | ||
wrapGAppsHook4 | ||
cargo | ||
rustc | ||
]; | ||
copyLibs = true; | ||
|
||
meta = with lib; { | ||
description = "A small, simple calculator written in rust/gtk4"; | ||
homepage = "https://github.com/DashieTM/OxiNoti"; | ||
changelog = "https://github.com/DashieTM/OxiNoti/releases/tag/${version}"; | ||
license = licenses.gpl3; | ||
maintainers = with maintainers; [ DashieTM ]; | ||
mainProgram = "oxinoti"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
self: { config | ||
, pkgs | ||
, lib | ||
, hm | ||
, ... | ||
}: | ||
let | ||
cfg = config.programs.oxinoti; | ||
defaultPackage = self.packages.${pkgs.stdenv.hostPlatform.system}.default; | ||
in | ||
{ | ||
meta.maintainers = with lib.maintainers; [ DashieTM ]; | ||
options.programs.oxinoti = with lib; { | ||
enable = mkEnableOption "oxinoti"; | ||
|
||
package = mkOption { | ||
type = with types; nullOr package; | ||
default = defaultPackage; | ||
defaultText = lib.literalExpression '' | ||
oxinoti.packages.''${pkgs.stdenv.hostPlatform.system}.default | ||
''; | ||
description = mdDoc '' | ||
Package to run | ||
''; | ||
}; | ||
}; | ||
config = lib.mkIf cfg.enable { | ||
home.packages = lib.optional (cfg.package != null) cfg.package; | ||
}; | ||
} |