aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
blob: 33b647d20f9e38775fb2761ed5fe678022d05ad9 (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
61
62
63
64
65
66
67
68
69
{
  description = "Cynerd's personal flake";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable-small";
    nixos-hardware.url = "nixos-hardware";
    nixdeploy.url = "gitlab:cynerd/nixdeploy";
    personal-secret.url = "git+ssh://git@cynerd.cz/nixos-personal-secret";

    agenix.url = "github:ryantm/agenix";
    shvspy.url = "git+https://github.com/silicon-heaven/shvspy.git?submodules=1";
    shvcli.url = "github:silicon-heaven/shvcli";

    nixturris.url = "gitlab:cynerd/nixturris";
    nixbigclown.url = "github:cynerd/nixbigclown";
    vpsadminos.url = "github:vpsfreecz/vpsadminos";

    shellrc.url = "git+https://git.cynerd.cz/shellrc";
    usbkey.url = "gitlab:cynerd/usbkey";
  };

  outputs = {
    self,
    nixpkgs,
    flake-utils,
    agenix,
    shvspy,
    shvcli,
    nixdeploy,
    shellrc,
    usbkey,
    ...
  }: let
    inherit (flake-utils.lib) eachDefaultSystem filterPackages;
    inherit (nixpkgs.lib) mapAttrs' nameValuePair filterAttrs;
  in
    {
      lib = import ./lib nixpkgs.lib;
      overlays = {
        noInherit = final: prev: import ./pkgs final prev;
        default = nixpkgs.lib.composeManyExtensions [
          agenix.overlays.default
          shvspy.overlays.default
          shvcli.overlays.default
          nixdeploy.overlays.default
          shellrc.overlays.default
          usbkey.overlays.default
          self.overlays.noInherit
        ];
      };
      nixosModules = import ./nixos self;
      nixosConfigurations = import ./nixos/configurations.nix self;
    }
    // eachDefaultSystem (system: let
      pkgs = nixpkgs.legacyPackages."${system}".extend self.overlays.default;
    in {
      packages =
        {default = pkgs.nixdeploy;}
        // mapAttrs' (n: v:
          nameValuePair
          "tarball-${n}"
          v.buildPlatform.${system}.config.system.build.tarball) (filterAttrs
          (n: v: v.config.system.build ? tarball)
          self.nixosConfigurations);
      legacyPackages = pkgs;
      devShells = filterPackages system (import ./devShells pkgs);
      formatter = pkgs.alejandra;
    });
}