2 inputs.nixpkgs.url = "github:NixOS/nixpkgs/b69f140a8028e4718bde4e5082f8df38e50b7971";
3 inputs.flake-utils.url = "github:numtide/flake-utils";
5 remoteNixpkgsPatches = [
7 { meta.description = "nixos-install: add support for inputs";
8 url = "https://github.com/NixOS/nixpkgs/pull/95194.diff";
9 sha256 = "sha256-R6LAHDM8FNQxsql5fiV16aDapKtZ7H/Q04pz1wjnSqQ";
13 localNixpkgsPatches = [
15 originPkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
16 nixpkgsPath = originPkgs.applyPatches {
17 name = "nixpkgs-patched";
18 src = inputs.nixpkgs.outPath;
19 patches = map originPkgs.fetchpatch remoteNixpkgsPatches ++ localNixpkgsPatches;
21 patch=$(printf '%s\n' ${builtins.concatStringsSep " "
22 (map (p: p.sha256) remoteNixpkgsPatches ++ localNixpkgsPatches)} |
23 sort | sha256sum | cut -c -7)
24 echo "+patch-$patch" >.version-suffix
29 nixosConfigurations.oignon =
30 let machineName = "oignon"; in
31 #import (nixpkgsPath + "/nixos/lib/eval-config.nix") {
32 inputs.nixpkgs.lib.nixosSystem {
33 system = "x86_64-linux";
35 inherit machineName inputs;
36 machines = inputs.self.nixosConfigurations;
40 nix.registry.nixpkgs.flake = inputs.nixpkgs;
41 nix.package = pkgs.nixFlakes;
42 nix.extraOptions = "experimental-features = nix-command flakes";
43 #nixpkgs.overlays = import nixpkgs/overlays.nix;
45 system.nixos.versionSuffix = ".${
46 lib.substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${
47 inputs.self.shortRev or "dirty"}";
48 system.nixos.revision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
50 # Let 'nixos-version --json' know about the Git revision of this flake.
51 system.configurationRevision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
53 system.configurationRevision =
56 else throw "Refusing to build from a dirty Git tree!";
59 (import (./machines + "/${machineName}.nix"))
60 inputs.nixpkgs.nixosModules.notDetected
64 inputs.flake-utils.lib.eachDefaultSystem (system:
65 #let pkgs = inputs.nixpkgs.legacyPackages.${system}; in
67 pkgs = import nixpkgsPath {
69 config = {}; # Make the config pure, ignoring user's config.
70 #overlays = import nixpkgs/overlays.nix;
72 devShell = import ./shell.nix { inherit pkgs; };