diff --git a/README.md b/README.md index 2b7e95c..0f19fd5 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ * https://nixos.wiki/wiki/Flakes * https://teu5us.github.io/nix-lib.html * https://ryantm.github.io/nixpkgs/builders/trivial-builders/ +* https://nixos.wiki/wiki/Nix-writers # TODOs: diff --git a/flake.nix b/flake.nix index 167a806..71c0106 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11-small"; inputs.unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small"; inputs.nur.url = "github:nix-community/NUR"; - inputs.home-manager.url = "github:nix-community/home-manager"; + inputs.home-manager.url = "github:nix-community/home-manager"; #/release-22.11"; inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs"; inputs.nixos-hardware.url = "github:NixOS/nixos-hardware"; diff --git a/hosts/noximilien/default.nix b/hosts/noximilien/default.nix index 564404e..99fb484 100644 --- a/hosts/noximilien/default.nix +++ b/hosts/noximilien/default.nix @@ -48,9 +48,11 @@ #../../profiles/web/services/openspeedtest ../../profiles/web/docs - ../../profiles/web/docs/pdoc - ../../profiles/web/docs/python-docs - ../../profiles/web/docs/yagcd + ../../profiles/web/docs/pdoc.nix + ../../profiles/web/docs/python-docs.nix + ../../profiles/web/docs/nixpkgs.nix + ../../profiles/web/docs/linux-docs.nix + ../../profiles/web/docs/yagcd.nix ../../profiles/web/sites/linktree-pbsds ../../profiles/web/sites/refleksjon-no diff --git a/profiles/web/docs/default.nix b/profiles/web/docs/default.nix index eed40b2..d161c1a 100644 --- a/profiles/web/docs/default.nix +++ b/profiles/web/docs/default.nix @@ -5,10 +5,16 @@ services.docs-to-host.docs = mkOption { type = types.listOf (types.submodule { options = { - subdir = mkOption { + dirname = mkOption { type = types.str; - example = "pdoc"; - description = lib.mdDoc "The path at which the documentation will be linked"; + example = "linux-doc"; + description = lib.mdDoc "The relative dirname at which the documentation will be linked"; + }; + basename = mkOption { + type = types.str; + example = "foobar.html"; + default = ""; + description = lib.mdDoc "The basename at which the documentation will be linked"; }; path = mkOption { type = types.path; @@ -29,8 +35,8 @@ config = let cfg = config.services.docs-to-host; - mkRow = {subdir, path, desc}: ''${subdir}/${desc}''; - mkEntry = {subdir, path, desc}: { name = subdir; path = path; }; + mkRow = {dirname, basename, path, desc}: ''${dirname}${desc}''; + mkEntry = {dirname, basename, path, desc}: { name = dirname; path = path; }; in { services.nginx.virtualHosts.${mkDomain "docs"} = { forceSSL = true; # addSSL = true; diff --git a/profiles/web/docs/linux-docs.nix b/profiles/web/docs/linux-docs.nix new file mode 100644 index 0000000..dd5e82e --- /dev/null +++ b/profiles/web/docs/linux-docs.nix @@ -0,0 +1,8 @@ +{ config, pkgs, lib, ... }: +{ + services.docs-to-host.docs = [{ + desc = "Linux kernel html documentation"; + dirname = "linux-docs"; + path = "${pkgs.linux-doc}/share/doc/linux-doc"; + }]; +} diff --git a/profiles/web/docs/nixpkgs.nix b/profiles/web/docs/nixpkgs.nix new file mode 100644 index 0000000..e3d4925 --- /dev/null +++ b/profiles/web/docs/nixpkgs.nix @@ -0,0 +1,21 @@ +{ config, pkgs, lib, inputs, ... }: +let + # https://stackoverflow.com/a/60232211 + nixpkgs-manual = import "${inputs.nixpkgs}/doc" { inherit pkgs; }; + nixos-manual = (import "${inputs.nixpkgs}/nixos/release.nix" { inherit (inputs) nixpkgs; }).manualHTML.${config.nixpkgs.system}; +in +{ + services.docs-to-host.docs = [ + { + dirname = "nixpkgs-manual"; + basename= "manual.html"; + path = "${nixpkgs-manual}/share/doc/nixpkgs"; + desc = "Officia nixpkgs manual"; + } + { + dirname = "nixos-manual"; + path = "${nixos-manual}/share/doc/nixos"; + desc = "Officia Nixos manual"; + } + ]; +} diff --git a/profiles/web/docs/pdoc/default.nix b/profiles/web/docs/pdoc.nix similarity index 95% rename from profiles/web/docs/pdoc/default.nix rename to profiles/web/docs/pdoc.nix index cc159da..2f282c7 100644 --- a/profiles/web/docs/pdoc/default.nix +++ b/profiles/web/docs/pdoc.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, mkDomain, ... }: +{ config, pkgs, lib, ... }: let # pdoc data @@ -257,14 +257,14 @@ in { services.docs-to-host.docs = [ { - subdir = "pdoc-docs"; - path = mkPdocs false; - desc = "Documentation for various python modules, generated with pdoc"; + dirname = "pdoc-docs"; + path = mkPdocs false; + desc = "Documentation for various python modules, generated with pdoc"; } { - subdir = "pdoc3-docs"; - path = mkPdocs true; - desc = "Documentation for various python modules, generated with pdoc"; + dirname = "pdoc3-docs"; + path = mkPdocs true; + desc = "Documentation for various python modules, generated with pdoc3"; } ]; diff --git a/profiles/web/docs/python-docs/default.nix b/profiles/web/docs/python-docs.nix similarity index 53% rename from profiles/web/docs/python-docs/default.nix rename to profiles/web/docs/python-docs.nix index c0bb43c..873f2a0 100644 --- a/profiles/web/docs/python-docs/default.nix +++ b/profiles/web/docs/python-docs.nix @@ -2,9 +2,9 @@ let python-versions = lib.attrNames (lib.filterAttrs (k: v: lib.isDerivation v) pkgs.pythonDocs.html); mkDocsEntry = python-version: { - subdir = "${python-version}"; - path = "${builtins.toString pkgs.pythonDocs.html.${python-version}}/share/doc/${python-version}/html"; - desc = "Documentation for Python ${pkgs.${python-version}.version}"; + dirname = "${python-version}"; + path = "${builtins.toString pkgs.pythonDocs.html.${python-version}}/share/doc/${python-version}/html"; + desc = "Documentation for Python ${pkgs.${python-version}.version}"; }; in { diff --git a/profiles/web/docs/yagcd/default.nix b/profiles/web/docs/yagcd.nix similarity index 74% rename from profiles/web/docs/yagcd/default.nix rename to profiles/web/docs/yagcd.nix index 2d6581d..07851ad 100644 --- a/profiles/web/docs/yagcd/default.nix +++ b/profiles/web/docs/yagcd.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, mkDomain, ... }: +{ config, pkgs, lib, ... }: let yagcd = pkgs.fetchzip { url = "http://hitmen.c02.at/files/yagcd/yagcd.tar.gz"; @@ -8,9 +8,9 @@ let in { services.docs-to-host.docs = [{ - desc = "Yet another Gamecube Documentation"; - subdir = "yagcd"; - path = "${yagcd}/yagcd"; + desc = "Yet another Gamecube Documentation"; + dirname = "yagcd"; + path = "${yagcd}/yagcd"; }]; /** / diff --git a/users/pbsds/home/default.nix b/users/pbsds/home/default.nix index f2fee45..1212327 100644 --- a/users/pbsds/home/default.nix +++ b/users/pbsds/home/default.nix @@ -227,7 +227,8 @@ programs.exa.enable = true; programs.exa.enableAliases = true; programs.direnv.enable = true; - #programs.mpv.bindings + programs.mpv.bindings."SHIFT+n" = "sub-seek -1"; + programs.mpv.bindings."n" = "sub-seek 1"; #programs.mpv.config # TODO: implement programs.bat.enableAliases