fass/flake.nix

98 lines
2.4 KiB
Nix
Raw Normal View History

2024-08-19 19:43:17 -06:00
{
2024-08-23 20:42:03 -06:00
description = "fass: stuff and fass";
2024-08-19 19:43:17 -06:00
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
{
2024-08-23 20:42:03 -06:00
overlay = _: prev: { inherit (self.packages.${prev.system}) fass; };
2024-08-19 19:43:17 -06:00
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
2024-08-23 20:42:03 -06:00
fass = with pkgs; pkgs.buildGoModule rec {
pname = "fass";
2024-08-19 19:43:17 -06:00
version = "v0.0.0";
src = ./.;
2024-10-16 07:42:11 -06:00
vendorHash = "sha256-XfbdYMNP/cq0XQDpJSvEpQoLg9oNc88LxJyFJ2c8iXM=";
2024-08-19 19:43:17 -06:00
nativeBuildInputs = [ pkg-config copyDesktopItems ];
buildInputs = [
2024-08-23 20:42:03 -06:00
fyne
2024-08-19 19:43:17 -06:00
glfw
libGL
libGLU
openssh
pkg-config
glibc
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXrandr
xorg.libXxf86vm
xorg.xinput
];
2024-08-23 20:42:03 -06:00
buildPhase = ''
${fyne}/bin/fyne package
'';
installPhase = ''
mkdir -p $out
pkg="$PWD/${pname}.tar.xz"
cd $out
tar --strip-components=1 -xvf $pkg
'';
2024-08-19 19:43:17 -06:00
};
});
2024-08-23 20:42:03 -06:00
defaultPackage = forAllSystems (system: self.packages.${system}.fass);
2024-08-19 19:43:17 -06:00
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`"
'';
buildInputs = with pkgs; [
fyne
git
go
2024-08-19 19:43:17 -06:00
gopls
go-tools
glxinfo
glfw
glibc
pkg-config
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXrandr
xorg.libXxf86vm
xorg.xinput
graphviz
go-font
];
};
});
};
}