gnome-random-background/flake.nix
2022-08-21 18:47:03 -05:00

79 lines
2 KiB
Nix

{
description = "gnome-random-background";
# nixConfig.bash-prompt-suffix = "develop";
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable";
};
};
outputs = { self, nixpkgs, ... }@input:
let
version = self.lastModifiedDate;
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (
system:
import nixpkgs {
inherit system;
}
);
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in
{
gnome-random-background = pkgs.poetry2nix.mkPoetryApplication {
python = pkgs.python310;
projectDir = ./.;
propagatedBuildInputs = [
pkgs.cairo
pkgs.gobject-introspection
pkgs.gtk4
pkgs.pkg-config
];
};
}
);
defaultPackage = forAllSystems (
system: self.packages.${system}.gnome-random-background
);
apps = forAllSystems (
system: {
gnome-choose-random-background = {
type = "app";
program = "${self.packages.${system}.gnome-random-background}/bin/gnome-choose-random-background";
};
}
);
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
python = pkgs.python310.withPackages (
ps: with ps; [
poetry
]
);
in
{
default =
pkgs.mkShell {
buildInputs = with pkgs; [
cairo
gobject-introspection
gtk4
pkg-config
python
];
shellHook = ''
export POETRY_VIRTUALENVS_IN_PROJECT=true
export PS1='\[\033[1;34m\][gnome-random-background:\w]\$\[\033[0m\] '
'';
};
}
);
};
}