Compare commits
3 Commits
master
...
67fda15ca9
| Author | SHA1 | Date | |
|---|---|---|---|
| 67fda15ca9 | |||
| 769ab6f72d | |||
| 1769e583d8 |
25
flake.nix
25
flake.nix
@@ -162,5 +162,30 @@
|
||||
# }
|
||||
# ];
|
||||
};
|
||||
|
||||
nixosConfigurations."thancred" = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit userName userEmail;
|
||||
hostname = "thancred";
|
||||
role = "server";
|
||||
};
|
||||
modules = [
|
||||
myOverlays
|
||||
./modules/common
|
||||
./modules/machine/thancred
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = extraSpecialArgs;
|
||||
home-manager.backupFileExtension = "bak";
|
||||
home-manager.users.${userName}.imports = [
|
||||
./home
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
aagl,
|
||||
vintage-story,
|
||||
vintage-story ? null,
|
||||
...
|
||||
}: let
|
||||
} @ args: let
|
||||
cfg = config.gaming;
|
||||
aagl = args.aagl or null;
|
||||
in {
|
||||
imports = [
|
||||
aagl.nixosModules.default
|
||||
];
|
||||
|
||||
options.gaming = {
|
||||
steam = {
|
||||
@@ -153,84 +150,85 @@ in {
|
||||
|
||||
config = let
|
||||
agl = cfg.aagl;
|
||||
in {
|
||||
programs.steam = lib.mkIf cfg.steam.enable {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = cfg.steam.firewall.remotePlay;
|
||||
localNetworkGameTransfers.openFirewall = cfg.steam.firewall.localNetworkGameTransfers;
|
||||
};
|
||||
hasAagl = aagl != null;
|
||||
in lib.mkMerge [
|
||||
{
|
||||
programs.steam = lib.mkIf cfg.steam.enable {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = cfg.steam.firewall.remotePlay;
|
||||
localNetworkGameTransfers.openFirewall = cfg.steam.firewall.localNetworkGameTransfers;
|
||||
};
|
||||
|
||||
programs.gamemode = lib.mkIf cfg.gamemode.enable {
|
||||
enable = true;
|
||||
settings = cfg.gamemode.config;
|
||||
};
|
||||
programs.gamemode = lib.mkIf cfg.gamemode.enable {
|
||||
enable = true;
|
||||
settings = cfg.gamemode.config;
|
||||
};
|
||||
|
||||
programs.gamescope = lib.mkIf cfg.gamescope.enable {
|
||||
enable = true;
|
||||
programs.gamescope = lib.mkIf cfg.gamescope.enable {
|
||||
enable = true;
|
||||
|
||||
# Apply custom resolution if specified
|
||||
args =
|
||||
lib.optional (cfg.gamescope.settings.resolution != null) [
|
||||
"-w"
|
||||
(toString cfg.gamescope.settings.resolution.width)
|
||||
"-h"
|
||||
(toString cfg.gamescope.settings.resolution.height)
|
||||
]
|
||||
++ lib.optional (cfg.gamescope.settings.refreshRate != null) [
|
||||
"-r"
|
||||
(toString cfg.gamescope.settings.refreshRate)
|
||||
];
|
||||
};
|
||||
# Apply custom resolution if specified
|
||||
args =
|
||||
lib.optional (cfg.gamescope.settings.resolution != null) [
|
||||
"-w"
|
||||
(toString cfg.gamescope.settings.resolution.width)
|
||||
"-h"
|
||||
(toString cfg.gamescope.settings.resolution.height)
|
||||
]
|
||||
++ lib.optional (cfg.gamescope.settings.refreshRate != null) [
|
||||
"-r"
|
||||
(toString cfg.gamescope.settings.refreshRate)
|
||||
];
|
||||
};
|
||||
|
||||
programs.anime-game-launcher = lib.mkIf agl.anime-game-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
environment.systemPackages =
|
||||
(lib.optionals cfg.lutris.enable (
|
||||
[cfg.lutris.package] ++
|
||||
(lib.optionals cfg.lutris.wine.enable [
|
||||
cfg.lutris.wine.package
|
||||
pkgs.winetricks
|
||||
]) ++
|
||||
(lib.optionals cfg.lutris.compatibility.protonSupport [
|
||||
pkgs.protonup-ng
|
||||
pkgs.protonup-qt
|
||||
]) ++
|
||||
cfg.lutris.compatibility.extraTools ++
|
||||
cfg.lutris.extraPackages
|
||||
)) ++
|
||||
(lib.optionals cfg.minecraft.enable [pkgs.prismlauncher]) ++
|
||||
(lib.optionals cfg.ffxiv.enable [pkgs.xivlauncher pkgs.fflogs]) ++
|
||||
(lib.optionals (cfg.vintage-story.enable && vintage-story != null) [vintage-story.packages.${pkgs.system}.default]) ++
|
||||
(lib.optionals cfg.vkbasalt.enable [pkgs.vkbasalt pkgs.vkbasalt-cli]) ++
|
||||
(lib.optionals cfg.mangohud.enable [pkgs.mangohud]) ++
|
||||
(lib.optionals (cfg.vkbasalt.enable || cfg.mangohud.enable) [pkgs.goverlay pkgs.mesa-demos pkgs.vulkan-tools]);
|
||||
}
|
||||
(lib.optionalAttrs hasAagl {
|
||||
programs.anime-game-launcher = lib.mkIf agl.anime-game-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.honkers-railway-launcher = lib.mkIf agl.honkers-railway-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
programs.honkers-railway-launcher = lib.mkIf agl.honkers-railway-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.honkers-launcher = lib.mkIf agl.honkers-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
programs.honkers-launcher = lib.mkIf agl.honkers-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.wavey-launcher = lib.mkIf agl.wavey-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
programs.wavey-launcher = lib.mkIf agl.wavey-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.sleepy-launcher = lib.mkIf agl.sleepy-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
programs.sleepy-launcher = lib.mkIf agl.sleepy-launcher.enable {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
(lib.optionals cfg.lutris.enable (
|
||||
[cfg.lutris.package] ++
|
||||
(lib.optionals cfg.lutris.wine.enable [
|
||||
cfg.lutris.wine.package
|
||||
pkgs.winetricks
|
||||
]) ++
|
||||
(lib.optionals cfg.lutris.compatibility.protonSupport [
|
||||
pkgs.protonup-ng
|
||||
pkgs.protonup-qt
|
||||
]) ++
|
||||
cfg.lutris.compatibility.extraTools ++
|
||||
cfg.lutris.extraPackages
|
||||
)) ++
|
||||
(lib.optionals cfg.minecraft.enable [pkgs.prismlauncher]) ++
|
||||
(lib.optionals cfg.ffxiv.enable [pkgs.xivlauncher pkgs.fflogs]) ++
|
||||
(lib.optionals cfg.vintage-story.enable [vintage-story.packages.${pkgs.system}.default]) ++
|
||||
(lib.optionals cfg.vkbasalt.enable [pkgs.vkbasalt pkgs.vkbasalt-cli]) ++
|
||||
(lib.optionals cfg.mangohud.enable [pkgs.mangohud]) ++
|
||||
(lib.optionals (cfg.vkbasalt.enable || cfg.mangohud.enable) [pkgs.goverlay pkgs.mesa-demos pkgs.vulkan-tools]);
|
||||
|
||||
nix.settings = let
|
||||
inherit agl;
|
||||
in (lib.mkIf
|
||||
(agl.anime-game-launcher.enable || agl.honkers-railway-laucher.enable || agl.honkers-launcher.enable || agl.wavey-launcher.enable || agl.sleepy-launcher.enable)
|
||||
{
|
||||
substituters = [ "https://ezkea.cachix.org" ];
|
||||
trusted-public-keys = [ "ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI=" ];
|
||||
}
|
||||
);
|
||||
};
|
||||
nix.settings = lib.mkIf
|
||||
(agl.anime-game-launcher.enable || agl.honkers-railway-launcher.enable || agl.honkers-launcher.enable || agl.wavey-launcher.enable || agl.sleepy-launcher.enable)
|
||||
{
|
||||
substituters = [ "https://ezkea.cachix.org" ];
|
||||
trusted-public-keys = [ "ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI=" ];
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ in {
|
||||
(import ../../apps/flatpak.nix {
|
||||
inherit lib pkgs flatpakPackages userName aagl;
|
||||
})
|
||||
aagl.nixosModules.default
|
||||
../../apps/gaming.nix
|
||||
../../apps/appimage.nix
|
||||
../../graphics
|
||||
|
||||
83
modules/machine/thancred/configuration.nix
Normal file
83
modules/machine/thancred/configuration.nix
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
pkgs,
|
||||
userName,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../../apps/gaming.nix
|
||||
../../pwrMgmt
|
||||
../../networking/core.nix
|
||||
../../virtualization/podman.nix
|
||||
];
|
||||
|
||||
# Enable flakes for NixOS
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
# Custom kernel/boot stuff
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Set your timezone
|
||||
time.timeZone = "America/Detroit";
|
||||
|
||||
# Enable OpenSSH
|
||||
services.openssh.enable = true;
|
||||
|
||||
# Enable keyring
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
# Enable GnuPG
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
# Enable SUID wrappers (some programs need them)
|
||||
programs.mtr.enable = true;
|
||||
|
||||
# Enable Polkit
|
||||
security.polkit.enable = true;
|
||||
|
||||
# Power management (see ../../pwrMgmt/default.nix)
|
||||
pwrMgmt = {
|
||||
enable = true;
|
||||
cpuFreqGovernor = "performance";
|
||||
powertop.enable = false;
|
||||
};
|
||||
|
||||
gaming = {
|
||||
vintage-story.enable = true;
|
||||
};
|
||||
|
||||
network = {
|
||||
firewall = {
|
||||
enable = true;
|
||||
tcpPorts = {
|
||||
allowedPorts = [ 42420 ];
|
||||
};
|
||||
udpPorts = {
|
||||
allowedPorts = [ 42420 ];
|
||||
};
|
||||
};
|
||||
networkManager.enable = true;
|
||||
};
|
||||
|
||||
# Podman module (see ../../virtualization/podman.nix)
|
||||
# podman = {
|
||||
# enable = true;
|
||||
# extraPackages = with pkgs; [
|
||||
# docker-credential-helpers
|
||||
# toolbox
|
||||
# cosign
|
||||
# crane
|
||||
# podman-tui
|
||||
# podman-desktop
|
||||
# ];
|
||||
# };
|
||||
|
||||
# Add username to groups "wheel" and "video" - more may be added here later
|
||||
users.users.${userName}.extraGroups = ["wheel" "podman" "network"];
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
}
|
||||
6
modules/machine/thancred/default.nix
Normal file
6
modules/machine/thancred/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./configuration.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
}
|
||||
32
modules/machine/thancred/hardware-configuration.nix
Normal file
32
modules/machine/thancred/hardware-configuration.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/0a885c0e-cf31-43b7-9a91-6f9624758102";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/C7B5-89D4";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/860c75ce-3afe-47cf-90d8-7612ab543a1e"; }
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
Reference in New Issue
Block a user