aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
blob: 729ab7ea29d9c57163c530bfde19bddb4015ada7 (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
45
46
47
48
{
  description = "Cross-platform Nix system configuration (NixOS + standalone home-manager)";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, home-manager, ... }@inputs:
    let
      lib = import ./lib { inherit inputs; };

      forAllSystems = nixpkgs.lib.genAttrs [
        "x86_64-linux"
        "aarch64-linux"
        "x86_64-darwin"
        "aarch64-darwin"
      ];
    in
    {
      # No real NixOS host exists yet. hosts/template/ is copy-source only and
      # is deliberately not wired in here — see hosts/template/ and README.md.
      nixosConfigurations = { };

      homeConfigurations = {
        "tom@linux" = lib.mkHome {
          username = "tom";
          system = "x86_64-linux";
        };
      };

      formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);

      devShells = forAllSystems (system:
        let
          pkgs = nixpkgs.legacyPackages.${system};
        in
        {
          default = pkgs.mkShell {
            packages = [ pkgs.statix pkgs.deadnix pkgs.nixfmt-rfc-style ];
          };
        });
    };
}