From 41e669aee7dcb57e3182042e299c5f4be6652b47 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:20:57 +0100 Subject: [PATCH] update hub --- modules/graphical/default.nix | 1 + modules/graphical/xfce.nix | 19 +++++++++++++++++++ pkgs/hub/default.nix | 2 +- pkgs/hub/update.sh | 20 ++++++++++++++++++++ systems/amd-server-vm/configuration.nix | 1 + systems/amd-server/configuration.nix | 12 +++++------- systems/pc/configuration.nix | 7 +++++-- 7 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 modules/graphical/xfce.nix create mode 100755 pkgs/hub/update.sh diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index 7b8ca5e..c6bf4a2 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -25,5 +25,6 @@ #./cosmic.nix ./shared.nix ./nightlight.nix + ./xfce.nix ]; } diff --git a/modules/graphical/xfce.nix b/modules/graphical/xfce.nix new file mode 100644 index 0000000..ca60b07 --- /dev/null +++ b/modules/graphical/xfce.nix @@ -0,0 +1,19 @@ +{lib, config, pkgs, ...}: +with lib; +let + cfg = config.custom.graphical.xfce; +in +{ + options.custom.graphical.xfce = { + enable = mkEnableOption "Enables lxqt"; + }; + + config = mkIf cfg.enable { + services.xserver = { + xkb.layout = config.mainUser.layout; + xkb.variant = config.mainUser.variant; + enable = true; + desktopManager.xfce.enable = true; + }; + }; +} diff --git a/pkgs/hub/default.nix b/pkgs/hub/default.nix index 55609e6..3b834e2 100644 --- a/pkgs/hub/default.nix +++ b/pkgs/hub/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchGit { url = "git@github.com:oberprofis/hub.git"; ref = "master"; - rev = "062c128597e2b2e4275f7c8ce27644cdc6b5e49b"; + rev = "8b689e230a8ecbc85d4e2eae7544018ccefc735a"; }; installPhase = '' mkdir -p $out diff --git a/pkgs/hub/update.sh b/pkgs/hub/update.sh new file mode 100755 index 0000000..b881218 --- /dev/null +++ b/pkgs/hub/update.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p jq nix-prefetch-git + +set -e + +PACKAGE_FILE="default.nix" # Replace with your package file path +REPO_URL="git@github.com:oberprofis/hub.git" # Replace with the repository URL + +echo "Fetching latest revision from $REPO_URL..." + +# Get the latest revision and sha256 +latest_rev=$(nix-prefetch-git $REPO_URL | jq -r '.rev') + +echo "Latest revision: $latest_rev" + +# Update the package file with the new revision and sha256 +sed -i "s|rev = \".*\";|rev = \"$latest_rev\";|" $PACKAGE_FILE + +echo "Package file $PACKAGE_FILE updated successfully." + diff --git a/systems/amd-server-vm/configuration.nix b/systems/amd-server-vm/configuration.nix index 44fa05d..12ecd8c 100644 --- a/systems/amd-server-vm/configuration.nix +++ b/systems/amd-server-vm/configuration.nix @@ -8,6 +8,7 @@ ../../modules/fail2ban.nix ../../modules/logging.nix ../../modules/motd.nix + ../../modules/kernel.nix (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") ]; diff --git a/systems/amd-server/configuration.nix b/systems/amd-server/configuration.nix index d3aca10..d87f6eb 100644 --- a/systems/amd-server/configuration.nix +++ b/systems/amd-server/configuration.nix @@ -7,6 +7,7 @@ { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../modules/kernel.nix ]; custom = { @@ -48,6 +49,7 @@ sddm.enable = true; nightlight.enable = true; i3.enable = true; + xfce.enable = true; shared.enable = true; }; }; @@ -59,11 +61,12 @@ systemd.services.start-vm = { description = "Start VM"; wants = [ "network-online.target" ]; - after = [ "network.target" "network-online.target" "vmware-networks.service" ]; + after = + [ "network.target" "network-online.target" "vmware-networks.service" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { - Type = "forking"; #?????? doesnt work without it, thanks vmware + Type = "forking"; # ?????? doesnt work without it, thanks vmware ExecStart = let script = pkgs.writeShellScript "start-vm" '' sleep 10 @@ -90,11 +93,6 @@ boot.kernelModules = [ "zenpower" ]; boot.blacklistedKernelModules = [ "k10temp" ]; - services.xserver.desktopManager = { - xfce.enable = true; - xterm.enable = false; - }; - networking.hostName = "amd-server"; # Define your hostname. nixpkgs.config.permittedInsecurePackages = [ "electron-28.3.3" "electron-27.3.11" ]; diff --git a/systems/pc/configuration.nix b/systems/pc/configuration.nix index 94b4961..29cc730 100644 --- a/systems/pc/configuration.nix +++ b/systems/pc/configuration.nix @@ -77,6 +77,10 @@ stylix.enable = true; }; }; + services.ollama = { + enable = true; + acceleration = "cuda"; + }; #nvidida drivers fail to build on new kernel https://github.com/NixOS/nixpkgs/issues/357643 boot.kernelPackages = lib.mkForce pkgs.linuxKernel.packages.linux_6_11; @@ -114,10 +118,9 @@ EndSection ''; - #zenpower for ryzen boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ]; - boot.kernelModules = ["zenpower"]; + boot.kernelModules = [ "zenpower" ]; boot.blacklistedKernelModules = [ "k10temp" ]; # Bootloader. boot.loader.systemd-boot.enable = true;