diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4de80a0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,108 @@ +{ + description = "Kirk nix modules"; + + nixConfig = { + extra-substituters = ["https://nix-community.cachix.org"]; + extra-trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; + }; + + inputs = { + #nixpkgs.url = "github:nixos/nixpkgs/22.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixpkgs-flood.url = "github:3JlOy-PYCCKUi/nixpkgs/flood-module"; + #nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + + home-manager.url = "github:nix-community/home-manager"; + + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + flake-root.url = "github:srid/flake-root"; + + devshell = { + url = "github:numtide/devshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake { + inherit inputs; + } + rec { + imports = with inputs; [ + flake-root.flakeModule + treefmt-nix.flakeModule + devshell.flakeModule + ]; + systems = [ + "x86_64-linux" + ]; + + flake = { + nixosModules = rec { + kirk = import ./nixos; + default = kirk; + }; + homeManagerModules = rec { + kirk = import ./home-manager; + default = kirk; + }; + }; + + perSystem = { + config, + pkgs, + ... + }: { + treefmt.config = { + inherit (config.flake-root) projectRootFile; + package = pkgs.treefmt; + + programs = { + alejandra.enable = true; + deadnix.enable = true; + }; + }; + + packages = { + docs = pkgs.callPackage ./mkDocs.nix { inherit inputs; }; + hugo = pkgs.callPackage ./mkHugo.nix { inherit inputs; }; + }; + + devshells.default = { + name = "Rasmus Kirk"; + + commands = [ + { + category = "Tools"; + name = "fmt"; + help = "Format the source tree"; + command = "nix fmt"; + } + ]; + }; + }; + }; + + # outputs = { + # self, + # }: { + # nixosModules.kirk = import ./nixos; + # nixosModules.default = self.nixosModules.kirk; + # + # homeManagerModules.kirk = import ./home-manager; + # homeManagerModules.default = self.homeManagerModules.kirk; + # + # # TODO: Find a way to generate documentation from modules using the same + # # tools as nixos. See ./mkDocs.nix + # + # #packages.x86_64-linux.mkdocs = {}; + # #defaultPackage.x86_64-linux = self.packages.x86_64-linux.report; + # }; +} diff --git a/hugo/.hugo_build.lock b/hugo/.hugo_build.lock new file mode 100644 index 0000000..e69de29 diff --git a/hugo/archetypes/default.md b/hugo/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/hugo/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/hugo/config.toml b/hugo/config.toml new file mode 100644 index 0000000..fbd6902 --- /dev/null +++ b/hugo/config.toml @@ -0,0 +1,4 @@ +theme = 'risotto' +languageCode = 'en-us' +title = "Option Documentation for Rasmus Kirk's Nix Modules" +baseURL = 'https://rasmus-kirk.github.io/nix-modules/' diff --git a/hugo/content/header.md b/hugo/content/header.md new file mode 100644 index 0000000..7d6e9c8 --- /dev/null +++ b/hugo/content/header.md @@ -0,0 +1,6 @@ +--- +title: Options Documentation +author: Rasmus Kirk +date: DATE-TIMESTAMP +--- + diff --git a/hugo/content/home-manager/index.md b/hugo/content/home-manager/index.md new file mode 100644 index 0000000..2915c37 --- /dev/null +++ b/hugo/content/home-manager/index.md @@ -0,0 +1,624 @@ +--- +title: Options Documentation +author: Rasmus Kirk +date: 2023-12-07 +--- + +## kirk.fonts.enable +Whether to enable Enable my fonts, namely fira-code with nerdfonts. Note that this is required for kirk modules that use the nerdfont icons to function properly.. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.foot.alpha +Alpha value of the foot terminal. + +*_Type_*: +floating point number + + +*_Default_* +``` +0.85 +``` + + + + +## kirk.foot.colorscheme +A colorscheme attribute set. + +*_Type_*: +attribute set + + +*_Default_* +``` +{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"} +``` + + + + +## kirk.foot.enable +Whether to enable foot terminal emulator. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.foot.enableKeyBindings +Whether or not to enable my keybindings. + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.foot.fontSize +Font size of the terminal. + +*_Type_*: +signed integer + + +*_Default_* +``` +15 +``` + + + + +## kirk.fzf.colorscheme +A colorscheme attribute set. + +*_Type_*: +attribute set + + +*_Default_* +``` +{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"} +``` + + + + +## kirk.fzf.enable +Whether to enable foot terminal emulator. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.fzf.enableZshIntegration +Whether to enable zsh integration. + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.git.enable +Whether to enable git. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.git.userEmail +What email address to use for git. + +*_Type_*: +string + + + + + + +## kirk.git.userName +Username to use for git. + +*_Type_*: +string + + + + + + +## kirk.gruvbox.colorscheme +A definition for the gruvbox theme. + +*_Type_*: +attribute set + + +*_Default_* +``` +{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"} +``` + + + + +## kirk.helix.enable +Whether to enable helix text editor. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.helix.extraPackages +Extra packages to install, for example LSP's. + +*_Type_*: +list of package + + +*_Default_* +``` +[] +``` + + + + +## kirk.helix.installMostLsps +Whether or not to install most of the LSP's that helix supports. + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.homeManagerScripts.configDir +Path to the home-manager configuration. + +*_Type_*: +null or path + + +*_Default_* +``` +null +``` + + + + +## kirk.homeManagerScripts.enable +Whether to enable home manager scripts. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.homeManagerScripts.machine +Path to the home-manager configuration. + +*_Type_*: +null or string + + + + + + +## kirk.jiten.dailyWord +Enable daily japanese word prompt. + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.jiten.enable +Whether to enable jiten japanese dictionary. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.joshuto.enable +Whether to enable joshuto file manager. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.joshuto.enableZshIntegration +Adds the auto-cd `j` command to zsh. + + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.kakoune.enable +Whether to enable kakoune text editor. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.ssh.enable +Whether to enable ssh with extra config. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.ssh.identityPath +The directory containing the path to the identity file. + +*_Type_*: +null or path + + +*_Default_* +``` +null +``` + + + + +## kirk.terminalTools.autoUpdateTealdeer +Whether to auto-update tealdeer. + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.terminalTools.enable +Whether to enable Quality of life terminal tools. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.terminalTools.enableZshIntegration +Whether to enable zsh integration for bat. + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.terminalTools.theme +What syntax highlighting colorscheme to use. + +*_Type_*: +string + + +*_Default_* +``` +"gruvbox-dark" +``` + + + + +## kirk.terminalTools.trashCleaner.enable +Enable the trash-cli cleanup script + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.terminalTools.trashCleaner.persistance +How many days a file stays in trash before getting cleaned up. + +*_Type_*: +signed integer or floating point number + + +*_Default_* +``` +30 +``` + + + + +## kirk.userDirs.autoSortDownloads +Whether or not to auto-sort downloads. + + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.userDirs.enable +Whether to enable userDirs. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.zathura.colorscheme +A colorscheme attribute set. + + +*_Type_*: +attribute set + + +*_Default_* +``` +{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"} +``` + + + + +## kirk.zathura.enable +Whether to enable foot terminal emulator. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.zathura.enableKeyBindings +Whether or not to enable my keybindings. + + +*_Type_*: +boolean + + +*_Default_* +``` +true +``` + + + + +## kirk.zsh.enable +Whether to enable zsh configuration.. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + diff --git a/hugo/content/nixos/index.md b/hugo/content/nixos/index.md new file mode 100644 index 0000000..3f5dd1c --- /dev/null +++ b/hugo/content/nixos/index.md @@ -0,0 +1,411 @@ +--- +title: Options Documentation +author: Rasmus Kirk +date: 2023-12-07 +--- + +## kirk.nixosScripts.configDir +Path to the nixos configuration. + +*_Type_*: +path + + +*_Default_* +``` +"/etc/nixos" +``` + + + + +## kirk.nixosScripts.enable +Whether to enable Nixos scripts + +Required options: +- `machine` +. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.nixosScripts.machine +REQUIRED! The machine to run on. + +*_Type_*: +null or string + + +*_Default_* +``` +null +``` + + + + +## kirk.servarr.acmeMail +REQUIRED! The ACME mail. + +*_Type_*: +null or string + + +*_Default_* +``` +null +``` + + + + +## kirk.servarr.domainName +REQUIRED! The domain name to host jellyfin on. + +*_Type_*: +null or string + + +*_Default_* +``` +null +``` + + + + +## kirk.servarr.enable +Whether to enable My servarr setup. Hosts Jellyfin on the given domain (remember domain +records/port forwarding) and hosts the following services on localhost +through a mullvad VPN: + +- Prowlarr +- Sonarr +- Radarr +- Flood/Rtorrnet + +Required options for this module: + +- `domainName` +- `acmeMail` +- `mullvadAcc` + +Remember to read the options. + +NOTE: The docker service to manage this executes the command `docker +container prune -f` on startup for reproducibility, may cause issues +depending on your setup. + +NOTE: This nixos module only supports the mullvad VPN, if you need +another VPN, create a PR or fork this repo! +. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.servarr.gluetun.extraConfig +Extra config for the service. + +*_Type_*: +attribute set + + +*_Default_* +``` +{} +``` + + + + +## kirk.servarr.jellyfin.extraConfig +Extra config for the service. + +*_Type_*: +attribute set + + +*_Default_* +``` +{} +``` + + + + +## kirk.servarr.jellyfin.port +Port of Jellyfin. + +*_Type_*: +16 bit unsigned integer; between 0 and 65535 (both inclusive) + + +*_Default_* +``` +8096 +``` + + + + +## kirk.servarr.mediaDir +The location of the media directory for the services. + +*_Type_*: +path + + +*_Default_* +``` +"~/servarr" +``` + + + + +## kirk.servarr.mullvadAcc +REQUIRED! The location the file containing your mullvad account key. + +*_Type_*: +null or path + + +*_Default_* +``` +null +``` + + + + +## kirk.servarr.prowlarr.extraConfig +Extra config for the service. + +*_Type_*: +attribute set + + +*_Default_* +``` +{} +``` + + + + +## kirk.servarr.prowlarr.port +Port of prowlarr. + +*_Type_*: +16 bit unsigned integer; between 0 and 65535 (both inclusive) + + +*_Default_* +``` +6002 +``` + + + + +## kirk.servarr.radarr.extraConfig +Extra config for the service. + +*_Type_*: +attribute set + + +*_Default_* +``` +{} +``` + + + + +## kirk.servarr.radarr.port +Port of radarr. + +*_Type_*: +16 bit unsigned integer; between 0 and 65535 (both inclusive) + + +*_Default_* +``` +6004 +``` + + + + +## kirk.servarr.rflood.extraConfig +Extra config for the service. + +*_Type_*: +attribute set + + +*_Default_* +``` +{} +``` + + + + +## kirk.servarr.rflood.port +Port of rflood. + +*_Type_*: +16 bit unsigned integer; between 0 and 65535 (both inclusive) + + +*_Default_* +``` +6001 +``` + + + + +## kirk.servarr.rflood.ulimits.enable +Whether to enable Enable rtorrent ulimits. I had a bug that caused rtorrent to fail +and log `std::bad_alloc`. Setting ulimits for this service fixed +the issue. You probably don't want to set this unless you have +similar issues.See link below for more info: + +https://stackoverflow.com/questions/75536471/rtorrent-docker-container-failing-to-start-saying-stdbad-alloc +. + +*_Type_*: +boolean + + +*_Default_* +``` +false +``` + + +*_Example_* +``` +true +``` + + +## kirk.servarr.rflood.ulimits.hard +The hard limit. + +*_Type_*: +unsigned integer, meaning >=0 + + +*_Default_* +``` +1024 +``` + + + + +## kirk.servarr.rflood.ulimits.soft +The soft limit. + +*_Type_*: +unsigned integer, meaning >=0 + + +*_Default_* +``` +1024 +``` + + + + +## kirk.servarr.sonarr.extraConfig +Extra config for the service. + +*_Type_*: +attribute set + + +*_Default_* +``` +{} +``` + + + + +## kirk.servarr.sonarr.port +Port of sonarr. + +*_Type_*: +16 bit unsigned integer; between 0 and 65535 (both inclusive) + + +*_Default_* +``` +6003 +``` + + + + +## kirk.servarr.stateDir +The location of the state directory for the services. + +*_Type_*: +path + + +*_Default_* +``` +"~/.local/state" +``` + + + + +## kirk.servarr.timezone +Your timezone, used for logging purposes. + +*_Type_*: +string + + +*_Default_* +``` +"Etc/UTC" +``` + + + + diff --git a/hugo/content/test.md b/hugo/content/test.md new file mode 100644 index 0000000..35d184a --- /dev/null +++ b/hugo/content/test.md @@ -0,0 +1,2 @@ +[Nixos options](./nixos) +[Home manager options](./home-manager) diff --git a/hugo/public/categories/index.html b/hugo/public/categories/index.html new file mode 100644 index 0000000..97c902d --- /dev/null +++ b/hugo/public/categories/index.html @@ -0,0 +1,78 @@ + + + + Categories – Option Documentation for Rasmus Kirk's Nix Modules + + + + + + + + + + + + + + + + + + + +
+ + + +
+

Categories

+ + + + + + +
+ +
+
+ + +
+
+
+
+
+ + + +
+ + + diff --git a/hugo/public/categories/index.xml b/hugo/public/categories/index.xml new file mode 100644 index 0000000..fc82f5c --- /dev/null +++ b/hugo/public/categories/index.xml @@ -0,0 +1,10 @@ + + + + Categories on Option Documentation for Rasmus Kirk's Nix Modules + https://rasmus-kirk.github.io/nix-modules/categories/ + Recent content in Categories on Option Documentation for Rasmus Kirk's Nix Modules + Hugo -- gohugo.io + en-us + + diff --git a/hugo/public/css/about.css b/hugo/public/css/about.css new file mode 100644 index 0000000..6c12ba4 --- /dev/null +++ b/hugo/public/css/about.css @@ -0,0 +1,26 @@ +/* About/bio section */ +.about__logo { + height: 1.5rem; +} + +.about__title { + display: inline; + vertical-align: top; +} + +.about__title::before { + content: none; +} + +/* Social media links */ +.aside__social-links { + padding: 0; +} + +.aside__social-links li { + display: inline-block; +} + +.aside__social-links li::marker { + content: none; +} diff --git a/hugo/public/css/colours.css b/hugo/public/css/colours.css new file mode 100644 index 0000000..4326985 --- /dev/null +++ b/hugo/public/css/colours.css @@ -0,0 +1,17 @@ +:root { + /* Background */ + --bg: var(--base00); + --off-bg: var(--base01); + --inner-bg: var(--base02); + + /* Text */ + --fg: var(--base05); + --off-fg: var(--base04); + --muted: var(--base03); + --link: var(--base0D); + --hover: var(--base0C); + --highlight: var(--base0A); + + /* Logo */ + --logo: var(--base0B); +} diff --git a/hugo/public/css/custom.css b/hugo/public/css/custom.css new file mode 100644 index 0000000..71949ed --- /dev/null +++ b/hugo/public/css/custom.css @@ -0,0 +1 @@ +/* Override this file to customise the theme's CSS for your site */ diff --git a/hugo/public/css/footer.css b/hugo/public/css/footer.css new file mode 100644 index 0000000..3e84188 --- /dev/null +++ b/hugo/public/css/footer.css @@ -0,0 +1,7 @@ +.page__footer { + color: var(--off-fg); +} + +.page__footer p { + margin: 0; +} diff --git a/hugo/public/css/header.css b/hugo/public/css/header.css new file mode 100644 index 0000000..cab735b --- /dev/null +++ b/hugo/public/css/header.css @@ -0,0 +1,20 @@ +/* Main menu */ +.main-nav ul { + display: flex; + flex-flow: row wrap; + justify-content: flex-start; + margin: 0; + padding: 0 0 0.25rem 0; + gap: 0rem 1.5rem; +} + +.main-nav li { + padding-top: 0.25rem; + margin-left: 1rem; + text-transform: lowercase; +} + +.main-nav li::marker { + content: "./"; +} + diff --git a/hugo/public/css/layout.css b/hugo/public/css/layout.css new file mode 100644 index 0000000..d249166 --- /dev/null +++ b/hugo/public/css/layout.css @@ -0,0 +1,57 @@ +/* 1rem = 16px by default */ + +.page { + max-width: 64rem; + margin: 1rem auto; + display: grid; + grid-template-areas: + "header" + "body" + "aside" + "footer"; + grid-template-columns: minmax(0, 1fr); /* https://css-tricks.com/preventing-a-grid-blowout/ */ + grid-row-gap: 2rem; +} + +@media (min-width: 45rem) { + .page { + grid-template-areas: + "header header" + "body aside" + "footer footer"; + grid-template-columns: minmax(0, 1fr) 15rem; + grid-column-gap: 2rem; + } +} + +/* Header */ +.page__header { + grid-area: header; + display: flex; +} + +.page__logo { + flex-shrink: 0; +} + +.page__nav { + flex-grow: 1; +} + +/* Body + aside */ +.page__body { + grid-area: body; + background-color: var(--off-bg); + box-shadow: 0 0 0 1rem var(--off-bg); + overflow-wrap: break-word; +} + +.page__aside { + grid-area: aside; + color: var(--off-fg); +} + +/* Footer */ +.page__footer { + grid-area: footer; +} diff --git a/hugo/public/css/logo.css b/hugo/public/css/logo.css new file mode 100644 index 0000000..368fff4 --- /dev/null +++ b/hugo/public/css/logo.css @@ -0,0 +1,37 @@ +.page__logo { + padding: 0; + margin: 0; + font-weight: inherit; + color: var(--bg); +} + +.page__logo:before { + content: none; +} + +.page__logo-inner { + display: block; + background: var(--logo); + opacity: 0.90; + padding: 0.25rem; +} + +a.page__logo-inner:link, a.page__logo-inner:visited { + color: inherit; + text-decoration: inherit; +} + +a.page__logo-inner:hover, +a.page__logo-inner:active { + opacity: 1; +} + +.page__logo-inner:before { + content: "["; + color: var(--bg); +} + +.page__logo-inner:after { + content: "] $"; + color: var(--bg); +} diff --git a/hugo/public/css/palettes/apprentice.css b/hugo/public/css/palettes/apprentice.css new file mode 100644 index 0000000..303d1c7 --- /dev/null +++ b/hugo/public/css/palettes/apprentice.css @@ -0,0 +1,20 @@ +/* Apprentice by romainl */ + +:root { + --base00: #262626; + --base01: #AF5F5F; + --base02: #5F875F; + --base03: #87875F; + --base04: #5F87AF; + --base05: #5F5F87; + --base06: #5F8787; + --base07: #6C6C6C; + --base08: #444444; + --base09: #FF8700; + --base0A: #87AF87; + --base0B: #FFFFAF; + --base0C: #87AFD7; + --base0D: #8787AF; + --base0E: #5FAFAF; + --base0F: #BCBCBC; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/base16-dark.css b/hugo/public/css/palettes/base16-dark.css new file mode 100644 index 0000000..cb1ec1d --- /dev/null +++ b/hugo/public/css/palettes/base16-dark.css @@ -0,0 +1,22 @@ +/* base16 default dark + * https://github.com/chriskempson/base16-default-schemes + */ + +:root { + --base00: #181818; + --base01: #282828; + --base02: #383838; + --base03: #585858; + --base04: #b8b8b8; + --base05: #d8d8d8; + --base06: #e8e8e8; + --base07: #f8f8f8; + --base08: #ab4642; + --base09: #dc9656; + --base0A: #f7ca88; + --base0B: #a1b56c; + --base0C: #86c1b9; + --base0D: #7cafc2; + --base0E: #ba8baf; + --base0F: #a16946; +} diff --git a/hugo/public/css/palettes/base16-light.css b/hugo/public/css/palettes/base16-light.css new file mode 100644 index 0000000..bcbbb5a --- /dev/null +++ b/hugo/public/css/palettes/base16-light.css @@ -0,0 +1,22 @@ +/* base16 default light + * https://github.com/chriskempson/base16-default-schemes + */ + +:root { + --base00: #f8f8f8; + --base01: #e8e8e8; + --base02: #d8d8d8; + --base03: #b8b8b8; + --base04: #585858; + --base05: #383838; + --base06: #282828; + --base07: #181818; + --base08: #ab4642; + --base09: #dc9656; + --base0A: #f7ca88; + --base0B: #a1b56c; + --base0C: #86c1b9; + --base0D: #7cafc2; + --base0E: #ba8baf; + --base0F: #a16946; +} diff --git a/hugo/public/css/palettes/dracula.css b/hugo/public/css/palettes/dracula.css new file mode 100644 index 0000000..66f1abc --- /dev/null +++ b/hugo/public/css/palettes/dracula.css @@ -0,0 +1,20 @@ +/* Dracula by Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula) */ + +:root { + --base00: #282936; + --base01: #3a3c4e; + --base02: #4d4f68; + --base03: #626483; + --base04: #62d6e8; + --base05: #e9e9f4; + --base06: #f1f2f8; + --base07: #f7f7fb; + --base08: #ea51b2; + --base09: #b45bcf; + --base0A: #00f769; + --base0B: #ebff87; + --base0C: #a1efe4; + --base0D: #62d6e8; + --base0E: #b45bcf; + --base0F: #00f769; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/gruvbox-dark.css b/hugo/public/css/palettes/gruvbox-dark.css new file mode 100644 index 0000000..1d60bd9 --- /dev/null +++ b/hugo/public/css/palettes/gruvbox-dark.css @@ -0,0 +1,23 @@ +/* gruvbox dark + * https://github.com/morhetz/gruvbox + * base16: https://github.com/dawikur/base16-gruvbox-scheme + */ + +:root { + --base00: #282828; + --base01: #3c3836; + --base02: #504945; + --base03: #665c54; + --base04: #bdae93; + --base05: #d5c4a1; + --base06: #ebdbb2; + --base07: #fbf1c7; + --base08: #fb4934; + --base09: #fe8019; + --base0A: #fabd2f; + --base0B: #b8bb26; + --base0C: #8ec07c; + --base0D: #83a598; + --base0E: #d3869b; + --base0F: #d65d0e; +} diff --git a/hugo/public/css/palettes/gruvbox-light.css b/hugo/public/css/palettes/gruvbox-light.css new file mode 100644 index 0000000..f786cf0 --- /dev/null +++ b/hugo/public/css/palettes/gruvbox-light.css @@ -0,0 +1,23 @@ +/* gruvbox light + * https://github.com/morhetz/gruvbox + * base16: https://github.com/dawikur/base16-gruvbox-scheme + */ + +:root { + --base00: #fbf1c7; + --base01: #ebdbb2; + --base02: #d5c4a1; + --base03: #bdae93; + --base04: #665c54; + --base05: #504945; + --base06: #3c3836; + --base07: #282828; + --base08: #9d0006; + --base09: #af3a03; + --base0A: #b57614; + --base0B: #79740e; + --base0C: #427b58; + --base0D: #076678; + --base0E: #8f3f71; + --base0F: #d65d0e; +} diff --git a/hugo/public/css/palettes/material.css b/hugo/public/css/palettes/material.css new file mode 100644 index 0000000..60bfafb --- /dev/null +++ b/hugo/public/css/palettes/material.css @@ -0,0 +1,20 @@ +/* Material by Nate Peterson */ + +:root { + --base00: #263238; + --base01: #2E3C43; + --base02: #314549; + --base03: #546E7A; + --base04: #B2CCD6; + --base05: #EEFFFF; + --base06: #EEFFFF; + --base07: #FFFFFF; + --base08: #F07178; + --base09: #F78C6C; + --base0A: #FFCB6B; + --base0B: #C3E88D; + --base0C: #89DDFF; + --base0D: #82AAFF; + --base0E: #C792EA; + --base0F: #FF5370; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/papercolor-dark.css b/hugo/public/css/palettes/papercolor-dark.css new file mode 100644 index 0000000..d289932 --- /dev/null +++ b/hugo/public/css/palettes/papercolor-dark.css @@ -0,0 +1,20 @@ +/* PaperColor Dark by Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) */ + +:root { + --base00: #1c1c1c; + --base01: #af005f; + --base02: #5faf00; + --base03: #d7af5f; + --base04: #5fafd7; + --base05: #808080; + --base06: #d7875f; + --base07: #d0d0d0; + --base08: #585858; + --base09: #5faf5f; + --base0A: #afd700; + --base0B: #af87d7; + --base0C: #ffaf00; + --base0D: #ff5faf; + --base0E: #00afaf; + --base0F: #5f8787; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/papercolor-light.css b/hugo/public/css/palettes/papercolor-light.css new file mode 100644 index 0000000..7eeb7f5 --- /dev/null +++ b/hugo/public/css/palettes/papercolor-light.css @@ -0,0 +1,20 @@ +/* PaperColor Light by Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) */ + +:root { + --base00: #eeeeee; + --base01: #af0000; + --base02: #008700; + --base03: #5f8700; + --base04: #0087af; + --base05: #444444; + --base06: #005f87; + --base07: #878787; + --base08: #bcbcbc; + --base09: #d70000; + --base0A: #d70087; + --base0B: #8700af; + --base0C: #d75f00; + --base0D: #d75f00; + --base0E: #005faf; + --base0F: #005f87; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/solarized-dark.css b/hugo/public/css/palettes/solarized-dark.css new file mode 100644 index 0000000..a646595 --- /dev/null +++ b/hugo/public/css/palettes/solarized-dark.css @@ -0,0 +1,20 @@ +/* Solarized Dark by Ethan Schoonover (modified by aramisgithub) */ + +:root { + --base00: #002b36; + --base01: #073642; + --base02: #586e75; + --base03: #657b83; + --base04: #839496; + --base05: #93a1a1; + --base06: #eee8d5; + --base07: #fdf6e3; + --base08: #dc322f; + --base09: #cb4b16; + --base0A: #b58900; + --base0B: #859900; + --base0C: #2aa198; + --base0D: #268bd2; + --base0E: #6c71c4; + --base0F: #d33682; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/solarized-light.css b/hugo/public/css/palettes/solarized-light.css new file mode 100644 index 0000000..dfb92c1 --- /dev/null +++ b/hugo/public/css/palettes/solarized-light.css @@ -0,0 +1,20 @@ +/* Solarized Light by Ethan Schoonover (modified by aramisgithub) */ + +:root { + --base00: #fdf6e3; + --base01: #eee8d5; + --base02: #93a1a1; + --base03: #839496; + --base04: #657b83; + --base05: #586e75; + --base06: #073642; + --base07: #002b36; + --base08: #dc322f; + --base09: #cb4b16; + --base0A: #b58900; + --base0B: #859900; + --base0C: #2aa198; + --base0D: #268bd2; + --base0E: #6c71c4; + --base0F: #d33682; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/tender.css b/hugo/public/css/palettes/tender.css new file mode 100644 index 0000000..77fbe87 --- /dev/null +++ b/hugo/public/css/palettes/tender.css @@ -0,0 +1,20 @@ +/* tender by Jacobo Tabernero (https://github/com/jacoborus/tender.vim) */ + +:root { + --base00: #282828; + --base01: #383838; + --base02: #484848; + --base03: #4c4c4c; + --base04: #b8b8b8; + --base05: #eeeeee; + --base06: #e8e8e8; + --base07: #feffff; + --base08: #f43753; + --base09: #dc9656; + --base0A: #ffc24b; + --base0B: #c9d05c; + --base0C: #73cef4; + --base0D: #b3deef; + --base0E: #d3b987; + --base0F: #a16946; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/tokyo-night-dark.css b/hugo/public/css/palettes/tokyo-night-dark.css new file mode 100644 index 0000000..760d2fe --- /dev/null +++ b/hugo/public/css/palettes/tokyo-night-dark.css @@ -0,0 +1,20 @@ +/* Tokyo Night Dark by Michaël Ball */ + +:root { + --base00: #1A1B26; + --base01: #16161E; + --base02: #2F3549; + --base03: #444B6A; + --base04: #787C99; + --base05: #A9B1D6; + --base06: #CBCCD1; + --base07: #D5D6DB; + --base08: #C0CAF5; + --base09: #A9B1D6; + --base0A: #0DB9D7; + --base0B: #9ECE6A; + --base0C: #B4F9F8; + --base0D: #2AC3DE; + --base0E: #BB9AF7; + --base0F: #F7768E; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/tokyo-night-light.css b/hugo/public/css/palettes/tokyo-night-light.css new file mode 100644 index 0000000..66e73c8 --- /dev/null +++ b/hugo/public/css/palettes/tokyo-night-light.css @@ -0,0 +1,20 @@ +/* Tokyo Night Light by Michaël Ball */ + +:root { + --base00: #D5D6DB; + --base01: #CBCCD1; + --base02: #DFE0E5; + --base03: #9699A3; + --base04: #4C505E; + --base05: #343B59; + --base06: #1A1B26; + --base07: #1A1B26; + --base08: #343B58; + --base09: #965027; + --base0A: #166775; + --base0B: #485E30; + --base0C: #3E6968; + --base0D: #34548A; + --base0E: #5A4A78; + --base0F: #8C4351; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/windows-95-light.css b/hugo/public/css/palettes/windows-95-light.css new file mode 100644 index 0000000..70cfeeb --- /dev/null +++ b/hugo/public/css/palettes/windows-95-light.css @@ -0,0 +1,20 @@ +/* Windows 95 Light by Fergus Collins (https://github.com/C-Fergus) */ + +:root { + --base00: #fcfcfc; + --base01: #e0e0e0; + --base02: #c4c4c4; + --base03: #a8a8a8; + --base04: #7e7e7e; + --base05: #545454; + --base06: #2a2a2a; + --base07: #000000; + --base08: #a80000; + --base09: #fcfc54; + --base0A: #a85400; + --base0B: #00a800; + --base0C: #00a8a8; + --base0D: #0000a8; + --base0E: #a800a8; + --base0F: #54fc54; +} \ No newline at end of file diff --git a/hugo/public/css/palettes/windows-95.css b/hugo/public/css/palettes/windows-95.css new file mode 100644 index 0000000..5b44cf8 --- /dev/null +++ b/hugo/public/css/palettes/windows-95.css @@ -0,0 +1,20 @@ +/* Windows 95 by Fergus Collins (https://github.com/C-Fergus) */ + +:root { + --base00: #000000; + --base01: #1C1C1C; + --base02: #383838; + --base03: #545454; + --base04: #7e7e7e; + --base05: #a8a8a8; + --base06: #d2d2d2; + --base07: #fcfcfc; + --base08: #fc5454; + --base09: #a85400; + --base0A: #fcfc54; + --base0B: #54fc54; + --base0C: #54fcfc; + --base0D: #5454fc; + --base0E: #fc54fc; + --base0F: #00a800; +} \ No newline at end of file diff --git a/hugo/public/css/risotto.css b/hugo/public/css/risotto.css new file mode 100644 index 0000000..dcb5a96 --- /dev/null +++ b/hugo/public/css/risotto.css @@ -0,0 +1,12 @@ +@import 'colours.css'; +@import 'typography.css'; +@import 'layout.css'; +@import 'header.css'; +@import 'logo.css'; +@import 'about.css'; +@import 'footer.css'; + +body { + background-color: var(--bg); + color: var(--fg); +} diff --git a/hugo/public/css/typography.css b/hugo/public/css/typography.css new file mode 100644 index 0000000..6369cf0 --- /dev/null +++ b/hugo/public/css/typography.css @@ -0,0 +1,215 @@ +/* Fonts */ +:root { + --font-monospace: "Fira Mono", monospace; +} + +body { + font-family: var(--font-monospace); + font-size: 16px; + line-height: 1.5rem; +} + +/* Headings */ +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 1rem; + margin: 1.5rem 0 0 0; + font-weight: 600; +} + +h1+h2, +h1+h3, +h1+h4, +h1+h5, +h1+h6, +h2+h3, +h2+h4, +h2+h5, +h2+h6, +h3+h4, +h3+h5, +h3+h6, +h4+h5, +h4+h6, +h5+h6 { + margin: 0; +} + +h1:before { content: "# "; } +h2:before { content: "## "; } +h3:before { content: "### "; } +h4:before { content: "#### "; } +h5:before { content: "##### "; } +h6:before { content: "###### "; } + +h1:before, +h2:before, +h3:before, +h4:before, +h5:before, +h6:before { + color: var(--muted); +} + +h1:first-child { + margin-top: 0; +} + +/* Paragraphs */ +p { + margin: 0 0 1.5rem 0; +} + +/* Links */ + +a:link, a:visited { + color: var(--link); +} + +a:hover, a:active, a.active { + color: var(--hover); +} + +/* Lists */ +ul { + margin: 0 0 1.5rem 0; + padding-left: 1.25rem; +} + +ol { + margin: 0 0 1.5rem 0; + padding-left: 1.75rem; +} + +ul ul, +ul ol, +ol ul, +ol ol { + margin: 0; +} + +ul li::marker { + content: '∗\00A0'; + color: var(--muted); +} + +ol li::marker { + color: var(--muted); +} + +dt { + margin: 0; + font-weight: bold; +} + +dd { + margin: 0 0 0 1.5rem; + font-style: italic; +} + +dd + dt { + margin-top: 1.5rem; +} + +dl { + margin: 0 0 1.5rem 0; +} + +/* Blockquotes */ +blockquote { + position: relative; + margin: 0 0 1.5rem 1.5rem; +} + +blockquote::before { + position: absolute; + left: -1.5rem; + content: ">"; + color: var(--muted); +} + +.twitter-tweet::before { + content: "\f099"; + font-family: "Font Awesome 5 Brands"; + font-weight: 400; +} + +/* Code */ +pre, +code, +kbd, +samp { + background: var(--inner-bg) !important; + font-family: var(--font-monospace); + color: var(--off-fg); +} + +pre { + overflow-x: auto; + padding: 1.5rem; + margin: 0 0 1.5rem 0; +} + +/* Emphasis */ +b, +strong { + font-weight: 600; +} + +/* Highlighting */ +::selection, +mark { + background-color: var(--highlight); + color: var(--bg); +} + +/* Other typographic elements */ +hr { + border: 0; + margin-bottom: 1.5rem; +} + +hr:after { + content: '---'; + color: var(--muted); +} + + +/* Prevent super/sub from affecting line height */ +sup, sub { + vertical-align: baseline; + position: relative; + top: -0.25rem; + font-size: unset; +} +sub { + top: 0.25rem; +} + +/* Tables */ +table { + border-spacing: 0; + margin: 0 0 1.5rem 0; + overflow-wrap: anywhere; +} +th, td { + padding: 0 .75rem; + vertical-align: top; +} +th:first-child, td:first-child { + padding-left: 0; +} +th { + text-align: inherit; +} + +/* Figures */ +img { + max-width: 100%; + height: auto; +} + diff --git a/hugo/public/header/index.html b/hugo/public/header/index.html new file mode 100644 index 0000000..6992857 --- /dev/null +++ b/hugo/public/header/index.html @@ -0,0 +1,88 @@ + + + + Options Documentation – Option Documentation for Rasmus Kirk's Nix Modules + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

Options Documentation

+
+ +
+ +
+
+ +
+ +
+
+ + +
+
+
+ + +

+ By Rasmus Kirk + +

+ + + + +
+
+ + + +
+ + + diff --git a/hugo/public/home-manager/index.html b/hugo/public/home-manager/index.html new file mode 100644 index 0000000..73ba53d --- /dev/null +++ b/hugo/public/home-manager/index.html @@ -0,0 +1,338 @@ + + + + Options Documentation – Option Documentation for Rasmus Kirk's Nix Modules + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

Options Documentation

+
+ +
+

kirk.fonts.enable

+

Whether to enable Enable my fonts, namely fira-code with nerdfonts. Note that this is required for kirk modules that use the nerdfont icons to function properly..

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.foot.alpha

+

Alpha value of the foot terminal.

+

Type: +floating point number

+

Default

+
0.85
+

kirk.foot.colorscheme

+

A colorscheme attribute set.

+

Type: +attribute set

+

Default

+
{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"}
+

kirk.foot.enable

+

Whether to enable foot terminal emulator.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.foot.enableKeyBindings

+

Whether or not to enable my keybindings.

+

Type: +boolean

+

Default

+
true
+

kirk.foot.fontSize

+

Font size of the terminal.

+

Type: +signed integer

+

Default

+
15
+

kirk.fzf.colorscheme

+

A colorscheme attribute set.

+

Type: +attribute set

+

Default

+
{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"}
+

kirk.fzf.enable

+

Whether to enable foot terminal emulator.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.fzf.enableZshIntegration

+

Whether to enable zsh integration.

+

Type: +boolean

+

Default

+
true
+

kirk.git.enable

+

Whether to enable git.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.git.userEmail

+

What email address to use for git.

+

Type: +string

+

kirk.git.userName

+

Username to use for git.

+

Type: +string

+

kirk.gruvbox.colorscheme

+

A definition for the gruvbox theme.

+

Type: +attribute set

+

Default

+
{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"}
+

kirk.helix.enable

+

Whether to enable helix text editor.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.helix.extraPackages

+

Extra packages to install, for example LSP’s.

+

Type: +list of package

+

Default

+
[]
+

kirk.helix.installMostLsps

+

Whether or not to install most of the LSP’s that helix supports.

+

Type: +boolean

+

Default

+
true
+

kirk.homeManagerScripts.configDir

+

Path to the home-manager configuration.

+

Type: +null or path

+

Default

+
null
+

kirk.homeManagerScripts.enable

+

Whether to enable home manager scripts.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.homeManagerScripts.machine

+

Path to the home-manager configuration.

+

Type: +null or string

+

kirk.jiten.dailyWord

+

Enable daily japanese word prompt.

+

Type: +boolean

+

Default

+
true
+

kirk.jiten.enable

+

Whether to enable jiten japanese dictionary.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.joshuto.enable

+

Whether to enable joshuto file manager.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.joshuto.enableZshIntegration

+

Adds the auto-cd j command to zsh.

+

Type: +boolean

+

Default

+
true
+

kirk.kakoune.enable

+

Whether to enable kakoune text editor.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.ssh.enable

+

Whether to enable ssh with extra config.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.ssh.identityPath

+

The directory containing the path to the identity file.

+

Type: +null or path

+

Default

+
null
+

kirk.terminalTools.autoUpdateTealdeer

+

Whether to auto-update tealdeer.

+

Type: +boolean

+

Default

+
true
+

kirk.terminalTools.enable

+

Whether to enable Quality of life terminal tools.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.terminalTools.enableZshIntegration

+

Whether to enable zsh integration for bat.

+

Type: +boolean

+

Default

+
true
+

kirk.terminalTools.theme

+

What syntax highlighting colorscheme to use.

+

Type: +string

+

Default

+
"gruvbox-dark"
+

kirk.terminalTools.trashCleaner.enable

+

Enable the trash-cli cleanup script

+

Type: +boolean

+

Default

+
true
+

kirk.terminalTools.trashCleaner.persistance

+

How many days a file stays in trash before getting cleaned up.

+

Type: +signed integer or floating point number

+

Default

+
30
+

kirk.userDirs.autoSortDownloads

+

Whether or not to auto-sort downloads.

+

Type: +boolean

+

Default

+
true
+

kirk.userDirs.enable

+

Whether to enable userDirs.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.zathura.colorscheme

+

A colorscheme attribute set.

+

Type: +attribute set

+

Default

+
{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"}
+

kirk.zathura.enable

+

Whether to enable foot terminal emulator.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.zathura.enableKeyBindings

+

Whether or not to enable my keybindings.

+

Type: +boolean

+

Default

+
true
+

kirk.zsh.enable

+

Whether to enable zsh configuration..

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+
+
+
+ +
+ +
+
+ + +
+
+
+ + +

+ By Rasmus Kirk, + 2023-12-07 +

+ + + + +
+
+ + + +
+ + + diff --git a/hugo/public/images/rice.svg b/hugo/public/images/rice.svg new file mode 100644 index 0000000..53e480c --- /dev/null +++ b/hugo/public/images/rice.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/hugo/public/index.html b/hugo/public/index.html new file mode 100644 index 0000000..996910e --- /dev/null +++ b/hugo/public/index.html @@ -0,0 +1,72 @@ + + + + + Option Documentation for Rasmus Kirk's Nix Modules – Option Documentation for Rasmus Kirk's Nix Modules + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
+ +
+
+ + +
+
+
+
+
+ + + +
+ + + diff --git a/hugo/public/index.xml b/hugo/public/index.xml new file mode 100644 index 0000000..e955b08 --- /dev/null +++ b/hugo/public/index.xml @@ -0,0 +1,77 @@ + + + + Option Documentation for Rasmus Kirk's Nix Modules + https://rasmus-kirk.github.io/nix-modules/ + Recent content on Option Documentation for Rasmus Kirk's Nix Modules + Hugo -- gohugo.io + en-us + + Options Documentation + https://rasmus-kirk.github.io/nix-modules/home-manager/ + Thu, 07 Dec 2023 00:00:00 +0000 + + https://rasmus-kirk.github.io/nix-modules/home-manager/ + kirk.fonts.enable Whether to enable Enable my fonts, namely fira-code with nerdfonts. Note that this is required for kirk modules that use the nerdfont icons to function properly.. +Type: boolean +Default +false Example +true kirk.foot.alpha Alpha value of the foot terminal. +Type: floating point number +Default +0.85 kirk.foot.colorscheme A colorscheme attribute set. +Type: attribute set +Default +{"bg":"282828","black":"1d2021","blue":"458588","bright":{"black":"928374","blue":"83a598","green":"b8bb26","orange":"fe8019","purple":"d3869b","red":"fb4934","teal":"8ec07c","white":"fbf1c7","yellow":"fabd2f"},"fg":"ebdbb2","green":"98971a","orange":"d65d0e","purple":"b16286","red":"cc241d","teal":"689d6a","white":"d5c4a1","yellow":"d79921"} kirk.foot.enable Whether to enable foot terminal emulator. +Type: boolean +Default +false Example +true kirk.foot.enableKeyBindings Whether or not to enable my keybindings. + + + + Options Documentation + https://rasmus-kirk.github.io/nix-modules/nixos/ + Thu, 07 Dec 2023 00:00:00 +0000 + + https://rasmus-kirk.github.io/nix-modules/nixos/ + kirk.nixosScripts.configDir Path to the nixos configuration. +Type: path +Default +"/etc/nixos" kirk.nixosScripts.enable Whether to enable Nixos scripts +Required options: +machine . Type: boolean +Default +false Example +true kirk.nixosScripts.machine REQUIRED! The machine to run on. +Type: null or string +Default +null kirk.servarr.acmeMail REQUIRED! The ACME mail. +Type: null or string +Default +null kirk.servarr.domainName REQUIRED! The domain name to host jellyfin on. +Type: null or string +Default +null kirk.servarr.enable Whether to enable My servarr setup. + + + + + https://rasmus-kirk.github.io/nix-modules/test/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://rasmus-kirk.github.io/nix-modules/test/ + Nixos options Home manager options + + + + Options Documentation + https://rasmus-kirk.github.io/nix-modules/header/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://rasmus-kirk.github.io/nix-modules/header/ + + + + + diff --git a/hugo/public/nixos/index.html b/hugo/public/nixos/index.html new file mode 100644 index 0000000..714a106 --- /dev/null +++ b/hugo/public/nixos/index.html @@ -0,0 +1,268 @@ + + + + Options Documentation – Option Documentation for Rasmus Kirk's Nix Modules + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

Options Documentation

+
+ +
+

kirk.nixosScripts.configDir

+

Path to the nixos configuration.

+

Type: +path

+

Default

+
"/etc/nixos"
+

kirk.nixosScripts.enable

+

Whether to enable Nixos scripts

+

Required options:

+
    +
  • machine +.
  • +
+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.nixosScripts.machine

+

REQUIRED! The machine to run on.

+

Type: +null or string

+

Default

+
null
+

kirk.servarr.acmeMail

+

REQUIRED! The ACME mail.

+

Type: +null or string

+

Default

+
null
+

kirk.servarr.domainName

+

REQUIRED! The domain name to host jellyfin on.

+

Type: +null or string

+

Default

+
null
+

kirk.servarr.enable

+

Whether to enable My servarr setup. Hosts Jellyfin on the given domain (remember domain +records/port forwarding) and hosts the following services on localhost +through a mullvad VPN:

+
    +
  • Prowlarr
  • +
  • Sonarr
  • +
  • Radarr
  • +
  • Flood/Rtorrnet
  • +
+

Required options for this module:

+
    +
  • domainName
  • +
  • acmeMail
  • +
  • mullvadAcc
  • +
+

Remember to read the options.

+

NOTE: The docker service to manage this executes the command docker container prune -f on startup for reproducibility, may cause issues +depending on your setup.

+

NOTE: This nixos module only supports the mullvad VPN, if you need +another VPN, create a PR or fork this repo! +.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.servarr.gluetun.extraConfig

+

Extra config for the service.

+

Type: +attribute set

+

Default

+
{}
+

kirk.servarr.jellyfin.extraConfig

+

Extra config for the service.

+

Type: +attribute set

+

Default

+
{}
+

kirk.servarr.jellyfin.port

+

Port of Jellyfin.

+

Type: +16 bit unsigned integer; between 0 and 65535 (both inclusive)

+

Default

+
8096
+

kirk.servarr.mediaDir

+

The location of the media directory for the services.

+

Type: +path

+

Default

+
"~/servarr"
+

kirk.servarr.mullvadAcc

+

REQUIRED! The location the file containing your mullvad account key.

+

Type: +null or path

+

Default

+
null
+

kirk.servarr.prowlarr.extraConfig

+

Extra config for the service.

+

Type: +attribute set

+

Default

+
{}
+

kirk.servarr.prowlarr.port

+

Port of prowlarr.

+

Type: +16 bit unsigned integer; between 0 and 65535 (both inclusive)

+

Default

+
6002
+

kirk.servarr.radarr.extraConfig

+

Extra config for the service.

+

Type: +attribute set

+

Default

+
{}
+

kirk.servarr.radarr.port

+

Port of radarr.

+

Type: +16 bit unsigned integer; between 0 and 65535 (both inclusive)

+

Default

+
6004
+

kirk.servarr.rflood.extraConfig

+

Extra config for the service.

+

Type: +attribute set

+

Default

+
{}
+

kirk.servarr.rflood.port

+

Port of rflood.

+

Type: +16 bit unsigned integer; between 0 and 65535 (both inclusive)

+

Default

+
6001
+

kirk.servarr.rflood.ulimits.enable

+

Whether to enable Enable rtorrent ulimits. I had a bug that caused rtorrent to fail +and log std::bad_alloc. Setting ulimits for this service fixed +the issue. You probably don’t want to set this unless you have +similar issues.See link below for more info:

+

https://stackoverflow.com/questions/75536471/rtorrent-docker-container-failing-to-start-saying-stdbad-alloc +.

+

Type: +boolean

+

Default

+
false
+

Example

+
true
+

kirk.servarr.rflood.ulimits.hard

+

The hard limit.

+

Type: +unsigned integer, meaning >=0

+

Default

+
1024
+

kirk.servarr.rflood.ulimits.soft

+

The soft limit.

+

Type: +unsigned integer, meaning >=0

+

Default

+
1024
+

kirk.servarr.sonarr.extraConfig

+

Extra config for the service.

+

Type: +attribute set

+

Default

+
{}
+

kirk.servarr.sonarr.port

+

Port of sonarr.

+

Type: +16 bit unsigned integer; between 0 and 65535 (both inclusive)

+

Default

+
6003
+

kirk.servarr.stateDir

+

The location of the state directory for the services.

+

Type: +path

+

Default

+
"~/.local/state"
+

kirk.servarr.timezone

+

Your timezone, used for logging purposes.

+

Type: +string

+

Default

+
"Etc/UTC"
+
+
+
+ +
+ +
+
+ + +
+
+
+ + +

+ By Rasmus Kirk, + 2023-12-07 +

+ + + + +
+
+ + + +
+ + + diff --git a/hugo/public/sitemap.xml b/hugo/public/sitemap.xml new file mode 100644 index 0000000..6a24c05 --- /dev/null +++ b/hugo/public/sitemap.xml @@ -0,0 +1,22 @@ + + + + https://rasmus-kirk.github.io/nix-modules/home-manager/ + 2023-12-07T00:00:00+00:00 + + https://rasmus-kirk.github.io/nix-modules/nixos/ + 2023-12-07T00:00:00+00:00 + + https://rasmus-kirk.github.io/nix-modules/test/ + 0 + + https://rasmus-kirk.github.io/nix-modules/categories/ + + https://rasmus-kirk.github.io/nix-modules/ + + https://rasmus-kirk.github.io/nix-modules/header/ + + https://rasmus-kirk.github.io/nix-modules/tags/ + + diff --git a/hugo/public/tags/index.html b/hugo/public/tags/index.html new file mode 100644 index 0000000..2c65c6e --- /dev/null +++ b/hugo/public/tags/index.html @@ -0,0 +1,78 @@ + + + + Tags – Option Documentation for Rasmus Kirk's Nix Modules + + + + + + + + + + + + + + + + + + + +
+ + + +
+

Tags

+ + + + + + +
+ +
+
+ + +
+
+
+
+
+ + + +
+ + + diff --git a/hugo/public/tags/index.xml b/hugo/public/tags/index.xml new file mode 100644 index 0000000..e37866b --- /dev/null +++ b/hugo/public/tags/index.xml @@ -0,0 +1,10 @@ + + + + Tags on Option Documentation for Rasmus Kirk's Nix Modules + https://rasmus-kirk.github.io/nix-modules/tags/ + Recent content in Tags on Option Documentation for Rasmus Kirk's Nix Modules + Hugo -- gohugo.io + en-us + + diff --git a/hugo/public/test/index.html b/hugo/public/test/index.html new file mode 100644 index 0000000..cc8f13d --- /dev/null +++ b/hugo/public/test/index.html @@ -0,0 +1,85 @@ + + + + Option Documentation for Rasmus Kirk's Nix Modules + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+

+
+ + +
+ +
+ +
+
+ + +
+
+
+ + + + + +
+
+ + + +
+ + + diff --git a/hugo/themes/risotto/.github/workflows/gh-pages.yml b/hugo/themes/risotto/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..f3c4157 --- /dev/null +++ b/hugo/themes/risotto/.github/workflows/gh-pages.yml @@ -0,0 +1,36 @@ +name: github pages + +on: + push: + branches: + - main + pull_request: + +jobs: + deploy: + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + path: risotto + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.85.0' + # extended: true + + - name: Build + working-directory: ./risotto/exampleSite + run: hugo --minify --themesDir="../.." -t risotto + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./risotto/exampleSite/public + cname: risotto.joeroe.io diff --git a/hugo/themes/risotto/.gitignore b/hugo/themes/risotto/.gitignore new file mode 100644 index 0000000..2a8645f --- /dev/null +++ b/hugo/themes/risotto/.gitignore @@ -0,0 +1 @@ +.hugo_build.lock diff --git a/hugo/themes/risotto/LICENSE b/hugo/themes/risotto/LICENSE new file mode 100644 index 0000000..5c93805 --- /dev/null +++ b/hugo/themes/risotto/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2021 Joe Roe + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/hugo/themes/risotto/NEWS.md b/hugo/themes/risotto/NEWS.md new file mode 100644 index 0000000..a9017be --- /dev/null +++ b/hugo/themes/risotto/NEWS.md @@ -0,0 +1,22 @@ +# risotto (development version) + +# risotto 0.2.0 + +* **Breaking change** – new framework for colour palettes: + * Palettes are defined using CSS variables following the [base16](https://github.com/chriskempson/base16) system + * Added 14 new palettes: `apprentice`, `base16-dark`, `base16-light`, `dracula`, `material`, `papercolor-dark`, `papercolor-light`, `solarized-dark`, `solarized-light`, `tender`, `tokyo-night-dark`, `tokyo-night-light`, `windows-95` and `windows-95-light`. + * The default palette is `base16-dark` + * The `mode` parameter is no longer needed + * If you were using one of the old named palettes (`gruvbox-dark` or `gruvbox-light`), the change will be seamless. + * If you were using a custom palette, you will need to redefine it using the new framework. See README for further details. +* Added a table of contents (thanks @dashv, #47) +* Added multilanguage support with a language switcher (thanks @bedefaced) +* Made the site header and nav wrap more efficiently on narrow screens (thanks @m-dev672, #32) +* Added a changelog + +# risotto 0.1.0 + +First named release, including: + +* `gruvbox-dark` and `gruvbox-light` colour palettes +* FontAwesome6 and Academicons icon sets diff --git a/hugo/themes/risotto/README.md b/hugo/themes/risotto/README.md new file mode 100644 index 0000000..c86c0ee --- /dev/null +++ b/hugo/themes/risotto/README.md @@ -0,0 +1,74 @@ +# risotto + +risotto is a minimalist, responsive [hugo](https://gohugo.io) theme inspired by terminal ricing aesthetics. + +![Screenshot of the risotto theme](https://raw.githubusercontent.com/joeroe/risotto/master/images/screenshot.png) + +## Install + +The easiest way to install the theme is to clone this repository into your site's `themes` directory: + +```shell +git clone https://github.com/joeroe/risotto themes/risotto +``` + +If your site is already a git repository, you can add the theme as a submodule instead: + +```shell +git submodule add https://github.com/joeroe/risotto.git themes/risotto +``` + +## Update + +If you installed the theme using `git clone`, pull the repository to get the latest version: + +```shell +cd themes/risotto +git pull +``` + +Or, if you added it as a git submodule: + +```shell +git submodule update --remote +``` + +## Configure + +To use the theme, add `theme = 'risotto'` to your site's `config.toml`, or `theme: risotto` to your `config.yaml` respectively. + +See `exampleSite/config.toml` for the theme-specific parameters you need to add to your site's `config.toml` or `config.yaml` to configure the theme. + +### Colour palettes + +risotto uses the [base16 framework](https://github.com/chriskempson/base16) to define colour schemes that can be used with the `theme.palette` parameter. +A selection of 16 palettes (10 dark, 6 light) are bundled with the theme: `apprentice`, `base16-dark`, `base16-light`, `dracula`, `gruvbox-dark`, `gruvbox-light`, `material`, `papercolor-dark`, `papercolor-light`, `solarized-dark`, `solarized-light`, `tender`, `tokyo-night-dark`, `tokyo-night-light`, `windows-95` and `windows-95-light`. +The default is `base16-dark`. + + + +The easiest way to use other base16 styles is to place .css file from https://github.com/monicfenga/base16-styles/tree/master/css-variables and place it in your `static/css/palettes` directory. + +Or to define a wholly custom theme, you will need to define the following CSS variables for the following base16 colours (see [base16-dark.css](blob/main/static/css/palettes/base16-dark.css) for an example): + +| Base | Default colour | Used for | Examples | +| ---- | -------------- | -------- | -------- | +| 00 | Dark | Background | Page background | +| 01 | │ | Alt. background | Content background | +| 02 | │ | In-text backgrounds | `
`, ``, ``, `` |
+| 03   | │              | Muted text | `:before` & `:marker` symbols |
+| 04   | │              | Alt. foreground | Aside text          |
+| 05   | │              | Foreground         | Content text         |
+| 06   | │              |          |          |
+| 07   | Light          |          |          |
+| 08   | Red            |          |          |
+| 09   | Orange         |          |          |
+| 0A   | Yellow         | Highlights | Selected text, `` |
+| 0B   | Green          | Primary accent | Logo          |
+| 0C   | Cyan           | Active links | `a:active`, `a:hover`         |
+| 0D   | Blue           | Links    | `a:link`, `a:visited`         |
+| 0E   | Magenta        |          |          |
+| 0F   | Brown          |          |          |
+
+For light mode palettes, the sequence of 00–07 should be reversed (light to dark, not dark to light).
+Note that not all colours are currently used in the theme.
diff --git a/hugo/themes/risotto/archetypes/default.md b/hugo/themes/risotto/archetypes/default.md
new file mode 100644
index 0000000..ac36e06
--- /dev/null
+++ b/hugo/themes/risotto/archetypes/default.md
@@ -0,0 +1,2 @@
++++
++++
diff --git a/hugo/themes/risotto/config.toml b/hugo/themes/risotto/config.toml
new file mode 100644
index 0000000..7c79705
--- /dev/null
+++ b/hugo/themes/risotto/config.toml
@@ -0,0 +1,3 @@
+[module]
+  [module.hugoVersion]
+    min = "0.41.0"
diff --git a/hugo/themes/risotto/exampleSite/LICENSE b/hugo/themes/risotto/exampleSite/LICENSE
new file mode 100644
index 0000000..4527efb
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Steve Francia
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/hugo/themes/risotto/exampleSite/config.toml b/hugo/themes/risotto/exampleSite/config.toml
new file mode 100644
index 0000000..be7f40c
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/config.toml
@@ -0,0 +1,100 @@
+baseURL = "https://risotto.joeroe.io"
+theme = "risotto"
+title = "risotto demo"
+author = "Joe Roe"
+copyright = "© 2021–2022 [Joe Roe](https://joeroe.io) & [risotto contributors](https://github.com/joeroe/risotto/graphs/contributors)."
+paginate = 3
+languageCode = "en"
+DefaultContentLanguage = "en"
+enableInlineShortcodes = true
+# prevent build failures when using Hugo's Instagram shortcode due to deprecated Instagram API.
+# See https://github.com/gohugoio/hugo/issues/7228#issuecomment-714490456
+ignoreErrors = ["error-remote-getjson"]
+
+# Automatically add content sections to main menu
+sectionPagesMenu = "main"
+
+[params]
+noindex = false
+
+[params.theme]
+palette = "base16-dark"
+
+# Sidebar: about/bio
+[params.about]
+title = "risotto"
+description = "A [hugo](https://gohugo.io) theme inspired by terminal ricing."
+logo = "images/rice.svg"
+
+# Sidebar: social links
+# Available icon sets:
+# * FontAwesome 6  ('fa-brands', 'fa-normal', or 'fa-solid' for brands)
+# * Academicons  ('ai ai-')
+
+[[params.socialLinks]]
+icon = "fa-brands fa-github"
+title = "GitHub"
+url = "https://github.com/joeroe/risotto"
+
+[[params.socialLinks]]
+icon = "fa-solid fa-envelope"
+title = "Email"
+url = "mailto:example@example.com"
+
+[[params.socialLinks]]
+icon = "ai ai-orcid"
+title = "ORCID"
+url = "https://orcid.org/0000-0001-2345-6789"
+
+[menu]
+
+  [[menu.main]]
+    identifier = "about"
+    name = "About"
+    url = "/about/"
+    weight = 10
+
+[taxonomies]
+category = "categories"
+tag = "tags"
+series = "series"
+
+# For hugo >= 0.60.0, enable inline HTML
+[markup.goldmark.renderer]
+unsafe = true
+
+[markup]
+
+  # Table of contents
+  # Add toc = true to content front matter to enable
+  [markup.tableOfContents]
+    startLevel = 2
+    endLevel   = 3
+    ordered    = true
+
+[privacy]
+
+  [privacy.vimeo]
+    disabled = false
+    simple = true
+
+  [privacy.twitter]
+    disabled = false
+    enableDNT = true
+    simple = true
+
+  [privacy.instagram]
+    disabled = false
+    simple = true
+
+  [privacy.youtube]
+    disabled = false
+    privacyEnhanced = true
+
+[services]
+
+  [services.instagram]
+    disableInlineCSS = true
+
+  [services.twitter]
+    disableInlineCSS = true
diff --git a/hugo/themes/risotto/exampleSite/configTaxo.toml b/hugo/themes/risotto/exampleSite/configTaxo.toml
new file mode 100644
index 0000000..9220fcf
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/configTaxo.toml
@@ -0,0 +1,27 @@
+timeout = 30000
+enableInlineShortcodes = true
+
+[taxonomies]
+category = "categories"
+tag = "tags"
+series = "series"
+
+[privacy]
+
+  [privacy.vimeo]
+    disabled = false
+    simple = true
+
+  [privacy.twitter]
+    disabled = false
+    enableDNT = true
+    simple = true
+    disableInlineCSS = true
+
+  [privacy.instagram]
+    disabled = false
+    simple = true
+
+  [privacy.youtube]
+    disabled = false
+    privacyEnhanced = true
diff --git a/hugo/themes/risotto/exampleSite/content/_index.md b/hugo/themes/risotto/exampleSite/content/_index.md
new file mode 120000
index 0000000..fe84005
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/_index.md
@@ -0,0 +1 @@
+../../README.md
\ No newline at end of file
diff --git a/hugo/themes/risotto/exampleSite/content/_index.md.old b/hugo/themes/risotto/exampleSite/content/_index.md.old
new file mode 100644
index 0000000..ed6494b
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/_index.md.old
@@ -0,0 +1,3 @@
++++
+author = "Hugo Authors"
++++
diff --git a/hugo/themes/risotto/exampleSite/content/about.md b/hugo/themes/risotto/exampleSite/content/about.md
new file mode 100644
index 0000000..b31bf1d
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/about.md
@@ -0,0 +1,25 @@
++++
+title = "About"
+description = "Hugo, the world's fastest framework for building websites"
+date = "2019-02-28"
+aliases = ["about-us", "about-hugo", "contact"]
+author = "Hugo Authors"
++++
+
+Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
+
+Hugo makes use of a variety of open source projects including:
+
+* https://github.com/yuin/goldmark
+* https://github.com/alecthomas/chroma
+* https://github.com/muesli/smartcrop
+* https://github.com/spf13/cobra
+* https://github.com/spf13/viper
+
+Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages.
+
+Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.
+
+Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.
+
+Learn more and contribute on [GitHub](https://github.com/gohugoio).
diff --git a/hugo/themes/risotto/exampleSite/content/archives.md b/hugo/themes/risotto/exampleSite/content/archives.md
new file mode 100644
index 0000000..db16eed
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/archives.md
@@ -0,0 +1,5 @@
+---
+date: 2019-05-28
+type: section
+layout: "archives"
+---
diff --git a/hugo/themes/risotto/exampleSite/content/homepage/about.md b/hugo/themes/risotto/exampleSite/content/homepage/about.md
new file mode 100644
index 0000000..b5d6981
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/homepage/about.md
@@ -0,0 +1,7 @@
+---
+title: 'Our Difference'
+button: 'About us'
+weight: 2
+---
+
+Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. Ipsum dolor sit amet, et essent mediocritatem quo.
diff --git a/hugo/themes/risotto/exampleSite/content/homepage/index.md b/hugo/themes/risotto/exampleSite/content/homepage/index.md
new file mode 100644
index 0000000..ca03031
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/homepage/index.md
@@ -0,0 +1,3 @@
+---
+headless: true
+---
diff --git a/hugo/themes/risotto/exampleSite/content/homepage/work.md b/hugo/themes/risotto/exampleSite/content/homepage/work.md
new file mode 100644
index 0000000..f99bc99
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/homepage/work.md
@@ -0,0 +1,7 @@
+---
+title: 'We Help Business Grow'
+button: 'Our Work'
+weight: 1
+---
+
+Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. Numquam dolores mel eu, mea docendi omittantur et, mea ea duis erat. Elit melius cu ius. Per ex novum tantas putant, ei his nullam aliquam apeirian. Aeterno quaestio constituto sea an, no eum intellegat assueverit.
diff --git a/hugo/themes/risotto/exampleSite/content/post/_index.md b/hugo/themes/risotto/exampleSite/content/post/_index.md
new file mode 100644
index 0000000..8a084d9
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/post/_index.md
@@ -0,0 +1,6 @@
++++
+aliases = ["posts", "articles", "blog", "showcase", "docs"]
+title = "Posts"
+author = "Hugo Authors"
+tags = ["index"]
++++
diff --git a/hugo/themes/risotto/exampleSite/content/post/emoji-support.md b/hugo/themes/risotto/exampleSite/content/post/emoji-support.md
new file mode 100644
index 0000000..dc3589a
--- /dev/null
+++ b/hugo/themes/risotto/exampleSite/content/post/emoji-support.md
@@ -0,0 +1,46 @@
++++
+author = "Hugo Authors"
+title = "Emoji Support"
+date = "2019-03-05"
+description = "Guide to emoji usage in Hugo"
+tags = [
+    "emoji",
+]
++++
+
+Emoji can be enabled in a Hugo project in a number of ways. 
+
+The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). 
+
+To enable emoji globally, set `enableEmoji` to `true` in your site's [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g.
+
+

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

+
+ +The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. + +*** + +**N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. + +{{< highlight html >}} +.emoji { + font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols; +} +{{< /highlight >}} + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/hugo/themes/risotto/exampleSite/content/post/markdown-syntax.md b/hugo/themes/risotto/exampleSite/content/post/markdown-syntax.md new file mode 100644 index 0000000..06990d7 --- /dev/null +++ b/hugo/themes/risotto/exampleSite/content/post/markdown-syntax.md @@ -0,0 +1,148 @@ ++++ +author = "Hugo Authors" +title = "Markdown Syntax Guide" +date = "2019-03-11" +description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." +tags = [ + "markdown", + "css", + "html", +] +categories = [ + "themes", + "syntax", +] +series = ["Themes Guide"] +aliases = ["migrate-from-jekyl"] ++++ + +This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. + + +## Headings + +The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. + +# H1 +## H2 +### H3 +#### H4 +##### H5 +###### H6 + +## Paragraph + +Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. + +Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. + +## Blockquotes + +The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. + +#### Blockquote without attribution + +> Tiam, ad mint andaepu dandae nostion secatur sequo quae. +> **Note** that you can use *Markdown syntax* within a blockquote. + +#### Blockquote with attribution + +> Don't communicate by sharing memory, share memory by communicating.
+> — Rob Pike[^1] + +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. + +## Tables + +Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. + + Name | Age +--------|------ + Bob | 27 + Alice | 23 + +#### Inline Markdown within tables + +| Italics | Bold | Code | +| -------- | -------- | ------ | +| *italics* | **bold** | `code` | + +## Code Blocks + +#### Code block with backticks + +```html + + + + + Example HTML5 Document + + +

Test

+ + +``` + +#### Code block indented with four spaces + + + + + + Example HTML5 Document + + +

Test

+ + + +#### Code block with Hugo's internal highlight shortcode +{{< highlight html >}} + + + + + Example HTML5 Document + + +

Test

+ + +{{< /highlight >}} + +## List Types + +#### Ordered List + +1. First item +2. Second item +3. Third item + +#### Unordered List + +* List item +* Another item +* And another item + +#### Nested list + +* Fruit + * Apple + * Orange + * Banana +* Dairy + * Milk + * Cheese + +## Other Elements — abbr, sub, sup, kbd, mark + +GIF is a bitmap image format. + +H2O + +Xn + Yn = Zn + +Press CTRL+ALT+Delete to end the session. + +Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. diff --git a/hugo/themes/risotto/exampleSite/content/post/math-typesetting.md b/hugo/themes/risotto/exampleSite/content/post/math-typesetting.md new file mode 100644 index 0000000..48fdc79 --- /dev/null +++ b/hugo/themes/risotto/exampleSite/content/post/math-typesetting.md @@ -0,0 +1,49 @@ +--- +author: Hugo Authors +title: Math Typesetting +date: 2019-03-08 +description: A brief guide to setup KaTeX +math: true +--- + +Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. + + +In this example we will be using [KaTeX](https://katex.org/) + +- Create a partial under `/layouts/partials/math.html` +- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. +- Include the partial in your templates like so: + +```bash +{{ if or .Params.math .Site.Params.math }} +{{ partial "math.html" . }} +{{ end }} +``` + +- To enable KaTex globally set the parameter `math` to `true` in a project's configuration +- To enable KaTex on a per page basis include the parameter `math: true` in content files + +**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) + +{{< math.inline >}} +{{ if or .Page.Params.math .Site.Params.math }} + + + + +{{ end }} +{{}} + +### Examples + +{{< math.inline >}} +

+Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) +

+{{}} + +Block math: +$$ + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +$$ diff --git a/hugo/themes/risotto/exampleSite/content/post/placeholder-text.md b/hugo/themes/risotto/exampleSite/content/post/placeholder-text.md new file mode 100644 index 0000000..9ed5f69 --- /dev/null +++ b/hugo/themes/risotto/exampleSite/content/post/placeholder-text.md @@ -0,0 +1,45 @@ ++++ +author = "Hugo Authors" +title = "Placeholder Text" +date = "2019-03-09" +description = "Lorem Ipsum Dolor Si Amet" +tags = [ + "markdown", + "text", +] ++++ + +Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. + +1. Exierant elisi ambit vivere dedere +2. Duce pollice +3. Eris modo +4. Spargitque ferrea quos palude + +Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis. + +1. Comas hunc haec pietate fetum procerum dixit +2. Post torum vates letum Tiresia +3. Flumen querellas +4. Arcanaque montibus omnes +5. Quidem et + +# Vagus elidunt + + + +[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) + +## Mane refeci capiebant unda mulcebat + +Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. + +Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et. + +Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/hugo/themes/risotto/exampleSite/content/post/rich-content.md b/hugo/themes/risotto/exampleSite/content/post/rich-content.md new file mode 100644 index 0000000..92b4b03 --- /dev/null +++ b/hugo/themes/risotto/exampleSite/content/post/rich-content.md @@ -0,0 +1,34 @@ ++++ +author = "Hugo Authors" +title = "Rich Content" +date = "2019-03-10" +description = "A brief description of Hugo Shortcodes" +tags = [ + "shortcodes", + "privacy", +] ++++ + +Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. + +--- + +## YouTube Privacy Enhanced Shortcode + +{{< youtube ZJthWmvUzzc >}} + +
+ +--- + +## Twitter Simple Shortcode + +{{< twitter_simple 1085870671291310081 >}} + +
+ +--- + +## Vimeo Simple Shortcode + +{{< vimeo_simple 48912912 >}} diff --git a/hugo/themes/risotto/exampleSite/layouts/.gitkeep b/hugo/themes/risotto/exampleSite/layouts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/hugo/themes/risotto/exampleSite/static/.gitignore b/hugo/themes/risotto/exampleSite/static/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/hugo/themes/risotto/images/screenshot.png b/hugo/themes/risotto/images/screenshot.png new file mode 100644 index 0000000..475685f Binary files /dev/null and b/hugo/themes/risotto/images/screenshot.png differ diff --git a/hugo/themes/risotto/images/tn.png b/hugo/themes/risotto/images/tn.png new file mode 100644 index 0000000..2d0e330 Binary files /dev/null and b/hugo/themes/risotto/images/tn.png differ diff --git a/hugo/themes/risotto/layouts/404.html b/hugo/themes/risotto/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/hugo/themes/risotto/layouts/_default/baseof.html b/hugo/themes/risotto/layouts/_default/baseof.html new file mode 100644 index 0000000..9ef13f5 --- /dev/null +++ b/hugo/themes/risotto/layouts/_default/baseof.html @@ -0,0 +1,36 @@ + + + + + {{- partial "head.html" . -}} + + + +
+ + + +
+ {{- block "main" . }}{{- end }} +
+ +
+
+ {{- partial "about.html" . -}} +
+
+
+ {{- block "aside" . }}{{- end }} +
+
+ +
+ {{- partial "footer.html" . -}} +
+ +
+ + + diff --git a/hugo/themes/risotto/layouts/_default/li.html b/hugo/themes/risotto/layouts/_default/li.html new file mode 100644 index 0000000..c85e091 --- /dev/null +++ b/hugo/themes/risotto/layouts/_default/li.html @@ -0,0 +1 @@ +
  • {{ .Title | markdownify }}
  • diff --git a/hugo/themes/risotto/layouts/_default/list.html b/hugo/themes/risotto/layouts/_default/list.html new file mode 100644 index 0000000..37742ef --- /dev/null +++ b/hugo/themes/risotto/layouts/_default/list.html @@ -0,0 +1,12 @@ +{{ define "main" }} +

    {{ .Title | markdownify }}

    + + {{ .Content }} + +
      + {{ range .Pages }} + {{ .Render "li" }} + {{ end }} +
    + +{{ end }} diff --git a/hugo/themes/risotto/layouts/_default/single.html b/hugo/themes/risotto/layouts/_default/single.html new file mode 100644 index 0000000..77abf32 --- /dev/null +++ b/hugo/themes/risotto/layouts/_default/single.html @@ -0,0 +1,29 @@ +{{ define "main" }} +
    +

    {{ .Title | markdownify }}

    +
    + {{ if .Params.toc }} + + {{ end }} +
    + {{ .Content }} +
    +
    +{{ end }} + +{{define "aside" }} + {{ if .Params.description }}

    {{ .Params.description }}

    {{ end }} + {{ if or (.Params.author) (.Params.date) }} +

    + {{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }} + {{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }} +

    + {{ end }} + + {{ if and (.Params.toc) (.TableOfContents) }} +
    + On this page: + {{ .TableOfContents }} + {{ end }} +{{ end }} diff --git a/hugo/themes/risotto/layouts/index.html b/hugo/themes/risotto/layouts/index.html new file mode 100644 index 0000000..c346e42 --- /dev/null +++ b/hugo/themes/risotto/layouts/index.html @@ -0,0 +1,4 @@ +{{ define "main" }} + {{ .Content }} +{{ end }} + diff --git a/hugo/themes/risotto/layouts/partials/about.html b/hugo/themes/risotto/layouts/partials/about.html new file mode 100644 index 0000000..6c6e1bc --- /dev/null +++ b/hugo/themes/risotto/layouts/partials/about.html @@ -0,0 +1,15 @@ +{{ with .Site.Params.about }} +
    + {{ with .logo }}{{ end }} +

    {{ .title }}

    +{{ with .description }}

    {{ . | markdownify }}

    {{ end }} +
    +{{ end }} + + diff --git a/hugo/themes/risotto/layouts/partials/footer.html b/hugo/themes/risotto/layouts/partials/footer.html new file mode 100644 index 0000000..7ee6434 --- /dev/null +++ b/hugo/themes/risotto/layouts/partials/footer.html @@ -0,0 +1,3 @@ +{{- partial "lang.html" . -}} + + diff --git a/hugo/themes/risotto/layouts/partials/head.html b/hugo/themes/risotto/layouts/partials/head.html new file mode 100644 index 0000000..45673a5 --- /dev/null +++ b/hugo/themes/risotto/layouts/partials/head.html @@ -0,0 +1,17 @@ +{{ with .Title }}{{ . }} – {{end}}{{ .Site.Title }} +{{ with .Site.Params.about }}{{ end }} + + + +{{ if .Site.Params.noindex }} {{ end }} + + + + + + + + + + + diff --git a/hugo/themes/risotto/layouts/partials/header.html b/hugo/themes/risotto/layouts/partials/header.html new file mode 100644 index 0000000..45c46ce --- /dev/null +++ b/hugo/themes/risotto/layouts/partials/header.html @@ -0,0 +1,10 @@ + + diff --git a/hugo/themes/risotto/layouts/partials/lang.html b/hugo/themes/risotto/layouts/partials/lang.html new file mode 100644 index 0000000..43c93d4 --- /dev/null +++ b/hugo/themes/risotto/layouts/partials/lang.html @@ -0,0 +1,28 @@ +

    + {{ $siteLanguages := .Site.Languages }} + {{ $pageLang := .Page.Lang }} + + {{ $currentPage := . }} + {{ $pageName := "" }} + {{ range .Site.Menus.main }} + {{ if eq ($currentPage.Permalink) (.URL | absLangURL) }} + {{ $pageName = .Name }} + {{ end }} + {{ end }} + + {{ range .Page.AllTranslations }} + {{ $translation := .}} + {{ range $siteLanguages }} + {{ if eq $translation.Lang .Lang }} + {{ $selected := false }} + {{ if eq $pageLang .Lang }} +
    $ echo $LANG
    {{ .LanguageName }}

    + + {{ else }} +
    export LANG={{ .LanguageName }}; ./{{ $pageName }}
    + {{ end }} + {{ end }} + {{ end }} + {{ end }} +

    +

    diff --git a/hugo/themes/risotto/layouts/post/list.html b/hugo/themes/risotto/layouts/post/list.html new file mode 100644 index 0000000..027e282 --- /dev/null +++ b/hugo/themes/risotto/layouts/post/list.html @@ -0,0 +1,22 @@ +{{ define "main" }} +
    +

    {{ .Title | markdownify }}

    + {{ .Content }} +
    + + {{ range .Pages }} + + {{ end }} +{{ end }} diff --git a/hugo/themes/risotto/static/css/about.css b/hugo/themes/risotto/static/css/about.css new file mode 100644 index 0000000..6c12ba4 --- /dev/null +++ b/hugo/themes/risotto/static/css/about.css @@ -0,0 +1,26 @@ +/* About/bio section */ +.about__logo { + height: 1.5rem; +} + +.about__title { + display: inline; + vertical-align: top; +} + +.about__title::before { + content: none; +} + +/* Social media links */ +.aside__social-links { + padding: 0; +} + +.aside__social-links li { + display: inline-block; +} + +.aside__social-links li::marker { + content: none; +} diff --git a/hugo/themes/risotto/static/css/colours.css b/hugo/themes/risotto/static/css/colours.css new file mode 100644 index 0000000..4326985 --- /dev/null +++ b/hugo/themes/risotto/static/css/colours.css @@ -0,0 +1,17 @@ +:root { + /* Background */ + --bg: var(--base00); + --off-bg: var(--base01); + --inner-bg: var(--base02); + + /* Text */ + --fg: var(--base05); + --off-fg: var(--base04); + --muted: var(--base03); + --link: var(--base0D); + --hover: var(--base0C); + --highlight: var(--base0A); + + /* Logo */ + --logo: var(--base0B); +} diff --git a/hugo/themes/risotto/static/css/custom.css b/hugo/themes/risotto/static/css/custom.css new file mode 100644 index 0000000..71949ed --- /dev/null +++ b/hugo/themes/risotto/static/css/custom.css @@ -0,0 +1 @@ +/* Override this file to customise the theme's CSS for your site */ diff --git a/hugo/themes/risotto/static/css/footer.css b/hugo/themes/risotto/static/css/footer.css new file mode 100644 index 0000000..3e84188 --- /dev/null +++ b/hugo/themes/risotto/static/css/footer.css @@ -0,0 +1,7 @@ +.page__footer { + color: var(--off-fg); +} + +.page__footer p { + margin: 0; +} diff --git a/hugo/themes/risotto/static/css/header.css b/hugo/themes/risotto/static/css/header.css new file mode 100644 index 0000000..cab735b --- /dev/null +++ b/hugo/themes/risotto/static/css/header.css @@ -0,0 +1,20 @@ +/* Main menu */ +.main-nav ul { + display: flex; + flex-flow: row wrap; + justify-content: flex-start; + margin: 0; + padding: 0 0 0.25rem 0; + gap: 0rem 1.5rem; +} + +.main-nav li { + padding-top: 0.25rem; + margin-left: 1rem; + text-transform: lowercase; +} + +.main-nav li::marker { + content: "./"; +} + diff --git a/hugo/themes/risotto/static/css/layout.css b/hugo/themes/risotto/static/css/layout.css new file mode 100644 index 0000000..d249166 --- /dev/null +++ b/hugo/themes/risotto/static/css/layout.css @@ -0,0 +1,57 @@ +/* 1rem = 16px by default */ + +.page { + max-width: 64rem; + margin: 1rem auto; + display: grid; + grid-template-areas: + "header" + "body" + "aside" + "footer"; + grid-template-columns: minmax(0, 1fr); /* https://css-tricks.com/preventing-a-grid-blowout/ */ + grid-row-gap: 2rem; +} + +@media (min-width: 45rem) { + .page { + grid-template-areas: + "header header" + "body aside" + "footer footer"; + grid-template-columns: minmax(0, 1fr) 15rem; + grid-column-gap: 2rem; + } +} + +/* Header */ +.page__header { + grid-area: header; + display: flex; +} + +.page__logo { + flex-shrink: 0; +} + +.page__nav { + flex-grow: 1; +} + +/* Body + aside */ +.page__body { + grid-area: body; + background-color: var(--off-bg); + box-shadow: 0 0 0 1rem var(--off-bg); + overflow-wrap: break-word; +} + +.page__aside { + grid-area: aside; + color: var(--off-fg); +} + +/* Footer */ +.page__footer { + grid-area: footer; +} diff --git a/hugo/themes/risotto/static/css/logo.css b/hugo/themes/risotto/static/css/logo.css new file mode 100644 index 0000000..368fff4 --- /dev/null +++ b/hugo/themes/risotto/static/css/logo.css @@ -0,0 +1,37 @@ +.page__logo { + padding: 0; + margin: 0; + font-weight: inherit; + color: var(--bg); +} + +.page__logo:before { + content: none; +} + +.page__logo-inner { + display: block; + background: var(--logo); + opacity: 0.90; + padding: 0.25rem; +} + +a.page__logo-inner:link, a.page__logo-inner:visited { + color: inherit; + text-decoration: inherit; +} + +a.page__logo-inner:hover, +a.page__logo-inner:active { + opacity: 1; +} + +.page__logo-inner:before { + content: "["; + color: var(--bg); +} + +.page__logo-inner:after { + content: "] $"; + color: var(--bg); +} diff --git a/hugo/themes/risotto/static/css/palettes/apprentice.css b/hugo/themes/risotto/static/css/palettes/apprentice.css new file mode 100644 index 0000000..303d1c7 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/apprentice.css @@ -0,0 +1,20 @@ +/* Apprentice by romainl */ + +:root { + --base00: #262626; + --base01: #AF5F5F; + --base02: #5F875F; + --base03: #87875F; + --base04: #5F87AF; + --base05: #5F5F87; + --base06: #5F8787; + --base07: #6C6C6C; + --base08: #444444; + --base09: #FF8700; + --base0A: #87AF87; + --base0B: #FFFFAF; + --base0C: #87AFD7; + --base0D: #8787AF; + --base0E: #5FAFAF; + --base0F: #BCBCBC; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/base16-dark.css b/hugo/themes/risotto/static/css/palettes/base16-dark.css new file mode 100644 index 0000000..cb1ec1d --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/base16-dark.css @@ -0,0 +1,22 @@ +/* base16 default dark + * https://github.com/chriskempson/base16-default-schemes + */ + +:root { + --base00: #181818; + --base01: #282828; + --base02: #383838; + --base03: #585858; + --base04: #b8b8b8; + --base05: #d8d8d8; + --base06: #e8e8e8; + --base07: #f8f8f8; + --base08: #ab4642; + --base09: #dc9656; + --base0A: #f7ca88; + --base0B: #a1b56c; + --base0C: #86c1b9; + --base0D: #7cafc2; + --base0E: #ba8baf; + --base0F: #a16946; +} diff --git a/hugo/themes/risotto/static/css/palettes/base16-light.css b/hugo/themes/risotto/static/css/palettes/base16-light.css new file mode 100644 index 0000000..bcbbb5a --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/base16-light.css @@ -0,0 +1,22 @@ +/* base16 default light + * https://github.com/chriskempson/base16-default-schemes + */ + +:root { + --base00: #f8f8f8; + --base01: #e8e8e8; + --base02: #d8d8d8; + --base03: #b8b8b8; + --base04: #585858; + --base05: #383838; + --base06: #282828; + --base07: #181818; + --base08: #ab4642; + --base09: #dc9656; + --base0A: #f7ca88; + --base0B: #a1b56c; + --base0C: #86c1b9; + --base0D: #7cafc2; + --base0E: #ba8baf; + --base0F: #a16946; +} diff --git a/hugo/themes/risotto/static/css/palettes/dracula.css b/hugo/themes/risotto/static/css/palettes/dracula.css new file mode 100644 index 0000000..66f1abc --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/dracula.css @@ -0,0 +1,20 @@ +/* Dracula by Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula) */ + +:root { + --base00: #282936; + --base01: #3a3c4e; + --base02: #4d4f68; + --base03: #626483; + --base04: #62d6e8; + --base05: #e9e9f4; + --base06: #f1f2f8; + --base07: #f7f7fb; + --base08: #ea51b2; + --base09: #b45bcf; + --base0A: #00f769; + --base0B: #ebff87; + --base0C: #a1efe4; + --base0D: #62d6e8; + --base0E: #b45bcf; + --base0F: #00f769; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/gruvbox-dark.css b/hugo/themes/risotto/static/css/palettes/gruvbox-dark.css new file mode 100644 index 0000000..1d60bd9 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/gruvbox-dark.css @@ -0,0 +1,23 @@ +/* gruvbox dark + * https://github.com/morhetz/gruvbox + * base16: https://github.com/dawikur/base16-gruvbox-scheme + */ + +:root { + --base00: #282828; + --base01: #3c3836; + --base02: #504945; + --base03: #665c54; + --base04: #bdae93; + --base05: #d5c4a1; + --base06: #ebdbb2; + --base07: #fbf1c7; + --base08: #fb4934; + --base09: #fe8019; + --base0A: #fabd2f; + --base0B: #b8bb26; + --base0C: #8ec07c; + --base0D: #83a598; + --base0E: #d3869b; + --base0F: #d65d0e; +} diff --git a/hugo/themes/risotto/static/css/palettes/gruvbox-light.css b/hugo/themes/risotto/static/css/palettes/gruvbox-light.css new file mode 100644 index 0000000..f786cf0 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/gruvbox-light.css @@ -0,0 +1,23 @@ +/* gruvbox light + * https://github.com/morhetz/gruvbox + * base16: https://github.com/dawikur/base16-gruvbox-scheme + */ + +:root { + --base00: #fbf1c7; + --base01: #ebdbb2; + --base02: #d5c4a1; + --base03: #bdae93; + --base04: #665c54; + --base05: #504945; + --base06: #3c3836; + --base07: #282828; + --base08: #9d0006; + --base09: #af3a03; + --base0A: #b57614; + --base0B: #79740e; + --base0C: #427b58; + --base0D: #076678; + --base0E: #8f3f71; + --base0F: #d65d0e; +} diff --git a/hugo/themes/risotto/static/css/palettes/material.css b/hugo/themes/risotto/static/css/palettes/material.css new file mode 100644 index 0000000..60bfafb --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/material.css @@ -0,0 +1,20 @@ +/* Material by Nate Peterson */ + +:root { + --base00: #263238; + --base01: #2E3C43; + --base02: #314549; + --base03: #546E7A; + --base04: #B2CCD6; + --base05: #EEFFFF; + --base06: #EEFFFF; + --base07: #FFFFFF; + --base08: #F07178; + --base09: #F78C6C; + --base0A: #FFCB6B; + --base0B: #C3E88D; + --base0C: #89DDFF; + --base0D: #82AAFF; + --base0E: #C792EA; + --base0F: #FF5370; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/papercolor-dark.css b/hugo/themes/risotto/static/css/palettes/papercolor-dark.css new file mode 100644 index 0000000..d289932 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/papercolor-dark.css @@ -0,0 +1,20 @@ +/* PaperColor Dark by Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) */ + +:root { + --base00: #1c1c1c; + --base01: #af005f; + --base02: #5faf00; + --base03: #d7af5f; + --base04: #5fafd7; + --base05: #808080; + --base06: #d7875f; + --base07: #d0d0d0; + --base08: #585858; + --base09: #5faf5f; + --base0A: #afd700; + --base0B: #af87d7; + --base0C: #ffaf00; + --base0D: #ff5faf; + --base0E: #00afaf; + --base0F: #5f8787; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/papercolor-light.css b/hugo/themes/risotto/static/css/palettes/papercolor-light.css new file mode 100644 index 0000000..7eeb7f5 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/papercolor-light.css @@ -0,0 +1,20 @@ +/* PaperColor Light by Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) */ + +:root { + --base00: #eeeeee; + --base01: #af0000; + --base02: #008700; + --base03: #5f8700; + --base04: #0087af; + --base05: #444444; + --base06: #005f87; + --base07: #878787; + --base08: #bcbcbc; + --base09: #d70000; + --base0A: #d70087; + --base0B: #8700af; + --base0C: #d75f00; + --base0D: #d75f00; + --base0E: #005faf; + --base0F: #005f87; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/solarized-dark.css b/hugo/themes/risotto/static/css/palettes/solarized-dark.css new file mode 100644 index 0000000..a646595 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/solarized-dark.css @@ -0,0 +1,20 @@ +/* Solarized Dark by Ethan Schoonover (modified by aramisgithub) */ + +:root { + --base00: #002b36; + --base01: #073642; + --base02: #586e75; + --base03: #657b83; + --base04: #839496; + --base05: #93a1a1; + --base06: #eee8d5; + --base07: #fdf6e3; + --base08: #dc322f; + --base09: #cb4b16; + --base0A: #b58900; + --base0B: #859900; + --base0C: #2aa198; + --base0D: #268bd2; + --base0E: #6c71c4; + --base0F: #d33682; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/solarized-light.css b/hugo/themes/risotto/static/css/palettes/solarized-light.css new file mode 100644 index 0000000..dfb92c1 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/solarized-light.css @@ -0,0 +1,20 @@ +/* Solarized Light by Ethan Schoonover (modified by aramisgithub) */ + +:root { + --base00: #fdf6e3; + --base01: #eee8d5; + --base02: #93a1a1; + --base03: #839496; + --base04: #657b83; + --base05: #586e75; + --base06: #073642; + --base07: #002b36; + --base08: #dc322f; + --base09: #cb4b16; + --base0A: #b58900; + --base0B: #859900; + --base0C: #2aa198; + --base0D: #268bd2; + --base0E: #6c71c4; + --base0F: #d33682; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/tender.css b/hugo/themes/risotto/static/css/palettes/tender.css new file mode 100644 index 0000000..77fbe87 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/tender.css @@ -0,0 +1,20 @@ +/* tender by Jacobo Tabernero (https://github/com/jacoborus/tender.vim) */ + +:root { + --base00: #282828; + --base01: #383838; + --base02: #484848; + --base03: #4c4c4c; + --base04: #b8b8b8; + --base05: #eeeeee; + --base06: #e8e8e8; + --base07: #feffff; + --base08: #f43753; + --base09: #dc9656; + --base0A: #ffc24b; + --base0B: #c9d05c; + --base0C: #73cef4; + --base0D: #b3deef; + --base0E: #d3b987; + --base0F: #a16946; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/tokyo-night-dark.css b/hugo/themes/risotto/static/css/palettes/tokyo-night-dark.css new file mode 100644 index 0000000..760d2fe --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/tokyo-night-dark.css @@ -0,0 +1,20 @@ +/* Tokyo Night Dark by Michaël Ball */ + +:root { + --base00: #1A1B26; + --base01: #16161E; + --base02: #2F3549; + --base03: #444B6A; + --base04: #787C99; + --base05: #A9B1D6; + --base06: #CBCCD1; + --base07: #D5D6DB; + --base08: #C0CAF5; + --base09: #A9B1D6; + --base0A: #0DB9D7; + --base0B: #9ECE6A; + --base0C: #B4F9F8; + --base0D: #2AC3DE; + --base0E: #BB9AF7; + --base0F: #F7768E; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/tokyo-night-light.css b/hugo/themes/risotto/static/css/palettes/tokyo-night-light.css new file mode 100644 index 0000000..66e73c8 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/tokyo-night-light.css @@ -0,0 +1,20 @@ +/* Tokyo Night Light by Michaël Ball */ + +:root { + --base00: #D5D6DB; + --base01: #CBCCD1; + --base02: #DFE0E5; + --base03: #9699A3; + --base04: #4C505E; + --base05: #343B59; + --base06: #1A1B26; + --base07: #1A1B26; + --base08: #343B58; + --base09: #965027; + --base0A: #166775; + --base0B: #485E30; + --base0C: #3E6968; + --base0D: #34548A; + --base0E: #5A4A78; + --base0F: #8C4351; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/windows-95-light.css b/hugo/themes/risotto/static/css/palettes/windows-95-light.css new file mode 100644 index 0000000..70cfeeb --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/windows-95-light.css @@ -0,0 +1,20 @@ +/* Windows 95 Light by Fergus Collins (https://github.com/C-Fergus) */ + +:root { + --base00: #fcfcfc; + --base01: #e0e0e0; + --base02: #c4c4c4; + --base03: #a8a8a8; + --base04: #7e7e7e; + --base05: #545454; + --base06: #2a2a2a; + --base07: #000000; + --base08: #a80000; + --base09: #fcfc54; + --base0A: #a85400; + --base0B: #00a800; + --base0C: #00a8a8; + --base0D: #0000a8; + --base0E: #a800a8; + --base0F: #54fc54; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/palettes/windows-95.css b/hugo/themes/risotto/static/css/palettes/windows-95.css new file mode 100644 index 0000000..5b44cf8 --- /dev/null +++ b/hugo/themes/risotto/static/css/palettes/windows-95.css @@ -0,0 +1,20 @@ +/* Windows 95 by Fergus Collins (https://github.com/C-Fergus) */ + +:root { + --base00: #000000; + --base01: #1C1C1C; + --base02: #383838; + --base03: #545454; + --base04: #7e7e7e; + --base05: #a8a8a8; + --base06: #d2d2d2; + --base07: #fcfcfc; + --base08: #fc5454; + --base09: #a85400; + --base0A: #fcfc54; + --base0B: #54fc54; + --base0C: #54fcfc; + --base0D: #5454fc; + --base0E: #fc54fc; + --base0F: #00a800; +} \ No newline at end of file diff --git a/hugo/themes/risotto/static/css/risotto.css b/hugo/themes/risotto/static/css/risotto.css new file mode 100644 index 0000000..dcb5a96 --- /dev/null +++ b/hugo/themes/risotto/static/css/risotto.css @@ -0,0 +1,12 @@ +@import 'colours.css'; +@import 'typography.css'; +@import 'layout.css'; +@import 'header.css'; +@import 'logo.css'; +@import 'about.css'; +@import 'footer.css'; + +body { + background-color: var(--bg); + color: var(--fg); +} diff --git a/hugo/themes/risotto/static/css/typography.css b/hugo/themes/risotto/static/css/typography.css new file mode 100644 index 0000000..6369cf0 --- /dev/null +++ b/hugo/themes/risotto/static/css/typography.css @@ -0,0 +1,215 @@ +/* Fonts */ +:root { + --font-monospace: "Fira Mono", monospace; +} + +body { + font-family: var(--font-monospace); + font-size: 16px; + line-height: 1.5rem; +} + +/* Headings */ +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 1rem; + margin: 1.5rem 0 0 0; + font-weight: 600; +} + +h1+h2, +h1+h3, +h1+h4, +h1+h5, +h1+h6, +h2+h3, +h2+h4, +h2+h5, +h2+h6, +h3+h4, +h3+h5, +h3+h6, +h4+h5, +h4+h6, +h5+h6 { + margin: 0; +} + +h1:before { content: "# "; } +h2:before { content: "## "; } +h3:before { content: "### "; } +h4:before { content: "#### "; } +h5:before { content: "##### "; } +h6:before { content: "###### "; } + +h1:before, +h2:before, +h3:before, +h4:before, +h5:before, +h6:before { + color: var(--muted); +} + +h1:first-child { + margin-top: 0; +} + +/* Paragraphs */ +p { + margin: 0 0 1.5rem 0; +} + +/* Links */ + +a:link, a:visited { + color: var(--link); +} + +a:hover, a:active, a.active { + color: var(--hover); +} + +/* Lists */ +ul { + margin: 0 0 1.5rem 0; + padding-left: 1.25rem; +} + +ol { + margin: 0 0 1.5rem 0; + padding-left: 1.75rem; +} + +ul ul, +ul ol, +ol ul, +ol ol { + margin: 0; +} + +ul li::marker { + content: '∗\00A0'; + color: var(--muted); +} + +ol li::marker { + color: var(--muted); +} + +dt { + margin: 0; + font-weight: bold; +} + +dd { + margin: 0 0 0 1.5rem; + font-style: italic; +} + +dd + dt { + margin-top: 1.5rem; +} + +dl { + margin: 0 0 1.5rem 0; +} + +/* Blockquotes */ +blockquote { + position: relative; + margin: 0 0 1.5rem 1.5rem; +} + +blockquote::before { + position: absolute; + left: -1.5rem; + content: ">"; + color: var(--muted); +} + +.twitter-tweet::before { + content: "\f099"; + font-family: "Font Awesome 5 Brands"; + font-weight: 400; +} + +/* Code */ +pre, +code, +kbd, +samp { + background: var(--inner-bg) !important; + font-family: var(--font-monospace); + color: var(--off-fg); +} + +pre { + overflow-x: auto; + padding: 1.5rem; + margin: 0 0 1.5rem 0; +} + +/* Emphasis */ +b, +strong { + font-weight: 600; +} + +/* Highlighting */ +::selection, +mark { + background-color: var(--highlight); + color: var(--bg); +} + +/* Other typographic elements */ +hr { + border: 0; + margin-bottom: 1.5rem; +} + +hr:after { + content: '---'; + color: var(--muted); +} + + +/* Prevent super/sub from affecting line height */ +sup, sub { + vertical-align: baseline; + position: relative; + top: -0.25rem; + font-size: unset; +} +sub { + top: 0.25rem; +} + +/* Tables */ +table { + border-spacing: 0; + margin: 0 0 1.5rem 0; + overflow-wrap: anywhere; +} +th, td { + padding: 0 .75rem; + vertical-align: top; +} +th:first-child, td:first-child { + padding-left: 0; +} +th { + text-align: inherit; +} + +/* Figures */ +img { + max-width: 100%; + height: auto; +} + diff --git a/hugo/themes/risotto/static/images/rice.svg b/hugo/themes/risotto/static/images/rice.svg new file mode 100644 index 0000000..53e480c --- /dev/null +++ b/hugo/themes/risotto/static/images/rice.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/hugo/themes/risotto/theme.toml b/hugo/themes/risotto/theme.toml new file mode 100644 index 0000000..265e16e --- /dev/null +++ b/hugo/themes/risotto/theme.toml @@ -0,0 +1,16 @@ +name = "risotto" +license = "MIT" +licenselink = "https://github.com/joeroe/risotto/blob/master/LICENSE" +description = "A minimalist, responsive theme inspired by terminal ricing aesthetics." + +homepage = "https://github.com/joeroe/risotto" +demosite = "https://risotto.joeroe.io" + +tags = ["responsive", "minimal", "dark mode"] +features = [] +min_version = "0.41.0" + +[author] + name = "Joe Roe" + homepage = "https://joeroe.io" + diff --git a/mkDocs.nix b/mkDocs.nix new file mode 100644 index 0000000..e744854 --- /dev/null +++ b/mkDocs.nix @@ -0,0 +1,65 @@ +{ + lib, + pkgs, + runCommand, + nixosOptionsDoc, + inputs, + ... +}: let + # Make sure the used package is scrubbed to avoid actually + # instantiating derivations. + # evaluate our options + evalHome = lib.evalModules { + # TODO: understand why pkgs needs to be passed here + specialArgs = {inherit pkgs;}; + modules = [ + { + # disabled checking that all option definitions have matching declarations + config._module.check = false; + } + inputs.home-manager.nixosModules.default + ./home-manager/fonts + ./home-manager/foot + ./home-manager/fzf + ./home-manager/git + ./home-manager/gruvboxTheme + ./home-manager/helix + ./home-manager/homeManagerScripts + ./home-manager/jiten + ./home-manager/joshuto + ./home-manager/kakoune + ./home-manager/ssh + ./home-manager/terminalTools + ./home-manager/userDirs + ./home-manager/zathura + ./home-manager/zsh + ]; + }; + # generate our docs + optionsDocHome = nixosOptionsDoc { + inherit (evalHome) options; + }; + + # Same for nixos + evalNixos = lib.evalModules { + specialArgs = {inherit pkgs;}; + modules = [ + { + config._module.check = false; + } + inputs.home-manager.nixosModules.default + ./nixos/servarr + ./nixos/nixosScripts + ]; + }; + optionsDocNixos = nixosOptionsDoc { + inherit (evalNixos) options; + }; + +in + # create a derivation for capturing the markdown output + runCommand "options-doc.md" {} '' + mkdir -p $out + cat ${optionsDocHome.optionsCommonMark} | tail -n +210 >> $out/home.md + cat ${optionsDocNixos.optionsCommonMark} | tail -n +210 >> $out/nixos.md + '' diff --git a/mkHugo.nix b/mkHugo.nix new file mode 100644 index 0000000..2660655 --- /dev/null +++ b/mkHugo.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + + pkgs.writeShellApplication { + name = "my-script"; + runtimeInputs = with pkgs; [ hugo ]; + text = '' + cat hugo/content/header.md result/home.md | sed "s/DATE-TIMESTAMP/$(date -u +%Y-%m-%d)/g" > hugo/content/home-manager/index.md + cat hugo/content/header.md result/nixos.md | sed "s/DATE-TIMESTAMP/$(date -u +%Y-%m-%d)/g" > hugo/content/nixos/index.md + cd hugo + hugo + ''; + } diff --git a/servarr/default.nix b/servarr/default.nix new file mode 100644 index 0000000..c9ce46b --- /dev/null +++ b/servarr/default.nix @@ -0,0 +1,212 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.kirk.servarr; +in { + imports = [ + ./jellyfin + ./radarr + ./lidarr + ./readarr + ./sonarr + ./prowlarr + ./transmission + ]; + + options.kirk.servarr = { + enable = mkEnableOption '' + My servarr setup. Lets you host the servarr services optionally + through a VPN. It is possible, BUT NOT RECOMENDED, to have + prowlarr/sonarr/radarr/readarr/lidarr behind a VPN. Generally, you + should use VPN on transmission and maybe jellyfin, depending on your + setup. Also sets permissions and creates folders. + + - Jellyfin + - Lidarr + - Prowlarr + - Radarr + - Readarr + - Sonarr + - Transmission + + Remember to read the options. + ''; + + mediaUsers = mkOption { + type = with types; listOf str; + default = []; + description = "Extra users to add the the media group, giving access to the media directory. You probably want to add your own user here."; + }; + + mediaDir = mkOption { + type = types.path; + default = "/data/media"; + description = "The location of the media directory for the services."; + }; + + stateDir = mkOption { + type = types.path; + default = "/data/.state"; + description = "The location of the state directory for the services."; + }; + + upnp.enable = mkEnableOption "Enable automatic port forwarding using UPNP."; + + vpn = { + enable = mkEnableOption ''Enable vpn''; + + wgConf = mkOption { + type = types.nullOr types.path; + default = null; + description = "REQUIRED! The path to the wireguard configuration file."; + }; + + dnsServers = mkOption { + type = with types; nullOr (listOf str); + default = null; + description = lib.mdDoc '' + Extra DNS servers for the VPN. If your wg config has a DNS field, + then this should not be necessary. + ''; + example = [ "1.1.1.2" ]; + }; + + vpnTestService = { + enable = mkEnableOption "Enable the vpn test service."; + + port = mkOption { + type = types.port; + default = 12300; + description = lib.mdDoc '' + The port that the vpn test service listens to. + ''; + example = 58403; + }; + }; + + openTcpPorts = mkOption { + type = with types; listOf port; + default = []; + description = lib.mdDoc '' + What TCP ports to allow incoming traffic from. You might need this + if you're port forwarding on your VPN provider and you're setting + up services that is not covered in by this module. + ''; + example = [ 46382 38473 ]; + }; + + openUdpPorts = mkOption { + type = with types; listOf port; + default = []; + description = lib.mdDoc '' + What UDP ports to allow incoming traffic from. You might need this + if you're port forwarding on your VPN provider and you're setting + up services that is not covered in by this module. + ''; + example = [ 46382 38473 ]; + }; + }; + }; + + config = mkIf cfg.enable { + users.groups = { + media = { + members = cfg.mediaUsers; + gid = 992; + }; + prowlarr = {}; + transmission = {}; + jellyfin = {}; + }; + # TODO: This is BAD. But seems necessary when using containers. + # The prefered solution is to just remove containerization. + # Look at https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/ids.nix + users.users = { + jellyfin = { + isSystemUser = true; + uid = lib.mkForce 316; + }; + sonarr = { + isSystemUser = true; + group = "media"; + uid = lib.mkForce 274; + }; + radarr = { + isSystemUser = true; + group = "media"; + uid = lib.mkForce 275; + }; + lidarr = { + isSystemUser = true; + group = "media"; + uid = lib.mkForce 306; + }; + readarr = { + isSystemUser = true; + group = "media"; + uid = lib.mkForce 309; + }; + transmission = { + isSystemUser = true; + group = "transmission"; + uid = lib.mkForce 70; + }; + prowlarr = { + isSystemUser = true; + group = "prowlarr"; + uid = lib.mkForce 293; + }; + }; + + systemd.tmpfiles.rules = [ + # State dirs + "d '${cfg.stateDir}' 0755 root root - -" + "d '${cfg.stateDir}/servarr' 0755 root root - -" + "d '${cfg.stateDir}/servarr/jellyfin' 0700 jellyfin root - -" + "d '${cfg.stateDir}/servarr/transmission' 0700 transmission root - -" + "d '${cfg.stateDir}/servarr/sonarr' 0700 sonarr root - -" + "d '${cfg.stateDir}/servarr/radarr' 0700 radarr root - -" + "d '${cfg.stateDir}/servarr/readarr' 0700 readarr root - -" + "d '${cfg.stateDir}/servarr/lidarr' 0700 lidarr root - -" + "d '${cfg.stateDir}/servarr/prowlarr' 0700 prowlarr root - -" + + # Media dirs + "d '${cfg.mediaDir}' 0775 root media - -" + "d '${cfg.mediaDir}/library' 0775 jellyfin media - -" + "d '${cfg.mediaDir}/library/series' 0775 jellyfin media - -" + "d '${cfg.mediaDir}/library/movies' 0775 jellyfin media - -" + "d '${cfg.mediaDir}/library/music' 0775 jellyfin media - -" + "d '${cfg.mediaDir}/library/books' 0775 jellyfin media - -" + "d '${cfg.mediaDir}/torrents' 0755 transmission media - -" + "d '${cfg.mediaDir}/torrents/.incomplete' 0755 transmission media - -" + "d '${cfg.mediaDir}/torrents/.watch' 0755 transmission media - -" + "d '${cfg.mediaDir}/torrents/manual' 0755 transmission media - -" + "d '${cfg.mediaDir}/torrents/liadarr' 0755 transmission media - -" + "d '${cfg.mediaDir}/torrents/radarr' 0755 transmission media - -" + "d '${cfg.mediaDir}/torrents/sonarr' 0755 transmission media - -" + "d '${cfg.mediaDir}/torrents/readarr' 0755 transmission media - -" + ]; + + kirk.upnp.enable = cfg.upnp.enable; + + kirk.vpnnamespace = { + enable = true; + accessibleFrom = [ + "192.168.1.0/24" + "127.0.0.1" + ]; + dnsServers = cfg.vpn.dnsServers; + wireguardAddressPath = cfg.vpn.wgAddress; + wireguardConfigFile = cfg.vpn.wgConf; + vpnTestService = { + enable = cfg.vpn.vpnTestService.enable; + port = cfg.vpn.vpnTestService.port; + }; + openTcpPorts = cfg.vpn.openTcpPorts; + openUdpPorts = cfg.vpn.openUdpPorts; + }; + }; +} diff --git a/servarr/jellyfin/default.nix b/servarr/jellyfin/default.nix new file mode 100644 index 0000000..5980d2c --- /dev/null +++ b/servarr/jellyfin/default.nix @@ -0,0 +1,137 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.kirk.servarr.jellyfin; + defaultPort = 8096; + servarr = config.kirk.servarr; +in { + options.kirk.servarr.jellyfin = { + enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "enable jellyfin"; + }; + + stateDir = mkOption { + type = types.path; + default = "${servarr.stateDir}/servarr/jellyfin"; + description = lib.mdDoc "The state directory for jellyfin"; + }; + + useVpn = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Use VPN with prowlarr"; + }; + + nginx = { + enable = mkEnableOption "Enable nginx for jellyfin"; + + domainName = mkOption { + type = types.nullOr types.str; + default = null; + description = "REQUIRED! The domain name to host jellyfin on."; + }; + + acmeMail = mkOption { + type = types.nullOr types.str; + default = null; + description = "REQUIRED! The ACME mail."; + }; + }; + }; + + config = + #assert (!(cfg.useVpn && cfg.nginx.enable)) || abort "useVpn not compatible with nginx.enable."; + #assert (cfg.nginx.enable -> (cfg.nginx.domainName != null && cfg.nginx.acmeMail != null)) || abort "Both nginx.domain and nginx.acmeMail needs to be set if nginx.enable is set."; + mkIf cfg.enable + { + services.jellyfin.enable = cfg.enable; + + networking.firewall.allowedTCPPorts = if cfg.nginx.enable then [ + 80 # http + 443 # https + ] else []; + + services.nginx = mkIf (cfg.nginx.enable || cfg.useVpn) { + enable = true; + + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + + virtualHosts."${builtins.replaceStrings ["\n"] [""] cfg.nginx.domainName}" = mkIf cfg.nginx.enable { + enableACME = true; + forceSSL = true; + locations."/" = { + recommendedProxySettings = true; + proxyWebsockets = true; + proxyPass = "http://127.0.0.1:${builtins.toString defaultPort}"; + }; + }; + + virtualHosts."127.0.0.1:${builtins.toString defaultPort}" = mkIf cfg.useVpn { + listen = [ + { + addr = "0.0.0.0"; + port = defaultPort; + } + ]; + locations."/" = { + recommendedProxySettings = true; + proxyWebsockets = true; + proxyPass = "http://192.168.15.1:${builtins.toString defaultPort}"; + }; + }; + }; + + security.acme = mkIf cfg.nginx.enable { + acceptTerms = true; + defaults.email = cfg.nginx.acmeMail; + }; + + kirk.vpnnamespace.portMappings = [( + mkIf cfg.useVpn { + From = defaultPort; + To = defaultPort; + } + )]; + + containers.jellyfin = mkIf cfg.useVpn { + autoStart = true; + ephemeral = true; + extraFlags = [ "--network-namespace-path=/var/run/netns/wg" ]; + + bindMounts = { + "${servarr.mediaDir}/library".isReadOnly = false; + "${cfg.stateDir}".isReadOnly = false; + }; + + config = { + users.groups.jellyfin = {}; + users.users.jellyfin = { + uid = lib.mkForce config.users.users.jellyfin.uid; + isSystemUser = true; + group = "jellyfin"; + }; + + # Use systemd-resolved inside the container + # Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686 + networking.useHostResolvConf = lib.mkForce false; + services.resolved.enable = true; + networking.nameservers = dnsServers; + + services.jellyfin = { + enable = true; + group = "jellyfin"; + dataDir = "${cfg.stateDir}"; + }; + + system.stateVersion = "23.11"; + }; + }; + }; +} diff --git a/servarr/lidarr/default.nix b/servarr/lidarr/default.nix new file mode 100644 index 0000000..5052247 --- /dev/null +++ b/servarr/lidarr/default.nix @@ -0,0 +1,103 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.kirk.servarr.lidarr; + servarr = config.kirk.servarr; +in { + options.kirk.servarr.lidarr = { + enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Enable lidarr"; + }; + + stateDir = mkOption { + type = types.path; + default = "${servarr.stateDir}/servarr/lidarr"; + description = lib.mdDoc "The state directory for lidarr"; + }; + + useVpn = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Use VPN with prowlarr"; + }; + }; + + config = mkIf cfg.enable { + services.lidarr = { + enable = cfg.enable; + user = "lidarr"; + group = "media"; + dataDir = cfg.stateDir; + }; + + kirk.vpnnamespace.portMappings = [( + mkIf cfg.useVpn { + From = defaultPort; + To = defaultPort; + } + )]; + + containers.lidarr= mkIf cfg.useVpn { + autoStart = true; + ephemeral = true; + extraFlags = [ "--network-namespace-path=/var/run/netns/wg" ]; + + bindMounts = { + "${servarr.mediaDir}".isReadOnly = false; + "${cfg.stateDir}".isReadOnly = false; + }; + + config = { + users.groups.media = { + gid = config.users.groups.media.gid; + }; + users.users.lidarr = { + uid = lib.mkForce config.users.users.lidarr.uid; + isSystemUser = true; + group = "media"; + }; + + # Use systemd-resolved inside the container + # Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686 + networking.useHostResolvConf = lib.mkForce false; + services.resolved.enable = true; + networking.nameservers = dnsServers; + + services.lidarr = { + enable = true; + group = "media"; + dataDir = "${cfg.stateDir}"; + }; + + system.stateVersion = "23.11"; + }; + }; + + services.nginx = mkIf cfg.useVpn { + enable = true; + + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + + virtualHosts."127.0.0.1:${builtins.toString defaultPort}" = { + listen = [ + { + addr = "0.0.0.0"; + port = defaultPort; + } + ]; + locations."/" = { + recommendedProxySettings = true; + proxyWebsockets = true; + proxyPass = "http://192.168.15.1:${builtins.toString defaultPort}"; + }; + }; + }; + }; +} diff --git a/servarr/prowlarr/default.nix b/servarr/prowlarr/default.nix new file mode 100644 index 0000000..e219abd --- /dev/null +++ b/servarr/prowlarr/default.nix @@ -0,0 +1,106 @@ +# TODO: Dir creation and file permissions in nix +{ + pkgs, + config, + lib, + ... +}: +with lib; let + defaultPort = 9696; + dnsServers = config.kirk.vpnnamespace.dnsServer; + servarr = config.kirk.servarr; + cfg = config.kirk.servarr.prowlarr; +in { + options.kirk.servarr.prowlarr = { + enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Enable prowlarr"; + }; + + stateDir = mkOption { + type = types.path; + default = "${servarr.stateDir}/servarr/prowlarr"; + description = lib.mdDoc '' + The state directory for prowlarr. Currently doesn't work, except with VPN. + ''; + }; + + useVpn = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Use VPN with prowlarr"; + }; + }; + + config = mkIf cfg.enable { + services.prowlarr = mkIf (!cfg.useVpn) { + enable = true; + openFirewall = true; + }; + + kirk.vpnnamespace.portMappings = [( + mkIf cfg.useVpn { + From = defaultPort; + To = defaultPort; + } + )]; + + containers.prowlarr = mkIf cfg.useVpn { + autoStart = true; + ephemeral = true; + extraFlags = [ "--network-namespace-path=/var/run/netns/wg" ]; + + bindMounts = { + "/var/lib/prowlarr" = { + hostPath = cfg.stateDir; + isReadOnly = false; + }; + }; + + config = { + users.groups.prowlarr = {}; + users.users.prowlarr = { + uid = lib.mkForce config.users.users.prowlarr.uid; + isSystemUser = true; + group = "prowlarr"; + }; + + # Use systemd-resolved inside the container + # Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686 + networking.useHostResolvConf = lib.mkForce false; + services.resolved.enable = true; + networking.nameservers = dnsServers; + + services.prowlarr = { + enable = true; + openFirewall = true; + }; + + system.stateVersion = "23.11"; + }; + }; + + services.nginx = mkIf cfg.useVpn { + enable = true; + + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + + virtualHosts."127.0.0.1:${builtins.toString defaultPort}" = { + listen = [ + { + addr = "0.0.0.0"; + port = defaultPort; + } + ]; + locations."/" = { + recommendedProxySettings = true; + proxyWebsockets = true; + proxyPass = "http://192.168.15.1:${builtins.toString defaultPort}"; + }; + }; + }; + }; +} diff --git a/servarr/radarr/default.nix b/servarr/radarr/default.nix new file mode 100644 index 0000000..f0930b4 --- /dev/null +++ b/servarr/radarr/default.nix @@ -0,0 +1,108 @@ +# TODO: Dir creation and file permissions in nix +{ + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.kirk.servarr.radarr; + defaultPort = 7878; + servarr = config.kirk.servarr; + dnsServers = config.kirk.vpnnamespace.dnsServers; +in { + options.kirk.servarr.radarr = { + enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Enable radarr"; + }; + + stateDir = mkOption { + type = types.path; + default = "${servarr.stateDir}/servarr/radarr"; + description = lib.mdDoc "The state directory for radarr"; + }; + + useVpn = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Use VPN with radarr"; + }; + }; + + config = mkIf cfg.enable { + services.radarr = mkIf (!cfg.useVpn) { + enable = cfg.enable; + user = "radarr"; + group = "media"; + dataDir = cfg.stateDir; + }; + + kirk.vpnnamespace.portMappings = [( + mkIf cfg.useVpn { + From = defaultPort; + To = defaultPort; + } + )]; + + containers.radarr= mkIf cfg.useVpn { + autoStart = true; + ephemeral = true; + extraFlags = [ "--network-namespace-path=/var/run/netns/wg" ]; + + bindMounts = { + "${servarr.mediaDir}".isReadOnly = false; + "${cfg.stateDir}".isReadOnly = false; + }; + + config = { + users.groups.media = { + gid = config.users.groups.media.gid; + }; + users.users.radarr = { + uid = lib.mkForce config.users.users.radarr.uid; + isSystemUser = true; + group = "media"; + }; + + # Use systemd-resolved inside the container + # Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686 + networking.useHostResolvConf = lib.mkForce false; + services.resolved.enable = true; + networking.nameservers = dnsServers; + + services.radarr = { + enable = true; + group = "media"; + dataDir = cfg.stateDir; + }; + + system.stateVersion = "23.11"; + }; + }; + + services.nginx = mkIf cfg.useVpn { + enable = true; + + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + + virtualHosts."127.0.0.1:${builtins.toString defaultPort}" = { + listen = [ + { + addr = "0.0.0.0"; + port = defaultPort; + } + ]; + locations."/" = { + recommendedProxySettings = true; + proxyWebsockets = true; + proxyPass = "http://192.168.15.1:${builtins.toString defaultPort}"; + }; + }; + }; + + }; +} diff --git a/servarr/readarr/default.nix b/servarr/readarr/default.nix new file mode 100644 index 0000000..575e6af --- /dev/null +++ b/servarr/readarr/default.nix @@ -0,0 +1,104 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.kirk.servarr.readarr; + servarr = config.kirk.servarr; +in { + options.kirk.servarr.readarr = { + enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Enable readarr"; + }; + + stateDir = mkOption { + type = types.path; + default = "${servarr.stateDir}/servarr/readarr"; + description = lib.mdDoc "The state directory for readarr"; + }; + + useVpn = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Use VPN with prowlarr"; + }; + }; + + config = mkIf cfg.enable { + services.readarr = { + enable = cfg.enable; + user = "readarr"; + group = "media"; + dataDir = cfg.stateDir; + }; + + kirk.vpnnamespace.portMappings = [( + mkIf cfg.useVpn { + From = defaultPort; + To = defaultPort; + } + )]; + + containers.readarr = mkIf cfg.useVpn { + autoStart = true; + ephemeral = true; + extraFlags = [ "--network-namespace-path=/var/run/netns/wg" ]; + + bindMounts = { + "${servarr.mediaDir}".isReadOnly = false; + "${cfg.stateDir}".isReadOnly = false; + }; + + config = { + users.groups.media = { + gid = config.users.groups.media.gid; + }; + users.users.readarr = { + uid = lib.mkForce config.users.users.readarr.uid; + isSystemUser = true; + group = "media"; + }; + + # Use systemd-resolved inside the container + # Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686 + networking.useHostResolvConf = lib.mkForce false; + services.resolved.enable = true; + networking.nameservers = dnsServers; + + services.readarr = { + enable = true; + group = "media"; + dataDir = "${cfg.stateDir}"; + }; + + system.stateVersion = "23.11"; + }; + }; + + services.nginx = mkIf cfg.useVpn { + enable = true; + + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + + virtualHosts."127.0.0.1:${builtins.toString defaultPort}" = { + listen = [ + { + addr = "0.0.0.0"; + port = defaultPort; + } + ]; + locations."/" = { + recommendedProxySettings = true; + proxyWebsockets = true; + proxyPass = "http://192.168.15.1:${builtins.toString defaultPort}"; + }; + }; + }; + + }; +} diff --git a/servarr/sonarr/default.nix b/servarr/sonarr/default.nix new file mode 100644 index 0000000..695489a --- /dev/null +++ b/servarr/sonarr/default.nix @@ -0,0 +1,109 @@ +# TODO: Dir creation and file permissions in nix +{ + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.kirk.servarr.sonarr; + defaultPort = 8989; + servarr = config.kirk.servarr; + dnsServers = config.kirk.vpnnamespace.dnsServers; +in { + options.kirk.servarr.sonarr = { + enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Enable sonarr"; + }; + + stateDir = mkOption { + type = types.path; + default = "${servarr.stateDir}/sonarr"; + description = lib.mdDoc "The state directory for sonarr"; + }; + + useVpn = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Use VPN with sonarr"; + }; + }; + + config = mkIf cfg.enable { + services.sonarr = mkIf (!cfg.useVpn) { + enable = cfg.enable; + user = "sonarr"; + group = "media"; + dataDir = cfg.stateDir; + }; + + kirk.vpnnamespace.portMappings = [ + (mkIf cfg.useVpn { + From = defaultPort; + To = defaultPort; + }) + ]; + + containers.sonarr = mkIf cfg.useVpn { + autoStart = true; + ephemeral = true; + extraFlags = [ "--network-namespace-path=/var/run/netns/wg" ]; + + bindMounts = { + "${servarr.mediaDir}".isReadOnly = false; + "${cfg.stateDir}".isReadOnly = false; + }; + + config = { + users.groups.media = { + gid = config.users.groups.media.gid; + }; + users.users.sonarr = { + uid = lib.mkForce config.users.users.sonarr.uid; + isSystemUser = true; + group = "media"; + }; + + # Use systemd-resolved inside the container + # Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686 + networking.useHostResolvConf = lib.mkForce false; + services.resolved.enable = true; + networking.nameservers = dnsServers; + + users.groups.media = {}; + + services.sonarr = { + enable = cfg.enable; + group = "media"; + dataDir = cfg.stateDir; + }; + + system.stateVersion = "23.11"; + }; + }; + + services.nginx = mkIf cfg.useVpn { + enable = true; + + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + + virtualHosts."127.0.0.1:${builtins.toString defaultPort}" = { + listen = [ + { + addr = "0.0.0.0"; + port = defaultPort; + } + ]; + locations."/" = { + recommendedProxySettings = true; + proxyWebsockets = true; + proxyPass = "http://192.168.15.1:${builtins.toString defaultPort}"; + }; + }; + }; + }; +} diff --git a/servarr/transmission/default.nix b/servarr/transmission/default.nix new file mode 100644 index 0000000..ac07603 --- /dev/null +++ b/servarr/transmission/default.nix @@ -0,0 +1,220 @@ +# TODO: Dir creation and file permissions in nix +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.kirk.servarr.transmission; + servarr = config.kirk.servarr; + dnsServers = config.lib.vpn.dnsServers; +in { + options.kirk.servarr.transmission = { + enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Enable transmission"; + }; + + stateDir = mkOption { + type = types.path; + default = "${servarr.stateDir}/servarr/transmission"; + description = lib.mdDoc "The state directory for transmission. Only works with useVpn option."; + }; + + downloadDir = mkOption { + type = types.path; + default = "${servarr.mediaDir}/torrents"; + description = lib.mdDoc '' + The directory for transmission to download to. + ''; + }; + + useVpn = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Run transmission through VPN"; + }; + + useFlood = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc "Use the flood UI"; + }; + + peerPort = mkOption { + type = types.port; + default = 50000; + description = "transmission peer traffic port."; + }; + + uiPort = mkOption { + type = types.port; + default = 9091; + description = "transmission web-UI port."; + }; + + extraConfig = mkOption { + type = types.attrs; + default = {}; + description = "Extra settings config for the transmission service."; + }; + }; + + config = mkIf cfg.enable { + services.transmission = mkIf (!cfg.useVpn) { + enable = true; + group = "media"; + #home = cfg.stateDir; + webHome = if cfg.useFlood then pkgs.flood-for-transmission else null; + package = pkgs.transmission_4; + openRPCPort = true; + openPeerPorts = true; + settings = { + download-dir = "${servarr.mediaDir}/torrents"; + incomplete-dir-enabled = true; + incomplete-dir = "${servarr.mediaDir}/torrents/.incomplete"; + watch-dir-enabled = true; + watch-dir = "${servarr.mediaDir}/torrents/.watch"; + + rpc-port = cfg.uiPort; + rpc-whitelist-enabled = true; + rpc-whitelist = "192.168.15.1,127.0.0.1"; + rpc-authentication-required = true; + + blocklist-enabled = true; + blocklist-url = "https://github.com/Naunter/BT_BlockLists/raw/master/bt_blocklists.gz"; + + encryption = 1; + utp-enabled = true; + port-forwarding-enabled = false; + + anti-brute-force-enabled = true; + anti-brute-force-threshold = 10; + } // cfg.extraConfig; + }; + + kirk.vpnnamespace = mkIf cfg.useVpn { + portMappings = [{ + From = cfg.uiPort; + To = cfg.uiPort; + }]; + openUdpPorts = [ cfg.peerPort ]; + openTcpPorts = [ cfg.peerPort ]; + }; + + containers.transmission = mkIf cfg.useVpn { + autoStart = true; + ephemeral = true; + extraFlags = [ "--network-namespace-path=/var/run/netns/wg" ]; + + bindMounts = { + "${servarr.mediaDir}/torrents".isReadOnly = false; + "/var/lib/transmission" = { + hostPath = cfg.stateDir; + isReadOnly = false; + }; + }; + + config = { + users.groups.media = { + gid = config.users.groups.media.gid; + }; + users.users.transmission = { + uid = lib.mkForce config.users.users.transmission.uid; + isSystemUser = true; + group = "media"; + }; + + # Use systemd-resolved inside the container + # Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686 + networking.useHostResolvConf = lib.mkForce false; + services.resolved.enable = true; + networking.nameservers = dnsServers; + + systemd.services.transmission.serviceConfig = { + RootDirectoryStartOnly = lib.mkForce false; + RootDirectory = lib.mkForce ""; + }; + + services.transmission = { + enable = true; + # This is maybe wrong, too afraid to fix it lol + group = "media"; + webHome = if cfg.useFlood then pkgs.flood-for-transmission else null; + package = pkgs.transmission_4; + openRPCPort = true; + openPeerPorts = true; + settings = { + download-dir = "${servarr.mediaDir}/torrents"; + incomplete-dir-enabled = true; + incomplete-dir = "${servarr.mediaDir}/torrents/.incomplete"; + watch-dir-enabled = true; + watch-dir = "${servarr.mediaDir}/torrents/.watch"; + + rpc-bind-address = "192.168.15.1"; + rpc-port = cfg.uiPort; + rpc-whitelist-enabled = false; + rpc-whitelist = "192.168.15.1,127.0.0.1"; + rpc-authentication-required = false; + + blocklist-enabled = true; + blocklist-url = "https://github.com/Naunter/BT_BlockLists/raw/master/bt_blocklists.gz"; + + peer-port = cfg.peerPort; + dht-enabled = true; + pex-enabled = true; + utp-enabled = false; + encryption = 1; + port-forwarding-enabled = false; + + anti-brute-force-enabled = true; + anti-brute-force-threshold = 10; + + # 0 = None, 1 = Critical, 2 = Error, 3 = Warn, 4 = Info, 5 = Debug, 6 = Trace + message-level = 3; + } // cfg.extraConfig; + }; + + environment.systemPackages = with pkgs; [ + curl + wget + util-linux + unixtools.ping + coreutils + curl + bash + libressl + netcat-gnu + openresolv + dig + ]; + + system.stateVersion = "23.11"; + }; + }; + + services.nginx = mkIf cfg.useVpn { + enable = true; + + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + + virtualHosts."127.0.0.1:${builtins.toString cfg.uiPort}" = { + listen = [ + { + addr = "0.0.0.0"; + port = cfg.uiPort; + } + ]; + locations."/" = { + recommendedProxySettings = true; + proxyWebsockets = true; + proxyPass = "http://192.168.15.1:${builtins.toString cfg.uiPort}"; + }; + }; + }; + }; +} diff --git a/util/upnp/default.nix b/util/upnp/default.nix new file mode 100644 index 0000000..fcdd40a --- /dev/null +++ b/util/upnp/default.nix @@ -0,0 +1,104 @@ +# TODO: Dir creation and file permissions in nix +{ + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.kirk.upnp; +in { + options.kirk.upnp = { + enable = mkEnableOption "Enable port forwarding using UPNP."; + + openTcpPorts = mkOption { + type = with types; listOf port; + default = []; + description = lib.mdDoc '' + What TCP ports to open using UPNP. + ''; + example = [ 46382 38473 ]; + }; + + openUdpPorts = mkOption { + type = with types; listOf port; + default = []; + description = lib.mdDoc '' + What UDP ports to open using UPNP. + ''; + example = [ 46382 38473 ]; + }; + }; + + config = mkIf cfg.enable { + # UPNPC firewall access, if not set, then upnpc will fail with "No IGD + # UPnP Device found !" + # + # Alternatively, I also tried allowing all traffic from the router. But + # I assume that the official way is cleaner/more secure: + # ```nix + # networking.firewall.extraCommands = '' + # iptables -I INPUT -p udp -s 192.168.1.1 -j ACCEPT + # iptables -I OUTPUT -p udp -d 192.168.1.1 -j ACCEPT + # ''; + # ``` + # + # See: + # https://github.com/miniupnp/miniupnp/blob/8ced59d384de13689d3b1c32405bcb562030b241/miniupnpc/README + # + # TODO: Understand this properly + networking.firewall.extraCommands = '' + # Rules for IPv4: + ${pkgs.ipset}/bin/ipset -exist create upnp hash:ip,port timeout 3 + iptables -A OUTPUT -d 239.255.255.250/32 -p udp -m udp --dport 1900 -j SET --add-set upnp src,src --exist + iptables -A INPUT -p udp -m set --match-set upnp dst,dst -j ACCEPT + iptables -A INPUT -d 239.255.255.250/32 -p udp -m udp --dport 1900 -j ACCEPT + + # Rules for IPv6: + ${pkgs.ipset}/bin/ipset -exist create upnp6 hash:ip,port timeout 3 family inet6 + ip6tables -A OUTPUT -d ff02::c/128 -p udp -m udp --dport 1900 -j SET --add-set upnp6 src,src --exist + ip6tables -A OUTPUT -d ff05::c/128 -p udp -m udp --dport 1900 -j SET --add-set upnp6 src,src --exist + ip6tables -A INPUT -p udp -m set --match-set upnp6 dst,dst -j ACCEPT + ip6tables -A INPUT -d ff02::c/128 -p udp -m udp --dport 1900 -j ACCEPT + ip6tables -A INPUT -d ff05::c/128 -p udp -m udp --dport 1900 -j ACCEPT + ''; + + systemd = { + services.upnpc = let + upnp-ports = pkgs.writeShellApplication { + name = "upnp-ports"; + + runtimeInputs = with pkgs; [miniupnpc]; + + text = ( + strings.concatMapStrings (x: "upnpc -r ${builtins.toString x} UDP" + "\n") cfg.openUpdPorts ++ + strings.concatMapStrings (x: "upnpc -r ${builtins.toString x} TCP" + "\n") cfg.openTcpPorts ++ + ''echo "Successfully requested upnp ports to be opened".'' + ); + }; + in mkIf cfg.upnp.enable { + enable = true; + description = "Sets port on router"; + script = "${upnp-ports}/bin/upnp-ports"; + + serviceConfig = { + User = "root"; + Type = "oneshot"; + }; + }; + + timers = { + upnpc = mkIf cfg.upnp.enable { + description = "Sets port on router"; + wantedBy = ["timers.target"]; + + timerConfig = { + OnCalendar = "hourly"; + Persistent = "true"; # Run service immediately if last window was missed + RandomizedDelaySec = "5m"; # Run service OnCalendar +- 1h + }; + }; + }; + }; + }; +} diff --git a/util/vpnNamespace/default.nix b/util/vpnNamespace/default.nix new file mode 100644 index 0000000..e87a835 --- /dev/null +++ b/util/vpnNamespace/default.nix @@ -0,0 +1,347 @@ +{ lib, pkgs, config, ... }: +# Thanks to Maroka-chan... +# TODO: Make it so you can make multiple namespaces by giving a list of +# objects with settings as attributes. Also add an option to enable whether +# the namespace should use a vpn or not. +with builtins; +with lib; +let + cfg = config.kirk.vpnnamespace; +in { + options.kirk.vpnnamespace = { + enable = mkEnableOption (lib.mdDoc "VPN Namespace") // { + description = lib.mdDoc '' + Whether to enable the VPN namespace. + + To access the namespace a veth pair is used to + connect the vpn namespace and the default namespace + through a linux bridge. One end of the pair is + connected to the linux bridge on the default namespace. + The other end is connected to the vpn namespace. + + Systemd services can be run within the namespace by + adding these options: + + bindsTo = [ "netns@wg.service" ]; + requires = [ "network-online.target" ]; + after = [ "wg.service" ]; + serviceConfig = { + NetworkNamespacePath = "/var/run/netns/wg"; + }; + ''; + }; + + accessibleFrom = mkOption { + type = types.listOf types.str; + default = [ ]; + description = lib.mdDoc '' + Subnets or specific addresses that the namespace should be accessible to. + ''; + example = [ + "10.0.2.0/24" + "192.168.1.27" + ]; + }; + + namespaceAddress = mkOption { + type = types.str; + default = "192.168.15.1"; + description = lib.mdDoc '' + The address of the veth interface connected to the vpn namespace. + + This is the address used to reach the vpn namespace from other + namespaces connected to the linux bridge. + ''; + }; + + bridgeAddress = mkOption { + type = types.str; + default = "192.168.15.5"; + description = lib.mdDoc '' + The address of the linux bridge on the default namespace. + + The linux bridge sits on the default namespace and + needs an address to make communication between the + default namespace and other namespaces on the + bridge possible. + ''; + }; + + wireguardAddressPath = mkOption { + type = types.path; + default = ""; + description = lib.mdDoc '' + The address for the wireguard interface. + It is a path to a file containing the address. + This is done so the whole wireguard config can be specified + in a secret file. + ''; + }; + + wireguardConfigFile = mkOption { + type = types.path; + default = "/etc/wireguard/wg0.conf"; + description = lib.mdDoc '' + Path to the wireguard config to use. + + Note that this is not a wg-quick config. + ''; + }; + + portMappings = mkOption { + type = with types; listOf (attrsOf port); + default = []; + description = lib.mdDoc '' + A list of pairs mapping a port from the host to a port in the namespace. + ''; + example = [{ + From = 80; + To = 80; + }]; + }; + + dnsServers = mkOption { + type = with types; nullOr (listOf str); + default = loadDns wireguardConfigFile; #[ "1.1.1.2" ]; + description = lib.mdDoc '' + YOUR VPN WILL LEAK IF THIS IS NOT SET. The dns address of your vpn. + ''; + example = [ "1.1.1.2" ]; + }; + + openTcpPorts = mkOption { + type = with types; listOf port; + default = []; + description = lib.mdDoc '' + What TCP ports to allow incoming traffic from. You need this if + you're port forwarding on your VPN provider. + ''; + example = [ 46382 38473 ]; + }; + + openUdpPorts = mkOption { + type = with types; listOf port; + default = []; + description = lib.mdDoc '' + What UDP ports to allow incoming traffic from. You need this if + you're port forwarding on your VPN provider. + ''; + example = [ 46382 38473 ]; + }; + + vpnTestService = { + enable = mkEnableOption "Enable the vpn test service."; + + port = mkOption { + type = types.port; + default = [ 12300 ]; + description = lib.mdDoc '' + The port that the vpn test service listens to. + ''; + example = [ 58403 ]; + }; + }; + }; + + config = + let + headMay = list: if list == [] then null else head list; + # Checks if string is ipv4, from SO, hope it works well + # https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + isIpv4 = address: + let pat = "((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])?/?[0-9]?[0-9]"; + regex = match pat address; + in regex != null; + # Checks if string is ipv6, from SO, hope it works well + # https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + isIpv6 = address: + let pat = "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))"; + regex = match pat address; + in regex != null; + isIp = ip: (isIpv4 ip || isIpv6 ip); + in + mkIf cfg.enable { + lib.vpn = { + dnsServers = + let lines = split "\n" (readFile cfg.wireguardConfigFile); + dnsLine = headMay (filter (x: typeOf x == "string" && match ".*DNS.*" x != null) lines); + in if dnsLine == null then [] else let + ipsUnsplit = head (match "DNS ?=(.*)" dnsLine); + in if ipsUnsplit == null then [] else let + ips = filter (x: typeOf x == "string") (split "," ipsUnsplit); + ipsNoSpaces = map (replaceStrings [" "] [""]) ips; + correctIps = filter isIp ipsNoSpaces; + in + assert ( correctIps != [] ) || abort "There must be at least 1 DNS server set."; + correctIps; + }; + + boot.kernel.sysctl."net.ipv4.ip_forward" = 1; + + systemd.services = { + "netns@" = { + description = "%I network namespace"; + before = [ "network.target" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + ExecStart = "${pkgs.iproute2}/bin/ip netns add %I"; + ExecStop = "${pkgs.iproute2}/bin/ip netns del %I"; + }; + }; + + wg = { + description = "wg network interface"; + bindsTo = [ "netns@wg.service" ]; + requires = [ "network-online.target" ]; + after = [ "netns@wg.service" ]; + wantedBy = [ "netns@wg.service" ]; + + serviceConfig = let + lines = split "\n" (readFile cfg.wireguardConfigFile); + addrLine = headMay (filter (x: typeOf x == "string" && match ".*Address.*" x != null) lines); + in if addrLine == null then [] else let + ipsUnsplit = head (match "Address ?=(.*)" addrLine); + in if ipsUnsplit == null then [] else let + ips = filter (x: typeOf x == "string") (split "," ipsUnsplit); + ipsNoSpaces = map (replaceStrings [" "] [""]) ips; + wgIpv4Address = headMay (filter isIpv4 ipsNoSpaces); + + vpn-namespace = pkgs.writeShellApplication { + name = "vpn-namespace"; + + runtimeInputs = with pkgs; [ iproute2 wireguard-tools iptables ]; + + text = '' + # Set up the wireguard interface + tmpdir=$(mktemp -d) + cat ${cfg.wireguardConfigFile} > "$tmpdir/wg.conf" + + # Get dns servers + grep "DNS =" "$tmpdir/wg.conf" | sed 's/DNS =//g' | sed 's/,/\n/g' | sed 's/ //g' | sed 's/^/nameserver: /g' > "$tmpdir/resolv.conf" + + ip link add wg0 type wireguard + ip link set wg0 netns wg + ip -n wg address add "${wgIpv4Address}" dev wg0 + ip netns exec wg wg setconf wg0 <(wg-quick strip "$tmpdir/wg.conf") + ip -n wg link set wg0 up + ip -n wg route add default dev wg0 + + # Start the loopback interface + ip -n wg link set dev lo up + + # Create a bridge + ip link add v-net-0 type bridge + ip addr add ${cfg.bridgeAddress}/24 dev v-net-0 + ip link set dev v-net-0 up + + # Set up veth pair to link namespace with host network + ip link add veth-vpn-br type veth peer name veth-vpn netns wg + ip link set veth-vpn-br master v-net-0 + + ip -n wg addr add ${cfg.namespaceAddress}/24 dev veth-vpn + ip -n wg link set dev veth-vpn up + + echo "setting dns" + # DNS test, see: + # https://www.man7.org/linux/man-pages/man8/wg-quick.8.html + # Absolutely no luck... + #echo "nameserver 1.1.1.1" | ip netns exec wg resolvconf -a wg0 -m 0 -x + + echo "Hello test" + '' + + # Add routes to make the namespace accessible + + strings.concatMapStrings (x: + "ip -n wg route add ${x} via ${cfg.bridgeAddress}" + "\n" + ) cfg.accessibleFrom + + # Add prerouting rules + + strings.concatMapStrings (x: + "iptables -t nat -A PREROUTING -p tcp --dport ${builtins.toString x.From} -j DNAT --to-destination ${cfg.namespaceAddress}:${builtins.toString x.To}" + + "\n" + ) cfg.portMappings + + # Allow VPN TCP ports + + strings.concatMapStrings (x: + "ip netns exec wg iptables -I INPUT -p tcp --dport ${builtins.toString x} -j ACCEPT" + + "\n" + ) cfg.openTcpPorts + + # Allow VPN UDP ports + + strings.concatMapStrings (x: + "ip netns exec wg iptables -I INPUT -p udp --dport ${builtins.toString x} -j ACCEPT" + + "\n" + ) cfg.openUdpPorts; + }; + in assert ( wgIpv4Address != null ) || abort "No address found in config file."; { + Type = "oneshot"; + RemainAfterExit = true; + ExecStart = "${vpn-namespace}/bin/vpn-namespace"; + + ExecStopPost = with pkgs; writers.writeBash "wg-down" ('' + ${iproute2}/bin/ip -n wg route del default dev wg0 + ${iproute2}/bin/ip -n wg link del wg0 + ${iproute2}/bin/ip -n wg link del veth-vpn + ${iproute2}/bin/ip link del v-net-0 + + # DNS test, see: + # https://www.man7.org/linux/man-pages/man8/wg-quick.8.html + #${iproute2}/bin/ip netns exec wg resolvconf -d wg0 + '' + + # Delete prerouting rules + + strings.concatMapStrings (x: "${iptables}/bin/iptables -t nat -D PREROUTING -p tcp --dport ${builtins.toString x.From} -j DNAT --to-destination ${cfg.namespaceAddress}:${builtins.toString x.To}" + "\n") cfg.portMappings); + }; + }; + + vpn-test-service = { + enable = cfg.vpnTestService.enable; + + script = let + vpn-test = pkgs.writeShellApplication { + name = "vpn-test"; + + runtimeInputs = with pkgs; [ util-linux unixtools.ping coreutils curl bash libressl netcat-gnu openresolv dig ]; + + text = '' + cd "$(mktemp -d)" + + # Print resolv.conf + echo "/etc/resolv.conf contains:" + cat /etc/resolv.conf + + # Query resolvconf + echo "resolvconf output:" + resolvconf -l + echo "" + + # Get ip + echo "Getting IP:" + curl -s ipinfo.io + + cat /etc/test.file + + echo -ne "DNS leak test:" + curl -s https://raw.githubusercontent.com/macvk/dnsleaktest/b03ab54d574adbe322ca48cbcb0523be720ad38d/dnsleaktest.sh -o dnsleaktest.sh + chmod +x dnsleaktest.sh + ./dnsleaktest.sh + + echo "starting netcat on port ${builtins.toString cfg.vpnTestService.port}:" + nc -vnlp ${builtins.toString cfg.vpnTestService.port} + ''; + }; + in "${vpn-test}/bin/vpn-test"; + + bindsTo = [ "netns@wg.service" ]; + requires = [ "network-online.target" ]; + after = [ "wg.service" ]; + serviceConfig = { + User="prowlarr"; + NetworkNamespacePath = "/var/run/netns/wg"; + BindReadOnlyPaths=["/etc/netns/wg/resolv.conf:/etc/resolv.conf:norbind" "/data/test.file:/etc/test.file:norbind"]; + }; + }; + }; + }; +}