diff --git a/flake.nix b/flake.nix index e3fe552..1d4f9c2 100644 --- a/flake.nix +++ b/flake.nix @@ -180,6 +180,14 @@ ./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@ #update with nixos-rebuild switch --flake .#adam-site --target-host "root@" "adam-site" = mkStableServer { diff --git a/modules/graphical/plasma.nix b/modules/graphical/plasma.nix index dd0c958..fa474a3 100644 --- a/modules/graphical/plasma.nix +++ b/modules/graphical/plasma.nix @@ -24,6 +24,7 @@ in }; #services.xserver.desktopManager.plasma5.enable = true; #services.displayManager.sddm.wayland.enable = true; + services.orca.enable = false; services.desktopManager.plasma6 = { enable = true; }; diff --git a/modules/misc/tv-on-off.nix b/modules/misc/tv-on-off.nix new file mode 100644 index 0000000..81281f0 --- /dev/null +++ b/modules/misc/tv-on-off.nix @@ -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 + ''; +} diff --git a/modules/thunderbolt.nix b/modules/thunderbolt.nix index 4da7e02..c903b50 100644 --- a/modules/thunderbolt.nix +++ b/modules/thunderbolt.nix @@ -1,4 +1,5 @@ { + services.hardware.bolt.enable = true; services.udev.extraRules = '' # Always authorize thunderbolt connections when they are plugged in. # This is to make sure the USB hub of Thunderbolt is working. diff --git a/systems/dell/configuration.nix b/systems/dell/configuration.nix index a5995f0..925c555 100644 --- a/systems/dell/configuration.nix +++ b/systems/dell/configuration.nix @@ -5,9 +5,6 @@ lib, ... }: -let - cec = "${pkgs.v4l-utils}/bin/cec-ctl"; -in { imports = [ # Include the results of the hardware scan. @@ -16,34 +13,12 @@ in ../../modules/misc/faster-boot-time.nix ../../modules/misc/kernel.nix ../../modules/services/ssh.nix + ../../modules/misc/tv-on-off.nix + ../../modules/thunderbolt.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 = { cli-tools.enable = true; tmpfs.enable = true; diff --git a/systems/dell/hardware-configuration.nix b/systems/dell/hardware-configuration.nix index 8c260da..6cacc0c 100644 --- a/systems/dell/hardware-configuration.nix +++ b/systems/dell/hardware-configuration.nix @@ -14,32 +14,18 @@ (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 = [ - "nvme" "xhci_pci" - "thunderbolt" + "ahci" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.kernelModules = [ "kvm-intel" ]; 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 # (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 @@ -48,5 +34,5 @@ # networking.interfaces.wlp59s0.useDHCP = lib.mkDefault true; 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; } diff --git a/users/kopatz/home.nix b/users/kopatz/home.nix index d57e9e1..84ada74 100644 --- a/users/kopatz/home.nix +++ b/users/kopatz/home.nix @@ -41,9 +41,12 @@ ../../home-manager/mpv.nix ../../home-manager/discord-theme.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 = { enable = true; buttons = {