commit 70ae873ac1f1e5b67d4c5cf3f1ae28a1ecea2a7a Author: Matthew Ess Date: Wed Jan 1 16:12:08 2020 -0500 Initial diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/README.md b/README.md new file mode 100644 index 0000000..1f77c5f --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# dotfiles.nix + +nix user configuration with home-manager. + diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..0cb4369 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,128 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + # Overlays + + ]; + + # Use the GRUB 2 boot loader. + # boot.loader.grub.enable = true; + # boot.loader.grub.version = 2; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + # boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + # systemd-boot + boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot.configurationLimit = 64; + boot.loader.efi.canTouchEfiVariables = true; + + boot.earlyVconsoleSetup = true; + + networking.hostName = "nixpad"; # Define your hostname. + networking.networkmanager.enable = true; + networking.networkmanager.wifi.scanRandMacAddress = false; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.enp0s25.useDHCP = true; + networking.interfaces.wlp3s0.useDHCP = true; + networking.interfaces.wwp0s20u4c2i12.useDHCP = true; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + fonts = { + enableDefaultFonts = true; + fonts = with pkgs; [ source-code-pro fira-code ]; + }; + + # Select internationalisation properties. + i18n = { + consoleKeyMap = "us"; + defaultLocale = "en_US.UTF-8"; + }; + + # Set your time zone. + time.timeZone = "America/New_York"; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # System utilities + curl + fish + git + htop + tmux + tree + vim + wget + ]; + + environment.variables = { + EDITOR = "vim"; + BROWSER = "firefox"; + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; + + # Enable fish shell + programs.fish.enable = true; + + # List services that you want to enable: + services = { + openssh.enable = true; + fprintd.enable = true; + printing.enable = true; + geoclue2.enable = true; + xserver = { + enable = true; + layout = "us"; + + # Enable touchpad support. + libinput = { + enable = true; + naturalScrolling = true; + }; + }; + }; + + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.mat = { + isNormalUser = true; + shell = pkgs.fish; + extraGroups = [ + "wheel" # Enable ‘sudo’ for the user. + "networkmanager" + ]; + }; + home-manager.users.mat = import ./home.nix; + + # Don't ask for my password *quite* as often. + security.sudo.extraConfig = "Defaults timestamp_timeout=60"; + + # This value determines the NixOS release with which your system is to be + # compatible, in order to avoid breaking some software such as database + # servers. You should change this only after NixOS release notes say you + # should. + system.stateVersion = "19.09"; # Did you read the comment? + +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..10e8b67 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,30 @@ +# 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" "ehci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/3aad55c2-899f-4af7-a0b4-5aa1c11685a7"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/4A83-BBDF"; + fsType = "vfat"; + }; + + swapDevices = + [{ device = "/dev/disk/by-uuid/d1bbcef9-0948-4618-ba61-06c5cb98c1d7"; }]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..8deda73 --- /dev/null +++ b/home.nix @@ -0,0 +1,163 @@ +{ pkgs, lib, ... }: + +let + name = "Matthew Ess"; + email = "daringseal@gmail.com"; + workEmail = "mess@yelp.com"; + +in { + home = { + packages = with pkgs; [ + # nix utilities + nixfmt + nix-prefetch-git + # command line utilities + ag + jq + tldr + # graphical applications + atom + firefox + enpass + termite + # graphical utilities + clipmenu + dmenu + i3lock-fancy + ]; + file = { + ".config/fish/fishfile".text = '' + laughedelic/pisces + sijad/gitignore + joehillen/to-fish + jethrokuan/z + decors/fish-colored-man + franciscolourenco/done + haslersn/fish-nix-completions + gyakovlev/fish-fzy + joseluisq/gitnow + edc/bass + fishpkg/fish-get + fishpkg/fish-spin + oh-my-fish/plugin-bang-bang + fishpkg/fish-humanize-duration + jorgebucaran/fish-getopts + matthewess/fish-autovenv + ''; + }; + }; + nixpkgs = { config.allowUnfree = true; }; + programs = { + bat.enable = true; + broot.enable = true; + command-not-found.enable = true; + direnv.enable = true; + feh.enable = true; + firefox.enable = true; + fish = { + enable = true; + interactiveShellInit = '' + echo 'ヽ(´ᗜ`)ノ welcome ヽ(´ᗜ`)ノ' + if not functions -q fisher + set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config + curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish + fish -c fisher + end + set VIRTUAL_ENV_DISABLE_PROMPT true + ''; + }; + git = { + enable = true; + userName = "${name}"; + userEmail = "${workEmail}"; + ignores = [ ".*.sw[a-z]" "tags" ]; + extraConfig = { + color.ui = true; + core.editor = "vim"; + push.default = "simple"; + }; + }; + htop = { + enable = true; + highlightBaseName = true; + }; + jq.enable = true; + man.enable = true; + neovim = { + enable = true; + viAlias = true; + vimAlias = true; + plugins = with pkgs.vimPlugins; [ + neovim-sensible + vim-fugitive + vim-surround + nerdtree + nerdtree-git-plugin + vim-colorschemes + lightline-vim + ]; + extraConfig = '' + set shell=/bin/bash + set nocompatible + + set cursorline "highlight current line + set showmatch "highlight matching [{()}] + set tabstop=2 "number of visual spaces per TAB when reading + set softtabstop=2 "number of spaces per TAB when editing + set expandtab "tabs are spaces + set shiftwidth=2 "indents + cmap w!! w !sudo tee >/dev/null % + set ww=<,>,[,] "wrap + + colorscheme Tomorrow-Night-Eighties + "lightline options + let g:lightline = {'colorscheme': 'jellybeans'} + + "view saving + au BufWinLeave ?* mkview 1 + au BufWinEnter ?* silent loadview 1 + + "nerdtree + "show hidden files + let NERDTreeShowHidden=1 + "open on vim open + autocmd vimenter * NERDTree + "switch to editing window + autocmd vimenter * wincmd p + "close if only nerdtree is left + autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif + ''; + }; + ssh.enable = true; + starship.enable = true; + termite.enable = true; + }; + services = { + gnome-keyring.enable = true; + lorri.enable = true; + redshift = { + enable = true; + provider = "geoclue2"; + }; + screen-locker = { + enable = true; + lockCmd = "i3lock-fancy"; + }; + }; + xsession = { + enable = true; + windowManager = { + i3 = { + enable = true; + config = rec { + modifier = "Mod4"; + keybindings = lib.mkOptionDefault { + "${modifier}+c" = "exec 'CM_ONESHOT=1 clipmenud'"; + "${modifier}+v" = "exec clipmenu"; + "${modifier}+Escape" = "exec i3lock-fancy"; + }; + }; + }; + }; + }; +} diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..f7fd44e --- /dev/null +++ b/install.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo ln -s $PWD/configuration.nix /etc/nixos/configuration.nix +sudo ln -s $PWD/hardware-configuration.nix /etc/nixos/hardware-configuration.nix +