add deck base config
This commit is contained in:
parent
9fd8cc2e0d
commit
9102264fcc
5 changed files with 254 additions and 1 deletions
20
flake.nix
20
flake.nix
|
|
@ -14,9 +14,11 @@
|
|||
};
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
jovian-nixos.url = "github:Jovian-Experiments/Jovian-NixOS";
|
||||
jovian-nixos.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, home-manager, nixvim, claude-code, firefox-addons, disko }:
|
||||
outputs = inputs@{ self, nixpkgs, home-manager, nixvim, claude-code, firefox-addons, disko, jovian-nixos }:
|
||||
{
|
||||
nixosConfigurations."hs" = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
|
@ -45,6 +47,16 @@
|
|||
];
|
||||
};
|
||||
|
||||
nixosConfigurations."deck" = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
jovian-nixos.nixosModules.jovian
|
||||
./hosts/nixos/deck/system.nix
|
||||
./hosts/nixos/deck/disk-config.nix
|
||||
];
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"yanlin@hs" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
|
|
@ -63,6 +75,12 @@
|
|||
modules = [ ./hosts/nixos/thinkpad/home.nix ];
|
||||
extraSpecialArgs = { inherit claude-code nixvim firefox-addons; };
|
||||
};
|
||||
|
||||
"yanlin@deck" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
modules = [ ./hosts/nixos/deck/home.nix ];
|
||||
extraSpecialArgs = { inherit claude-code nixvim firefox-addons; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
47
hosts/nixos/deck/disk-config.nix
Normal file
47
hosts/nixos/deck/disk-config.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Disko configuration for Steam Deck
|
||||
# Following the partitioning scheme from https://heywoodlh.io/nixos-steamdeck
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
# EFI System Partition
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Swap partition
|
||||
swap = {
|
||||
size = "8G";
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Root partition - takes remaining space
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
43
hosts/nixos/deck/hardware-configuration.nix
Normal file
43
hosts/nixos/deck/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# Placeholder hardware configuration for Steam Deck
|
||||
#
|
||||
# This file must be generated on the actual Steam Deck hardware.
|
||||
#
|
||||
# To generate this file:
|
||||
# 1. Boot into the Jovian-NixOS installer ISO on the Steam Deck
|
||||
# 2. Run: nixos-generate-config --root /mnt --show-hardware-config > hardware-configuration.nix
|
||||
# 3. Copy the generated file to this location
|
||||
#
|
||||
# The generated file will include:
|
||||
# - CPU and GPU detection
|
||||
# - Storage device configuration
|
||||
# - Kernel modules for Steam Deck hardware
|
||||
# - File system configuration
|
||||
#
|
||||
# DO NOT attempt to use this placeholder for installation.
|
||||
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
# Placeholder - will be replaced by actual hardware detection
|
||||
boot.initrd.availableKernelModules = [ ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# Placeholder filesystem configuration
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
12
hosts/nixos/deck/home.nix
Normal file
12
hosts/nixos/deck/home.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Allow unfree packages in home-manager
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Import the common NixOS home configuration
|
||||
imports = [
|
||||
../home-default.nix
|
||||
../../../modules/gnome.nix
|
||||
];
|
||||
}
|
||||
133
hosts/nixos/deck/system.nix
Normal file
133
hosts/nixos/deck/system.nix
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../system-default.nix # Common NixOS system configuration
|
||||
];
|
||||
|
||||
# Bootloader - standard UEFI setup
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.configurationLimit = 10;
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 3;
|
||||
};
|
||||
|
||||
# Use latest kernel for better hardware support
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# Network configuration
|
||||
networking = {
|
||||
hostName = "deck";
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
wifi.powersave = true;
|
||||
};
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
# Hardware support for Steam Deck (AMD APU)
|
||||
hardware = {
|
||||
enableRedistributableFirmware = true;
|
||||
|
||||
# Graphics configuration for AMD
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
# Bluetooth support
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Sound configuration with PipeWire
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# Jovian Steam Deck configuration
|
||||
jovian = {
|
||||
steam = {
|
||||
enable = true;
|
||||
autoStart = true;
|
||||
desktopSession = "gnome";
|
||||
};
|
||||
decky-loader.enable = true;
|
||||
devices.steamdeck = {
|
||||
enable = true;
|
||||
autoUpdate = true;
|
||||
};
|
||||
};
|
||||
|
||||
# GNOME Desktop Environment
|
||||
services.xserver.enable = true;
|
||||
services.displayManager.gdm.enable = true;
|
||||
services.desktopManager.gnome.enable = true;
|
||||
|
||||
# Keyboard layout
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
options = "";
|
||||
};
|
||||
|
||||
# XDG portal for proper desktop integration
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-gnome
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
|
||||
# Touchscreen configuration
|
||||
services.libinput = {
|
||||
enable = true;
|
||||
touchpad = {
|
||||
naturalScrolling = true;
|
||||
tapping = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Host-specific SSH configuration
|
||||
services.openssh = {
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
};
|
||||
|
||||
# Host-specific user configuration
|
||||
users.users.yanlin = {
|
||||
extraGroups = [ "networkmanager" "wheel" "video" "audio" "input" ];
|
||||
hashedPassword = "$6$kSyaRzAtj8VPcNeX$NsEP6zQAfp6O8YWcolfPRKnhIcJlKu5luZgWqozJAHtbE/gv90KoOOKU7Dt.FnbPB0Ej26jXoBH4X.7y/OLGB1";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOzmzq6xXp7KkUfPsFo/4O7AYVCJ1U+GrbD0fB10izMF yanlin@thinkpad"
|
||||
];
|
||||
};
|
||||
|
||||
# Host-specific packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# System utilities
|
||||
pciutils
|
||||
usbutils
|
||||
unzip
|
||||
|
||||
# Icon themes for GNOME applications
|
||||
adwaita-icon-theme
|
||||
hicolor-icon-theme
|
||||
];
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue