setting up the cumsole

This commit is contained in:
2025-12-11 12:14:43 +00:00
parent e7275b4c37
commit 4a8274bd59
10 changed files with 203 additions and 96 deletions

View File

@@ -23,7 +23,6 @@ in
{
imports = [
./hardware-configuration.nix
./system/hardware.nix
./system/boot.nix
./system/network.nix
./system/inputMethods.nix
@@ -147,8 +146,74 @@ in
system.stateVersion = "24.11"; # Did you read the comment?
specialisation = {
steam = {
"01-steam" = {
configuration = {
# ── HDMI-CEC: Turn on TV when Steam specialisation starts ─────────────────────
services.udev.packages = [ pkgs.libcec ]; # ensures cec-utils is in PATH
# A user service that runs once the graphical session (Steam/GameScope) is ready
systemd.user.services.cec-tv-on = {
description = "Turn on TV via HDMI-CEC when entering Steam specialisation";
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = toString (
pkgs.writeShellScript "cec-tv-on.sh" ''
# Wait a moment for the HDMI link to settle
sleep 3
# Turn on the TV and set it as active source (most TVs understand this)
${pkgs.libcec}/bin/cec-client -s -d 1 <<EOF
on 0
as
EOF
# Alternative one-liner if the above somehow fails:
# echo 'on 0' | ${pkgs.libcec}/bin/cec-client -s -d 1
# echo 'as' | ${pkgs.libcec}/bin/cec-client -s -d 1
''
);
};
};
# Make sure the user service starts automatically
systemd.user.targets.graphical-session = {
# This target already exists, we just ensure its active
unitConfig = {
RefuseManualStart = false;
RefuseManualStop = false;
};
};
#boot.loader.systemd-boot.sortKey = lib.mkForce "00000000001-steam";
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
libva
libva-vdpau-driver
libvdpau-va-gl
];
};
# ── Bluetooth ────────────────────────────────────────────────────────────────
hardware.bluetooth = {
enable = true; # Enable Bluetooth support
powerOnBoot = true; # Power up controller on boot
settings.General = {
#Enable = "Source,Sink,Media,Socket";
# Experimental = true;
};
};
# ── Tablets ─────────────────────────────────────────────────────────────────
hardware.enableRedistributableFirmware = true;
hardware.firmware = [
pkgs.linux-firmware
];
environment = {
systemPackages = with pkgs; [
mangohud
@@ -159,22 +224,11 @@ in
};
};
services.ananicy = {
enable = true;
package = pkgs.ananicy-cpp;
rulesProvider = pkgs.ananicy-cpp;
extraRules = [
{
"name" = "gamescope";
"nice" = -20;
}
];
};
programs = {
gamescope = {
enable = true;
capSysNice = false;
capSysNice = true;
};
steam = {
@@ -186,20 +240,28 @@ in
mangohud
gamemode
];
gamescopeSession.enable = true;
gamescopeSession = {
enable = true;
args = [
"--prefer-output"
"HDMI-A-2"
"--hdr-enabled"
];
};
};
};
};
};
main-system = {
"00-main-system" = {
configuration = {
#boot.loader.systemd-boot.sortKey = lib.mkDefault "00000000000-main";
##############################################################################
# Imports
##############################################################################
imports = [
./system/services.nix
./system/hardware.nix
./system/nixOSPkgs.nix
#inputs.niri.nixosModules.niri
];

View File

@@ -39,14 +39,12 @@ in
##########################################################################
# See https://wiki.hyprland.org/Configuring/Monitors/
# monitor = lib.mkMerge [
monitor = lib.mkMerge [
#(lib.mkIf (systemName == "laptop") [ "eDP-1,1920x1080@59.99700,0x0,1" ])
# (lib.mkIf (systemName == "pc") [
# "DP-2,2560x1440@144,0x0,1"
# "DP-1,2560x1440@239.97,2569x0,1"
# #"DP-1,2560x1440@144,1920x0,1,bitdepth,10,cm,hdr"
# ])
# ];
(lib.mkIf (systemName == "pc") [
"HDMI-A-2, disable"
])
];
monitorv2 =
[ ]

View File

@@ -44,8 +44,8 @@
};
shellAliases = {
nix-switch = "sudo nixos-rebuild switch";
nix-upgrade = "sudo nixos-rebuild switch --upgrade";
nix-switch = "nh os switch --specialisation 00-main-system";
nix-upgrade = "(cd ~/nixos-dots && nix flake update) && echo 'flake.lock updated'";
nix-edit = "sudo vim /etc/nixos/configuration.nix";
ls = "exa -lag --icons";

6
flake.lock generated
View File

@@ -1426,11 +1426,11 @@
"tinted-zed": "tinted-zed"
},
"locked": {
"lastModified": 1765047449,
"narHash": "sha256-VQcqjJ2g0kT9TW4ENwA2HBQJzfbCUd5s1Wm3K+R2QZY=",
"lastModified": 1765386911,
"narHash": "sha256-YLjQpnTZCMjCho7ZDs5O1yFVw+fDlXq4lSJDuLWHHeA=",
"owner": "nix-community",
"repo": "stylix",
"rev": "bd00e01aab676aee88e6cc5c9238b4a5a7d6639a",
"rev": "cb6bbed75eaca21deb8950c2ec0036ae5cde18ca",
"type": "github"
},
"original": {

View File

@@ -35,9 +35,14 @@
boot.initrd.kernelModules = [ ];
boot.kernelModules =
[ ]
++ (lib.optionals (systemName == "pc") [ "kvm-amd" ])
++ (lib.optionals (systemName == "pc") [ "kvm-amd" "btusb"])
++ (lib.optionals (systemName == "laptop") [ "kvm-intel" ]);
boot.extraModulePackages = [ ];
boot.kernelParams = [
# Most common working combination in 2024/2025
"btusb.enable_autosuspend=0"
"btusb.reset=1"
];
fileSystems."/" = lib.mkMerge [
(lib.mkIf (systemName == "pc") {
@@ -71,29 +76,36 @@
fsType = "btrfs";
})
];
fileSystems."/server" = lib.mkIf (systemName == "pc") { # or remove the mkIf if you want it on both
device = "//192.168.1.8/mrfluffy"; # adjust the share name if its not the home share
fsType = "cifs";
options = let
# Separate credentials from the Nix store (very important for security)
credFile = "/etc/nixos/smb-credentials-mrfluffy";
in [
# Basic recommended options
"credentials=${credFile}"
"gid=users" # make files belong to the "users" group (or your preferred group)
"uid=1000" # replace with your users UID, or use "uid=${config.users.users.yourname.uid}"
"file_mode=0664"
"dir_mode=0775"
"nofail" # ← this makes the mount OPTIONAL (boot continues if unreachable)
"noauto" # dont mount automatically at boot (optional, combine with x-systemd.automount)
"x-systemd.automount" # creates a systemd automount unit → mounts on first access
"x-systemd.mount-timeout=15" # dont wait forever
"vers=3.0" # force SMB3 if the server supports it (recommended)
# "iocharset=utf8" # usually not needed with modern servers
# "cache=loose" # improves performance for some workloads
fileSystems."/home/mrfluffy/Games" = lib.mkMerge [
(lib.mkIf (systemName == "pc") {
device = "/dev/disk/by-uuid/54188f21-d525-4681-a9d4-b798363eef17";
fsType = "ext4";
})
];
};
#fileSystems."/server" = lib.mkIf (systemName == "pc") { # or remove the mkIf if you want it on both
# device = "//192.168.1.8/mrfluffy"; # adjust the share name if its not the home share
# fsType = "cifs";
# options = let
# # Separate credentials from the Nix store (very important for security)
# credFile = "/etc/nixos/smb-credentials-mrfluffy";
# in [
# # Basic recommended options
# "credentials=${credFile}"
# "gid=users" # make files belong to the "users" group (or your preferred group)
# "uid=1000" # replace with your users UID, or use "uid=${config.users.users.yourname.uid}"
# "file_mode=0664"
# "dir_mode=0775"
# "nofail" # ← this makes the mount OPTIONAL (boot continues if unreachable)
# "noauto" # dont mount automatically at boot (optional, combine with x-systemd.automount)
# "x-systemd.automount" # creates a systemd automount unit → mounts on first access
# "x-systemd.mount-timeout=15" # dont wait forever
# "vers=3.0" # force SMB3 if the server supports it (recommended)
# # "iocharset=utf8" # usually not needed with modern servers
# # "cache=loose" # improves performance for some workloads
# ];
#};
swapDevices =
[ ]

View File

@@ -247,6 +247,7 @@ in
wineWowPackages.stable
mangayomi
rink
protontricks
############################
# KDE / File Management

View File

@@ -23,7 +23,13 @@ in
{
boot = {
loader = {
systemd-boot.enable = true;
systemd-boot = {
enable = true;
extraInstallCommands = ''
${lib.getExe pkgs.gnused} -i 's/default .*/default *-specialisation-00-main-system.conf/' /boot/loader/loader.conf
'';
#sortKey = "z-normal";
};
efi.canTouchEfiVariables = true;
};

View File

@@ -33,17 +33,17 @@ in
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
rocmPackages.rocm-core
rocmPackages.rocminfo
rocmPackages.rocm-runtime
rocmPackages.clr.icd
rocmPackages.rocm-smi
rocmPackages.clr
#rocmPackages.hipblas
rocmPackages.rocblas
rocmPackages.rocsolver
rocmPackages.rocm-comgr
rocmPackages.rocsparse
#rocmPackages.rocm-core
#rocmPackages.rocminfo
#rocmPackages.rocm-runtime
#rocmPackages.clr.icd
#rocmPackages.rocm-smi
#rocmPackages.clr
##rocmPackages.hipblas
#rocmPackages.rocblas
#rocmPackages.rocsolver
#rocmPackages.rocm-comgr
#rocmPackages.rocsparse
# amdvlk
# driversi686Linux.amdvlk
# mesa

View File

@@ -70,6 +70,7 @@ in
# Core programs
############################
programs = {
dconf.enable = true;
appimage = {
enable = true;
@@ -84,7 +85,7 @@ in
};
gamescope = {
enable = true;
capSysNice = true;
capSysNice = false;
};
nix-index-database = {

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, systemName, ... }:
{
config,
lib,
pkgs,
systemName,
...
}:
{
###############################################
@@ -54,13 +60,32 @@
"92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 96000;
"default.clock.allowed-rates" = [ 44100 48000 96000 ];
"default.clock.allowed-rates" = [
44100
48000
96000
];
};
};
};
})
];
###############################################
# nice shit
###############################################
services.ananicy = {
enable = true;
package = pkgs.ananicy-cpp;
rulesProvider = pkgs.ananicy-cpp;
extraRules = [
{
"name" = "gamescope";
"nice" = -20;
}
];
};
services.blueman.enable = true;
###############################################
@@ -167,7 +192,8 @@
description = "Service to launch Steam URLs via FIFO";
wantedBy = [ "default.target" ];
serviceConfig = {
ExecStart = let
ExecStart =
let
script = pkgs.writeShellScript "steam-run-url-service.sh" ''
#!/usr/bin/env bash
FIFO="/run/user/$(id --user)/steam-run-url.fifo"
@@ -184,7 +210,8 @@
fi
done
'';
in "${script}";
in
"${script}";
Restart = "always";
};
path = [ pkgs.steam ];