Add gamescope as separate desktop option

This commit is contained in:
Evie Litherland-Smith 2023-08-05 18:06:21 +01:00
parent 1336f5da84
commit 14d8b5683c
8 changed files with 79 additions and 64 deletions

10
home/default.nix Normal file
View file

@ -0,0 +1,10 @@
{ config, lib, pkgs, ... }:
{
home.packages = with pkgs; [
bitwarden
signal-desktop
libreoffice
zotero
];
}

View file

@ -14,7 +14,7 @@ in {
home = { home = {
inherit username homeDirectory; inherit username homeDirectory;
stateVersion = "23.05"; stateVersion = "23.05";
packages = with pkgs; [ gcc ]; packages = with pkgs; [coreutils-prefixed];
}; };
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;

View file

@ -12,7 +12,6 @@ in {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../hyprland.nix
../../services/${hostName}.nix ../../services/${hostName}.nix
]; ];
@ -28,7 +27,7 @@ in {
opengl.driSupport32Bit = true; opengl.driSupport32Bit = true;
steam-hardware.enable = true; steam-hardware.enable = true;
}; };
system.autoUpgrade.enable = true; system.autoUpgrade.enable = false;
environment.systemPackages = with pkgs; [mesa]; environment.systemPackages = with pkgs; [mesa];
programs = { programs = {
xwayland.enable = true; xwayland.enable = true;

View file

@ -1,26 +1,18 @@
{shellConfig, ...}: let { shellConfig, ... }:
let
username = "xenia"; username = "xenia";
homeDirectory = "/home/${username}"; homeDirectory = "/home/${username}";
in { in
{
imports = [ imports = [
shellConfig shellConfig
../../home/git/personal.nix ../../home/git/personal.nix
../../home/ssh/personal.nix ../../home/ssh/personal.nix
../../home/tui ../../home/tui
../../home/hyprland
]; ];
home = { home = {
inherit username homeDirectory; inherit username homeDirectory;
stateVersion = "22.11"; stateVersion = "22.11";
}; };
programs.home-manager.enable = true; programs.home-manager.enable = true;
xdg.configFile."hypr/display.conf".text = ''
monitor=DP-1,highrr,auto,1
monitor=DP-2,highrr,auto,1
monitor=HDMI-1,highres,auto,2
monitor=HDMI-2,highres,auto,2
'';
xdg.configFile."hypr/autostart.conf".text = ''
exec-once=gamescope -w 1920 -h 1080 -W 3840 -H 2160 -U -f --hdr-enabled -e -- steam -gamepadui
'';
} }

View file

@ -1,6 +1,8 @@
{ pkgs, shell, ... }: { pkgs, shell, ... }:
let flakeURL = "git+https://git.xenia.me.uk/xenia/nixos.git?ref=main"; let
in { flakeURL = "git+https://git.xenia.me.uk/xenia/nixos.git?ref=main";
in
{
nix = { nix = {
settings.experimental-features = [ "nix-command" "flakes" ]; settings.experimental-features = [ "nix-command" "flakes" ];
gc = { gc = {
@ -18,52 +20,16 @@ in {
localBinInPath = true; localBinInPath = true;
systemPackages = with pkgs; [ distrobox ]; systemPackages = with pkgs; [ distrobox ];
shellAliases = { shellAliases = {
nou = "sudo nixos-rebuild switch --flake ${flakeURL}"; nou = "sudo nixos-rebuild switch --flake \"${flakeURL}\"";
noul = "sudo nixos-rebuild switch --flake $HOME/.config/home-manager"; noul = "sudo nixos-rebuild switch --flake $HOME/.config/home-manager";
hms = "${pkgs.home-manager}/bin/home-manager switch --flake ${flakeURL}"; hms = "${pkgs.home-manager}/bin/home-manager switch --flake \"${flakeURL}\"";
hmsl = "${pkgs.home-manager}/bin/home-manager switch --flake $HOME/.config/home-manager"; hmsl = "${pkgs.home-manager}/bin/home-manager switch --flake $HOME/.config/home-manager";
}; };
}; };
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
services.power-profiles-daemon.enable = true; services.power-profiles-daemon.enable = true;
virtualisation.podman.enable = true; virtualisation.podman.enable = true;
programs = { programs.${shell}.enable = true;
${shell}.enable = true;
ssh.startAgent = true;
dconf.enable = true;
};
fonts = {
packages = with pkgs; [
# icon fonts
material-symbols
# normal fonts
jost
lexend
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
roboto
# nerdfonts
(nerdfonts.override { fonts = [ "FiraCode" ]; })
];
fontconfig = {
enable = true;
# user defined fonts
# the reason there's Noto Color Emoji everywhere is to override DejaVu's
# B&W emojis that would sometimes show instead of some Color emojis
defaultFonts = {
serif = [ "Noto Serif" "Noto Color Emoji" ];
sansSerif = [ "Noto Sans" "Noto Color Emoji" ];
monospace = [ "FiraCode Nerd Font" "Noto Color Emoji" ];
emoji = [ "Noto Color Emoji" ];
};
};
};
services.xserver = {
layout = "gb";
xkbVariant = "";
};
console.keyMap = "uk";
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/London"; time.timeZone = "Europe/London";
i18n = { i18n = {

View file

@ -2,13 +2,7 @@
{ {
imports = [ ./common.nix ]; imports = [ ./common.nix ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ libnotify ];
libnotify
bitwarden
signal-desktop
libreoffice
zotero
];
security.rtkit.enable = true; security.rtkit.enable = true;
sound.enable = true; sound.enable = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
@ -25,6 +19,33 @@
}; };
}; };
console.keyMap = "uk"; console.keyMap = "uk";
programs.ssh.startAgent = true;
programs.dconf.enable = true; programs.dconf.enable = true;
xdg.portal.enable = true; fonts = {
packages = with pkgs; [
# icon fonts
material-symbols
# normal fonts
jost
lexend
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
roboto
# nerdfonts
(nerdfonts.override { fonts = [ "FiraCode" ]; })
];
fontconfig = {
enable = true;
# user defined fonts
# the reason there's Noto Color Emoji everywhere is to override DejaVu's
# B&W emojis that would sometimes show instead of some Color emojis
defaultFonts = {
serif = [ "Noto Serif" "Noto Color Emoji" ];
sansSerif = [ "Noto Sans" "Noto Color Emoji" ];
monospace = [ "FiraCode Nerd Font" "Noto Color Emoji" ];
emoji = [ "Noto Color Emoji" ];
};
};
};
} }

26
hosts/gamescope.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
let
sessionCommand = " gamescope -w 1920 -h 1080 -W 3840 -H 2160 -U -f --hdr-enabled -e -- steam -gamepadui";
in
{
imports = [ ./desktop.nix ];
services = {
blueman.enable = true;
greetd.settings = {
default_session.command = sessionCommand;
initial_session.command = sessionCommand;
};
};
programs = {
xwayland.enable = true;
gamescope = {
enable = true;
capSysNice = true;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
gamescopeSession.enable = true;
};
};
}

View file

@ -14,6 +14,7 @@
initial_session.command = "Hyprland"; initial_session.command = "Hyprland";
}; };
}; };
xdg.portal.enable = true;
xdg.portal.extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; xdg.portal.extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
programs = { programs = {
hyprland.enable = true; hyprland.enable = true;