From 9f9479b5762203d4c30136c7ebece4826e9a5eba Mon Sep 17 00:00:00 2001 From: unexplrd Date: Sun, 30 Mar 2025 16:07:10 +0300 Subject: [PATCH] make home manager modules composable Signed-off-by: unexplrd --- hosts/dunamis/users/user/common.nix | 14 +++ .../dunamis/users/user/home-configuration.nix | 16 +--- .../eldrid/users/user/home-configuration.nix | 18 +--- hosts/eldrid/users/user/programs.nix | 87 ------------------- hosts/sarien/users/user/flatpak.nix | 64 ++++++-------- .../sarien/users/user/home-configuration.nix | 17 +--- hosts/sarien/users/user/programs.nix | 77 ---------------- 7 files changed, 51 insertions(+), 242 deletions(-) create mode 100644 hosts/dunamis/users/user/common.nix delete mode 100644 hosts/eldrid/users/user/programs.nix delete mode 100644 hosts/sarien/users/user/programs.nix diff --git a/hosts/dunamis/users/user/common.nix b/hosts/dunamis/users/user/common.nix new file mode 100644 index 0000000..71c96e3 --- /dev/null +++ b/hosts/dunamis/users/user/common.nix @@ -0,0 +1,14 @@ +{ + inputs, + osConfig, + ... +}: { + imports = with inputs; [ + nix-index-database.hmModules.nix-index + self.homeModules.desktop + self.homeModules.programs + ]; + inherit (osConfig) desktop; + home.stateVersion = osConfig.system.stateVersion; + home.sessionPath = ["$HOME/.local/bin"]; +} diff --git a/hosts/dunamis/users/user/home-configuration.nix b/hosts/dunamis/users/user/home-configuration.nix index a8f2ea4..8499b4a 100644 --- a/hosts/dunamis/users/user/home-configuration.nix +++ b/hosts/dunamis/users/user/home-configuration.nix @@ -1,17 +1,7 @@ { - lib, - inputs, - osConfig, - ... -}: { - imports = with inputs; [ - nix-index-database.hmModules.nix-index - self.homeModules.desktop - self.homeModules.programs - ./programs.nix + imports = [ + ./common.nix ./flatpak.nix + ./programs.nix ]; - inherit (osConfig) desktop; - home.stateVersion = osConfig.system.stateVersion; - home.sessionPath = ["$HOME/.local/bin"]; } diff --git a/hosts/eldrid/users/user/home-configuration.nix b/hosts/eldrid/users/user/home-configuration.nix index 8a91e5d..3463665 100644 --- a/hosts/eldrid/users/user/home-configuration.nix +++ b/hosts/eldrid/users/user/home-configuration.nix @@ -1,19 +1,7 @@ { - inputs, - osConfig, - ... -}: { - imports = with inputs; [ - nix-index-database.hmModules.nix-index - self.homeModules.desktop - self.homeModules.programs - ./programs.nix + imports = [ + ../../../dunamis/users/user/common.nix + ../../../dunamis/users/user/programs.nix ./flatpak.nix ]; - home = { - inherit (osConfig.system) stateVersion; - sessionPath = ["$HOME/.local/bin"]; - }; - - desktop.niri.enable = true; } diff --git a/hosts/eldrid/users/user/programs.nix b/hosts/eldrid/users/user/programs.nix deleted file mode 100644 index a8e621b..0000000 --- a/hosts/eldrid/users/user/programs.nix +++ /dev/null @@ -1,87 +0,0 @@ -{pkgs, ...}: { - shell = { - fish.enable = true; - oh-my-posh.enable = true; - }; - - console.yazi.enable = true; - - stylix.targets.fzf.enable = false; - services.ssh-agent.enable = true; - services.pueue.enable = true; - - syncthing.enable = true; - - programs = { - bat.enable = true; - btop = { - enable = true; - settings.update_ms = 200; - }; - eza.enable = true; - fd.enable = true; - fzf = { - enable = true; - defaultOptions = ["--color=16"]; - }; - pay-respects.enable = true; - nix-index.enable = true; - nix-index-database.comma.enable = true; - gitui.enable = true; - git = { - enable = true; - delta.enable = true; - signing.format = "ssh"; - aliases = { - cl = "clone"; - co = "checkout"; - pom = "push origin main"; - }; - }; - jujutsu.enable = true; - ripgrep.enable = true; - }; - - terminal = { - ghostty.enable = true; - kitty.enable = true; - }; - - editor = { - helix.enable = true; - }; - - home.packages = with pkgs; [ - alejandra # nix formatter in rust - devenv # programming deps in rust - dust # du in rust - fend # calc in rust - flatpak # flatpak cli - jj-fzf # fuzzy finder jujutsu tui - just # make in rust - ouch # archive manager in runt - overskride # bluetooth gui in rust - pika-backup # borg gui in rust - pinentry-qt # pinentry for rbw - procs # ps in rust - rbw # bitwarden cli in rust - trashy # trash cli in rust - vial # qmk keyboard configuring app - virt-manager # libvirt gui - waycheck # check wayland protocols - ]; - - xdg.desktopEntries = { - uni = { - actions."Copy".exec = "fish -c \"~/.local/bin/uni --copy\""; - categories = ["Utility" "X-Launch" "Network"]; - comment = "Select and open or copy URLs from a list."; - exec = "fish -c \"~/.local/bin/uni\""; - icon = "web-browser"; - name = "Uni URL Handler"; - startupNotify = true; - terminal = false; - type = "Application"; - }; - }; -} diff --git a/hosts/sarien/users/user/flatpak.nix b/hosts/sarien/users/user/flatpak.nix index 167f0db..53036c3 100644 --- a/hosts/sarien/users/user/flatpak.nix +++ b/hosts/sarien/users/user/flatpak.nix @@ -18,34 +18,33 @@ packages = [ # misc "app.zen_browser.zen" + "io.github.ungoogled_software.ungoogled_chromium" "net.mullvad.MullvadBrowser" - "com.obsproject.Studio" "com.bitwarden.desktop" "com.github.tchx84.Flatseal" + "com.logseq.Logseq" + "com.obsproject.Studio" + "com.usebottles.bottles" + "de.haeckerfelix.Fragments" "org.qbittorrent.qBittorrent" - # "com.transmissionbt.Transmission" - "com.usebottles.bottles" - "com.logseq.Logseq" - "io.github.martchus.syncthingtray" - # chatting - "org.signal.Signal" "im.riot.Riot" - "org.telegram.desktop" "io.github.spacingbat3.webcord" "org.mozilla.Thunderbird" + "org.signal.Signal" + "org.telegram.desktop" # media - "org.atheme.audacious" + "io.bassi.Amberol" "io.freetubeapp.FreeTube" - #"io.github.celluloid_player.Celluloid" # "io.mpv.Mpv" + #"io.github.celluloid_player.Celluloid" # gaming #"com.github._0negal.Viper" - "net.lutris.Lutris" "com.heroicgameslauncher.hgl" + "net.lutris.Lutris" { appId = "org.unmojang.FjordLauncher"; origin = "hero-persson"; @@ -59,38 +58,32 @@ Context = { sockets = ["wayland" "!x11" "!fallback-x11"]; filesystems = [ - "xdg-run/pipewire-0" + "!home" + "!host" + "!~/.ssh" + "/nix/store:ro" "xdg-config/gtk-3.0:ro" "xdg-config/gtk-4.0:ro" - # "~/.local/share/fonts:ro" + "xdg-run/pipewire-0" "~/.local/share/icons:ro" - # "~/.nix-profile/share/icons:ro" - # "~/.nix-profile/share/fonts:ro" - "/nix/store:ro" ]; }; Environment = { - XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons"; ELECTRON_OZONE_PLATFORM_HINT = "wayland"; - #GTK_THEME = "adw-gtk3"; - }; - }; - "io.github.martchus.syncthingtray".Context.filesystems = ["/storage/games/heroic/Factorio/game/saves"]; - "org.octave.Octave".Context.sockets = ["x11"]; - "org.octave.Octave".Environment = {QT_QPA_PLATFORM = "xcb";}; - "com.valvesoftware.Steam" = { - Context = { - sockets = ["x11" "wayland"]; - filesystems = ["/storage/games/steam"]; - }; - Environment = { - STEAM_FORCE_DESKTOPUI_SCALING = "1.3"; }; }; "org.signal.Signal" = { - Environment = { - SIGNAL_PASSWORD_STORE = "gnome-libsecret"; - }; + Environment.SIGNAL_PASSWORD_STORE = "gnome-libsecret"; + }; + "com.obsproject.Studio" = { + Context.filesystems = ["~/vids"]; + }; + "com.logseq.Logseq" = { + Context.filesystems = [ + "~/docs/logseq" + "~/docs/nure/2025/logseq" + "~/syncthing/logseq" + ]; }; "net.lutris.Lutris".Context = { sockets = ["x11" "wayland"]; @@ -101,10 +94,7 @@ filesystems = ["/storage/games/heroic" "~/games/heroic"]; }; "com.usebottles.Bottles" = { - Context = { - sockets = ["x11" "wayland"]; - filesystems = ["/home/user/docs/nure/tex-template/assets/BridgeKSG"]; - }; + Context.sockets = ["x11" "wayland"]; }; }; }; diff --git a/hosts/sarien/users/user/home-configuration.nix b/hosts/sarien/users/user/home-configuration.nix index e3da1f8..3463665 100644 --- a/hosts/sarien/users/user/home-configuration.nix +++ b/hosts/sarien/users/user/home-configuration.nix @@ -1,16 +1,7 @@ -{inputs, ...}: { - imports = with inputs; [ - nix-index-database.hmModules.nix-index - self.homeModules.desktop - self.homeModules.programs - ./programs.nix +{ + imports = [ + ../../../dunamis/users/user/common.nix + ../../../dunamis/users/user/programs.nix ./flatpak.nix ]; - desktop.niri.enable = true; - home = { - stateVersion = "25.05"; - sessionPath = [ - "$HOME/.local/bin" - ]; - }; } diff --git a/hosts/sarien/users/user/programs.nix b/hosts/sarien/users/user/programs.nix deleted file mode 100644 index dd8487f..0000000 --- a/hosts/sarien/users/user/programs.nix +++ /dev/null @@ -1,77 +0,0 @@ -{pkgs, ...}: { - shell = { - fish.enable = true; - #nushell.enable = true; - oh-my-posh.enable = true; - }; - - console.yazi.enable = true; - - stylix.targets.fzf.enable = false; - services.ssh-agent.enable = true; - services.pueue.enable = true; - - syncthing.enable = true; - - programs = { - bat.enable = true; - btop = { - enable = true; - settings.update_ms = 200; - }; - eza.enable = true; - fd.enable = true; - fzf = { - enable = true; - defaultOptions = ["--color=16"]; - }; - pay-respects.enable = true; - nix-index.enable = true; - nix-index-database.comma.enable = true; - gitui.enable = true; - git = { - enable = true; - delta.enable = true; - signing.format = "ssh"; - aliases = { - cl = "clone"; - co = "checkout"; - pom = "push origin main"; - }; - }; - jujutsu.enable = true; - ripgrep.enable = true; - }; - - terminal = { - ghostty.enable = true; - kitty.enable = true; - }; - - editor = { - helix.enable = true; - # neve.enable = true; - zed.enable = true; - }; - - home.packages = with pkgs; [ - alejandra # nix formatter in rust - flatpak # flatpak cli - trashy # trash cli in rust - devenv # programming deps in rust - procs # ps in rust - ouch # archive manager in runt - dust # du in rust - fend # calc in rust - moar # better pager (in go) - just # make in rust - rbw # bitwarden cli in rust - pinentry-qt # pinentry for rbw - vial # qmk keyboard configuring app - jj-fzf # fuzzy finder jujutsu tui - waycheck # check wayland protocols - pika-backup # borg gui in rust - virt-manager # libvirt gui - ]; - systemd.user.settings.Manager.DefaultEnvironment.PAGER = "moar"; -}