Misc: Enable nix flakes

This commit is contained in:
PapaTutuWawa 2021-11-01 22:12:21 +01:00
parent 8c1eefc62c
commit 09d385806a
5 changed files with 31 additions and 25 deletions

View File

@ -34,7 +34,7 @@ in mkHost config {
gajim-mainwindow gajim-mainwindow
virt-manager unstable.qemu scream virt-manager unstable.qemu scream
#gamemode # Custom package #gamemode # Custom package
key-mapper # Custom package #key-mapper # Custom package
replaysorcery # Custom package replaysorcery # Custom package
#evdev-proxy # Custom package #evdev-proxy # Custom package
vfio-isolate # Custom Package vfio-isolate # Custom Package
@ -104,7 +104,7 @@ in mkHost config {
WriteResolvConf=false WriteResolvConf=false
''; '';
udev = { udev = {
packages = with pkgs; [ key-mapper ]; #packages = with pkgs; [ key-mapper ];
extraRules = '' extraRules = ''
KERNEL=="uinput", GROUP="input", MODE="0660" KERNEL=="uinput", GROUP="input", MODE="0660"
''; '';
@ -125,7 +125,7 @@ in mkHost config {
nix.package = pkgs.nixUnstable; nix.package = pkgs.nixUnstable;
nix.extraOptions = '' nix.extraOptions = ''
experimental-options = nix-command flakes ca-references experimental-features = nix-command flakes ca-references
''; '';
# TODO: Move into modules # TODO: Move into modules
@ -148,17 +148,17 @@ in mkHost config {
Restart = "always"; Restart = "always";
}; };
}; };
key-mapper = { #key-mapper = {
description = "A tool to change the mapping of your input device buttons"; # description = "A tool to change the mapping of your input device buttons";
wantedBy = [ "default.target" ]; # wantedBy = [ "default.target" ];
serviceConfig = { # serviceConfig = {
Type = "simple"; # Type = "simple";
ExecStart = "${pkgs.key-mapper}/bin/key-mapper-service"; # ExecStart = "${pkgs.key-mapper}/bin/key-mapper-service";
Restart = "always"; # Restart = "always";
# NOTE: The Tartarus may not be connected, so don't fail if we cannot set the preset # # NOTE: The Tartarus may not be connected, so don't fail if we cannot set the preset
ExecPostStart = "${pkgs.key-mapper}/bin/key-mapper --command start --preset NOOP --device \"Razer Razer Tartarus V2\"; exit 0"; # ExecPostStart = "${pkgs.key-mapper}/bin/key-mapper --command start --preset NOOP --device \"Razer Razer Tartarus V2\"; exit 0";
}; # };
}; #};
replaysorcery = { replaysorcery = {
description = "An open-source, instant-replay solution for Linux"; description = "An open-source, instant-replay solution for Linux";
#wantedBy = [ "default.target" ]; #wantedBy = [ "default.target" ];

View File

@ -3,7 +3,7 @@ pkgs: final: prev:
{ {
nur = import (builtins.fetchTarball { nur = import (builtins.fetchTarball {
url = "https://github.com/nix-community/NUR/archive/master.tar.gz"; url = "https://github.com/nix-community/NUR/archive/master.tar.gz";
sha256 = "19s8a5pfp8yms0kx5lb74al5yfia2smn46dndsl43q528719pnp4"; sha256 = "0fz7zdfvjfjzg46w7khvwr5jhpd9w8yx0cdd9gnmbkzxhbspbmwq";
}) { }) {
inherit pkgs; inherit pkgs;
}; };

View File

@ -12,7 +12,7 @@ let
}; };
wrapInSandbox = pkgs.callPackage ./sandbox.nix {}; wrapInSandbox = pkgs.callPackage ./sandbox.nix {};
in { in {
key-mapper = pkgs.callPackage ./tools/games/key-mapper {}; #key-mapper = pkgs.callPackage ./tools/games/key-mapper {};
vfio-isolate = pkgs.callPackage ./tools/virtualisation/vfio-isolate {}; vfio-isolate = pkgs.callPackage ./tools/virtualisation/vfio-isolate {};
mopidy-funkwhale = pkgs.callPackage ./applications/audio/mopidy/funkwhale.nix {}; mopidy-funkwhale = pkgs.callPackage ./applications/audio/mopidy/funkwhale.nix {};
# Not as clean as I hoped, but it works # Not as clean as I hoped, but it works

View File

@ -1,14 +1,16 @@
{ stdenv, lib }: { stdenv, lib, fetchFromGitHub }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "Anime4k"; pname = "Anime4k";
version = "4.0.0-RC"; version = "4.0.1";
src = builtins.fetchGit { src = fetchFromGitHub {
url = "https://github.com/bloc97/Anime4K.git"; owner = "bloc97";
ref = "cb56502ed429a5a3e48ed62c5245d6445a209c7c"; repo = "Anime4k";
rev = "v${version}";
sha256 = "1gc1ka9i7xzxq58175q5svhvp8vr27hy477r4z4nkhp9q1cqj19r";
}; };
installPhase = '' installPhase = ''
find ./glsl/ -type f -iname '*.glsl' -exec install -Dm 644 {} -t $out/usr/share/shaders/ \; find ./glsl/ -type f -iname '*.glsl' -exec install -Dm 644 {} -t $out/usr/share/shaders/ \;
''; '';

View File

@ -4,10 +4,12 @@
, gtk3, gobject-introspection, git, gnome , gtk3, gobject-introspection, git, gnome
, wrapGAppsHook , wrapGAppsHook
, makeDesktopItem , makeDesktopItem
, fetchFromGitHub
}: }:
python3Packages.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
pname = "key-mapper"; pname = "key-mapper";
# TODO: Update to 1.2.1
version = "1.0.0"; version = "1.0.0";
buildInputs = [ gobject-introspection gtk3 gnome.adwaita-icon-theme ]; buildInputs = [ gobject-introspection gtk3 gnome.adwaita-icon-theme ];
@ -16,9 +18,11 @@ python3Packages.buildPythonApplication rec {
propagatedBuildInputs = with python3.pkgs; [ setuptools pydbus evdev pygobject3 ]; propagatedBuildInputs = with python3.pkgs; [ setuptools pydbus evdev pygobject3 ];
src = builtins.fetchGit { src = fetchFromGitHub {
url = "https://github.com/sezanzeb/key-mapper.git"; owner = "sezanzeb";
ref = version; repo = "key-mapper";
rev = version;
sha256 = "07dgp4vays1w4chhd22vlp9bxc49lcgzkvmjqgbr00m3781yjsf7";
}; };
doCheck = false; doCheck = false;