initial commit
This commit is contained in:
12
home/panotaka/common/core/bash.nix
Normal file
12
home/panotaka/common/core/bash.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
# FIXME(starter): customize your bash preferences here
|
||||
{
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
shellAliases = {
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
'';
|
||||
};
|
||||
}
|
||||
10
home/panotaka/common/core/darwin.nix
Normal file
10
home/panotaka/common/core/darwin.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
# Core home functionality that will only work on Darwin
|
||||
{ config, ... }:
|
||||
{
|
||||
home.sessionPath = [ "/opt/homebrew/bin" ];
|
||||
|
||||
home = {
|
||||
username = config.hostSpec.username;
|
||||
homeDirectory = config.hostSpec.home;
|
||||
};
|
||||
}
|
||||
79
home/panotaka/common/core/default.nix
Normal file
79
home/panotaka/common/core/default.nix
Normal file
@@ -0,0 +1,79 @@
|
||||
#FIXME: Move attrs that will only work on linux to nixos.nix
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
hostSpec,
|
||||
...
|
||||
}: let
|
||||
platform =
|
||||
if hostSpec.isDarwin
|
||||
then "darwin"
|
||||
else "nixos";
|
||||
in {
|
||||
imports = lib.flatten [
|
||||
(map lib.custom.relativeToRoot [
|
||||
"modules/common/host-spec.nix"
|
||||
"modules/home"
|
||||
])
|
||||
./${platform}.nix
|
||||
|
||||
# FIXME(starter): add/edit as desired
|
||||
./fish.nix
|
||||
./bash.nix
|
||||
./direnv.nix
|
||||
./fonts.nix
|
||||
./kitty.nix
|
||||
./git.nix
|
||||
./ssh.nix
|
||||
];
|
||||
|
||||
inherit hostSpec;
|
||||
|
||||
services.ssh-agent.enable = true;
|
||||
|
||||
home = {
|
||||
username = lib.mkDefault config.hostSpec.username;
|
||||
homeDirectory = lib.mkDefault config.hostSpec.home;
|
||||
stateVersion = lib.mkDefault "24.11";
|
||||
sessionPath = [
|
||||
"$HOME/.local/bin"
|
||||
];
|
||||
sessionVariables = {
|
||||
FLAKE = "$HOME/src/nix/nix-config";
|
||||
SHELL = "bash";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = builtins.attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
# FIXME(starter): add/edit as desired
|
||||
# Packages that don't have custom configs go here
|
||||
curl
|
||||
pciutils
|
||||
pfetch # system info
|
||||
pre-commit # git hooks
|
||||
p7zip # compression & encryption
|
||||
usbutils
|
||||
unzip # zip extraction
|
||||
unrar # rar extraction
|
||||
;
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nix;
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Nicely reload system units when changing configs
|
||||
systemd.user.startServices = "sd-switch";
|
||||
}
|
||||
8
home/panotaka/common/core/direnv.nix
Normal file
8
home/panotaka/common/core/direnv.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
nix-direnv.enable = true; # better than native direnv nix functionality - https://github.com/nix-community/nix-direnv
|
||||
};
|
||||
}
|
||||
25
home/panotaka/common/core/fish.nix
Normal file
25
home/panotaka/common/core/fish.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{pkgs, ...}: {
|
||||
home.packages = builtins.attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
grc
|
||||
;
|
||||
};
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting # Disable greeting
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
name = "grc";
|
||||
src = pkgs.fishPlugins.grc.src;
|
||||
}
|
||||
{
|
||||
name = "autopair";
|
||||
src = pkgs.fishPlugins.autopair.src;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
7
home/panotaka/common/core/fonts.nix
Normal file
7
home/panotaka/common/core/fonts.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = [
|
||||
pkgs.noto-fonts
|
||||
];
|
||||
}
|
||||
25
home/panotaka/common/core/git.nix
Normal file
25
home/panotaka/common/core/git.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
# git is core no matter what but additional settings may could be added made in optional/foo eg: development.nix
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
|
||||
ignores = [
|
||||
".csvignore"
|
||||
# nix
|
||||
"*.drv"
|
||||
"result"
|
||||
# python
|
||||
"*.py?"
|
||||
"__pycache__/"
|
||||
".venv/"
|
||||
# direnv
|
||||
".direnv"
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
5
home/panotaka/common/core/kitty.nix
Normal file
5
home/panotaka/common/core/kitty.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
7
home/panotaka/common/core/nixos.nix
Normal file
7
home/panotaka/common/core/nixos.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
# Core home functionality that will only work on Linux
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
}
|
||||
9
home/panotaka/common/core/screen.nix
Normal file
9
home/panotaka/common/core/screen.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.screen ];
|
||||
home.file.".screenrc".text = ''
|
||||
startup_message off
|
||||
defbce on
|
||||
setenv TERM xterm-256color
|
||||
'';
|
||||
}
|
||||
24
home/panotaka/common/core/ssh.nix
Normal file
24
home/panotaka/common/core/ssh.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
# FIXME(starter): adjust to you security requirements
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.ssh =
|
||||
{
|
||||
enable = true;
|
||||
|
||||
controlMaster = "auto";
|
||||
controlPath = "${config.home.homeDirectory}/.ssh/sockets/S.%r@%h:%p";
|
||||
controlPersist = "20m";
|
||||
# Avoids infinite hang if control socket connection interrupted. ex: vpn goes down/up
|
||||
serverAliveCountMax = 3;
|
||||
serverAliveInterval = 5; # 3 * 5s
|
||||
hashKnownHosts = true;
|
||||
addKeysToAgent = "yes";
|
||||
};
|
||||
home.file = {
|
||||
".ssh/config.d/.keep".text = "# Managed by Home Manager";
|
||||
".ssh/sockets/.keep".text = "# Managed by Home Manager";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user