From 2ceaaeff76be5a95cd3050676b9e2807156b82d0 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 29 Jun 2024 03:45:06 -0400 Subject: [PATCH] feat(steamdeck): prepare config for eventual install --- devices/README.md | 19 ++++---- devices/bbsteamie/default.nix | 47 ++++++++++++++++++++ devices/bbsteamie/hardware-configuration.nix | 40 +++++++++++++++++ devices/bbsteamie/modules/desktop.nix | 38 ++++++++++++++++ flake.in.nix | 2 + 5 files changed, 137 insertions(+), 9 deletions(-) create mode 100644 devices/bbsteamie/default.nix create mode 100644 devices/bbsteamie/hardware-configuration.nix create mode 100644 devices/bbsteamie/modules/desktop.nix diff --git a/devices/README.md b/devices/README.md index 6dd48e7..2c4ce6b 100644 --- a/devices/README.md +++ b/devices/README.md @@ -4,15 +4,16 @@ This directory encompasses every device's main configuration file. ## List of my Devices -| Name | Description | -| ---------- | ------------------------------------------------------------------------------------------------------- | -| `android` | My [Nix-On-Droid](https://github.com/nix-community/nix-on-droid) configuration for my OnePlus 9 Pro | -| `binto` | My desktop PC with a multi-monitor setup and an NVIDIA (cringe) 3070 | -| `cluster` | Two Lenovo mini PCs that make use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster | -| `nos` | My custom built NAS | -| `oksys` | A very old Acer laptop that went from sailing the seas for years to becoming my web server and VPN host. It is now retired indefinitely. | -| `servivi` | A gaming PC in a previous life, it is now used to experiment and do heavier stuff | -| `wim` | My 2-1 Lenovo Laptop that I use for uni | +| Name | Description | +| ----------- | ------------------------------------------------------------------------------------------------------- | +| `android` | My [Nix-On-Droid](https://github.com/nix-community/nix-on-droid) configuration for my OnePlus 9 Pro | +| `bbsteamie` | My wife's SteamDeck that has a pink case | +| `binto` | My desktop PC with a multi-monitor setup and an NVIDIA (cringe) 3070 | +| `cluster` | Two Lenovo mini PCs that make use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster | +| `nos` | My custom built NAS | +| `oksys` | A very old Acer laptop that went from sailing the seas for years to becoming my web server and VPN host. It is now retired indefinitely. | +| `servivi` | A gaming PC in a previous life, it is now used as a build farm and hosts game servers | +| `wim` | My 2-1 Lenovo Laptop that I use for uni | ## Global Vars diff --git a/devices/bbsteamie/default.nix b/devices/bbsteamie/default.nix new file mode 100644 index 0000000..372078a --- /dev/null +++ b/devices/bbsteamie/default.nix @@ -0,0 +1,47 @@ +{ + config, + jovian, + ... +}: let + inherit (config.vars) mainUser hostName; +in { + imports = [ + jovian.nixosModules.default + + ./hardware-configuration.nix + + ./modules/desktop.nix + ]; + + vars = { + mainUser = "mariah"; + hostName = "bbsteamie"; + promptMainColor = "pink"; + }; + + users.users.${mainUser} = { + isNormalUser = true; + extraGroups = [ + "wheel" + "adm" + ]; + }; + + networking = { + inherit hostName; + networkmanager.enable = true; + }; + + home-manager.users.${mainUser} = { + imports = []; + + # No touchy + home.stateVersion = "24.11"; + }; + + # Set your time zone. + time.timeZone = "America/Montreal"; + + # No touchy + system.stateVersion = "24.11"; +} diff --git a/devices/bbsteamie/hardware-configuration.nix b/devices/bbsteamie/hardware-configuration.nix new file mode 100644 index 0000000..1129d10 --- /dev/null +++ b/devices/bbsteamie/hardware-configuration.nix @@ -0,0 +1,40 @@ +{modulesPath, ...}: { + nixpkgs.hostPlatform = "x86_64-linux"; + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; + + jovian = { + steamos.useSteamOSConfig = true; + + devices.steamdeck = { + enable = true; + enableGyroDsuService = true; + }; + hardware.has.amd.gpu = true; + }; + + boot.loader = { + efi.canTouchEfiVariables = true; + + systemd-boot = { + enable = true; + configurationLimit = 30; + }; + }; + + virtualisation.waydroid.enable = true; + + # TODO: add auto-generated stuff + + # Placeholder + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/6ae4d722-dacf-485a-8d29-b276f540dc91"; + fsType = "btrfs"; + }; + + "/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; + }; +} diff --git a/devices/bbsteamie/modules/desktop.nix b/devices/bbsteamie/modules/desktop.nix new file mode 100644 index 0000000..c3e1d52 --- /dev/null +++ b/devices/bbsteamie/modules/desktop.nix @@ -0,0 +1,38 @@ +{config, ...}: let + inherit (config.vars) mainUser; +in { + # Auto-login to plasma + services = { + desktopManager.plasma6.enable = true; + + displayManager = { + autoLogin = { + enable = true; + user = mainUser; + }; + + defaultSession = "plasmawayland"; + }; + }; + + programs = { + xwayland.enable = true; + kdeconnect.enable = true; + }; + + # Enable flatpak support + services.flatpak.enable = true; + services.packagekit.enable = true; + + jovian.steam = { + enable = true; + user = mainUser; + + desktopSession = config.services.displayManager.defaultSession; + }; + + jovian.decky-loader = { + enable = true; + user = mainUser; + }; +} diff --git a/flake.in.nix b/flake.in.nix index e9c2bbb..7d0a469 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -68,6 +68,8 @@ ]; binto = mkNixOS [./devices/binto]; + bbsteamie = mkNixOS [./devices/bbsteamie]; + # NAS nos = mkNixOS [ ./devices/nos