From c884d03229198d913423e24884ad0f5f988ce14b Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 5 Jun 2018 22:14:33 -0700 Subject: [PATCH 1/6] [NixOS] Add uber-loaner nix file --- nixos/machines/uber-loaner.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 nixos/machines/uber-loaner.nix diff --git a/nixos/machines/uber-loaner.nix b/nixos/machines/uber-loaner.nix new file mode 100644 index 00000000..2188b325 --- /dev/null +++ b/nixos/machines/uber-loaner.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + + ../configuration.nix + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2958f04b-8387-4a0c-abc1-f12036c53581"; + fsType = "ext4"; + }; + + fileSystems."/tmp" = + { device = "tmpfs"; + fsType = "tmpfs"; + }; + + swapDevices = [ ]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} From 0baa079371b202b2b5ea9ef6ecf5e82906aa8a19 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 16 Jun 2018 19:17:30 -0700 Subject: [PATCH 2/6] [Emacs] Always use frame mode when in xmonad --- dotfiles/emacs.d/README.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index c83a941a..648fe019 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1168,7 +1168,9 @@ Disabling line numbers because they are slow as fuck. #+END_SRC *** frame-mode #+BEGIN_SRC emacs-lisp -(defvar imalison:use-frame-mode nil) +(defvar imalison:use-frame-mode + (s-contains? "xmonad" (shell-command-to-string "wmctrl -m"))) + (use-package frame-mode :if imalison:use-frame-mode :demand t From f5c97ae7e193a63b2422f1e4d8ce911f8c333106 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 16 Jun 2018 19:17:57 -0700 Subject: [PATCH 3/6] [NixOS] Add wmctrl --- nixos/configuration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c3a96cdb..118502a6 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -115,6 +115,7 @@ in stow tmux wget + wmctrl zsh # Miscellaneous @@ -197,5 +198,5 @@ in shell = pkgs.zsh; }; - system.stateVersion = "18.03"; # Did you read the comment? + system.stateVersion = "18.03"; } From a748a6c85a700cf2aae0e37d59faf29f6dc79f40 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 16 Jun 2018 19:18:11 -0700 Subject: [PATCH 4/6] [NixOS] Use grub for uber-loaner --- nixos/machines/uber-loaner.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/machines/uber-loaner.nix b/nixos/machines/uber-loaner.nix index 2188b325..4d0c89df 100644 --- a/nixos/machines/uber-loaner.nix +++ b/nixos/machines/uber-loaner.nix @@ -9,6 +9,14 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; + boot.loader.grub.efiSupport = true; + boot.loader.grub.device = "nodev"; + boot.loader.grub.enable = true; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/EFI"; + fsType = "vfat"; + }; fileSystems."/" = { device = "/dev/disk/by-uuid/2958f04b-8387-4a0c-abc1-f12036c53581"; @@ -20,8 +28,13 @@ fsType = "tmpfs"; }; + environment.systemPackages = [ + pkgs.linuxPackages.rtl8814au + ]; + swapDevices = [ ]; nix.maxJobs = lib.mkDefault 4; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + users.extraUsers.root.initialHashedPassword = ""; } From 0840cc868640a0d8ead716b844ab6792aeaa7296 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 16 Jun 2018 20:59:06 -0700 Subject: [PATCH 5/6] [NixOS] Only enable nvidia drivers on imalison-home --- nixos/configuration.nix | 2 -- nixos/machines/imalison-home.nix | 25 ++++++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index aabb4f84..c2a968e8 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -98,7 +98,6 @@ in pommed_light rofi rofi-pass - sddm-kcm udiskie-appindicator volnoti xclip @@ -179,7 +178,6 @@ in exportConfiguration = true; enable = true; layout = "us"; - videoDrivers = [ "nvidia" ]; desktopManager = { gnome3.enable = true; default = "none"; diff --git a/nixos/machines/imalison-home.nix b/nixos/machines/imalison-home.nix index a3f78654..83be237d 100644 --- a/nixos/machines/imalison-home.nix +++ b/nixos/machines/imalison-home.nix @@ -52,15 +52,18 @@ networking.hostName = "imalison-home"; boot.loader.efi.canTouchEfiVariables = true; - services.xserver.screenSection = '' - DefaultDepth 24 - Option "RegistryDwords" "PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1" - Option "TripleBuffer" "True" - Option "Stereo" "0" - Option "nvidiaXineramaInfoOrder" "DFP-0" - Option "metamodes" "DVI-D-0: nvidia-auto-select +0+2160 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, HDMI-0: nvidia-auto-select +640+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, HDMI-1: nvidia-auto-select +2560+2160 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}" - Option "SLI" "Off" - Option "MultiGPU" "Off" - Option "BaseMosaic" "off" - ''; + services.xserver = { + screenSection = '' + DefaultDepth 24 + Option "RegistryDwords" "PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1" + Option "TripleBuffer" "True" + Option "Stereo" "0" + Option "nvidiaXineramaInfoOrder" "DFP-0" + Option "metamodes" "DVI-D-0: nvidia-auto-select +0+2160 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, HDMI-0: nvidia-auto-select +640+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, HDMI-1: nvidia-auto-select +2560+2160 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}" + Option "SLI" "Off" + Option "MultiGPU" "Off" + Option "BaseMosaic" "off" + ''; + videoDrivers = [ "nvidia" ]; + }; } From b4a011dd2e167cad2bb4be5b37e2a77cdd560e2c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 16 Jun 2018 22:40:50 -0700 Subject: [PATCH 6/6] [NixOS] Get USB wifi dongle working --- nixos/machines/uber-loaner.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nixos/machines/uber-loaner.nix b/nixos/machines/uber-loaner.nix index 4d0c89df..0503a71c 100644 --- a/nixos/machines/uber-loaner.nix +++ b/nixos/machines/uber-loaner.nix @@ -8,7 +8,7 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.extraModulePackages = [ pkgs.linuxPackages.rtl8814au ]; boot.loader.grub.efiSupport = true; boot.loader.grub.device = "nodev"; boot.loader.grub.enable = true; @@ -28,10 +28,6 @@ fsType = "tmpfs"; }; - environment.systemPackages = [ - pkgs.linuxPackages.rtl8814au - ]; - swapDevices = [ ]; nix.maxJobs = lib.mkDefault 4;