home: use proper modules

This commit is contained in:
Max Headroom 2022-02-15 23:18:57 +01:00
parent 283ba0515e
commit d25971bc1c
7 changed files with 138 additions and 118 deletions

View file

@ -12,31 +12,8 @@ let
meta = if args ? meta then args.meta else import ./userinfo.nix pkgs; meta = if args ? meta then args.meta else import ./userinfo.nix pkgs;
isNixos = args ? isNixos; isNixos = args ? isNixos;
in
lib.recursiveUpdate
{
manual.json.enable = false;
manual.html.enable = false;
manual.manpages.enable = false;
# general program config optionalDesktopModule = lib.optional (systemProfile == "desktop") {
programs.bat = import ./home/bat.nix meta;
programs.fzf = import ./home/fzf.nix meta;
programs.lsd = import ./home/lsd.nix meta;
programs.git = import ./home/git.nix { inherit lib meta pkgs; };
programs.htop = import ./home/htop.nix meta;
programs.ssh = import ./home/ssh.nix meta;
# direnv
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.direnv.enableFishIntegration = false;
programs.direnv.enableZshIntegration = true;
programs.zsh.enable = true;
home.packages = with pkgs; [ neovim-remote ];
} (lib.optionalAttrs (systemProfile == "desktop") {
# other files # other files
home.file.templates-directory = import ./home/templates.nix meta; home.file.templates-directory = import ./home/templates.nix meta;
home.file.steam-skins = { home.file.steam-skins = {
@ -69,4 +46,33 @@ lib.recursiveUpdate
gtk.enable = true; gtk.enable = true;
gtk.theme.name = "Adwaita-dark"; gtk.theme.name = "Adwaita-dark";
dconf.settings = import ./home/dconf { inherit meta config; }; dconf.settings = import ./home/dconf { inherit meta config; };
}) };
in
{
manual.json.enable = false;
manual.html.enable = false;
manual.manpages.enable = false;
_module.args = { inherit meta inputs; };
# general program config
imports = [
./home/bat.nix
./home/fzf.nix
./home/lsd.nix
./home/git.nix
./home/htop.nix
./home/ssh.nix
] ++ optionalDesktopModule;
# direnv
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.direnv.enableFishIntegration = false;
programs.direnv.enableZshIntegration = true;
programs.zsh.enable = true;
home.packages = with pkgs; [ neovim-remote ];
}

View file

@ -1,7 +1,9 @@
meta: { {
programs.bat = {
enable = true; enable = true;
config = { config = {
paging = "never"; paging = "never";
theme = "DarkNeon"; theme = "DarkNeon";
}; };
};
} }

View file

@ -1,4 +1,6 @@
meta: { {
programs.fzf = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
};
} }

View file

@ -1,4 +1,7 @@
{ lib, meta, pkgs }: { { lib, meta, pkgs, ... }:
{
programs.git = {
enable = true; enable = true;
userName = meta.firstName; userName = meta.firstName;
@ -24,4 +27,5 @@
init.defaultBranch = "master"; init.defaultBranch = "master";
pull.rebase = true; pull.rebase = true;
}; };
};
} }

View file

@ -1,4 +1,5 @@
meta: { {
programs.htop = {
enable = true; enable = true;
settings = { settings = {
detailed_cpu_time = true; detailed_cpu_time = true;
@ -11,4 +12,5 @@ meta: {
column_meter_modes_0 = [ 0 0 0 ]; column_meter_modes_0 = [ 0 0 0 ];
column_meter_modes_1 = [ 0 0 0 0 ]; column_meter_modes_1 = [ 0 0 0 0 ];
}; };
};
} }

View file

@ -1,5 +1,7 @@
meta: { {
programs.lsd = {
enable = true; enable = true;
enableAliases = true; enableAliases = true;
settings = { date = "relative"; }; settings = { date = "relative"; };
};
} }

View file

@ -1,4 +1,4 @@
meta: { meta, ... }:
let let
gitHost = { gitHost = {
user = "git"; user = "git";
@ -23,6 +23,7 @@ let
}; };
equip = host: cfgSet: cfgSet // { inherit host; }; equip = host: cfgSet: cfgSet // { inherit host; };
in { in {
programs.ssh = {
enable = true; enable = true;
controlMaster = "auto"; controlMaster = "auto";
controlPersist = "15m"; controlPersist = "15m";
@ -56,4 +57,5 @@ in {
matchBlocks.pveGitlab = equip "git.${meta.orgDomain}" gitHost // { user = "gitlab"; }; matchBlocks.pveGitlab = equip "git.${meta.orgDomain}" gitHost // { user = "gitlab"; };
matchBlocks.labHost = equip "*.lab" labHost; matchBlocks.labHost = equip "*.lab" labHost;
matchBlocks.mdnsLocal = equip "*.local" features.noFancyDNS; matchBlocks.mdnsLocal = equip "*.local" features.noFancyDNS;
};
} }