feat: nix flake (#18)

This commit is contained in:
Hayden 2022-11-27 16:10:05 +00:00 committed by GitHub
parent aaabd3517a
commit 4a00e58b1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 114 additions and 0 deletions

27
flake.lock Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1669556876,
"narHash": "sha256-WF1KAul1L/ALduSLj0FDrc3uP3ZAEm8jMVeW1J4efOY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9edd8bbef7b0136febfb6d1bdc41c9bc80c0f90f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

87
flake.nix Normal file
View File

@ -0,0 +1,87 @@
{
description = "A GTK Mastodon client, forked from the now-archived Tootle";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/master";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { system = system; };
nativeBuildInputs = with pkgs; [
meson
ninja
vala
pkg-config
desktop-file-utils
python39
gtk3
wrapGAppsHook
];
buildInputs = with pkgs; [
meson
ninja
vala
glib
gtk4
json-glib
libxml2
libgee
libsoup
libadwaita
libsecret
];
in
{
devShells = {
${system} = {
default = pkgs.mkShell {
packages = buildInputs ++ nativeBuildInputs;
};
};
};
packages = {
${system} = {
tooth =
pkgs.stdenv.mkDerivation {
name = "tooth";
src = self;
nativeBuildInputs = nativeBuildInputs;
buildInputs = buildInputs;
preFixup = with pkgs; ''
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \
--prefix XDG_DATA_DIRS : "$out/share" \
--prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/dev.geopjr.tooth" \
--prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
--prefix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
--prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" [ pango json-glib ]}"
)
'';
configurePhase = "meson build --prefix=$out";
buildPhase = "ninja -C build";
installPhase = "
patchShebangs meson/post_install.py
ninja -C build install
";
postInstallPhase = "
meson/post_install.py
";
};
default = self.packages.${system}.tooth;
};
};
};
}