diff --git a/common/desktop.nix b/common/desktop.nix index 6c409db..24c6ccb 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; @@ -115,6 +118,7 @@ htop i3lock killall + libreoffice-fresh lxappearance ncdu nitrogen @@ -128,20 +132,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 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; } 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"; 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 ''; }; }