more moving

This commit is contained in:
mjallen18
2024-02-29 14:17:34 -06:00
parent 347d30094b
commit ab42ace3b6
11 changed files with 128 additions and 82 deletions

8
flake.lock generated
View File

@@ -205,16 +205,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1709145408, "lastModified": 1709150264,
"narHash": "sha256-sS7DOx3nvFUm2p9wFvPGX1pgetLOPg0R1lXMdRQhVnw=", "narHash": "sha256-HofykKuisObPUfj0E9CJVfaMhawXkYx3G8UIFR/XQ38=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d4164730d41de41525032cacb2d3139906cb1c03", "rev": "9099616b93301d5cf84274b184a3a5ec69e94e08",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "master", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@@ -3,11 +3,9 @@
inputs = { inputs = {
# Common # Common
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/master";
# Desktop # Desktop
# kde.url = "github:nix-community/kde2nix";
nix-flatpak.url = "github:gmodena/nix-flatpak"; nix-flatpak.url = "github:gmodena/nix-flatpak";
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
@@ -30,7 +28,6 @@
modules = [ modules = [
impermanence.nixosModules.impermanence impermanence.nixosModules.impermanence
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
# kde.nixosModules.plasma6
nix-flatpak.nixosModules.nix-flatpak nix-flatpak.nixosModules.nix-flatpak
./hosts/desktop/configuration.nix ./hosts/desktop/configuration.nix
./share/impermanence ./share/impermanence

View File

@@ -4,7 +4,16 @@ in {
imports = [ ../modules ../share ]; imports = [ ../modules ../share ];
# Enable nix flakes and nix-command tools # Enable nix flakes and nix-command tools
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix = {
settings.experimental-features = [ "nix-command" "flakes" ];
# Garbage collect automatically every week
gc.automatic = true;
};
# Configure nixpkgs
# Enable non free
nixpkgs.config.allowUnfree = true;
# Hardware configs # Hardware configs
hardware = { hardware = {
@@ -54,4 +63,8 @@ in {
magicOrExtension = "\\x7fELF....AI\\x02"; magicOrExtension = "\\x7fELF....AI\\x02";
}; };
}; };
programs = {
fish.enable = true;
};
} }

View File

@@ -8,15 +8,6 @@ let
password = password =
"$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06"; "$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06";
hostname = "matt-nixos"; hostname = "matt-nixos";
# discover-wrapper is needed as of 1/24/24 since PackageKit does not work correctly so this removes error messages.
discover-wrapped = pkgs.symlinkJoin {
name = "discover-flatpak-backend";
paths = [ pkgs.libsForQt5.discover ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/plasma-discover --add-flags "--backends flatpak"
'';
};
in { in {
imports = [ # Include the results of the hardware scan. imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@@ -30,6 +21,10 @@ in {
corectrl.enablePolkit = true; corectrl.enablePolkit = true;
}; };
share.gaming.enable = true;
apps.discover-wrapped.enable = true;
# Configure bootloader with lanzaboot and secureboot # Configure bootloader with lanzaboot and secureboot
boot = { boot = {
loader = { loader = {
@@ -61,22 +56,6 @@ in {
consoleLogLevel = 3; consoleLogLevel = 3;
bootspec.enable = true; bootspec.enable = true;
# Network option required using sysctl to let Ubisoft Connect work as of 7-12-2023
kernel.sysctl."net.ipv4.tcp_mtu_probing" = 1;
};
# Hardware configs
hardware = {
# Xbox controllers
xpadneo.enable = true;
# Steam udev rules for remote play
steam-hardware.enable = true;
# opengl.enable = true;
# # Enables support for 32bit libs that steam uses
# opengl.driSupport32Bit = true;
}; };
# Services configs # Services configs
@@ -191,7 +170,6 @@ in {
efibootmgr efibootmgr
sbctl sbctl
gparted gparted
discover-wrapped
pciutils pciutils
papirus-icon-theme papirus-icon-theme
vulkan-tools vulkan-tools
@@ -204,51 +182,25 @@ in {
]; ];
}; };
# Configure programs
programs = {
fish.enable = true;
java.enable = true;
# Steam
steam = {
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
};
};
# Configure nixpkgs # Configure nixpkgs
nixpkgs = { nixpkgs.config.permittedInsecurePackages = [
config = { # allow insecure electron for etcher
# Enable non free "electron-19.1.9"
allowUnfree = true; ];
permittedInsecurePackages = [ # # Configure nixpkgs
# allow insecure electron for etcher # nixpkgs = {
"electron-19.1.9" # config = {
]; # # Enable non free
# allowUnfree = true;
packageOverrides = pkgs: { # permittedInsecurePackages = [
steam = pkgs.steam.override { # # allow insecure electron for etcher
extraPkgs = pkgs: # "electron-19.1.9"
with pkgs; [ # ];
xorg.libXcursor # };
xorg.libXi # };
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
};
};
};
};
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users."${user}" = { users.users."${user}" = {

View File

@@ -15,8 +15,11 @@ in {
home.stateVersion = "23.11"; home.stateVersion = "23.11";
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.fish.enable = true; programs = {
programs.mangohud.enable = true; fish.enable = true;
mangohud.enable = true;
java.enable = true;
};
programs.git = { programs.git = {
enable = true; enable = true;
@@ -57,7 +60,4 @@ in {
# Other packages # Other packages
vulkan-hdr-layer vulkan-hdr-layer
]; ];
# Garbage collect automatically every week
nix.gc.automatic = true;
} }

View File

@@ -0,0 +1,23 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.apps.discover-wrapped;
# discover-wrapper is needed as of 1/24/24 since PackageKit does not work correctly so this removes error messages.
discover-wrapped = pkgs.symlinkJoin {
name = "discover-flatpak-backend";
paths = [ pkgs.libsForQt5.discover ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/plasma-discover --add-flags "--backends flatpak"
'';
};
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
# Configure environment
environment.systemPackages = [ discover-wrapped ];
};
}

View File

@@ -0,0 +1,6 @@
{ lib, ... }:
with lib; {
options.apps.discover-wrapped = {
enable = mkEnableOption "enable discover with flatpak";
};
}

View File

@@ -3,6 +3,7 @@
./samba ./samba
./apps/collabora ./apps/collabora
# ./apps/dashy # ./apps/dashy
./apps/discover-wrapped
./apps/jellyfin ./apps/jellyfin
./apps/jellyseerr ./apps/jellyseerr
./apps/mariadb ./apps/mariadb

View File

@@ -1 +1 @@
{ ... }: { imports = [ ./amd ./nvidia ]; } { ... }: { imports = [ ./amd ./nvidia ./gaming ]; }

48
share/gaming/default.nix Normal file
View File

@@ -0,0 +1,48 @@
{ lib, pkgs, config, ... }:
with lib;
let cfg = config.share.gaming;
in {
imports = [ ./options.nix ];
config = mkIf cfg.enable {
# Network option required using sysctl to let Ubisoft Connect work as of 7-12-2023
boot.kernel.sysctl."net.ipv4.tcp_mtu_probing" = 1;
# Configure programs
programs.steam = {
enable = true;
# Open ports in the firewall for Steam Remote Play
remotePlay.openFirewall = true;
# Open ports in the firewall for Source Dedicated Server
dedicatedServer.openFirewall = true;
};
# Hardware configs
hardware = {
# Xbox controllers
xpadneo.enable = true;
# Steam udev rules for remote play
steam-hardware.enable = true;
};
# Configure nixpkgs
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs:
with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
};
};
};
}

6
share/gaming/options.nix Normal file
View File

@@ -0,0 +1,6 @@
{ lib, ... }:
with lib; {
options.share.gaming = {
enable = mkEnableOption "enable gaming stuffs";
};
}