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/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" diff --git a/flake.lock b/flake.lock index 5e2a4bb..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": { @@ -68,13 +68,29 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1712324865, + "narHash": "sha256-+BatEWd4HlMeK7Ora+gYIkarjxFVCg9oKrIeybHIIX4=", + "owner": "Nixos", + "repo": "nixos-hardware", + "rev": "f3b959627bca46a9f7052b8fbc464b8323e68c2c", + "type": "github" + }, + "original": { + "owner": "Nixos", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "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": { @@ -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 d0b592b..eb85aff 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ outputs = inputs@{ nixpkgs, + nixos-hardware, home-manager, osu-nixos, ... @@ -28,10 +29,23 @@ } ]; }; + 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 + ./users/stitchynyan/default.nix + ]; + }; lappy = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ + nixos-hardware.nixosModules.framework-12th-gen-intel ./packages/default.nix ./hosts/lappy/default.nix @@ -68,17 +82,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..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; @@ -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..123528c 100644 --- a/hosts/lappy/default.nix +++ b/hosts/lappy/default.nix @@ -12,77 +12,76 @@ 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; }; time.timeZone = "America/Lost_Angeles"; + services.syncthing = { + enable = true; + user = "stitchynyan"; + openDefaultPorts = true; + databaseDir = "/home/stitchynyan/.local/share/syncthing"; + dataDir = "/home/stitchynyan"; + }; + 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; + + 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 }; }; diff --git a/hosts/scarab/default.nix b/hosts/scarab/default.nix new file mode 100644 index 0000000..06ca55b --- /dev/null +++ b/hosts/scarab/default.nix @@ -0,0 +1,101 @@ +{ config, inputs, lib, pkgs, ... }: +let + +in +{ + imports = [ + ../default.nix + #"${inputs.mobile-nixos}/modules/quirks/qualcomm/sdm845-modem.nix" + #"${inputs.mobile-nixos}/modules/quirks/audio.nix" + ]; + + stitchyconf.form = "handheld"; + + mobile = { + beautification = { + silentBoot = lib.mkDefault true; + splash = lib.mkDefault true; + }; + boot.stage-1 = { + kernel.useStrictKernelConfig = true; + networking.enable = true; + }; + quirks = { + audio.alsa-ucm-meld = true; + qualcomm.sdm845-modem.enable = true; + }; + }; + + boot.loader = { + efi.canTouchEfiVariables = false; + systemd-boot.enable = false; + }; + #services.openssh.enable = true; + services.xserver.desktopManager.phosh = { + enable = true; + user = "stitchynyan"; + group = "users"; + }; + + #services.xserver.desktopManager.plasma5 = { + # enable = true; + # mobile.enable = true; + #}; + + programs.firefox.enable = true; + programs.calls.enable = true; + + hardware = { + bluetooth.enable = true; + pulseaudio.enable = lib.mkForce false; + sensor.iio.enable = true; + }; + + networking.networkmanager = { + enable = true; + unmanaged = [ "rndis0" "usb0" ]; + }; + + /*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/wireplumber.conf.d/51-qcom-sdm845.conf" '' + monitor.alsa.rules = [ + { + 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 + } + } + } + ] + '') + ]; + + services.openssh = { + enable = true; + settings.PasswordAuthentication = true; + }; + + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "oneplus-sdm845-firmware" + "oneplus-sdm845-firmware-xz" + ]; + system.stateVersion = "23.11"; +} 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; 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; }; } diff --git a/users/stitchynyan/default.nix b/users/stitchynyan/default.nix index b5a819c..51d9adf 100644 --- a/users/stitchynyan/default.nix +++ b/users/stitchynyan/default.nix @@ -15,29 +15,30 @@ programs = { firefox.enable = true; - hyprland.enable = true; - openvpn3.enable = true; + hyprland.enable = config.stitchyconf.form == "pc"; + openvpn3.enable = config.stitchyconf.form == "pc"; steam = { - enable = true; + enable = config.stitchyconf.form == "pc"; 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; + enable = lib.mkForce true; alsa.enable = true; + jack.enable = true; + pulse.enable = true; }; - printing.enable = true; - usbmuxd.enable = true; + printing.enable = false; + usbmuxd.enable = false; xserver.enable = true; };