summary refs log tree commit diff
path: root/flake.nix
blob: ec2a03e98c2b4a7a239ac53f9eb984e01c9b83fc (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
  description = "tzlil's system(s)";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    impermanence.url = "github:nix-community/impermanence";
    agenix.url = "github:ryantm/agenix";
    nixos-hardware.url = "github:nixos/nixos-hardware";
    nixinate.url = "github:matthewcroughan/nixinate";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    programsdb = {
      url = "github:wamserma/flake-programs-sqlite";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    hyprland.url = "github:hyprwm/Hyprland";
  };

  outputs = inputs @ {self, ...}: let
    mkSystem_ = pkgs: system: h: modules:
      pkgs.lib.nixosSystem {
        system = system;
        modules = [./hosts/${h}/cfg.nix] ++ modules;
        specialArgs = {inherit inputs;};
      };
    mkSystem = pkgs: system: h: (mkSystem_ pkgs system h [
      inputs.agenix.nixosModules.age
      inputs.impermanence.nixosModules.impermanence
    ]);
  in {
    apps = inputs.nixinate.nixinate.x86_64-linux self;
    nixosConfigurations = {
      # pc = mkSystem inputs.nixpkgs "x86_64-linux" "pc";
      vm = mkSystem inputs.nixpkgs "x86_64-linux" "vm";
      vps = mkSystem inputs.nixpkgs "x86_64-linux" "vps";
    };

    formatter = {
      x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra;
    };
  };
}