From ebec7174a4710788d6495b90d49a4e44bdd5025e Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Mon, 29 Aug 2022 00:18:24 +0300 Subject: [PATCH] system: cleanup main file --- system/configuration.nix | 43 +--------------- system/machine/home/default.nix | 51 +++++++++++++++++++ .../home}/hardware-configuration.nix | 0 3 files changed, 53 insertions(+), 41 deletions(-) create mode 100644 system/machine/home/default.nix rename system/{ => machine/home}/hardware-configuration.nix (100%) diff --git a/system/configuration.nix b/system/configuration.nix index 41453f2..a8e55bb 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -8,40 +8,15 @@ let secrets = import ../secrets.nix; in { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - boot = { - # Use the GRUB 2 boot loader. - loader.grub = { - enable = true; - version = 2; - device = "/dev/sda"; - }; - - kernelPackages = pkgs.linuxPackages_latest; - extraModulePackages = with config.boot.kernelPackages; [ - rtl88x2bu - ]; - }; + imports = [ ./machine/home ]; networking = { - hostName = "home"; # Define your hostname. - inherit (secrets.networking) extraHosts; - networkmanager.enable = true; # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config # replicates the default behaviour. useDHCP = false; - - interfaces = { - enp3s0.useDHCP = true; - wlp11s0f3u2.useDHCP = true; - }; }; # Select internationalisation properties. @@ -66,7 +41,6 @@ in openssh.enable = true; # Xmonad - dbus = { enable = true; packages = [ pkgs.dconf ]; @@ -80,20 +54,6 @@ in xkbVariant = "dvorak,"; xkbOptions = "grp:win_space_toggle"; - xrandrHeads = [ - { - output = "DisplayPort-1"; - primary = true; - } - { - output = "HDMI-A-0"; - monitorConfig = '' - Option "Rotate" "right" - Option "LeftOf" "DisplayPort-1" - ''; - } - ]; - displayManager = { defaultSession = "none+xmonad"; }; @@ -107,6 +67,7 @@ in enable = true; mediaKeys.enable = true; }; + hardware.pulseaudio = { enable = true; package = pkgs.pulseaudioFull; diff --git a/system/machine/home/default.nix b/system/machine/home/default.nix new file mode 100644 index 0000000..5c3582d --- /dev/null +++ b/system/machine/home/default.nix @@ -0,0 +1,51 @@ +{ config, pkgs, ... }: + +let + secrets = import ../../../secrets.nix; +in +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + boot = { + # Use the GRUB 2 boot loader. + loader.grub = { + enable = true; + version = 2; + device = "/dev/sda"; + }; + + kernelPackages = pkgs.linuxPackages_latest; + extraModulePackages = with config.boot.kernelPackages; [ + rtl88x2bu + ]; + }; + + networking = { + hostName = "home"; # Define your hostname. + inherit (secrets.networking) extraHosts; + + interfaces = { + enp3s0.useDHCP = true; + wlp11s0f3u2.useDHCP = true; + }; + }; + + services.xserver = { + xrandrHeads = [ + { + output = "DisplayPort-1"; + primary = true; + } + { + output = "HDMI-A-0"; + monitorConfig = '' + Option "Rotate" "right" + Option "LeftOf" "DisplayPort-1" + ''; + } + ]; + }; +} diff --git a/system/hardware-configuration.nix b/system/machine/home/hardware-configuration.nix similarity index 100% rename from system/hardware-configuration.nix rename to system/machine/home/hardware-configuration.nix