Home

mint @main - refs - log -
-
https://git.jolheiser.com/mint.git
Budget
mint / flake.nix
- raw -
 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
  outputs =
    { nixpkgs, ... }:
    let
      systems = [
        "x86_64-linux"
        "i686-linux"
        "x86_64-darwin"
        "aarch64-linux"
        "armv6l-linux"
        "armv7l-linux"
      ];
      forAllSystems = f: nixpkgs.lib.genAttrs systems f;
    in
    {
      packages = forAllSystems (system: import ./nix { pkgs = import nixpkgs { inherit system; }; });
      devShells = forAllSystems (
        system:
        let
          pkgs = import nixpkgs { inherit system; };
        in
        {
          default = pkgs.mkShell {
            nativeBuildInputs = with pkgs; [
              uv
              ruff
              mypy
              (with python3Packages; [
                rope
                pytest
                python-lsp-server
                pylsp-mypy
                python-lsp-ruff
                pylsp-rope
              ])
            ];
          };
        }
      );
      nixosModules.default = import ./nix/module.nix;
      nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./nix/vm.nix
          {
            virtualisation.vmVariant.virtualisation = {
              cores = 2;
              memorySize = 2048;
              graphics = false;
              forwardPorts = [
                {
                  from = "host";
                  host.port = 6468;
                  guest.port = 6468;
                }
              ];
            };
            system.stateVersion = "23.11";
          }
        ];
      };
      apps = forAllSystems (
        system:
        let
          pkgs = import nixpkgs { inherit system; };
        in
        {
          vm = {
            type = "app";
            program = "${pkgs.writeShellScript "vm" ''
              nixos-rebuild build-vm --flake .#vm
              ./result/bin/run-nixos-vm
              rm nixos.qcow2
            ''}";
          };
        }
      );
    };
}