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": {
"locked": {
"lastModified": 1709145408,
"narHash": "sha256-sS7DOx3nvFUm2p9wFvPGX1pgetLOPg0R1lXMdRQhVnw=",
"lastModified": 1709150264,
"narHash": "sha256-HofykKuisObPUfj0E9CJVfaMhawXkYx3G8UIFR/XQ38=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d4164730d41de41525032cacb2d3139906cb1c03",
"rev": "9099616b93301d5cf84274b184a3a5ec69e94e08",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}

View File

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

View File

@@ -4,7 +4,16 @@ in {
imports = [ ../modules ../share ];
# 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 = {
@@ -54,4 +63,8 @@ in {
magicOrExtension = "\\x7fELF....AI\\x02";
};
};
programs = {
fish.enable = true;
};
}

View File

@@ -8,15 +8,6 @@ let
password =
"$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06";
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 {
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
@@ -30,6 +21,10 @@ in {
corectrl.enablePolkit = true;
};
share.gaming.enable = true;
apps.discover-wrapped.enable = true;
# Configure bootloader with lanzaboot and secureboot
boot = {
loader = {
@@ -61,22 +56,6 @@ in {
consoleLogLevel = 3;
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
@@ -191,7 +170,6 @@ in {
efibootmgr
sbctl
gparted
discover-wrapped
pciutils
papirus-icon-theme
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
nixpkgs = {
config = {
# Enable non free
allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [
# allow insecure electron for etcher
"electron-19.1.9"
];
permittedInsecurePackages = [
# allow insecure electron for etcher
"electron-19.1.9"
];
# # Configure nixpkgs
# nixpkgs = {
# config = {
# # Enable non free
# allowUnfree = true;
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
];
};
};
};
};
# permittedInsecurePackages = [
# # allow insecure electron for etcher
# "electron-19.1.9"
# ];
# };
# };
# Define a user account. Don't forget to set a password with passwd.
users.users."${user}" = {

View File

@@ -15,8 +15,11 @@ in {
home.stateVersion = "23.11";
programs.home-manager.enable = true;
programs.fish.enable = true;
programs.mangohud.enable = true;
programs = {
fish.enable = true;
mangohud.enable = true;
java.enable = true;
};
programs.git = {
enable = true;
@@ -57,7 +60,4 @@ in {
# Other packages
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
./apps/collabora
# ./apps/dashy
./apps/discover-wrapped
./apps/jellyfin
./apps/jellyseerr
./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";
};
}