{ inputs.nixpkgs.url = "github:NixOS/nixpkgs/8585991bfb629edda1e42c191bef935d9d70d690"; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.home-manager.url = "github:nix-community/home-manager"; outputs = inputs: let remoteNixpkgsPatches = import nixpkgs/patches.nix; localNixpkgsPatches = [ ]; originPkgs = inputs.nixpkgs.legacyPackages."x86_64-linux"; nixpkgsPath = originPkgs.applyPatches { name = "nixpkgs-patched"; src = inputs.nixpkgs.outPath; patches = map originPkgs.fetchpatch remoteNixpkgsPatches ++ localNixpkgsPatches; postPatch = '' patch=$(printf '%s\n' ${builtins.concatStringsSep " " (map (p: p.sha256) remoteNixpkgsPatches ++ localNixpkgsPatches)} | sort | sha256sum | cut -c -7) echo "+patch-$patch" >.version-suffix ''; }; lib = originPkgs.lib; in { nixosConfigurations = lib.genAttrs [ "oignon" "patate" ] (hostName: import (nixpkgsPath + "/nixos/lib/eval-config.nix") { #inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux"; extraArgs = { inherit hostName inputs; hosts = inputs.self.nixosConfigurations; }; modules = [ (import (./hosts + "/${hostName}.nix")) inputs.nixpkgs.nixosModules.notDetected inputs.home-manager.nixosModules.home-manager ({ pkgs, ... }: { nix.registry.nixpkgs.flake = inputs.nixpkgs; nix.package = pkgs.nixFlakes; nix.extraOptions = "experimental-features = nix-command flakes"; #nixpkgs.overlays = import nixpkgs/overlays.nix; /* system.nixos.versionSuffix = ".${ lib.substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${ inputs.self.shortRev or "dirty"}"; system.nixos.revision = lib.mkIf (inputs.self ? rev) inputs.self.rev; */ # Let 'nixos-version --json' know about the Git revision of this flake. system.configurationRevision = lib.mkIf (inputs.self ? rev) inputs.self.rev; /* system.configurationRevision = if inputs.self ? rev then inputs.self.rev else throw "Refusing to build from a dirty Git tree!"; */ }) { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; } ]; }); } // inputs.flake-utils.lib.eachDefaultSystem (system: #let pkgs = inputs.nixpkgs.legacyPackages.${system}; in let pkgs = import nixpkgsPath { inherit system; config = {}; # Make the config pure, ignoring user's config. #overlays = import nixpkgs/overlays.nix; }; in { devShell = import ./shell.nix { inherit pkgs; }; } ); }