summaryrefslogtreecommitdiff
path: root/flake.nix
blob: e0c3a5d8f10661e7600a3b2a5908deb5aee4417d (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
49
50
51
52
53
54
55
56
57
58
59
60
{
  description = "Home Manager configuration";

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

  outputs = inputs@{
    self,
    nixpkgs,
    home-manager,
    sops-nix,
    ...
  }: let
    system = "x86_64-linux";
    pkgs = import nixpkgs {inherit system;};
    lib = (nixpkgs.lib.extend (_: _: home-manager.lib)).extend (import ./lib);
  in with lib; {
    inherit lib;

    nixosConfigurations.lemptop = nixpkgs.lib.nixosSystem {
      inherit lib system;
      specialArgs = {inherit inputs;};
      modules = [
        ({config, ... }: {
          nixpkgs.overlays = with lib; [(composeManyExtensions [
            (import ./overlays/vimPlugins.nix {inherit pkgs;})
            (import ./overlays/suckless.nix {inherit pkgs; home = config.users.users.mike.home;})
          ])];
        })
        ./machines/lemptop.nix
      ] ++ (attrValues
        (attrsets.mergeAttrsList [
          (modulesIn ./profiles/core)
          (modulesIn ./profiles/station)
          (modulesIn ./profiles/email)
        ]));
    };

    templates = {
      default = {
        path = ./templates/flake;
        description = "Python and go stuff";
      };
      ansible = {
        path = ./templates/ansible;
        description = "Ansible and shellhook to login to awx";
      };
      go = {
        path = ./templates/go;
        description = "Go, gotools, and gofumpt";
      };
    };
  };
}