diff --git a/install.sh b/install.sh index 8ba99d9..0d8c5bc 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#/bin/env bash +#!/bin/env bash set -euo pipefail REPO_DIR=$(dirname $(readlink -f $0)) @@ -45,6 +45,7 @@ while [[ $# -gt 0 ]]; do ;; esac done +echo_header "== DotFiles with GUI: $GUI and ENV: $ENVIRONMENT" # Install basic packages. # Most other packages are installed via Home Manager. @@ -143,11 +144,14 @@ fi echo_header "==[host] Installing Home Manager" nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager nix-channel --update -nix-shell '' -A install +NIXPKGS_ALLOW_UNFREE=1 ENVIRONMENT=$ENVIRONMENT nix-shell '' -A install echo_header "==[host] Installing Home Manager packages" workspace_link nix/home.nix .config/home-manager/home.nix -NIXPKGS_ALLOW_UNFREE=1 DOTFILES_ENV=$ENVIRONMENT home-manager switch +workspace_link nix/core.nix .config/home-manager/core.nix +workspace_link nix/personal.nix .config/home-manager/personal.nix +workspace_link nix/work.nix .config/home-manager/work.nix +NIXPKGS_ALLOW_UNFREE=1 ENVIRONMENT=$ENVIRONMENT home-manager switch echo_header "==[host] Use zsh as default shell" sudo chsh $USER --shell=/bin/zsh @@ -155,5 +159,6 @@ sudo chsh $USER --shell=/bin/zsh echo_header "==[host] Plug for neovim" sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' -nvim --headless +'PlugInstall --sync' +qa -nvim --headless +'PlugUpdate --sync' +qa +nvim --headless +PlugInstall +qa +nvim --headless +PlugUpdate +qa +nvim --headless +PlugUpgrade +qa diff --git a/nix/core.nix b/nix/core.nix index 449e301..fcda487 100644 --- a/nix/core.nix +++ b/nix/core.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ lib, config, pkgs, ... }: { # This value determines the Home Manager release that your configuration is @@ -66,6 +66,9 @@ # Kubernetes k9s kubectl + + # Gnome + gnomeExtensions.pop-shell ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage @@ -88,6 +91,11 @@ }; }; + programs.gh = { + enable = true; + gitCredentialHelper.enable = true; + }; + programs.git = { enable = true; userName = "Tine"; @@ -96,6 +104,10 @@ difftastic.enable = true; lfs.enable = true; + includes = [ + { path = "~/.gitconfig.local"; } + ]; + extraConfig = { user = { signingkey = "~/.ssh/id_ed25519"; @@ -109,8 +121,8 @@ format = "ssh"; }; - credentials = { - helper = "libsecret"; + credential = { + helper = "secretservice"; }; init = { diff --git a/nix/home.nix b/nix/home.nix index 95902ac..03f42d8 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -1,21 +1,11 @@ { config, pkgs, home, ... }: -with import { }; -with lib; + let - environment = builtins.getEnv "DOTFILES_ENV"; + environment = builtins.getEnv "ENVIRONMENT"; in { imports = - if environment != "" then - if environment == "personal" then - lib.info "loading PERSONAL home manager environment" - [ ./core.nix ./personal.nix ] - else - if environment == "work" then - lib.info "loading WORK home manager environment" - [ ./core.nix ./work.nix ] - else - lib.warn "DOTFILES_ENV is not one of 'personal' or 'work', ONLY core home environment will be available!" [ ] - else - lib.warn "DOTFILES_ENV not specified, ONLY core home environment will be available!" [ ]; + if environment == "work" + then [ ./core.nix ./work.nix ] + else [ ./core.nix ./personal.nix ]; } diff --git a/nix/work.nix b/nix/work.nix index d71ed0a..1b706fa 100644 --- a/nix/work.nix +++ b/nix/work.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: +{ lib, config, pkgs, ... }: { home.username = "tine"; home.homeDirectory = "/home/tine"; + + programs.git.extraConfig.user.signingkey = lib.mkForce "~/.ssh/id_rsa"; }