2 inputs.nixpkgs.url = "github:NixOS/nixpkgs/34f85de51bbc74595e63b22ee089adbb31f7c7a2";
3 inputs.flake-utils.url = "github:numtide/flake-utils";
4 inputs.home-manager.url = "github:nix-community/home-manager";
6 remoteNixpkgsPatches = import nixpkgs/patches.nix;
7 localNixpkgsPatches = [
8 nixpkgs/patches/sanoid.diff
10 originPkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
11 nixpkgsPath = originPkgs.applyPatches {
12 name = "nixpkgs-patched";
13 src = inputs.nixpkgs.outPath;
14 patches = map originPkgs.fetchpatch remoteNixpkgsPatches ++ localNixpkgsPatches;
16 patch=$(printf '%s\n' ${builtins.concatStringsSep " "
17 (map (p: p.sha256) remoteNixpkgsPatches ++ localNixpkgsPatches)} |
18 sort | sha256sum | cut -c -7)
19 echo "+patch-$patch" >.version-suffix
24 nixosConfigurations = lib.genAttrs [ "oignon" "patate" ] (hostName:
25 import (nixpkgsPath + "/nixos/lib/eval-config.nix") {
26 #inputs.nixpkgs.lib.nixosSystem {
27 system = "x86_64-linux";
29 inherit hostName inputs;
30 hosts = inputs.self.nixosConfigurations;
33 (import (./hosts + "/${hostName}.nix"))
34 inputs.nixpkgs.nixosModules.notDetected
35 inputs.home-manager.nixosModules.home-manager
37 nix.registry.nixpkgs.flake = inputs.nixpkgs;
38 nix.package = pkgs.nixFlakes;
39 nix.extraOptions = "experimental-features = nix-command flakes";
40 nixpkgs.overlays = import nixpkgs/overlays.nix;
42 system.nixos.versionSuffix = ".${
43 lib.substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${
44 inputs.self.shortRev or "dirty"}";
45 system.nixos.revision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
47 # Let 'nixos-version --json' know about the Git revision of this flake.
48 system.configurationRevision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
50 system.configurationRevision =
53 else throw "Refusing to build from a dirty Git tree!";
57 home-manager.useGlobalPkgs = true;
58 home-manager.useUserPackages = true;
63 inputs.flake-utils.lib.eachDefaultSystem (system:
64 #let pkgs = inputs.nixpkgs.legacyPackages.${system}; in
66 pkgs = import nixpkgsPath {
68 config = {}; # Make the config pure, ignoring user's config.
69 #overlays = import nixpkgs/overlays.nix;
71 devShell = import ./shell.nix { inherit pkgs; };