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, pkgs,
lib, lib,
nix-config, nix-config,
phone, nixosConfig,
... ...
}: }:
let let
inherit (lib) mkIf singleton; inherit (lib) mkIf singleton;
inherit (nix-config.packages.${pkgs.system}) friendlyfox; inherit (nix-config.packages.${pkgs.system}) friendlyfox;
isPhone = nixosConfig.programs.calls.enable;
in in
{ {
programs.librewolf = { 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/userChrome.css".source = "${friendlyfox}/userChrome.css";
".librewolf/default/chrome/userContent.css".source = "${friendlyfox}/userContent.css"; ".librewolf/default/chrome/userContent.css".source = "${friendlyfox}/userContent.css";
}; };

View File

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

View File

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

View File

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