diff --git a/common.nix b/common.nix index c5e7092..4b3c54b 100644 --- a/common.nix +++ b/common.nix @@ -1,9 +1,9 @@ rec { default = { - browser = "io.github.zen_browser.zen.desktop"; + browser = "io.github.zen_browser.zen"; calculator = "gnome-calculator"; fileManager = "nautilus"; - imageViewer = "org.gnome.Loupe.desktop"; + imageViewer = "loupe"; lockScreen = "hyprlock"; terminal = "kitty"; }; diff --git a/flake.lock b/flake.lock index c1f0a98..1e9d62b 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,49 @@ { "nodes": { + "ags": { + "inputs": { + "astal": "astal", + "nixpkgs": [ + "hyprpanel", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735485506, + "narHash": "sha256-7CWr3Q83KnGiLUn0oaboafLMOXQ0X9/fjFRVY1xopbM=", + "owner": "aylur", + "repo": "ags", + "rev": "251d39413543264361898b02035775aa3e46fe52", + "type": "github" + }, + "original": { + "owner": "aylur", + "repo": "ags", + "type": "github" + } + }, + "astal": { + "inputs": { + "nixpkgs": [ + "hyprpanel", + "ags", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735172721, + "narHash": "sha256-rtEAwGsHSppnkR3Qg3eRJ6Xh/F84IY9CrBBLzYabalY=", + "owner": "aylur", + "repo": "astal", + "rev": "6c84b64efc736e039a8a10774a4a1bf772c37aa2", + "type": "github" + }, + "original": { + "owner": "aylur", + "repo": "astal", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -375,6 +419,27 @@ "type": "github" } }, + "hyprpanel": { + "inputs": { + "ags": "ags", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736315488, + "narHash": "sha256-XKQT7ZY+0q3CHncCQ5QvSq8inG44A0ReokqYjieL1Z4=", + "owner": "Jas-SinghFSU", + "repo": "HyprPanel", + "rev": "9663d2f6b74df8476feb87b3b09e998c8ef87ac8", + "type": "github" + }, + "original": { + "owner": "Jas-SinghFSU", + "repo": "HyprPanel", + "type": "github" + } + }, "ixx": { "inputs": { "flake-utils": [ @@ -510,6 +575,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "hyprpanel": "hyprpanel", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", diff --git a/flake.nix b/flake.nix index 923c69b..0f81200 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,10 @@ url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + hyprpanel = { + url = "github:Jas-SinghFSU/HyprPanel"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs-unstable"; @@ -25,39 +29,40 @@ nixpkgs, nixpkgs-unstable, home-manager, + hyprpanel, stylix, ... }: let system = "x86_64-linux"; inherit (self) outputs; + common = import ./common.nix; in { + defaultPackage.${system} = home-manager.defaultPackage.${system}; + # Adds the nix fmt command to format nix files formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style; nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { system = system; - specialArgs = { inherit outputs; }; # Pass args to modules + specialArgs = { inherit outputs inputs; }; # Pass args to modules modules = [ ./configuration.nix home-manager.nixosModules.home-manager { - home-manager = - let - common = import ./common.nix; - in - { - # Backups conflicting files in case of error - backupFileExtension = "bkp"; - useGlobalPkgs = true; - useUserPackages = true; - # Passes inputs as an argument to home-manager - extraSpecialArgs = { inherit inputs; }; - users.${common.username} = import ./home-manager; - }; + home-manager = { + # Backups conflicting files in case of error + backupFileExtension = "bkp"; + useGlobalPkgs = true; + useUserPackages = true; + # Passes inputs as an argument to home-manager + extraSpecialArgs = { inherit inputs; }; + users.${common.username} = import ./home-manager; + }; } stylix.nixosModules.stylix + ./overlays.nix ]; }; diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix index 7c3223f..ac17a9b 100644 --- a/home-manager/hyprland/default.nix +++ b/home-manager/hyprland/default.nix @@ -6,6 +6,7 @@ ./waybar ./hypridle ./hyprlock + ./hyprpanel ./hyprshot.nix ./settings.nix ./swaync diff --git a/home-manager/hyprland/hyprpanel/default.nix b/home-manager/hyprland/hyprpanel/default.nix new file mode 100644 index 0000000..4602502 --- /dev/null +++ b/home-manager/hyprland/hyprpanel/default.nix @@ -0,0 +1,110 @@ +{ inputs, ... }: +let + common = import ../../../common.nix; + theme = import ../../../theme.nix; +in +{ + imports = [ inputs.hyprpanel.homeManagerModules.hyprpanel ]; + + programs.hyprpanel = { + enable = true; + # Automatically restart HyprPanel with systemd. + systemd.enable = true; + # Add hyprpanel to the Hyprland config 'exec-once'. + hyprland.enable = true; + # Fix the overwrite issue with HyprPanel. + overwrite.enable = true; + + # Import a theme from './themes/*.json'. + theme = ""; + + # Override the final config with an arbitrary set. + # Useful for overriding colors in your selected theme. + # Default: {} + override = { + theme.bar.menus.text = "#123ABC"; + }; + + # Configure bar layouts for monitors. + layout = { + "bar.layouts" = { + "*" = { + left = [ + "dashboard" + "workspaces" + "windowtitle" + ]; + middle = [ "media" ]; + right = [ + "kbinput" + "volume" + "network" + "systray" + "clock" + "notifications" + ]; + }; + }; + }; + + # Configure and theme almost all options from the GUI. + # Options that require '{}' or '[]' are not yet implemented, + # except for the layout above. + # See 'https://hyprpanel.com/configuration/settings.html'. + # Default: + settings = { + bar = { + clock.format = "%a %b %d %H:%M"; + customModules.kbLayout.leftClick = "hyprctl switchxkblayout keychron-keychron-k8-pro next"; + launcher.autoDetectIcon = true; + network.label = false; + workspaces = { + show_icons = false; + show_numbered = true; + }; + }; + + menus.clock = { + time = { + military = true; + hideSeconds = true; + }; + weather = { + unit = "metric"; + location = "Bergen, Norway"; # TODO not working + }; + }; + + menus.dashboard = { + directories.enabled = false; + shortcuts.left = { + shortcut1 = { + command = common.default.browser; + icon = ""; # TODO replace with Zen icon + tooltip = "Zen"; + }; + shortcut2 = { + command = "spotify"; + icon = ""; + tooltip = "Spotify"; + }; + ## shortcut3 === discord + ## shortcut4 === rofi -show drun + }; + stats.enable_gpu = true; + }; + + scalingPriority = "hyprland"; + + theme = { + bar.transparent = true; + font = { + name = "${theme.nerdFont} NF"; + size = "16px"; + }; + }; + + wallpaper.enable = true; + }; + }; +} diff --git a/home-manager/hyprland/settings.nix b/home-manager/hyprland/settings.nix index 7b50a0e..0fd57ad 100644 --- a/home-manager/hyprland/settings.nix +++ b/home-manager/hyprland/settings.nix @@ -18,8 +18,7 @@ in "${app.terminal}" "hypridle" "systemctl --user start hyprpolkitagent" - "swaync" - "waybar" + # "waybar" "waypaper --restore" ]; diff --git a/home-manager/hyprland/swaync/default.nix b/home-manager/hyprland/swaync/default.nix index c676ec2..1b624ec 100644 --- a/home-manager/hyprland/swaync/default.nix +++ b/home-manager/hyprland/swaync/default.nix @@ -3,9 +3,8 @@ let theme = import ../../../theme.nix; in { - # TODO inject font services.swaync = { - enable = true; + enable = false; style = lib.mkDefault '' * { all: unset; diff --git a/home-manager/hyprland/waybar/default.nix b/home-manager/hyprland/waybar/default.nix index 5ab52d3..23c50f4 100644 --- a/home-manager/hyprland/waybar/default.nix +++ b/home-manager/hyprland/waybar/default.nix @@ -1,5 +1,3 @@ -{ ... }: - { home.file.".config/waybar" = { source = ./config; diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index aa07aff..0c55140 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -10,7 +10,7 @@ xdg-desktop-portal-hyprland hyprpolkitagent # Auth deamon providing modals for password auth hyprshot # Screenshots - waybar + # waybar ]; programs = { diff --git a/overlays.nix b/overlays.nix new file mode 100644 index 0000000..b41909f --- /dev/null +++ b/overlays.nix @@ -0,0 +1,7 @@ +{ inputs, ... }: + +{ + nixpkgs.overlays = with inputs; [ + hyprpanel.overlay + ]; +}