feat(boilr): service and fixes
This commit is contained in:
parent
1f1c7775aa
commit
b000585104
|
@ -44,6 +44,7 @@
|
|||
|
||||
environment.systemPackages = with pkgs; [
|
||||
steam-rom-manager
|
||||
(pkgs.callPackage ../pkgs/boilr.nix {})
|
||||
];
|
||||
|
||||
security.sudo.extraRules = [
|
||||
|
@ -58,6 +59,7 @@
|
|||
}
|
||||
];
|
||||
|
||||
programs.steam.enable = true;
|
||||
jovian.devices.steamdeck.enable = true;
|
||||
jovian.steam.enable = true;
|
||||
jovian.steam.autoStart = true;
|
||||
|
|
69
pkgs/boilr.nix
Normal file
69
pkgs/boilr.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
clangStdenv,
|
||||
gtk3,
|
||||
xorg,
|
||||
perl,
|
||||
openssl,
|
||||
speechd,
|
||||
libxkbcommon,
|
||||
libGL,
|
||||
wayland,
|
||||
}: let
|
||||
version = "1.9.1";
|
||||
hash = "sha256-mdkRuEzfWhdbX0DD6uwc1o8kXjqk1Y0+FFKHrM2m81w=";
|
||||
cargoHash = "sha256-5nhtGqukZ8tp7gPV+JiUEHTzWUj6JtsB2i7bODcXJSc=";
|
||||
|
||||
rpathLibs = [
|
||||
speechd
|
||||
openssl
|
||||
gtk3
|
||||
libxkbcommon
|
||||
libGL
|
||||
|
||||
# WINIT_UNIX_BACKEND=wayland
|
||||
wayland
|
||||
|
||||
# WINIT_UNIX_BACKEND=x11
|
||||
xorg.libXcursor
|
||||
xorg.libXrandr
|
||||
xorg.libXi
|
||||
xorg.libX11
|
||||
xorg.libxcb
|
||||
];
|
||||
in
|
||||
rustPlatform.buildRustPackage.override {stdenv = clangStdenv;} {
|
||||
pname = "BoilR";
|
||||
inherit version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "PhilipK";
|
||||
repo = "BoilR";
|
||||
rev = "v.${version}";
|
||||
inherit hash;
|
||||
};
|
||||
|
||||
warning = builtins.trace "Is boilr part of nixpkgs? https://github.com/NixOS/nixpkgs/pull/247991" "";
|
||||
|
||||
inherit cargoHash;
|
||||
|
||||
nativeBuildInputs = [perl];
|
||||
|
||||
buildInputs = rpathLibs;
|
||||
|
||||
postInstall = ''
|
||||
patchelf --add-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/boilr
|
||||
'';
|
||||
|
||||
dontPatchELF = true;
|
||||
|
||||
meta = {
|
||||
description = "BoilR automatically adds (almost) all your games to your Steam library (including image art)";
|
||||
homepage = "https://github.com/PhilipK/BoilR";
|
||||
license = with lib.licenses; [asl20 mit];
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [foolnotion];
|
||||
};
|
||||
}
|
|
@ -14,7 +14,9 @@
|
|||
];
|
||||
};
|
||||
in {
|
||||
imports = [];
|
||||
imports = [
|
||||
../modules/boilr.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
home = {
|
||||
|
@ -36,6 +38,10 @@ in {
|
|||
# Make sure firefox is my default browser
|
||||
programs.firefox.enable = true;
|
||||
|
||||
services.boilr = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Configure restic backups
|
||||
# services.restic = {
|
||||
# enable = true;
|
||||
|
|
42
users/modules/boilr.nix
Normal file
42
users/modules/boilr.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.boilr;
|
||||
in {
|
||||
options.services.boilr = {
|
||||
enable = lib.mkEnableOption "boilr, the steam shortcut importer";
|
||||
|
||||
package = lib.mkOption {
|
||||
description = "Boilr package to use";
|
||||
default = pkgs.callPackage ../../pkgs/boilr.nix {};
|
||||
type = lib.types.package;
|
||||
};
|
||||
|
||||
settingsPath = lib.mkOption {
|
||||
description = "Boilr settings";
|
||||
default = {};
|
||||
type = with lib.types; attrsOf anything;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.user.services.boilr = {
|
||||
Unit = {
|
||||
Description = "BoilR automatically adds (almost) all your games to your Steam library (including image art)";
|
||||
Documentation = ["https://github.com/PhilipK/BoilR"];
|
||||
After = "network.target";
|
||||
Before = "steam.slice";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${cfg.package}/bin/boilr --no-ui";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["steam.slice"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue