Init
This commit is contained in:
commit
18403b428e
2 changed files with 310 additions and 0 deletions
72
flake.nix
Normal file
72
flake.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
# flake.nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "https://mirrors.cernet.edu.cn/nix-channels/nixos-unstable/nixexprs.tar.xz";
|
||||
home-manager = {
|
||||
url = "https://git.zmsun.cn/mirror/2.home-manager/archive/master.tar.gz";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
unf = {
|
||||
url = "git+https://git.zmsun.cn/pkg/unf";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
agenix = {
|
||||
url = "https://git.zmsun.cn/mirror/3.agenix/archive/main.tar.gz";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
inputs.darwin.url = "https://git.zmsun.cn/mirror/3.1.nix-darwin/archive/master.tar.gz";
|
||||
inputs.systems.url = "https://git.zmsun.cn/mirror/3.2.nix-systems/archive/main.tar.gz";
|
||||
};
|
||||
|
||||
sops-nix = {
|
||||
url = "git+https://git.zmsun.cn/pkg/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... } @ inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
lib = nixpkgs.lib;
|
||||
modules = {
|
||||
agenix = inputs.agenix.nixosModules.default;
|
||||
sops-nix = inputs.sops-nix.nixosModules.default;
|
||||
};
|
||||
jsonDerivations = with builtins; mapAttrs (n: v: inputs.unf.lib.json {
|
||||
inherit self pkgs;
|
||||
modules = [ v ];
|
||||
}) modules;
|
||||
in
|
||||
{
|
||||
packages.${system} = rec {
|
||||
default = json;
|
||||
json = pkgs.runCommand "doc-extra-options" {
|
||||
nativeBuildInputs = [ pkgs.coreutils ];
|
||||
} (let
|
||||
aim = "$out/share/doc/doc-extra-options";
|
||||
cpCommands = lib.concatMapStringsSep "" (name:
|
||||
"cp ${jsonDerivations.${name}} ${aim}/${name}.json\n"
|
||||
) (builtins.attrNames jsonDerivations);
|
||||
in ''
|
||||
mkdir -p ${aim}
|
||||
${cpCommands}
|
||||
'');
|
||||
json-allinone = inputs.unf.lib.json {
|
||||
inherit self pkgs;
|
||||
projectName = "Extra Docs";
|
||||
modules = builtins.attrValues modules;
|
||||
};
|
||||
html = inputs.unf.lib.html {
|
||||
inherit self pkgs;
|
||||
projectName = "Extra options";
|
||||
newPath = "https://doc.zmsun.cn/extra";
|
||||
specialArgs = { goodDx = true; };
|
||||
modules = builtins.attrValues modules;
|
||||
userOpts = { warningsAreErrors = false; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue