Compare commits

..

10 commits

Author SHA1 Message Date
30da71c790 Update users/stitchynyan/default.nix
even more alphabetized O.O
2024-05-04 04:31:38 -07:00
a6c4098a5c
revert "scarab init" accidentally pushed to master
This reverts commit 40a8d3b711.
2024-05-03 09:29:43 +00:00
97a6ae026e
get test user on gemini 'server' 2024-05-03 04:47:19 +00:00
aea964c745
flake update and fstrim 2024-04-20 09:08:27 +00:00
0a8c6eb54e
tweaks for arduino plus bat 2024-04-20 09:08:20 +00:00
9a4993661b
change this for better bat 2024-04-20 09:08:14 +00:00
40a8d3b711
scarab init 2024-04-20 09:07:49 +00:00
101d47fa29
moar malachite fixes 2024-04-05 02:46:38 -07:00
8d69eb76d6
better way of doing this 2024-04-05 02:23:54 -07:00
16ae890458
Update framework config 2024-03-31 10:10:47 +00:00
13 changed files with 142 additions and 196 deletions

View file

@ -8,9 +8,6 @@ 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"

View file

@ -38,11 +38,11 @@
]
},
"locked": {
"lastModified": 1712390667,
"narHash": "sha256-ebq+fJZfobqpsAdGDGpxNWSySbQejRwW9cdiil6krCo=",
"lastModified": 1713547570,
"narHash": "sha256-i8tNz47Lfsq5QWFLyE3rIm0gs2UUvXXAxfWTC24e370=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "b787726a8413e11b074cde42704b4af32d95545c",
"rev": "7c61e400a99f33cdff3118c1e4032bcb049e1a30",
"type": "github"
},
"original": {
@ -55,11 +55,11 @@
"mobile-nixos": {
"flake": false,
"locked": {
"lastModified": 1711757427,
"narHash": "sha256-PqHK0J9YCRKlxpJp+UG+/xpwfIQRPVUPspvbbP3FB2M=",
"lastModified": 1713034591,
"narHash": "sha256-zEtSq4e1hsf5nPoTzsx+cvHTusQxFdyDpD3mOa360A0=",
"owner": "nixos",
"repo": "mobile-nixos",
"rev": "f7087f8fdbd1309af315ef8c92345320aadc5edf",
"rev": "5455e4455b231218f6198b39383a0ad4c1d6638e",
"type": "github"
},
"original": {
@ -70,11 +70,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1712324865,
"narHash": "sha256-+BatEWd4HlMeK7Ora+gYIkarjxFVCg9oKrIeybHIIX4=",
"lastModified": 1713521961,
"narHash": "sha256-EwR8wW9AqJhSIY+0oxWRybUZ32BVKuZ9bjlRh8SJvQ8=",
"owner": "Nixos",
"repo": "nixos-hardware",
"rev": "f3b959627bca46a9f7052b8fbc464b8323e68c2c",
"rev": "5d48925b815fd202781bfae8fb6f45c07112fdb2",
"type": "github"
},
"original": {
@ -86,11 +86,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1712163089,
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
"lastModified": 1713297878,
"narHash": "sha256-hOkzkhLT59wR8VaMbh1ESjtZLbGi+XNaBN6h49SPqEc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
"rev": "66adc1e47f8784803f2deb6cacd5e07264ec2d5c",
"type": "github"
},
"original": {

View file

@ -29,18 +29,6 @@
}
];
};
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; };
@ -68,6 +56,7 @@
./packages/default.nix
./hosts/gemini/default.nix
./users/nyadmin/default.nix
./users/cirno/default.nix
home-manager.nixosModules.home-manager
{
@ -75,6 +64,7 @@
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;
}
];
};

View file

