dots-of-war/files/nix-stuff/nixpkgs/modules/base.nix

123 lines
3.1 KiB
Nix
Raw Normal View History

2020-08-09 18:32:27 +00:00
{ config, lib, pkgs, ... }:
let
2020-08-16 21:05:10 +00:00
cfg = config.elkowar.base;
2020-08-24 13:57:25 +00:00
elkowar_local = import ../local/default.nix {};
2020-08-16 21:05:10 +00:00
sources = import ../nix/sources.nix;
2020-08-25 22:26:00 +00:00
addFlags = package: name: flags: pkgs.symlinkJoin {
name = name;
paths = [ package ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/${name} --add-flags "${flags}"
'';
};
2020-08-09 18:32:27 +00:00
in
{
2020-08-16 21:05:10 +00:00
options.elkowar.base = {
2020-08-09 18:32:27 +00:00
enable = lib.mkEnableOption "Basic profile enabled";
2020-08-11 15:56:16 +00:00
enableFish = lib.mkEnableOption "Fish shell";
enableZsh = lib.mkEnableOption "Zsh shell";
2020-08-24 13:57:25 +00:00
includeNiceToHaves = lib.mkEnableOption "Add nice-to-have, non-essential programs";
2020-08-25 22:26:00 +00:00
includeHaskellDev = lib.mkEnableOption "Include large haskell development packages";
2020-08-09 18:32:27 +00:00
};
2020-08-16 21:05:10 +00:00
imports = [ ./term ./generalConfig.nix ];
2020-08-11 14:25:46 +00:00
2020-08-09 18:32:27 +00:00
config = lib.mkIf cfg.enable {
2020-08-11 14:25:46 +00:00
elkowar.programs.tmux.enable = true;
2020-08-11 15:56:16 +00:00
elkowar.programs.zsh.enable = cfg.enableZsh;
elkowar.programs.fish.enable = cfg.enableFish;
elkowar.generalConfig.shellAbbrs = {
2020-08-16 21:05:10 +00:00
vim = "nvim";
2020-08-24 13:57:25 +00:00
cxmonad = "cd ~/.xmonad && nvim /home/leon/.xmonad/lib/Config.hs && cd -";
2020-08-16 21:05:10 +00:00
cnix = "cd ~/nixpkgs/ && nvim home.nix && cd -";
2020-08-24 13:57:25 +00:00
cvim = "cd ~/.config/nvim/ && nvim init.vim && cd -";
2020-08-11 15:56:16 +00:00
2020-08-16 21:05:10 +00:00
gaa = "git add --all";
gc = "git commit -m ";
gp = "git push";
2020-08-24 13:57:25 +00:00
gst = "git status";
2020-08-11 14:25:46 +00:00
};
2020-08-24 13:57:25 +00:00
home.packages = with pkgs; lib.mkMerge [
[
sources.manix
direnv
rnix-lsp
niv
exa
trash-cli
ripgrep
fd
jq
2020-08-25 22:26:00 +00:00
nodejs
nodePackages.bash-language-server
nodePackages.dockerfile-language-server-nodejs
(addFlags bat "bat" "--theme base16")
2020-08-09 18:32:27 +00:00
2020-08-24 13:57:25 +00:00
cachix
]
(
lib.mkIf cfg.includeNiceToHaves [
2020-08-25 22:26:00 +00:00
(addFlags glow "glow" "--style ~/.config/glowStyle.json")
mdcat
2020-08-24 13:57:25 +00:00
haskellPackages.nix-tree
cloc
fet-sh
github-cli
websocat
gtop
2020-08-25 22:26:00 +00:00
nix-prefetch
]
)
(
lib.mkIf cfg.includeHaskellDev [
cabal2nix
cabal-install
2020-08-24 13:57:25 +00:00
]
)
2020-08-09 18:32:27 +00:00
];
programs = {
home-manager.enable = true;
htop.enable = true;
2020-08-16 21:05:10 +00:00
2020-08-09 18:32:27 +00:00
fzf = {
enable = true;
2020-08-11 15:56:16 +00:00
enableFishIntegration = cfg.enableFish;
enableZshIntegration = cfg.enableZsh;
2020-08-09 18:32:27 +00:00
defaultCommand = "rg --files";
fileWidgetCommand = "fd --type f";
changeDirWidgetCommand = "rg --files --null | xargs -0 dirname | sort -u";
};
direnv = {
enable = true;
2020-08-11 15:56:16 +00:00
enableFishIntegration = cfg.enableFish;
enableZshIntegration = cfg.enableZsh;
2020-08-09 18:32:27 +00:00
enableNixDirenvIntegration = true;
};
};
home = {
sessionVariables = rec {
LOCALE_ARCHIVE_2_11 = "${pkgs.glibcLocales}/lib/locale/locale-archive";
LOCALE_ARCHIVE_2_27 = "${pkgs.glibcLocales}/lib/locale/locale-archive";
LOCALE_ARCHIVE = "/usr/bin/locale";
EDITOR = "nvim";
VISUAL = "nvim";
GIT_EDITOR = EDITOR;
};
username = "leon";
homeDirectory = "/home/leon";
stateVersion = "20.09";
};
};
}