mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 15:27:01 +05:30
chore: reformat Nix files with alejandra
This commit is contained in:
parent
baa7902ec3
commit
8f0408e6c9
3 changed files with 79 additions and 64 deletions
14
default.nix
14
default.nix
|
@ -1,6 +1,8 @@
|
||||||
(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
(import (let
|
||||||
in fetchTarball {
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
url =
|
in
|
||||||
"https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
fetchTarball {
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||||
}) { src = ./.; }).defaultNix
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||||
|
}) {src = ./.;})
|
||||||
|
.defaultNix
|
||||||
|
|
115
flake.nix
115
flake.nix
|
@ -2,9 +2,9 @@
|
||||||
description = "clipboard-substitutor";
|
description = "clipboard-substitutor";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; };
|
nixpkgs = {url = "github:NixOS/nixpkgs/nixpkgs-unstable";};
|
||||||
|
|
||||||
flake-utils = { url = "github:numtide/flake-utils"; };
|
flake-utils = {url = "github:numtide/flake-utils";};
|
||||||
|
|
||||||
flake-compat = {
|
flake-compat = {
|
||||||
url = "github:edolstra/flake-compat";
|
url = "github:edolstra/flake-compat";
|
||||||
|
@ -35,60 +35,71 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = {
|
||||||
{ self, nixpkgs, crane, flake-utils, advisory-db, rust-overlay, ... }:
|
self,
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
nixpkgs,
|
||||||
let
|
crane,
|
||||||
pkgs = import nixpkgs {
|
flake-utils,
|
||||||
inherit system;
|
advisory-db,
|
||||||
overlays = [ (import rust-overlay) ];
|
rust-overlay,
|
||||||
};
|
...
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [(import rust-overlay)];
|
||||||
|
};
|
||||||
|
|
||||||
rustStable =
|
rustStable =
|
||||||
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
||||||
src = ./.;
|
src = ./.;
|
||||||
buildInputs = with pkgs;
|
buildInputs = with pkgs;
|
||||||
[ xorg.libxcb python39 ] ++ pkgs.lib.optionals stdenv.isDarwin
|
[xorg.libxcb python39]
|
||||||
[ pkgs.darwin.apple_sdk.frameworks.AppKit ];
|
++ pkgs.lib.optionals stdenv.isDarwin
|
||||||
cargoArtifacts = craneLib.buildDepsOnly { inherit src buildInputs; };
|
[pkgs.darwin.apple_sdk.frameworks.AppKit];
|
||||||
|
cargoArtifacts = craneLib.buildDepsOnly {inherit src buildInputs;};
|
||||||
|
|
||||||
clipboard-substitutor = craneLib.buildPackage {
|
clipboard-substitutor = craneLib.buildPackage {
|
||||||
inherit src buildInputs;
|
inherit src buildInputs;
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
clipboard-substitutor-clippy = craneLib.cargoClippy {
|
clipboard-substitutor-clippy = craneLib.cargoClippy {
|
||||||
inherit cargoArtifacts src buildInputs;
|
inherit cargoArtifacts src buildInputs;
|
||||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||||
};
|
};
|
||||||
clipboard-substitutor-fmt = craneLib.cargoFmt { inherit src; };
|
clipboard-substitutor-fmt = craneLib.cargoFmt {inherit src;};
|
||||||
clipboard-substitutor-audit =
|
clipboard-substitutor-audit =
|
||||||
craneLib.cargoAudit { inherit src advisory-db; };
|
craneLib.cargoAudit {inherit src advisory-db;};
|
||||||
clipboard-substitutor-nextest = craneLib.cargoNextest {
|
clipboard-substitutor-nextest = craneLib.cargoNextest {
|
||||||
inherit cargoArtifacts src buildInputs;
|
inherit cargoArtifacts src buildInputs;
|
||||||
partitions = 1;
|
partitions = 1;
|
||||||
partitionType = "count";
|
partitionType = "count";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
checks = {
|
checks = {
|
||||||
# TODO: migrate to cargo-audit
|
# TODO: migrate to cargo-audit
|
||||||
# clipboard-substitutor-audit
|
# clipboard-substitutor-audit
|
||||||
inherit clipboard-substitutor clipboard-substitutor-clippy
|
inherit
|
||||||
clipboard-substitutor-fmt clipboard-substitutor-nextest;
|
clipboard-substitutor
|
||||||
};
|
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.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
inputsFrom = builtins.attrValues self.checks;
|
inputsFrom = builtins.attrValues self.checks;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
cargo-nextest
|
cargo-nextest
|
||||||
cargo-release
|
cargo-release
|
||||||
rustStable
|
rustStable
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
14
shell.nix
14
shell.nix
|
@ -1,6 +1,8 @@
|
||||||
(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
(import (let
|
||||||
in fetchTarball {
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
url =
|
in
|
||||||
"https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
fetchTarball {
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||||
}) { src = ./.; }).shellNix
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||||
|
}) {src = ./.;})
|
||||||
|
.shellNix
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue