Fix macOS nix package
This commit is contained in:
parent
21be820dcd
commit
6139d29898
46
flake.nix
46
flake.nix
|
@ -6,14 +6,26 @@
|
|||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, naersk }:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
utils,
|
||||
naersk,
|
||||
}:
|
||||
utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
naersk-lib = pkgs.callPackage naersk { };
|
||||
in {
|
||||
packages.default = naersk-lib.buildPackage ./.;
|
||||
devShells.default = with pkgs;
|
||||
in
|
||||
{
|
||||
packages.default = naersk-lib.buildPackage {
|
||||
src = ./.;
|
||||
buildInputs = with pkgs; lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AppKit ];
|
||||
};
|
||||
devShells.default =
|
||||
with pkgs;
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
cargo
|
||||
|
@ -25,11 +37,21 @@
|
|||
];
|
||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
||||
};
|
||||
}) // {
|
||||
nixosModules.default = { config, lib, pkgs, ... }:
|
||||
}
|
||||
)
|
||||
// {
|
||||
nixosModules.default =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let cfg = config.services.url-eater;
|
||||
in {
|
||||
let
|
||||
cfg = config.services.url-eater;
|
||||
in
|
||||
{
|
||||
options.services.url-eater = {
|
||||
enable = mkEnableOption "Enables the URL Eater service";
|
||||
filters = mkOption {
|
||||
|
@ -49,10 +71,12 @@
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services."url-eater" = let
|
||||
systemd.user.services."url-eater" =
|
||||
let
|
||||
filters = pkgs.writeText "filters.kdl" cfg.filters;
|
||||
pkg = self.packages.${pkgs.system}.default;
|
||||
in {
|
||||
in
|
||||
{
|
||||
description = "Clipboard URL cleanup service";
|
||||
|
||||
after = [ "graphical-session-pre.target" ];
|
||||
|
|
Loading…
Reference in New Issue