Vic's *Nix config.
1{
2 inputs,
3 lib,
4 den,
5 ...
6}:
7{
8 perSystem =
9 { pkgs, ... }:
10 {
11 devShells.default =
12 let
13 system = pkgs.stdenvNoCC.targetPlatform.system;
14 apps = inputs.self.packages.${system};
15
16 denApps = den.lib.nh.denApps {
17 outPrefix = [ ];
18 fromFlake = false;
19 } pkgs;
20
21 formatter = inputs.self.formatter.${system};
22 fmtt = pkgs.writeShellApplication {
23 name = "fmtt";
24 text = ''
25 ${lib.getExe formatter} "$@"
26 '';
27 };
28
29 nix_conf = {
30 inherit (inputs.self.nixosConfigurations.nargun.config.nix.settings)
31 experimental-features
32 substituters
33 trusted-public-keys
34 ;
35 };
36
37 nix_conf_file = pkgs.writeTextFile {
38 name = "nix.conf";
39 text = lib.concatStringsSep "\n" (
40 lib.mapAttrsToList (name: value: "extra-${name} = ${lib.concatStringsSep " " value}") nix_conf
41 );
42 };
43
44 shellHook = ''
45 export NIX_USER_CONF_FILES="${nix_conf_file}"
46 '';
47
48 in
49 pkgs.mkShell {
50 shellHook = shellHook;
51 buildInputs = denApps ++ [
52 fmtt
53 apps.vic-sops-rotate
54 apps.vic-sops-get
55 # apps.edgevpn
56 apps.gh-deps-update
57 pkgs.nh
58 pkgs.sops
59 pkgs.just
60 pkgs.npins
61 pkgs.cachix
62 pkgs.nix-unit
63 ];
64 };
65 };
66}