summaryrefslogtreecommitdiff
path: root/profiles/core
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2023-10-07 01:33:26 +0200
committerMike Vink <mike1994vink@gmail.com>2023-10-07 01:33:26 +0200
commita2cbf737e78051c2cb10eeaf4a5dccc19d6348ba (patch)
treef53ab92a0c94926e92117891eb87f19cafaa536c /profiles/core
parentcfaef26e8718916adcc68fbfb63b15f2389b2cd2 (diff)
first working
Diffstat (limited to 'profiles/core')
-rw-r--r--profiles/core/git.nix20
-rw-r--r--profiles/core/hm.nix4
-rw-r--r--profiles/core/home.nix221
3 files changed, 122 insertions, 123 deletions
diff --git a/profiles/core/git.nix b/profiles/core/git.nix
new file mode 100644
index 0000000..84b165a
--- /dev/null
+++ b/profiles/core/git.nix
@@ -0,0 +1,20 @@
+{config, ...}: {
+ hm = {
+ programs.git = {
+ enable = true;
+ userName = "Mike Vink";
+ userEmail = "mike1994vink@gmail.com";
+ extraConfig = {
+ worktree.guessRemote = true;
+ mergetool.fugitive.cmd = "vim -f -c \"Gdiff\" \"$MERGED\"";
+ merge.tool = "fugitive";
+ };
+ ignores = [
+ "/.direnv/"
+ "/.envrc"
+ "/.env"
+ ".vimsession.vim"
+ ];
+ };
+ };
+}
diff --git a/profiles/core/hm.nix b/profiles/core/hm.nix
index e1a29d6..5e56fed 100644
--- a/profiles/core/hm.nix
+++ b/profiles/core/hm.nix
@@ -1,7 +1,7 @@
-{inputs, config, lib, ...}: {
+{inputs, config, lib, ...}: with lib; {
imports = [
inputs.home-manager.nixosModules.default
- (mkAliasOptionModule [ "hm" ] [ "home-manager" "users" my.username ])
+ (mkAliasOptionModule [ "hm" ] [ "home-manager" "users" "mike" ])
];
system.extraDependencies = collectFlakeInputs inputs.home-manager;
diff --git a/profiles/core/home.nix b/profiles/core/home.nix
index 5d57f76..4399fe9 100644
--- a/profiles/core/home.nix
+++ b/profiles/core/home.nix
@@ -1,41 +1,38 @@
-{
+ {
inputs,
config,
pkgs,
...
}: {
- programs.home-manager.enable = true;
- home.homeDirectory = "/home/${username}";
- home.username = username;
- home.stateVersion = "23.05";
- fonts.fontconfig.enable = true;
- xdg = {
- enable = true;
- configFile = with config.lib.meta; {
- "emacs/init.el".source = mkMutableSymlink ./emacs/init.el;
- };
- mimeApps = {
+ hm = {
+ fonts.fontconfig.enable = true;
+ xdg = {
+ enable = true;
+ configFile = with config.lib.meta; {
+ "emacs/init.el".source = mkMutableSymlink ./emacs/init.el;
+ };
+ mimeApps = {
enable = true;
defaultApplications = {
- "text/x-shellscript" = ["text.desktop"];
- "x-scheme-handler/magnet" = ["torrent.desktop"];
- "application/x-bittorrent" = ["torrent.desktop"];
- "x-scheme-handler/mailto" = ["mail.desktop"];
- "text/plain" = ["text.desktop"];
- "application/postscript" = ["pdf.desktop"];
- "application/pdf" = ["pdf.desktop"];
- "image/png" = ["img.desktop"];
- "image/jpeg" = ["img.desktop"];
- "image/gif" = ["img.desktop"];
- "application/rss+xml" = ["rss.desktop"];
- "video/x-matroska" = ["video.desktop"];
- "video/mp4" = ["video.desktop"];
- "x-scheme-handler/lbry" = ["lbry.desktop"];
- "inode/directory" = ["file.desktop"];
+ "text/x-shellscript" = ["text.desktop"];
+ "x-scheme-handler/magnet" = ["torrent.desktop"];
+ "application/x-bittorrent" = ["torrent.desktop"];
+ "x-scheme-handler/mailto" = ["mail.desktop"];
+ "text/plain" = ["text.desktop"];
+ "application/postscript" = ["pdf.desktop"];
+ "application/pdf" = ["pdf.desktop"];
+ "image/png" = ["img.desktop"];
+ "image/jpeg" = ["img.desktop"];
+ "image/gif" = ["img.desktop"];
+ "application/rss+xml" = ["rss.desktop"];
+ "video/x-matroska" = ["video.desktop"];
+ "video/mp4" = ["video.desktop"];
+ "x-scheme-handler/lbry" = ["lbry.desktop"];
+ "inode/directory" = ["file.desktop"];
};
- };
- mime.enable = true;
- desktopEntries = {
+ };
+ mime.enable = true;
+ desktopEntries = {
text= { type = "Application"; name = "Text editor"; exec = "${pkgs.st}/bin/st -e kak %u"; };
file = { type = "Application"; name = "File Manager"; exec = "${pkgs.st}/bin/st -e lfub %u"; };
torrent = { type = "Application"; name = "Torrent"; exec = "${pkgs.coreutils}/bin/env transadd %U"; };
@@ -44,39 +41,39 @@
mail = { type = "Application"; name = "Mail"; exec = "${pkgs.st}/bin/st -e neomutt %u"; };
pdf = { type = "Application"; name = "PDF reader"; exec = "${pkgs.zathura}/bin/zathura %u"; };
rss = { type = "Application"; name = "RSS feed addition"; exec = "${pkgs.coreutils}/bin/env rssadd %u"; };
+ };
};
- };
- programs.ssh = {
- enable = true;
- matchBlocks = {
- "*" = {
- identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519";
+ programs.ssh = {
+ enable = true;
+ matchBlocks = {
+ "*" = {
+ identityFile = "${config.users.users.mike.home}/.ssh/id_ed25519";
+ };
};
};
- };
- home.sessionVariables = {
- EDITOR = "kak";
- TERMINAL = "st";
- };
+ home.sessionVariables = {
+ EDITOR = "kak";
+ TERMINAL = "st";
+ };
- home.sessionPath = [
- "${config.home.homeDirectory}/.krew/bin"
- "${config.home.homeDirectory}/.cargo/bin"
- "${pkgs.ncurses}/bin"
- ];
+ home.sessionPath = [
+ "${config.users.users.mike.home}/.krew/bin"
+ "${config.users.users.mike.home}/.cargo/bin"
+ "${pkgs.ncurses}/bin"
+ ];
- programs.starship.enable = true;
+ programs.starship.enable = true;
- programs.direnv = {
- enable = true;
- nix-direnv.enable = true;
- };
+ programs.direnv = {
+ enable = true;
+ nix-direnv.enable = true;
+ };
- programs.readline = {
- enable = true;
- extraConfig = ''
+ programs.readline = {
+ enable = true;
+ extraConfig = ''
$if mode=vi
set keymap vi-command
@@ -88,16 +85,16 @@
Control-l: clear-screen
$endif
'';
- };
+ };
- programs.emacs = {
- enable = true;
- package = pkgs.emacs29;
- };
+ programs.emacs = {
+ enable = true;
+ package = pkgs.emacs29;
+ };
- programs.tmux = {
- enable = true;
- extraConfig = ''
+ programs.tmux = {
+ enable = true;
+ extraConfig = ''
set-option -g default-shell ${pkgs.bashInteractive}/bin/bash
set -s set-clipboard on
setw -g mouse on
@@ -109,7 +106,7 @@
# set -g prefix C-space
# bind C-space send-prefix
- bind-key R source ${config.xdg.configHome}/tmux/tmux.conf; display-message "sourced ${config.xdg.configHome}/tmux/tmux.conf!"
+ bind-key R source ${config.hm.xdg.configHome}/tmux/tmux.conf; display-message "sourced ${config.hm.xdg.configHome}/tmux/tmux.conf!"
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send -X begin-selection
@@ -137,11 +134,11 @@
bind -n C-s run-shell tmux-normal-mode
bind -n C-q run-shell 'tmux-normal-mode --quit'
'';
- };
+ };
- programs.bash = {
- enable = true;
- bashrcExtra = ''
+ programs.bash = {
+ enable = true;
+ bashrcExtra = ''
export PATH=$PATH:$HOME/.local/bin
[[ -f ~/.cache/wal/sequences ]] && (cat ~/.cache/wal/sequences &)
unset LD_PRELOAD
@@ -157,57 +154,38 @@
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
'';
- shellAliases = {
- e = "kakup ";
- es = "kakup -f";
- k9s = "k9s";
- k = "kubectl ";
- d = "docker ";
- ls = "ls --color=auto";
- s = "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/flake#";
- b = "/run/current-system/bin/switch-to-configuration boot";
- h = "home-manager switch --flake ${config.home.homeDirectory}/flake --impure";
- fa = "azdo-switch-project";
- v = "nvim";
- V = "nvim -S .vimsession.vim";
- M = "xrandr --output HDMI1 --auto --output eDP1 --off";
- m = "xrandr --output eDP1 --auto --output HDMI1 --off";
- mM = "xrandr --output eDP1 --auto --output HDMI1 --off";
- newflake = "nix flake new -t ~/flake ";
- ansible-flake = "nix flake new -t ~/flake#ansible ";
- go-flake = "nix flake new -t ~/flake#go ";
- lock-pass = "gpgconf --kill gpg-agent";
- };
- };
-
- programs.nushell.enable = true;
-
- programs.git = {
- enable = true;
- userName = "Mike Vink";
- userEmail = email;
- extraConfig = {
- worktree.guessRemote = true;
- mergetool.fugitive.cmd = "vim -f -c \"Gdiff\" \"$MERGED\"";
- merge.tool = "fugitive";
+ shellAliases = {
+ e = "kakup ";
+ es = "kakup -f";
+ k9s = "k9s";
+ k = "kubectl ";
+ d = "docker ";
+ ls = "ls --color=auto";
+ s = "sudo nixos-rebuild switch --flake ${config.users.users.mike.home}/flake#";
+ b = "/run/current-system/bin/switch-to-configuration boot";
+ h = "home-manager switch --flake ${config.users.users.mike.home}/flake --impure";
+ fa = "azdo-switch-project";
+ v = "nvim";
+ V = "nvim -S .vimsession.vim";
+ M = "xrandr --output HDMI1 --auto --output eDP1 --off";
+ m = "xrandr --output eDP1 --auto --output HDMI1 --off";
+ mM = "xrandr --output eDP1 --auto --output HDMI1 --off";
+ newflake = "nix flake new -t ~/flake ";
+ ansible-flake = "nix flake new -t ~/flake#ansible ";
+ go-flake = "nix flake new -t ~/flake#go ";
+ lock-pass = "gpgconf --kill gpg-agent";
+ };
};
- ignores = [
- "/.direnv/"
- "/.envrc"
- "/.env"
- ".vimsession.vim"
- ];
- };
# https://github.com/drduh/config/blob/master/gpg.conf
# https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration-Options.html
# https://www.gnupg.org/documentation/manuals/gnupg/GPG-Esoteric-Options.html
- programs.gpg = {
- enable = true;
- scdaemonSettings = {
+ programs.gpg = {
+ enable = true;
+ scdaemonSettings = {
disable-ccid = true;
- };
- settings = {
+ };
+ settings = {
personal-cipher-preferences = "AES256 AES192 AES";
personal-digest-preferences = "SHA512 SHA384 SHA256";
personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed";
@@ -228,15 +206,16 @@
no-symkey-cache = true;
use-agent = true;
throw-keyids = true;
+ };
+ };
+ services.gpg-agent = {
+ enable = true;
+ enableSshSupport = true;
+ defaultCacheTtl = 34550000;
+ maxCacheTtl = 34550000;
+ };
+ programs.password-store = {
+ enable = true;
};
- };
- services.gpg-agent = {
- enable = true;
- enableSshSupport = true;
- defaultCacheTtl = 34550000;
- maxCacheTtl = 34550000;
- };
- programs.password-store = {
- enable = true;
};
}