diff options
| -rw-r--r-- | flake.lock | 17 | ||||
| -rw-r--r-- | flake.nix | 4 | ||||
| -rw-r--r-- | modules/desktop/darkman/default.nix | 39 | ||||
| -rw-r--r-- | modules/desktop/default.nix | 4 | ||||
| -rw-r--r-- | modules/desktop/gtk/default.nix | 42 | ||||
| -rw-r--r-- | modules/desktop/waybar/style.nix | 4 | ||||
| -rw-r--r-- | users/arpit.nix | 1 |
7 files changed, 56 insertions, 55 deletions
@@ -301,18 +301,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1784356753, - "narHash": "sha256-12KrbMiWLcf8m7pCvAtZh1ZrgF85ZXDXvfR/fWTKy84=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "61b7c44c4073f0b827768aff0049561b5110ea5a", - "type": "github" + "lastModified": 1785483748, + "narHash": "sha256-II2tuu61ElXqjvw0FyZPlwzFrz6zWLczg8xljsZyQRg=", + "rev": "59ea0b1c043c463e39fcb3cfb9a5c8bcf0777c72", + "type": "tarball", + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1044894.59ea0b1c043c/nixexprs.tar.xz" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "type": "indirect" } }, "nixpkgs_2": { @@ -2,7 +2,9 @@ { description = "Home Manager configuration of arpit."; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + # use nixpkgs from the local registry, saves disk space on + # duplicate derivations + nixpkgs.url = "nixpkgs"; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/desktop/darkman/default.nix b/modules/desktop/darkman/default.nix new file mode 100644 index 0000000..4aef68d --- /dev/null +++ b/modules/desktop/darkman/default.nix @@ -0,0 +1,39 @@ +# Darkman - Automatic dark/light mode switching based on time of day +{ + config, + lib, + pkgs, + ... +}: +{ + options.desktop.darkman = { + enable = lib.mkEnableOption "Enables darkman automatic dark/light mode switching." // { + default = true; + }; + }; + + config = lib.mkIf (config.desktop.enable && config.desktop.darkman.enable) { + services.darkman = { + enable = true; + settings = { + portal = true; + lat = 0; + lng = 0; + }; + }; + + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; + config.common = { + default = [ "hyprland" ]; + "org.freedesktop.impl.portal.Settings" = "darkman"; + }; + }; + + # Always dark by default + home.activation.forceDarkman = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + ${pkgs.darkman}/bin/darkman set dark || true + ''; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 27926ec..15ad896 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,4 +1,4 @@ -# Desktop - Desktop environment configuration (Hyprland, GTK, waybar) +# Desktop - Desktop environment configuration (Hyprland, darkman, waybar) { lib, config, @@ -6,7 +6,7 @@ }: { imports = [ - ./gtk + ./darkman ./rofi ./xdg ./hyprland diff --git a/modules/desktop/gtk/default.nix b/modules/desktop/gtk/default.nix deleted file mode 100644 index 05a9807..0000000 --- a/modules/desktop/gtk/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -# GTK - GTK3/GTK4 theme configuration (Nightfox dark theme) -{ - config, - lib, - pkgs, - ... -}: -{ - config = lib.mkIf config.desktop.enable { - gtk = { - enable = true; - colorScheme = "dark"; - theme = { - package = pkgs.nightfox-gtk-theme.override { - tweakVariants = [ "carbonfox" ]; - }; - name = "Nightfox-Dark-Carbonfox"; - }; - gtk3.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - }; - - gtk.gtk4.theme = config.gtk.theme; - - dconf.settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - gtk-theme = "Nightfox-Dark-Carbonfox"; - }; - }; - - qt = { - enable = true; - platformTheme.name = "gtk4"; - style.name = "adwaita-dark"; - }; - }; -} diff --git a/modules/desktop/waybar/style.nix b/modules/desktop/waybar/style.nix index 25841d8..4ca496f 100644 --- a/modules/desktop/waybar/style.nix +++ b/modules/desktop/waybar/style.nix @@ -11,6 +11,10 @@ with config.scheme.withHashtag; padding: 0; } + window#waybar { + background: transparent; + } + #workspaces, #window, #pulseaudio, #battery, #network, #clock.time, #custom-usque, #memory, #cpu, #clock.date { background: ${base00}; diff --git a/users/arpit.nix b/users/arpit.nix index beb0c44..c96da70 100644 --- a/users/arpit.nix +++ b/users/arpit.nix @@ -14,6 +14,7 @@ # Desktop environment desktop.enable = true; + desktop.darkman.enable = true; desktop.hardware.gpu = { nvidia.enable = true; amd.enable = true; |
