From 0f2c55992677e78d5d2908d0648e410ef9b27436 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2017 13:59:19 +0200 Subject: Organise modules into folders --- marvin.nix | 45 ++++++++-------- modules/accounting.nix | 10 ---- modules/adb.nix | 9 ---- modules/audio.nix | 12 ----- modules/bare-metal.nix | 18 ------- modules/berlin.nix | 8 --- modules/british-english.nix | 4 -- modules/colemak.nix | 17 ------ modules/configuration/berlin.nix | 8 +++ modules/configuration/british-english.nix | 4 ++ modules/configuration/nix.nix | 25 +++++++++ modules/configuration/user.nix | 11 ++++ modules/connman.nix | 14 ----- modules/dev.nix | 19 ------- modules/development/base.nix | 19 +++++++ modules/development/javascript.nix | 15 ++++++ modules/development/lisp.nix | 11 ++++ modules/dotfiles.nix | 13 ----- modules/gnome.nix | 24 --------- modules/grub2.nix | 13 ----- modules/hardware/adb.nix | 9 ++++ modules/hardware/audio.nix | 12 +++++ modules/hardware/bare-metal.nix | 18 +++++++ modules/hardware/colemak.nix | 17 ++++++ modules/hardware/connman.nix | 14 +++++ modules/hardware/grub2.nix | 13 +++++ modules/hardware/hidpi.nix | 9 ++++ modules/hardware/intel-gpu.nix | 14 +++++ modules/hardware/laptop.nix | 77 +++++++++++++++++++++++++++ modules/hardware/network-manager.nix | 10 ++++ modules/hardware/nitrokey.nix | 26 +++++++++ modules/hardware/printing.nix | 8 +++ modules/hardware/synaptics.nix | 27 ++++++++++ modules/hardware/systemd-boot.nix | 10 ++++ modules/hardware/thinkpad.nix | 36 +++++++++++++ modules/hardware/trackball.nix | 13 +++++ modules/hidpi.nix | 9 ---- modules/i3.nix | 16 ------ modules/infrastructure.nix | 9 ---- modules/intel-gpu.nix | 14 ----- modules/javascript.nix | 15 ------ modules/laptop.nix | 77 --------------------------- modules/lisp.nix | 11 ---- modules/machines/t470s.nix | 25 +++++++++ modules/machines/x250.nix | 37 +++++++++++++ modules/network-manager.nix | 10 ---- modules/nitrokey.nix | 26 --------- modules/nix.nix | 25 --------- modules/passwords.nix | 8 --- modules/printing.nix | 8 --- modules/programs/accounting.nix | 10 ++++ modules/programs/dotfiles.nix | 13 +++++ modules/programs/gnome.nix | 24 +++++++++ modules/programs/i3.nix | 16 ++++++ modules/programs/infrastructure.nix | 9 ++++ modules/programs/passwords.nix | 8 +++ modules/programs/shell.nix | 29 ++++++++++ modules/programs/window-manager.nix | 18 +++++++ modules/services/syncthing.nix | 12 +++++ modules/services/xserver.nix | 88 +++++++++++++++++++++++++++++++ modules/services/zeroconf.nix | 7 +++ modules/shell.nix | 29 ---------- modules/synaptics.nix | 27 ---------- modules/syncthing.nix | 12 ----- modules/systemd-boot.nix | 10 ---- modules/t470s.nix | 24 --------- modules/thinkpad.nix | 35 ------------ modules/trackball.nix | 13 ----- modules/user-interface.nix | 2 +- modules/user.nix | 11 ---- modules/window-manager.nix | 18 ------- modules/x250.nix | 39 -------------- modules/xserver.nix | 88 ------------------------------- modules/zeroconf.nix | 7 --- satoshipad.nix | 53 +++++++++---------- 75 files changed, 752 insertions(+), 752 deletions(-) delete mode 100644 modules/accounting.nix delete mode 100644 modules/adb.nix delete mode 100644 modules/audio.nix delete mode 100644 modules/bare-metal.nix delete mode 100644 modules/berlin.nix delete mode 100644 modules/british-english.nix delete mode 100644 modules/colemak.nix create mode 100644 modules/configuration/berlin.nix create mode 100644 modules/configuration/british-english.nix create mode 100644 modules/configuration/nix.nix create mode 100644 modules/configuration/user.nix delete mode 100644 modules/connman.nix delete mode 100644 modules/dev.nix create mode 100644 modules/development/base.nix create mode 100644 modules/development/javascript.nix create mode 100644 modules/development/lisp.nix delete mode 100644 modules/dotfiles.nix delete mode 100644 modules/gnome.nix delete mode 100644 modules/grub2.nix create mode 100644 modules/hardware/adb.nix create mode 100644 modules/hardware/audio.nix create mode 100644 modules/hardware/bare-metal.nix create mode 100644 modules/hardware/colemak.nix create mode 100644 modules/hardware/connman.nix create mode 100644 modules/hardware/grub2.nix create mode 100644 modules/hardware/hidpi.nix create mode 100644 modules/hardware/intel-gpu.nix create mode 100644 modules/hardware/laptop.nix create mode 100644 modules/hardware/network-manager.nix create mode 100644 modules/hardware/nitrokey.nix create mode 100644 modules/hardware/printing.nix create mode 100644 modules/hardware/synaptics.nix create mode 100644 modules/hardware/systemd-boot.nix create mode 100644 modules/hardware/thinkpad.nix create mode 100644 modules/hardware/trackball.nix delete mode 100644 modules/hidpi.nix delete mode 100644 modules/i3.nix delete mode 100644 modules/infrastructure.nix delete mode 100644 modules/intel-gpu.nix delete mode 100644 modules/javascript.nix delete mode 100644 modules/laptop.nix delete mode 100644 modules/lisp.nix create mode 100644 modules/machines/t470s.nix create mode 100644 modules/machines/x250.nix delete mode 100644 modules/network-manager.nix delete mode 100644 modules/nitrokey.nix delete mode 100644 modules/nix.nix delete mode 100644 modules/passwords.nix delete mode 100644 modules/printing.nix create mode 100644 modules/programs/accounting.nix create mode 100644 modules/programs/dotfiles.nix create mode 100644 modules/programs/gnome.nix create mode 100644 modules/programs/i3.nix create mode 100644 modules/programs/infrastructure.nix create mode 100644 modules/programs/passwords.nix create mode 100644 modules/programs/shell.nix create mode 100644 modules/programs/window-manager.nix create mode 100644 modules/services/syncthing.nix create mode 100644 modules/services/xserver.nix create mode 100644 modules/services/zeroconf.nix delete mode 100644 modules/shell.nix delete mode 100644 modules/synaptics.nix delete mode 100644 modules/syncthing.nix delete mode 100644 modules/systemd-boot.nix delete mode 100644 modules/t470s.nix delete mode 100644 modules/thinkpad.nix delete mode 100644 modules/trackball.nix delete mode 100644 modules/user.nix delete mode 100644 modules/window-manager.nix delete mode 100644 modules/x250.nix delete mode 100644 modules/xserver.nix delete mode 100644 modules/zeroconf.nix diff --git a/marvin.nix b/marvin.nix index c3508fb..55a97fd 100644 --- a/marvin.nix +++ b/marvin.nix @@ -2,28 +2,29 @@ { imports = [ ./hardware-configuration.nix - ./modules/systemd-boot.nix - ./modules/audio.nix - ./modules/adb.nix - ./modules/syncthing.nix - ./modules/nitrokey.nix - ./modules/shell.nix - ./modules/dotfiles.nix - ./modules/berlin.nix - ./modules/colemak.nix - ./modules/trackball.nix - ./modules/british-english.nix - ./modules/x250.nix - ./modules/user.nix - ./modules/dev.nix - ./modules/lisp.nix - ./modules/javascript.nix - ./modules/infrastructure.nix - ./modules/accounting.nix - ./modules/passwords.nix - ./modules/network-manager.nix - ./modules/nix.nix - ./modules/i3.nix + + ./modules/configuration/berlin.nix + ./modules/configuration/british-english.nix + ./modules/configuration/nix.nix + ./modules/configuration/user.nix + ./modules/development/base.nix + ./modules/development/javascript.nix + ./modules/development/lisp.nix + ./modules/hardware/adb.nix + ./modules/hardware/audio.nix + ./modules/hardware/colemak.nix + ./modules/hardware/network-manager.nix + ./modules/hardware/nitrokey.nix + ./modules/hardware/systemd-boot.nix + ./modules/hardware/trackball.nix + ./modules/machines/x250.nix + ./modules/programs/accounting.nix + ./modules/programs/dotfiles.nix + ./modules/programs/i3.nix + ./modules/programs/infrastructure.nix + ./modules/programs/passwords.nix + ./modules/programs/shell.nix + ./modules/services/syncthing.nix ]; environment.systemPackages = with pkgs; [ diff --git a/modules/accounting.nix b/modules/accounting.nix deleted file mode 100644 index 5882436..0000000 --- a/modules/accounting.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - aqbanking - ledger - bean-add - beancount - fava - ]; -} diff --git a/modules/adb.nix b/modules/adb.nix deleted file mode 100644 index 8b511f5..0000000 --- a/modules/adb.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ programs.adb.enable = true; - users.groups.adbusers = {}; - - services.udev = { - packages = [ pkgs.android-udev-rules ]; - }; -} diff --git a/modules/audio.nix b/modules/audio.nix deleted file mode 100644 index f504657..0000000 --- a/modules/audio.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.pulseaudio = { - enable = true; - support32Bit = true; - }; - - environment.systemPackages = with pkgs; [ - pamixer - pavucontrol - ]; -} diff --git a/modules/bare-metal.nix b/modules/bare-metal.nix deleted file mode 100644 index b5e0fc7..0000000 --- a/modules/bare-metal.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - fuse_exfat - cryptsetup - dmidecode - hdparm - pciutils - usbutils - ]; - - boot.kernelPackages = pkgs.linuxPackages_4_12; - - boot.tmpOnTmpfs = true; - - fileSystems."/".options = [ "noatime" "nodiratime" ]; - fileSystems."/home".options = [ "noatime" "nodiratime" ]; -} diff --git a/modules/berlin.nix b/modules/berlin.nix deleted file mode 100644 index 246510c..0000000 --- a/modules/berlin.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ time.timeZone = "Europe/Berlin"; - services.redshift = { - latitude = "52.586"; - longitude = "13.300"; - }; -} diff --git a/modules/british-english.nix b/modules/british-english.nix deleted file mode 100644 index 3ff9367..0000000 --- a/modules/british-english.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n.defaultLocale = "en_GB.UTF-8"; -} diff --git a/modules/colemak.nix b/modules/colemak.nix deleted file mode 100644 index 3b1c058..0000000 --- a/modules/colemak.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n.consoleKeyMap = "colemak/en-latin9"; - services.kmscon = { - extraConfig = '' - xkb-model=pc104 - xkb-layout=us - xkb-variant=colemak - xkb-options="altwin:prtsc_rwin" - ''; - }; - services.xserver = { - layout = "us,us"; - xkbVariant = "colemak,"; - xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; - }; -} diff --git a/modules/configuration/berlin.nix b/modules/configuration/berlin.nix new file mode 100644 index 0000000..246510c --- /dev/null +++ b/modules/configuration/berlin.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ time.timeZone = "Europe/Berlin"; + services.redshift = { + latitude = "52.586"; + longitude = "13.300"; + }; +} diff --git a/modules/configuration/british-english.nix b/modules/configuration/british-english.nix new file mode 100644 index 0000000..3ff9367 --- /dev/null +++ b/modules/configuration/british-english.nix @@ -0,0 +1,4 @@ +{ config, pkgs, ... }: + +{ i18n.defaultLocale = "en_GB.UTF-8"; +} diff --git a/modules/configuration/nix.nix b/modules/configuration/nix.nix new file mode 100644 index 0000000..504942e --- /dev/null +++ b/modules/configuration/nix.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: + +{ nix = { + buildCores = 0; + + daemonNiceLevel = 10; + daemonIONiceLevel = 4; + + autoOptimiseStore = true; + gc = { + automatic = true; + options = "--delete-older-than 30d"; + }; + }; + + system.autoUpgrade = { + enable = true; + }; + systemd.services.nixos-upgrade = { + environment.NIXPKGS_ALLOW_UNFREE = "1"; + script = '' + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} + ''; + }; +} diff --git a/modules/configuration/user.nix b/modules/configuration/user.nix new file mode 100644 index 0000000..1b2b674 --- /dev/null +++ b/modules/configuration/user.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ users.extraUsers.alan = { + description = "Alan Pearce"; + isNormalUser = true; + extraGroups = [ "audio" "wheel" "adbusers" "docker" ]; + shell = "/run/current-system/sw/bin/zsh"; + home = "/home/alan"; + uid = 1000; + }; +} diff --git a/modules/connman.nix b/modules/connman.nix deleted file mode 100644 index 0361f9c..0000000 --- a/modules/connman.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, pkgs, ... }: - -{ networking.connman = { - enable = true; - enableVPN = false; - }; - networking.wireless.enable = true; - - environment.systemPackages = with pkgs; [ - cmst - connman-notify - connman_dmenu - ]; -} diff --git a/modules/dev.nix b/modules/dev.nix deleted file mode 100644 index abe5f96..0000000 --- a/modules/dev.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - mercurial - gitAndTools.git-extras - gitAndTools.hub - - editorconfig-core-c - - ag - ripgrep - - httpie - http-prompt - mitmproxy - - nodePackages.js-yaml - ]; -} diff --git a/modules/development/base.nix b/modules/development/base.nix new file mode 100644 index 0000000..abe5f96 --- /dev/null +++ b/modules/development/base.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + mercurial + gitAndTools.git-extras + gitAndTools.hub + + editorconfig-core-c + + ag + ripgrep + + httpie + http-prompt + mitmproxy + + nodePackages.js-yaml + ]; +} diff --git a/modules/development/javascript.nix b/modules/development/javascript.nix new file mode 100644 index 0000000..cc5b89e --- /dev/null +++ b/modules/development/javascript.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ environment.systemPackages = with pkgs; [ + nodejs-8_x + pkgsUnstable.flow + pkgsUnstable.nodePackages.yarn + pkgsUnstable.nodePackages.tern + pkgsUnstable.nodePackages.node2nix + pkgsUnstable.nodePackages.nodemon + ]; +} diff --git a/modules/development/lisp.nix b/modules/development/lisp.nix new file mode 100644 index 0000000..ffaa711 --- /dev/null +++ b/modules/development/lisp.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + ccl + sbcl + lispPackages.quicklisp + + dust + pixie + ]; +} diff --git a/modules/dotfiles.nix b/modules/dotfiles.nix deleted file mode 100644 index eed2223..0000000 --- a/modules/dotfiles.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in -{ environment.systemPackages = with pkgs; [ - git - stow - fzf - pkgsUnstable.ghq - ]; -} diff --git a/modules/gnome.nix b/modules/gnome.nix deleted file mode 100644 index bd78545..0000000 --- a/modules/gnome.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -{ services = { - gnome3 = { - gnome-documents.enable = false; - gnome-user-share.enable = false; - gnome-online-accounts.enable = false; - seahorse.enable = false; - tracker.enable = false; - }; - telepathy.enable = false; - - xserver = { - desktopManager.gnome3 = { - enable = true; - extraGSettingsOverrides = '' - [org.gnome.desktop.input-sources] - sources=[('xkb','${config.services.xserver.layout + (optionalString (config.services.xserver.xkbVariant != "") ("+" + config.services.xserver.xkbVariant))}')] - ''; - }; - }; - }; -} diff --git a/modules/grub2.nix b/modules/grub2.nix deleted file mode 100644 index 70e86e7..0000000 --- a/modules/grub2.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.loader = { - grub = { - enable = true; - splashImage = null; - version = 2; - device = "nodev"; - efiSupport = true; - }; - efi.canTouchEfiVariables = true; - }; -} diff --git a/modules/hardware/adb.nix b/modules/hardware/adb.nix new file mode 100644 index 0000000..8b511f5 --- /dev/null +++ b/modules/hardware/adb.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ programs.adb.enable = true; + users.groups.adbusers = {}; + + services.udev = { + packages = [ pkgs.android-udev-rules ]; + }; +} diff --git a/modules/hardware/audio.nix b/modules/hardware/audio.nix new file mode 100644 index 0000000..f504657 --- /dev/null +++ b/modules/hardware/audio.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ hardware.pulseaudio = { + enable = true; + support32Bit = true; + }; + + environment.systemPackages = with pkgs; [ + pamixer + pavucontrol + ]; +} diff --git a/modules/hardware/bare-metal.nix b/modules/hardware/bare-metal.nix new file mode 100644 index 0000000..b5e0fc7 --- /dev/null +++ b/modules/hardware/bare-metal.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + fuse_exfat + cryptsetup + dmidecode + hdparm + pciutils + usbutils + ]; + + boot.kernelPackages = pkgs.linuxPackages_4_12; + + boot.tmpOnTmpfs = true; + + fileSystems."/".options = [ "noatime" "nodiratime" ]; + fileSystems."/home".options = [ "noatime" "nodiratime" ]; +} diff --git a/modules/hardware/colemak.nix b/modules/hardware/colemak.nix new file mode 100644 index 0000000..3b1c058 --- /dev/null +++ b/modules/hardware/colemak.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: + +{ i18n.consoleKeyMap = "colemak/en-latin9"; + services.kmscon = { + extraConfig = '' + xkb-model=pc104 + xkb-layout=us + xkb-variant=colemak + xkb-options="altwin:prtsc_rwin" + ''; + }; + services.xserver = { + layout = "us,us"; + xkbVariant = "colemak,"; + xkbOptions = "grp:shifts_toggle,altwin:prtsc_rwin"; + }; +} diff --git a/modules/hardware/connman.nix b/modules/hardware/connman.nix new file mode 100644 index 0000000..0361f9c --- /dev/null +++ b/modules/hardware/connman.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ networking.connman = { + enable = true; + enableVPN = false; + }; + networking.wireless.enable = true; + + environment.systemPackages = with pkgs; [ + cmst + connman-notify + connman_dmenu + ]; +} diff --git a/modules/hardware/grub2.nix b/modules/hardware/grub2.nix new file mode 100644 index 0000000..70e86e7 --- /dev/null +++ b/modules/hardware/grub2.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ boot.loader = { + grub = { + enable = true; + splashImage = null; + version = 2; + device = "nodev"; + efiSupport = true; + }; + efi.canTouchEfiVariables = true; + }; +} diff --git a/modules/hardware/hidpi.nix b/modules/hardware/hidpi.nix new file mode 100644 index 0000000..1f4644c --- /dev/null +++ b/modules/hardware/hidpi.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ i18n = { + consoleFont = "ter-v24b"; + consolePackages = with pkgs; [ + terminus_font + ]; + }; +} diff --git a/modules/hardware/intel-gpu.nix b/modules/hardware/intel-gpu.nix new file mode 100644 index 0000000..b44ddad --- /dev/null +++ b/modules/hardware/intel-gpu.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ hardware.opengl.extraPackages = with pkgs; [ + vaapiIntel + ]; + + boot.earlyVconsoleSetup = true; + boot.initrd.kernelModules = [ + "i915" + ]; + boot.kernelModules = [ + "i915" + ]; +} diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix new file mode 100644 index 0000000..55dcbd1 --- /dev/null +++ b/modules/hardware/laptop.nix @@ -0,0 +1,77 @@ +{ config, pkgs, lib, ... }: + +{ boot.kernelModules = [ "coretemp" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + x86_energy_perf_policy + ]; + + hardware = { + bluetooth.enable = true; + }; + + environment.systemPackages = with pkgs; [ + powerstat + powertop + + arandr + autorandr + disper + ]; + + # powerManagement.resumeCommands = '' + # AUTORANDR="autorandr -c" + + # detect_display() + # { + # for X in /tmp/.X11-unix/X*; do + # D="''${X##/tmp/.X11-unix/X}" + # user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}') + # if [ x"$user" != x"" ]; then + # export DISPLAY=":$D" + # /bin/su -c "''${AUTORANDR}" "$user" + # fi + # done + # } + + # case "$1" in + # thaw|resume) + # detect_display + # ;; + # esac + # ''; + + programs.light.enable = true; + + services.logind.extraConfig = '' + IdleAction=suspend + IdleActionSec=600 + ''; + + services.physlock.enable = false; + + services.tlp = { + enable = true; + extraConfig = '' + CPU_SCALING_GOVERNOR_ON_BAT=powersave + ''; + }; + + services.udev.extraRules = '' + # ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/alan/.Xauthority", RUN+="${pkgs.autorandr}/bin/autorandr -c" + ''; + + services.xserver = { + libinput = { + enable = lib.mkDefault true; + naturalScrolling = true; + disableWhileTyping = true; + }; + }; + + systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; + systemd.services.nix-gc.unitConfig.ConditionACPower = true; + + imports = [ + ../user-interface.nix + ]; +} diff --git a/modules/hardware/network-manager.nix b/modules/hardware/network-manager.nix new file mode 100644 index 0000000..b85b8f4 --- /dev/null +++ b/modules/hardware/network-manager.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ networking.networkmanager = { + enable = true; + }; + + environment.systemPackages = with pkgs; [ + networkmanagerapplet + ]; +} diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix new file mode 100644 index 0000000..ac85e35 --- /dev/null +++ b/modules/hardware/nitrokey.nix @@ -0,0 +1,26 @@ +{ config, nixpkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ programs.ssh.startAgent = false; + + services.pcscd.enable = true; + + services.tor = { + enable = true; + client = { + enable = true; + socksListenAddress = "9050 IPv6Traffic"; + }; + torsocks = { + enable = true; + }; + }; + + environment.systemPackages = [ + pkgsUnstable.gnupg + pkgsUnstable.nitrokey-app + ]; +} diff --git a/modules/hardware/printing.nix b/modules/hardware/printing.nix new file mode 100644 index 0000000..beba72e --- /dev/null +++ b/modules/hardware/printing.nix @@ -0,0 +1,8 @@ +{ config, pkgs, lib, ... }: + +{ services.printing.enable = true; + + imports = [ + ../services/zeroconf.nix + ]; +} diff --git a/modules/hardware/synaptics.nix b/modules/hardware/synaptics.nix new file mode 100644 index 0000000..9f075cc --- /dev/null +++ b/modules/hardware/synaptics.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: + +{ services.xserver = { + libinput.enable = false; + synaptics = { + enable = true; + + accelFactor = "0.04"; + + minSpeed = "0.3"; + maxSpeed = "0.6"; + + palmDetect = true; + palmMinWidth = 5; + palmMinZ = 20; + + twoFingerScroll = true; + vertTwoFingerScroll = true; + horizTwoFingerScroll = true; + additionalOptions = '' + Option "RBCornerButton" "3" + Option "VertScrollDelta" "-111" + Option "HorizScrollDelta" "-111" + ''; + }; + }; +} diff --git a/modules/hardware/systemd-boot.nix b/modules/hardware/systemd-boot.nix new file mode 100644 index 0000000..80e79fd --- /dev/null +++ b/modules/hardware/systemd-boot.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ boot.loader.systemd-boot = { + enable = true; + editor = false; # Don't allow modification + }; + boot.loader.efi.canTouchEfiVariables = true; + boot.vesa = true; + boot.earlyVconsoleSetup = true; +} diff --git a/modules/hardware/thinkpad.nix b/modules/hardware/thinkpad.nix new file mode 100644 index 0000000..1e97f06 --- /dev/null +++ b/modules/hardware/thinkpad.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: + +{ boot.kernelModules = [ "tp_smapi" ]; + boot.blacklistedKernelModules = [ "thinkpad_ec" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + # acpi_call + tp_smapi + ]; + + hardware.trackpoint = { + enable = true; + emulateWheel = true; + }; + + services.thinkfan = { + enable = true; + sensor = "/sys/class/thermal/thermal_zone0/temp"; + }; + + services.tlp = { + enable = true; + extraConfig = '' + # Newer Thinkpads have a battery firmware + # it conflicts with TLP if stop thresholds are set + START_CHARGE_THRESH_BAT0=70 + STOP_CHARGE_THRESH_BAT0=80 + START_CHARGE_THRESH_BAT1=70 + STOP_CHARGE_THRESH_BAT1=80 + ''; + }; + + imports = [ + ./bare-metal.nix + ./laptop.nix + ]; +} diff --git a/modules/hardware/trackball.nix b/modules/hardware/trackball.nix new file mode 100644 index 0000000..9aa5abc --- /dev/null +++ b/modules/hardware/trackball.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ services.xserver.config = '' + Section "InputClass" + Identifier "Trackball (No Acceleration)" + MatchIsPointer "yes" + MatchIsTouchpad "no" + MatchProduct "Trackball" + Option "AccelerationProfile" "-1" + Option "AccelerationScheme" "none" + EndSection + ''; +} diff --git a/modules/hidpi.nix b/modules/hidpi.nix deleted file mode 100644 index 1f4644c..0000000 --- a/modules/hidpi.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ i18n = { - consoleFont = "ter-v24b"; - consolePackages = with pkgs; [ - terminus_font - ]; - }; -} diff --git a/modules/i3.nix b/modules/i3.nix deleted file mode 100644 index 3bba3bb..0000000 --- a/modules/i3.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver.windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - }; - - environment.systemPackages = with pkgs; [ - i3status - i3lock-color - ]; - - imports = [ - ./window-manager.nix - ]; -} diff --git a/modules/infrastructure.nix b/modules/infrastructure.nix deleted file mode 100644 index b41816e..0000000 --- a/modules/infrastructure.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - ansible - hugo - - nixops - ]; -} diff --git a/modules/intel-gpu.nix b/modules/intel-gpu.nix deleted file mode 100644 index b44ddad..0000000 --- a/modules/intel-gpu.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.opengl.extraPackages = with pkgs; [ - vaapiIntel - ]; - - boot.earlyVconsoleSetup = true; - boot.initrd.kernelModules = [ - "i915" - ]; - boot.kernelModules = [ - "i915" - ]; -} diff --git a/modules/javascript.nix b/modules/javascript.nix deleted file mode 100644 index cc5b89e..0000000 --- a/modules/javascript.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, pkgs, ... }: - -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in -{ environment.systemPackages = with pkgs; [ - nodejs-8_x - pkgsUnstable.flow - pkgsUnstable.nodePackages.yarn - pkgsUnstable.nodePackages.tern - pkgsUnstable.nodePackages.node2nix - pkgsUnstable.nodePackages.nodemon - ]; -} diff --git a/modules/laptop.nix b/modules/laptop.nix deleted file mode 100644 index c50c28e..0000000 --- a/modules/laptop.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ boot.kernelModules = [ "coretemp" ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - x86_energy_perf_policy - ]; - - hardware = { - bluetooth.enable = true; - }; - - environment.systemPackages = with pkgs; [ - powerstat - powertop - - arandr - autorandr - disper - ]; - - # powerManagement.resumeCommands = '' - # AUTORANDR="autorandr -c" - - # detect_display() - # { - # for X in /tmp/.X11-unix/X*; do - # D="''${X##/tmp/.X11-unix/X}" - # user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}') - # if [ x"$user" != x"" ]; then - # export DISPLAY=":$D" - # /bin/su -c "''${AUTORANDR}" "$user" - # fi - # done - # } - - # case "$1" in - # thaw|resume) - # detect_display - # ;; - # esac - # ''; - - programs.light.enable = true; - - services.logind.extraConfig = '' - IdleAction=suspend - IdleActionSec=600 - ''; - - services.physlock.enable = false; - - services.tlp = { - enable = true; - extraConfig = '' - CPU_SCALING_GOVERNOR_ON_BAT=powersave - ''; - }; - - services.udev.extraRules = '' - # ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/alan/.Xauthority", RUN+="${pkgs.autorandr}/bin/autorandr -c" - ''; - - services.xserver = { - libinput = { - enable = lib.mkDefault true; - naturalScrolling = true; - disableWhileTyping = true; - }; - }; - - systemd.services.nixos-upgrade.unitConfig.ConditionACPower = true; - systemd.services.nix-gc.unitConfig.ConditionACPower = true; - - imports = [ - ./user-interface.nix - ]; -} diff --git a/modules/lisp.nix b/modules/lisp.nix deleted file mode 100644 index ffaa711..0000000 --- a/modules/lisp.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - ccl - sbcl - lispPackages.quicklisp - - dust - pixie - ]; -} diff --git a/modules/machines/t470s.nix b/modules/machines/t470s.nix new file mode 100644 index 0000000..21614f0 --- /dev/null +++ b/modules/machines/t470s.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: + +{ hardware.usbWwan.enable = true; + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + ]; + + boot.blacklistedKernelModules = [ "thinkpad_acpi" ]; + + systemd.services.ModemManager.enable = true; + + hardware.pulseaudio.extraConfig = '' + load-module module-alsa-sink device=hw:0,7 + ''; + + environment.systemPackages = with pkgs; [ + nvme-cli + ]; + + imports = [ + ../hardware/intel-gpu.nix + ../hardware/hidpi.nix + ../hardware/thinkpad.nix + ]; +} diff --git a/modules/machines/x250.nix b/modules/machines/x250.nix new file mode 100644 index 0000000..c527f4d --- /dev/null +++ b/modules/machines/x250.nix @@ -0,0 +1,37 @@ +{ config, pkgs, ... }: + +{ boot.extraModulePackages = with config.boot.kernelPackages; [ + acpi_call + ]; + + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + ]; + + services.xserver.monitorSection = '' + DisplaySize 277 156 + ''; + + services.tlp.extraConfig = '' + # Newer Thinkpads have a battery firmware + # it conflicts with TLP if stop thresholds are set + START_CHARGE_THRESH_BAT0=70 + # STOP_CHARGE_THRESH_BAT0=80 + START_CHARGE_THRESH_BAT1=70 + # STOP_CHARGE_THRESH_BAT1=80 + + DISK_APM_LEVEL_ON_AC="254 254" + DISK_APM_LEVEL_ON_BAT="128 128" + + # One or both of these lines stops disk corruption + # when re-attaching to AC whilst on. + SATA_LINKPWR_ON_BAT=medium_power + SATA_LINKPWR_BLACKLIST="host1" + ''; + + imports = [ + ../hardware/synaptics.nix + ../hardware/intel-gpu.nix + ../hardware/thinkpad.nix + ]; +} diff --git a/modules/network-manager.nix b/modules/network-manager.nix deleted file mode 100644 index b85b8f4..0000000 --- a/modules/network-manager.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ networking.networkmanager = { - enable = true; - }; - - environment.systemPackages = with pkgs; [ - networkmanagerapplet - ]; -} diff --git a/modules/nitrokey.nix b/modules/nitrokey.nix deleted file mode 100644 index ac85e35..0000000 --- a/modules/nitrokey.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, nixpkgs, ... }: - -let - pkgsUnstable = import {}; - # pkgsUnstable = pkgs; -in -{ programs.ssh.startAgent = false; - - services.pcscd.enable = true; - - services.tor = { - enable = true; - client = { - enable = true; - socksListenAddress = "9050 IPv6Traffic"; - }; - torsocks = { - enable = true; - }; - }; - - environment.systemPackages = [ - pkgsUnstable.gnupg - pkgsUnstable.nitrokey-app - ]; -} diff --git a/modules/nix.nix b/modules/nix.nix deleted file mode 100644 index 504942e..0000000 --- a/modules/nix.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, pkgs, ... }: - -{ nix = { - buildCores = 0; - - daemonNiceLevel = 10; - daemonIONiceLevel = 4; - - autoOptimiseStore = true; - gc = { - automatic = true; - options = "--delete-older-than 30d"; - }; - }; - - system.autoUpgrade = { - enable = true; - }; - systemd.services.nixos-upgrade = { - environment.NIXPKGS_ALLOW_UNFREE = "1"; - script = '' - ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} - ''; - }; -} diff --git a/modules/passwords.nix b/modules/passwords.nix deleted file mode 100644 index 8c9d7cf..0000000 --- a/modules/passwords.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ environment.systemPackages = with pkgs; [ - keepassx-community - pass - pwgen - ]; -} diff --git a/modules/printing.nix b/modules/printing.nix deleted file mode 100644 index 3172f33..0000000 --- a/modules/printing.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ services.printing.enable = true; - - imports = [ - ./zeroconf.nix - ]; -} diff --git a/modules/programs/accounting.nix b/modules/programs/accounting.nix new file mode 100644 index 0000000..5882436 --- /dev/null +++ b/modules/programs/accounting.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + aqbanking + ledger + bean-add + beancount + fava + ]; +} diff --git a/modules/programs/dotfiles.nix b/modules/programs/dotfiles.nix new file mode 100644 index 0000000..eed2223 --- /dev/null +++ b/modules/programs/dotfiles.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +let + pkgsUnstable = import {}; + # pkgsUnstable = pkgs; +in +{ environment.systemPackages = with pkgs; [ + git + stow + fzf + pkgsUnstable.ghq + ]; +} diff --git a/modules/programs/gnome.nix b/modules/programs/gnome.nix new file mode 100644 index 0000000..bd78545 --- /dev/null +++ b/modules/programs/gnome.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +with lib; +{ services = { + gnome3 = { + gnome-documents.enable = false; + gnome-user-share.enable = false; + gnome-online-accounts.enable = false; + seahorse.enable = false; + tracker.enable = false; + }; + telepathy.enable = false; + + xserver = { + desktopManager.gnome3 = { + enable = true; + extraGSettingsOverrides = '' + [org.gnome.desktop.input-sources] + sources=[('xkb','${config.services.xserver.layout + (optionalString (config.services.xserver.xkbVariant != "") ("+" + config.services.xserver.xkbVariant))}')] + ''; + }; + }; + }; +} diff --git a/modules/programs/i3.nix b/modules/programs/i3.nix new file mode 100644 index 0000000..3bba3bb --- /dev/null +++ b/modules/programs/i3.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: + +{ services.xserver.windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + }; + + environment.systemPackages = with pkgs; [ + i3status + i3lock-color + ]; + + imports = [ + ./window-manager.nix + ]; +} diff --git a/modules/programs/infrastructure.nix b/modules/programs/infrastructure.nix new file mode 100644 index 0000000..b41816e --- /dev/null +++ b/modules/programs/infrastructure.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + ansible + hugo + + nixops + ]; +} diff --git a/modules/programs/passwords.nix b/modules/programs/passwords.nix new file mode 100644 index 0000000..8c9d7cf --- /dev/null +++ b/modules/programs/passwords.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ environment.systemPackages = with pkgs; [ + keepassx-community + pass + pwgen + ]; +} diff --git a/modules/programs/shell.nix b/modules/programs/shell.nix new file mode 100644 index 0000000..3ea43ad --- /dev/null +++ b/modules/programs/shell.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ programs.zsh = { + enable = true; + promptInit = ""; + }; + programs.bash.enableCompletion = true; + programs.xonsh = { + enable = true; + }; + + environment.systemPackages = with pkgs; [ + vim + pv + file + htop + lsof + iftop + iotop + nmap + netperf + moreutils + psmisc + tree + zip + unzip + telnet + ]; +} diff --git a/modules/programs/window-manager.nix b/modules/programs/window-manager.nix new file mode 100644 index 0000000..c159374 --- /dev/null +++ b/modules/programs/window-manager.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ services.xserver.displayManager = { + lightdm = { + enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ + dmenu + dunst + libnotify # for notify-send + sxhkd + scrot + + perlPackages.FileMimeInfo # xdg-utils uses this when no DE + ]; +} diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix new file mode 100644 index 0000000..5a3e1d6 --- /dev/null +++ b/modules/services/syncthing.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ services.syncthing = { + enable = true; + user = "alan"; + group = "users"; + openDefaultPorts = true; + systemService = true; + useInotify = true; + dataDir = "/home/alan/.config/syncthing"; + }; +} diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix new file mode 100644 index 0000000..2cef678 --- /dev/null +++ b/modules/services/xserver.nix @@ -0,0 +1,88 @@ +{ config, pkgs, ... }: + +{ services.xserver = { + enable = true; + enableCtrlAltBackspace = true; + exportConfiguration = true; + }; + + services.dbus.socketActivated = true; + + environment.sessionVariables = { + XCURSOR_PATH = [ + "${config.system.path}/share/icons" + "$HOME/.icons" + "$HOME/.nix-profile/share/icons/" + ]; + }; + + environment.systemPackages = with pkgs; [ + xorg.xmodmap + xorg.xinit + xorg.xev + xorg.xdpyinfo + xclip + xfontsel + + vanilla-dmz + + hicolor_icon_theme + adapta-gtk-theme + flat-plat + paper-gtk-theme + paper-icon-theme + + arc-icon-theme + tango-icon-theme + + gtk-engine-murrine + gtk_engines + ]; + + fonts = { + enableFontDir = true; + enableDefaultFonts = true; + fontconfig = { + defaultFonts = { + monospace = [ "Liberation Mono" ]; + sansSerif = [ "Liberation Sans" ]; + serif = [ "Liberation Serif" ]; + }; + ultimate = { + enable = true; + # presets: + # ultimate1 ultimate2 ultimate3 ultimate4 ultimate5 osx windowsxp + preset = "ultimate3"; + }; + }; + fonts = with pkgs; [ + cantarell_fonts + carlito + dejavu_fonts + fantasque-sans-mono + fira + fira-code + fira-mono + font-droid + font-awesome-ttf + hack-font + liberation_ttf + mononoki + (nerdfonts.override { + withFont = "Monoid"; + }) + opensans-ttf + paratype-pt-mono + paratype-pt-sans + paratype-pt-serif + roboto + roboto-mono + roboto-slab + source-code-pro + source-sans-pro + source-serif-pro + terminus_font + xorg.fontxfree86type1 + ]; + }; +} diff --git a/modules/services/zeroconf.nix b/modules/services/zeroconf.nix new file mode 100644 index 0000000..aa4b47e --- /dev/null +++ b/modules/services/zeroconf.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ services.avahi = { + enable = true; + nssmdns = true; + }; +} diff --git a/modules/shell.nix b/modules/shell.nix deleted file mode 100644 index 3ea43ad..0000000 --- a/modules/shell.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, pkgs, ... }: - -{ programs.zsh = { - enable = true; - promptInit = ""; - }; - programs.bash.enableCompletion = true; - programs.xonsh = { - enable = true; - }; - - environment.systemPackages = with pkgs; [ - vim - pv - file - htop - lsof - iftop - iotop - nmap - netperf - moreutils - psmisc - tree - zip - unzip - telnet - ]; -} diff --git a/modules/synaptics.nix b/modules/synaptics.nix deleted file mode 100644 index 9f075cc..0000000 --- a/modules/synaptics.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver = { - libinput.enable = false; - synaptics = { - enable = true; - - accelFactor = "0.04"; - - minSpeed = "0.3"; - maxSpeed = "0.6"; - - palmDetect = true; - palmMinWidth = 5; - palmMinZ = 20; - - twoFingerScroll = true; - vertTwoFingerScroll = true; - horizTwoFingerScroll = true; - additionalOptions = '' - Option "RBCornerButton" "3" - Option "VertScrollDelta" "-111" - Option "HorizScrollDelta" "-111" - ''; - }; - }; -} diff --git a/modules/syncthing.nix b/modules/syncthing.nix deleted file mode 100644 index 5a3e1d6..0000000 --- a/modules/syncthing.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ services.syncthing = { - enable = true; - user = "alan"; - group = "users"; - openDefaultPorts = true; - systemService = true; - useInotify = true; - dataDir = "/home/alan/.config/syncthing"; - }; -} diff --git a/modules/systemd-boot.nix b/modules/systemd-boot.nix deleted file mode 100644 index 80e79fd..0000000 --- a/modules/systemd-boot.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.loader.systemd-boot = { - enable = true; - editor = false; # Don't allow modification - }; - boot.loader.efi.canTouchEfiVariables = true; - boot.vesa = true; - boot.earlyVconsoleSetup = true; -} diff --git a/modules/t470s.nix b/modules/t470s.nix deleted file mode 100644 index 394df77..0000000 --- a/modules/t470s.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, pkgs, ... }: - -{ hardware.usbWwan.enable = true; - hardware.firmware = with pkgs; [ - firmwareLinuxNonfree - ]; - - boot.blacklistedKernelModules = [ "thinkpad_acpi" ]; - - systemd.services.ModemManager.enable = true; - - hardware.pulseaudio.extraConfig = '' - load-module module-alsa-sink device=hw:0,7 - ''; - - environment.systemPackages = with pkgs; [ - nvme-cli - ]; - - imports = [ - ./intel-gpu.nix - ./thinkpad.nix - ]; -} diff --git a/modules/thinkpad.nix b/modules/thinkpad.nix deleted file mode 100644 index 38133d7..0000000 --- a/modules/thinkpad.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, pkgs, ... }: - -{ boot.kernelModules = [ "tp_smapi" ]; - boot.blacklistedKernelModules = [ "thinkpad_ec" ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - # acpi_call - tp_smapi - ]; - - hardware.trackpoint = { - enable = true; - emulateWheel = true; - }; - - services.thinkfan = { - enable = true; - sensor = "/sys/class/thermal/thermal_zone0/temp"; - }; - - services.tlp = { - enable = true; - extraConfig = '' - # Newer Thinkpads have a battery firmware - # it conflicts with TLP if stop thresholds are set - START_CHARGE_THRESH_BAT0=70 - STOP_CHARGE_THRESH_BAT0=80 - START_CHARGE_THRESH_BAT1=70 - STOP_CHARGE_THRESH_BAT1=80 - ''; - }; - - imports = [ - ./bare-metal.nix - ]; -} diff --git a/modules/trackball.nix b/modules/trackball.nix deleted file mode 100644 index 9aa5abc..0000000 --- a/modules/trackball.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver.config = '' - Section "InputClass" - Identifier "Trackball (No Acceleration)" - MatchIsPointer "yes" - MatchIsTouchpad "no" - MatchProduct "Trackball" - Option "AccelerationProfile" "-1" - Option "AccelerationScheme" "none" - EndSection - ''; -} diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 09cb2bc..67989a9 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -78,6 +78,6 @@ in }; imports = [ - ./xserver.nix + ./services/xserver.nix ]; } diff --git a/modules/user.nix b/modules/user.nix deleted file mode 100644 index 1b2b674..0000000 --- a/modules/user.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -{ users.extraUsers.alan = { - description = "Alan Pearce"; - isNormalUser = true; - extraGroups = [ "audio" "wheel" "adbusers" "docker" ]; - shell = "/run/current-system/sw/bin/zsh"; - home = "/home/alan"; - uid = 1000; - }; -} diff --git a/modules/window-manager.nix b/modules/window-manager.nix deleted file mode 100644 index c159374..0000000 --- a/modules/window-manager.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver.displayManager = { - lightdm = { - enable = true; - }; - }; - - environment.systemPackages = with pkgs; [ - dmenu - dunst - libnotify # for notify-send - sxhkd - scrot - - perlPackages.FileMimeInfo # xdg-utils uses this when no DE - ]; -} diff --git a/modules/x250.nix b/modules/x250.nix deleted file mode 100644 index e163ec4..0000000 --- a/modules/x250.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, pkgs, ... }: - -{ imports = [ - ./synaptics.nix - ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - acpi_call - ]; - - hardware.firmware = with pkgs; [ - firmwareLinuxNonfree - ]; - - services.xserver.monitorSection = '' - DisplaySize 277 156 - ''; - - services.tlp.extraConfig = '' - # Newer Thinkpads have a battery firmware - # it conflicts with TLP if stop thresholds are set - START_CHARGE_THRESH_BAT0=70 - # STOP_CHARGE_THRESH_BAT0=80 - START_CHARGE_THRESH_BAT1=70 - # STOP_CHARGE_THRESH_BAT1=80 - - DISK_APM_LEVEL_ON_AC="254 254" - DISK_APM_LEVEL_ON_BAT="128 128" - - # One or both of these lines stops disk corruption - # when re-attaching to AC whilst on. - SATA_LINKPWR_ON_BAT=medium_power - SATA_LINKPWR_BLACKLIST="host1" - ''; - - imports = [ - ./intel-gpu.nix - ./thinkpad.nix - ]; -} diff --git a/modules/xserver.nix b/modules/xserver.nix deleted file mode 100644 index 2cef678..0000000 --- a/modules/xserver.nix +++ /dev/null @@ -1,88 +0,0 @@ -{ config, pkgs, ... }: - -{ services.xserver = { - enable = true; - enableCtrlAltBackspace = true; - exportConfiguration = true; - }; - - services.dbus.socketActivated = true; - - environment.sessionVariables = { - XCURSOR_PATH = [ - "${config.system.path}/share/icons" - "$HOME/.icons" - "$HOME/.nix-profile/share/icons/" - ]; - }; - - environment.systemPackages = with pkgs; [ - xorg.xmodmap - xorg.xinit - xorg.xev - xorg.xdpyinfo - xclip - xfontsel - - vanilla-dmz - - hicolor_icon_theme - adapta-gtk-theme - flat-plat - paper-gtk-theme - paper-icon-theme - - arc-icon-theme - tango-icon-theme - - gtk-engine-murrine - gtk_engines - ]; - - fonts = { - enableFontDir = true; - enableDefaultFonts = true; - fontconfig = { - defaultFonts = { - monospace = [ "Liberation Mono" ]; - sansSerif = [ "Liberation Sans" ]; - serif = [ "Liberation Serif" ]; - }; - ultimate = { - enable = true; - # presets: - # ultimate1 ultimate2 ultimate3 ultimate4 ultimate5 osx windowsxp - preset = "ultimate3"; - }; - }; - fonts = with pkgs; [ - cantarell_fonts - carlito - dejavu_fonts - fantasque-sans-mono - fira - fira-code - fira-mono - font-droid - font-awesome-ttf - hack-font - liberation_ttf - mononoki - (nerdfonts.override { - withFont = "Monoid"; - }) - opensans-ttf - paratype-pt-mono - paratype-pt-sans - paratype-pt-serif - roboto - roboto-mono - roboto-slab - source-code-pro - source-sans-pro - source-serif-pro - terminus_font - xorg.fontxfree86type1 - ]; - }; -} diff --git a/modules/zeroconf.nix b/modules/zeroconf.nix deleted file mode 100644 index aa4b47e..0000000 --- a/modules/zeroconf.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, ... }: - -{ services.avahi = { - enable = true; - nssmdns = true; - }; -} diff --git a/satoshipad.nix b/satoshipad.nix index bc92724..56ee7b4 100644 --- a/satoshipad.nix +++ b/satoshipad.nix @@ -3,35 +3,34 @@ { imports = [ ./hardware-configuration.nix + ./private/default.nix + ./modules/base.nix - ./modules/grub2.nix - ./modules/audio.nix - ./modules/adb.nix - ./modules/syncthing.nix - ./modules/hidpi.nix - ./modules/nitrokey.nix - ./modules/shell.nix - ./modules/dotfiles.nix - ./modules/berlin.nix - ./modules/colemak.nix - ./modules/trackball.nix - ./modules/british-english.nix - ./modules/printing.nix - ./modules/t470s.nix - ./modules/user.nix - ./modules/dev.nix - ./modules/lisp.nix - ./modules/javascript.nix + ./modules/configuration/berlin.nix + ./modules/configuration/british-english.nix + ./modules/configuration/nix.nix + ./modules/configuration/user.nix + ./modules/development/base.nix + ./modules/development/javascript.nix + ./modules/development/lisp.nix + ./modules/hardware/adb.nix + ./modules/hardware/audio.nix + ./modules/hardware/colemak.nix + ./modules/hardware/grub2.nix + ./modules/hardware/network-manager.nix + ./modules/hardware/nitrokey.nix + ./modules/hardware/printing.nix + ./modules/hardware/trackball.nix + ./modules/machines/t470s.nix + ./modules/programs/accounting.nix + ./modules/programs/dotfiles.nix + ./modules/programs/gnome.nix + ./modules/programs/i3.nix + ./modules/programs/infrastructure.nix + ./modules/programs/passwords.nix + ./modules/programs/shell.nix ./modules/satoshipay.nix - ./modules/infrastructure.nix - ./modules/accounting.nix - ./modules/passwords.nix - ./modules/network-manager.nix - ./modules/zeroconf.nix - ./modules/nix.nix - ./modules/i3.nix - ./modules/gnome.nix - ./private/default.nix + ./modules/services/syncthing.nix ]; boot.initrd.luks.devices = [ -- cgit 1.4.1