~cyplo/dotfiles

ref: 1ca69547b9a678da7a89ac93b7822ac478a2ab7d dotfiles/flake.nix -rw-r--r-- 2.5 KiB
1ca69547 — Cyryl Płotnicki update 4 months ago
                                                                                
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
  description = "NixOS configuration with flakes";
  outputs = { self, flake-utils, home-manager, nixpkgs-nixos-unstable, nixpkgs-stable, nixos-hardware, nur, agenix, neuron } @ inputs:

  let
    mkServer = pkgs: system: hostname:
    pkgs.lib.nixosSystem {
      system = system;
      modules = [
        (./. + "/nixos/boxes/${hostname}")
        agenix.nixosModules.age
      ];
      specialArgs = { inherit inputs; };
    };
    mkWorkstation = pkgs: system: hostname:
    pkgs.lib.nixosSystem {
      system = system;
      modules = [
        (./. + "/nixos/boxes/${hostname}")
        (import ./nixos/email-accounts.nix)

        home-manager.nixosModules.home-manager
        {
          home-manager.useGlobalPkgs = true;
          home-manager.useUserPackages = true;
          home-manager.users.cyryl = import ./nixos/home-manager;
        }

      ];
      specialArgs = { inherit inputs; };
    };
  in

  {
    nixosConfigurations = {
      bootstrap = nixpkgs-stable.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          (./. + "/nixos/boxes/bootstrap")
        ];
        specialArgs = { inherit inputs; };
      };
      foureighty = mkWorkstation nixpkgs-stable "x86_64-linux" "foureighty";
      skinnyv = mkWorkstation nixpkgs-stable "x86_64-linux" "skinnyv";
      brix = mkServer nixpkgs-stable "x86_64-linux" "brix";
      vultr1 = mkServer nixpkgs-stable "x86_64-linux" "vultr1";
    };
  };
  inputs = {
    nixpkgs-nixos-unstable = {
      type = "github";
      owner = "NixOS";
      repo = "nixpkgs";
      ref = "nixos-unstable";
    };

    nixpkgs-stable = {
      type = "github";
      owner = "NixOS";
      repo = "nixpkgs";
      ref = "nixos-21.05";
    };

    nixos-hardware = {
      type = "github";
      owner = "NixOS";
      repo = "nixos-hardware";
      ref = "master";
    };

    home-manager = {
      type = "github";
      owner = "nix-community";
      repo = "home-manager";
      ref = "release-21.05";
      inputs = {
        nixpkgs.follows = "nixpkgs-stable";
      };
    };

    flake-utils = {
      type = "github";
      owner = "numtide";
      repo = "flake-utils";
      ref = "master";
    };

    nur = {
      type = "github";
      owner = "nix-community";
      repo = "NUR";
      ref = "master";
    };

    agenix = {
      type = "github";
      owner = "ryantm";
      repo = "agenix";
      ref = "master";
    };

    neuron = {
      type = "github";
      owner = "srid";
      repo = "neuron";
      ref = "master";
    };
  };

}