{ outputs = { flake-root, flake-parts, home-manager, just-flake, nixpkgs, pre-commit-hooks, self, systems, ... }@inputs: let lib = nixpkgs.lib // home-manager.lib; secrets = builtins.fromTOML (builtins.readFile "${self}/secrets/secrets.toml"); systemsAttributes = lib.genAttrs (import systems); kansaiPkgs = import "${self}/lib/kansai-pkgs.nix" { inherit systemsAttributes nixpkgs self inputs ; }; in flake-parts.lib.mkFlake { inherit inputs; } { systems = builtins.attrNames (systemsAttributes (system: system)); imports = [ flake-root.flakeModule just-flake.flakeModule (import ./home { inherit kansaiPkgs self lib inputs secrets ; inherit (self) outputs; }) (import ./hosts { inherit kansaiPkgs self lib inputs secrets ; inherit (self) outputs; }) ]; perSystem = { system, config, ... }: let pkgs = (kansaiPkgs { })."${system}"; in { packages.default = home-manager.defaultPackage."${system}"; formatter = pkgs.nixfmt-rfc-style; just-flake.features.default = { enable = true; justfile = '' action target action: git add . && nix develop --command rui --allow-unfree --allow-insecure {{target}} {{action}} -- --impure build target: just action {{target}} build switch target: just action {{target}} switch news user='ebisu': rui home news --user {{user}} -- --impure check: nix develop --command nix flake check push message: git add . && git commit -m "{{message}}" && git push origin main commit message: git add . && git commit -m "{{message}}" restore: git restore --staged . && git restore . deploy hostname user='root': git add . && nixos-rebuild \ --flake .#{{hostname}} \ --target-host {{user}}@{{hostname}} \ --use-remote-sudo \ switch provision ip hostname: doas nix run github:nix-community/nixos-anywhere \ -- \ --flake .#{{hostname}} root@{{ip}} ''; }; checks.pre-commit-check = pre-commit-hooks.lib.${system}.run { src = ./.; hooks = { deadnix.enable = true; flake-checker.enable = true; nixfmt-rfc-style.enable = true; statix.enable = true; }; }; devShells.default = pkgs.mkShell { inherit (self.checks.${system}.pre-commit-check) shellHook; buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; inputsFrom = [ config.flake-root.devShell config.just-flake.outputs.devShell ]; }; }; }; inputs = { chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; flake-root.url = "github:srid/flake-root"; just-flake.url = "github:juspay/just-flake"; nur.url = "github:nix-community/NUR"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs-stable.url = "github:NixOS/nixpkgs/24.05"; nix-filter.url = "github:numtide/nix-filter"; systems.url = "github:nix-systems/default"; aagl = { url = "github:ezKEa/aagl-gtk-on-nix"; inputs = { flake-compat.follows = "flake-compat"; nixpkgs.follows = "nixpkgs"; }; }; apple-fonts = { url = "github:Lyndeno/apple-fonts.nix"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; flake-registry = { url = "github:NixOS/flake-registry"; flake = false; }; flake-utils = { url = "github:numtide/flake-utils"; inputs.systems.follows = "systems"; }; gitignore = { url = "github:hercules-ci/gitignore.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; hyprfocus = { url = "github:pyt0xic/hyprfocus"; inputs = { hyprland.follows = "hyprland"; nix-filter.follows = "nix-filter"; }; }; hyprland = { type = "git"; url = "https://github.com/hyprwm/Hyprland"; submodules = true; inputs = { nixpkgs.follows = "nixpkgs"; systems.follows = "systems"; }; }; hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; inputs = { hyprland.follows = "hyprland"; nixpkgs.follows = "nixpkgs"; systems.follows = "systems"; }; }; nix-alien = { url = "github:thiagokokada/nix-alien"; inputs = { flake-compat.follows = "flake-compat"; flake-utils.follows = "flake-utils"; nix-filter.follows = "nix-filter"; nix-index-database.follows = "nix-index-database"; nixpkgs.follows = "nixpkgs"; }; }; nix-gaming = { url = "github:fufexan/nix-gaming"; inputs = { flake-parts.follows = "flake-parts"; nixpkgs.follows = "nixpkgs"; }; }; nix-index-database = { url = "github:nix-community/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; nix-search = { url = "github:diamondburned/nix-search"; inputs = { flake-compat.follows = "flake-compat"; flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; nix-thorium = { url = "github:almahdi/nix-thorium"; inputs.nixpkgs.follows = "nixpkgs"; }; notion-repackaged = { url = "github:pikokr/nix-notion-repackaged"; inputs.nixpkgs.follows = "nixpkgs"; }; # TODO: inputs omnix = { url = "github:juspay/omnix"; inputs = { nixpkgs.follows = "nixpkgs"; systems.follows = "systems"; }; }; pia = { url = "github:Fuwn/nixos-pia"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; pre-commit-hooks = { url = "github:cachix/git-hooks.nix"; inputs = { flake-compat.follows = "flake-compat"; gitignore.follows = "gitignore"; nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs-stable"; }; }; nix-prettier = { url = "github:loophp/nix-prettier"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; pywal-nix = { url = "github:Fuwn/pywal-nix"; inputs = { flake-compat.follows = "flake-compat"; flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; pre-commit-hooks.follows = "pre-commit-hooks"; systems.follows = "systems"; }; }; rui = { url = "github:Fuwn/rui"; inputs = { flake-compat.follows = "flake-compat"; flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; pre-commit-hooks.follows = "pre-commit-hooks"; systems.follows = "systems"; }; }; sops-nix = { url = "github:Mic92/sops-nix"; inputs = { nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs-stable"; }; }; spicetify-nix = { url = "github:the-argus/spicetify-nix"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; tailray = { url = "github:NotAShelf/tailray"; inputs.nixpkgs.follows = "nixpkgs"; }; tsutsumi = { url = "github:Fuwn/tsutsumi"; inputs = { flake-compat.follows = "flake-compat"; flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; pre-commit-hooks.follows = "pre-commit-hooks"; systems.follows = "systems"; rui.follows = "rui"; }; }; }; }