From a8b23e0189c6f7bf7100aafe3a2d24bb69efe924 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 31 Mar 2024 08:40:08 +0000 Subject: [PATCH 01/27] scarab init --- flake.nix | 11 +++++++ hosts/scarab/default.nix | 64 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 hosts/scarab/default.nix diff --git a/flake.nix b/flake.nix index d0b592b..82621cd 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,17 @@ } ]; }; + scarab = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = [ + { _module.args = { inherit inputs; }; } + (import "${inputs.mobile-nixos}/lib/configuration.nix" { + device = "oneplus-enchilada"; + }) + ./packages/default.nix + ./hosts/scarab/default.nix + ]; + }; lappy = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix new file mode 100644 index 0000000..f63b472 --- /dev/null +++ b/hosts/scarab/default.nix @@ -0,0 +1,64 @@ +{ config, lib, pkgs, ... }: +let + + defaultUserName = "nixos"; + +in +{ + imports = [ ../default.nix ]; + + users.users."${defaultUserName}" = { + isNormalUser = true; + password = "1234"; + extraGroups = [ + "dialout" + "feedbackd" + "networkmanager" + "video" + "wheel" + ]; + }; + + mobile = { + beautification = { + silentBoot = lib.mkDefault true; + splash = lib.mkDefault true; + }; + boot.stage-1 = { + kernel.useStrictKernelConfig = true; + networking.enable = true; + }; + }; + + services.openssh.enable = true; + #services.pipewire = { + # enable = true; + # pulse.enable = true; + #}; + services.xserver.desktopManager.phosh = { + enable = true; + user = defaultUserName; + group = "users"; + }; + + #services.xserver.desktopManager.plasma5 = { + # enable = true; + # mobile.enable = true; + #}; + + programs.firefox.enable = true; + programs.calls.enable = true; + + hardware = { + bluetooth.enable = true; + sensor.iio.enable = true; + }; + + networking.networkmanager.unmanaged = [ "rndis0" "usb0" ]; + + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "oneplus-sdm845-firmware" + "oneplus-sdm845-firmware-xz" + ]; + system.stateVersion = "23.11"; +} From ed6489c55997f06669c38b7a505045a937d3d59a Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 31 Mar 2024 10:10:47 +0000 Subject: [PATCH 02/27] Update framework config --- config/hypr/hyprpaper.conf | 12 +++---- flake.lock | 17 +++++++++ flake.nix | 15 ++++---- hosts/default.nix | 17 ++++++++- hosts/lappy/default.nix | 70 ++++++++++++++++++-------------------- 5 files changed, 80 insertions(+), 51 deletions(-) diff --git a/config/hypr/hyprpaper.conf b/config/hypr/hyprpaper.conf index e07a445..c98267c 100644 --- a/config/hypr/hyprpaper.conf +++ b/config/hypr/hyprpaper.conf @@ -1,10 +1,10 @@ -preload = ~/.config/wallpapers/wallpaper.png +preload = ~/.config/wallpapers/current_wallpaper.png -wallpaper = eDP-1,~/.config/wallpapers/wallpaper.png -wallpaper = DP-1,~/.config/wallpapers/wallpaper.png -wallpaper = DP-2,~/.config/wallpapers/wallpaper.png -wallpaper = DP-3,~/.config/wallpapers/wallpaper.png -wallpaper = DP-4,~/.config/wallpapers/wallpaper.png +wallpaper = eDP-1,~/.config/wallpapers/current_wallpaper.png +wallpaper = DP-1,~/.config/wallpapers/current_wallpaper.png +wallpaper = DP-2,~/.config/wallpapers/current_wallpaper.png +wallpaper = DP-3,~/.config/wallpapers/current_wallpaper.png +wallpaper = DP-4,~/.config/wallpapers/current_wallpaper.png splash=false ipc = off diff --git a/flake.lock b/flake.lock index 5e2a4bb..111e20f 100644 --- a/flake.lock +++ b/flake.lock @@ -68,6 +68,22 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1711352745, + "narHash": "sha256-luvqik+i3HTvCbXQZgB6uggvEcxI9uae0nmrgtXJ17U=", + "owner": "Nixos", + "repo": "nixos-hardware", + "rev": "9a763a7acc4cfbb8603bb0231fec3eda864f81c0", + "type": "github" + }, + "original": { + "owner": "Nixos", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1710272261, @@ -123,6 +139,7 @@ "inputs": { "home-manager": "home-manager", "mobile-nixos": "mobile-nixos", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "osu-nixos": "osu-nixos" } diff --git a/flake.nix b/flake.nix index 82621cd..8235e59 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ outputs = inputs@{ nixpkgs, + nixos-hardware, home-manager, osu-nixos, ... @@ -43,6 +44,7 @@ system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ + nixos-hardware.nixosModules.framework-12th-gen-intel ./packages/default.nix ./hosts/lappy/default.nix @@ -79,17 +81,16 @@ }; inputs = { - mobile-nixos = { - url = "github:nixos/mobile-nixos"; - flake = false; - }; - nixpkgs = { - url = "github:NixOS/nixpkgs/nixos-unstable"; - }; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; + mobile-nixos = { + url = "github:nixos/mobile-nixos"; + flake = false; + }; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixos-hardware.url = "github:Nixos/nixos-hardware/master"; osu-nixos.url = "github:Asqiir/osu-nixos"; }; } diff --git a/hosts/default.nix b/hosts/default.nix index 62d4c4c..d738e3a 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -24,7 +24,22 @@ in security.sudo.wheelNeedsPassword = false; security.rtkit.enable = true; - services.xserver.displayManager.lightdm.enable = false; + services = { + resolved = { + enable = true; + dnsovertls = "opportunistic"; + fallbackDns = [ + "2620:fe::10#dns10.quad9.net" + "2620:fe::fe:10#dns10.quad9.net" + "9.9.9.10#dns10.quad9.net" + "149.112.112.10#dns10.quad9.net" + ]; + extraConfig = '' + DNS=2620:fe::10#dns10.quad9.net 2620:fe::fe:10#dns10.quad9.net 9.9.9.10#dns10.quad9.net 149.112.112.10#dns10.quad9.net + ''; + }; + xserver.displayManager.lightdm.enable = false; + }; # Wireguard stuff, to-do make better networking.firewall = { diff --git a/hosts/lappy/default.nix b/hosts/lappy/default.nix index e0bee12..00b4beb 100644 --- a/hosts/lappy/default.nix +++ b/hosts/lappy/default.nix @@ -12,23 +12,8 @@ artPkgs.enable = true; }; - system.nixos.tags = [ "Nya_Beginnings" ]; - services.logind.powerKey = "ignore"; services.logind.powerKeyLongPress = "poweroff"; - services.resolved = { - enable = true; - dnsovertls = "opportunistic"; - fallbackDns = [ - "2620:fe::10#dns10.quad9.net" - "2620:fe::fe:10#dns10.quad9.net" - "9.9.9.10#dns10.quad9.net" - "149.112.112.10#dns10.quad9.net" - ]; - extraConfig = '' - DNS=2620:fe::10#dns10.quad9.net 2620:fe::fe:10#dns10.quad9.net 9.9.9.10#dns10.quad9.net 149.112.112.10#dns10.quad9.net - ''; - }; networking = { hostName = "lappy"; networkmanager.enable = true; @@ -36,53 +21,64 @@ time.timeZone = "America/Lost_Angeles"; boot.kernelParams = [ - #"intel_pstate=no_hwp" - "kernel.yama.ptrace_scope=0" - #"mem_sleep_default=deep" - "acpi_osi=\"!Windows 2020\"" - "module_blacklist=hid_sensor_hub" + #"i915.enable_guc=7" "intel_iommu=on" "iommu=pt" - "nvme.noacpi=1" - #"i915.enable_guc=7" + "kernel.yama.ptrace_scope=0" ]; virtualisation.libvirtd.enable = true; hardware.bluetooth.enable = true; + hardware.bluetooth.settings.General.Experimental = true; hardware.opengl = { enable = true; driSupport = true; driSupport32Bit = true; - extraPackages = with pkgs; [ - intel-compute-runtime - intel-media-driver - ]; + extraPackages = lib.attrVals [ + "intel-compute-runtime" + "intel-media-driver" + ] pkgs; }; - systemd.extraConfig = - "AllowedCPUs=8-15" - ; + systemd.extraConfig = "AllowedCPUs=8-15"; services.tlp = { enable = true; settings = { - TLP_DEFAULT_MODE = "BAT"; - TLP_PERSISTENT_DEFAULT = 1; - - CPU_SCALING_GOVERNOR_ON_BAT = "schedutil"; CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - + CPU_HWP_DYN_BOOST_ON_BAT = false; + CPU_SCALING_GOVERNOR_ON_BAT = "schedutil"; CPU_MIN_PERF_ON_AC = 0; CPU_MAX_PERF_ON_AC = 100; CPU_MIN_PERF_ON_BAT = 0; CPU_MAX_PERF_ON_BAT = 50; - #Optional helps save long term battery health - START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge - STOP_CHARGE_THRESH_BAT0 = 90; # 80 and above it stops charging + INTEL_GPU_MAX_FREQ_ON_BAT = 800; + INTEL_GPU_BOOST_FREQ_ON_BAT = 1000; + NMI_WATCHDOG = false; + PCIE_ASPM_ON_AC = "default"; + PCIE_ASPM_ON_BAT = "powersupersave"; + PLATFORM_PROFILE_ON_BAT = "low-power"; + RUNTIME_PM_ON_BAT = true; + WOL_DISABLE = true; + SCHED_POWERSAVE_ON_BAT = true; + + USB_AUTOSUSPEND = true; + USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN = true; + USB_EXCLUDE_AUDIO = true; + USB_EXCLUDE_BTUSB = false; + USB_EXCLUDE_PHONE = false; + USB_EXCLUDE_PRINTER = true; + + TLP_DEFAULT_MODE = "BAT"; + TLP_PERSISTENT_DEFAULT = 1; + + #Optional helps save long term battery health + START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge + STOP_CHARGE_THRESH_BAT0 = 90; # 80 and above it stops charging }; }; From ba4ac7f1f4e46f6cce9deb4f31197a6e8a2297a9 Mon Sep 17 00:00:00 2001 From: stitchy Date: Mon, 1 Apr 2024 21:09:20 +0000 Subject: [PATCH 03/27] change this for better bat --- hosts/lappy/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hosts/lappy/default.nix b/hosts/lappy/default.nix index 00b4beb..123528c 100644 --- a/hosts/lappy/default.nix +++ b/hosts/lappy/default.nix @@ -20,6 +20,14 @@ }; time.timeZone = "America/Lost_Angeles"; + services.syncthing = { + enable = true; + user = "stitchynyan"; + openDefaultPorts = true; + databaseDir = "/home/stitchynyan/.local/share/syncthing"; + dataDir = "/home/stitchynyan"; + }; + boot.kernelParams = [ #"i915.enable_guc=7" "intel_iommu=on" @@ -67,11 +75,6 @@ SCHED_POWERSAVE_ON_BAT = true; USB_AUTOSUSPEND = true; - USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN = true; - USB_EXCLUDE_AUDIO = true; - USB_EXCLUDE_BTUSB = false; - USB_EXCLUDE_PHONE = false; - USB_EXCLUDE_PRINTER = true; TLP_DEFAULT_MODE = "BAT"; TLP_PERSISTENT_DEFAULT = 1; From a66a3015cd405084d162b82f522d8fa85a9c1551 Mon Sep 17 00:00:00 2001 From: stitchy Date: Mon, 1 Apr 2024 21:32:39 +0000 Subject: [PATCH 04/27] enable some config only on desktop systems --- users/stitchynyan/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/users/stitchynyan/default.nix b/users/stitchynyan/default.nix index b5a819c..a233760 100644 --- a/users/stitchynyan/default.nix +++ b/users/stitchynyan/default.nix @@ -15,29 +15,29 @@ programs = { firefox.enable = true; - hyprland.enable = true; - openvpn3.enable = true; + hyprland.enable = lib.mkIf( config.stitchyconf.form == "pc") true; + openvpn3.enable = lib.mkIf( config.stitchyconf.form == "pc") true; steam = { - enable = true; + enable = lib.mkIf( config.stitchyconf.form == "pc") true; remotePlay.openFirewall = true; }; }; services = { avahi = { - enable = true; + enable = false; nssmdns4 = true; openFirewall = true; }; blueman.enable = true; - gnome.gnome-keyring.enable = true; + gnome.gnome-keyring.enable = lib.mkIf( config.stitchyconf.form == "pc") true; pipewire = { enable = true; pulse.enable = true; alsa.enable = true; }; - printing.enable = true; - usbmuxd.enable = true; + printing.enable = false + usbmuxd.enable = false; xserver.enable = true; }; From 615dce3e41134291075dd44f9e02cd63deff8eed Mon Sep 17 00:00:00 2001 From: stitchy Date: Mon, 1 Apr 2024 21:37:49 +0000 Subject: [PATCH 05/27] need to import user config --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 8235e59..eb85aff 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,7 @@ }) ./packages/default.nix ./hosts/scarab/default.nix + ./users/stitchynyan/default.nix ]; }; lappy = nixpkgs.lib.nixosSystem { From f5bff2f354ddebd8938bc1079a6e20a265141f05 Mon Sep 17 00:00:00 2001 From: stitchy Date: Mon, 1 Apr 2024 21:47:00 +0000 Subject: [PATCH 06/27] user changes --- hosts/scarab/default.nix | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index f63b472..62ce7dd 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -1,25 +1,11 @@ { config, lib, pkgs, ... }: let - defaultUserName = "nixos"; - in { imports = [ ../default.nix ]; - users.users."${defaultUserName}" = { - isNormalUser = true; - password = "1234"; - extraGroups = [ - "dialout" - "feedbackd" - "networkmanager" - "video" - "wheel" - ]; - }; - - mobile = { + mobile = { beautification = { silentBoot = lib.mkDefault true; splash = lib.mkDefault true; @@ -30,14 +16,10 @@ in }; }; - services.openssh.enable = true; - #services.pipewire = { - # enable = true; - # pulse.enable = true; - #}; + #services.openssh.enable = true; services.xserver.desktopManager.phosh = { enable = true; - user = defaultUserName; + user = "stitchynyan"; group = "users"; }; From 11fb88b3ccdaf6eb63fcbfd5e2f8edc0fddcd95c Mon Sep 17 00:00:00 2001 From: stitchy Date: Mon, 1 Apr 2024 21:49:04 +0000 Subject: [PATCH 07/27] I hade phone keyboards --- config/zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/zshrc b/config/zshrc index e15d2a8..0daeece 100755 --- a/config/zshrc +++ b/config/zshrc @@ -8,6 +8,9 @@ unsetopt PROMPT_SP bindkey -v # End of lines configured by zsh-newuser-install +# Temporary Rebuild shortcut +alias re-scarab="sudo nixos-rebuild --flake '/etc/nixos#scarab'" + export XDG_CONFIG_HOME="$HOME/.config" export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/.local/share" From 73a035567cf02a0515e059c01424e2c29f6cd077 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 01:39:54 +0000 Subject: [PATCH 08/27] flake update --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 111e20f..628c13a 100644 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ ] }, "locked": { - "lastModified": 1710349883, - "narHash": "sha256-bjbdS2mC76xNJwt1d/uZa+JdHR8CCyYbF4Ey/NgOJus=", + "lastModified": 1712390667, + "narHash": "sha256-ebq+fJZfobqpsAdGDGpxNWSySbQejRwW9cdiil6krCo=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f0db7d418e781354d8a3c50e611e3b1cd413087", + "rev": "b787726a8413e11b074cde42704b4af32d95545c", "type": "github" }, "original": { @@ -55,11 +55,11 @@ "mobile-nixos": { "flake": false, "locked": { - "lastModified": 1710655727, - "narHash": "sha256-TOJraNC9vW2gP/ov1RBD+J61pUEJm4q7481Iu6G4ieo=", + "lastModified": 1711757427, + "narHash": "sha256-PqHK0J9YCRKlxpJp+UG+/xpwfIQRPVUPspvbbP3FB2M=", "owner": "nixos", "repo": "mobile-nixos", - "rev": "8c59592e8d44c1b30be3fa4e6df7938fa9672be3", + "rev": "f7087f8fdbd1309af315ef8c92345320aadc5edf", "type": "github" }, "original": { @@ -70,11 +70,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1711352745, - "narHash": "sha256-luvqik+i3HTvCbXQZgB6uggvEcxI9uae0nmrgtXJ17U=", + "lastModified": 1712324865, + "narHash": "sha256-+BatEWd4HlMeK7Ora+gYIkarjxFVCg9oKrIeybHIIX4=", "owner": "Nixos", "repo": "nixos-hardware", - "rev": "9a763a7acc4cfbb8603bb0231fec3eda864f81c0", + "rev": "f3b959627bca46a9f7052b8fbc464b8323e68c2c", "type": "github" }, "original": { @@ -86,11 +86,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710272261, - "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", + "lastModified": 1712163089, + "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", + "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", "type": "github" }, "original": { From e64ef40ed366493eeccd229a230e66dfb3e67056 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 01:43:19 +0000 Subject: [PATCH 09/27] thyingy --- users/stitchynyan/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/stitchynyan/default.nix b/users/stitchynyan/default.nix index a233760..352fe50 100644 --- a/users/stitchynyan/default.nix +++ b/users/stitchynyan/default.nix @@ -36,7 +36,7 @@ pulse.enable = true; alsa.enable = true; }; - printing.enable = false + printing.enable = false; usbmuxd.enable = false; xserver.enable = true; }; From d31d3beb06e45c4859c600654f9e388a1131ca4d Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 01:44:49 +0000 Subject: [PATCH 10/27] alsjkdf --- hosts/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/default.nix b/hosts/default.nix index d738e3a..9063f24 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -15,7 +15,7 @@ in }; boot = { - kernelPackages = lib.mkDefault pkgs.linuxPackages_zen; + #kernelPackages = lib.mkDefault pkgs.linuxPackages_zen; loader = { efi.canTouchEfiVariables = lib.mkDefault true; systemd-boot.enable = lib.mkDefault true; From 4469ec41f72d80a7038a1c93ab1ddb4aff92d058 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 01:47:14 +0000 Subject: [PATCH 11/27] asdf --- users/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/default.nix b/users/default.nix index ecc5e31..00303d3 100644 --- a/users/default.nix +++ b/users/default.nix @@ -6,5 +6,6 @@ mutableUsers = false; users.root.initialHashedPassword = "!"; }; + hardware.pulseaudio.enable = false; }; } From 6404b1e3569b07483a76cf385274cf6fcceec956 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 02:56:53 +0000 Subject: [PATCH 12/27] bad steam --- users/stitchynyan/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/users/stitchynyan/default.nix b/users/stitchynyan/default.nix index 352fe50..6f65da2 100644 --- a/users/stitchynyan/default.nix +++ b/users/stitchynyan/default.nix @@ -15,11 +15,13 @@ programs = { firefox.enable = true; - hyprland.enable = lib.mkIf( config.stitchyconf.form == "pc") true; - openvpn3.enable = lib.mkIf( config.stitchyconf.form == "pc") true; - steam = { - enable = lib.mkIf( config.stitchyconf.form == "pc") true; - remotePlay.openFirewall = true; + lib.mkIf( config.stitchyconf.form == "pc") { + hyprland.enable = true; + openvpn3.enable = true; + steam = { + enable = true; + remotePlay.openFirewall = true; + }; }; }; From 4091d2aeab12c8312c4593cd4f8ab157b2c697ff Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 03:04:05 +0000 Subject: [PATCH 13/27] finally steam dead? --- hosts/scarab/default.nix | 4 +++- users/stitchynyan/default.nix | 12 +++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 62ce7dd..8fb2a75 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -5,7 +5,9 @@ in { imports = [ ../default.nix ]; - mobile = { + stitchyconf.form = "handheld"; + + mobile = { beautification = { silentBoot = lib.mkDefault true; splash = lib.mkDefault true; diff --git a/users/stitchynyan/default.nix b/users/stitchynyan/default.nix index 6f65da2..a019c7c 100644 --- a/users/stitchynyan/default.nix +++ b/users/stitchynyan/default.nix @@ -15,13 +15,11 @@ programs = { firefox.enable = true; - lib.mkIf( config.stitchyconf.form == "pc") { - hyprland.enable = true; - openvpn3.enable = true; - steam = { - enable = true; - remotePlay.openFirewall = true; - }; + hyprland.enable = config.stitchyconf.form == "pc"; + openvpn3.enable = config.stitchyconf.form == "pc"; + steam = { + enable = config.stitchyconf.form == "pc"; + remotePlay.openFirewall = true; }; }; From 7d4d14795ff323258336f46a4c6ad8ab81e1e0d0 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 04:30:43 +0000 Subject: [PATCH 14/27] add necessary packages --- packages/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/default.nix b/packages/default.nix index ffe07f9..4f7fe19 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -11,6 +11,8 @@ let ] pkgs; handheldPkgs = lib.attrVals [ "chatty" + "fluffychat" + "gnome-console" "gnome-text-editor" "megapixels" ] pkgs; From d73fca4bf2cf4878ac608beaaa2a7daefa9b1ac6 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 04:52:03 +0000 Subject: [PATCH 15/27] boot --- hosts/scarab/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 8fb2a75..7bb9053 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -18,6 +18,10 @@ in }; }; + boot.loader = { + efi.canTouchEfiVariables = false; + systemd-boot.enable = false; + }; #services.openssh.enable = true; services.xserver.desktopManager.phosh = { enable = true; From eb10c1c3af1b5d43dc8dda766f2f8152eb42ac27 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 7 Apr 2024 05:30:28 +0000 Subject: [PATCH 16/27] jacky --- users/stitchynyan/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/users/stitchynyan/default.nix b/users/stitchynyan/default.nix index a019c7c..7b1c5d8 100644 --- a/users/stitchynyan/default.nix +++ b/users/stitchynyan/default.nix @@ -33,8 +33,9 @@ gnome.gnome-keyring.enable = lib.mkIf( config.stitchyconf.form == "pc") true; pipewire = { enable = true; - pulse.enable = true; alsa.enable = true; + jack.enable = true; + pulse.enable = true; }; printing.enable = false; usbmuxd.enable = false; From d5714a3e84313e5a40637429d192cdb16b9c2ee9 Mon Sep 17 00:00:00 2001 From: stitchy Date: Wed, 10 Apr 2024 05:49:56 +0000 Subject: [PATCH 17/27] enable qualcom quirks --- hosts/scarab/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 7bb9053..aeca5f1 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -1,9 +1,13 @@ -{ config, lib, pkgs, ... }: +{ config, inputs, lib, pkgs, ... }: let in { - imports = [ ../default.nix ]; + imports = [ + "../default.nix" + "${inputs.mobile-nixos}/modules/quirks/qualcomm/sdm845-modem.nix" + "${inputs.mobile-nixos}/modules/quirks/audio.nix" + ]; stitchyconf.form = "handheld"; @@ -16,6 +20,10 @@ in kernel.useStrictKernelConfig = true; networking.enable = true; }; + quirks = { + audio.alsa-ucm-meld = true; + qualcomm.sdm845-modem.enable = true; + }; }; boot.loader = { From c8f468585a317ef786ea3a7bd6312b24bfd6e767 Mon Sep 17 00:00:00 2001 From: stitchy Date: Wed, 10 Apr 2024 06:03:34 +0000 Subject: [PATCH 18/27] hwa? --- hosts/scarab/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index aeca5f1..2cacec7 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -4,9 +4,9 @@ let in { imports = [ - "../default.nix" - "${inputs.mobile-nixos}/modules/quirks/qualcomm/sdm845-modem.nix" - "${inputs.mobile-nixos}/modules/quirks/audio.nix" + ../default.nix + #"${inputs.mobile-nixos}/modules/quirks/qualcomm/sdm845-modem.nix" + #"${inputs.mobile-nixos}/modules/quirks/audio.nix" ]; stitchyconf.form = "handheld"; From 0fe053607398307933731f5ec58259337bbb1490 Mon Sep 17 00:00:00 2001 From: stitchy Date: Thu, 18 Apr 2024 09:29:41 +0000 Subject: [PATCH 19/27] try wireplumber thingy --- hosts/scarab/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 2cacec7..bb81954 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -50,7 +50,20 @@ in sensor.iio.enable = true; }; - networking.networkmanager.unmanaged = [ "rndis0" "usb0" ]; + networking.networkmanager = { + enable = true; + unmanaged = [ "rndis0" "usb0" ]; + }; + + systemd.user.services.wireplumber.environment.WIREPLUMBER_CONFIG_DIR = pkgs.runCommand "wireplumber-config" {} '' + cp -a "${pkgs.wireplumber}/share/wireplumber" "$out" + chmod +w "$out" "$out/main.lua.d" + ln -s ${pkgs.fetchurl { + url = "https://gitlab.com/postmarketOS/pmaports/-/raw/0aa9524204e9c9c002c860b87c972bc2ebf025f3/device/community/soc-qcom-sdm845/51-qcom-sdm845.lua"; + hash = "sha256-56oNJJyuZZe1Iig1xskDuyazw3PbRZtmU/YRFUTqjwk="; + }} "$out/main.lua.d/51-qcom-sdm845.lua" + ''; + systemd.services.wireplumber.environment.WIREPLUMBER_CONFIG_DIR = config.systemd.user.services.wireplumber.environment.WIREPLUMBER_CONFIG_DIR; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "oneplus-sdm845-firmware" From 846f6fdbc3a84705b256b3f218c94723bf611d9f Mon Sep 17 00:00:00 2001 From: stitchy Date: Sat, 20 Apr 2024 09:14:45 +0000 Subject: [PATCH 20/27] try again pipewire --- hosts/scarab/default.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index bb81954..1534ac8 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -55,15 +55,14 @@ in unmanaged = [ "rndis0" "usb0" ]; }; - systemd.user.services.wireplumber.environment.WIREPLUMBER_CONFIG_DIR = pkgs.runCommand "wireplumber-config" {} '' - cp -a "${pkgs.wireplumber}/share/wireplumber" "$out" - chmod +w "$out" "$out/main.lua.d" - ln -s ${pkgs.fetchurl { - url = "https://gitlab.com/postmarketOS/pmaports/-/raw/0aa9524204e9c9c002c860b87c972bc2ebf025f3/device/community/soc-qcom-sdm845/51-qcom-sdm845.lua"; - hash = "sha256-56oNJJyuZZe1Iig1xskDuyazw3PbRZtmU/YRFUTqjwk="; - }} "$out/main.lua.d/51-qcom-sdm845.lua" - ''; - systemd.services.wireplumber.environment.WIREPLUMBER_CONFIG_DIR = config.systemd.user.services.wireplumber.environment.WIREPLUMBER_CONFIG_DIR; + services.pipewire.wireplumber.configPackages = [ + (pkgs.writeTextDir "share/wireplumber/quailcum.lua.d/51-qcom-sdm845.lua" '' + ${pkgs.fetchurl { + url = "https://gitlab.com/postmarketOS/pmaports/-/raw/0aa9524204e9c9c002c860b87c972bc2ebf025f3/device/community/soc-qcom-sdm845/51-qcom-sdm845.lua"; + hash = "sha256-56oNJJyuZZe1Iig1xskDuyazw3PbRZtmU/YRFUTqjwk="; + }} + '') + ]; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "oneplus-sdm845-firmware" From c2012c8ccf974072f68776062d6d00e3951cbb0c Mon Sep 17 00:00:00 2001 From: stitchy Date: Sat, 20 Apr 2024 09:31:04 +0000 Subject: [PATCH 21/27] read the file? --- hosts/scarab/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 1534ac8..5cac94f 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -57,10 +57,10 @@ in services.pipewire.wireplumber.configPackages = [ (pkgs.writeTextDir "share/wireplumber/quailcum.lua.d/51-qcom-sdm845.lua" '' - ${pkgs.fetchurl { + ${builtins.readFile (pkgs.fetchurl { url = "https://gitlab.com/postmarketOS/pmaports/-/raw/0aa9524204e9c9c002c860b87c972bc2ebf025f3/device/community/soc-qcom-sdm845/51-qcom-sdm845.lua"; hash = "sha256-56oNJJyuZZe1Iig1xskDuyazw3PbRZtmU/YRFUTqjwk="; - }} + })} '') ]; From 38cb13e81efc4e3f3f18b17f2fa9cb71e705d10b Mon Sep 17 00:00:00 2001 From: stitchy Date: Sat, 20 Apr 2024 09:37:16 +0000 Subject: [PATCH 22/27] die pulse --- hosts/scarab/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 5cac94f..6316917 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -47,6 +47,7 @@ in hardware = { bluetooth.enable = true; + pulseaudio.enable = lib.mkForce false; sensor.iio.enable = true; }; From f1703644003fb7c90daec918e1d303a3d0cc2311 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sat, 20 Apr 2024 10:14:18 +0000 Subject: [PATCH 23/27] please --- hosts/scarab/default.nix | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 6316917..7bae50c 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -56,14 +56,50 @@ in unmanaged = [ "rndis0" "usb0" ]; }; - services.pipewire.wireplumber.configPackages = [ + /*services.pipewire.wireplumber.configPackages = [ (pkgs.writeTextDir "share/wireplumber/quailcum.lua.d/51-qcom-sdm845.lua" '' ${builtins.readFile (pkgs.fetchurl { url = "https://gitlab.com/postmarketOS/pmaports/-/raw/0aa9524204e9c9c002c860b87c972bc2ebf025f3/device/community/soc-qcom-sdm845/51-qcom-sdm845.lua"; hash = "sha256-56oNJJyuZZe1Iig1xskDuyazw3PbRZtmU/YRFUTqjwk="; })} '') - ]; + ];*/ + + services.pipewire.wireplumber.configPackages = [ + (pkgs.writeTextDir "share/wireplumber/quailcum.lua.d/51-qcom-sdm845.lua" '' + -- PipeWire's S24LE default audio format is broken in the kernel driver + alsa_monitor.rules = [ + { + matches = { + { "node.name" = "alsa_output.*.HiFi*__sink" }, + { "node.name" = "alsa_input.*.HiFi*__source" } + ] + actions = { + update-props = { + audio.format = "S16LE", + audio.rate = 48000, + api.alsa.period-size = 4096, + api.alsa.period-num = 6, + api.alsa.headroom = 512, + }, + } + } + }] + + -- Disable suspend for Voice Call devices + alsa_monitor.rules = [ + { + matches = { + { "node.name" = "alsa_output.*.Voice_Call*__sink" }, + { "node.name" ="alsa_input.*.Voice_Call*__source" } + } + actions.update=props = { + audio.format = "S16LE", + session.suspend-timeout-seconds = 0, + } + }] + '') + ]; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "oneplus-sdm845-firmware" From 5ad595d52522f0f1125e3af3618c6c0b82c7f78f Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 21 Apr 2024 18:03:11 +0000 Subject: [PATCH 24/27] why can't pulse die gracefully --- hosts/scarab/default.nix | 5 +++++ users/stitchynyan/default.nix | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 7bae50c..47d8d8f 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -101,6 +101,11 @@ in '') ]; + services.openssh = { + enable = true; + settings.PasswordAuthentication = true; + }; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "oneplus-sdm845-firmware" "oneplus-sdm845-firmware-xz" diff --git a/users/stitchynyan/default.nix b/users/stitchynyan/default.nix index 7b1c5d8..51d9adf 100644 --- a/users/stitchynyan/default.nix +++ b/users/stitchynyan/default.nix @@ -32,7 +32,7 @@ blueman.enable = true; gnome.gnome-keyring.enable = lib.mkIf( config.stitchyconf.form == "pc") true; pipewire = { - enable = true; + enable = lib.mkForce true; alsa.enable = true; jack.enable = true; pulse.enable = true; From 159b4f48262114ef925e8d81a985c63682e6670c Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 21 Apr 2024 19:23:18 +0000 Subject: [PATCH 25/27] try user changes --- hosts/scarab/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index 47d8d8f..d3c7081 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -65,6 +65,7 @@ in '') ];*/ +/* services.pipewire.wireplumber.configPackages = [ (pkgs.writeTextDir "share/wireplumber/quailcum.lua.d/51-qcom-sdm845.lua" '' -- PipeWire's S24LE default audio format is broken in the kernel driver @@ -100,6 +101,7 @@ in }] '') ]; + */ services.openssh = { enable = true; From a6d7a7b04c7b989cbb1f18f414269ced0b1ed780 Mon Sep 17 00:00:00 2001 From: stitchy Date: Tue, 23 Apr 2024 10:31:35 +0000 Subject: [PATCH 26/27] try new thing --- hosts/scarab/default.nix | 41 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index d3c7081..bb34e08 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -65,43 +65,28 @@ in '') ];*/ -/* services.pipewire.wireplumber.configPackages = [ - (pkgs.writeTextDir "share/wireplumber/quailcum.lua.d/51-qcom-sdm845.lua" '' - -- PipeWire's S24LE default audio format is broken in the kernel driver - alsa_monitor.rules = [ + (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/51-qcom-sdm845.lua" '' + monitor.alsa.rules = [ { - matches = { - { "node.name" = "alsa_output.*.HiFi*__sink" }, - { "node.name" = "alsa_input.*.HiFi*__source" } + matches = [ + { + node.name = "~alsa_output.*" + } ] actions = { update-props = { - audio.format = "S16LE", - audio.rate = 48000, - api.alsa.period-size = 4096, - api.alsa.period-num = 6, - api.alsa.headroom = 512, - }, + audio.format = "S16LE" + audio.rate = 48000 + api.alsa.period-size = 4096 + api.alsa.period-num = 6 + api.alsa.headroom = 512 + } } } - }] - - -- Disable suspend for Voice Call devices - alsa_monitor.rules = [ - { - matches = { - { "node.name" = "alsa_output.*.Voice_Call*__sink" }, - { "node.name" ="alsa_input.*.Voice_Call*__source" } - } - actions.update=props = { - audio.format = "S16LE", - session.suspend-timeout-seconds = 0, - } - }] + ] '') ]; - */ services.openssh = { enable = true; From 9e29339de841e4cf1cf55fa2fc30c444eee1b73f Mon Sep 17 00:00:00 2001 From: stitchy Date: Tue, 23 Apr 2024 10:35:21 +0000 Subject: [PATCH 27/27] ->.conf --- hosts/scarab/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix index bb34e08..06ca55b 100644 --- a/hosts/scarab/default.nix +++ b/hosts/scarab/default.nix @@ -66,7 +66,7 @@ in ];*/ services.pipewire.wireplumber.configPackages = [ - (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/51-qcom-sdm845.lua" '' + (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/51-qcom-sdm845.conf" '' monitor.alsa.rules = [ { matches = [