From 3cc287e2683537722bdc15694b92c5985f9a1c4f Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 22 Jun 2017 01:10:57 +0200 Subject: Move devhell's machines into machines/ In his configuration he had machine_common.nix which was imported from the other machine_*.nix files. However in order to start modularizing I've converted machine_common.nix into a proper NixOS module which now resides in modules/user/devhell/profiles/base.nix and can be simply activated via: vuizvui.user.devhell.profiles.base.enable = true; Apart from that I've removed the following configuration definitiens from machine_common.nix: nix.binaryCaches = [ "https://headcounter.org/hydra/" "https://cache.nixos.org/" ]; nix.requireSignedBinaryCaches = true; nix.binaryCachePublicKeys = [ "headcounter.org:/7YANMvnQnyvcVB6rgFTdb8p5LG1OTXaO+21CaOSBzg=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; nix.nixPath = lib.mkOptionDefault [ "nixpkgs=/home/dev/git/remote/other_github/nixpkgs" ]; The reason for removing them is because we already handle that via the vuizvui core modules (modules/core/common.nix). I've tested this by evaluating the machines by temporarily setting "allowUnfree = true" (which is part of another module I didn't migrate yet) and it succeeds. Signed-off-by: aszlig Cc: @devhell --- devhell/machines/machine_common.nix | 109 -------------------------------- devhell/machines/machine_eris.nix | 60 ------------------ devhell/machines/machine_skunkworks.nix | 79 ----------------------- devhell/machines/machine_titan.nix | 62 ------------------ machines/default.nix | 5 ++ machines/devhell/eris.nix | 60 ++++++++++++++++++ machines/devhell/skunkworks.nix | 79 +++++++++++++++++++++++ machines/devhell/titan.nix | 62 ++++++++++++++++++ modules/module-list.nix | 1 + modules/user/devhell/profiles/base.nix | 108 +++++++++++++++++++++++++++++++ 10 files changed, 315 insertions(+), 310 deletions(-) delete mode 100644 devhell/machines/machine_common.nix delete mode 100644 devhell/machines/machine_eris.nix delete mode 100644 devhell/machines/machine_skunkworks.nix delete mode 100644 devhell/machines/machine_titan.nix create mode 100644 machines/devhell/eris.nix create mode 100644 machines/devhell/skunkworks.nix create mode 100644 machines/devhell/titan.nix create mode 100644 modules/user/devhell/profiles/base.nix diff --git a/devhell/machines/machine_common.nix b/devhell/machines/machine_common.nix deleted file mode 100644 index b7fb5215..00000000 --- a/devhell/machines/machine_common.nix +++ /dev/null @@ -1,109 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - boot = { - kernelPackages = pkgs.linuxPackages_latest; - cleanTmpDir = true; - }; - - nix = { - buildCores = 0; - useSandbox = true; - binaryCaches = [ - "https://headcounter.org/hydra/" - "https://cache.nixos.org/" - ]; - requireSignedBinaryCaches = true; - binaryCachePublicKeys = [ - "headcounter.org:/7YANMvnQnyvcVB6rgFTdb8p5LG1OTXaO+21CaOSBzg=" - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - ]; - nixPath = lib.mkOptionDefault [ "nixpkgs=/home/dev/git/remote/other_github/nixpkgs" ]; - }; - - time = { - timeZone = "Europe/London"; - }; - - system = { - fsPackages = with pkgs; [ - sshfsFuse - fuse - cryptsetup - ]; - }; - - hardware = { - enableAllFirmware = true; - cpu.intel.updateMicrocode = true; - opengl = { - s3tcSupport = true; - driSupport32Bit = true; - }; - pulseaudio = { - enable = true; - systemWide = false; - }; - }; - - programs = { - ssh = { - startAgent = false; - }; - zsh = { - enable = true; - enableCompletion = true; - }; - bash = { - enableCompletion = true; - promptInit = '' - # Provide a nice prompt. - PROMPT_COLOR="1;31m" - let $UID && PROMPT_COLOR="1;32m" - PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " - if test "$TERM" = "xterm"; then - PS1="\[\033]2;\h:\u:\w\007\]$PS1" - fi - eval `dircolors ~/.dir_colors` - ''; - }; - }; - - environment = { - shells = [ "/run/current-system/sw/bin/zsh" ]; - sessionVariables.TERM = "xterm-256color"; - }; - - fonts = { - fontconfig = { - enable = true; - ultimate = { - enable = true; - }; - }; - enableGhostscriptFonts = true; - enableCoreFonts = true; - fonts = with pkgs; [ - clearlyU - cm_unicode - dejavu_fonts - dosemu_fonts - font-awesome-ttf - freefont_ttf - hack-font - inconsolata - powerline-fonts - proggyfonts - source-code-pro - source-sans-pro - source-serif-pro - terminus_font - tewi-font - ttf_bitstream_vera - ubuntu_font_family - unifont - vistafonts - wqy_microhei - ] ++ lib.filter lib.isDerivation (lib.attrValues lohit-fonts); - }; -} diff --git a/devhell/machines/machine_eris.nix b/devhell/machines/machine_eris.nix deleted file mode 100644 index 60b6944c..00000000 --- a/devhell/machines/machine_eris.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - imports = [ ./machine_common.nix ]; - - boot = { - loader = { - timeout = 2; - systemd-boot = { - enable = true; - }; - - efi.canTouchEfiVariables = true; - }; - - initrd = { - availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" ]; - kernelModules = [ "fuse" ]; - postDeviceCommands = '' - echo noop > /sys/block/sda/queue/scheduler - ''; - }; - - kernelModules = [ "tp_smapi" ]; - extraModulePackages = [ config.boot.kernelPackages.tp_smapi ]; - }; - - hardware = { - opengl = { - extraPackages = [ pkgs.vaapiIntel ]; - }; - }; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/4788e218-db0f-4fd6-916e-e0c484906eb0"; - fsType = "btrfs"; - options = [ - "autodefrag" - "space_cache" - "compress=lzo" - "noatime" - "ssd" - ]; - }; - - swapDevices = [ ]; - - nix = { - maxJobs = 4; - extraOptions = '' - auto-optimise-store = true - ''; - }; - - i18n = { - consoleFont = "lat9w-16"; - consoleKeyMap = "uk"; - defaultLocale = "en_GB.UTF-8"; - }; -} diff --git a/devhell/machines/machine_skunkworks.nix b/devhell/machines/machine_skunkworks.nix deleted file mode 100644 index 12ad9687..00000000 --- a/devhell/machines/machine_skunkworks.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - imports = [ ./machine_common.nix ]; - - boot = { - loader.grub = { - enable = true; - version = 2; - devices = [ - "/dev/disk/by-id/ata-ST31500541AS_6XW0NK21" - "/dev/disk/by-id/ata-ST31500541AS_6XW0P0CW" - "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21PNSAG848626F" - "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21PNSAG848674K" - ]; - }; - - initrd = { - availableKernelModules = [ "ehci_pci" "ahci" "firewire_ohci" "usbhid" "usb_storage" ]; - kernelModules = [ "fuse" ]; - }; - - kernelParams = [ "pci=noaer" ]; - kernelModules = [ "kvm-intel" ]; - extraModulePackages = [ ]; - blacklistedKernelModules = [ "pcspkr" ]; - }; - - hardware = { - opengl = { - extraPackages = [ pkgs.vaapiVdpau ]; - }; - }; - - fileSystems."/" = { - label = "nixos"; - fsType = "btrfs"; - options = [ - "autodefrag" - "space_cache" - "compress=lzo" - "noatime" - "ssd" - ]; - }; - - fileSystems."/home" = { - label = "home"; - fsType = "btrfs"; - options = [ - "autodefrag" - "space_cache" - "compress=lzo" - "noatime" - ]; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/16bd9abd-6af5-4a24-8ea5-58adc51e9641"; } - { device = "/dev/disk/by-uuid/279708cb-f9c3-4a37-a064-80ff85a66f88"; } - { device = "/dev/disk/by-uuid/0c2409c3-e824-4759-a9ad-9bfcea1e73bb"; } - { device = "/dev/disk/by-uuid/3f1835a8-5587-4963-9b6c-66ecb36059de"; } - ]; - - nix.maxJobs = 8; - - i18n = { - consoleFont = "lat9w-16"; - consoleKeyMap = "dvorak"; - defaultLocale = "en_US.UTF-8"; - }; - - powerManagement.powerUpCommands = '' - ${pkgs.hdparm}/sbin/hdparm -B 255 \ - /dev/disk/by-id/ata-ST31500541AS_6XW0NK21 - ${pkgs.hdparm}/sbin/hdparm -B 255 \ - /dev/disk/by-id/ata-ST31500541AS_6XW0P0CW - ''; -} diff --git a/devhell/machines/machine_titan.nix b/devhell/machines/machine_titan.nix deleted file mode 100644 index 5a0018fb..00000000 --- a/devhell/machines/machine_titan.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - imports = [ ./machine_common.nix ]; - - boot = { - loader = { - timeout = 2; - systemd-boot = { - enable = true; - }; - - efi.canTouchEfiVariables = true; - }; - - initrd = { - availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ]; - kernelModules = [ "fuse" ]; - }; - - kernelModules = [ "kvm-intel" ]; - extraModulePackages = [ ]; - - kernelParams = [ "elevator=noop" ]; - }; - - hardware = { - opengl = { - enable = true; - extraPackages = [ pkgs.libvdpau-va-gl pkgs.vaapiVdpau pkgs.vaapiIntel ]; - }; - }; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/09d1155f-e7dd-4754-ae01-44da2517d5f0"; - fsType = "btrfs"; - options = [ - "autodefrag" - "space_cache" - "compress=lzo" - "noatime" - "ssd" - ]; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/fecde631-8661-4a0e-88e6-5ce5b551847a"; } - ]; - - nix = { - maxJobs = 4; - extraOptions = '' - auto-optimise-store = true - ''; - }; - - i18n = { - consoleFont = "lat9w-16"; - consoleKeyMap = "uk"; - defaultLocale = "en_GB.UTF-8"; - }; -} diff --git a/machines/default.nix b/machines/default.nix index a976bbc4..151576f8 100644 --- a/machines/default.nix +++ b/machines/default.nix @@ -12,6 +12,11 @@ with import ../lib; tyree = callMachine ./aszlig/managed/tyree.nix {}; }; }; + devhell = { + eris = callMachine devhell/eris.nix {}; + skunkworks = callMachine devhell/skunkworks.nix {}; + titan = callMachine devhell/titan.nix {}; + }; labnet = { labtops = callNetwork ./labnet/labtops.nix {}; }; diff --git a/machines/devhell/eris.nix b/machines/devhell/eris.nix new file mode 100644 index 00000000..2aa83b9f --- /dev/null +++ b/machines/devhell/eris.nix @@ -0,0 +1,60 @@ +{ config, pkgs, lib, ... }: + +{ + vuizvui.user.devhell.profiles.base.enable = true; + + boot = { + loader = { + timeout = 2; + systemd-boot = { + enable = true; + }; + + efi.canTouchEfiVariables = true; + }; + + initrd = { + availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" ]; + kernelModules = [ "fuse" ]; + postDeviceCommands = '' + echo noop > /sys/block/sda/queue/scheduler + ''; + }; + + kernelModules = [ "tp_smapi" ]; + extraModulePackages = [ config.boot.kernelPackages.tp_smapi ]; + }; + + hardware = { + opengl = { + extraPackages = [ pkgs.vaapiIntel ]; + }; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/4788e218-db0f-4fd6-916e-e0c484906eb0"; + fsType = "btrfs"; + options = [ + "autodefrag" + "space_cache" + "compress=lzo" + "noatime" + "ssd" + ]; + }; + + swapDevices = [ ]; + + nix = { + maxJobs = 4; + extraOptions = '' + auto-optimise-store = true + ''; + }; + + i18n = { + consoleFont = "lat9w-16"; + consoleKeyMap = "uk"; + defaultLocale = "en_GB.UTF-8"; + }; +} diff --git a/machines/devhell/skunkworks.nix b/machines/devhell/skunkworks.nix new file mode 100644 index 00000000..04ef71e8 --- /dev/null +++ b/machines/devhell/skunkworks.nix @@ -0,0 +1,79 @@ +{ config, pkgs, lib, ... }: + +{ + vuizvui.user.devhell.profiles.base.enable = true; + + boot = { + loader.grub = { + enable = true; + version = 2; + devices = [ + "/dev/disk/by-id/ata-ST31500541AS_6XW0NK21" + "/dev/disk/by-id/ata-ST31500541AS_6XW0P0CW" + "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21PNSAG848626F" + "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21PNSAG848674K" + ]; + }; + + initrd = { + availableKernelModules = [ "ehci_pci" "ahci" "firewire_ohci" "usbhid" "usb_storage" ]; + kernelModules = [ "fuse" ]; + }; + + kernelParams = [ "pci=noaer" ]; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + blacklistedKernelModules = [ "pcspkr" ]; + }; + + hardware = { + opengl = { + extraPackages = [ pkgs.vaapiVdpau ]; + }; + }; + + fileSystems."/" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "autodefrag" + "space_cache" + "compress=lzo" + "noatime" + "ssd" + ]; + }; + + fileSystems."/home" = { + label = "home"; + fsType = "btrfs"; + options = [ + "autodefrag" + "space_cache" + "compress=lzo" + "noatime" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/16bd9abd-6af5-4a24-8ea5-58adc51e9641"; } + { device = "/dev/disk/by-uuid/279708cb-f9c3-4a37-a064-80ff85a66f88"; } + { device = "/dev/disk/by-uuid/0c2409c3-e824-4759-a9ad-9bfcea1e73bb"; } + { device = "/dev/disk/by-uuid/3f1835a8-5587-4963-9b6c-66ecb36059de"; } + ]; + + nix.maxJobs = 8; + + i18n = { + consoleFont = "lat9w-16"; + consoleKeyMap = "dvorak"; + defaultLocale = "en_US.UTF-8"; + }; + + powerManagement.powerUpCommands = '' + ${pkgs.hdparm}/sbin/hdparm -B 255 \ + /dev/disk/by-id/ata-ST31500541AS_6XW0NK21 + ${pkgs.hdparm}/sbin/hdparm -B 255 \ + /dev/disk/by-id/ata-ST31500541AS_6XW0P0CW + ''; +} diff --git a/machines/devhell/titan.nix b/machines/devhell/titan.nix new file mode 100644 index 00000000..605fc714 --- /dev/null +++ b/machines/devhell/titan.nix @@ -0,0 +1,62 @@ +{ config, pkgs, lib, ... }: + +{ + vuizvui.user.devhell.profiles.base.enable = true; + + boot = { + loader = { + timeout = 2; + systemd-boot = { + enable = true; + }; + + efi.canTouchEfiVariables = true; + }; + + initrd = { + availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ]; + kernelModules = [ "fuse" ]; + }; + + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + + kernelParams = [ "elevator=noop" ]; + }; + + hardware = { + opengl = { + enable = true; + extraPackages = [ pkgs.libvdpau-va-gl pkgs.vaapiVdpau pkgs.vaapiIntel ]; + }; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/09d1155f-e7dd-4754-ae01-44da2517d5f0"; + fsType = "btrfs"; + options = [ + "autodefrag" + "space_cache" + "compress=lzo" + "noatime" + "ssd" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/fecde631-8661-4a0e-88e6-5ce5b551847a"; } + ]; + + nix = { + maxJobs = 4; + extraOptions = '' + auto-optimise-store = true + ''; + }; + + i18n = { + consoleFont = "lat9w-16"; + consoleKeyMap = "uk"; + defaultLocale = "en_GB.UTF-8"; + }; +} diff --git a/modules/module-list.nix b/modules/module-list.nix index 5994dd61..33ac6af6 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -29,6 +29,7 @@ ./user/aszlig/services/slim ./user/aszlig/services/vlock ./user/aszlig/system/kernel.nix + ./user/devhell/profiles/base.nix ./user/openlab/base.nix ./user/openlab/labtops.nix ./user/openlab/stackenblocken.nix diff --git a/modules/user/devhell/profiles/base.nix b/modules/user/devhell/profiles/base.nix new file mode 100644 index 00000000..263206ff --- /dev/null +++ b/modules/user/devhell/profiles/base.nix @@ -0,0 +1,108 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.vuizvui.user.devhell.profiles.base; + +in { + options.vuizvui.user.devhell.profiles.base = { + enable = lib.mkEnableOption "Base profile for devhell"; + }; + + config = lib.mkIf cfg.enable { + boot = { + kernelPackages = pkgs.linuxPackages_latest; + cleanTmpDir = true; + }; + + nix = { + buildCores = 0; + useSandbox = true; + }; + + time = { + timeZone = "Europe/London"; + }; + + system = { + fsPackages = with pkgs; [ + sshfsFuse + fuse + cryptsetup + ]; + }; + + hardware = { + enableAllFirmware = true; + cpu.intel.updateMicrocode = true; + opengl = { + s3tcSupport = true; + driSupport32Bit = true; + }; + pulseaudio = { + enable = true; + systemWide = false; + }; + }; + + programs = { + ssh = { + startAgent = false; + }; + zsh = { + enable = true; + enableCompletion = true; + }; + bash = { + enableCompletion = true; + promptInit = '' + # Provide a nice prompt. + PROMPT_COLOR="1;31m" + let $UID && PROMPT_COLOR="1;32m" + PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " + if test "$TERM" = "xterm"; then + PS1="\[\033]2;\h:\u:\w\007\]$PS1" + fi + eval `dircolors ~/.dir_colors` + ''; + }; + }; + + environment = { + shells = [ "/run/current-system/sw/bin/zsh" ]; + sessionVariables.TERM = "xterm-256color"; + }; + + fonts = { + fontconfig = { + enable = true; + ultimate = { + enable = true; + }; + }; + enableGhostscriptFonts = true; + enableCoreFonts = true; + fonts = with pkgs; [ + clearlyU + cm_unicode + dejavu_fonts + dosemu_fonts + font-awesome-ttf + freefont_ttf + hack-font + inconsolata + powerline-fonts + proggyfonts + source-code-pro + source-sans-pro + source-serif-pro + terminus_font + tewi-font + ttf_bitstream_vera + ubuntu_font_family + unifont + vistafonts + wqy_microhei + ] ++ lib.filter lib.isDerivation (lib.attrValues lohit-fonts); + }; + }; +} -- cgit 1.4.1