Compare commits
27 commits
master
...
oneplus/sc
Author | SHA1 | Date | |
---|---|---|---|
9e29339de8 | |||
a6d7a7b04c | |||
159b4f4826 | |||
5ad595d525 | |||
f170364400 | |||
38cb13e81e | |||
c2012c8ccf | |||
846f6fdbc3 | |||
0fe0536073 | |||
c8f468585a | |||
d5714a3e84 | |||
eb10c1c3af | |||
d73fca4bf2 | |||
7d4d14795f | |||
4091d2aeab | |||
6404b1e356 | |||
4469ec41f7 | |||
d31d3beb06 | |||
e64ef40ed3 | |||
73a035567c | |||
11fb88b3cc | |||
f5bff2f354 | |||
615dce3e41 | |||
a66a3015cd | |||
ba4ac7f1f4 | |||
ed6489c559 | |||
a8b23e0189 |
13 changed files with 196 additions and 142 deletions
|
@ -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"
|
||||
|
|
24
flake.lock
24
flake.lock
|
@ -38,11 +38,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1713547570,
|
||||
"narHash": "sha256-i8tNz47Lfsq5QWFLyE3rIm0gs2UUvXXAxfWTC24e370=",
|
||||
"lastModified": 1712390667,
|
||||
"narHash": "sha256-ebq+fJZfobqpsAdGDGpxNWSySbQejRwW9cdiil6krCo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "7c61e400a99f33cdff3118c1e4032bcb049e1a30",
|
||||
"rev": "b787726a8413e11b074cde42704b4af32d95545c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -55,11 +55,11 @@
|
|||
"mobile-nixos": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1713034591,
|
||||
"narHash": "sha256-zEtSq4e1hsf5nPoTzsx+cvHTusQxFdyDpD3mOa360A0=",
|
||||
"lastModified": 1711757427,
|
||||
"narHash": "sha256-PqHK0J9YCRKlxpJp+UG+/xpwfIQRPVUPspvbbP3FB2M=",
|
||||
"owner": "nixos",
|
||||
"repo": "mobile-nixos",
|
||||
"rev": "5455e4455b231218f6198b39383a0ad4c1d6638e",
|
||||
"rev": "f7087f8fdbd1309af315ef8c92345320aadc5edf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -70,11 +70,11 @@
|
|||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1713521961,
|
||||
"narHash": "sha256-EwR8wW9AqJhSIY+0oxWRybUZ32BVKuZ9bjlRh8SJvQ8=",
|
||||
"lastModified": 1712324865,
|
||||
"narHash": "sha256-+BatEWd4HlMeK7Ora+gYIkarjxFVCg9oKrIeybHIIX4=",
|
||||
"owner": "Nixos",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "5d48925b815fd202781bfae8fb6f45c07112fdb2",
|
||||
"rev": "f3b959627bca46a9f7052b8fbc464b8323e68c2c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -86,11 +86,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1713297878,
|
||||
"narHash": "sha256-hOkzkhLT59wR8VaMbh1ESjtZLbGi+XNaBN6h49SPqEc=",
|
||||
"lastModified": 1712163089,
|
||||
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "66adc1e47f8784803f2deb6cacd5e07264ec2d5c",
|
||||
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
14
flake.nix
14
flake.nix
|
@ -29,6 +29,18 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
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; };
|
||||
|
@ -56,7 +68,6 @@
|
|||
./packages/default.nix
|
||||
./hosts/gemini/default.nix
|
||||
./users/nyadmin/default.nix
|
||||
./users/cirno/default.nix
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
|
@ -64,7 +75,6 @@
|
|||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.nyadmin = import ./users/nyadmin/home.nix;
|
||||
home-manager.users.cirno = import ./users/cirno/home.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;
|
||||
|
@ -25,7 +25,6 @@ in
|
|||
security.sudo.wheelNeedsPassword = false;
|
||||
security.rtkit.enable = true;
|
||||
services = {
|
||||
fstrim.enable = true;
|
||||
resolved = {
|
||||
enable = true;
|
||||
dnsovertls = "opportunistic";
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
PCIE_ASPM_ON_AC = "default";
|
||||
PCIE_ASPM_ON_BAT = "powersupersave";
|
||||
PLATFORM_PROFILE_ON_BAT = "low-power";
|
||||
RUNTIME_PM_ON_BAT = "auto";
|
||||
RUNTIME_PM_ON_BAT = true;
|
||||
WOL_DISABLE = true;
|
||||
SCHED_POWERSAVE_ON_BAT = true;
|
||||
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
passthrough = pkgs.writeShellApplication {
|
||||
name = "pasthrough.sh";
|
||||
runtimeInputs = lib.attrVals [ "coreutils" "kmod" "libvirt" "procps" ] pkgs;
|
||||
text = ''
|
||||
passthrough = pkgs.writeShellScript "pasthrough.sh" ''
|
||||
GUEST_NAME="$1"
|
||||
HOOK_NAME="$2"
|
||||
STATE_NAME="$3"
|
||||
|
||||
echo 19>/home/stitchynyan/startlogfile
|
||||
BASH_XTRACEFD=19
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# For the windows 10 VM
|
||||
|
@ -19,57 +15,51 @@ let
|
|||
if [[ "$HOOK_NAME/$STATE_NAME" == "prepare/begin" ]]; then
|
||||
|
||||
# Remove Hyprland
|
||||
pkill Hyprland
|
||||
${pkgs.busybox}/bin/pkill Hyprland
|
||||
|
||||
# Unbind VTconsoles
|
||||
echo 0 > /sys/class/vtconsole/vtcon0/bind
|
||||
echo 0 > /sys/class/vtconsole/vtcon1/bind
|
||||
${pkgs.busybox}/bin/echo 0 > /sys/class/vtconsole/vtcon0/bind
|
||||
${pkgs.busybox}/bin/echo 0 > /sys/class/vtconsole/vtcon1/bind
|
||||
|
||||
# Unbind EFI-Framebuffer
|
||||
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
|
||||
|
||||
# We love race conditions
|
||||
sleep 2
|
||||
${pkgs.busybox}/bin/echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
|
||||
|
||||
# Unload Modules
|
||||
modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
|
||||
${pkgs.busybox}/bin/modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
|
||||
|
||||
# Unbind the GPU from display driver
|
||||
virsh nodedev-detach pci_0000_01_00_0
|
||||
virsh nodedev-detach pci_0000_01_00_1
|
||||
${pkgs.libvirt}/bin/virsh nodedev-detach pci_0000_01_00_0
|
||||
${pkgs.libvirt}/bin/virsh nodedev-detach pci_0000_01_00_1
|
||||
|
||||
# Load VFIO Kernel Module
|
||||
modprobe vfio_pci
|
||||
|
||||
sleep 2
|
||||
${pkgs.busybox}/bin/modprobe vfio_pci
|
||||
|
||||
elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then
|
||||
|
||||
# Re-Bind GPU to Nvidia Driver (replace the pci addresses with yours)
|
||||
virsh nodedev-reattach pci_0000_01_00_0
|
||||
virsh nodedev-reattach pci_0000_01_00_1
|
||||
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_0
|
||||
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_1
|
||||
|
||||
modprobe -r vfio-pci
|
||||
${pkgs.busybox}/bin/modprobe -r vfio-pci
|
||||
|
||||
#bind efi
|
||||
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
|
||||
${pkgs.busybox}/bin/echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
|
||||
|
||||
# Reload nvidia modules
|
||||
modprobe nvidia_drm
|
||||
modprobe nvidia_modeset
|
||||
modprobe nvidia_uvm
|
||||
modprobe nvidia
|
||||
${pkgs.busybox}/bin/modprobe nvidia_drm
|
||||
${pkgs.busybox}/bin/modprobe nvidia_modeset
|
||||
${pkgs.busybox}/bin/modprobe nvidia_uvm
|
||||
${pkgs.busybox}/bin/modprobe nvidia
|
||||
|
||||
# Rebind VT consoles
|
||||
echo 1 > /sys/class/vtconsole/vtcon0/bind
|
||||
bin/echo 1 > /sys/class/vtconsole/vtcon1/bind
|
||||
${pkgs.busybox}/bin/echo 1 > /sys/class/vtconsole/vtcon0/bind
|
||||
${pkgs.busybox}/bin/echo 1 > /sys/class/vtconsole/vtcon1/bind
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
'';
|
||||
};
|
||||
in {
|
||||
imports =
|
||||
[
|
||||
|
@ -89,15 +79,6 @@ in {
|
|||
steam-hardware.enable = true;
|
||||
};
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
user = "stitchynyan";
|
||||
openDefaultPorts = true;
|
||||
databaseDir = "/home/stitchynyan/.local/share/syncthing";
|
||||
dataDir = "/home/stitchynyan";
|
||||
};
|
||||
|
||||
networking.hostName = "malachite";
|
||||
|
||||
time.timeZone = "America/Los_Angeles";
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" "vfio-pci" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
boot.kernelParams = [
|
||||
|
|
101
hosts/scarab/default.nix
Normal file
101
hosts/scarab/default.nix
Normal file
|
@ -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";
|
||||
}
|
|
@ -11,6 +11,8 @@ let
|
|||
] pkgs;
|
||||
handheldPkgs = lib.attrVals [
|
||||
"chatty"
|
||||
"fluffychat"
|
||||
"gnome-console"
|
||||
"gnome-text-editor"
|
||||
"megapixels"
|
||||
] pkgs;
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
|
||||
|
||||
config = {
|
||||
|
||||
programs = {
|
||||
firefox.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
};
|
||||
desktopManager.plasma6.enable = true;
|
||||
};
|
||||
|
||||
users.users.cirno = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh;
|
||||
home = "/home/cirno";
|
||||
description = "user for guests/cirno people";
|
||||
extraGroups = [ "" ];
|
||||
initialHashedPassword = "$6$2f8vjQbdKyEBqPRT$FrZBZfzpJGqNqLlCyb7CzRNm0wuZwfRI7Qj/dUQlbtLixyJK5Im9AJT7GXmP5StfhZxSbH/wW8nDGPQm98NXV0";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
{ config,
|
||||
nixosConfig,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
home-manager,
|
||||
... }:
|
||||
let
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
home.stateVersion = "24.05";
|
||||
home.homeDirectory = "/home/cirno";
|
||||
}
|
|
@ -6,5 +6,6 @@
|
|||
mutableUsers = false;
|
||||
users.root.initialHashedPassword = "!";
|
||||
};
|
||||
hardware.pulseaudio.enable = false;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,51 +4,52 @@
|
|||
imports = [ ../default.nix ];
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem ( lib.getName pkg) [
|
||||
"cudatoolkit"
|
||||
"nvidia-settings"
|
||||
"nvidia-x11"
|
||||
"osu-lazer"
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-run"
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
"cudatoolkit"
|
||||
];
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
security.pam.services.swaylock = {};
|
||||
|
||||
services = {
|
||||
avahi = {
|
||||
enable = config.stitchyconf.form == "pc";
|
||||
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 = lib.mkForce true;
|
||||
alsa.enable = true;
|
||||
enable = true;
|
||||
jack.enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
printing.enable = true;
|
||||
usbmuxd.enable = true;
|
||||
printing.enable = false;
|
||||
usbmuxd.enable = false;
|
||||
xserver.enable = true;
|
||||
};
|
||||
|
||||
security.pam.services.swaylock = {};
|
||||
|
||||
users.users.stitchynyan = {
|
||||
description = "Personal user";
|
||||
extraGroups = [ "wheel" "networkmanager" "kvm" "libvirtd" "audio" "dialout" ];
|
||||
home = "/home/stitchynyan";
|
||||
initialHashedPassword = "$y$j9T$rvySCWHYE4AO4A9J0Vf20.$x5hpBNsOWovQFtNfFUIt17OAH5MJFwFBGjxbaEIagJ3";
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh;
|
||||
home = "/home/stitchynyan";
|
||||
description = "Personal user";
|
||||
extraGroups = [ "wheel" "networkmanager" "kvm" "libvirtd" "audio" ];
|
||||
initialHashedPassword = "$y$j9T$rvySCWHYE4AO4A9J0Vf20.$x5hpBNsOWovQFtNfFUIt17OAH5MJFwFBGjxbaEIagJ3";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue