Home: Refactor a bit.

This commit is contained in:
Dmitry Voronin 2024-11-16 04:56:36 +03:00
parent fb297297f4
commit 12707eae34
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
132 changed files with 31 additions and 35 deletions

View file

@ -45,7 +45,7 @@ in {
# Chromium config. # Chromium config.
environment.etc = let environment.etc = let
chromium = import <home/config/chromium> args; chromium = import <home/file/chromium> args;
in { in {
"chromium/initial_preferences".source = lib.mkForce chromium.preferences; "chromium/initial_preferences".source = lib.mkForce chromium.preferences;
"chromium/policies/managed/extra.json".source = lib.mkForce chromium.policy; "chromium/policies/managed/extra.json".source = lib.mkForce chromium.policy;

View file

@ -13,6 +13,8 @@
} @args: let } @args: let
cfg = config.home.android; cfg = config.home.android;
android = import ./android args; android = import ./android args;
env = import ./env args;
file = import ./file args;
package = import <package> args; package = import <package> args;
programs = import ./program args; programs = import ./program args;
stylix = import <system/Stylix.nix> args; stylix = import <system/Stylix.nix> args;
@ -35,8 +37,8 @@ in {
inputs.stylix.homeManagerModules.stylix inputs.stylix.homeManagerModules.stylix
]; ];
home = { home = {
file = import ./config args; inherit (env) sessionVariables;
sessionVariables = import ./variable args; inherit file;
stateVersion = const.droidStateVersion; stateVersion = const.droidStateVersion;
}; };
}; };

View file

@ -9,6 +9,8 @@
... ...
} @args: let } @args: let
cfg = config.home.nixos; cfg = config.home.nixos;
env = import ./env args;
file = import ./file args;
programs = import ./program args; programs = import ./program args;
in { in {
imports = (util.ls <user>); imports = (util.ls <user>);
@ -29,16 +31,16 @@ in {
${user.username} = { ${user.username} = {
home = { home = {
inherit (const) stateVersion; inherit (const) stateVersion;
inherit (env) sessionVariables;
inherit (user) username homeDirectory; inherit (user) username homeDirectory;
file = import ./config args; inherit file;
sessionVariables = import ./variable args;
# ISSUE: https://github.com/nix-community/home-manager/issues/5589 # ISSUE: https://github.com/nix-community/home-manager/issues/5589
extraActivationPath = with pkgs; [ openssh ]; extraActivationPath = with pkgs; [ openssh ];
}; };
xdg = import ./xdg { inherit (user) homeDirectory; }; xdg = import ./xdg { inherit (user) homeDirectory; };
programs = with programs; core // desktop; programs = with programs; core // desktop;
dconf.settings = util.catSet (util.ls ./config/dconf) args; dconf.settings = util.catSet (util.ls ./file/dconf) args;
}; };
} }
) { } cfg.users; ) { } cfg.users;

14
home/env/Variable.nix vendored Normal file
View file

@ -0,0 +1,14 @@
{
pkgs,
...
}: {
EDITOR = "nvim"; # Default text editor.
GTK_CSD = 0; # GTK apps compat.
MANGOHUD = "1"; # Enable Mangohud by default.
MANPAGER = "nvim +Man!"; # App to use for man pages.
MOZ_LEGACY_PROFILES = "1"; # Disable Firefox profile switching on rebuild.
NIXPKGS_ALLOW_UNFREE = "1"; # Allow unfree packages in shell.
NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}"; # Current system architecture.
TERM = "xterm-256color"; # Terminal settings.
WINEFSYNC = "1"; # Use fsync for Wine.
}

6
home/env/default.nix vendored Normal file
View file

@ -0,0 +1,6 @@
{
pkgs,
...
} @args: {
sessionVariables = import ./Variable.nix args;
}

Some files were not shown because too many files have changed in this diff Show more