diff --git a/flake.lock b/flake.lock index 0f30101..5234fb2 100644 --- a/flake.lock +++ b/flake.lock @@ -150,6 +150,24 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "fromYaml": { "flake": false, "locked": { @@ -418,6 +436,47 @@ "type": "github" } }, + "nix-gaming": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719710498, + "narHash": "sha256-+yqI1zvk1jNcNTWA3CGnp5N2jSXr/q/CggYZYvGsdNc=", + "owner": "fufexan", + "repo": "nix-gaming", + "rev": "774908e566a0b3b702219fdf90a5ed4551b3688d", + "type": "github" + }, + "original": { + "owner": "fufexan", + "repo": "nix-gaming", + "type": "github" + } + }, + "nix-index-db": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719832725, + "narHash": "sha256-dr8DkeS74KVNTgi8BE0BiUKALb+EKlMIV86G2xPYO64=", + "owner": "mic92", + "repo": "nix-index-database", + "rev": "2917972ed34ce292309b3a4976286f8b5c08db27", + "type": "github" + }, + "original": { + "owner": "mic92", + "repo": "nix-index-database", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1719075281, @@ -434,6 +493,18 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1719848872, @@ -489,6 +560,8 @@ "hyprland": "hyprland", "impermanence": "impermanence", "nh": "nh", + "nix-gaming": "nix-gaming", + "nix-index-db": "nix-index-db", "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "stylix": "stylix" diff --git a/flake.nix b/flake.nix index d1b5d2a..02478d5 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nix-index-db = { + url = "github:mic92/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; @@ -26,6 +31,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nix-gaming = { + url = "github:fufexan/nix-gaming"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + stylix.url = "github:danth/stylix"; }; diff --git a/os/configuration.nix b/os/configuration.nix index 73fa85e..8fb13ae 100644 --- a/os/configuration.nix +++ b/os/configuration.nix @@ -6,6 +6,10 @@ inputs, ... }: { + imports = [ + inputs.nix-gaming.nixosModules.pipewireLowLatency + ]; + nixpkgs.config = {allowUnfree = true;}; nixpkgs.overlays = [ outputs.overlays.additions @@ -140,7 +144,16 @@ hardware.pulseaudio.enable = false; services.pipewire = { enable = true; + alsa.enable = true; + alsa.support32Bit = true; pulse.enable = true; + + lowLatency = { + enable = true; + # defaults (USES nix-gaming PIPEWIRE LOW LATENCY MODULE!) + quantum = 64; + rate = 48000; + }; }; services.libinput.enable = true; diff --git a/os/shell/zsh.nix b/os/shell/zsh.nix index 15c90f6..b5ac256 100644 --- a/os/shell/zsh.nix +++ b/os/shell/zsh.nix @@ -6,6 +6,7 @@ programs.bat.enable = true; programs.eza.enable = true; programs.man.enable = true; + programs.nix-index.enableZshIntegration = false; home.packages = [ pkgs.unstable.steam-run ]; diff --git a/os/util/user.nix b/os/util/user.nix index 91eda7a..a72e2ca 100644 --- a/os/util/user.nix +++ b/os/util/user.nix @@ -182,7 +182,9 @@ in { home-manager.users = lib.mkIf (config.user != null) (lib.attrsets.mapAttrs (name: userConfig: { imports = - [] + [ + inputs.nix-index-db.hmModules.nix-index + ] ++ ( if name != "root" then [ @@ -301,6 +303,9 @@ in { }; programs.home-manager.enable = true; programs.git.enable = true; + programs.nix-index.enable = true; + programs.nix-index.symlinkToCacheHome = true; + programs.nix-index-database.comma.enable = true; systemd.user.startServices = "sd-switch"; }) config.user);