meta(home-manager): Determine isPhone from nixosConfig

Simplifies things a bit since we no longer depend on a phone variable,
thus making the individual files easier to copy/paste.
This commit is contained in:
Donovan Glover 2024-09-08 23:14:11 -04:00
parent 9e59527e9a
commit 4b5d240ebd
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
4 changed files with 18 additions and 12 deletions

View File

@ -2,13 +2,15 @@
pkgs,
lib,
nix-config,
phone,
nixosConfig,
...
}:
let
inherit (lib) mkIf singleton;
inherit (nix-config.packages.${pkgs.system}) friendlyfox;
isPhone = nixosConfig.programs.calls.enable;
in
{
programs.librewolf = {
@ -101,7 +103,7 @@ in
};
};
home.file = mkIf phone {
home.file = mkIf isPhone {
".librewolf/default/chrome/userChrome.css".source = "${friendlyfox}/userChrome.css";
".librewolf/default/chrome/userContent.css".source = "${friendlyfox}/userContent.css";
};

View File

@ -1,15 +1,17 @@
{ lib, phone, ... }:
{ lib, nixosConfig, ... }:
let
inherit (lib) mkIf;
isPhone = nixosConfig.programs.calls.enable;
no = {
name = "";
settings.Hidden = "true";
};
in
{
xdg.desktopEntries = mkIf phone {
xdg.desktopEntries = mkIf isPhone {
anki = no;
htop = no;
fish = no;

View File

@ -1,7 +1,9 @@
{ config, phone, ... }:
{ config, nixosConfig, ... }:
let
inherit (config.home) homeDirectory;
isPhone = nixosConfig.programs.calls.enable;
in
{
xdg = {
@ -12,12 +14,12 @@ in
templates = null;
publicShare = null;
desktop = "${homeDirectory}";
download = if phone then "${homeDirectory}" else "${homeDirectory}/";
documents = if phone then "${homeDirectory}" else "${homeDirectory}/";
music = if phone then "${homeDirectory}" else "${homeDirectory}/";
pictures = if phone then "${homeDirectory}" else "${homeDirectory}/";
videos = if phone then "${homeDirectory}" else "${homeDirectory}/";
desktop = homeDirectory;
download = if isPhone then homeDirectory else "${homeDirectory}/";
documents = if isPhone then homeDirectory else "${homeDirectory}/";
music = if isPhone then homeDirectory else "${homeDirectory}/";
pictures = if isPhone then homeDirectory else "${homeDirectory}/";
videos = if isPhone then homeDirectory else "${homeDirectory}/";
};
configFile."user-dirs.locale".text = "ja_JP";

View File

@ -189,7 +189,7 @@ in
};
extraSpecialArgs = {
inherit nix-config phone;
inherit nix-config;
};
};