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 { background {
monitor = 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) color = rgba(25, 20, 20, 1.0)
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations

View File

@ -11,6 +11,7 @@
hyprland = { hyprland = {
url = "github:hyprwm/Hyprland"; url = "github:hyprwm/Hyprland";
}; };
#hyprland-plugins = { #hyprland-plugins = {
# url = "github:hyprwm/hyprland-plugins"; # url = "github:hyprwm/hyprland-plugins";
# inputs.hyprland.follows = "hyprland"; # inputs.hyprland.follows = "hyprland";
@ -42,6 +43,10 @@
nix-ld, nix-ld,
... ...
} @ inputs: let } @ inputs: let
username = "foglar";
hostname = "laptop";
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
@ -62,13 +67,15 @@
in { in {
nixosConfigurations = { nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem { laptop = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs system pkgs pkgs-stable;}; specialArgs = {
inherit inputs system pkgs pkgs-stable username hostname;
};
modules = [ modules = [
./nixos/configuration.nix ./nixos/configuration.nix
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
nix-ld.nixosModules.nix-ld 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.username = "foglar";
home.homeDirectory = "/home/foglar"; home.homeDirectory = "/home/foglar";
home.stateVersion = "24.05"; # Please read the comment before changing. home.stateVersion = "24.05"; # Please read the comment before changing.
@ -38,11 +35,11 @@
cat = "bat --style plain"; cat = "bat --style plain";
rasp = "s foglar@192.168.8.140"; rasp = "s foglar@192.168.8.140";
hist = "history | awk '{for (i=2; i<=NF; i++) printf \$i\" \"; print \"\"}' | fzf | wl-copy"; 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"; cdx = "zoxide query --interactive";
distrobox-enter = "distrobox-enter --root"; distrobox-enter = "distrobox-enter --root";
distrobox-create = "distrobox-create --root"; distrobox-create = "distrobox-create --root";
distrobox-list = "distrobox-list --root";
}; };
bashrcExtra = '' bashrcExtra = ''
@ -69,38 +66,6 @@
XDG_PICTURES_DIR = "$HOME/Pictures/Screenshots/"; 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. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
} }

View File

@ -22,6 +22,36 @@
export __VK_LAYER_NV_optimus=NVIDIA_only export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@" 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; tor.enable = lib.mkDefault true;
virt-manager.enable = lib.mkDefault true; virt-manager.enable = lib.mkDefault true;
}; };
desktop.steamdeck.enable = lib.mkDefault false;
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
programs.wireshark.enable = true; programs.wireshark.enable = true;
} }

View File

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

View File

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