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 bindkey -v
# End of lines configured by zsh-newuser-install # 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_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"

View file

@ -38,11 +38,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1712390667, "lastModified": 1713547570,
"narHash": "sha256-ebq+fJZfobqpsAdGDGpxNWSySbQejRwW9cdiil6krCo=", "narHash": "sha256-i8tNz47Lfsq5QWFLyE3rIm0gs2UUvXXAxfWTC24e370=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "b787726a8413e11b074cde42704b4af32d95545c", "rev": "7c61e400a99f33cdff3118c1e4032bcb049e1a30",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -55,11 +55,11 @@
"mobile-nixos": { "mobile-nixos": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1711757427, "lastModified": 1713034591,
"narHash": "sha256-PqHK0J9YCRKlxpJp+UG+/xpwfIQRPVUPspvbbP3FB2M=", "narHash": "sha256-zEtSq4e1hsf5nPoTzsx+cvHTusQxFdyDpD3mOa360A0=",
"owner": "nixos", "owner": "nixos",
"repo": "mobile-nixos", "repo": "mobile-nixos",
"rev": "f7087f8fdbd1309af315ef8c92345320aadc5edf", "rev": "5455e4455b231218f6198b39383a0ad4c1d6638e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -70,11 +70,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1712324865, "lastModified": 1713521961,
"narHash": "sha256-+BatEWd4HlMeK7Ora+gYIkarjxFVCg9oKrIeybHIIX4=", "narHash": "sha256-EwR8wW9AqJhSIY+0oxWRybUZ32BVKuZ9bjlRh8SJvQ8=",
"owner": "Nixos", "owner": "Nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "f3b959627bca46a9f7052b8fbc464b8323e68c2c", "rev": "5d48925b815fd202781bfae8fb6f45c07112fdb2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -86,11 +86,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1712163089, "lastModified": 1713297878,
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", "narHash": "sha256-hOkzkhLT59wR8VaMbh1ESjtZLbGi+XNaBN6h49SPqEc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", "rev": "66adc1e47f8784803f2deb6cacd5e07264ec2d5c",
"type": "github" "type": "github"
}, },
"original": { "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 { lappy = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
@ -68,6 +56,7 @@
./packages/default.nix ./packages/default.nix
./hosts/gemini/default.nix ./hosts/gemini/default.nix
./users/nyadmin/default.nix ./users/nyadmin/default.nix
./users/cirno/default.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
@ -75,6 +64,7 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.nyadmin = import ./users/nyadmin/home.nix; 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 = { boot = {
#kernelPackages = lib.mkDefault pkgs.linuxPackages_zen; kernelPackages = lib.mkDefault pkgs.linuxPackages_zen;
loader = { loader = {
efi.canTouchEfiVariables = lib.mkDefault true; efi.canTouchEfiVariables = lib.mkDefault true;
systemd-boot.enable = lib.mkDefault true; systemd-boot.enable = lib.mkDefault true;
@ -25,6 +25,7 @@ in
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
security.rtkit.enable = true; security.rtkit.enable = true;
services = { services = {
fstrim.enable = true;
resolved = { resolved = {
enable = true; enable = true;
dnsovertls = "opportunistic"; dnsovertls = "opportunistic";

View file

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

View file

@ -1,11 +1,15 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
let let
passthrough = pkgs.writeShellScript "pasthrough.sh" '' passthrough = pkgs.writeShellApplication {
name = "pasthrough.sh";
runtimeInputs = lib.attrVals [ "coreutils" "kmod" "libvirt" "procps" ] pkgs;
text = ''
GUEST_NAME="$1" GUEST_NAME="$1"
HOOK_NAME="$2" HOOK_NAME="$2"
STATE_NAME="$3" STATE_NAME="$3"
set -e echo 19>/home/stitchynyan/startlogfile
BASH_XTRACEFD=19
set -x set -x
# For the windows 10 VM # For the windows 10 VM
@ -15,51 +19,57 @@ let
if [[ "$HOOK_NAME/$STATE_NAME" == "prepare/begin" ]]; then if [[ "$HOOK_NAME/$STATE_NAME" == "prepare/begin" ]]; then
# Remove Hyprland # Remove Hyprland
${pkgs.busybox}/bin/pkill Hyprland pkill Hyprland
# Unbind VTconsoles # Unbind VTconsoles
${pkgs.busybox}/bin/echo 0 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon0/bind
${pkgs.busybox}/bin/echo 0 > /sys/class/vtconsole/vtcon1/bind echo 0 > /sys/class/vtconsole/vtcon1/bind
# Unbind EFI-Framebuffer # Unbind EFI-Framebuffer
${pkgs.busybox}/bin/echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# We love race conditions
sleep 2
# Unload Modules # Unload Modules
${pkgs.busybox}/bin/modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
# Unbind the GPU from display driver # Unbind the GPU from display driver
${pkgs.libvirt}/bin/virsh nodedev-detach pci_0000_01_00_0 virsh nodedev-detach pci_0000_01_00_0
${pkgs.libvirt}/bin/virsh nodedev-detach pci_0000_01_00_1 virsh nodedev-detach pci_0000_01_00_1
# Load VFIO Kernel Module # Load VFIO Kernel Module
${pkgs.busybox}/bin/modprobe vfio_pci modprobe vfio_pci
sleep 2
elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then
# Re-Bind GPU to Nvidia Driver (replace the pci addresses with yours) # Re-Bind GPU to Nvidia Driver (replace the pci addresses with yours)
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_0 virsh nodedev-reattach pci_0000_01_00_0
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_1 virsh nodedev-reattach pci_0000_01_00_1
${pkgs.busybox}/bin/modprobe -r vfio-pci modprobe -r vfio-pci
#bind efi #bind efi
${pkgs.busybox}/bin/echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
# Reload nvidia modules # Reload nvidia modules
${pkgs.busybox}/bin/modprobe nvidia_drm modprobe nvidia_drm
${pkgs.busybox}/bin/modprobe nvidia_modeset modprobe nvidia_modeset
${pkgs.busybox}/bin/modprobe nvidia_uvm modprobe nvidia_uvm
${pkgs.busybox}/bin/modprobe nvidia modprobe nvidia
# Rebind VT consoles # Rebind VT consoles
${pkgs.busybox}/bin/echo 1 > /sys/class/vtconsole/vtcon0/bind echo 1 > /sys/class/vtconsole/vtcon0/bind
${pkgs.busybox}/bin/echo 1 > /sys/class/vtconsole/vtcon1/bind bin/echo 1 > /sys/class/vtconsole/vtcon1/bind
fi fi
fi fi
''; '';
};
in { in {
imports = imports =
[ [
@ -79,6 +89,15 @@ in {
steam-hardware.enable = true; 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"; networking.hostName = "malachite";
time.timeZone = "America/Los_Angeles"; 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.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" "vfio-pci" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.kernelParams = [ 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; ] pkgs;
handheldPkgs = lib.attrVals [ handheldPkgs = lib.attrVals [
"chatty" "chatty"
"fluffychat"
"gnome-console"
"gnome-text-editor" "gnome-text-editor"
"megapixels" "megapixels"
] pkgs; ] 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; mutableUsers = false;
users.root.initialHashedPassword = "!"; users.root.initialHashedPassword = "!";
}; };
hardware.pulseaudio.enable = false;
}; };
} }

View file

@ -4,52 +4,51 @@
imports = [ ../default.nix ]; imports = [ ../default.nix ];
nixpkgs.config.allowUnfreePredicate = pkg: nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem ( lib.getName pkg) [ builtins.elem ( lib.getName pkg) [
"cudatoolkit"
"nvidia-settings"
"nvidia-x11"
"osu-lazer" "osu-lazer"
"steam" "steam"
"steam-original" "steam-original"
"steam-run" "steam-run"
"nvidia-x11"
"nvidia-settings"
"cudatoolkit"
]; ];
programs = { programs = {
firefox.enable = true; firefox.enable = true;
hyprland.enable = config.stitchyconf.form == "pc"; hyprland.enable = true;
openvpn3.enable = config.stitchyconf.form == "pc"; openvpn3.enable = true;
steam = { steam = {
enable = config.stitchyconf.form == "pc"; enable = true;
remotePlay.openFirewall = true; remotePlay.openFirewall = true;
}; };
}; };
security.pam.services.swaylock = {};
services = { services = {
avahi = { avahi = {
enable = false; enable = config.stitchyconf.form == "pc";
nssmdns4 = true; nssmdns4 = true;
openFirewall = true; openFirewall = true;
}; };
blueman.enable = true; blueman.enable = true;
gnome.gnome-keyring.enable = lib.mkIf( config.stitchyconf.form == "pc") true; gnome.gnome-keyring.enable = true;
pipewire = { pipewire = {
enable = lib.mkForce true;
alsa.enable = true; alsa.enable = true;
jack.enable = true; enable = true;
pulse.enable = true; pulse.enable = true;
}; };
printing.enable = false; printing.enable = true;
usbmuxd.enable = false; usbmuxd.enable = true;
xserver.enable = true; xserver.enable = true;
}; };
security.pam.services.swaylock = {};
users.users.stitchynyan = { users.users.stitchynyan = {
description = "Personal user";
extraGroups = [ "wheel" "networkmanager" "kvm" "libvirtd" "audio" "dialout" ];
home = "/home/stitchynyan";
initialHashedPassword = "$y$j9T$rvySCWHYE4AO4A9J0Vf20.$x5hpBNsOWovQFtNfFUIt17OAH5MJFwFBGjxbaEIagJ3";
isNormalUser = true; isNormalUser = true;
shell = pkgs.zsh; shell = pkgs.zsh;
home = "/home/stitchynyan";
description = "Personal user";
extraGroups = [ "wheel" "networkmanager" "kvm" "libvirtd" "audio" ];
initialHashedPassword = "$y$j9T$rvySCWHYE4AO4A9J0Vf20.$x5hpBNsOWovQFtNfFUIt17OAH5MJFwFBGjxbaEIagJ3";
}; };
} }