diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2016-07-14 20:20:05 -0400 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2016-07-14 20:23:19 -0400 |
commit | 5e51bed2e787ded903be61ad1227dca208f80e6b (patch) | |
tree | d7c2839f6d2c8a0d0957b5da8e985ec965a9c942 | |
parent | 418be345d29bc8ae40900b9ec652be36ae0091cf (diff) |
Refactor nix config.
-rw-r--r-- | nixos/aji.nix | 49 | ||||
-rw-r--r-- | nixos/configuration.nix (renamed from configuration.nix) | 48 |
2 files changed, 49 insertions, 48 deletions
diff --git a/nixos/aji.nix b/nixos/aji.nix new file mode 100644 index 0000000..abda9f8 --- /dev/null +++ b/nixos/aji.nix @@ -0,0 +1,49 @@ +{ config, pkgs, hardware, ... }: + +{ + imports = [ + ./configuration.nix + ]; + + # Use the gummiboot efi boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.timeout = 0; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.luks.devices = [ + { + device = "/dev/sda2"; + name = "crypt"; + preLVM = true; + allowDiscards = true; + } + ]; + boot.kernelModules = ["tp_smapi" "thinkpad_acpi" "fbcon" "i915"]; + boot.kernelParams = ["quiet" "acpi_osi=\"!Windows 2012\""]; + boot.extraModulePackages = [config.boot.kernelPackages.tp_smapi]; + boot.extraModprobeConfig = '' + options i915 enable_rc6=1 + ''; + + networking.hostName = "aji"; + + fileSystems."/" = { + mountPoint = "/"; + device = "/dev/mapper/cryptvg-root"; + fsType = "btrfs"; + options = ["subvol=aji-root" "discard" "compress=lzo"]; + }; + swapDevices = + [ { device = "/dev/mapper/cryptvg-swap"; } + ]; + + services.tlp.enable = true; + services.tlp.extraConfig = '' + # Needed for either SSD or btrfs. + SATA_LINKPWR_ON_BAT=max_performance + ''; + + services.xserver.xkbModel = "thinkpad60"; + + # The NixOS release to be compatible with for stateful data such as databases. + system.stateVersion = "16.03"; +} diff --git a/configuration.nix b/nixos/configuration.nix index 2b56615..c25f009 100644 --- a/configuration.nix +++ b/nixos/configuration.nix @@ -6,27 +6,8 @@ hardware.pulseaudio.package = pkgs.pulseaudioFull; hardware.enableAllFirmware = true; - # Use the gummiboot efi boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.timeout = 0; - boot.loader.efi.canTouchEfiVariables = true; - boot.initrd.luks.devices = [ - { - device = "/dev/sda2"; - name = "crypt"; - preLVM = true; - allowDiscards = true; - } - ]; - boot.kernelModules = ["tp_smapi" "thinkpad_acpi" "fbcon" "i915"]; - boot.kernelParams = ["quiet" "acpi_osi=\"!Windows 2012\""]; - boot.extraModulePackages = [config.boot.kernelPackages.tp_smapi]; - boot.extraModprobeConfig = '' - options i915 enable_rc6=1 - ''; boot.cleanTmpDir = true; - networking.hostName = "aji"; networking.wireless.enable = true; networking.firewall.enable = true; @@ -40,16 +21,6 @@ # defaultLocale = "en_US.UTF-8"; # }; - fileSystems."/" = { - mountPoint = "/"; - device = "/dev/mapper/cryptvg-root"; - fsType = "btrfs"; - options = ["subvol=aji-root" "discard" "compress=lzo"]; - }; - swapDevices = - [ { device = "/dev/mapper/cryptvg-swap"; } - ]; - # Set your time zone. time.timeZone = "America/New_York"; @@ -111,29 +82,13 @@ extraOptions = ["-r"]; }; - services.tlp.enable = true; - services.tlp.extraConfig = '' - SATA_LINKPWR_ON_BAT=max_performance - ''; - # Enable the X11 windowing system. services.xserver.enable = true; services.xserver.windowManager.xmonad.enable = true; services.xserver.windowManager.xmonad.enableContribAndExtras = true; - #services.xserver.windowManager.xmonad.extraPackages = - #haskellPackages: [ - # haskellPackages.xmonad-contrib]; - # services.xserver.windowManager.awesome.enable = true; - # services.xserver.windowManager.i3.enable = true; - # services.xserver.displayManager.slim = { - # enable = true; - # autoLogin = true; - # defaultUser = "orbekk"; - # }; services.xserver.layout = "us"; services.xserver.xkbVariant = "dvorak"; - services.xserver.xkbModel = "thinkpad60"; users = { defaultUserShell = "/run/current-system/sw/bin/fish"; @@ -147,9 +102,6 @@ }; }; - # The NixOS release to be compatible with for stateful data such as databases. - system.stateVersion = "16.03"; - nix.maxJobs = 4; nix.buildCores = 4; nix.useSandbox = true; |