Modularization update

This commit is contained in:
foglar 2024-11-24 12:58:20 +01:00
parent 7c3c15a9a2
commit 002d90b664
7 changed files with 80 additions and 70 deletions

View File

@ -10,7 +10,7 @@ general {
background {
monitor =
path = /home/foglar/dotfiles/nixos/aurora_borealis.png
path = /home/foglar/dotfiles/config/backgrounds/aurora_borealis.png
color = rgba(25, 20, 20, 1.0)
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations

View File

@ -11,6 +11,7 @@
hyprland = {
url = "github:hyprwm/Hyprland";
};
#hyprland-plugins = {
# url = "github:hyprwm/hyprland-plugins";
# inputs.hyprland.follows = "hyprland";
@ -42,6 +43,10 @@
nix-ld,
...
} @ inputs: let
username = "foglar";
hostname = "laptop";
system = "x86_64-linux";
pkgs = import nixpkgs {
@ -62,13 +67,15 @@
in {
nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs system pkgs pkgs-stable;};
specialArgs = {
inherit inputs system pkgs pkgs-stable username hostname;
};
modules = [
./nixos/configuration.nix
inputs.stylix.nixosModules.stylix
nix-ld.nixosModules.nix-ld
{ programs.nix-ld.dev.enable = true; }
{programs.nix-ld.dev.enable = true;}
];
};
};

View File

@ -1,7 +1,4 @@
{
pkgs,
...
}: {
{...}: {
home.username = "foglar";
home.homeDirectory = "/home/foglar";
home.stateVersion = "24.05"; # Please read the comment before changing.
@ -38,11 +35,11 @@
cat = "bat --style plain";
rasp = "s foglar@192.168.8.140";
hist = "history | awk '{for (i=2; i<=NF; i++) printf \$i\" \"; print \"\"}' | fzf | wl-copy";
packages = "paru -Qe | fzf | wl-copy";
cdx = "zoxide query --interactive";
distrobox-enter = "distrobox-enter --root";
distrobox-create = "distrobox-create --root";
distrobox-list = "distrobox-list --root";
};
bashrcExtra = ''
@ -69,38 +66,6 @@
XDG_PICTURES_DIR = "$HOME/Pictures/Screenshots/";
};
home.packages = with pkgs; [
(writeShellScriptBin "gs" ''
set -xeuo pipefail
gamescopeArgs=(
--adaptive-sync # VRR support
--hdr-enabled
--mangoapp # performance overlay
--rt
--steam
)
steamArgs=(
-pipewire-dmabuf
-tenfoot
)
mangoConfig=(
cpu_temp
gpu_temp
ram
vram
)
mangoVars=(
MANGOHUD=1
MANGOHUD_CONFIG="$(IFS=,; echo "$mangoConfig[*]")"
)
export "$mangoVars[@]"
exec gamescope "$gamescopeArgs[@]" -- steam "$steamArgs[@]"
'')
];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

View File

@ -22,6 +22,36 @@
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'')
(writeShellScriptBin "gs" ''
set -xeuo pipefail
gamescopeArgs=(
--adaptive-sync # VRR support
--hdr-enabled
--mangoapp # performance overlay
--rt
--steam
)
steamArgs=(
-pipewire-dmabuf
-tenfoot
)
mangoConfig=(
cpu_temp
gpu_temp
ram
vram
)
mangoVars=(
MANGOHUD=1
MANGOHUD_CONFIG="$(IFS=,; echo "''${mangoConfig[*]}")"
)
export "''${mangoVars[@]}"
exec gamescope "''${gamescopeArgs[@]}" -- steam "''${steamArgs[@]}"
'')
];
};
}

View File

@ -13,6 +13,7 @@
tor.enable = lib.mkDefault true;
virt-manager.enable = lib.mkDefault true;
};
desktop.steamdeck.enable = lib.mkDefault false;
programs.kdeconnect.enable = true;
programs.wireshark.enable = true;
}

View File

@ -7,23 +7,27 @@
}: {
options = {
package.steam.enable = lib.mkEnableOption "Enable Steam module";
desktop.steamdeck.enable = lib.mkEnableOption "Enable Steam desktop integration";
};
config = lib.mkIf config.package.steam.enable {
programs.steam = {
enable = true;
gamescopeSession.enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
services.getty.autologinUser = "${username}";
environment = {
systemPackages = [pkgs.mangohud];
loginShellInit = ''
[[ "$(tty)" = "/dev/tty1" ]] && ./gs
'';
};
};
config = lib.mkMerge [
(lib.mkIf config.package.steam.enable {
programs.steam = {
enable = true;
gamescopeSession.enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
})
(lib.mkIf config.desktop.steamdeck.enable {
services.getty.autologinUser = "${username}";
environment = {
systemPackages = [pkgs.mangohud];
loginShellInit = ''
[[ "$(tty)" = "/dev/tty1" ]] && gs
'';
};
})
];
}

View File

@ -11,17 +11,20 @@
./sys/style.nix
];
sys.audio.enable = lib.mkDefault true;
sys.desktop.plasma.enable = lib.mkDefault true;
sys.desktop.gnome.enable = lib.mkDefault false;
sys.desktop.hyprland.enable = lib.mkDefault true;
sys.fonts.packages = lib.mkDefault true;
sys.locales.enable = lib.mkDefault true;
sys.network.enable = lib.mkDefault true;
sys.bluetooth.enable = lib.mkDefault true;
sys.nvidia.enable = lib.mkDefault true;
sys.printing.enable = lib.mkDefault true;
sys.sddm.enable = lib.mkDefault true;
sys.style.enable = lib.mkDefault true;
sys = {
audio.enable = lib.mkDefault true;
desktop = {
plasma.enable = lib.mkDefault true;
gnome.enable = lib.mkDefault false;
hyprland.enable = lib.mkDefault true;
};
fonts.packages = lib.mkDefault true;
locales.enable = lib.mkDefault true;
network.enable = lib.mkDefault true;
bluetooth.enable = lib.mkDefault true;
nvidia.enable = lib.mkDefault true;
printing.enable = lib.mkDefault true;
sddm.enable = lib.mkDefault true;
style.enable = lib.mkDefault true;
};
}