Files
sops-manager/flake.nix
T
2026-06-05 23:51:30 +04:00

98 lines
2.4 KiB
Nix

{
description = "sops-tui a TUI for managing SOPS-encrypted secrets";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
crane.url = "github:ipetkov/crane";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
flake-parts,
crane,
rust-overlay,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
flake.flakeModules.default = ./nix/flakeModule.nix;
perSystem =
{
pkgs,
lib,
system,
...
}:
let
craneLib = (crane.mkLib pkgs).overrideToolchain (
p:
p.rust-bin.nightly.latest.default.override {
extensions = [
"rustc-codegen-cranelift-preview"
"rust-analyzer"
"rust-src"
];
}
);
src = craneLib.cleanCargoSource ./.;
commonArgs = {
inherit src;
strictDeps = true;
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
sops-tui = craneLib.buildPackage (
commonArgs
// {
inherit cargoArtifacts;
meta = {
description = "TUI for managing SOPS-encrypted secrets in NixOS/sops-nix workflows";
mainProgram = "sops-tui";
platforms = lib.platforms.unix;
};
}
);
in
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.rust-overlay.overlays.default ];
};
packages = {
default = sops-tui;
inherit sops-tui;
};
checks = {
inherit sops-tui;
sops-tui-clippy = craneLib.cargoClippy (
commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--all-targets";
}
);
sops-tui-fmt = craneLib.cargoFmt { inherit src; };
};
devShells.default = craneLib.devShell {
inputsFrom = [ sops-tui ];
packages = with pkgs; [ sops ];
};
};
};
}