# TODO: Add flake-utils, flake-parts, git-pre-hook { description = "Home Manager configuration"; inputs = { devshell.url = "github:numtide/devshell"; flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; nixgl = { url = "github:nix-community/nixGL"; inputs.nixpkgs.follows = "nixpkgs"; }; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nur.url = "github:nix-community/NUR"; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; treefmt-nix.url = "github:numtide/treefmt-nix"; }; outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } ( { withSystem, ... }: { systems = [ "aarch64-linux" ]; imports = [ inputs.home-manager.flakeModules.home-manager inputs.treefmt-nix.flakeModule inputs.devshell.flakeModule # ./home/flake-module.nix ]; flake = { homeConfigurations = { asahi = withSystem "aarch64-linux" ( { pkgs, ... }: inputs.home-manager.lib.homeManagerConfiguration { inherit pkgs; extraSpecialArgs = { inherit inputs pkgs; }; modules = [ ./home/home.nix inputs.lix-module.nixosModules.default inputs.sops-nix.homeManagerModules.sops { nixpkgs.overlays = [ inputs.nur.overlays.default ]; } ]; } ); }; }; perSystem = { system, config, ... }: let pkgs = import inputs.nixpkgs { inherit system; overlays = [ inputs.nur.overlays.default inputs.nixgl.overlays.default ]; }; in { _module.args.pkgs = pkgs; devshells.default = { commands = [ { help = "`home-manager switch` for asahi"; name = "switch-asahi"; command = "home-manager switch --flake .#asahi"; } { help = "`home-manager switch` for asahi with backup"; name = "switch-asahi-backup"; command = "home-manager switch --flake .#asahi -b backup"; } { help = "update dependencies"; name = "update"; command = "nix flake update"; } { help = "show home-manager documentation"; name = "man-home"; command = "man home-configuration.nix"; } ]; packages = [ config.treefmt.build.wrapper pkgs.age pkgs.forgejo-cli pkgs.helix pkgs.lix pkgs.marksman pkgs.nil pkgs.sops pkgs.taplo pkgs.uutils-coreutils pkgs.yaml-language-server ]; }; treefmt = ./treefmt.nix; }; } ); }