feat(home): import desktop module using import-tree and move misc config to desktop module

This commit is contained in:
Mohammad Rafiq 2025-06-14 18:22:53 +08:00
parent 2387ad9099
commit f5a046cd58
No known key found for this signature in database
10 changed files with 97 additions and 112 deletions

16
flake.lock generated
View file

@ -307,6 +307,21 @@
"type": "github" "type": "github"
} }
}, },
"import-tree": {
"locked": {
"lastModified": 1745565707,
"narHash": "sha256-ccFeWWQ9RLgCd1k+xwV/ASUkJ7AGTTaGDhlRWZgytxY=",
"owner": "vic",
"repo": "import-tree",
"rev": "ed504db425c363b13f13d5ca52f1a2600c4a7703",
"type": "github"
},
"original": {
"owner": "vic",
"repo": "import-tree",
"type": "github"
}
},
"mnw": { "mnw": {
"locked": { "locked": {
"lastModified": 1748710831, "lastModified": 1748710831,
@ -511,6 +526,7 @@
"flake-utils-plus": "flake-utils-plus", "flake-utils-plus": "flake-utils-plus",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"import-tree": "import-tree",
"mnw": "mnw", "mnw": "mnw",
"nil": "nil", "nil": "nil",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",

View file

@ -1,6 +1,7 @@
{ {
inputs = { inputs = {
import-tree.url = "github:vic/import-tree";
rrvsh-nixpkgs.url = "github:rrvsh/nixpkgs/librechat-module"; rrvsh-nixpkgs.url = "github:rrvsh/nixpkgs/librechat-module";
crane.url = "github:ipetkov/crane"; crane.url = "github:ipetkov/crane";
disko.inputs.nixpkgs.follows = "nixpkgs"; disko.inputs.nixpkgs.follows = "nixpkgs";

View file

@ -3,11 +3,11 @@
inputs, inputs,
osConfig, osConfig,
lib, lib,
system,
... ...
}: }:
let let
inherit (lib) mkMerge mkIf; inherit (lib) optional;
inherit (inputs) import-tree;
mkEmailAccount = address: { mkEmailAccount = address: {
inherit address; inherit address;
maildir.path = address; maildir.path = address;
@ -22,43 +22,13 @@ let
host = "smtp.forwardemail.net"; host = "smtp.forwardemail.net";
port = 465; port = 465;
}; };
thunderbird.enable = true; thunderbird.enable = osConfig.desktop.enable;
}; };
in in
{ {
config = mkMerge [ imports = optional osConfig.desktop.enable (import-tree ./desktop);
(mkIf osConfig.desktop.enable (
import ./desktop { config = {
inherit
lib
inputs
system
pkgs
osConfig
;
}
))
(mkIf osConfig.desktop.enable {
home.persistence."/persist/home/rafiq".directories = [
"docs"
"repos"
"vids"
"tmp"
".tor project"
".local/share/PrismLauncher"
];
programs = {
obs-studio.enable = true;
thunderbird.enable = true;
thunderbird.profiles.rafiq.isDefault = true;
};
home.packages = with pkgs; [
stremio
tor-browser
prismlauncher
];
})
{
accounts = { accounts = {
email = { email = {
maildirBasePath = "mail"; maildirBasePath = "mail";
@ -101,9 +71,6 @@ in
pantheon.check pantheon.check
inputs.nixspect.packages."x86_64-linux".nixspect inputs.nixspect.packages."x86_64-linux".nixspect
]; ];
persistence."/persist/home/rafiq".directories = [
];
}; };
programs = { programs = {
nh.enable = true; nh.enable = true;
@ -115,6 +82,5 @@ in
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
}; };
} };
];
} }

View file

@ -2,6 +2,7 @@
lib, lib,
inputs, inputs,
system, system,
...
}: }:
let let
inherit (builtins) map listToAttrs; inherit (builtins) map listToAttrs;

View file

@ -1,20 +0,0 @@
{
pkgs,
lib,
inputs,
system,
osConfig,
...
}:
let
inherit (lib) mkMerge;
in
mkMerge [
(import ./browser.nix { inherit lib inputs system; })
(import ./lockscreen.nix)
(import ./launcher.nix)
(import ./media-player.nix)
(import ./status-bar.nix { inherit pkgs; })
(import ./terminal.nix)
(import ./window-manager { inherit pkgs osConfig lib; })
]

View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
persistDirs = [
"docs"
"repos"
"vids"
"tmp"
".tor project"
".local/share/PrismLauncher"
];
programs = {
obs-studio.enable = true;
thunderbird.enable = true;
thunderbird.profiles.rafiq.isDefault = true;
};
home.packages = with pkgs; [
stremio
tor-browser
prismlauncher
];
}

View file

@ -5,7 +5,7 @@
... ...
}: }:
{ {
wayland.windowManager.hyprland.settings = import ./hyprland/settings.nix { wayland.windowManager.hyprland.settings = import ./_hyprland/settings.nix {
inherit pkgs osConfig lib; inherit pkgs osConfig lib;
}; };
} }