From 37df1799abd27cd335632d94ec9bc256b6da5acc Mon Sep 17 00:00:00 2001 From: Viv Lim Date: Tue, 12 Mar 2024 23:20:41 -0700 Subject: [PATCH] add a pile of stuff --- configuration.nix | 67 +++++++++++++++++++++++++++++++++++++++-------- deck.nix | 35 +++++++++++++++++++++++++ disk-config.nix | 2 +- flake.lock | 6 ++--- flake.nix | 40 +++++++++++++++++++++------- 5 files changed, 125 insertions(+), 25 deletions(-) create mode 100644 deck.nix diff --git a/configuration.nix b/configuration.nix index 174133f..b8607b5 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,27 +2,71 @@ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ./disk-config.nix + ./deck.nix ]; - jovian.steam = { + # just kind of a grab bag of stuff + environment.systemPackages = with pkgs; [ + tailscale + rustup + (wrapOBS { + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + obs-livesplit-one + obs-multi-rtmp + obs-vaapi + obs-gstreamer + input-overlay + obs-3d-effect + obs-composite-blur + obs-gradient-source + waveform + ]; + }) + (retroarch.override { + cores = with libretro; [ + bsnes + bsnes-mercury-balanced + gambatte + genesis-plus-gx + gpsp + mgba + mupen64plus + parallel-n64 + sameboy + snes9x + tgbdual + vba-next + ]; + }) + ]; + + boot.supportedFilesystems = [ "ntfs" ]; # i would like to be able towrite to ntfs please + + services.tailscale = { enable = true; - autoStart = true; - - desktopSession = "plasmawayland"; - - user = "vivlim"; - + useRoutingFeatures = "client"; + extraUpFlags = [ + ]; }; - jovian.decky-loader = { - enable = true; + virtualisation = { + waydroid.enable = true; }; - jovian.devices.steamdeck = { + networking.firewall = { enable = true; - autoUpdate = false; # firmware / bios. not sure if i want it yet + interfaces = { + tailscale0 = { + allowedTCPPortRanges = []; # [{ from = 1000; to = 2000; }] + allowedUDPPortRanges = []; # [{ from = 1000; to = 2000; }] + }; + }; }; + boot.loader.grub = { # no need to set devices, disko will add all devices that have a EF02 partition to the list already # devices = [ ]; @@ -33,6 +77,7 @@ networking.networkmanager.enable = true; system.stateVersion = "23.11"; + # unfree as in unfreedom nixpkgs.config.allowUnfree = true; # these were set in base. diff --git a/deck.nix b/deck.nix new file mode 100644 index 0000000..f2f7c9b --- /dev/null +++ b/deck.nix @@ -0,0 +1,35 @@ +{ modulesPath, config, lib, pkgs, ... }: { + # Generic steam deck-specific configs that are reasonable for other people to refer to / use + jovian.steam = { + enable = true; + + # Boot straight into gamescope + autoStart = true; + + # We have to use this instead of services.xserver.displayManager.defaultSession + # https://jovian-experiments.github.io/Jovian-NixOS/options.html#jovian.steam.desktopSession + desktopSession = "plasmawayland"; + + user = "vivlim"; # it's me! + }; + + # Need to have this or we won't have steam available on the desktop (which is *very* funny) + programs.steam = { + enable = true; + }; + + jovian.decky-loader = { + enable = true; + }; + + jovian.devices.steamdeck = { + enable = true; # apply a bunch of deck-specific stuff + autoUpdate = false; # auto-update firmware / bios. the tools for doing the manually are added to systemPackages below + }; + + environment.systemPackages = with pkgs; [ + steamdeck-firmware # gives us `jupiter-biosupdate` and `jupiter-controller-update` https://jovian-experiments.github.io/Jovian-NixOS/devices/valve-steam-deck/index.html + jupiter-dock-updater-bin # `jupiter-dock-updater` + ]; +} + diff --git a/disk-config.nix b/disk-config.nix index 1824a08..2780ac4 100644 --- a/disk-config.nix +++ b/disk-config.nix @@ -48,7 +48,7 @@ type = "lvm_vg"; lvs = { root = { - size = "100%"; # expand later if needed + size = "100%FREE"; # expand later if needed content = { type = "filesystem"; format = "ext4"; diff --git a/flake.lock b/flake.lock index 901d8e4..169e2c6 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "unstable": "unstable" }, "locked": { - "lastModified": 1710228223, - "narHash": "sha256-nqie8+sN9dh00wdA3WpU3CblWDlV1jQDk8dhDWLkJU8=", + "lastModified": 1710310808, + "narHash": "sha256-EmrJeUgqvrMCKaBVzRR1Zdj8iNEM1F53bn2xvjZmO50=", "owner": "vivlim", "repo": "nix-base", - "rev": "3b19c4b48f785437c7d082e90f1af06617cb5047", + "rev": "dd9b5e20885497a31a950baacce02b3c0f091756", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 35e0b00..b4c3f98 100644 --- a/flake.nix +++ b/flake.nix @@ -31,26 +31,46 @@ ({ config, pkgs, ... }: { nixpkgs.overlays = [ jovian.overlays.default ]; }); machineFactory = base.machineFactory; colmenaTargetFactory = base.colmenaTargetFactory; - in { - # nix build .#nixosConfigurations.vivdeck.config.system.build.toplevel - nixosConfigurations = with base; { - vivdeck = (machineFactory { + + # Using a wrapper I have in `base` that unpacks 'moduleBundles' defined there. + machineFactoryArgs = { system = "x86_64-linux"; hostname = "vivdeck"; inherit inputs; modules = [ disko.nixosModules.disko ./configuration.nix - moduleBundles.system-base - moduleBundles.plasma-desktop - moduleBundles.system-physical - moduleBundles.gaming-hardware - moduleBundles.amd + base.moduleBundles.system-base + base.moduleBundles.plasma-desktop + base.moduleBundles.system-physical + base.moduleBundles.gaming-hardware + base.moduleBundles.amd sops-nix.nixosModules.sops jovian.nixosModules.jovian overlayModule ]; - }); + }; + + in { + # nix build .#nixosConfigurations.vivdeck.config.system.build.toplevel + nixosConfigurations = { + vivdeck = (base.machineFactory machineFactoryArgs); + }; + + colmena = { + meta = { + nixpkgs = import nixpkgs { + system = "x86_64-linux"; + }; + specialArgs = { + inherit inputs; + }; + }; + vivdeck = (base.colmenaTargetFactory machineFactoryArgs) + // { + deployment.targetHost = "192.168.1.167"; # todo: change to tailscale hostname after it's added. + deployment.targetUser = "root"; + }; }; devShells = base.devShells;