about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-12-13 11:53:51 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-12-13 11:53:51 +0100
commitfb94b8f1860ba09d892ce7a85e6b90ac103ab410 (patch)
treeb1221ab020fdf790559ee3a07f2b424ca1c30208
parent0b0dde69f51d577cabc8bbc399794e573c080e33 (diff)
downloaddots-fb94b8f1860ba09d892ce7a85e6b90ac103ab410.tar.gz
dots-fb94b8f1860ba09d892ce7a85e6b90ac103ab410.zip
Add x220 config
-rwxr-xr-xmachines/base.nix2
-rw-r--r--machines/x220/configuration.nix123
-rw-r--r--machines/x220/default.nix6
-rwxr-xr-xmachines/x220/hardware-configuration.nix8
-rw-r--r--modules/internet.nix14
-rwxr-xr-xmodules/nur.nix4
6 files changed, 157 insertions, 0 deletions
diff --git a/machines/base.nix b/machines/base.nix
index 61253ae..e56c663 100755
--- a/machines/base.nix
+++ b/machines/base.nix
@@ -8,6 +8,8 @@
     ../users/pn.nix
   ];
 
+  boot.cleanTmpDir = true;
+
   environment.systemPackages = with pkgs; [
     wget vim curl htop file
     stdenv git zip unzip
diff --git a/machines/x220/configuration.nix b/machines/x220/configuration.nix
new file mode 100644
index 0000000..072ebaa
--- /dev/null
+++ b/machines/x220/configuration.nix
@@ -0,0 +1,123 @@
+{ pkgs, ... }:
+
+let
+  busybox_utils = pkgs.stdenv.mkDerivation {
+    name = "strings";
+    unpackPhase = "true";
+    installPhase = ''
+      mkdir -p $out/bin
+      cp ${pkgs.busybox}/bin/strings $out/bin/strings
+      cp ${pkgs.busybox}/bin/telnet $out/bin/telnet
+    '';
+  };
+in
+{
+  imports = [
+    ../base.nix
+    ../pl.nix
+    ../../modules/larbs.nix
+    ../../modules/internet.nix
+    ../../modules/dockd.nix
+    ../../modules/trackpad.nix
+    ../../modules/agetty.nix
+  ];
+
+  boot.plymouth.enable = true;
+
+  networking = {
+    hostName = "x220";
+
+    networkmanager = {
+     enable = true;
+     wifi.backend = "iwd";
+    };
+  };
+
+  nixpkgs.config.allowUnfree = true;
+
+
+  environment.systemPackages = with pkgs; [
+    # Basic tools
+    groff file ssh-ident busybox_utils
+
+    # XORG perfs
+    dunst xclip
+    xwallpaper xdotool
+
+    # UI apps
+    zathura brave sxiv pulsemixer
+    lynx lf arandr wpa_supplicant_gui
+    system-config-printer libreoffice
+    vscodium abook
+
+    # Audio/Video
+    mpd mpc_cli mpv ffmpeg youtube-dl
+
+    # CLIs
+    lm_sensors
+    gitAndTools.gh docker-compose xsel
+    bc libnotify
+    pamixer maim killall
+    quickserve ueberzug chafa
+
+    # Thinkpad utils
+    nur.repos.pn.dockd acpi tpacpi-bat
+
+    wineStaging
+
+  ];
+
+  fonts.fonts = with pkgs; [
+    roboto-slab
+  ];
+
+  programs.gnupg = {
+    agent = {
+      enable = true;
+      enableSSHSupport = true;
+      pinentryFlavor = "gnome3";
+    };
+  };
+
+  programs.browserpass.enable = true;
+  programs.dockd.enable = true;
+
+  virtualisation.docker.enable = true;
+
+  services.udev.packages = [ pkgs.libu2f-host ];
+
+  services.pcscd.enable = true;
+
+  services.agetty = {
+    defaultUser = "pn";
+  };
+
+  services.printing = {
+    enable = true;
+    drivers = [ pkgs.epson_201207w ];
+  };
+  hardware.sane.enable = true;
+
+  services.cron.enable = true;
+  # services.fcron.enable = true;
+
+  services.acpid.enable = true;
+
+  # Battery
+  services.tlp.enable = true;
+
+  services.xserver.wacom = {
+    enable = true;
+  };
+
+  users.users.pn.extraGroups = [ "docker" "scanner" "lp" ];
+
+  security.pam.u2f = {
+    enable = true;
+    cue = true;
+    interactive = true;
+    #control = "required";
+    #control = "requisite";
+  };
+
+}
diff --git a/machines/x220/default.nix b/machines/x220/default.nix
new file mode 100644
index 0000000..cd4010f
--- /dev/null
+++ b/machines/x220/default.nix
@@ -0,0 +1,6 @@
+{
+  imports = [
+    ./hardware-configuration.nix
+    ./configuration.nix
+  ];
+}
diff --git a/machines/x220/hardware-configuration.nix b/machines/x220/hardware-configuration.nix
index 3b34522..935e986 100755
--- a/machines/x220/hardware-configuration.nix
+++ b/machines/x220/hardware-configuration.nix
@@ -15,6 +15,14 @@
   boot.kernelModules = [ "kvm-intel" "tp_smapi" ];
   boot.extraModulePackages = with config.boot.kernelPackages; [ tp_smapi ];
 
+
+  boot.loader.grub.enable = true;
+  boot.loader.grub.version = 2;
+  boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
+
+  boot.plymouth.enable = true;
+
+
   fileSystems."/" =
     { device = "/dev/disk/by-uuid/e00c989b-b3fd-469e-b894-ea609fb4d7fa";
       fsType = "ext4";
diff --git a/modules/internet.nix b/modules/internet.nix
new file mode 100644
index 0000000..79365ca
--- /dev/null
+++ b/modules/internet.nix
@@ -0,0 +1,14 @@
+## Basic rules for interacting with the internet
+{ pkgs, ... }:
+{
+  networking.nameservers = [
+    "1.1.1.1"
+    "8.8.8.8"
+  ];
+
+
+  networking.extraHosts = "${ pkgs.stdenv.lib.readFile "${pkgs.fetchurl {
+    url = "https://raw.githubusercontent.com/StevenBlack/hosts/5a5016ab5bf0166e004147cb49ccd0114ed29b72/alternates/fakenews-gambling-porn/hosts";
+    sha256 = "1c60fyzxz89bic6ymcvb8fcanyxpzr8v2z5vixxr79d8mj0vjswm";
+  }}"}";
+}
diff --git a/modules/nur.nix b/modules/nur.nix
index c8326e9..a4c3449 100755
--- a/modules/nur.nix
+++ b/modules/nur.nix
@@ -6,4 +6,8 @@
       inherit pkgs;
     };
   };
+  nix.binaryCaches = [
+    "https://cache.nixos.org"
+    "https://pn.cachix.org"
+  ];
 }