Fix macOS nix package
This commit is contained in:
parent
21be820dcd
commit
6139d29898
86
flake.nix
86
flake.nix
|
@ -6,14 +6,26 @@
|
||||||
utils.url = "github:numtide/flake-utils";
|
utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, utils, naersk }:
|
outputs =
|
||||||
utils.lib.eachDefaultSystem (system:
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
utils,
|
||||||
|
naersk,
|
||||||
|
}:
|
||||||
|
utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
naersk-lib = pkgs.callPackage naersk { };
|
naersk-lib = pkgs.callPackage naersk { };
|
||||||
in {
|
in
|
||||||
packages.default = naersk-lib.buildPackage ./.;
|
{
|
||||||
devShells.default = with pkgs;
|
packages.default = naersk-lib.buildPackage {
|
||||||
|
src = ./.;
|
||||||
|
buildInputs = with pkgs; lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AppKit ];
|
||||||
|
};
|
||||||
|
devShells.default =
|
||||||
|
with pkgs;
|
||||||
mkShell {
|
mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
cargo
|
cargo
|
||||||
|
@ -25,34 +37,46 @@
|
||||||
];
|
];
|
||||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
||||||
};
|
};
|
||||||
}) // {
|
}
|
||||||
nixosModules.default = { config, lib, pkgs, ... }:
|
)
|
||||||
with lib;
|
// {
|
||||||
let cfg = config.services.url-eater;
|
nixosModules.default =
|
||||||
in {
|
{
|
||||||
options.services.url-eater = {
|
config,
|
||||||
enable = mkEnableOption "Enables the URL Eater service";
|
lib,
|
||||||
filters = mkOption {
|
pkgs,
|
||||||
type = types.str;
|
...
|
||||||
example = ''
|
}:
|
||||||
category "Spotify" {
|
with lib;
|
||||||
params "context@open.spotify.com" "si@open.spotify.com"
|
let
|
||||||
}
|
cfg = config.services.url-eater;
|
||||||
category "Twitter" {
|
in
|
||||||
params "cxt@*.twitter.com" "ref_*@*.twitter.com" "s@*.twitter.com" "t@*.twitter.com" "twclid"
|
{
|
||||||
}
|
options.services.url-eater = {
|
||||||
'';
|
enable = mkEnableOption "Enables the URL Eater service";
|
||||||
description = mdDoc ''
|
filters = mkOption {
|
||||||
A list of filters to use, in the KDL file format.
|
type = types.str;
|
||||||
'';
|
example = ''
|
||||||
};
|
category "Spotify" {
|
||||||
|
params "context@open.spotify.com" "si@open.spotify.com"
|
||||||
|
}
|
||||||
|
category "Twitter" {
|
||||||
|
params "cxt@*.twitter.com" "ref_*@*.twitter.com" "s@*.twitter.com" "t@*.twitter.com" "twclid"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = mdDoc ''
|
||||||
|
A list of filters to use, in the KDL file format.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.user.services."url-eater" = let
|
systemd.user.services."url-eater" =
|
||||||
|
let
|
||||||
filters = pkgs.writeText "filters.kdl" cfg.filters;
|
filters = pkgs.writeText "filters.kdl" cfg.filters;
|
||||||
pkg = self.packages.${pkgs.system}.default;
|
pkg = self.packages.${pkgs.system}.default;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
description = "Clipboard URL cleanup service";
|
description = "Clipboard URL cleanup service";
|
||||||
|
|
||||||
after = [ "graphical-session-pre.target" ];
|
after = [ "graphical-session-pre.target" ];
|
||||||
|
@ -62,7 +86,7 @@
|
||||||
exec ${pkg}/bin/url-eater ${filters}
|
exec ${pkg}/bin/url-eater ${filters}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue