{ description = "My nixOS flake for home-manager"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; }; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; zen-browser = { url = "github:0xc000022070/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, home-manager, niri, rust-overlay, agenix, ... }@inputs: let username = "primary"; homeDirectory = "/home/${username}"; hostname = nixpkgs.lib.strings.removeSuffix "\n" (builtins.readFile /etc/hostname); pkgs' = (import nixpkgs { system = "x86_64-linux"; }).applyPatches { name = "nixpkgs"; src = inputs.nixpkgs; patches = [ # https://github.com/NixOS/nixpkgs/pull/67576 # gimp 3.0 (builtins.fetchurl { url = "https://github.com/NixOS/nixpkgs/pull/67576.diff"; sha256 = "02fk89563m2xfrl7kl9s1hh4bcppwrmd60j542kyl64nd2cvp9ss"; }) # mistral-rs 0.5.0 # https://github.com/NixOS/nixpkgs/pull/392645 (builtins.fetchurl { url = "https://github.com/NixOS/nixpkgs/pull/392645.diff"; sha256 = "1sc65jfx5ngsa4zkfnybg6ma65g2wgzd6ac1gajxwqni5470i5rq"; }) ]; }; pkgs = import pkgs' { system = "x86_64-linux"; }; in { formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; homeConfigurations."${username}" = home-manager.lib.homeManagerConfiguration { inherit pkgs; extraSpecialArgs = { inherit inputs username homeDirectory optimizeWithFlags ; }; modules = [ ./system-${hostname}.nix niri.homeModules.config agenix.homeManagerModules.age ( { pkgs, ... }: { nixpkgs.overlays = [ rust-overlay.overlays.default inputs.niri.overlays.niri ]; # home-manager stuff home = { inherit username homeDirectory; }; } ) ]; }; }; }