{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-latest.url = github:NixOS/nixpkgs/nixos-unstable; home-manager.url = github:nix-community/home-manager; pwnix = { inputs.nixpkgs.follows = "nixpkgs"; url = git+https://im.badat.dev/bad/pwnix.git; }; agenix.url = github:ryantm/agenix; nixos-hardware.url = github:NixOS/nixos-hardware; oxalica.url = github:oxalica/rust-overlay; helix.url = "github:helix-editor/helix"; }; outputs = args@{ home-manager, nixpkgs, agenix, nixos-hardware, oxalica, ... }: with nixpkgs; rec { # Configurations for NixOS machines. nixosConfigurations = let mkUserConfig = path: { config, ... }: { imports = [ home-manager.nixosModules.home-manager ]; config = { home-manager.users."riley" = (import "${path}/home.nix"); home-manager.extraSpecialArgs = args // { age = config.age; }; home-manager.useGlobalPkgs = true; }; }; in { # Desktop system "strawberry" = lib.nixosSystem { system = "x86_64-linux"; modules = [ (mkUserConfig ./system/strawberry) agenix.nixosModules.default ./system/strawberry/core.nix ./shared/core ./shared/secrets.nix ]; specialArgs = args; }; # Thinkpad "lime" = lib.nixosSystem { system = "x86_64-linux"; modules = [ (mkUserConfig ./system/lime) agenix.nixosModules.default ./system/lime/core.nix ./shared/core ./shared/secrets.nix ]; specialArgs = args; }; # Raspberry Pi hosting my website "cherry" = lib.nixosSystem { system = "aarch64-linux"; modules = [ ./system/cherry/core.nix ]; }; }; # Configurations for non-NixOS machines. homeConfigurations = with home-manager.lib; { "dev-lt-63" = homeManagerConfiguration { extraSpecialArgs = args; pkgs = import nixpkgs { system = "x86_64-linux"; }; modules = [ agenix.homeManagerModules.default ./system/dev-lt-63/home.nix ./shared/home ]; }; }; overlays = { default = (import ./shared/overlay.nix args.helix); }; devShells."x86_64-linux"."utils" = let pkgs = import nixpkgs { system = "x86_64-linux"; }; in pkgs.mkShell { buildInputs = import ./shared/env.nix pkgs; }; }; }