Squash merge redo into master

This commit is contained in:
alsaiduq-lab 2025-05-29 20:01:47 -06:00
parent d9fa7610df
commit 05fa2b59f2
15 changed files with 268 additions and 114 deletions

View file

@ -1,11 +1,19 @@
{pkgs, ...}: {
# Bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.memtest86.enable = true;
boot.loader.systemd-boot.configurationLimit = 5;
boot.loader.timeout = 5;
# Create the traditional /bin directory with a symlink to bash for scripts
boot = {
loader = {
systemd-boot = {
enable = true;
configurationLimit = 5;
};
efi.canTouchEfiVariables = true;
timeout = 5;
};
tmp = {
cleanOnBoot = true;
};
kernelPackages = pkgs.linuxPackages_xanmod_latest;
};
system.activationScripts.binbash = {
deps = [];
text = ''

View file

@ -17,6 +17,7 @@
./npm.nix
./tailscale.nix
./udiskie.nix
./ld.nix
];
services.ollama = {

View file

@ -34,7 +34,7 @@
];
LD_LIBRARY_PATH = lib.makeLibraryPath [
pkgs.libglvnd
pkgs.mesa.drivers
pkgs.mesa
pkgs.gcc-unwrapped.lib
pkgs.linuxPackages.nvidia_x11
pkgs.cudatoolkit

View file

@ -1,22 +1,29 @@
{pkgs, ...}: let
wallpapers = [
"${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nixos-wallpaper.png"
"${pkgs.nixos-artwork.wallpapers.gnome-dark}/share/backgrounds/gnome/gnome-dark.png"
"${pkgs.nixos-artwork.wallpapers.nineish-dark-gray}/share/backgrounds/nixos/nixos-wallpaper.png"
];
wallpaperDir = "/home/cobray/wallpapers";
randomWallpaper = pkgs.writeShellScript "wallpaper.sh" ''
#!${pkgs.runtimeShell}
set -e
BG_DIR="/var/lib/lightdm-background"
BG_LINK="$BG_DIR/current-wallpaper.png"
BG_LINK="$BG_DIR/random-wallpaper.png"
LAST_WALLPAPER="$BG_DIR/.last-wallpaper"
WALLPAPER_DIR="${wallpaperDir}"
mkdir -p "$BG_DIR"
WALLPAPERS=( ${builtins.concatStringsSep " " (map (w: "\"${w}\"") wallpapers)} )
rm -f "$BG_LINK"
mapfile -t WALLPAPERS < <(${pkgs.findutils}/bin/find "$WALLPAPER_DIR" -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" \))
COUNT=''${#WALLPAPERS[@]}
if [[ "$COUNT" -eq 0 ]]; then exit 1; fi
RAND=$(shuf -i 0-$(($COUNT - 1)) -n 1)
if [[ "$COUNT" -eq 0 ]]; then
cp -f "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nixos-wallpaper.png" "$BG_LINK"
echo "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nixos-wallpaper.png" > "$LAST_WALLPAPER"
chown lightdm:lightdm "$BG_LINK" "$LAST_WALLPAPER"
exit 0
fi
RAND=$(${pkgs.coreutils}/bin/shuf -i 0-$(($COUNT - 1)) -n 1)
SELECT=''${WALLPAPERS[$RAND]}
ln -sf "$SELECT" "$BG_LINK"
cp -f "$SELECT" "$BG_LINK"
echo "$SELECT" > "$LAST_WALLPAPER"
chown lightdm:lightdm "$BG_LINK" "$LAST_WALLPAPER"
'';
in {
services.xserver.enable = true;
@ -31,7 +38,7 @@ in {
extraPackages = with pkgs; [
dmenu
i3status
i3lock
i3lock-color
i3blocks
picom
feh
@ -42,6 +49,10 @@ in {
xsettingsd
];
extraSessionCommands = ''
if [ -f /var/lib/lightdm-background/.last-wallpaper ]; then
${pkgs.feh}/bin/feh --bg-fill "$(cat /var/lib/lightdm-background/.last-wallpaper)"
fi
export GSETTINGS_SCHEMA_DIR="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas"
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "Tokyonight-Dark"
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface icon-theme "candy-icons"
@ -64,7 +75,7 @@ in {
services.xserver.displayManager.lightdm = {
enable = true;
background = "/var/lib/lightdm-background/current-wallpaper.png";
background = "/var/lib/lightdm-background/random-wallpaper.png";
greeters.gtk = {
enable = true;
theme = {
@ -91,17 +102,21 @@ in {
systemd.tmpfiles.rules = [
"d /var/lib/lightdm-background 0755 lightdm lightdm - -"
"L+ /var/lib/lightdm-background/current-wallpaper.png - - - - ${builtins.elemAt wallpapers 0}"
"d ${wallpaperDir} 0755 cobray users - -"
"f /var/log/random-wallpaper.log 0644 root root - -"
];
systemd.services.random-wallpaper = {
description = "Update wallpaper to a random image";
before = ["display-manager.service"];
wantedBy = ["display-manager.service"];
serviceConfig = {
Type = "oneshot";
ExecStart = "${randomWallpaper}";
User = "root";
};
};
systemd.timers.random-wallpaper = {
description = "Daily wallpaper refresh for LightDM";
wantedBy = ["timers.target"];
@ -134,18 +149,18 @@ in {
[Settings]
gtk-application-prefer-dark-theme=1
gtk-theme-name=Tokyonight-Dark
gtk-icon-theme-name="candy-icons"
gtk-font-name="Clear Sans 10"
gtk-cursor-theme-name="capitaine-cursors"
gtk-icon-theme-name=candy-icons
gtk-font-name=Clear Sans 10
gtk-cursor-theme-name=capitaine-cursors
gtk-cursor-theme-size=24
'';
"gtk-4.0/settings.ini".text = ''
[Settings]
gtk-application-prefer-dark-theme=1
gtk-theme-name=Tokyonight-Dark
gtk-icon-theme-name="candy-icons"
gtk-font-name="Clear Sans 10"
gtk-cursor-theme-name="capitaine-cursors"
gtk-icon-theme-name=candy-icons
gtk-font-name=Clear Sans 10
gtk-cursor-theme-name=capitaine-cursors
gtk-cursor-theme-size=24
'';
};
@ -164,6 +179,9 @@ in {
adwaita-icon-theme
kdePackages.breeze-icons
gnome-themes-extra
findutils
coreutils
feh
];
environment.pathsToLink = [
@ -175,6 +193,9 @@ in {
{
name = "xfce+i3";
start = ''
if [ -f /var/lib/lightdm-background/.last-wallpaper ]; then
${pkgs.feh}/bin/feh --bg-fill "$(cat /var/lib/lightdm-background/.last-wallpaper)"
fi
export XDG_DATA_DIRS="${pkgs.tokyonight-gtk-theme}/share:${pkgs.candy-icons}/share:${pkgs.hicolor-icon-theme}/share:${pkgs.adwaita-icon-theme}/share:$XDG_DATA_DIRS"
${pkgs.xfce.xfce4-session}/bin/xfce4-session --with-ck-launch &
${pkgs.i3-gaps}/bin/i3

5
modules/ld.nix Normal file
View file

@ -0,0 +1,5 @@
{
programs.nix-ld = {
enable = true;
};
}

View file

@ -1,6 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
networkmanager_dmenu
networkmanagerapplet
];

View file

@ -2,14 +2,17 @@
nixpkgs.config.allowUnfree = true;
programs.nix-index.enable = true;
programs.command-not-found.enable = false;
nix.settings = {
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
substituters = [
"https://cache.nixos.org"
"https://nix-gaming.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
];
};
}

View file

@ -1,61 +1,25 @@
{
config,
pkgs,
lib,
...
}: let
py = pkgs.python311Packages;
gccLibPath = "${pkgs.gcc-unwrapped.lib}/lib";
nvidiaLibPath = "${pkgs.linuxPackages.nvidia_x11}/lib";
cudaLibPath = "${pkgs.cudatoolkit}/lib";
glvndLibPath = "${pkgs.libglvnd}/lib";
ldLibraryPath = "${gccLibPath}:${nvidiaLibPath}:${cudaLibPath}:${glvndLibPath}";
pythonEnv = pkgs.python311.buildEnv.override {
extraLibs = with py; [
numpy
i3ipc
requests
ipython
six
psutil
pynvml
pyqtgraph
pyqt6
pyyaml
pillow
jedi
libcst
wheel
jupyterlab
];
extraOutputsToInstall = ["out"];
postBuild = ''
wrapProgram $out/bin/python \
--prefix LD_LIBRARY_PATH : "${ldLibraryPath}"
'';
};
custom-UV = pkgs.symlinkJoin {
name = "uv";
paths = [pkgs.uv];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/uv \
--prefix LD_LIBRARY_PATH : "${ldLibraryPath}" \
--set PYTHONPATH ""
'';
};
in {
options.python = {
enable = lib.mkEnableOption "System Python Environment";
};
config = lib.mkIf config.python.enable {
environment.systemPackages = with pkgs; [
pythonEnv
isort
custom-UV
git
stdenv.cc.cc.lib
python311
];
};
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
(python311.withPackages (ps:
with ps; [
i3ipc
requests
ipython
six
psutil
pynvml
pyqtgraph
pyqt6
pyyaml
pillow
jedi
libcst
wheel
jupyterlab
datasets
]))
isort
uv
python311
];
}

View file

@ -1,8 +1,6 @@
{pkgs, ...}: {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
# apparently enabling this makes big picture boot up, does not work on nvidia however
# gamescopeSession.enable = true;
extraCompatPackages = [
@ -28,7 +26,6 @@
piper
portaudio
alsa-lib
stdenv.cc.cc.lib
libglvnd
];
}