modifications to steamdeck hardware, allow for hp printing and switched up v4lloopback module. included cachix in again, along with devenv support
This commit is contained in:
parent
d475f895a0
commit
82a02d7257
18
hosts/common.nix
Normal file
18
hosts/common.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
# Enable CUPS printing service
|
||||||
|
services.printing.enable = true;
|
||||||
|
|
||||||
|
# Enable network printer discovery
|
||||||
|
services.avahi = {
|
||||||
|
enable = true;
|
||||||
|
nssmdns4 = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Install HP printer drivers
|
||||||
|
services.printing.drivers = [
|
||||||
|
pkgs.hplip
|
||||||
|
pkgs.hplipWithPlugin # For printers requiring proprietary plugins
|
||||||
|
];
|
||||||
|
}
|
13
hosts/steamdeck/cachix.nix
Normal file
13
hosts/steamdeck/cachix.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# WARN: this file will get overwritten by $ cachix use <name>
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
folder = ./cachix;
|
||||||
|
toImport = name: value: folder + ("/" + name);
|
||||||
|
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
||||||
|
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit imports;
|
||||||
|
nix.settings.substituters = [ "https://cache.nixos.org/" ];
|
||||||
|
}
|
13
hosts/steamdeck/cachix/devenv.nix
Normal file
13
hosts/steamdeck/cachix/devenv.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
settings = {
|
||||||
|
substituters = [
|
||||||
|
"https://devenv.cachix.org"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
jovianNixosRev = "f6423d86bec22c25a576b23262495c5536b0d069";
|
jovianNixosRev = "f6423d86bec22c25a576b23262495c5536b0d069";
|
||||||
@ -18,29 +18,23 @@ in
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
(fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master")
|
||||||
(jovianNixos + "/modules")
|
(jovianNixos + "/modules")
|
||||||
|
./cachix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Basic System Configuration
|
# Basic System Configuration
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
networking = {
|
|
||||||
hostName = "steamnix";
|
# Printing Configuration
|
||||||
networkmanager.enable = true;
|
services.printing = {
|
||||||
|
enable = true;
|
||||||
|
drivers = [ pkgs.hplipWithPlugin ];
|
||||||
};
|
};
|
||||||
time.timeZone = "America/Los_Angeles";
|
|
||||||
i18n = {
|
services.avahi = {
|
||||||
defaultLocale = "en_US.UTF-8";
|
enable = true;
|
||||||
extraLocaleSettings = {
|
nssmdns = true;
|
||||||
LC_ADDRESS = "en_US.UTF-8";
|
|
||||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
|
||||||
LC_MEASUREMENT = "en_US.UTF-8";
|
|
||||||
LC_MONETARY = "en_US.UTF-8";
|
|
||||||
LC_NAME = "en_US.UTF-8";
|
|
||||||
LC_NUMERIC = "en_US.UTF-8";
|
|
||||||
LC_PAPER = "en_US.UTF-8";
|
|
||||||
LC_TELEPHONE = "en_US.UTF-8";
|
|
||||||
LC_TIME = "en_US.UTF-8";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Nix Package Manager Configuration
|
# Nix Package Manager Configuration
|
||||||
@ -53,12 +47,18 @@ in
|
|||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
substituters = [ "cache.nixos.org" ];
|
substituters = [ "https://cache.nixos.org" ];
|
||||||
allowed-users = [ "@wheel" "jeirmeister" ];
|
allowed-users = [ "@wheel" "jeirmeister" ];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Steam Deck Specific Configuration
|
nix.extraOptions = ''
|
||||||
|
trusted-users = root jeirmeister
|
||||||
|
extra-substituters = https://nixpkgs-python.cachix.org https://devenv.cachix.org
|
||||||
|
extra-trusted-public-keys = nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU= devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Steam Deck Configuration
|
||||||
jovian = {
|
jovian = {
|
||||||
hardware.has.amd.gpu = true;
|
hardware.has.amd.gpu = true;
|
||||||
devices.steamdeck = {
|
devices.steamdeck = {
|
||||||
@ -77,11 +77,6 @@ in
|
|||||||
workarounds.ignoreMissingKernelModules = true;
|
workarounds.ignoreMissingKernelModules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Hardware and Display Configuration
|
|
||||||
hardware.video = {
|
|
||||||
displaylink.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Desktop Environment and Display Configuration
|
# Desktop Environment and Display Configuration
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -89,14 +84,15 @@ in
|
|||||||
videoDrivers = [ "displaylink" "modesetting" ];
|
videoDrivers = [ "displaylink" "modesetting" ];
|
||||||
desktopManager.plasma6 = {
|
desktopManager.plasma6 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraSessionCommands = ''
|
|
||||||
${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0;
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
displayManager = {
|
displayManager = {
|
||||||
sddm = {
|
sddm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wayland = true;
|
settings = {
|
||||||
|
Wayland = {
|
||||||
|
EnableHiDPI = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
sessionCommands = ''
|
sessionCommands = ''
|
||||||
${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0
|
${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0
|
||||||
@ -104,6 +100,17 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# VS Code Server Configuration
|
||||||
|
services.vscode-server = {
|
||||||
|
enable = true;
|
||||||
|
enableFHS = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.nix-ld = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.nix-ld-rs;
|
||||||
|
};
|
||||||
|
|
||||||
# System Services Configuration
|
# System Services Configuration
|
||||||
services = {
|
services = {
|
||||||
# Audio Configuration
|
# Audio Configuration
|
||||||
@ -139,6 +146,21 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Uncomment when ready to use Immersed
|
||||||
|
# immersed-video = {
|
||||||
|
# description = "Load v4l2loopback module for Immersed";
|
||||||
|
# wantedBy = [ "multi-user.target" ];
|
||||||
|
# after = [ "systemd-modules-load.service" ];
|
||||||
|
# requires = [ "systemd-modules-load.service" ];
|
||||||
|
# serviceConfig = {
|
||||||
|
# Type = "oneshot";
|
||||||
|
# RemainAfterExit = true;
|
||||||
|
# ExecStartPre = "${pkgs.kmod}/bin/modprobe -r v4l2loopback || true";
|
||||||
|
# ExecStart = "${pkgs.kmod}/bin/modprobe v4l2loopback exclusive_caps=1 video_nr=0 card_label='Immersed Virtual Camera'";
|
||||||
|
# ExecStop = "${pkgs.kmod}/bin/rmmod v4l2loopback || true";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
"systemd-modules-load" = {
|
"systemd-modules-load" = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
restartIfChanged = true;
|
restartIfChanged = true;
|
||||||
@ -147,10 +169,17 @@ in
|
|||||||
|
|
||||||
# UDev Rules
|
# UDev Rules
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
|
# Steam Deck Fan Control
|
||||||
SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/pwm1"
|
SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/pwm1"
|
||||||
SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/fan1_input"
|
SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/fan1_input"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Network Configuration
|
||||||
|
networking = {
|
||||||
|
hostName = "steamnix";
|
||||||
|
networkmanager.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# User Configuration
|
# User Configuration
|
||||||
users = {
|
users = {
|
||||||
users.jeirmeister = {
|
users.jeirmeister = {
|
||||||
@ -174,8 +203,8 @@ in
|
|||||||
|
|
||||||
groups = {
|
groups = {
|
||||||
steamos.gid = 1000;
|
steamos.gid = 1000;
|
||||||
gamepad = {};
|
gamepad = { };
|
||||||
render = {};
|
render = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -192,6 +221,9 @@ in
|
|||||||
dmidecode
|
dmidecode
|
||||||
binutils
|
binutils
|
||||||
|
|
||||||
|
# Scanner & Printers
|
||||||
|
epsonscan2
|
||||||
|
|
||||||
# Virtual Display
|
# Virtual Display
|
||||||
linuxPackages.v4l2loopback
|
linuxPackages.v4l2loopback
|
||||||
v4l-utils
|
v4l-utils
|
||||||
@ -207,19 +239,21 @@ in
|
|||||||
# Utilities
|
# Utilities
|
||||||
tree
|
tree
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Locale and Time
|
||||||
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
i18n = {
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "en_US.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||||
|
LC_MEASUREMENT = "en_US.UTF-8";
|
||||||
|
LC_MONETARY = "en_US.UTF-8";
|
||||||
|
LC_NAME = "en_US.UTF-8";
|
||||||
|
LC_NUMERIC = "en_US.UTF-8";
|
||||||
|
LC_PAPER = "en_US.UTF-8";
|
||||||
|
LC_TELEPHONE = "en_US.UTF-8";
|
||||||
|
LC_TIME = "en_US.UTF-8";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
# TODO: Incorporate this part later
|
|
||||||
# Immersed Video Service
|
|
||||||
# immersed-video = {
|
|
||||||
# description = "Load v4l2loopback module for Immersed";
|
|
||||||
# wantedBy = [ "multi-user.target" ];
|
|
||||||
# after = [ "systemd-modules-load.service" ];
|
|
||||||
# requires = [ "systemd-modules-load.service" ];
|
|
||||||
# serviceConfig = {
|
|
||||||
# Type = "oneshot";
|
|
||||||
# RemainAfterExit = true;
|
|
||||||
# ExecStartPre = "${pkgs.kmod}/bin/modprobe -r v4l2loopback || true";
|
|
||||||
# ExecStart = "${pkgs.kmod}/bin/modprobe v4l2loopback exclusive_caps=1 video_nr=0 card_label='Immersed Virtual Camera'";
|
|
||||||
# ExecStop = "${pkgs.kmod}/bin/rmmod v4l2loopback || true";
|
|
||||||
# };
|
|
||||||
# };
|
|
@ -1,39 +1,84 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by 'nixos-generate-config'
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
[
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
|
# Hardware Configuration
|
||||||
boot.initrd.kernelModules = [ ];
|
hardware = {
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
enableRedistributableFirmware = lib.mkForce true;
|
||||||
boot.extraModulePackages = [ ];
|
firmware = lib.mkForce [ pkgs.linux-firmware ];
|
||||||
|
|
||||||
fileSystems."/" =
|
graphics = {
|
||||||
{ device = "/dev/disk/by-uuid/f3cc4aae-428e-435d-b9f7-333f7dad06b2";
|
enable = true;
|
||||||
fsType = "ext4";
|
enable32Bit = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
libva
|
||||||
|
vaapiVdpau
|
||||||
|
v4l-utils
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
{ device = "/dev/disk/by-uuid/580E-5E90";
|
};
|
||||||
fsType = "vfat";
|
|
||||||
options = [ "fmask=0077" "dmask=0077" ];
|
# Boot Configuration
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
initrd = {
|
||||||
|
availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
|
kernelModules = [ "amdgpu" "kvm-amd" ];
|
||||||
|
};
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
kernelModules = [ "amdgpu" "v4l2loopback" "snd-aloop" "kvm-amd" ];
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
extraModulePackages = [ pkgs.linuxPackages_latest.v4l2loopback ];
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
};
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
||||||
|
# Filesystem Configuration
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/f3cc4aae-428e-435d-b9f7-333f7dad06b2";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/580E-5E90";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Optional SteamOS games mount (commented out)
|
||||||
|
# fileSystems."/mnt/steamos" = {
|
||||||
|
# device = "/dev/disk/by-uuid/5261b393-9b3e-4334-9ddf-4a1eb9865905";
|
||||||
|
# fsType = "ext4";
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Swap Configuration
|
||||||
|
swapDevices = [ ]; #TODO: consider releasing the zram swapfile and utilizing the one already on steamos
|
||||||
|
|
||||||
|
# Network Configuration
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.enp4s0f3u1u4u3.useDHCP = lib.mkDefault true;
|
# networking.interfaces.enp4s0f3u1u4u4.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
|
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
# Platform Configuration
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
|
# System State Version
|
||||||
|
system.stateVersion = "24.05";
|
||||||
}
|
}
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
# Required for AppImage support
|
|
||||||
appimage-run
|
|
||||||
|
|
||||||
# Optional but useful tools for AppImage management
|
|
||||||
zlib
|
|
||||||
fuse
|
|
||||||
fuse3
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,8 +1,16 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
home.packages = with pkgs; [
|
||||||
./appimage.nix
|
# Required for AppImage support
|
||||||
./tailscale.nix
|
appimage-run
|
||||||
|
|
||||||
|
# Optional but useful tools for AppImage management
|
||||||
|
zlib
|
||||||
|
fuse
|
||||||
|
fuse3
|
||||||
|
tailscale
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
tailscale
|
|
||||||
];
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user