This commit is contained in:
Kopatz
2025-11-01 21:24:07 +01:00
parent e1bbfb4b78
commit 7f2ec92017
7 changed files with 62 additions and 50 deletions

View File

@@ -180,6 +180,14 @@
./systems/laptop/configuration.nix ./systems/laptop/configuration.nix
]; ];
}; };
"dell" = mkHost {
modules = [
### User specific ###
disko.nixosModules.disko
./users/kopatz
./systems/dell/configuration.nix
];
};
#initial install done with nix run github:nix-community/nixos-anywhere/73a6d3fef4c5b4ab9e4ac868f468ec8f9436afa7 -- --flake .#adam-site root@<ip> #initial install done with nix run github:nix-community/nixos-anywhere/73a6d3fef4c5b4ab9e4ac868f468ec8f9436afa7 -- --flake .#adam-site root@<ip>
#update with nixos-rebuild switch --flake .#adam-site --target-host "root@<ip>" #update with nixos-rebuild switch --flake .#adam-site --target-host "root@<ip>"
"adam-site" = mkStableServer { "adam-site" = mkStableServer {

View File

@@ -24,6 +24,7 @@ in
}; };
#services.xserver.desktopManager.plasma5.enable = true; #services.xserver.desktopManager.plasma5.enable = true;
#services.displayManager.sddm.wayland.enable = true; #services.displayManager.sddm.wayland.enable = true;
services.orca.enable = false;
services.desktopManager.plasma6 = { services.desktopManager.plasma6 = {
enable = true; enable = true;
}; };

View File

@@ -0,0 +1,38 @@
{ pkgs, lib, ... }:
let
cec = "${pkgs.v4l-utils}/bin/cec-ctl";
tvOn = pkgs.writeShellScriptBin "tvOn" ''
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
${cec} --tv --skip-info
${cec} --skip-info --user-control-pressed ui-cmd=power-on-function --to TV
echo "Turning TV on!"
fi
'';
tvOff = pkgs.writeShellScriptBin "tvOff" ''
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
${cec} --tv --skip-info
${cec} --skip-info --user-control-pressed ui-cmd=power-on-function --to TV
echo "Turning TV on!"
fi
'';
in
{
environment.systemPackages = with pkgs; [
tvOff
tvOn
];
# after suspend, do `cec-ctl -A | grep cec0 | wc -l`, if >0, do `cec-ctl --standby --to TV`
# similar on wakeup, if present send `cec-ctl --user-control-pressed ui-cmd=power-on-function --to TV`
environment.etc."systemd/system-sleep/sleep-turn-tv-off-on.sh".source =
pkgs.writeShellScript "post-sleep-turn-tv-off.sh" ''
case $1/$2 in
pre/*)
${tvOff}
;;
post/*)
${tvOn}
;;
esac
'';
}

View File

@@ -1,4 +1,5 @@
{ {
services.hardware.bolt.enable = true;
services.udev.extraRules = '' services.udev.extraRules = ''
# Always authorize thunderbolt connections when they are plugged in. # Always authorize thunderbolt connections when they are plugged in.
# This is to make sure the USB hub of Thunderbolt is working. # This is to make sure the USB hub of Thunderbolt is working.

View File

@@ -5,9 +5,6 @@
lib, lib,
... ...
}: }:
let
cec = "${pkgs.v4l-utils}/bin/cec-ctl";
in
{ {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
@@ -16,34 +13,12 @@ in
../../modules/misc/faster-boot-time.nix ../../modules/misc/faster-boot-time.nix
../../modules/misc/kernel.nix ../../modules/misc/kernel.nix
../../modules/services/ssh.nix ../../modules/services/ssh.nix
../../modules/misc/tv-on-off.nix
../../modules/thunderbolt.nix
./disk-config.nix ./disk-config.nix
inputs.nixos-hardware.nixosModules.dell-xps-15-7590-nvidia
]; ];
# after suspend, do `cec-ctl -A | grep cec0 | wc -l`, if >0, do `cec-ctl --standby --to TV`
# similar on wakeup, if present send `cec-ctl --user-control-pressed ui-cmd=power-on-function --to TV`
environment.etc."systemd/system-sleep/sleep-turn-tv-off-on.sh".source =
pkgs.writeShellScript "post-sleep-turn-tv-off.sh" ''
case $1/$2 in
pre/*)
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
${cec} -C --skip-info
${cec} --tv --skip-info
${cec} --standby --skip-info --to TV
echo "Turning TV off!"
${pkgs.coreutils}/bin/sleep 2
fi
;;
post/*)
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
${cec} --tv --skip-info
${cec} --skip-info --user-control-pressed ui-cmd=power-on-function --to TV
echo "Turning TV on!"
fi
;;
esac
'';
custom = { custom = {
cli-tools.enable = true; cli-tools.enable = true;
tmpfs.enable = true; tmpfs.enable = true;

View File

@@ -14,32 +14,18 @@
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
# boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "uas" "sd_mod" "rtsx_pci_sdmmc" "thunderbolt"];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci" "xhci_pci"
"thunderbolt" "ahci"
"nvme"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
]; ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
#fileSystems."/" =
# {
# device = "/dev/disk/by-uuid/10537ea5-9d9f-4be8-8509-c7f9c9b978b8";
# fsType = "ext4";
# };
#fileSystems."/boot" =
# {
# device = "/dev/disk/by-uuid/C163-6BD5";
# fsType = "vfat";
# };
#swapDevices =
# [{ device = "/dev/disk/by-uuid/3ef4829c-e9ea-4cc0-85a1-bd8e704b9940"; }];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction # still possible to use this option, but it's recommended to use it in conjunction
@@ -48,5 +34,5 @@
# networking.interfaces.wlp59s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp59s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View File

@@ -41,9 +41,12 @@
../../home-manager/mpv.nix ../../home-manager/mpv.nix
../../home-manager/discord-theme.nix ../../home-manager/discord-theme.nix
../../home-manager/vr.nix ../../home-manager/vr.nix
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeModules.nixvim
inputs.stylix.homeModules.stylix
]; ];
stylix.enable = false;
stylix.image = if (config.stylix.enable == false) then ../../wallpaper/ina.jpg else null;
programs.feh = { programs.feh = {
enable = true; enable = true;
buttons = { buttons = {