-
-
Save cleverca22/295d8efc424d216b74ac9f56ca34ec29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, config, pkgs, ... }: | |
let | |
doit = pkgs.writeScriptBin "doit" '' | |
#!/bin/sh | |
mkdir -p ~/.config/i3 | |
wget https://gist.githubusercontent.com/anonymous/1fa336e9eb22bf68816246a746f22115/raw/3ed4d5c07690fb03f2ffabae44ad4a69392519eb/config -O ~/.config/i3/config | |
wget https://gist.githubusercontent.com/anonymous/1fa336e9eb22bf68816246a746f22115/raw/3ed4d5c07690fb03f2ffabae44ad4a69392519eb/rofi-pass -O ~/.bin/rofi-pass | |
chmod +x ~/.bin/rofi-pass | |
sudo systemctl restart display-manager | |
''; | |
in { | |
virtualisation.writableStore = true; | |
boot.loader.grub.device = "/dev/sda"; | |
boot.loader.grub.efiInstallAsRemovable = true; | |
boot.loader.grub.efiSupport = true; | |
environment = { | |
shellInit = '' | |
export XDG_CONFIG_HOME="$HOME/.config" | |
export XDG_CACHE_HOME="$HOME/.cache" | |
export XDG_DATA_HOME="$HOME/.data" | |
export PATH="$HOME/.bin:$PATH" | |
export PATH="$HOME/.cargo/bin:$PATH" | |
export PROMPT_DIRTRIM=2 | |
export HISTFILE="$XDG_CACHE_HOME/bash/history" | |
export HISTSIZE="10000" | |
export HISTFILESIZE=500000 | |
export HISTCONTROL="erasedups:ignoreboth" | |
export HISTIGNORE="&:[ ]*:exit:ls:cd:date:bg:fg:history:clear" | |
export INPUTRC="$XDG_CONFIG_HOME/inputrc" | |
export LANG=en_US.UTF-8 | |
export EDITOR="nvim" | |
export VISUAL=$EDITOR | |
export ALTERNATE_EDITOR="" | |
export PAGER="less" | |
export MANPAGER="less -X" | |
export BROWSER="xdg-open" | |
export LESSHISTFILE=/dev/null | |
export GREP_COLOR="1;33" | |
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc" | |
export ELINKS_CONFDIR="$XDG_CONFIG_HOME/elinks" | |
export FINDME=yes | |
# ssh-agent | |
if [[ -d ''${XDG_RUNTIME_DIR:-/run/user/$(id -u)} ]]; then | |
export SSH_AUTH_SOCK=''${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/ssh | |
ssh-add -l &>/dev/null | |
[[ "$?" = 2 ]] && ssh-agent -a "$SSH_AUTH_SOCK" | |
fi | |
''; | |
interactiveShellInit = '' | |
export PS1='\[\e[01;31m\]\u\[\e[m\]@\[\e[01;34m\]\h\[\e[00m\] \w\$ ' | |
''; | |
systemPackages = with pkgs; [ | |
rofi-pass | |
chromium | |
doit | |
ctags | |
emacs | |
fasd | |
gimp | |
git | |
i3 | |
inkscape | |
lxappearance | |
mpv | |
pass | |
pavucontrol | |
pcmanfm | |
rofi | |
sudo | |
termite | |
tmux | |
unzip | |
wget | |
vanilla-dmz | |
xclip | |
xlibs.xmodmap | |
youtube-dl | |
zip | |
]; | |
}; | |
fonts = { | |
enableFontDir = true; | |
enableGhostscriptFonts = true; | |
fontconfig = { | |
ultimate.enable = true; | |
ultimate.preset = "osx"; | |
}; | |
fonts = with pkgs; [ | |
dejavu_fonts | |
liberation_ttf | |
inconsolata | |
iosevka | |
terminus_font | |
]; | |
}; | |
hardware.pulseaudio.enable = true; | |
i18n = { | |
consoleFont = "ter-112n"; | |
consoleKeyMap = "us"; | |
defaultLocale = "en_US.UTF-8"; | |
}; | |
imports = | |
[ | |
]; | |
networking = { | |
firewall.enable = false; | |
hostName = "basilisk"; | |
hosts = { | |
"127.0.0.1" = [ "basilisk" ]; | |
"192.168.1.2" = [ "chimera" ]; | |
"192.168.1.3" = [ "basilisk" ]; | |
}; | |
wireless.enable = false; | |
}; | |
nixpkgs.config = { | |
allowUnfree = true; | |
packageOverrides = pkgs: { | |
rofi-pass = pkgs.callPackage ./rofi-pass.nix {}; | |
}; | |
}; | |
programs = { | |
bash.enableCompletion = true; | |
gnupg.agent.enable = true; | |
ssh.startAgent = true; | |
}; | |
security = { | |
sudo = { | |
enable = true; | |
wheelNeedsPassword = false; | |
}; | |
}; | |
services = { | |
openssh.enable = true; | |
xserver = { | |
enable = true; | |
desktopManager.xterm.enable = false; | |
desktopManager.default = "none"; | |
displayManager = { | |
auto.enable = true; | |
auto.user = "mfiano"; | |
sessionCommands = '' | |
[[ -e $XDG_CONFIG_HOME/xorg/xmodmap ]] && xmodmap $XDG_CONFIG_HOME/xorg/xmodmap | |
[[ -e $XDG_CONFIG_HOME/xorg/xresources ]] && xrdb -merge $XDG_CONFIG_HOME/xorg/xresources | |
''; | |
}; | |
layout = "us"; | |
videoDrivers = [ "nvidia" "intel" "vesa" ]; | |
windowManager = { | |
default = "i3"; | |
i3.enable = true; | |
i3.extraPackages = with pkgs; [ i3status ]; | |
}; | |
}; | |
}; | |
system.stateVersion = "17.09"; | |
time.timeZone = "America/New_York"; | |
users = { | |
users = { | |
mfiano = { | |
extraGroups = [ "wheel" ]; | |
isNormalUser = true; | |
uid = 1000; | |
}; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, writeScriptBin, bashInteractive, rofi, pass, xclip }: | |
writeScriptBin "rofi-pass" '' | |
#!/bin/sh | |
export PATH=${lib.makeBinPath [ bashInteractive rofi pass xclip ]}:$PATH | |
shopt -s nullglob globstar | |
password_files=(~/.data/pass/**/*.gpg) | |
password_files=("''${password_files[@]##*/.data/pass/}") | |
password_files=("''${password_files[@]%.gpg}") | |
password=$(printf '%s\n' "''${password_files[@]}" | rofi -dmenu -p "Search password: " "$@") | |
env > /tmp/vars | |
echo $XDG_DATA_HOME | |
PASSWORD_STORE_DIR=$XDG_DATA_HOME/pass PASSWORD_STORE_X_SELECTION=clipboard pass -c "$password" | |
'' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment