From 6e94b3ca2fc18102f46ea6357f7b11235ed3ce63 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 21 Mar 2021 01:48:27 +0200 Subject: feat(tazjin/nixos): Initial check in of new host (tverskoy) This is my new X13 AMD Thinkpad, on which many fun things will be done. Change-Id: I4de114a8c5ebb37d2f4844f407d2dc0e7cc9557e Reviewed-on: https://cl.tvl.fyi/c/depot/+/2620 Tested-by: BuildkiteCI Reviewed-by: tazjin --- users/tazjin/nixos/default.nix | 3 +- users/tazjin/nixos/tverskoy/default.nix | 203 ++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 users/tazjin/nixos/tverskoy/default.nix (limited to 'users') diff --git a/users/tazjin/nixos/default.nix b/users/tazjin/nixos/default.nix index d4576bd3c7..370049859f 100644 --- a/users/tazjin/nixos/default.nix +++ b/users/tazjin/nixos/default.nix @@ -41,6 +41,7 @@ in { camdenSystem = systemFor [ depot.users.tazjin.nixos.camden ]; frogSystem = systemFor [ depot.users.tazjin.nixos.frog ]; + tverskoySystem = systemFor [ depot.users.tazjin.nixos.tverskoy ]; - meta.targets = [ "camdenSystem" "frogSystem" ]; + meta.targets = [ "camdenSystem" "frogSystem" "tverskoySystem" ]; } diff --git a/users/tazjin/nixos/tverskoy/default.nix b/users/tazjin/nixos/tverskoy/default.nix new file mode 100644 index 0000000000..74c676f4e3 --- /dev/null +++ b/users/tazjin/nixos/tverskoy/default.nix @@ -0,0 +1,203 @@ +{ depot, lib, ... }: + +config: let + # add google-c-style here because other machines get it from, eh, + # elsewhere. + emacs = (depot.users.tazjin.emacs.overrideEmacs(epkgs: epkgs ++ [ + depot.third_party.emacsPackages.google-c-style + ])); + + nixpkgs = import depot.third_party.nixpkgsSrc { + config.allowUnfree = true; + }; + + quasselClient = depot.third_party.quassel.override { + client = true; + enableDaemon = false; + monolithic = false; + }; +in lib.fix(self: { + boot = { + initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + kernelPackages = nixpkgs.linuxPackages_latest; + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + }; + + fileSystems = { + "/" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = [ "defaults" "size=4G" "mode=755" ]; + }; + + "/home" = { + device = "zpool/ephemeral/home"; + fsType = "zfs"; + }; + + "/nix" = { + device = "zpool/local/nix"; + fsType = "zfs"; + }; + + "/depot" = { + device = "zpool/safe/depot"; + fsType = "zfs"; + }; + + "/persist" = { + device = "zpool/safe/persist"; + fsType = "zfs"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/BF4F-388B"; + fsType = "vfat"; + }; + }; + + hardware = { + cpu.amd.updateMicrocode = true; + enableRedistributableFirmware = true; + bluetooth.enable = true; + bluetooth.hsphfpd.enable = true; + }; + + networking = { + hostName = "tverskoy"; + hostId = "3c91827f"; + useDHCP = false; + networkmanager.enable = true; + + nameservers = [ + "8.8.8.8" + "8.8.4.4" + ]; + }; + + fonts = { + fonts = with nixpkgs; [ + corefonts + dejavu_fonts + jetbrains-mono + noto-fonts-cjk + noto-fonts-emoji + ]; + + fontconfig = { + hinting.enable = true; + subpixel.lcdfilter = "light"; + + defaultFonts = { + monospace = [ "JetBrains Mono" ]; + }; + }; + }; + + security.rtkit.enable = true; + services = { + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + # redshift.enable = true; + + blueman.enable = true; + + xserver = { + enable = true; + layout = "us"; + xkbOptions = "caps:super"; + videoDrivers = [ "amdgpu" ]; + + libinput.enable = true; + + displayManager = { + # Give EXWM permission to control the session. + sessionCommands = "${nixpkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER"; + lightdm.enable = true; + # lightdm.greeters.gtk.clock-format = "%H:%M"; # TODO(tazjin): TZ? + }; + + windowManager.session = lib.singleton { + name = "exwm"; + start = "${emacs}/bin/tazjins-emacs"; + }; + }; + }; + + # Do not restart the display manager automatically + systemd.services.display-manager.restartIfChanged = lib.mkForce false; + + time.timeZone = "Africa/Cairo"; + + users.users.tazjin = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" ]; + uid = 1000; + shell = nixpkgs.fish; + initialHashedPassword = "$6$d3FywUNCuZnJ4l.$ZW2ul59MLYon1v1xhC3lTJZfZ91lWW6Tpi13MpME0cJcYZNrsx7ABdgQRn.K05awruG2Y9ARAzURnmiJ31WTS1"; + }; + + programs = { + light.enable = true; + }; + + environment.systemPackages = + # programs from the depot + (with depot; [ + emacs + third_party.lieer + tools.nsfv-setup + ]) ++ + + # programs from nixpkgs + (with nixpkgs; [ + bat + chromium + curl + direnv + emacs27-nox # emacsclient + exa + fd + file + gdb + git + gnupg + google-chrome + htop + hyperfine + iftop + imagemagick + jq + manpages + msmtp + networkmanagerapplet + nix-prefetch-github + notmuch + openssh + openssl + pass + pavucontrol + pinentry + pinentry-emacs + pwgen + quasselClient + ripgrep + rustup + screen + scrot + tokei + tree + vlc + xsecurelock + ]); + + system.stateVersion = "20.09"; +}) -- cgit 1.4.1