aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/libghostty-vt/nix/vm/create.nix
blob: f8fe8500da77769344f24b7fd9a3d95e3b079ac2 (plain) (blame)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
  system,
  nixpkgs,
  overlay,
  module,
  common ? ./common.nix,
  uid ? 1000,
  gid ? 1000,
}: let
  pkgs = import nixpkgs {
    inherit system;
    overlays = [
      overlay
    ];
  };
in
  nixpkgs.lib.nixosSystem {
    system = builtins.replaceStrings ["darwin"] ["linux"] system;
    modules = [
      {
        virtualisation.vmVariant = {
          virtualisation.host.pkgs = pkgs;
        };

        nixpkgs.overlays = [
          overlay
        ];

        users.groups.ghostty = {
          gid = gid;
        };

        users.users.ghostty = {
          uid = uid;
        };

        system.stateVersion = nixpkgs.lib.trivial.release;
      }
      common
      module
    ];
  }