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;
isNixos = args ? isNixos;
in
lib.recursiveUpdate
{
manual.json.enable = false;
manual.html.enable = false;
manual.manpages.enable = false;
# general program config
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") {
optionalDesktopModule = lib.optional (systemProfile == "desktop") {
# other files
home.file.templates-directory = import ./home/templates.nix meta;
home.file.steam-skins = {
@ -69,4 +46,33 @@ lib.recursiveUpdate
gtk.enable = true;
gtk.theme.name = "Adwaita-dark";
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;
config = {
paging = "never";
theme = "DarkNeon";
};
};
}

View file

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

View file

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

View file

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

View file

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

View file

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