traygent/flake.nix

104 lines
2.7 KiB
Nix
Raw Permalink Normal View History

2023-10-07 05:29:05 -06:00
{
description = "traygent: a graphical ssh-agent";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
inherit (builtins) readFile fromTOML;
verStr = fromTOML (readFile ./FyneApp.toml);
2023-10-07 05:29:05 -06:00
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
traygent = with pkgs;
2024-04-15 09:00:25 -06:00
buildGoModule rec {
2023-10-07 05:29:05 -06:00
pname = "traygent";
2024-08-26 10:25:43 -06:00
version = verStr.Details.Version;
2023-10-07 05:29:05 -06:00
src = ./.;
2024-08-26 07:48:32 -06:00
vendorHash = "sha256-rYLUBRX0m9sCihu6EhakiC1jAzp6NAY7oLaSSKwNqhU=";
2024-06-19 20:40:25 -06:00
2023-10-07 05:29:05 -06:00
proxyVendor = true;
nativeBuildInputs = [ pkg-config copyDesktopItems ];
buildInputs = [
2024-08-26 07:48:32 -06:00
fyne
2023-10-07 05:29:05 -06:00
glfw
libGL
libGLU
openssh
pkg-config
glibc
2023-10-07 05:29:05 -06:00
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXrandr
xorg.libXxf86vm
xorg.xinput
2024-08-26 07:48:32 -06:00
wayland
libxkbcommon
2023-10-07 05:29:05 -06:00
];
2024-08-26 07:48:32 -06:00
# No wayland yet, it opens a second window
buildPhase = ''
${fyne}/bin/fyne package --release
2024-08-26 07:48:32 -06:00
'';
installPhase = ''
mkdir -p $out
pkg="$PWD/${pname}.tar.xz"
cd $out
tar --strip-components=1 -xvf $pkg
'';
2023-10-07 05:29:05 -06:00
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.traygent);
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
export GOEXPERIMENT=loopvar
2023-10-07 05:29:05 -06:00
nix run github:qbit/xin#flake-warn
2024-04-15 09:00:25 -06:00
echo "Go `${pkgs.go}/bin/go version`"
2023-10-07 05:29:05 -06:00
'';
buildInputs = with pkgs; [
2024-08-26 07:48:32 -06:00
fyne
2023-10-07 05:29:05 -06:00
git
2024-04-15 09:00:25 -06:00
go
2023-10-07 05:29:05 -06:00
gopls
go-tools
2023-11-12 19:11:55 -07:00
glxinfo
2024-06-19 19:53:30 -06:00
nilaway
2023-10-07 05:29:05 -06:00
glfw
glibc
2023-10-07 05:29:05 -06:00
pkg-config
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXrandr
xorg.libXxf86vm
xorg.xinput
graphviz
2024-08-26 07:48:32 -06:00
wayland
libxkbcommon
2023-10-07 05:29:05 -06:00
go-font
];
};
});
};
}