From 14e3fbb489fc172679f3a24327356575c7ff1aeb Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Thu, 22 Dec 2022 15:05:43 +0100 Subject: [PATCH] Add nix home-manager --- .bin/autoinstall | 3 ++ .config/aliasrc | 4 +- .config/environment | 16 ++----- .config/nixpkgs/common.nix | 48 +++++++++++++++++++ .config/nixpkgs/graphical.nix | 37 ++++++++++++++ .config/nixpkgs/home.nix | 1 + .config/zsh/.zshrc | 1 + .../qutebrowser/userscripts/qute-keepassxc | 2 +- .xprofile | 2 + 9 files changed, 100 insertions(+), 14 deletions(-) create mode 100644 .config/nixpkgs/common.nix create mode 100644 .config/nixpkgs/graphical.nix create mode 120000 .config/nixpkgs/home.nix diff --git a/.bin/autoinstall b/.bin/autoinstall index 19e3095..64971e4 100755 --- a/.bin/autoinstall +++ b/.bin/autoinstall @@ -29,6 +29,9 @@ _autoinstall_base () { "https://raw.githubusercontent.com/qw3rtman/git-fire/master/git-fire" \ "$HOME/.local/bin/git-fire" + hm_config="$HOME/.config/nixpkgs" + ln -sf "$hm_config/$(cat /proc/sys/kernel/hostname)-$(whoami).nix" "$hm_config/home.nix" + return 0 } diff --git a/.config/aliasrc b/.config/aliasrc index 587dbf8..d5dcaa2 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -7,7 +7,7 @@ alias :wq='exit' alias aliases='$EDITOR ~/.config/aliasrc && . ~/.config/aliasrc' alias aliases.local='$EDITOR ~/.config/aliasrc.local && . ~/.config/aliasrc' # shellcheck disable=2154 -alias arch-deps2deps='set -a; source PKGBUILD; set +a; sudo pacman -S --asdeps --noconfirm $depends && makepkg -fsi --noconfirm' +alias arch-deps2deps='set -a; source PKGBUILD; set +a; paru -S --asdeps --noconfirm $depends && paru -Ui --rebuild' alias artisan='./artisan' alias bspwm-default='echo "default" > /tmp/bspwm_mode; bspc wm -r' @@ -41,7 +41,7 @@ alias keepass-unlock='(pkill keepassxc; pass keepass | head -n 1 | keepassxc --p alias less='less -FS -x4' alias ls='ls -lFh --color=auto' -alias lsblk='lsblk -o +PARTLABEL,LABEL,FSTYPE,UUID' +alias lsblk='lsblk -o +LABEL,FSTYPE' alias make='make -j5' alias mkdir='mkdir -pv' diff --git a/.config/environment b/.config/environment index 467f65e..7a4eddb 100644 --- a/.config/environment +++ b/.config/environment @@ -22,8 +22,6 @@ export BEMENU_OPTS="--tb '#6272a4'\ --scf '#ff79c6'\ --list 25 --ignorecase -p ''" -export CM_LAUNCHER='rofi' - export DOCKER_BUILDKIT=1 export DRONE_SERVER='https://ci.serguzim.me' @@ -37,7 +35,7 @@ export HOSTNAME="$_hostname" export KUBECONFIG="$HOME/.kube/config" -export LOCALE_ARCHIVE="/usr/lib/locale/locale-archive" +#export LOCALE_ARCHIVE="/usr/lib/locale/locale-archive" export MAILCAPS="$XDG_CONFIG_HOME/mailcap/mailcaprc" _makeflags=$(grep -c ^processor /proc/cpuinfo) @@ -82,13 +80,9 @@ export ZSH="$ZDOTDIR/oh-my-zsh" [ -x "$(command -v moar)" ] && export MANPAGER="moar" [ -x "$(command -v moar)" ] && export PAGER="moar" -if [ -x "$(command -v home-manager)" ] && [ -x "$(command -v nix)" ] -then - [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ] \ - && . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" - - [ -d "$HOME/.nix-profile/share" ] \ - && export XDG_DATA_DIRS="$HOME/.nix-profile/share:$XDG_DATA_DIRS" -fi +[ -x "$(command -v home-manager)" ] \ + && [ -x "$(command -v nix)" ] \ + && [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ] \ + && . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" [ -f "$HOME/.config/environment.local" ] && . "$HOME/.config/environment.local" diff --git a/.config/nixpkgs/common.nix b/.config/nixpkgs/common.nix new file mode 100644 index 0000000..c70eb51 --- /dev/null +++ b/.config/nixpkgs/common.nix @@ -0,0 +1,48 @@ +{ config, pkgs, ... }: + +{ + # Packages that should be installed to the user profile. + home.packages = with pkgs; [ + bat # cat-alternative + direnv # tool to load custom environments + docker-credential-helpers + exa # ls-alternative + faas-cli # cli for openfaas + git # git + gitflow # tool for git workflow + git-lfs # git support for large files + jq # tool for JSON + moar # moar is less + nix-direnv # allow better nix and direnv integration + openssh # ssh client and server + pass # password-store + playerctl # control media players + rclone # tool for remote storages + restic # backup tool + ripgrep # grep-alternative + trash-cli # rm wrapper to use trash-bin + shellcheck # tool for shell-syntax + spotifyd # spotify-daemon + tokei # project-language statistics + unzip # unzip + vimHugeX # vim with clipboard support + yq # tool for YAML + yt-dlp # tool to download videos from the internet + zip # zip + ]; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "22.11"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + targets.genericLinux.enable = true; +} diff --git a/.config/nixpkgs/graphical.nix b/.config/nixpkgs/graphical.nix new file mode 100644 index 0000000..96a9146 --- /dev/null +++ b/.config/nixpkgs/graphical.nix @@ -0,0 +1,37 @@ +{ config, pkgs, ... }: + +{ + # Packages that should be installed to the user profile. + home.packages = with pkgs; [ + #alacritty # terminal emulator + bc # calculator (bsp-layout dependency) + bsp-layout # automatic layouts for bpswm + ckb-next # corsair hardware control + conky # shows stuff on the wallpaper + dunst # notification-daemon + feh # image viewer and wallpaper-tool + flameshot # screenshot tool + helvum # Pipewire GUI + parcellite # clipboard-manager + pavucontrol # Pulseaudio GUI + solaar # Logitech tool + #vagrant # tool for automated virtual machines + #virtualbox # tool for virtual machines + xclip # clipboard CLI for X + ]; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "22.11"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + targets.genericLinux.enable = true; +} diff --git a/.config/nixpkgs/home.nix b/.config/nixpkgs/home.nix new file mode 120000 index 0000000..43c554f --- /dev/null +++ b/.config/nixpkgs/home.nix @@ -0,0 +1 @@ +/home/tobias/.config/nixpkgs/portalo-tobias.nix \ No newline at end of file diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index d3a1a29..8621174 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -123,4 +123,5 @@ source source-remote-file \ "https://raw.githubusercontent.com/dracula/zsh-syntax-highlighting/master/zsh-syntax-highlighting.sh" \ "dracula-syntax-highlighting" +[ -x "$(command -v direnv)" ] && eval "$(direnv hook zsh)" [ -x "$(command -v starship)" ] && eval "$(starship init zsh)" diff --git a/.local/share/qutebrowser/userscripts/qute-keepassxc b/.local/share/qutebrowser/userscripts/qute-keepassxc index 466d856..dd5e535 100755 --- a/.local/share/qutebrowser/userscripts/qute-keepassxc +++ b/.local/share/qutebrowser/userscripts/qute-keepassxc @@ -96,7 +96,7 @@ def parse_args(): help='GPG key to encrypt KeepassXC auth key with') parser.add_argument('--insecure', action='store_true', help="Do not encrypt auth key") - parser.add_argument('--dmenu-invocation', '-d', default='rofi -dmenu', + parser.add_argument('--dmenu-invocation', '-d', default='bemenu', help='Invocation used to execute a dmenu-provider') parser.add_argument('--only-username', action='store_true', help='Only insert username') diff --git a/.xprofile b/.xprofile index e67d69e..b4630a4 100644 --- a/.xprofile +++ b/.xprofile @@ -8,6 +8,8 @@ setxkbmap de setxkbmap -option caps:none setxkbmap -option compose:menu +xrdb "$HOME/.Xresources" + _autostart() { ### wait for audio