diff --git a/flake.lock b/flake.lock index e38c44e5..6f8c813d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,29 +1,68 @@ { "nodes": { - "home-manager": { + "niri": { "inputs": { - "nixpkgs": "nixpkgs" + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1754444017, - "narHash": "sha256-PyxmeamNheSNZICr8vvanf0F3YQf9DPCu2qErVC2A7k=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "a3790776751d1a6365aa0717f509d05adee90734", + "lastModified": 1754647495, + "narHash": "sha256-cHzUe/X4LQjlVWZ+k7OFuPZIe2S+0dDNEOIRXORK0ZA=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "f4739f416bd1e092207825f3c9cd400fc306d6d9", "type": "github" }, "original": { - "id": "home-manager", - "type": "indirect" + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1748151941, + "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.05.1", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1754589971, + "narHash": "sha256-gu0lWJbDkHs6+V9KHXwQHtZ2Hp72FxOjy3YisJ3qj9k=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "f74d83dccaa6e8fffb38c304dd5d1eae07b87d24", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1753939845, - "narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=", + "lastModified": 1754498491, + "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "94def634a20494ee057c76998843c015909d6311", + "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", "type": "github" }, "original": { @@ -33,6 +72,22 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1754563854, + "narHash": "sha256-YzNTExe3kMY9lYs23mZR7jsVHe5TWnpwNrsPOpFs/b8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e728d7ae4bb6394bbd19eec52b7358526a44c414", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1754214453, @@ -49,10 +104,64 @@ "type": "github" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1753595452, + "narHash": "sha256-vqkSDvh7hWhPvNjMjEDV4KbSCv2jyl2Arh73ZXe274k=", + "ref": "refs/heads/master", + "rev": "a5431dd02dc23d9ef1680e67777fed00fe5f7cda", + "revCount": 665, + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + } + }, "root": { "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2" + "niri": "niri", + "nixpkgs": "nixpkgs_2", + "quickshell": "quickshell" + } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1748488455, + "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.6", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1754533920, + "narHash": "sha256-fCZ68Yud1sUCq6UNXj0SDyiBgVA8gJUE+14ZFGsFJG8=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "e0d1dad25a158551ab58547b2ece4b7d5a19929c", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index edc02cb0..5d626b12 100644 --- a/flake.nix +++ b/flake.nix @@ -1,3 +1,4 @@ + { description = "Dank material shell."; @@ -5,138 +6,97 @@ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; quickshell.url = "git+https://git.outfoxxed.me/quickshell/quickshell"; quickshell.inputs.nixpkgs.follows = "nixpkgs"; - # home-manager.url = "github:nix-community/home-manager"; + niri.url = "github:sodiboo/niri-flake"; + niri.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, ... }: - let pkgs = nixpkgs.legacyPackages.x86_64-linux; + outputs = { self, nixpkgs, niri, quickshell, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; in { + packages.${system} = { + dankMaterialShell = pkgs.stdenvNoCC.mkDerivation { + name = "dankMaterialShell"; + src = ./.; + installPhase = '' + mkdir -p $out/etc/xdg/quickshell/DankMaterialShell + cp -r . $out/etc/xdg/quickshell/DankMaterialShell + ''; + }; - packages.x86_64-linux.dankMaterialShell = pkgs.stdenvNoCC.mkDerivation { - name = "dankMaterialShell"; - src = ./.; - buildInputs = with pkgs; [ - material-symbols - inter - fira-code - cava - wl-clipboard - cliphist - ddcutil - libsForQt5.qt5ct - kdePackages.qt6ct - matugen - ]; - installPhase = '' - mkdir -p $out/etc/xdg/quickshell/DankMaterialShell - cp -r . $out/etc/xdg/quickshell/DankMaterialShell - ''; + default = self.packages.${system}.dankMaterialShell; }; - packages.x86_64-linux.default = - self.packages.x86_64-linux.dankMaterialShell; - - homeModules.dankMaterialShell = { config, options, pkgs, outputs, ... }: + homeModules.dankMaterialShell = { config, pkgs, lib, ... }: let cfg = config.programs.dankMaterialShell; in { + imports = [ niri.homeModules.niri ]; + options.programs.dankMaterialShell = { - enable = pkgs.lib.mkEnableOption "DankMaterialShell"; - enableKeybinds = - pkgs.lib.mkEnableOption "DankMaterialShell Niri keybinds"; - enableSystemd = - pkgs.lib.mkEnableOption "DankMaterialShell systemd startup"; + enable = lib.mkEnableOption "DankMaterialShell"; + enableKeybinds = lib.mkEnableOption "DankMaterialShell Niri keybinds"; + enableSystemd = lib.mkEnableOption "DankMaterialShell systemd startup"; }; - config.programs.quickshell.enable = pkgs.lib.mkIf cfg.enable true; + config = lib.mkIf cfg.enable { + programs.quickshell = { + enable = true; + package = quickshell.packages.${system}.quickshell; + configs.DankMaterialShell = "${self.packages.${system}.dankMaterialShell}/etc/xdg/quickshell/DankMaterialShell"; + activeConfig = lib.mkIf cfg.enableSystemd "DankMaterialShell"; + systemd = lib.mkIf cfg.enableSystemd { + enable = true; + target = "graphical-session.target"; + }; + }; - config.programs.quickshell.configs.DankMaterialShell = - pkgs.lib.mkIf cfg.enable - "${self.outputs.packages.x86_64-linux.dankMaterialShell}/etc/xdg/quickshell/DankMaterialShell"; + programs.niri.settings = lib.mkMerge [ + (lib.mkIf cfg.enableKeybinds { + binds = with config.lib.niri.actions; { + "Mod+Space".action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "spotlight" "toggle"; + "Mod+V".action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "clipboard" "toggle"; + "Mod+M".action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "processlist" "toggle"; + "Mod+Comma".action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "settings" "toggle"; + "Super+Alt+L".action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "lock" "lock"; + "XF86AudioRaiseVolume" = { + allow-when-locked = true; + action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" "increment" "3"; + }; + "XF86AudioLowerVolume" = { + allow-when-locked = true; + action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" "decrement" "3"; + }; + "XF86AudioMute" = { + allow-when-locked = true; + action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" "mute"; + }; + "XF86AudioMicMute" = { + allow-when-locked = true; + action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" "micmute"; + }; + }; + }) + (lib.mkIf (!cfg.enableSystemd) { + spawn-at-startup = [{ + command = [ "qs" "-c" "DankMaterialShell" ]; + }]; + }) + ]; - config.programs.quickshell.package = pkgs.lib.mkIf cfg.enable - self.inputs.quickshell.packages.x86_64-linux.quickshell; - - config.programs.quickshell.activeConfig = - pkgs.lib.mkIf cfg.enableSystemd "DankMaterialShell"; - config.programs.quickshell.systemd.enable = - pkgs.lib.mkIf cfg.enableSystemd true; - config.programs.quickshell.systemd.target = - pkgs.lib.mkIf cfg.enableSystemd "graphical-session.target"; - - config.programs.niri.settings.binds = pkgs.lib.mkIf cfg.enableKeybinds - (with config.lib.niri.actions; { - "Mod+Space" = { - hotkey-overlay.title = "Application Launcher"; - action = - spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "spotlight" - "toggle"; - }; - "Mod+V" = { - hotkey-overlay.title = "Clipboard Manager"; - action = - spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "clipboard" - "toggle"; - }; - "Mod+M" = { - hotkey-overlay.title = "Task Manager"; - action = - spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "processlist" - "toggle"; - }; - "Mod+Comma" = { - hotkey-overlay.title = "Settings"; - action = - spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "settings" - "toggle"; - }; - "Super+Alt+L" = { - hotkey-overlay.title = "Lock Screen"; - action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "lock" - "lock"; - }; - "XF86AudioRaiseVolume" = { - allow-when-locked = true; - action = - spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" - "increment" "3"; - }; - "XF86AudioLowerVolume" = { - allow-when-locked = true; - action = - spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" - "decrement" "3"; - }; - "XF86AudioMute" = { - allow-when-locked = true; - action = - spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" - "mute"; - }; - "XF86AudioMicMute" = { - allow-when-locked = true; - action = - spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" - "micmute"; - }; - }); - - config.home.packages = pkgs.lib.mkIf cfg.enable (with pkgs; [ - material-symbols - inter - fira-code - cava - wl-clipboard - cliphist - ddcutil - libsForQt5.qt5ct - kdePackages.qt6ct - matugen - ]); - - config.programs.niri.settings.spawn-at-startup = - pkgs.lib.mkIf (cfg.enable && !cfg.enableSystemd) [{ - command = [ "qs" "-c" "DankMaterialShell" ]; - }]; + home.packages = with pkgs; [ + material-symbols + inter + fira-code + cava + wl-clipboard + cliphist + ddcutil + libsForQt5.qt5ct + kdePackages.qt6ct + matugen + ]; + }; }; }; }