all repos — nix-packages @ 519ecdfbde8e471f2316f972cd2ce0390d382fd8

My personal collection of packages for nix

flake.nix (view raw)

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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
  description = "My personal NUR repository";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    files.url = "github:mightyiam/files";
    git-hooks.url = "github:cachix/git-hooks.nix";
  };

  outputs =
    inputs@{ self, flake-parts, ... }:
    flake-parts.lib.mkFlake { inherit inputs; } (
      { ... }:
      {
        imports = [
          inputs.files.flakeModules.default
          inputs.git-hooks.flakeModule
        ];

        systems = [
          "x86_64-linux"
          "i686-linux"
          "aarch64-darwin"
          "aarch64-linux"
          "armv6l-linux"
          "armv7l-linux"
        ];
        perSystem =
          {
            self',
            pkgs,
            lib,
            config,
            ...
          }:
          let
            inherit pkgs;

            lpkgs = self'.legacyPackages;

            all = pkgs.symlinkJoin {
              name = "all";
              paths = (import ./ci.nix { inherit pkgs; }).cachePkgs;
            };
          in
          {
            legacyPackages = (import ./pkgs { inherit pkgs; });

            packages = (
              lpkgs
              // {
                inherit all;
                default = all;
              }
            );

            formatter = pkgs.nixfmt-tree;

            devShells.default = pkgs.mkShellNoCC {
              packages = [
                config.files.writer.drv
                config.pre-commit.settings.package
                pkgs.update-nix-fetchgit
              ]
              ++ config.pre-commit.settings.enabledPackages;

              shellHook = ''
                ${config.pre-commit.installationScript}
              '';
            };

            pre-commit = {
              check.enable = true;
              settings.hooks.gen-files = {
                enable = true;
                name = "Generate files from the files flake-parts module";
                files = "\\.nix$";
                excludes = [
                  "ci.nix"
                  "overlay.nix"
                ];
                pass_filenames = false;
                entry =
                  let
                    inherit (config.files.writer) drv exeFilename;
                  in
                  "${drv}/bin/${exeFilename}";
              };
            };

            files.files = [
              {
                path_ = "README.md";
                drv =
                  let
                    inherit (lib) mapAttrsToList concatStringsSep;
                    ps = lib.filterAttrs (k: v: (k != "all") && (lib.isDerivation v)) lpkgs;

                    plist = mapAttrsToList (name: p: ''
                      ### ${name}
                      - Version: ${p.version}
                      - Homepage: ${p.meta.homepage}
                      - Description: ${p.meta.description}
                    '') ps;

                    mkModuleList = mapAttrsToList (
                      mod: _: ''
                        - ${mod}
                      ''
                    );
                  in
                  pkgs.writeText "README.md" ''
                    # nix-packages

                    **My personal [NUR](https://github.com/nix-community/NUR) repository**

                    ## Packages
                    ${concatStringsSep "\n" plist}
                    ## Modules
                    ### NixOS
                    ${concatStringsSep "\n" (mkModuleList self.outputs.nixosModules)}
                    ### Darwin
                    ${concatStringsSep "\n" (mkModuleList self.outputs.darwinModules)}
                    ### Home Manager
                    ${concatStringsSep "\n" (mkModuleList self.outputs.homeModules)}
                  '';
              }
            ];
          };
        flake = {
          overlays = {
            default = import ./overlay.nix;
          };

          nixosModules = import ./modules/nixos;
          darwinModules = import ./modules/darwin;
          homeModules = import ./modules/home;
        };
      }
    );
}