From 111c824354016ccb686d7e7bddb082126e2d8b2b Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 9 Oct 2020 22:42:12 -0500 Subject: [PATCH] Add initial nixos configuration --- apps/kitty/kitty.conf | 2 +- bin/floating-term | 2 +- bin/is_wayland | 3 +- bin/launch | 2 +- env/laptop/hardware.nix | 32 +++++++++++++ env/laptop/sway/config.d/main | 7 +-- env/nix/personal-machine.nix | 88 +++++++++++++++++++++++++++++++++++ 7 files changed, 129 insertions(+), 7 deletions(-) create mode 100644 env/laptop/hardware.nix create mode 100644 env/nix/personal-machine.nix diff --git a/apps/kitty/kitty.conf b/apps/kitty/kitty.conf index b698d2f..d8f9366 100644 --- a/apps/kitty/kitty.conf +++ b/apps/kitty/kitty.conf @@ -1,4 +1,4 @@ -font_family Iosevka Fixed SS07 Medium +font_family Iosevka repaint_delay 5 input_delay 1 diff --git a/bin/floating-term b/bin/floating-term index f07fff9..98680dd 100755 --- a/bin/floating-term +++ b/bin/floating-term @@ -5,7 +5,7 @@ flags=("") case "$TERMINAL" in kitty ) - flags=(-o remember_window_size=no -o initial_window_width=122c -o initial_window_height=24c --class floating_terminal) + flags=(-o remember_window_size=no -o initial_window_width=60c -o initial_window_height=12c --class floating_terminal) ;; # TODO: rxvt? diff --git a/bin/is_wayland b/bin/is_wayland index 60c9321..0bdd24b 100755 --- a/bin/is_wayland +++ b/bin/is_wayland @@ -1,3 +1,4 @@ #!/usr/bin/env bash -loginctl show-session "$(loginctl | grep "$(whoami)" | head -n 1 | field 1)" -p Type | grep -i wayland >/dev/null +exit 0 +# loginctl show-session "$(loginctl | grep "$(whoami)" | head -n 1 | field 1)" -p Type | grep -i wayland >/dev/null diff --git a/bin/launch b/bin/launch index d18fa57..a6681cf 100755 --- a/bin/launch +++ b/bin/launch @@ -7,7 +7,7 @@ app="$( awk 'NF{NF--};1' | \ cat - <(dmenu_path) | \ sort | uniq -c | sort -nr | \ - sd '^\s+' '' | \ + sd -fm '^\s+' '' | \ cut -d' ' -f2- | \ fzf )" diff --git a/env/laptop/hardware.nix b/env/laptop/hardware.nix new file mode 100644 index 0000000..f98b636 --- /dev/null +++ b/env/laptop/hardware.nix @@ -0,0 +1,32 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/d1d92974-c0c0-4566-8131-c3dda9b21122"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/3EB9-C18F"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + # High-DPI console + console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz"; +} diff --git a/env/laptop/sway/config.d/main b/env/laptop/sway/config.d/main index e3e1218..61a3a53 100644 --- a/env/laptop/sway/config.d/main +++ b/env/laptop/sway/config.d/main @@ -2,9 +2,6 @@ exec libinput-gestures -c $DOTFILES_PATH/apps/de/libinput/sway-gestures.conf # exec swayidle -w timeout 300 'swaylock -f -c 000000' timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -f -c 000000' -# TODO: setup displays (when docked for work?) -output eDP-1 res 1600x900 pos 0 0 - bindswitch lid:toggle exec swaylock input type:touchpad { @@ -18,3 +15,7 @@ input type:touchpad { input type:keyboard { xkb_options ctrl:nocaps } + +# TODO: setup displays (when docked for work?) +output eDP-1 res 1600x900 pos 0 0 + diff --git a/env/nix/personal-machine.nix b/env/nix/personal-machine.nix new file mode 100644 index 0000000..ed76038 --- /dev/null +++ b/env/nix/personal-machine.nix @@ -0,0 +1,88 @@ +{ config, pkgs, ... }: + +{ + imports = [ /etc/nixos/hardware-configuration.nix ]; + + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + nixpkgs.config = { + allowUnfree = true; + packageOverrides = pkgs: { + vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + }; + }; + + networking = { + networkmanager.enable = true; + hostName = "third.lyte.dev"; + }; + + i18n.defaultLocale = "en_US.UTF-8"; + console.keyMap = "us"; + + time.timeZone = "America/Chicago"; + + environment = { + systemPackages = with pkgs; [ + wget vim neovim git curl fish bash tmux pciutils usbutils w3m networkmanager sway zsh kitty firefox-devedition-bin ripgrep lightdm fortune sd fzf dmenu ranger nodejs python3 rsync pass brightnessctl wl-clipboard waybar mako vulkan-tools htop rustup clang + ]; + variables = { + EDITOR = "nvim"; + }; + }; + + fonts.fonts = with pkgs; [ iosevka ]; + + hardware = { + pulseaudio = { + enable = true; + support32Bit = true; + }; + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + extraPackages = with pkgs; [ + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + }; + }; + + programs = { + fish.enable = true; + mtr.enable = true; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryFlavor = "curses"; + }; + }; + + services = { + openssh.enable = true; + xserver = { + enable = true; + displayManager.lightdm = { + enable = true; + }; + }; + }; + + networking.firewall.enable = false; + + sound.enable = true; + + users.users.daniel = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + shell = pkgs.fish; + home = "/home/daniel/.home"; + }; + + system.stateVersion = "20.03"; +}