From 4e1eb313365378a1c4706cd14ec69fa3584809b1 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 19 Nov 2024 10:42:23 +0100 Subject: [PATCH] home: split programs/services into their own modules --- home/home.nix | 61 ++++++++----------------------- home/programs/bash.nix | 11 ++++++ home/programs/bat.nix | 4 ++ home/programs/bottom.nix | 7 ++++ home/programs/eza.nix | 4 ++ home/programs/feh.nix | 4 ++ home/programs/fzf.nix | 7 ++++ home/programs/home-manager.nix | 4 ++ home/programs/man.nix | 7 ++++ home/programs/mpv.nix | 4 ++ home/programs/obs-studio.nix | 4 ++ home/programs/ssh/default.nix | 8 +++- home/programs/texlive.nix | 7 ++++ home/programs/zoxide.nix | 4 ++ home/services/gnome-keyring.nix | 4 ++ home/services/network-manager.nix | 4 ++ 16 files changed, 97 insertions(+), 47 deletions(-) create mode 100644 home/programs/bash.nix create mode 100644 home/programs/bat.nix create mode 100644 home/programs/bottom.nix create mode 100644 home/programs/eza.nix create mode 100644 home/programs/feh.nix create mode 100644 home/programs/fzf.nix create mode 100644 home/programs/home-manager.nix create mode 100644 home/programs/man.nix create mode 100644 home/programs/mpv.nix create mode 100644 home/programs/obs-studio.nix create mode 100644 home/programs/texlive.nix create mode 100644 home/programs/zoxide.nix create mode 100644 home/services/gnome-keyring.nix create mode 100644 home/services/network-manager.nix diff --git a/home/home.nix b/home/home.nix index 8a8e6e2..3ef2ee5 100644 --- a/home/home.nix +++ b/home/home.nix @@ -10,25 +10,34 @@ in { ./programs/aria2.nix ./programs/atuin.nix + ./programs/bash.nix + ./programs/bat.nix ./programs/beets.nix + ./programs/bottom.nix ./programs/comma.nix ./programs/direnv + ./programs/eza.nix + ./programs/fzf.nix ./programs/gdb.nix - ./programs/gh.nix ./programs/gh-dash.nix + ./programs/gh.nix ./programs/git ./programs/gpg + ./programs/home-manager.nix ./programs/jq.nix ./programs/less.nix + ./programs/man.nix ./programs/neovim ./programs/nix-index ./programs/pandoc.nix ./programs/ripgrep.nix ./programs/ssh ./programs/tealdeer + ./programs/texlive.nix ./programs/thunderbird.nix ./programs/tmux ./programs/yt-dlp.nix + ./programs/zoxide.nix ./programs/zsh ./services/nix-channel-update.nix @@ -42,9 +51,12 @@ in { ./programs/alacritty.nix ./programs/emacs + ./programs/feh.nix ./programs/firefox.nix + ./programs/mpv.nix ./programs/ncmpcpp.nix ./programs/newsboat + ./programs/obs-studio.nix ./programs/qutebrowser.nix ./programs/rofi.nix ./programs/taskwarrior.nix @@ -57,8 +69,10 @@ in { ./services/copyq.nix ./services/dunst.nix ./services/fcitx5.nix + ./services/gnome-keyring.nix ./services/keybase.nix ./services/mpd.nix + ./services/network-manager.nix ./services/picom.nix ./services/polybar.nix ./services/screen-locker.nix @@ -137,51 +151,6 @@ in { fonts.fontconfig.enable = mkForce true; - programs = { - home-manager.enable = true; - - bash = { - enable = true; - historyFile = "${config.xdg.dataHome}/bash_history"; - historySize = 100000; - bashrcExtra = '' - source "${config.xdg.configHome}/mutable_env.sh" - ''; - }; - - bat.enable = true; - bottom = { - enable = true; - settings.flags.enable_gpu = true; - }; - eza.enable = true; - feh.enable = mkIf graphics true; - fzf = { - enable = true; - defaultCommand = "fd --type f"; - }; - man = { - enable = true; - generateCaches = true; - }; - mpv.enable = mkIf graphics true; - obs-studio.enable = mkIf graphics true; - ssh = { - enable = true; - includes = [ "mutable_config" ]; - }; - texlive = { - enable = true; - # packageSet = pkgs.texlive.combined.scheme-medium; - }; - zoxide.enable = true; - }; - - services = { - gnome-keyring.enable = mkIf graphics true; - network-manager-applet.enable = mkIf graphics true; - }; - manual = { html.enable = true; manpages.enable = true; diff --git a/home/programs/bash.nix b/home/programs/bash.nix new file mode 100644 index 0000000..c523f38 --- /dev/null +++ b/home/programs/bash.nix @@ -0,0 +1,11 @@ +{ config, ... }: +{ + programs.bash = { + enable = true; + historyFile = "${config.xdg.dataHome}/bash_history"; + historySize = 100000; + bashrcExtra = '' + source "${config.xdg.configHome}/mutable_env.sh" + ''; + }; +} \ No newline at end of file diff --git a/home/programs/bat.nix b/home/programs/bat.nix new file mode 100644 index 0000000..7a4a3d7 --- /dev/null +++ b/home/programs/bat.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + programs.bat.enable = true; +} \ No newline at end of file diff --git a/home/programs/bottom.nix b/home/programs/bottom.nix new file mode 100644 index 0000000..38ea549 --- /dev/null +++ b/home/programs/bottom.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.bottom = { + enable = true; + settings.flags.enable_gpu = true; + }; +} \ No newline at end of file diff --git a/home/programs/eza.nix b/home/programs/eza.nix new file mode 100644 index 0000000..a722dfb --- /dev/null +++ b/home/programs/eza.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + programs.eza.enable = true; +} \ No newline at end of file diff --git a/home/programs/feh.nix b/home/programs/feh.nix new file mode 100644 index 0000000..d222b6f --- /dev/null +++ b/home/programs/feh.nix @@ -0,0 +1,4 @@ +{ machineVars, ... }: +{ + programs.feh.enable = !machineVars.headless; +} \ No newline at end of file diff --git a/home/programs/fzf.nix b/home/programs/fzf.nix new file mode 100644 index 0000000..7af1d37 --- /dev/null +++ b/home/programs/fzf.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.fzf = { + enable = true; + defaultCommand = "fd --type f"; + }; +} \ No newline at end of file diff --git a/home/programs/home-manager.nix b/home/programs/home-manager.nix new file mode 100644 index 0000000..6e8134e --- /dev/null +++ b/home/programs/home-manager.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + programs.home-manager.enable = true; +} \ No newline at end of file diff --git a/home/programs/man.nix b/home/programs/man.nix new file mode 100644 index 0000000..0bbd7f2 --- /dev/null +++ b/home/programs/man.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.man = { + enable = true; + generateCaches = true; + }; +} \ No newline at end of file diff --git a/home/programs/mpv.nix b/home/programs/mpv.nix new file mode 100644 index 0000000..48cd57a --- /dev/null +++ b/home/programs/mpv.nix @@ -0,0 +1,4 @@ +{ machineVars, ... }: +{ + programs.mpv.enable = !machineVars.headless; +} \ No newline at end of file diff --git a/home/programs/obs-studio.nix b/home/programs/obs-studio.nix new file mode 100644 index 0000000..7ca3149 --- /dev/null +++ b/home/programs/obs-studio.nix @@ -0,0 +1,4 @@ +{ machineVars, ... }: +{ + programs.obs-studio.enable = !machineVars.headless; +} \ No newline at end of file diff --git a/home/programs/ssh/default.nix b/home/programs/ssh/default.nix index 118c5b7..cbf8e80 100644 --- a/home/programs/ssh/default.nix +++ b/home/programs/ssh/default.nix @@ -10,5 +10,11 @@ mode = "0444"; }; - programs.ssh.includes = [ config.sops.secrets."ssh/secret-config".path ]; + programs.ssh = { + enable = true; + includes = [ + config.sops.secrets."ssh/secret-config".path + "mutable_config" + ]; + }; } diff --git a/home/programs/texlive.nix b/home/programs/texlive.nix new file mode 100644 index 0000000..bc461b8 --- /dev/null +++ b/home/programs/texlive.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.texlive = { + enable = true; + # packageSet = pkgs.texlive.combined.scheme-medium; + }; +} \ No newline at end of file diff --git a/home/programs/zoxide.nix b/home/programs/zoxide.nix new file mode 100644 index 0000000..99cf06f --- /dev/null +++ b/home/programs/zoxide.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + programs.zoxide.enable = true; +} \ No newline at end of file diff --git a/home/services/gnome-keyring.nix b/home/services/gnome-keyring.nix new file mode 100644 index 0000000..e11bdee --- /dev/null +++ b/home/services/gnome-keyring.nix @@ -0,0 +1,4 @@ +{ machineVars, ... }: +{ + services.gnome-keyring.enable = !machineVars.headless; +} \ No newline at end of file diff --git a/home/services/network-manager.nix b/home/services/network-manager.nix new file mode 100644 index 0000000..08b7aaa --- /dev/null +++ b/home/services/network-manager.nix @@ -0,0 +1,4 @@ +{ machineVars, ... }: +{ + services.network-manager-applet.enable = !machineVars.headless; +} \ No newline at end of file