2024-03-26 20:19:40 -06:00
|
|
|
{
|
|
|
|
description = "kogs: koreader sync server";
|
|
|
|
|
|
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
|
|
|
|
|
|
outputs =
|
|
|
|
{ self
|
|
|
|
, nixpkgs
|
|
|
|
,
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
|
|
|
in
|
|
|
|
{
|
|
|
|
overlay = _: prev: { inherit (self.packages.${prev.system}) kogs; };
|
|
|
|
nixosModule = import ./module.nix;
|
|
|
|
packages = forAllSystems (system:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgsFor.${system};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
kogs = pkgs.buildGoModule {
|
|
|
|
pname = "kogs";
|
2024-03-31 14:35:45 -06:00
|
|
|
version = "v1.0.0";
|
2024-03-26 20:19:40 -06:00
|
|
|
src = ./.;
|
|
|
|
|
2024-03-31 14:35:45 -06:00
|
|
|
vendorHash = null;
|
2024-03-26 20:19:40 -06:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
defaultPackage = forAllSystems (system: self.packages.${system}.kogs);
|
|
|
|
devShells = forAllSystems (system:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgsFor.${system};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
shellHook = ''
|
|
|
|
PS1='\u@\h:\@; '
|
|
|
|
nix run github:qbit/xin#flake-warn
|
|
|
|
echo "Go `${pkgs.go}/bin/go version`"
|
|
|
|
'';
|
|
|
|
nativeBuildInputs = with pkgs; [ git go gopls go-tools ];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|