Skip to content

Commit

Permalink
home: make conditonal based on local.system.linux
Browse files Browse the repository at this point in the history
  • Loading branch information
tomodachi94 committed Dec 4, 2024
1 parent 7357057 commit a55df26
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 25 deletions.
2 changes: 1 addition & 1 deletion home/darwin/color-pickers/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

config = {
assertions = [{
assertion = config.home.colorPickers.enable && (config.home.colorPickers != []) && !pkgs.stdenv.hostPlatform.isDarwin;
assertion = config.home.colorPickers.enable && (config.home.colorPickers != [ ]) && !pkgs.stdenv.hostPlatform.isDarwin;
message = "Must use Darwin to install color pickers.";
}];

Expand Down
4 changes: 2 additions & 2 deletions home/darwin/desktop-standalone-packages.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ pkgs, ... }:
{
{ pkgs, lib, config, ... }:
lib.mkIf config.local.system.darwin {
home.packages = [
pkgs.iterm2
];
Expand Down
3 changes: 2 additions & 1 deletion home/darwin/git.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
{ lib, config, ... }:
lib.mkIf config.local.system.darwin {
programs.git = {
ignores = [
".DS_Store" # https://en.wikipedia.org/wiki/.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion home/linux/blueman.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, config, ... }:
{
services.blueman-applet = {
enable = config.local.eagerSetup.enableGraphicalApps;
enable = config.local.system.linux && config.local.eagerSetup.enableGraphicalApps;
};

dconf.settings = {
Expand Down
2 changes: 1 addition & 1 deletion home/linux/desktop-standalone-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let
firejailWrappers = tomolib.firejailWrappers { inherit pkgs; };
in
{
home.packages = lib.optionals config.local.eagerSetup.enableGraphicalApps [
home.packages = lib.optionals (config.local.system.linux && config.local.eagerSetup.enableGraphicalApps) [
pkgs.lxqt.qps
pkgs.zotero
tomopkgs.${pkgs.system}.crosshair-dot
Expand Down
2 changes: 1 addition & 1 deletion home/linux/dunst.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, ... }:
{
services.dunst = {
enable = config.local.eagerSetup.enableGraphicalApps;
enable = config.local.system.linux && config.local.eagerSetup.enableGraphicalApps;
};

stylix.targets.dunst.enable = true;
Expand Down
2 changes: 1 addition & 1 deletion home/linux/fcitx5/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ pkgs, lib, config, ... }:
lib.mkIf config.local.eagerSetup.enableGraphicalApps {
lib.mkIf (config.local.system.linux && config.local.eagerSetup.enableGraphicalApps) {
i18n.inputMethod.enabled = "fcitx5";
i18n.inputMethod.fcitx5.addons = with pkgs; [
fcitx5-mozc
Expand Down
2 changes: 1 addition & 1 deletion home/linux/fun.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ pkgs, lib, config, ... }:
{
home.packages = lib.optionals config.local.eagerSetup.enableGames [
home.packages = lib.optionals (config.local.system.linux && config.local.eagerSetup.enableGames) [
pkgs.prismlauncher
pkgs.lutris # Launcher for Windows-only games
];
Expand Down
2 changes: 1 addition & 1 deletion home/linux/gnome-keyring.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ config, ... }:
{
services.gnome-keyring = {
enable = config.local.eagerSetup.enableGraphicalApps;
enable = config.local.system.linux && config.local.eagerSetup.enableGraphicalApps;
};
}
2 changes: 1 addition & 1 deletion home/linux/gnome-terminal.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ vars, config, ... }:
{
programs.gnome-terminal = {
enable = config.local.eagerSetup.enableGraphicalApps;
enable = config.local.system.linux && config.local.eagerSetup.enableGraphicalApps;
profile."b1dcc9dd-5262-4d8d-a863-c897e6d979b9" = {
default = true;
loginShell = true;
Expand Down
2 changes: 1 addition & 1 deletion home/linux/gtk.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs, config, ... }:
{
gtk = {
enable = config.local.eagerSetup.enableGraphicalApps;
enable = config.local.system.linux && config.local.eagerSetup.enableGraphicalApps;
# cursorTheme.package = pkgs.vanilla-dmz;
# cursorTheme.name = "Vanilla-DMZ";
# cursorTheme.size = 23;
Expand Down
3 changes: 2 additions & 1 deletion home/linux/home-manager.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
{ config, lib, ... }:
lib.mkIf config.local.system.linux {
home.username = "me";
home.homeDirectory = "/home/me";
}
2 changes: 1 addition & 1 deletion home/linux/i3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
};

# For cleanliness, this contains any packages that are exclusively used in this configuration.
home.packages = lib.optionals config.local.eagerSetup.enableGraphicalApps (with pkgs; [
home.packages = lib.optionals (config.local.system.linux && config.local.eagerSetup.enableGraphicalApps) (with pkgs; [
xss-lock
brightnessctl
playerctl
Expand Down
4 changes: 2 additions & 2 deletions home/linux/i3status-rust/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ pkgs, ... }:
{
{ pkgs, lib, config, ... }:
lib.mkIf (config.local.system.linux && config.local.eagerSetup.enableGraphicalApps) {
xdg.configFile."i3status-rust/config.toml".source = ./config.toml;

home.packages = [
Expand Down
3 changes: 2 additions & 1 deletion home/linux/i3status/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
{ config, lib, ... }:
lib.mkIf config.local.system.linux {
xdg.configFile."i3status".source = ./.;
}
2 changes: 1 addition & 1 deletion home/linux/kdeconnect.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ config, ... }:
{
services.kdeconnect = {
enable = config.local.eagerSetup.enableGraphicalApps;
enable = config.local.system.linux && config.local.eagerSetup.enableGraphicalApps;
};
}
3 changes: 2 additions & 1 deletion home/linux/kitty/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
{ lib, config, ... }:
lib.mkIf config.local.system.linux {
xdg.configFile."kitty".source = ./.;
}
2 changes: 1 addition & 1 deletion home/linux/network-manager-applet.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ config, ... }:
{
services.network-manager-applet = {
enable = config.local.eagerSetup.enableGraphicalApps;
enable = config.local.system.linux && config.local.eagerSetup.enableGraphicalApps;
};
}
2 changes: 1 addition & 1 deletion home/linux/volnoti.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs, tomopkgs, config, ... }:
{
services.volnoti = {
enable = config.local.eagerSetup.enableGraphicalApps;
enable = config.local.system.linux && config.local.eagerSetup.enableGraphicalApps;
package = tomopkgs.${pkgs.system}.volnoti;
};
}
10 changes: 6 additions & 4 deletions home/linux/xdg.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# NOTE: DO NOT INCLUDE XDG.CONFIGFILE SETTINGS HERE :)
{ pkgs, config, ... }:
{ pkgs, lib, config, ... }:
{
xdg = {
userDirs = {
enable = true;
enable = config.local.system.linux;
};
mimeApps = {
enable = true;
enable = config.local.system.linux;
defaultApplications = {
# TODO: Split into modules and conditionally enable these rules if the application is enabled
"x-scheme-handler/https" = "/etc/profiles/per-user/me/share/applications/librewolf.desktop";
Expand All @@ -17,6 +17,8 @@
"x-scheme-handler/feed" = "${pkgs.liferea}/share/applications/net.sourceforge.liferea.desktop";
};
};
configFile."user-dirs.locale".text = "en_US";
configFile."user-dirs.locale" = lib.mkIf config.local.system.linux {
text = "en_US";
};
};
}

0 comments on commit a55df26

Please sign in to comment.