Skip to content

Commit

Permalink
flake.nix: re-added nix-gaming
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Mar 3, 2024
1 parent dfe7f4e commit d6d47ee
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 130 deletions.
58 changes: 58 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
inputs.flake-compat.follows = "flake-compat";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
};
nixgl = {
url = "github:nix-community/nixGL";
inputs.flake-utils.follows = "flake-utils";
Expand Down
13 changes: 11 additions & 2 deletions nixos/desktop/audio/default.nix → nixos/desktop/audio.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, flake, ... }:

let
cfg = config.nixos.desktop.audio;
in
{
imports = [ ./low-latency.nix ];
imports = [ flake.inputs.nix-gaming.nixosModules.pipewireLowLatency ];

options.nixos.desktop.audio = {
enable = lib.mkEnableOption "audio config" // {
default = config.nixos.desktop.enable;
};
lowLatency.enable = lib.mkEnableOption "low latency config" // {
default = config.nixos.games.enable;
};
};

config = lib.mkIf cfg.enable {
Expand All @@ -25,6 +28,12 @@ in
support32Bit = true;
};
pulse.enable = true;
lowLatency = {
inherit (cfg.lowLatency) enable;
# The default for this module is 64 that generally is too low and
# generates e.g.: cracking
quantum = lib.mkDefault 128;
};
wireplumber = {
enable = true;
configPackages =
Expand Down
108 changes: 0 additions & 108 deletions nixos/desktop/audio/low-latency.nix

This file was deleted.

2 changes: 1 addition & 1 deletion nixos/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
imports = [
./audio
./audio.nix
./fonts.nix
./greetd.nix
./locale.nix
Expand Down
22 changes: 3 additions & 19 deletions nixos/games/osu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,9 @@ in
};

config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; let
import-osu-songs = pkgs.writeShellApplication {
name = "import-osu-songs";
runtimeInputs = [ pkgs.coreutils ];
text = ''
declare -r osu_dir="$HOME/.osu"
if [[ ! -d "$osu_dir" ]]; then
>&2 echo "'$osu_dir' directory not found! Start 'osu-stable' once to create it."
exit 1
fi
declare -r osu_song_dir="$osu_dir/drive_c/osu/Songs"
mkdir -p "$osu_song_dir"
cp -v "''${@}" "$osu_song_dir"
'';
};
in
[
osu-lazer-bin
import-osu-songs
environment.systemPackages = with pkgs; [
gaming.osu-lazer-bin
gaming.osu-mime
];

# Enable opentabletdriver
Expand Down
2 changes: 2 additions & 0 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ outputs.lib.recursiveMergeAttrs [
# namespaces
libEx = outputs.lib;

gaming = flake.inputs.nix-gaming.packages.${prev.system};

wallpapers = prev.callPackage ../packages/wallpapers { };

# custom packages
Expand Down

0 comments on commit d6d47ee

Please sign in to comment.