{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs"; hyprland.url = "github:hyprwm/Hyprland"; zen-browser = { url = "github:youwen5/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, hyprland, nixpkgs, zen-browser, home-manager, ... }: let system = "x86_64-linux"; inherit (hyprland.inputs) nixpkgs; eachSystem = nixpkgs.lib.genAttrs (import hyprland.inputs.systems); pkgsFor = eachSystem (system: import nixpkgs {localSystem = system;}); rawCommitPins = (builtins.fromTOML (builtins.readFile ./hyprpm.toml)).repository.commit_pins; commitPins = builtins.listToAttrs ( map (p: { name = builtins.head p; value = builtins.elemAt p 1; }) rawCommitPins ); srcRev = "${commitPins.${hyprland.rev} or "git"}"; srcRevShort = builtins.substring 0 7 srcRev; in { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { inherit system; modules = [ ./configuration.nix ./hardware-configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit self; }; # home-manager.users.user = import ./home.nix; # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix } (let inputs = { zen = zen-browser; }; in { config, pkgs, ... }: { environment.systemPackages = [ pkgs.git inputs.zen.packages.${pkgs.stdenv.hostPlatform.system}.default ]; } ) ]; }; packages = eachSystem (system: let pkgs = pkgsFor.${system}; in rec { hyprsplit = pkgs.stdenv.mkDerivation { pname = "hyprsplit"; version = "flakeRev=${self.shortRev or "dirty"}_srcRev=${srcRevShort}"; src = if (commitPins ? ${hyprland.rev}) && (self ? rev) then (builtins.fetchGit { url = "https://github.com/shezdy/hyprsplit"; rev = srcRev; }) else ./.; nativeBuildInputs = with pkgs; [pkg-config meson ninja gcc14]; buildInputs = with pkgs; [ hyprland.packages.${system}.hyprland.dev pixman libdrm ] ++ hyprland.packages.${system}.hyprland.buildInputs; meta = with pkgs.lib; { homepage = "https://github.com/shezdy/hyprsplit"; description = "Hyprland plugin for separate sets of workspaces on each monitor"; license = licenses.bsd3; platforms = platforms.linux; }; }; default = hyprsplit; }); devShells = eachSystem (system: let pkgs = pkgsFor.${system}; in { default = pkgs.mkShell.override {stdenv = pkgs.gcc14Stdenv;} { shellHook = '' meson setup build --reconfigure cp ./build/compile_commands.json ./compile_commands.json ''; name = "hyprsplit"; inputsFrom = [self.packages.${system}.hyprsplit]; }; }); }; }