Files
clrsync/flake.nix

95 lines
2.4 KiB
Nix

{
description = "clrsync - Color scheme manager";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs, ... }:
let
supportedSystems = [
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
baseVersion = nixpkgs.lib.removeSuffix "\n" (builtins.readFile ./VERSION);
semver =
if self ? rev then
"${baseVersion}+git.${builtins.substring 0 7 self.rev}"
else
"${baseVersion}+dev";
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in
rec {
clrsync = pkgs.callPackage ./package.nix { inherit semver; };
default = clrsync;
}
);
homeModules = {
default = import ./home-manager-module.nix self;
clrsync = self.homeModules.default;
};
apps = forAllSystems (system: {
clrsync-gui = {
type = "app";
program = "${self.packages.${system}.clrsync}/bin/clrsync_gui";
meta = {
description = "clrsync gui app";
license = self.packages.x86_64-linux.licenses.mit;
maintainers = [ "Daniel Dada" ];
};
};
clrsync-cli = {
type = "app";
program = "${self.packages.${system}.clrsync}/bin/clrsync_cli";
meta = {
description = "clrsync cli app";
license = self.packages.x86_64-linux.licenses.mit;
maintainers = [ "Daniel Dada" ];
};
};
default = self.apps.${system}.clrsync-cli;
});
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
clrsync = self.packages.${system}.clrsync;
in
{
default = pkgs.mkShell {
inputsFrom = [ clrsync ];
packages = with pkgs; [
cmake
ninja
clang-tools
gdb
];
shellHook = ''
export CMAKE_GENERATOR="Ninja"
export CMAKE_EXPORT_COMPILE_COMMANDS=1
'';
};
}
);
overlays.default = final: prev: {
clrsync = self.packages.${final.system}.clrsync;
};
};
}