mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 20:07:01 +05:30
chore: reformat all files with nixfmt-rfc-style
This commit is contained in:
parent
7fd491b0da
commit
b52dea88b0
3 changed files with 100 additions and 80 deletions
11
default.nix
11
default.nix
|
@ -1,8 +1,9 @@
|
||||||
(import (let
|
(import (
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
let
|
||||||
in
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
|
in
|
||||||
fetchTarball {
|
fetchTarball {
|
||||||
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||||
}) {src = ./.;})
|
}
|
||||||
.defaultNix
|
) { src = ./.; }).defaultNix
|
||||||
|
|
158
flake.nix
158
flake.nix
|
@ -22,83 +22,101 @@
|
||||||
inputs.flake-compat.url = "github:nix-community/flake-compat";
|
inputs.flake-compat.url = "github:nix-community/flake-compat";
|
||||||
inputs.flake-compat.flake = false;
|
inputs.flake-compat.flake = false;
|
||||||
|
|
||||||
outputs = {
|
outputs =
|
||||||
self,
|
{
|
||||||
nixpkgs,
|
self,
|
||||||
advisory-db,
|
nixpkgs,
|
||||||
crane,
|
advisory-db,
|
||||||
devshell,
|
crane,
|
||||||
fenix,
|
devshell,
|
||||||
flake-utils,
|
fenix,
|
||||||
...
|
flake-utils,
|
||||||
}:
|
...
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
}:
|
||||||
pkgs = import nixpkgs {
|
flake-utils.lib.eachDefaultSystem (
|
||||||
inherit system;
|
system:
|
||||||
overlays = [devshell.overlays.default];
|
let
|
||||||
};
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ devshell.overlays.default ];
|
||||||
|
};
|
||||||
|
|
||||||
rustStable = (import fenix {inherit pkgs;}).fromToolchainFile {
|
rustStable = (import fenix { inherit pkgs; }).fromToolchainFile {
|
||||||
file = ./rust-toolchain.toml;
|
file = ./rust-toolchain.toml;
|
||||||
sha256 = "sha256-yMuSb5eQPO/bHv+Bcf/US8LVMbf/G/0MSfiPwBhiPpk=";
|
sha256 = "sha256-yMuSb5eQPO/bHv+Bcf/US8LVMbf/G/0MSfiPwBhiPpk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
||||||
commonArgs = {
|
commonArgs = {
|
||||||
src = craneLib.cleanCargoSource ./.;
|
src = craneLib.cleanCargoSource ./.;
|
||||||
buildInputs = [];
|
buildInputs = [ ];
|
||||||
nativeBuildInputs = with pkgs;
|
nativeBuildInputs =
|
||||||
[xorg.libxcb python312]
|
with pkgs;
|
||||||
++ pkgs.lib.optionals stdenv.isDarwin
|
[
|
||||||
[pkgs.darwin.apple_sdk.frameworks.AppKit];
|
xorg.libxcb
|
||||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
python312
|
||||||
};
|
]
|
||||||
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {doCheck = false;});
|
++ pkgs.lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.AppKit ];
|
||||||
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||||
|
};
|
||||||
|
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { doCheck = false; });
|
||||||
|
|
||||||
clipboard-substitutor = craneLib.buildPackage (commonArgs // {doCheck = false;});
|
clipboard-substitutor = craneLib.buildPackage (commonArgs // { doCheck = false; });
|
||||||
clipboard-substitutor-clippy = craneLib.cargoClippy (commonArgs
|
clipboard-substitutor-clippy = craneLib.cargoClippy (
|
||||||
// {
|
commonArgs
|
||||||
inherit cargoArtifacts;
|
// {
|
||||||
});
|
inherit cargoArtifacts;
|
||||||
clipboard-substitutor-fmt = craneLib.cargoFmt (commonArgs // {});
|
}
|
||||||
clipboard-substitutor-audit = craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
|
);
|
||||||
clipboard-substitutor-nextest = craneLib.cargoNextest (commonArgs
|
clipboard-substitutor-fmt = craneLib.cargoFmt (commonArgs // { });
|
||||||
// {
|
clipboard-substitutor-audit = craneLib.cargoAudit (commonArgs // { inherit advisory-db; });
|
||||||
inherit cargoArtifacts;
|
clipboard-substitutor-nextest = craneLib.cargoNextest (
|
||||||
partitions = 1;
|
commonArgs
|
||||||
partitionType = "count";
|
// {
|
||||||
});
|
inherit cargoArtifacts;
|
||||||
in {
|
partitions = 1;
|
||||||
checks = {
|
partitionType = "count";
|
||||||
inherit clipboard-substitutor clipboard-substitutor-audit clipboard-substitutor-clippy clipboard-substitutor-fmt clipboard-substitutor-nextest;
|
}
|
||||||
};
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
checks = {
|
||||||
|
inherit
|
||||||
|
clipboard-substitutor
|
||||||
|
clipboard-substitutor-audit
|
||||||
|
clipboard-substitutor-clippy
|
||||||
|
clipboard-substitutor-fmt
|
||||||
|
clipboard-substitutor-nextest
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
packages.default = clipboard-substitutor;
|
packages.default = clipboard-substitutor;
|
||||||
|
|
||||||
apps.default = flake-utils.lib.mkApp {drv = clipboard-substitutor;};
|
apps.default = flake-utils.lib.mkApp { drv = clipboard-substitutor; };
|
||||||
|
|
||||||
devShells.default = pkgs.devshell.mkShell {
|
devShells.default = pkgs.devshell.mkShell {
|
||||||
imports = [
|
imports = [
|
||||||
"${devshell}/extra/language/c.nix"
|
"${devshell}/extra/language/c.nix"
|
||||||
"${devshell}/extra/language/rust.nix"
|
"${devshell}/extra/language/rust.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
env = [
|
env = [
|
||||||
{
|
{
|
||||||
name = "DEVSHELL_NO_MOTD";
|
name = "DEVSHELL_NO_MOTD";
|
||||||
value = 1;
|
value = 1;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
cargo-dist
|
cargo-dist
|
||||||
cargo-nextest
|
cargo-nextest
|
||||||
cargo-release
|
cargo-release
|
||||||
rustStable
|
rustStable
|
||||||
];
|
];
|
||||||
|
|
||||||
language.c.libraries = commonArgs.nativeBuildInputs;
|
language.c.libraries = commonArgs.nativeBuildInputs;
|
||||||
language.rust.enableDefaultToolchain = false;
|
language.rust.enableDefaultToolchain = false;
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
11
shell.nix
11
shell.nix
|
@ -1,8 +1,9 @@
|
||||||
(import (let
|
(import (
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
let
|
||||||
in
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
|
in
|
||||||
fetchTarball {
|
fetchTarball {
|
||||||
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||||
}) {src = ./.;})
|
}
|
||||||
.shellNix
|
) { src = ./.; }).shellNix
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue