From e4b3b506570d4b523b9f4a1ba4118acc44593c10 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 22 Nov 2021 20:54:18 +0100 Subject: [PATCH 1/5] add kernel parameter for better suspend --- hardware/xps5530/hardware-configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hardware/xps5530/hardware-configuration.nix b/hardware/xps5530/hardware-configuration.nix index 78ef8d2..257dfd9 100644 --- a/hardware/xps5530/hardware-configuration.nix +++ b/hardware/xps5530/hardware-configuration.nix @@ -12,6 +12,10 @@ boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; + boot.kernelParams = [ + "mem_sleep_default=deep" + ] + boot.initrd.luks.devices."cryptlvm".device = "/dev/sda2"; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; From 48fcb0a6c707651707aa6dc5be21a04da62b8879 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 23 Nov 2021 10:08:17 +0100 Subject: [PATCH 2/5] fix the work config --- home-manager/work-wsl.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/home-manager/work-wsl.nix b/home-manager/work-wsl.nix index 5e90cb0..4f965ae 100644 --- a/home-manager/work-wsl.nix +++ b/home-manager/work-wsl.nix @@ -6,14 +6,11 @@ ]; programs.git.userEmail = "zweili@contria.com"; - home.shellAliases = { - management-server = "mosh --ssh=\"ssh -p 22\" localadmin@10.40.0.53 tmux a"; - }; - programs.bash = { enable = true; bashrcExtra = '' . ~/git_repos/nixos/home-manager/work_config/bashrc + . /home/andreas/.nix-profile/etc/profile.d/nix.sh ''; }; } From 99b1870e2262ad87484f007df347af576819651f Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 23 Nov 2021 20:36:13 +0100 Subject: [PATCH 3/5] add libreoffice --- common/desktop.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/common/desktop.nix b/common/desktop.nix index accb829..cfda342 100644 --- a/common/desktop.nix +++ b/common/desktop.nix @@ -114,6 +114,7 @@ highlight htop i3lock + libreoffice-fresh lxappearance ncdu nitrogen From d0e20bffde71bcd303426f68a3b12888623ce57a Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 23 Nov 2021 20:51:25 +0100 Subject: [PATCH 4/5] group options a bit better --- common/desktop.nix | 65 +++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 38 deletions(-) diff --git a/common/desktop.nix b/common/desktop.nix index cfda342..790100c 100644 --- a/common/desktop.nix +++ b/common/desktop.nix @@ -11,17 +11,30 @@ ]; # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; # Set your time zone. time.timeZone = "Europe/Zurich"; - networking.networkmanager.enable = true; + networking = { + networkmanager.enable = true; + firewall.allowedTCPPorts = [ 22 ]; + # firewall.allowedUDPPorts = [ ... ]; + }; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + hardware = { + cpu.intel.updateMicrocode = true; + enableRedistributableFirmware = true; + }; + + services = { + openssh.enable = true; + autorandr.enable = true; + printing.enable = true; + }; # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; @@ -31,28 +44,21 @@ }; # Enable the X11 windowing system. - services.xserver.enable = true; - - - services.xserver.displayManager.lightdm.enable = true; - services.xserver.displayManager.defaultSession = "none+qtile"; - services.xserver.windowManager = { - qtile.enable = true; + services.xserver = { + enable = true; + displayManager.lightdm.enable = true; + displayManager.defaultSession = "none+qtile"; + windowManager.qtile.enable = true; + layout = "us"; + xkbOptions = "compose:ralt"; + libinput.enable = true; }; - services.autorandr.enable = true; - - # Configure keymap in X11 - services.xserver.layout = "us"; - services.xserver.xkbOptions = "compose:ralt"; fonts.fonts = with pkgs; [ source-code-pro ]; - # Enable CUPS to print documents. - services.printing.enable = true; - # Enable keyring security.pam.services.lightdm.enableGnomeKeyring = true; services.gnome.gnome-keyring.enable = true; @@ -61,9 +67,6 @@ sound.enable = true; hardware.pulseaudio.enable = true; - # Enable touchpad support (enabled default in most desktopManager). - services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.andreas = { isNormalUser = true; @@ -128,20 +131,6 @@ wget ]; - hardware = { - cpu.intel.updateMicrocode = true; - enableRedistributableFirmware = true; - }; - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - - # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 22 ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave From 26938c2cecc230d8e2a4642eb187cf28a9416ac0 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 23 Nov 2021 20:57:23 +0100 Subject: [PATCH 5/5] reorder stuff --- hardware/asus/hardware-configuration.nix | 36 +++++++++++++----------- hardware/vm/configuration.nix | 6 ++-- hardware/vm/hardware-configuration.nix | 31 +++++++++++--------- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/hardware/asus/hardware-configuration.nix b/hardware/asus/hardware-configuration.nix index 6d09acb..0a4f215 100644 --- a/hardware/asus/hardware-configuration.nix +++ b/hardware/asus/hardware-configuration.nix @@ -4,27 +4,29 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "aesni_intel" "cryptd" ]; + boot.initrd.availableKernelModules = [ + "aesni_intel" + "ahci" + "cryptd" + "sd_mod" + "usb_storage" + "xhci_pci" + ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; boot.initrd.luks.devices."cryptlvm".device = "/dev/sda2"; - fileSystems."/" = - { device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-label/BOOT"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-label/swap"; } - ]; + fileSystems."/boot" = { + device = "/dev/disk/by-label/BOOT"; + fsType = "vfat"; + }; + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; } diff --git a/hardware/vm/configuration.nix b/hardware/vm/configuration.nix index b7c9c01..efdda49 100644 --- a/hardware/vm/configuration.nix +++ b/hardware/vm/configuration.nix @@ -11,8 +11,10 @@ ./hardware-configuration.nix ]; - networking.hostName = "nixos-vm"; # Define your hostname. - networking.interfaces.enp0s3.useDHCP = true; + networking = { + hostName = "nixos-vm"; + interfaces.enp0s3.useDHCP = true; + }; environment.variables = { ZWEILI_HARDWARE = "vm"; diff --git a/hardware/vm/hardware-configuration.nix b/hardware/vm/hardware-configuration.nix index 8453137..3ccd3a4 100644 --- a/hardware/vm/hardware-configuration.nix +++ b/hardware/vm/hardware-configuration.nix @@ -4,26 +4,29 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = [ ]; - - boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "ata_piix" + "ohci_pci" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-label/BOOT"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/BOOT"; + fsType = "vfat"; + }; - swapDevices = - [ { device = "/dev/disk/by-label/swap"; } - ]; + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; virtualisation.virtualbox.guest.enable = true; }