@ -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,6 +25,7 @@ in
security.sudo.wheelNeedsPassword = false;
security.rtkit.enable = true;
services = {
fstrim.enable = true;
resolved = {
enable = true;
dnsovertls = "opportunistic";

View file

@ -70,7 +70,7 @@
PCIE_ASPM_ON_AC = "default";
PCIE_ASPM_ON_BAT = "powersupersave";
PLATFORM_PROFILE_ON_BAT = "low-power";
RUNTIME_PM_ON_BAT = true;
RUNTIME_PM_ON_BAT = "auto";
WOL_DISABLE = true;
SCHED_POWERSAVE_ON_BAT = true;

View file

@ -1,65 +1,75 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
passthrough = pkgs.writeShellScript "pasthrough.sh" ''
GUEST_NAME="$1"
HOOK_NAME="$2"
STATE_NAME="$3"
passthrough = pkgs.writeShellApplication {
name = "pasthrough.sh";
runtimeInputs = lib.attrVals [ "coreutils" "kmod" "libvirt" "procps" ] pkgs;
text = ''
GUEST_NAME="$1"
HOOK_NAME="$2"
STATE_NAME="$3"
set -e
set -x
echo 19>/home/stitchynyan/startlogfile
BASH_XTRACEFD=19
set -x
# For the windows 10 VM
if [[ "$GUEST_NAME" == "win10" ]]; then
# For the windows 10 VM
if [[ "$GUEST_NAME" == "win10" ]]; then
# Prepare hook
if [[ "$HOOK_NAME/$STATE_NAME" == "prepare/begin" ]]; then
# Prepare hook
if [[ "$HOOK_NAME/$STATE_NAME" == "prepare/begin" ]]; then
# Remove Hyprland
${pkgs.busybox}/bin/pkill Hyprland
# Remove Hyprland
pkill Hyprland
# Unbind VTconsoles
${pkgs.busybox}/bin/echo 0 > /sys/class/vtconsole/vtcon0/bind
${pkgs.busybox}/bin/echo 0 > /sys/class/vtconsole/vtcon1/bind
# Unbind VTconsoles
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
# Unbind EFI-Framebuffer
${pkgs.busybox}/bin/echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Unbind EFI-Framebuffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Unload Modules
${pkgs.busybox}/bin/modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
# We love race conditions
sleep 2
# Unbind the GPU from display driver
${pkgs.libvirt}/bin/virsh nodedev-detach pci_0000_01_00_0
${pkgs.libvirt}/bin/virsh nodedev-detach pci_0000_01_00_1
# Unload Modules
modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
# Load VFIO Kernel Module
${pkgs.busybox}/bin/modprobe vfio_pci
# Unbind the GPU from display driver
virsh nodedev-detach pci_0000_01_00_0
virsh nodedev-detach pci_0000_01_00_1
elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then
# Load VFIO Kernel Module
modprobe vfio_pci
# Re-Bind GPU to Nvidia Driver (replace the pci addresses with yours)
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_0
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_1
sleep 2
${pkgs.busybox}/bin/modprobe -r vfio-pci
elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then
#bind efi
${pkgs.busybox}/bin/echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
# 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
# Reload nvidia modules
${pkgs.busybox}/bin/modprobe nvidia_drm
${pkgs.busybox}/bin/modprobe nvidia_modeset
${pkgs.busybox}/bin/modprobe nvidia_uvm
${pkgs.busybox}/bin/modprobe nvidia
modprobe -r vfio-pci
# Rebind VT consoles
${pkgs.busybox}/bin/echo 1 > /sys/class/vtconsole/vtcon0/bind
${pkgs.busybox}/bin/echo 1 > /sys/class/vtconsole/vtcon1/bind
#bind efi
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
# Rebind VT consoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
bin/echo 1 > /sys/class/vtconsole/vtcon1/bind
fi
fi
fi
'';
'';
};
in {
imports =
[
@ -79,6 +89,15 @@ 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";

View file

@ -7,7 +7,7 @@
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.kernelModules = [ "kvm-intel" "vfio-pci" ];
boot.extraModulePackages = [ ];
boot.kernelParams = [

View file

@ -1,101 +0,0 @@
{ 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";
}

View file

@ -11,8 +11,6 @@ let
] pkgs;
handheldPkgs = lib.attrVals [
"chatty"
"fluffychat"
"gnome-console"
"gnome-text-editor"
"megapixels"
] pkgs;

29
users/cirno/default.nix Normal file
View file

@ -0,0 +1,29 @@
{ 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";
};
};
}

15
users/cirno/home.nix Normal file
View file

@ -0,0 +1,15 @@
{ config,
nixosConfig,
pkgs,
lib,
inputs,
home-manager,
... }:
let
in
{
home.stateVersion = "24.05";
home.homeDirectory = "/home/cirno";
}

View file

@ -6,6 +6,5 @@
mutableUsers = false;
users.root.initialHashedPassword = "!";
};
hardware.pulseaudio.enable = false;
};
}

View file

@ -4,52 +4,51 @@
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 = config.stitchyconf.form == "pc";
openvpn3.enable = config.stitchyconf.form == "pc";
hyprland.enable = true;
openvpn3.enable = true;
steam = {
enable = config.stitchyconf.form == "pc";
enable = true;
remotePlay.openFirewall = true;
};
};
security.pam.services.swaylock = {};
services = {
avahi = {
enable = false;
enable = config.stitchyconf.form == "pc";
nssmdns4 = true;
openFirewall = true;
};
blueman.enable = true;
gnome.gnome-keyring.enable = lib.mkIf( config.stitchyconf.form == "pc") true;
gnome.gnome-keyring.enable = true;
pipewire = {
enable = lib.mkForce true;
alsa.enable = true;
jack.enable = true;
enable = true;
pulse.enable = true;
};
printing.enable = false;
usbmuxd.enable = false;
printing.enable = true;
usbmuxd.enable = true;
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";
};
}