summaryrefslogtreecommitdiff
path: root/users/ryan/linux/foreign.nix
blob: b1b06ab7e5d2ddd93d201237c8c9209fa775cb9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ inputs, ... }:

# Applies to any standalone (non-NixOS) home-manager install, where
# home-manager owns the user profile on its own instead of being wired in
# via a NixOS module. NixOS manages nix.conf/the flake registry and doesn't
# need the genericLinux target at all, so this is skipped on NixOS hosts.
{
  targets.genericLinux.enable = true;

  xdg.configFile."nix/nix.conf".text = "experimental-features = nix-command flakes\n";
  xdg.configFile."nix/registry.json".text = builtins.toJSON {
    version = 2;
    flakes = [
      {
        from = { type = "indirect"; id = "nixpkgs"; };
        to = {
          type = "path";
          path = inputs.nixpkgs.outPath;
          lastModified = inputs.nixpkgs.lastModified;
          narHash = inputs.nixpkgs.narHash;
        };
      }
    ];
  };
}