From 31074d797c62f64009375e60b15d4b55a8937cab Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 29 Oct 2015 01:09:54 +0100 Subject: tv config: split stuff into fs and hw --- tv/1systems/cd.nix | 4 +-- tv/1systems/mkdir.nix | 4 +-- tv/1systems/nomic.nix | 9 +------ tv/1systems/rmdir.nix | 4 +-- tv/1systems/wu.nix | 4 +-- tv/2configs/AO753.nix | 39 ----------------------------- tv/2configs/CAC-CentOS-7-64bit.nix | 47 ----------------------------------- tv/2configs/CAC-Developer-1.nix | 6 ----- tv/2configs/CAC-Developer-2.nix | 6 ----- tv/2configs/cryptoroot.nix | 4 --- tv/2configs/fs/CAC-CentOS-7-64bit.nix | 20 +++++++++++++++ tv/2configs/hw/AO753.nix | 46 ++++++++++++++++++++++++++++++++++ tv/2configs/hw/CAC-Developer-1.nix | 8 ++++++ tv/2configs/hw/CAC-Developer-2.nix | 8 ++++++ tv/2configs/hw/CAC.nix | 13 ++++++++++ tv/2configs/hw/w110er.nix | 46 ++++++++++++++++++++++++++++++++++ tv/2configs/w110er.nix | 42 ------------------------------- 17 files changed, 149 insertions(+), 161 deletions(-) delete mode 100644 tv/2configs/AO753.nix delete mode 100644 tv/2configs/CAC-CentOS-7-64bit.nix delete mode 100644 tv/2configs/CAC-Developer-1.nix delete mode 100644 tv/2configs/CAC-Developer-2.nix delete mode 100644 tv/2configs/cryptoroot.nix create mode 100644 tv/2configs/fs/CAC-CentOS-7-64bit.nix create mode 100644 tv/2configs/hw/AO753.nix create mode 100644 tv/2configs/hw/CAC-Developer-1.nix create mode 100644 tv/2configs/hw/CAC-Developer-2.nix create mode 100644 tv/2configs/hw/CAC.nix create mode 100644 tv/2configs/hw/w110er.nix delete mode 100644 tv/2configs/w110er.nix diff --git a/tv/1systems/cd.nix b/tv/1systems/cd.nix index d2b08bef7..69f1300be 100644 --- a/tv/1systems/cd.nix +++ b/tv/1systems/cd.nix @@ -24,8 +24,8 @@ with lib; }; imports = [ - ../2configs/CAC-Developer-2.nix - ../2configs/CAC-CentOS-7-64bit.nix + ../2configs/hw/CAC-Developer-2.nix + ../2configs/fs/CAC-CentOS-7-64bit.nix ../2configs/base.nix #../2configs/consul-server.nix ../2configs/exim-smarthost.nix diff --git a/tv/1systems/mkdir.nix b/tv/1systems/mkdir.nix index f0c7dc2a0..305ea7269 100644 --- a/tv/1systems/mkdir.nix +++ b/tv/1systems/mkdir.nix @@ -37,8 +37,8 @@ in }; imports = [ - ../2configs/CAC-Developer-1.nix - ../2configs/CAC-CentOS-7-64bit.nix + ../2configs/hw/CAC-Developer-1.nix + ../2configs/fs/CAC-CentOS-7-64bit.nix ../2configs/base.nix ../2configs/consul-server.nix ../2configs/exim-smarthost.nix diff --git a/tv/1systems/nomic.nix b/tv/1systems/nomic.nix index 210846215..61f833d41 100644 --- a/tv/1systems/nomic.nix +++ b/tv/1systems/nomic.nix @@ -24,7 +24,7 @@ with lib; }; imports = [ - ../2configs/AO753.nix + ../2configs/hw/AO753.nix ../2configs/base.nix #../2configs/consul-server.nix ../2configs/git.nix @@ -87,13 +87,6 @@ with lib; swapDevices = [ ]; - nix = { - buildCores = 2; - maxJobs = 2; - daemonIONiceLevel = 1; - daemonNiceLevel = 1; - }; - # TODO base boot.tmpOnTmpfs = true; diff --git a/tv/1systems/rmdir.nix b/tv/1systems/rmdir.nix index c52222cd1..f77268b53 100644 --- a/tv/1systems/rmdir.nix +++ b/tv/1systems/rmdir.nix @@ -37,8 +37,8 @@ in }; imports = [ - ../2configs/CAC-Developer-1.nix - ../2configs/CAC-CentOS-7-64bit.nix + ../2configs/hw/CAC-Developer-1.nix + ../2configs/fs/CAC-CentOS-7-64bit.nix ../2configs/base.nix ../2configs/consul-server.nix ../2configs/exim-smarthost.nix diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 586ad1725..65389b662 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -24,7 +24,7 @@ with lib; }; imports = [ - ../2configs/w110er.nix + ../2configs/hw/w110er.nix ../2configs/base.nix #../2configs/consul-client.nix ../2configs/git.nix @@ -389,6 +389,4 @@ with lib; services.tor.enable = true; services.virtualboxHost.enable = true; - # TODO w110er if xserver is enabled - services.xserver.vaapiDrivers = [ pkgs.vaapiIntel ]; } diff --git a/tv/2configs/AO753.nix b/tv/2configs/AO753.nix deleted file mode 100644 index 96167ce01..000000000 --- a/tv/2configs/AO753.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ - ../2configs/smartd.nix - ]; - - boot.loader.grub = { - device = "/dev/sda"; - splashImage = null; - }; - - boot.initrd.availableKernelModules = [ - "ahci" - ]; - - boot.kernelModules = [ - "kvm-intel" - "wl" - ]; - - boot.extraModulePackages = [ - config.boot.kernelPackages.broadcom_sta - ]; - - networking.wireless.enable = true; - - services.logind.extraConfig = '' - HandleHibernateKey=ignore - HandleLidSwitch=ignore - HandlePowerKey=ignore - HandleSuspendKey=ignore - ''; - - nixpkgs.config = { - allowUnfree = false; - allowUnfreePredicate = (x: pkgs.lib.hasPrefix "broadcom-sta-" x.name); - }; -} diff --git a/tv/2configs/CAC-CentOS-7-64bit.nix b/tv/2configs/CAC-CentOS-7-64bit.nix deleted file mode 100644 index 168d1d97b..000000000 --- a/tv/2configs/CAC-CentOS-7-64bit.nix +++ /dev/null @@ -1,47 +0,0 @@ -_: - -{ - boot.loader.grub = { - device = "/dev/sda"; - splashImage = null; - }; - - boot.initrd.availableKernelModules = [ - "ata_piix" - "vmw_pvscsi" - ]; - - fileSystems."/" = { - device = "/dev/centos/root"; - fsType = "xfs"; - }; - - fileSystems."/boot" = { - device = "/dev/sda1"; - fsType = "xfs"; - }; - - swapDevices = [ - { device = "/dev/centos/swap"; } - ]; - - users.extraGroups = { - # ● systemd-tmpfiles-setup.service - Create Volatile Files and Directories - # Loaded: loaded (/nix/store/2l33gg7nmncqkpysq9f5fxyhlw6ncm2j-systemd-217/example/systemd/system/systemd-tmpfiles-setup.service) - # Active: failed (Result: exit-code) since Mon 2015-03-16 10:29:18 UTC; 4s ago - # Docs: man:tmpfiles.d(5) - # man:systemd-tmpfiles(8) - # Process: 19272 ExecStart=/nix/store/2l33gg7nmncqkpysq9f5fxyhlw6ncm2j-systemd-217/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=1/FAILURE) - # Main PID: 19272 (code=exited, status=1/FAILURE) - # - # Mar 16 10:29:17 cd systemd-tmpfiles[19272]: [/usr/lib/tmpfiles.d/legacy.conf:26] Unknown group 'lock'. - # Mar 16 10:29:18 cd systemd-tmpfiles[19272]: Two or more conflicting lines for /var/log/journal configured, ignoring. - # Mar 16 10:29:18 cd systemd-tmpfiles[19272]: Two or more conflicting lines for /var/log/journal/7b35116927d74ea58785e00b47ac0f0d configured, ignoring. - # Mar 16 10:29:18 cd systemd[1]: systemd-tmpfiles-setup.service: main process exited, code=exited, status=1/FAILURE - # Mar 16 10:29:18 cd systemd[1]: Failed to start Create Volatile Files and Directories. - # Mar 16 10:29:18 cd systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state. - # Mar 16 10:29:18 cd systemd[1]: systemd-tmpfiles-setup.service failed. - # warning: error(s) occured while switching to the new configuration - lock.gid = 10001; - }; -} diff --git a/tv/2configs/CAC-Developer-1.nix b/tv/2configs/CAC-Developer-1.nix deleted file mode 100644 index 37bc32afb..000000000 --- a/tv/2configs/CAC-Developer-1.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: - -{ - nix.maxJobs = 1; - sound.enable = false; -} diff --git a/tv/2configs/CAC-Developer-2.nix b/tv/2configs/CAC-Developer-2.nix deleted file mode 100644 index fedb808df..000000000 --- a/tv/2configs/CAC-Developer-2.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: - -{ - nix.maxJobs = 2; - sound.enable = false; -} diff --git a/tv/2configs/cryptoroot.nix b/tv/2configs/cryptoroot.nix deleted file mode 100644 index 04618ac4a..000000000 --- a/tv/2configs/cryptoroot.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: - -{ -} diff --git a/tv/2configs/fs/CAC-CentOS-7-64bit.nix b/tv/2configs/fs/CAC-CentOS-7-64bit.nix new file mode 100644 index 000000000..c9eb97f44 --- /dev/null +++ b/tv/2configs/fs/CAC-CentOS-7-64bit.nix @@ -0,0 +1,20 @@ +_: + +{ + boot.loader.grub = { + device = "/dev/sda"; + }; + fileSystems = { + "/" = { + device = "/dev/centos/root"; + fsType = "xfs"; + }; + "/boot" = { + device = "/dev/sda1"; + fsType = "xfs"; + }; + }; + swapDevices = [ + { device = "/dev/centos/swap"; } + ]; +} diff --git a/tv/2configs/hw/AO753.nix b/tv/2configs/hw/AO753.nix new file mode 100644 index 000000000..acd9ee32b --- /dev/null +++ b/tv/2configs/hw/AO753.nix @@ -0,0 +1,46 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ../smartd.nix + ]; + + boot.loader.grub = { + device = "/dev/sda"; + splashImage = null; + }; + + boot.initrd.availableKernelModules = [ + "ahci" + ]; + + boot.kernelModules = [ + "kvm-intel" + "wl" + ]; + + boot.extraModulePackages = [ + config.boot.kernelPackages.broadcom_sta + ]; + + networking.wireless.enable = true; + + nix = { + buildCores = 2; + maxJobs = 2; + daemonIONiceLevel = 1; + daemonNiceLevel = 1; + }; + + services.logind.extraConfig = '' + HandleHibernateKey=ignore + HandleLidSwitch=ignore + HandlePowerKey=ignore + HandleSuspendKey=ignore + ''; + + nixpkgs.config = { + allowUnfree = false; + allowUnfreePredicate = (x: pkgs.lib.hasPrefix "broadcom-sta-" x.name); + }; +} diff --git a/tv/2configs/hw/CAC-Developer-1.nix b/tv/2configs/hw/CAC-Developer-1.nix new file mode 100644 index 000000000..5143c8359 --- /dev/null +++ b/tv/2configs/hw/CAC-Developer-1.nix @@ -0,0 +1,8 @@ +_: +{ + imports = [ ./CAC.nix ]; + nix = { + buildCores = 1; + maxJobs = 1; + }; +} diff --git a/tv/2configs/hw/CAC-Developer-2.nix b/tv/2configs/hw/CAC-Developer-2.nix new file mode 100644 index 000000000..1b3b102cc --- /dev/null +++ b/tv/2configs/hw/CAC-Developer-2.nix @@ -0,0 +1,8 @@ +_: +{ + imports = [ ./CAC.nix ]; + nix = { + buildCores = 2; + maxJobs = 2; + }; +} diff --git a/tv/2configs/hw/CAC.nix b/tv/2configs/hw/CAC.nix new file mode 100644 index 000000000..9ed18344a --- /dev/null +++ b/tv/2configs/hw/CAC.nix @@ -0,0 +1,13 @@ +_: +{ + boot.initrd.availableKernelModules = [ + "ata_piix" + "vmw_pvscsi" + ]; + boot.loader.grub.splashImage = null; + nix = { + daemonIONiceLevel = 1; + daemonNiceLevel = 1; + }; + sound.enable = false; +} diff --git a/tv/2configs/hw/w110er.nix b/tv/2configs/hw/w110er.nix new file mode 100644 index 000000000..aa8292441 --- /dev/null +++ b/tv/2configs/hw/w110er.nix @@ -0,0 +1,46 @@ +{ pkgs, ... }: + +{ + imports = [ + ../smartd.nix + ]; + + boot.extraModprobeConfig = '' + options kvm_intel nested=1 + ''; + + boot.initrd.availableKernelModules = [ "ahci" ]; + boot.kernelModules = [ "kvm-intel" ]; + + boot.loader.gummiboot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.wireless.enable = true; + + nix = { + buildCores = 4; + maxJobs = 4; + daemonIONiceLevel = 1; + daemonNiceLevel = 1; + }; + + services.logind.extraConfig = '' + HandleHibernateKey=ignore + HandleLidSwitch=ignore + HandlePowerKey=ignore + HandleSuspendKey=ignore + ''; + + services.xserver = { + vaapiDrivers = [ pkgs.vaapiIntel ]; + }; + + system.activationScripts.powertopTunables = '' + echo 1 > /sys/module/snd_hda_intel/parameters/power_save + echo 1500 > /proc/sys/vm/dirty_writeback_centisecs + (cd /sys/bus/pci/devices + for i in *; do + echo auto > $i/power/control # defaults to 'on' + done) + ''; +} diff --git a/tv/2configs/w110er.nix b/tv/2configs/w110er.nix deleted file mode 100644 index e580b2161..000000000 --- a/tv/2configs/w110er.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - ../2configs/smartd.nix - ]; - - boot.extraModprobeConfig = '' - options kvm_intel nested=1 - ''; - - boot.initrd.availableKernelModules = [ "ahci" ]; - boot.kernelModules = [ "kvm-intel" ]; - - boot.loader.gummiboot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.wireless.enable = true; - - nix = { - buildCores = 4; - maxJobs = 4; - daemonIONiceLevel = 1; - daemonNiceLevel = 1; - }; - - services.logind.extraConfig = '' - HandleHibernateKey=ignore - HandleLidSwitch=ignore - HandlePowerKey=ignore - HandleSuspendKey=ignore - ''; - - system.activationScripts.powertopTunables = '' - echo 1 > /sys/module/snd_hda_intel/parameters/power_save - echo 1500 > /proc/sys/vm/dirty_writeback_centisecs - (cd /sys/bus/pci/devices - for i in *; do - echo auto > $i/power/control # defaults to 'on' - done) - ''; -} -- cgit v1.2.3