summary refs log tree commit diff stats
path: root/flake.nix
blob: 644fa4b42b4e4e293a4f5fe4cbe2b35f03b4d96d (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
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
{
  description = "Nixos server config";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05-small";

    systems.url = "github:nix-systems/x86_64-linux";
    flake-utils = {
      url = "github:numtide/flake-utils";
      inputs.systems.follows = "systems";
    };

    # modules
    disko = {
      url = "github:nix-community/disko";
      inputs = {
        nixpkgs.follows = "nixpkgs";
      };
    };
    impermanence = {
      url = "github:nix-community/impermanence";
      inputs = {
      };
    };
    simple-nixos-mailserver = {
      url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.05";
      inputs = {
        nixpkgs.follows = "nixpkgs";
      };
    };
  };

  outputs = {
    self,
    nixpkgs,
    # modules
    simple-nixos-mailserver,
    impermanence,
    disko,
    ...
  } @ attrs: let
    system = "x86_64-linux";
    pkgs = nixpkgs.legacyPackages.${system};
  in {
    nixosConfigurations."server1" = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs = attrs;
      modules = [
        ./hosts/server1/configuration.nix
        simple-nixos-mailserver.nixosModule
        {
          mailserver = import ./system/mail {inherit (pkgs) lib;};
        }
        disko.nixosModules.default
        impermanence.nixosModules.impermanence
      ];
    };
    devShells."${system}" = {
      default = pkgs.mkShell {
        packages = with pkgs; [
          nil
          alejandra
          statix
          shellcheck
          ltex-ls
          cocogitto
          git-crypt
        ];
      };
    };
  };
}
# vim: ts=2