cleanup nix setup

This commit is contained in:
elkowar 2020-08-11 16:25:46 +02:00
parent f5b202f0ce
commit b3eaf2bb34
7 changed files with 145 additions and 97 deletions

View file

@ -1 +1 @@
/nix/store/spsy6k9bx1rvrfqwmd848r2j6pw1w3bi-home-manager-files/.config/htop/htoprc /nix/store/v0n44jjhbc1jh715dysni16gyskaf3g4-home-manager-files/.config/htop/htoprc

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
cfg = config.elkowar.generalConfig;
myConf = import ../myConfig.nix;
in
{
options.elkowar.generalConfig = with lib; {
shellAliases = lib.mkOption {
type = types.attrsOf types.str;
default = {};
description = ''
A map of aliases that will get applied to zsh and fish configuration.
'';
};
};
config = {
programs.zsh.shellAliases = cfg.shellAliases;
};
}

View file

@ -1,5 +1,15 @@
{ myConf, pkgs ? import <nixpkgs> }: { config, lib, pkgs, ... }:
let
cfg = config.elkowar.programs.tmux;
myConf = import ../myConfig.nix;
in
{ {
options.elkowar.programs.tmux = {
enable = lib.mkEnableOption "Enable the tmux configuration";
};
config = lib.mkIf cfg.enable {
programs.tmux = {
enable = true; enable = true;
clock24 = true; clock24 = true;
historyLimit = 10000; historyLimit = 10000;
@ -39,4 +49,6 @@
} }
]; ];
};
};
} }

View file

@ -1,5 +1,11 @@
{ myConf, pkgs ? import <nixpkgs> }: { config, lib, pkgs, ... }:
let let
cfg = config.elkowar.programs.zsh;
myConf = import ../myConfig.nix;
makeAbbrs = with builtins; abbrs: concatStringsSep "\n" makeAbbrs = with builtins; abbrs: concatStringsSep "\n"
( (
attrValues attrValues
@ -96,6 +102,11 @@ let
in in
{ {
options.elkowar.programs.zsh = {
enable = lib.mkEnableOption "ZSH configuration";
};
config = {
programs.zsh = {
enable = true; enable = true;
@ -171,4 +182,6 @@ in
{ name = "zsh-abbr"; src = sources.zsh-abbr; } { name = "zsh-abbr"; src = sources.zsh-abbr; }
{ name = "fast-syntax-highlighting"; src = sources.fast-syntax-highlighting; } { name = "fast-syntax-highlighting"; src = sources.fast-syntax-highlighting; }
]; ];
};
};
} }

View file

@ -31,10 +31,6 @@ in
desktop.enable = true; desktop.enable = true;
}; };
gtk = import ./config/gtk.nix { inherit pkgs; inherit myConf; };
imports = [ ./profiles/base.nix ./profiles/desktop.nix ]; imports = [ ./profiles/base.nix ./profiles/desktop.nix ];
} }

View file

@ -10,7 +10,15 @@ in
#useZsh = lib.mkEnableOption #useZsh = lib.mkEnableOption
}; };
imports = [ ../config/tmux.nix ../config/generalConfig.nix ../config/zsh.nix ];
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
elkowar.programs.tmux.enable = true;
elkowar.programs.zsh.enable = true;
elkowar.generalConfig.shellAliases = {
gc = "git commit";
};
home.packages = with pkgs; [ home.packages = with pkgs; [
direnv direnv
rnix-lsp rnix-lsp
@ -29,15 +37,13 @@ in
fd fd
jq jq
(import (fetchTarball https://github.com/lf-/nix-doc/archive/main.tar.gz) {}) #(import (fetchTarball https://github.com/lf-/nix-doc/archive/main.tar.gz) {})
]; ];
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
htop.enable = true; htop.enable = true;
zsh = import ../config/zsh.nix { inherit pkgs; inherit myConf; };
tmux = import ../config/tmux.nix { inherit pkgs; inherit myConf; };
fzf = { fzf = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;

View file

@ -11,6 +11,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
gtk = import ../config/gtk.nix { inherit pkgs; inherit myConf; };
home.packages = with pkgs; [ home.packages = with pkgs; [
elkowar_local.bashtop elkowar_local.bashtop
elkowar_local.liquidctl elkowar_local.liquidctl