diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 6703d41..0000000 --- a/bors.toml +++ /dev/null @@ -1,5 +0,0 @@ -status = [ "check" ] - -required_approvals = 1 - -up_to_date_approvals = true diff --git a/bud/default.nix b/bud/default.nix deleted file mode 100644 index fc4eded..0000000 --- a/bud/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - pkgs, - lib, - budUtils, - ... -}: { - bud.cmds = with pkgs; { - get = { - writer = budUtils.writeBashWithPaths [nixUnstable git coreutils]; - synopsis = "get [DEST]"; - help = "Copy the desired template to DEST"; - script = ./get.bash; - }; - }; -} diff --git a/bud/get.bash b/bud/get.bash deleted file mode 100644 index b88081b..0000000 --- a/bud/get.bash +++ /dev/null @@ -1 +0,0 @@ -nix flake new -t "github:divnix/devos/main" "${2:-devos}" diff --git a/default.nix b/default.nix deleted file mode 100644 index 395edca..0000000 --- a/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -let - inherit (default.inputs.nixos) lib; - default = (import ./lib/compat).defaultNix; - ciSystems = ["aarch64-linux" "i686-linux" "x86_64-linux"]; - filterSystems = lib.filterAttrs (system: _: lib.elem system ciSystems); - recurseIntoAttrsRecursive = lib.mapAttrs (_: v: - if lib.isAttrs v - then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v) - else v); - systemOutputs = - lib.filterAttrs - (name: set: lib.isAttrs set && lib.any (system: set ? ${system} && name != "legacyPackages") ciSystems) - default.outputs; - ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs; -in - (recurseIntoAttrsRecursive ciDrvs) // {shell = import ./shell.nix;} diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 7585238..0000000 --- a/doc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -book diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md deleted file mode 100644 index 86f5dd7..0000000 --- a/doc/CONTRIBUTING.md +++ /dev/null @@ -1,18 +0,0 @@ -# Pull Requests - -## TL;DR; -- **Target Branch**: `main` -- **Merge Policy**: [`bors`][bors] is always right (→ `bors try`) -- **Docs**: every changeset is expected to contain doc updates -- **Commit Msg**: be a poet! Comprehensive and explanatory commit messages - should cover the motivation and use case in an easily understandable manner - even when read after a few months. -- **Test Driven Development**: please default to test driven development where possible. - -### Within the Devshell (`nix develop`) -- **Hooks**: please `git commit` within the devshell -- **Fail Early**: please run from within the devshell on your local machine: - - `nix flake check` - -[bors]: https://bors.tech - diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md deleted file mode 100644 index 1d7bafe..0000000 --- a/doc/SUMMARY.md +++ /dev/null @@ -1,28 +0,0 @@ -# Summary - -- [Introduction](../README.md) -- [Quick Start](./start/index.md) - - [ISO](./start/iso.md) - - [Bootstrapping](./start/bootstrapping.md) - - [From NixOS](./start/from-nixos.md) -- [Key Concepts](./concepts/index.md) - - [Hosts](./concepts/hosts.md) - - [Overrides](./concepts/overrides.md) - - [Profiles](./concepts/profiles.md) - - [Suites](./concepts/suites.md) - - [Users](./concepts/users.md) -- [Outputs](./outputs/index.md) - - [Modules](./outputs/modules.md) - - [Overlays](./outputs/overlays.md) - - [Packages](./outputs/pkgs.md) -- [Concerns]() - - [Secrets](./secrets.md) - - [Tests](./tests.md) -- [Helper Script – `bud`](./bud/index.md) - - [get](./bud/get.md) -- [Integrations](./integrations/index.md) - - [Cachix](./integrations/cachix.md) - - [Deploy RS](./integrations/deploy.md) - - [NvFetcher](./integrations/nvfetcher.md) - - [Hercules CI](./integrations/hercules.md) -- [Contributing](./CONTRIBUTING.md) diff --git a/doc/book.toml b/doc/book.toml deleted file mode 100644 index 373d26f..0000000 --- a/doc/book.toml +++ /dev/null @@ -1,6 +0,0 @@ -[book] -authors = ["Timothy DeHerrera"] -language = "en" -multilingual = false -src = "." -title = "devos docs" diff --git a/doc/bud/get.md b/doc/bud/get.md deleted file mode 100644 index 12263df..0000000 --- a/doc/bud/get.md +++ /dev/null @@ -1,10 +0,0 @@ -# get -The `get` subcommand is useful for getting a bare copy of devos without the -git history. - -## Usage -```sh -bud get DEST-DIR -``` - -If DEST-DIR is ommitted, it defaults to _./devos_. diff --git a/doc/bud/index.md b/doc/bud/index.md deleted file mode 100644 index 7b98579..0000000 --- a/doc/bud/index.md +++ /dev/null @@ -1,24 +0,0 @@ -# [`bud`][bud] command -The template incudes a convenient script for managing your system called [`bud`][bud]. - -It is a portable and highly composable system control tool that work anywhere on your host -or in the flake's devshell. - -Although it comes with some predefined standard helpers, -it is very extensible and you are encouraged to write your own script snippets -to ease your workflows. An example is the bud module for a `get` command that -comes included with `devos`. - -While writing scripts you can convenientely access smart environment variables -that can tell the current architecture, user or host name, among others, regardless -wether you invoke `bud` within the devshell or as the system-wide installed `bud`. - -For details, please review the [bud repo][bud]. - -## Usage -```sh -bud help -``` - - -[bud]: https://github.com/divnix/bud diff --git a/doc/concepts/hosts.md b/doc/concepts/hosts.md deleted file mode 100644 index 1c3c3fa..0000000 --- a/doc/concepts/hosts.md +++ /dev/null @@ -1,62 +0,0 @@ -# Hosts - -Nix flakes contain an output called `nixosConfigurations` declaring an -attribute set of valid NixOS systems. To simplify the management and creation -of these hosts, devos automatically imports every _.nix_ file inside this -directory to the mentioned attribute set, applying the projects defaults to -each. The only hard requirement is that the file contain a valid NixOS module. - -As an example, a file `hosts/system.nix` or `hosts/system/default.nix` will -be available via the flake output `nixosConfigurations.system`. You can have -as many hosts as you want and all of them will be automatically imported based -on their name. - -For each host, the configuration automatically sets the `networking.hostName` -attribute to the folder name or name of the file minus the _.nix_ extension. This -is for convenience, since `nixos-rebuild` automatically searches for a configuration -matching the current systems hostname if one is not specified explicitly. - -You can set channels, systems, and add extra modules to each host by editing the -`nixos.hosts` argument in flake.nix. This is the perfect place to import -host specific modules from external sources, such as the -[nixos-hardware][nixos-hardware] repository. - -It is recommended that the host modules only contain configuration information -specific to a particular piece of hardware. Anything reusable across machines -is best saved for [profile modules](./profiles.md). - -This is a good place to import sets of profiles, called [suites](./suites.md), -that you intend to use on your machine. - - -## Example - -flake.nix: -```nix -{ - nixos = { - imports = [ (devos.lib.importHosts ./hosts) ]; - hosts = { - librem = { - channelName = "latest"; - modules = [ nixos-hardware.nixosModules.purism-librem-13v3 ]; - }; - }; - }; -} -``` - -hosts/librem.nix: -```nix -{ suites, ... }: -{ - imports = suites.laptop; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; -} -``` - -[nixos-hardware]: https://github.com/NixOS/nixos-hardware diff --git a/doc/concepts/index.md b/doc/concepts/index.md deleted file mode 100644 index 618292c..0000000 --- a/doc/concepts/index.md +++ /dev/null @@ -1,10 +0,0 @@ -# Key Concepts - -Key concepts are derived from [digga][digga]. Please refer to its -[docs][digga-docs] for more details. - -This section is dedicated to helping you develop a more hands on -understanding of them them. - -[digga-docs]: https://digga.divnix.com -[digga]: https://github.com/divnix/digga diff --git a/doc/concepts/overrides.md b/doc/concepts/overrides.md deleted file mode 100644 index 610fde0..0000000 --- a/doc/concepts/overrides.md +++ /dev/null @@ -1,42 +0,0 @@ -# Overrides -Each NixOS host follows one channel. But many times it is useful to get packages -or modules from different channels. - -## Packages -You can make use of `overlays/overrides.nix` to override specific packages in the -default channel to be pulled from other channels. That file is simply an example -of how any overlay can get `channels` as their first argument. - -You can add overlays to any channel to override packages from other channels. - -Pulling the manix package from the `latest` channel: -```nix -channels: final: prev: { - __dontExport = true; - inherit (pkgs.latest) manix; -} -``` - -It is recommended to set the `__dontExport` property for override specific -overlays. `overlays/overrides.nix` is the best place to consolidate all package -overrides and the property is already set for you. - -## Modules - -You can also pull modules from other channels. All modules have access to the -`modulesPath` for each channel as `ModulesPath`. And you can use -`disabledModules` to remove modules from the current channel. - -To pull zsh module from the `latest` channel this code can be placed in any module, whether its your host file, a profile, or a module in ./modules etc: -```nix -{ latestModulesPath }: -{ - imports = [ "${latestModulesPath}/programs/zsh/zsh.nix" ]; - disabledModules = [ "programs/zsh/zsh.nix" ]; -} -``` - -> ##### _Note:_ -> Sometimes a modules name will change from one branch to another. - -[nixpkgs-modules]: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules diff --git a/doc/concepts/profiles.md b/doc/concepts/profiles.md deleted file mode 100644 index 7e592cc..0000000 --- a/doc/concepts/profiles.md +++ /dev/null @@ -1,67 +0,0 @@ -# Profiles - -Profiles are a convenient shorthand for the [_definition_][definition] of -[options][options] in contrast to their [_declaration_][declaration]. They're -built into the NixOS module system for a reason: to elegantly provide a clear -separation of concerns. - -## Creation -Profiles are created with the `rakeLeaves` function which recursively collects -`.nix` files from within a folder. The recursion stops at folders with a `default.nix` -in them. You end up with an attribute set with leaves(paths to profiles) or -nodes(attrsets leading to more nodes or leaves). - -A profile is used for quick modularization of [interelated bits](./profiles.md#subprofiles). - -> ##### _Notes:_ -> * For _declaring_ module options, there's the [modules](../outputs/modules.md) directory. -> * This directory takes inspiration from -> [upstream](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/profiles) -> . - -### Nested profiles -Profiles can be nested in attribute sets due to the recursive nature of `rakeLeaves`. -This can be useful to have a set of profiles created for a specific purpose. It is -sometimes useful to have a `common` profile that has high level concerns related -to all its sister profiles. - -### Example - -profiles/develop/common.nix: -```nix -{ - imports = [ ./zsh ]; - # some generic development concerns ... -} -``` - -profiles/develop/zsh.nix: -```nix -{ ... }: -{ - programs.zsh.enable = true; - # zsh specific options ... -} -``` - -The examples above will end up with a profiles set like this: -```nix -{ - develop = { - common = ./profiles/develop/common.nix; - zsh = ./profiles/develop/zsh.nix; - }; -} -``` - -## Conclusion -Profiles are the most important concept in DevOS. They allow us to keep our -Nix expressions self contained and modular. This way we can maximize reuse -across hosts while minimizing boilerplate. Remember, anything machine -specific belongs in your [host](hosts.md) files instead. - -[definition]: https://nixos.org/manual/nixos/stable/index.html#sec-option-definitions -[declaration]: https://nixos.org/manual/nixos/stable/index.html#sec-option-declarations -[options]: https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules -[spec]: https://github.com/divnix/devos/tree/main/lib/devos/mkProfileAttrs.nix -[config]: https://nixos.wiki/wiki/Module#structure diff --git a/doc/concepts/suites.md b/doc/concepts/suites.md deleted file mode 100644 index e9eef34..0000000 --- a/doc/concepts/suites.md +++ /dev/null @@ -1,25 +0,0 @@ -# Suites -Suites provide a mechanism for users to easily combine and name collections of -profiles. - -`suites` are defined in the `importables` argument in either the `home` or `nixos` -namespace. They are a special case of an `importable` which is passed as a special -argument (one that can be use in an `imports` line) to your hosts. All lists defined -in `suites` are flattened and type-checked as paths. - -## Definition -```nix -rec { - workstation = [ profiles.develop profiles.graphical users.nixos ]; - mobileWS = workstation ++ [ profiles.laptop ]; -} -``` - -## Usage -`hosts/my-laptop.nix`: -```nix -{ suites, ... }: -{ - imports = suites.mobileWS; -} -``` diff --git a/doc/concepts/users.md b/doc/concepts/users.md deleted file mode 100644 index 3ab7c39..0000000 --- a/doc/concepts/users.md +++ /dev/null @@ -1,77 +0,0 @@ -> ##### _Note:_ -> This section and its semantics need a conceptiual rework. -> Since recently [portable home configurations][portableuser] -> that are not bound to any specific host are a thing. - -# Users - -Users are a special case of [profiles](profiles.md) that define system -users and [home-manager][home-manager] configurations. For your convenience, -home manager is wired in by default so all you have to worry about is declaring -your users. For a fully fleshed out example, check out the developers personal -[branch](https://github.com/divnix/devos/tree/nrd/users/nrd/default.nix). - -## Basic Usage -`users/myuser/default.nix`: -```nix -{ ... }: -{ - users.users.myuser = { - isNormalUser = true; - }; - - home-manager.users.myuser = { - programs.mpv.enable = true; - }; -} - -``` - -## Home Manager -Home Manager support follows the same principles as regular nixos configurations, -it even gets its own namespace in your `flake.nix` as `home`. - -All modules defined in [user modules][modules-list] will be imported to -Home Manager. -User profiles can be collected in a similar fashion as system ones into a `suites` -argument that gets passed to your home-manager users. - -### Example -```nix -{ - home-manager.users.nixos = { suites, ... }: { - imports = suites.base; - }; -} -``` - - -## External Usage -You can easily use the defined home-manager configurations outside of NixOS -using the `homeConfigurations` flake output. The [bud](../bud/index.md) helper -script makes this even easier. - -This is great for keeping your environment consistent across Unix systems, -including OSX. - -### From within the projects devshell: -```sh -# builds the nixos user defined in the NixOS host -bud home NixOS nixos - -# build and activate -bud home NixOS nixos switch -``` - -### Manually from outside the project: -```sh -# build -nix build "github:divnix/devos#homeConfigurations.nixos@NixOS.home.activationPackage" - -# activate -./result/activate && unlink result -``` - -[home-manager]: https://nix-community.github.io/home-manager -[modules-list]: https://github.com/divnix/devos/tree/main/users/modules/module-list.nix -[portableuser]: https://digga.divnix.com/api-reference-home.html#homeusers diff --git a/doc/integrations/cachix.md b/doc/integrations/cachix.md deleted file mode 100644 index b025459..0000000 --- a/doc/integrations/cachix.md +++ /dev/null @@ -1,17 +0,0 @@ -# Cachix -The system will automatically pull a cachix.nix at the root if one exists. -This is usually created automatically by a `sudo cachix use`. If you're more -inclined to keep the root clean, you can drop any generated files in the -`cachix` directory into the `profiles/cachix` directory without further -modification. - -For example, to add your own cache, assuming the template lives in /etc/nixos, -by simply running `sudo cachix use yourcache`. Then, optionally, move -`cachix/yourcache.nix` to `profiles/cachix/yourcache.nix` - -These caches are only added to the system after a `nixos-rebuild switch`, so it -is recommended to call `cachix use nrdxp` before the initial deployment, as it -will save a lot of build time. - -In the future, users will be able to skip this step once the ability to define -the nix.conf within the flake is fully fleshed out upstream. diff --git a/doc/integrations/deploy.md b/doc/integrations/deploy.md deleted file mode 100644 index 642267c..0000000 --- a/doc/integrations/deploy.md +++ /dev/null @@ -1,49 +0,0 @@ -# deploy-rs -[Deploy-rs][d-rs] is a tool for managing NixOS remote machines. It was -chosen for devos after the author experienced some frustrations with the -stateful nature of nixops' db. It was also designed from scratch to support -flake based deployments, and so is an excellent tool for the job. - -By default, all the [hosts](../concepts/hosts.md) are also available as deploy-rs nodes, -configured with the hostname set to `networking.hostName`; overridable via -the command line. - -## Usage - -Just add your ssh key to the host: -```nix -{ ... }: -{ - users.users.${sshUser}.openssh.authorizedKeys.keyFiles = [ - ../secrets/path/to/key.pub - ]; -} -``` - -And the private key to your user: -```nix -{ ... }: -{ - home-manager.users.${sshUser}.programs.ssh = { - enable = true; - - matchBlocks = { - ${host} = { - host = hostName; - identityFile = ../secrets/path/to/key; - extraOptions = { AddKeysToAgent = "yes"; }; - }; - }; - } -} -``` - -And run the deployment: -```sh -deploy '.#hostName' --hostname host.example.com -``` - -> ##### _Note:_ -> Your user will need **passwordless** sudo access - -[d-rs]: https://github.com/serokell/deploy-rs diff --git a/doc/integrations/hercules.md b/doc/integrations/hercules.md deleted file mode 100644 index aa0185e..0000000 --- a/doc/integrations/hercules.md +++ /dev/null @@ -1,36 +0,0 @@ -# Hercules CI -If you start adding your own packages and configurations, you'll probably have -at least a few binary artifacts. With hercules we can build every package in -our configuration automatically, on every commit. Additionally, we can have it -upload all our build artifacts to a binary cache like [cachix][cachix]. - -This will work whether your copy is a fork, or a bare template, as long as your -repo is hosted on GitHub. - -## Setup -Just head over to [hercules-ci.com](https://hercules-ci.com) to make an account. - -Then follow the docs to set up an [agent][agent], if you want to deploy to a -binary cache (and of course you do), be sure _not_ to skip the -[binary-caches.json][cache]. - -## Ready to Use -The repo is already set up with the proper _default.nix_ file, building all -declared packages, checks, profiles and shells. So you can see if something -breaks, and never build the same package twice! - -If you want to get fancy, you could even have hercules -[deploy your configuration](https://docs.hercules-ci.com/hercules-ci-effects/guide/deploy-a-nixos-machine/)! - -> ##### _Note:_ -> Hercules doesn't have access to anything encrypted in the -> [secrets folder](../../secrets), so none of your secrets will accidentally get -> pushed to a cache by mistake. -> -> You could pull all your secrets via your user, and then exclude it from -> [allUsers](https://github.com/nrdxp/devos/blob/nrd/suites/default.nix#L17) -> to keep checks passing. - -[agent]: https://docs.hercules-ci.com/hercules-ci/getting-started/#github -[cache]: https://docs.hercules-ci.com/hercules-ci/getting-started/deploy/nixos/#_3_configure_a_binary_cache -[cachix]: https://cachix.org diff --git a/doc/integrations/index.md b/doc/integrations/index.md deleted file mode 100644 index 5ea739e..0000000 --- a/doc/integrations/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# Integrations -This section explores some of the optional tools included with devos to provide -a solution to common concerns such as ci and remote deployment. An effort is -made to choose tools that treat nix, and where possible flakes, as first class -citizens. diff --git a/doc/integrations/nvfetcher.md b/doc/integrations/nvfetcher.md deleted file mode 100644 index c26c5fb..0000000 --- a/doc/integrations/nvfetcher.md +++ /dev/null @@ -1,43 +0,0 @@ -# nvfetcher -[NvFetcher][nvf] is a workflow companion for updating nix sources. - -You can specify an origin source and an update configuration, and -nvfetcher can for example track updates to a specific branch and -automatically update your nix sources configuration on each run -to the tip of that branch. - -All package source declaration is done in [sources.toml][sources.toml]. - -From within the devshell of this repo, run `nvfetcher`, a wrapped -version of `nvfetcher` that knows where to find and place its files -and commit the results. - -## Usage - -Statically fetching (not tracking) a particular tag from a github repo: -```toml -[manix] -src.manual = "v0.6.3" -fetch.github = "mlvzk/manix" -``` - -Tracking the latest github _release_ from a github repo: -```toml -[manix] -src.github = "mlvzk/manix" # responsible for tracking -fetch.github = "mlvzk/manix" # responsible for fetching -``` - -Tracking the latest commit of a git repository and fetch from a git repo: -```toml -[manix] -src.git = "https://github.com/mlvzk/manix.git" # responsible for tracking -fetch.git = "https://github.com/mlvzk/manix.git" # responsible for fetching -``` - -> ##### _Note:_ -> Please refer to the [NvFetcher Readme][nvf-readme] for more options. - -[nvf]: https://github.com/berberman/nvfetcher -[nvf-readme]: https://github.com/berberman/nvfetcher#readme -[sources.toml]: https://github.com/divnix/devos/tree/main/pkgs/sources.toml diff --git a/doc/outputs/index.md b/doc/outputs/index.md deleted file mode 100644 index 3620718..0000000 --- a/doc/outputs/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Layout -Each of the following sections is a directory whose contents are output to the -outside world via the flake's outputs. Check each chapter for details. diff --git a/doc/outputs/modules.md b/doc/outputs/modules.md deleted file mode 100644 index f698e9f..0000000 --- a/doc/outputs/modules.md +++ /dev/null @@ -1,79 +0,0 @@ -# Modules -The modules directory is a replica of nixpkg's NixOS [modules][nixpkgs-modules] -, and follows the same semantics. This allows for trivial upstreaming into -nixpkgs proper once your module is sufficiently stable. - -All modules linked in _module-list.nix_ are automatically exported via -`nixosModules.`, and imported into all [hosts](../concepts/hosts.md). - - -> ##### _Note:_ -> This is reserved for declaring brand new module options. If you just want to -> declare a coherent configuration of already existing and related NixOS options -> , use [profiles](../concepts/profiles.md) instead. - -## Semantics -In case you've never written a module for nixpkgs before, here is a brief -outline of the process. - -### Declaration -modules/services/service-category/my-service.nix: -```nix -{ config, lib, ... }: -let - cfg = config.services.myService; -in -{ - options.services.myService = { - enable = lib.mkEnableOption "Description of my new service."; - - # additional options ... - }; - - config = lib.mkIf cfg.enable { - # implementation ... - }; -} -``` - -### Import -modules/module-list.nix: -```nix -[ - ./services/service-category/my-service.nix -] -``` - -## Usage - -### Internal -profiles/profile-category/my-profile.nix: -```nix -{ ... }: -{ - services.MyService.enable = true; -} -``` - -### External -flake.nix: -```nix -{ - # inputs omitted - - outputs = { self, devos, nixpkgs, ... }: { - nixosConfigurations.myConfig = nixpkgs.lib.nixosSystem { - system = "..."; - - modules = [ - devos.nixosModules.my-service - ({ ... }: { - services.MyService.enable = true; - }) - ]; - }; - }; -} -``` - -[nixpkgs-modules]: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules diff --git a/doc/outputs/overlays.md b/doc/outputs/overlays.md deleted file mode 100644 index f463d1a..0000000 --- a/doc/outputs/overlays.md +++ /dev/null @@ -1,25 +0,0 @@ -# Overlays -Writing overlays is a common occurence when using a NixOS system. Therefore, -we want to keep the process as simple and straightforward as possible. - -Any _.nix_ files declared in this directory will be assumed to be a valid -overlay, and will be automatically imported into all [hosts](../concepts/hosts.md), and -exported via `overlays./` _as well as_ -`packages..` (for valid systems), so all you have to do is -write it. - -## Example -overlays/kakoune.nix: -```nix -final: prev: { - kakoune = prev.kakoune.override { - configure.plugins = with final.kakounePlugins; [ - (kak-fzf.override { fzf = final.skim; }) - kak-auto-pairs - kak-buffers - kak-powerline - kak-vertical-selection - ]; - }; -} -``` diff --git a/doc/outputs/pkgs.md b/doc/outputs/pkgs.md deleted file mode 100644 index 4de93a8..0000000 --- a/doc/outputs/pkgs.md +++ /dev/null @@ -1,109 +0,0 @@ -# Packages -Similar to [modules](./modules.md), the pkgs directory mirrors the upstream -[nixpkgs/pkgs][pkgs], and for the same reason; if you ever want to upstream -your package, it's as simple as dropping it into the nixpkgs/pkgs directory. - -The only minor difference is that, instead of adding the `callPackage` call to -`all-packages.nix`, you just add it the the _default.nix_ in this directory, -which is defined as a simple overlay. - -All the packages are exported via `packages..`, for all -the supported systems listed in the package's `meta.platforms` attribute. - -And, as usual, every package in the overlay is also available to any NixOS -[host](../concepts/hosts.md). - -Another convenient difference is that it is possible to use -[nvfetcher](https://github.com/berberman/nvfetcher) to keep packages up to -date. -This is best understood by the simple example below. - -## Example -It is possible to specify sources separately to keep them up to date semi -automatically. -The basic rules are specified in pkgs/sources.toml: -```toml -# nvfetcher.toml -[libinih] -src.github = "benhoyt/inih" -fetch.github = "benhoyt/inih" -``` -After changes to this file as well as to update the packages specified in there run -nvfetcher (for more details see [nvfetcher](https://github.com/berberman/nvfetcher)). - -The pkgs overlay is managed in -pkgs/default.nix: -```nix -final: prev: { - # keep sources first, this makes sources available to the pkgs - sources = prev.callPackage (import ./_sources/generated.nix) { }; - - # then, call packages with `final.callPackage` - libinih = prev.callPackage ./development/libraries/libinih { }; -} -``` - -Lastly the example package is in -pkgs/development/libraries/libinih/default.nix: -```nix -{ stdenv, meson, ninja, lib, sources, ... }: -stdenv.mkDerivation { - pname = "libinih"; - - # version will resolve to the latest available on gitub - inherit (sources.libinih) version src; - - buildInputs = [ meson ninja ]; - - # ... -} -``` - - -## Migration from flake based approach -Previous to nvfetcher it was possible to manage sources via a pkgs/flake.nix, the main changes from there are that sources where in the attribute "srcs" (now "sources") and the contents of the sources where slightly different. -In order to switch to the new system, rewrite pkgs/flake.nix to a pkgs/sources.toml file using the documentation of nvfetcher, -add the line that calls the sources at the beginning of pkgs/default.nix, and -accomodate the small changes in the packages as can be seen from the example. - -The example package looked like: - -pkgs/flake.nix: -```nix -{ - description = "Package sources"; - - inputs = { - libinih.url = "github:benhoyt/inih/r53"; - libinih.flake = false; - }; -} -``` - -pkgs/default.nix: -```nix -final: prev: { - # then, call packages with `final.callPackage` - libinih = prev.callPackage ./development/libraries/libinih { }; -} -``` - -pkgs/development/libraries/libinih/default.nix: -```nix -{ stdenv, meson, ninja, lib, srcs, ... }: -let inherit (srcs) libinih; in -stdenv.mkDerivation { - pname = "libinih"; - - # version will resolve to 53, as specified in the flake.nix file - inherit (libinih) version; - - src = libinih; - - buildInputs = [ meson ninja ]; - - # ... -} -``` - -[pkgs]: https://github.com/NixOS/nixpkgs/tree/master/pkgs diff --git a/doc/secrets.md b/doc/secrets.md deleted file mode 100644 index 6afe2f6..0000000 --- a/doc/secrets.md +++ /dev/null @@ -1,110 +0,0 @@ -# Secrets -Secrets are managed using [git-crypt][git-crypt] and [agenix][agenix] -so you can keep your flake in a public repository like GitHub without -exposing your password or other sensitive data. - -By default, everything in the secrets folder is automatically encrypted. Just -be sure to run `git-crypt init` before putting anything in here. - -## Agenix -Currently, there is [no mechanism][secrets-issue] in nix itself to deploy secrets -within the nix store because it is world-readable. - -Most NixOS modules have the ability to set options to files in the system, outside -the nix store, that contain sensitive information. You can use [agenix][agenix] -to easily setup those secret files declaratively. - -[agenix][agenix] encrypts secrets and stores them as .age files in your repository. -Age files are encrypted with multiple ssh public keys, so any host or user with a -matching ssh private key can read the data. The [age module][age module] will add those -encrypted files to the nix store and decrypt them on activation to `/run/secrets`. - -### Setup -All hosts must have openssh enabled, this is done by default in the core profile. - -You need to populate your `secrets/secrets.nix` with the proper ssh public keys. -Be extra careful to make sure you only add public keys, you should never share a -private key!! - -secrets/secrets.nix: -```nix -let - system = ""; - user = ""; - allKeys = [ system user ]; -in -``` - -On most systems, you can get your systems ssh public key from `/etc/ssh/ssh_host_ed25519_key.pub`. If -this file doesn't exist you likely need to enable openssh and rebuild your system. - -Your users ssh public key is probably stored in `~/.ssh/id_ed25519.pub` or -`~/.ssh/id_rsa.pub`. If you haven't generated a ssh key yet, be sure do so: -```sh -ssh-keygen -t ed25519 -``` - -> ##### _Note:_ -> The underlying tool used by agenix, rage, doesn't work well with password protected -> ssh keys. So if you have lots of secrets you might have to type in your password many -> times. - - -### Secrets -You will need the `agenix` command to create secrets. DevOS conveniently provides that -in the devShell, so just run `nix develop` whenever you want to edit secrets. Make sure -to always run `agenix` while in the `secrets/` folder, so it can pick up your `secrets.nix`. - -To create secrets, simply add lines to your `secrets/secrets.nix`: -``` -let - ... - allKeys = [ system user ]; -in -{ - "secret.age".publicKeys = allKeys; -} -``` -That would tell agenix to create a `secret.age` file that is encrypted with the `system` -and `user` ssh public key. - -Then go into the `secrets` folder and run: -```sh -agenix -e secret.age -``` -This will create the `secret.age`, if it doesn't already exist, and allow you to edit it. - -If you ever change the `publicKeys` entry of any secret make sure to rekey the secrets: -```sh -agenix --rekey -``` - -### Usage -Once you have your secret file encrypted and ready to use, you can utilize the [age module][age module] -to ensure that your secrets end up in `/run/secrets`. - -In any profile that uses a NixOS module that requires a secret you can enable a particular secret like so: - -```nix -{ self, ... }: -{ - age.secrets.mysecret.file = "${self}/secrets/mysecret.age"; -} -``` - - -Then you can just pass the path `/run/secrets/mysecret` to the module. - -You can make use of the many options provided by the age module to customize where and how -secrets get decrypted. You can learn about them by looking at the -[age module][age module]. - - -> ##### _Note:_ -> You can take a look at the [agenix repository][agenix] for more information -> about the tool. - -[git-crypt]: https://github.com/AGWA/git-crypt -[agenix]: https://github.com/ryantm/agenix -[age module]: https://github.com/ryantm/agenix/blob/master/modules/age.nix -[secrets-issue]: https://github.com/NixOS/nix/issues/8 diff --git a/doc/start/bootstrapping.md b/doc/start/bootstrapping.md deleted file mode 100644 index f4c5190..0000000 --- a/doc/start/bootstrapping.md +++ /dev/null @@ -1,102 +0,0 @@ -# Bootstrapping - -This will help you boostrap a bare host with the help of the -[bespoke iso](./iso.md) live installer. - -_Note: nothing prevents you from remotely executing the boostrapping -process. See below._ - -Once your target host has booted into the live iso, you need to partion -and format your disk according to the [official manual][manual]. - -## Mount partitions - -Then properly mount the formatted partitions at `/mnt`, so that you can -install your system to those new partitions. - -Mount `nixos` partition to `/mnt` and — for UEFI — `boot` -partition to `/mnt/boot`: - -```console -$ mount /dev/disk/by-label/nixos /mnt -$ mkdir -p /mnt/boot && mount /dev/disk/by-label/boot /mnt/boot # UEFI only -$ swapon /dev/disk/by-label/swap -``` - -Add some extra space to the store. In the iso, it's running on a tmpfs -off your RAM: -```console -$ mkdir -p /mnt/tmpstore/{work,store} -$ mount -t overlay overlay -olowerdir=/nix/store,upperdir=/mnt/tmpstore/store,workdir=/mnt/tmpstore/work /nix/store -``` - -## Install - -Install off of a copy of devos from the time the iso was built: - -```console -$ cd /iso/devos -$ nixos-install --flake .#NixOS -``` - -## Notes of interest - -### Remote access to the live installer - -The iso live installer comes preconfigured with a network configuration -which announces it's hostname via [MulticastDNS][mDNS] as `hostname.local`, -that is `bootstrap.local` in the [iso example](./iso). - -In the rare case that [MulticastDNS][mDNS] is not availabe or turned off -in your network, there is a static link-local IPv6 address configured to -`fe80::47`(mnemonic from the letter's position in the english alphabet: -`n=14 i=9 x=24; 47 = n+i+x`). - -Provided that you have added your public key to the authorized keys of the -`root` user _(hint: [`deploy-rs`](../integrations/deploy.md) needs passwordless -sudo access)_: - -```nix -{ ... }: -{ - users.users.root.openssh.authorizedKeys.keyFiles = [ - ../secrets/path/to/key.pub - ]; -} -``` - -You can then ssh into the live installer through one of the -following options: - -```console -ssh root@bootstrap.local - -ssh root@fe80::47%eno1 # where eno1 is your network interface on which you are linked to the target -``` - -_Note: the [static link-local IPv6 address][staticLLA] and [MulticastDNS][mDNS] is only -configured on the live installer. If you wish to enable [MulticastDNS][mDNS] -for your environment, you ought to configure that in a regular [profile](../concepts/profiles.md)._ - -### EUI-64 LLA & Host Identity - -The iso's IPv6 Link Local Address (LLA) is configured with a static 64-bit Extended -Unique Identifiers (EUI-64) that is derived from the host interface's Message -Authentication Code (MAC) address. - -After a little while (a few seconds), you can remotely discover this unique and host -specific address over [NDP][NDP] for example with: - -```console -ip -6 neigh show # also shows fe80::47 -``` - -***This LLA is stable for the host, unless you need to swap that particular network card.*** -Under this reservation, though, you may use this EUI-64 to wire up a specific -(cryptographic) host identity. - - -[manual]: https://nixos.org/manual/nixos/stable/index.html#sec-installation-partitioning -[mDNS]: https://en.wikipedia.org/wiki/Multicast_DNS -[NDP]: https://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol -[staticLLA]: https://tools.ietf.org/html/rfc7404 diff --git a/doc/start/from-nixos.md b/doc/start/from-nixos.md deleted file mode 100644 index ce79063..0000000 --- a/doc/start/from-nixos.md +++ /dev/null @@ -1,54 +0,0 @@ -# From NixOS - -## Generate Configuration -Assuming you're happy with your existing partition layout, you can generate a -basic NixOS configuration for your system using: -```sh -bud up -``` - -This will make a new file `hosts/up-$(hostname).nix`, which you can edit to -your liking. - -You must then add a host to `nixos.hosts` in flake.nix: -```nix -{ - nixos.hosts = { - modules = hosts/NixOS.nix; - }; -} -``` - -Make sure your `i18n.defaultLocale` and `time.timeZone` are set properly for -your region. Keep in mind that `networking.hostName` will be automatically -set to the name of your host; - -Now might be a good time to read the docs on [suites](../concepts/suites.md) and -[profiles](../concepts/profiles.md) and add or create any that you need. - -> ##### _Note:_ -> While the `up` sub-command is provided as a convenience to quickly set up and -> install a "fresh" NixOS system on current hardware, committing these files is -> discouraged. -> -> They are placed in the git staging area automatically because they would be -> invisible to the flake otherwise, but it is best to move what you need from -> them directly into a host module of your own making, and commit that instead. -# Installation - -Once you're ready to deploy `hosts/my-host.nix`: -```sh -bud my-host switch -``` - - -This calls `nixos-rebuild` with sudo to build and install your configuration. - -> ##### _Notes:_ -> - Instead of `switch`, you can pass `build`, `test`, `boot`, etc just as with -> `nixos-rebuild`. -> -> - It is convenient to have the template living at `/etc/nixos` so you can -> simply `sudo nixos-rebuild switch` from anywhere on the system, but it is -> not required. - diff --git a/doc/start/index.md b/doc/start/index.md deleted file mode 100644 index 2cd14d9..0000000 --- a/doc/start/index.md +++ /dev/null @@ -1,41 +0,0 @@ -# Quick Start -The only dependency is nix, so make sure you have it [installed][install-nix]. - -## Get the Template -Here is a snippet that will get you the template without the git history: -```sh -nix-shell -p cachix --run "cachix use nrdxp" - -nix-shell https://github.com/divnix/devos/archive/main.tar.gz -A shell \ - --run "bud get main" - -cd devos - -nix-shell - -git init -git add . -git commit -m init -``` - -This will place you in a new folder named `devos` with git initialized, and a -nix-shell that provides all the dependencies, including the unstable nix -version required. - -In addition, the [binary cache](../integrations/cachix.md) is added for faster deployment. - -> ##### _Notes:_ -> - Flakes ignore files that have not been added to git, so be sure to stage new -> files before building the system. -> - You can choose to simply clone the repo with git if you want to follow -> upstream changes. -> - If the `nix-shell -p cachix --run "cachix use nrdxp"` line doesn't work -> you can try with sudo: `sudo nix-shell -p cachix --run "cachix use nrdxp"` - -## Next Steps: -- [Make installable ISO](./iso.md) -- [Bootstrap Host](./bootstrapping.md) -- [Already on NixOS](./from-nixos.md) - - -[install-nix]: https://nixos.org/manual/nix/stable/#sect-multi-user-installation diff --git a/doc/start/iso.md b/doc/start/iso.md deleted file mode 100644 index 76af1c6..0000000 --- a/doc/start/iso.md +++ /dev/null @@ -1,22 +0,0 @@ -# ISO - -Making and writing an installable iso for `hosts/bootstrap.nix` is as simple as: -```sh -bud build bootstrap bootstrapIso -sudo -E $(which bud) burn -``` - -This works for any host. - -## ISO image nix store & cache - -The iso image holds the store to the live environment and _also_ acts as a binary cache -to the installer. To considerably speed up things, the image already includes all flake -`inputs` as well as the `devshell` closures. - -While you _could_ provision any machine with a single stick, a custom-made iso for -the host you want to install DevOS to, maximises those local cache hits. - -For hosts that don't differ too much, a single usb stick might be ok, whereas when -there are bigger differences, a custom-made usb stick will be considerably faster. - diff --git a/doc/tests.md b/doc/tests.md deleted file mode 100644 index 4844912..0000000 --- a/doc/tests.md +++ /dev/null @@ -1,33 +0,0 @@ -# Testing - -Testing is always an important aspect of any software development project, and -NixOS offers some incredibly powerful tools to write tests for your -configuration, and, optionally, run them in -[CI](./integrations/hercules.md). - -## Unit Tests -Unit tests can be created from regular derivations, and they can do -almost anything you can imagine. By convention, it is best to test your -packages during their [check phase][check]. All packages and their tests will -be built during CI. - -## Integration Tests -All your profiles defined in suites will be tested in a NixOS VM. - -You can write integration tests for one or more NixOS VMs that can, -optionally, be networked together, and yes, it's as awesome as it sounds! - -Be sure to use the `mkTest` function from digga, `digga.lib.pkgs-lib.mkTest` -which wraps the official [testing-python][testing-python] function to ensure -that the system is setup exactly as it is for a bare DevOS system. There are -already great resources for learning how to use these tests effectively, -including the official [docs][test-doc], a fantastic [blog post][test-blog], -and the examples in [nixpkgs][nixos-tests]. - -[test-doc]: https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests -[test-blog]: https://www.haskellforall.com/2020/11/how-to-use-nixos-for-lightweight.html -[default]: https://github.com/divnix/devos/tree/main/tests/default.nix -[run-test]: https://github.com/NixOS/nixpkgs/blob/6571462647d7316aff8b8597ecdf5922547bf365/lib/debug.nix#L154-L166 -[nixos-tests]: https://github.com/NixOS/nixpkgs/tree/master/nixos/tests -[testing-python]: https://github.com/NixOS/nixpkgs/tree/master/nixos/lib/testing-python.nix -[check]: https://nixos.org/manual/nixpkgs/stable/#ssec-check-phase diff --git a/doc/theme/highlight.js b/doc/theme/highlight.js deleted file mode 100644 index f4fd4fa..0000000 --- a/doc/theme/highlight.js +++ /dev/null @@ -1,6 +0,0 @@ -/* - Highlight.js 10.1.2 (edd73d24) - License: BSD-3-Clause - Copyright (c) 2006-2020, Ivan Sagalaev -*/ -var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!Object.hasOwnProperty.call(n,r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ignoreMatch(){this.ignore=!0}}function t(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){var t={};for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}function a(e){return e.nodeName.toLowerCase()}var i=Object.freeze({__proto__:null,escapeHTML:t,inherit:r,nodeStream:function(e){var n=[];return function e(t,r){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:r,node:i}),r=e(i,r),a(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:i}));return r}(e,0),n},mergeStreams:function(e,n,r){var i=0,s="",o=[];function l(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){s+=""}function d(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var g=l();if(s+=t(r.substring(i,g[0].offset)),i=g[0].offset,g===e){o.reverse().forEach(u);do{d(g.splice(0,1)[0]),g=l()}while(g===e&&g.length&&g[0].offset===i);o.reverse().forEach(c)}else"start"===g[0].event?o.push(g[0].node):o.pop(),d(g.splice(0,1)[0])}return s+t(r.substr(i))}});const s="",o=e=>!!e.kind;class l{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=t(e)}openNode(e){if(!o(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){o(e)&&(this.buffer+=s)}value(){return this.buffer}span(e){this.buffer+=``}}class c{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{c._collapse(e)}))}}class u extends c{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function d(e){return e?"string"==typeof e?e:e.source:null}const g="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",h={begin:"\\\\[\\s\\S]",relevance:0},f={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[h]},p={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[h]},b={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},m=function(e,n,t={}){var a=r({className:"comment",begin:e,end:n,contains:[]},t);return a.contains.push(b),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},v=m("//","$"),x=m("/\\*","\\*/"),E=m("#","$");var _=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:g,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>d(e)).join("")}(n,/.*\b/,e.binary,/\b.*/)),r({className:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:h,APOS_STRING_MODE:f,QUOTE_STRING_MODE:p,PHRASAL_WORDS_MODE:b,COMMENT:m,C_LINE_COMMENT_MODE:v,C_BLOCK_COMMENT_MODE:x,HASH_COMMENT_MODE:E,NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{className:"number",begin:g,relevance:0},BINARY_NUMBER_MODE:{className:"number",begin:"\\b(0b[01]+)",relevance:0},CSS_NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[h,{begin:/\[/,end:/\]/,relevance:0,contains:[h]}]}]},TITLE_MODE:{className:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}}),N="of and for in not or if then".split(" ");function w(e,n){return n?+n:function(e){return N.includes(e.toLowerCase())}(e)?0:1}const R=t,y=r,{nodeStream:O,mergeStreams:k}=i,M=Symbol("nomatch");return function(t){var a=[],i=Object.create(null),s=Object.create(null),o=[],l=!0,c=/(^(<[^>]+>|\t|)+|\n)/gm,g="Could not find the language '{}', did you forget to load/include a language module?";const h={disableAutodetect:!0,name:"Plain text",contains:[]};var f={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:u};function p(e){return f.noHighlightRe.test(e)}function b(e,n,t,r){var a={code:n,language:e};S("before:highlight",a);var i=a.result?a.result:m(a.language,a.code,t,r);return i.code=a.code,S("after:highlight",i),i}function m(e,t,a,s){var o=t;function c(e,n){var t=E.case_insensitive?n[0].toLowerCase():n[0];return Object.prototype.hasOwnProperty.call(e.keywords,t)&&e.keywords[t]}function u(){null!=y.subLanguage?function(){if(""!==A){var e=null;if("string"==typeof y.subLanguage){if(!i[y.subLanguage])return void k.addText(A);e=m(y.subLanguage,A,!0,O[y.subLanguage]),O[y.subLanguage]=e.top}else e=v(A,y.subLanguage.length?y.subLanguage:null);y.relevance>0&&(I+=e.relevance),k.addSublanguage(e.emitter,e.language)}}():function(){if(!y.keywords)return void k.addText(A);let e=0;y.keywordPatternRe.lastIndex=0;let n=y.keywordPatternRe.exec(A),t="";for(;n;){t+=A.substring(e,n.index);const r=c(y,n);if(r){const[e,a]=r;k.addText(t),t="",I+=a,k.addKeyword(n[0],e)}else t+=n[0];e=y.keywordPatternRe.lastIndex,n=y.keywordPatternRe.exec(A)}t+=A.substr(e),k.addText(t)}(),A=""}function h(e){return e.className&&k.openNode(e.className),y=Object.create(e,{parent:{value:y}})}function p(e){return 0===y.matcher.regexIndex?(A+=e[0],1):(L=!0,0)}var b={};function x(t,r){var i=r&&r[0];if(A+=t,null==i)return u(),0;if("begin"===b.type&&"end"===r.type&&b.index===r.index&&""===i){if(A+=o.slice(r.index,r.index+1),!l){const n=Error("0 width match regex");throw n.languageName=e,n.badRule=b.rule,n}return 1}if(b=r,"begin"===r.type)return function(e){var t=e[0],r=e.rule;const a=new n(r),i=[r.__beforeBegin,r["on:begin"]];for(const n of i)if(n&&(n(e,a),a.ignore))return p(t);return r&&r.endSameAsBegin&&(r.endRe=RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),r.skip?A+=t:(r.excludeBegin&&(A+=t),u(),r.returnBegin||r.excludeBegin||(A=t)),h(r),r.returnBegin?0:t.length}(r);if("illegal"===r.type&&!a){const e=Error('Illegal lexeme "'+i+'" for mode "'+(y.className||"")+'"');throw e.mode=y,e}if("end"===r.type){var s=function(e){var t=e[0],r=o.substr(e.index),a=function e(t,r,a){let i=function(e,n){var t=e&&e.exec(n);return t&&0===t.index}(t.endRe,a);if(i){if(t["on:end"]){const e=new n(t);t["on:end"](r,e),e.ignore&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,r,a)}(y,e,r);if(!a)return M;var i=y;i.skip?A+=t:(i.returnEnd||i.excludeEnd||(A+=t),u(),i.excludeEnd&&(A=t));do{y.className&&k.closeNode(),y.skip||y.subLanguage||(I+=y.relevance),y=y.parent}while(y!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),h(a.starts)),i.returnEnd?0:t.length}(r);if(s!==M)return s}if("illegal"===r.type&&""===i)return 1;if(B>1e5&&B>3*r.index)throw Error("potential infinite loop, way more iterations than matches");return A+=i,i.length}var E=T(e);if(!E)throw console.error(g.replace("{}",e)),Error('Unknown language: "'+e+'"');var _=function(e){function n(n,t){return RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,n="|"){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i0&&(a+=n),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"===l[0][0]&&l[1]?a+="\\"+(+l[1]+s):(a+=l[0],"("===l[0]&&r++)}a+=")"}return a}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex((e,n)=>n>0&&void 0!==e),r=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,r)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;const t=n.exec(e);return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),t}}function i(e,n){const t=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==t&&"."!==r||n.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return function t(s,o){const l=s;if(s.compiled)return l;s.compiled=!0,s.__beforeBegin=null,s.keywords=s.keywords||s.beginKeywords;let c=null;if("object"==typeof s.keywords&&(c=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=function(e,n){var t={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(n){r(n,e[n])})),t;function r(e,r){n&&(r=r.toLowerCase()),r.split(" ").forEach((function(n){var r=n.split("|");t[r[0]]=[e,w(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemes&&c)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return l.keywordPatternRe=n(s.lexemes||c||/\w+/,!0),o&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__beforeBegin=i),s.begin||(s.begin=/\B|\b/),l.beginRe=n(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(l.endRe=n(s.end)),l.terminator_end=d(s.end)||"",s.endsWithParent&&o.terminator_end&&(l.terminator_end+=(s.end?"|":"")+o.terminator_end)),s.illegal&&(l.illegalRe=n(s.illegal)),void 0===s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(n){return r(e,{variants:null},n)}))),e.cached_variants?e.cached_variants:function e(n){return!!n&&(n.endsWithParent||e(n.starts))}(e)?r(e,{starts:e.starts?r(e.starts):null}):Object.isFrozen(e)?r(e):e}("self"===e?s:e)}))),s.contains.forEach((function(e){t(e,l)})),s.starts&&t(s.starts,o),l.matcher=function(e){const n=new a;return e.contains.forEach(e=>n.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&n.addRule(e.terminator_end,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(l),l}(e)}(E),N="",y=s||_,O={},k=new f.__emitter(f);!function(){for(var e=[],n=y;n!==E;n=n.parent)n.className&&e.unshift(n.className);e.forEach(e=>k.openNode(e))}();var A="",I=0,S=0,B=0,L=!1;try{for(y.matcher.considerAll();;){B++,L?L=!1:(y.matcher.lastIndex=S,y.matcher.considerAll());const e=y.matcher.exec(o);if(!e)break;const n=x(o.substring(S,e.index),e);S=e.index+n}return x(o.substr(S)),k.closeAllNodes(),k.finalize(),N=k.toHTML(),{relevance:I,value:N,language:e,illegal:!1,emitter:k,top:y}}catch(n){if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:n.message,context:o.slice(S-100,S+100),mode:n.mode},sofar:N,relevance:0,value:R(o),emitter:k};if(l)return{illegal:!1,relevance:0,value:R(o),emitter:k,language:e,top:y,errorRaised:n};throw n}}function v(e,n){n=n||f.languages||Object.keys(i);var t=function(e){const n={relevance:0,emitter:new f.__emitter(f),value:R(e),illegal:!1,top:h};return n.emitter.addText(e),n}(e),r=t;return n.filter(T).filter(I).forEach((function(n){var a=m(n,e,!1);a.language=n,a.relevance>r.relevance&&(r=a),a.relevance>t.relevance&&(r=t,t=a)})),r.language&&(t.second_best=r),t}function x(e){return f.tabReplace||f.useBR?e.replace(c,e=>"\n"===e?f.useBR?"
":e:f.tabReplace?e.replace(/\t/g,f.tabReplace):e):e}function E(e){let n=null;const t=function(e){var n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=f.languageDetectRe.exec(n);if(t){var r=T(t[1]);return r||(console.warn(g.replace("{}",t[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?t[1]:"no-highlight"}return n.split(/\s+/).find(e=>p(e)||T(e))}(e);if(p(t))return;S("before:highlightBlock",{block:e,language:t}),f.useBR?(n=document.createElement("div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"):n=e;const r=n.textContent,a=t?b(t,r,!0):v(r),i=O(n);if(i.length){const e=document.createElement("div");e.innerHTML=a.value,a.value=k(i,O(e),r)}a.value=x(a.value),S("after:highlightBlock",{block:e,result:a}),e.innerHTML=a.value,e.className=function(e,n,t){var r=n?s[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),e.includes(r)||a.push(r),a.join(" ").trim()}(e.className,t,a.language),e.result={language:a.language,re:a.relevance,relavance:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance,relavance:a.second_best.relevance})}const N=()=>{if(!N.called){N.called=!0;var e=document.querySelectorAll("pre code");a.forEach.call(e,E)}};function T(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]}function A(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach(e=>{s[e]=n})}function I(e){var n=T(e);return n&&!n.disableAutodetect}function S(e,n){var t=e;o.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(t,{highlight:b,highlightAuto:v,fixMarkup:x,highlightBlock:E,configure:function(e){f=y(f,e)},initHighlighting:N,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",N,!1)},registerLanguage:function(e,n){var r=null;try{r=n(t)}catch(n){if(console.error("Language definition for '{}' could not be registered.".replace("{}",e)),!l)throw n;console.error(n),r=h}r.name||(r.name=e),i[e]=r,r.rawDefinition=n.bind(null,t),r.aliases&&A(r.aliases,{languageName:e})},listLanguages:function(){return Object.keys(i)},getLanguage:T,registerAliases:A,requireLanguage:function(e){var n=T(e);if(n)return n;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:I,inherit:y,addPlugin:function(e){o.push(e)}}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString="10.1.2";for(const n in _)"object"==typeof _[n]&&e(_[n]);return Object.assign(t,_),t}({})}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);hljs.registerLanguage("xml",function(){"use strict";return function(e){var n={className:"symbol",begin:"&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;"},a={begin:"\\s",contains:[{className:"meta-keyword",begin:"#?[a-z_][a-z1-9_-]+",illegal:"\\n"}]},s=e.inherit(a,{begin:"\\(",end:"\\)"}),t=e.inherit(e.APOS_STRING_MODE,{className:"meta-string"}),i=e.inherit(e.QUOTE_STRING_MODE,{className:"meta-string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:"",relevance:10,contains:[a,i,t,s,{begin:"\\[",end:"\\]",contains:[{className:"meta",begin:"",contains:[a,s,i,t]}]}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:")",end:">",keywords:{name:"style"},contains:[c],starts:{end:"",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:")",end:">",keywords:{name:"script"},contains:[c],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:"",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},c]}]}}}());hljs.registerLanguage("markdown",function(){"use strict";return function(n){const e={begin:"<",end:">",subLanguage:"xml",relevance:0},a={begin:"\\[.+?\\][\\(\\[].*?[\\)\\]]",returnBegin:!0,contains:[{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0,relevance:0},{className:"link",begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}],relevance:10},i={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},s={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};i.contains.push(s),s.contains.push(i);var c=[e,a];return i.contains=i.contains.concat(c),s.contains=s.contains.concat(c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:c=c.concat(i,s)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:c}]}]},e,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:c,end:"$"},{className:"code",variants:[{begin:"(`{3,})(.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})(.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}}());hljs.registerLanguage("perl",function(){"use strict";return function(e){var n={$pattern:/[\w.]+/,keyword:"getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmget sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when"},t={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},s={begin:"->{",end:"}"},r={variants:[{begin:/\$\d/},{begin:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{begin:/[\$%@][^\s\w{]/,relevance:0}]},i=[e.BACKSLASH_ESCAPE,t,r],a=[r,e.HASH_COMMENT_MODE,e.COMMENT("^\\=\\w","\\=cut",{endsWithParent:!0}),s,{className:"string",contains:i,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*\\<",end:"\\>",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:"{\\w+}",contains:[],relevance:0},{begin:"-?\\w+\\s*\\=\\>",contains:[],relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",begin:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",relevance:10},{className:"regexp",begin:"(m|qr)?/",end:"/[a-z]*",contains:[e.BACKSLASH_ESCAPE],relevance:0}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return t.contains=a,s.contains=a,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:a}}}());hljs.registerLanguage("plaintext",function(){"use strict";return function(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}}());hljs.registerLanguage("ini",function(){"use strict";function e(e){return e?"string"==typeof e?e:e.source:null}function n(...n){return n.map(n=>e(n)).join("")}return function(a){var s={className:"number",relevance:0,variants:[{begin:/([\+\-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},i=a.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];var t={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)}/}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,r,t,l,s,"self"],relevance:0},g="("+[/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/].map(n=>e(n)).join("|")+")";return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:n(g,"(\\s*\\.\\s*",g,")*",n("(?=",/\s*=\s*[^#\s]/,")")),className:"attr",starts:{end:/$/,contains:[i,c,r,t,l,s]}}]}}}());hljs.registerLanguage("json",function(){"use strict";return function(n){var e={literal:"true false null"},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],t=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:t,keywords:e},l={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(a,{begin:/:/})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(a)],illegal:"\\S"};return t.push(l,s),i.forEach((function(n){t.push(n)})),{name:"JSON",contains:t,keywords:e,illegal:"\\S"}}}());hljs.registerLanguage("ruby",function(){"use strict";return function(e){var n="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",a={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},s={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},r=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^\\=begin","^\\=end",{contains:[s],relevance:10}),e.COMMENT("^__END__","\\n$")],c={className:"subst",begin:"#\\{",end:"}",keywords:a},t={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[qQwWx]?\\(",end:"\\)"},{begin:"%[qQwWx]?\\[",end:"\\]"},{begin:"%[qQwWx]?{",end:"}"},{begin:"%[qQwWx]?<",end:">"},{begin:"%[qQwWx]?/",end:"/"},{begin:"%[qQwWx]?%",end:"%"},{begin:"%[qQwWx]?-",end:"-"},{begin:"%[qQwWx]?\\|",end:"\\|"},{begin:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{begin:/<<[-~]?'?(\w+)(?:.|\n)*?\n\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},b={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:a},d=[t,i,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE}]}].concat(r)},{className:"function",beginKeywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),b].concat(r)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(\\!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[t,{begin:n}],relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{className:"params",begin:/\|/,end:/\|/,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[i,{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r{",end:"}[a-z]*"},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(r),relevance:0}].concat(r);c.contains=d,b.contains=d;var g=[{begin:/^\s*=>/,starts:{end:"$",contains:d}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{end:"$",contains:d}}];return{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:r.concat(g).concat(d)}}}());hljs.registerLanguage("yaml",function(){"use strict";return function(e){var n="true false yes no null",a="[\\w#;/?:@&=+$,.~*\\'()[\\]]+",s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:"{{",end:"}}"},{begin:"%{",end:"}"}]}]},i=e.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l={end:",",endsWithParent:!0,excludeEnd:!0,contains:[],keywords:n,relevance:0},t={begin:"{",end:"}",contains:[l],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[l],illegal:"\\n",relevance:0},b=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---s*$",relevance:10},{className:"string",begin:"[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"\\-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b"},t,g,s],c=[...b];return c.pop(),c.push(i),l.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml","YAML"],contains:b}}}());hljs.registerLanguage("haskell",function(){"use strict";return function(e){var n={variants:[e.COMMENT("--","$"),e.COMMENT("{-","-}",{contains:["self"]})]},i={className:"meta",begin:"{-#",end:"#-}"},a={className:"meta",begin:"^#",end:"$"},s={className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},l={begin:"\\(",end:"\\)",illegal:'"',contains:[i,a,{className:"type",begin:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},e.inherit(e.TITLE_MODE,{begin:"[_a-z][\\w']*"}),n]};return{name:"Haskell",aliases:["hs"],keywords:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",contains:[{beginKeywords:"module",end:"where",keywords:"module where",contains:[l,n],illegal:"\\W\\.|;"},{begin:"\\bimport\\b",end:"$",keywords:"import qualified as hiding",contains:[l,n],illegal:"\\W\\.|;"},{className:"class",begin:"^(\\s*)?(class|instance)\\b",end:"where",keywords:"class family instance where",contains:[s,l,n]},{className:"class",begin:"\\b(data|(new)?type)\\b",end:"$",keywords:"data family type newtype deriving",contains:[i,s,l,{begin:"{",end:"}",contains:l.contains},n]},{beginKeywords:"default",end:"$",contains:[s,l,n]},{beginKeywords:"infix infixl infixr",end:"$",contains:[e.C_NUMBER_MODE,n]},{begin:"\\bforeign\\b",end:"$",keywords:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",contains:[s,e.QUOTE_STRING_MODE,n]},{className:"meta",begin:"#!\\/usr\\/bin\\/env runhaskell",end:"$"},i,a,e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,s,e.inherit(e.TITLE_MODE,{begin:"^[_a-z][\\w']*"}),n,{begin:"->|<-"}]}}}());hljs.registerLanguage("nix",function(){"use strict";return function(e){var n={keyword:"rec with let in inherit assert if else then",literal:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"},i={className:"subst",begin:/\$\{/,end:/}/,keywords:n},t={className:"string",contains:[i],variants:[{begin:"''",end:"''"},{begin:'"',end:'"'}]},s=[e.NUMBER_MODE,e.HASH_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t,{begin:/[a-zA-Z0-9-_]+(\s*=)/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/\S+/}]}];return i.contains=s,{name:"Nix",aliases:["nixos"],keywords:n,contains:s}}}());hljs.registerLanguage("bash",function(){"use strict";return function(e){const s={};Object.assign(s,{className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{/,end:/\}/,contains:[{begin:/:-/,contains:[s]}]}]});const t={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,t]};t.contains.push(n);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,s]},i=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b-?[a-z\._]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[i,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,n,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},s]}}}());hljs.registerLanguage("shell",function(){"use strict";return function(s){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:"^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]",starts:{end:"$",subLanguage:"bash"}}]}}}());hljs.registerLanguage("python",function(){"use strict";return function(e){var n={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10",built_in:"Ellipsis NotImplemented",literal:"False None True"},a={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:n,illegal:/#/},s={begin:/\{\{/,relevance:0},r={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/(u|b)?r?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(u|b)?r?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(fr|rf|f)'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(fr|rf|f)"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(u|r|ur)'/,end:/'/,relevance:10},{begin:/(u|r|ur)"/,end:/"/,relevance:10},{begin:/(b|br)'/,end:/'/},{begin:/(b|br)"/,end:/"/},{begin:/(fr|rf|f)'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/(fr|rf|f)"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l={className:"number",relevance:0,variants:[{begin:e.BINARY_NUMBER_RE+"[lLjJ]?"},{begin:"\\b(0o[0-7]+)[lLjJ]?"},{begin:e.C_NUMBER_RE+"[lLjJ]?"}]},t={className:"params",variants:[{begin:/\(\s*\)/,skip:!0,className:null},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:["self",a,l,r,e.HASH_COMMENT_MODE]}]};return i.contains=[r,l,a],{name:"Python",aliases:["py","gyp","ipython"],keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[a,l,{beginKeywords:"if",relevance:0},r,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,t,{begin:/->/,endsWithParent:!0,keywords:"None"}]},{className:"meta",begin:/^[\t ]*@/,end:/$/},{begin:/\b(print|exec)\(/}]}}}()); diff --git a/flake.lock b/flake.lock index 8f6439e..0d1b1c6 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1646360966, - "narHash": "sha256-fJ/WHSU45bMJRDqz9yA3B2lwXtW5DKooU+Pzn13GyZI=", + "lastModified": 1649191071, + "narHash": "sha256-35hEJuMvRswOPKb9lbB9ZuHVe0eJN6WJc4T8Frn0hYQ=", "owner": "kamadorueda", "repo": "alejandra", - "rev": "511c3f6a88b6964e1496fb6f441f4ae5e58bd3ea", + "rev": "3d3f24127a8e2b28998a81c444f8b4b4f11da6c6", "type": "github" }, "original": { @@ -21,21 +21,6 @@ "type": "github" } }, - "blank": { - "locked": { - "lastModified": 1625557891, - "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", - "owner": "divnix", - "repo": "blank", - "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "blank", - "type": "github" - } - }, "cachix": { "locked": { "lastModified": 1642244250, @@ -52,36 +37,36 @@ "type": "github" } }, - "deploy": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "digga", - "latest" - ], - "utils": "utils" - }, + "crane": { + "flake": false, "locked": { - "lastModified": 1632822684, - "narHash": "sha256-lt7eayYmgsD5OQwpb1XYfHpxttn43bWo7G7hIJs+zJw=", - "owner": "serokell", - "repo": "deploy-rs", - "rev": "9a02de4373e0ec272d08a417b269a28ac8b961b4", + "lastModified": 1644785799, + "narHash": "sha256-VpAJO1L0XeBvtCuNGK4IDKp6ENHIpTrlaZT7yfBCvwo=", + "owner": "ipetkov", + "repo": "crane", + "rev": "fc7a94f841347c88f2cb44217b2a3faa93e2a0b2", "type": "github" }, "original": { - "owner": "serokell", - "repo": "deploy-rs", + "owner": "ipetkov", + "repo": "crane", "type": "github" } }, "devshell": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixCargoIntegration", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1637575296, - "narHash": "sha256-ZY8YR5u8aglZPe27+AJMnPTG6645WuavB+w0xmhTarw=", + "lastModified": 1647857022, + "narHash": "sha256-Aw70NWLOIwKhT60MHDGjgWis3DP3faCzr6ap9CSayek=", "owner": "numtide", "repo": "devshell", - "rev": "0e56ef21ba1a717169953122c7415fa6a8cd2618", + "rev": "0a5ff74dacb9ea22614f64e61aeb3ca0bf0e7311", "type": "github" }, "original": { @@ -90,56 +75,57 @@ "type": "github" } }, - "digga": { + "dream2nix": { "inputs": { - "blank": "blank", - "deploy": "deploy", - "devshell": "devshell", - "flake-utils-plus": "flake-utils-plus", - "home-manager": [ - "home" + "alejandra": [ + "nixCargoIntegration", + "nixpkgs" ], - "latest": "latest", - "nixlib": [ - "nixos" + "crane": "crane", + "flake-utils-pre-commit": [ + "nixCargoIntegration", + "nixpkgs" + ], + "gomod2nix": [ + "nixCargoIntegration", + "nixpkgs" + ], + "mach-nix": [ + "nixCargoIntegration", + "nixpkgs" ], - "nixos-generators": "nixos-generators", "nixpkgs": [ - "nixos" + "nixCargoIntegration", + "nixpkgs" + ], + "node2nix": [ + "nixCargoIntegration", + "nixpkgs" + ], + "poetry2nix": [ + "nixCargoIntegration", + "nixpkgs" + ], + "pre-commit-hooks": [ + "nixCargoIntegration", + "nixpkgs" ] }, "locked": { - "lastModified": 1643510242, - "narHash": "sha256-9C9DyJhQ5bevk0CEEjGct+U9EqUgHg8T70nxz47zjMI=", - "owner": "divnix", - "repo": "digga", - "rev": "33bfb05b8a148d8ad6a842de74e22209bf9fe5d7", + "lastModified": 1649088506, + "narHash": "sha256-rIpLWnomSDYlaZfQiXs4Ui3EqmiY6d9qEkIY/vzZg6s=", + "owner": "nix-community", + "repo": "dream2nix", + "rev": "84135ea205bcc04648fcc7776261e1dcb6e78ceb", "type": "github" }, "original": { - "owner": "divnix", - "ref": "main", - "repo": "digga", + "owner": "nix-community", + "repo": "dream2nix", "type": "github" } }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1641205782, @@ -157,11 +143,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "owner": "numtide", "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", "type": "github" }, "original": { @@ -170,32 +156,44 @@ "type": "github" } }, - "flake-utils-plus": { - "inputs": { - "flake-utils": "flake-utils" - }, + "flake-utils_2": { "locked": { - "lastModified": 1639385028, - "narHash": "sha256-oqorKz3mwf7UuDJwlbCEYCB2LfcWLL0DkeCWhRIL820=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "be1be083af014720c14f3b574f57b6173b4915d0", + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", "type": "github" }, "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1637014545, + "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, "flakeCompat": { "flake": false, "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "lastModified": 1648199409, + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", "type": "github" }, "original": { @@ -204,6 +202,50 @@ "type": "github" } }, + "fup": { + "inputs": { + "flake-utils": "flake-utils" + }, + "locked": { + "lastModified": 1647259887, + "narHash": "sha256-yEkMbEHVO9qydluQ3uHGWX1PkfZhgDKxnd1rhZYZ72w=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "06dba5f3b4fa2cc0bfc98ce9cd6f9a4d8db11d46", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "type": "github" + } + }, + "helix": { + "inputs": { + "nixCargoIntegration": [ + "nixCargoIntegration" + ], + "nixpkgs": [ + "nixos" + ], + "rust-overlay": [ + "rust-overlay" + ] + }, + "locked": { + "lastModified": 1649456512, + "narHash": "sha256-evrtUI3NkwEhQGJmRPnDqvoYex3SnH9NAxgCLJw2v3s=", + "owner": "helix-editor", + "repo": "helix", + "rev": "7779dbfcb847e9aa20e01ae0f8354c3c0de38fe3", + "type": "github" + }, + "original": { + "owner": "helix-editor", + "repo": "helix", + "type": "github" + } + }, "home": { "inputs": { "nixpkgs": [ @@ -211,36 +253,20 @@ ] }, "locked": { - "lastModified": 1645746341, - "narHash": "sha256-j4fTWByYMGSSl0P7HEJQmbU/ifJtW25n/SoF6hgXN8c=", + "lastModified": 1648834319, + "narHash": "sha256-i5Aj4Aw64D/A0X6XW5LxSS4XBnYj7gMz+kN4dpsbdk8=", "owner": "nix-community", "repo": "home-manager", - "rev": "650cfe60f31f3d27ba869bf7db12ca8ded5f1d74", + "rev": "0bdbdea2e26c984b096f4f7d10e3c88536a980b0", "type": "github" }, "original": { "owner": "nix-community", - "ref": "master", + "ref": "release-21.11", "repo": "home-manager", "type": "github" } }, - "latest": { - "locked": { - "lastModified": 1638198142, - "narHash": "sha256-plU9b8r4St6q4U7VHtG9V7oF8k9fIpfXl/KDaZLuY9k=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "8a308775674e178495767df90c419425474582a1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "naersk": { "inputs": { "nixpkgs": [ @@ -248,11 +274,11 @@ ] }, "locked": { - "lastModified": 1639947939, - "narHash": "sha256-pGsM8haJadVP80GFq4xhnSpNitYNQpaXk4cnA796Cso=", + "lastModified": 1649096192, + "narHash": "sha256-7O8e+eZEYeU+ET98u/zW5epuoN/xYx9G+CIh4DjZVzY=", "owner": "nmattia", "repo": "naersk", - "rev": "2fc8ce9d3c025d59fee349c1f80be9785049d653", + "rev": "d626f73332a8f587b613b0afe7293dd0777be07d", "type": "github" }, "original": { @@ -261,22 +287,78 @@ "type": "github" } }, - "nixlib": { + "nixCargoIntegration": { + "inputs": { + "devshell": "devshell", + "dream2nix": "dream2nix", + "nixpkgs": [ + "nixos" + ], + "rustOverlay": [ + "rust-overlay" + ] + }, "locked": { - "lastModified": 1641688481, - "narHash": "sha256-6L+EU12xLDHby7y8elgFtRKVBxix+7qV8DhVgXqrKZo=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "f697717b3d3a074ffc16c8c8227504f0db292886", + "lastModified": 1649398335, + "narHash": "sha256-SjE4w4kcg3NphapPwBMiIdZDLvVqEf9+IfIskQMd4OY=", + "owner": "yusdacra", + "repo": "nix-cargo-integration", + "rev": "791bf70e720869431479bd4f2133e466b13fe088", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", + "owner": "yusdacra", + "repo": "nix-cargo-integration", "type": "github" } }, "nixos": { + "locked": { + "lastModified": 1649225869, + "narHash": "sha256-u1zLtPmQzhT9mNXyM8Ey9pk7orDrIKdwooeGDEXm5xM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b6966d911da89e5a7301aaef8b4f0a44c77e103c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixosHardware": { + "locked": { + "lastModified": 1649401245, + "narHash": "sha256-mce0dpugKD9qgFgzloE2yoYJRD6Bvsy2QDzODpXMsss=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "ddeb6a0aa430914674d6f0bc1646cf11e799a5bb", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixosPersistence": { + "locked": { + "lastModified": 1646131459, + "narHash": "sha256-GPmgxvUFvQ1GmsGfWHy9+rcxWrczeDhS9XnAIPHi9XQ=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "2f39baeb7d039fda5fc8225111bb79474138e6f4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, + "nixpkgs": { "locked": { "lastModified": 1645433236, "narHash": "sha256-4va4MvJ076XyPp5h8sm5eMQvCrJ6yZAbBmyw95dGyw4=", @@ -292,78 +374,20 @@ "type": "github" } }, - "nixos-generators": { - "inputs": { - "nixlib": "nixlib", - "nixpkgs": [ - "digga", - "blank" - ] - }, - "locked": { - "lastModified": 1637655461, - "narHash": "sha256-kXZPbclN3gKwjhp2/RYFDFpAsSBwzX1iLF4EcnHZsPQ=", - "owner": "nix-community", - "repo": "nixos-generators", - "rev": "05a3eb158a9c7746a5d463726d7f7cccf07500e4", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixos-generators", - "type": "github" - } - }, - "nixos-hardware": { - "locked": { - "lastModified": 1645346782, - "narHash": "sha256-3qd0cu+2kapIP7cdHW9n8zh1wCvRGg83K7/cCj5Xv+A=", - "owner": "nixos", - "repo": "nixos-hardware", - "rev": "1ccfe243aa6e94bf80f2a66f6be41d086d37fc87", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixos-hardware", - "type": "github" - } - }, - "nixosPersistence": { - "locked": { - "lastModified": 1644791231, - "narHash": "sha256-iDihsF1fUMK4xXiUudPnDM3veH1LXbbxfP9Lzekw9iU=", - "owner": "nix-community", - "repo": "impermanence", - "rev": "635bcd2d88739197a0b584aa9fadaa53c717a853", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "impermanence", - "type": "github" - } - }, "nixpkgsWayland": { "inputs": { "cachix": "cachix", - "flake-compat": "flake-compat_2", - "nixpkgs": [ - "nixos" - ] + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1645727284, "narHash": "sha256-xwi46ruR5z4THe967gzW74dQhPmlS5FWSiWuo9aYquY=", - "owner": "colemickens", - "repo": "nixpkgs-wayland", - "rev": "ddd6f194eed2779df5730e702cecda28bd8938df", - "type": "github" + "path": "/nix/store/23by5yfsvzynznfjk2kjwn1gpb231fl9-source", + "type": "path" }, "original": { - "owner": "colemickens", - "repo": "nixpkgs-wayland", - "type": "github" + "id": "nixpkgsWayland", + "type": "indirect" } }, "rnixLsp": { @@ -374,14 +398,14 @@ "nixpkgs": [ "nixos" ], - "utils": "utils_2" + "utils": "utils" }, "locked": { - "lastModified": 1643586450, - "narHash": "sha256-BRIAc3+zavSlJPYSbov2n1W9/a4Iuh2swFPYRWjCm1g=", + "lastModified": 1647240246, + "narHash": "sha256-/MLdBWfFUN1C1eNVBYfaVAIcDiZKXpWEbzBC2pqVXj0=", "owner": "nix-community", "repo": "rnix-lsp", - "rev": "41eb2f3366e3f351bf2563c2a7c46fd17e78dfe0", + "rev": "4d1024ccfe1bc569811769d1ef52a2fc6c1d482d", "type": "github" }, "original": { @@ -393,32 +417,41 @@ "root": { "inputs": { "alejandra": "alejandra", - "digga": "digga", + "fup": "fup", + "helix": "helix", "home": "home", "naersk": "naersk", + "nixCargoIntegration": "nixCargoIntegration", "nixos": "nixos", - "nixos-hardware": "nixos-hardware", + "nixosHardware": "nixosHardware", "nixosPersistence": "nixosPersistence", "nixpkgsWayland": "nixpkgsWayland", - "rnixLsp": "rnixLsp" + "rnixLsp": "rnixLsp", + "rust-overlay": "rust-overlay" } }, - "utils": { + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "nixos" + ] + }, "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "lastModified": 1649447403, + "narHash": "sha256-JZMYKsCxpLpPKLVjDUVmKs/bVnbcaPa8crf2uKh0lKY=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "44801306a2aa0e9aaa47588d615ce6df4acf18c6", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "oxalica", + "repo": "rust-overlay", "type": "github" } }, - "utils_2": { + "utils": { "locked": { "lastModified": 1638122382, "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", diff --git a/flake.nix b/flake.nix index 1673de4..2af98ba 100644 --- a/flake.nix +++ b/flake.nix @@ -2,15 +2,25 @@ description = "A highly structured configuration database."; inputs = { nixos.url = "github:nixos/nixpkgs/nixos-unstable"; - digga.url = "github:divnix/digga/main"; - digga.inputs.nixpkgs.follows = "nixos"; - digga.inputs.nixlib.follows = "nixos"; - digga.inputs.home-manager.follows = "home"; - home.url = "github:nix-community/home-manager/master"; + + fup.url = "github:gytis-ivaskevicius/flake-utils-plus"; + + home.url = "github:nix-community/home-manager/release-21.11"; home.inputs.nixpkgs.follows = "nixos"; + + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixos"; + }; naersk.url = "github:nmattia/naersk"; naersk.inputs.nixpkgs.follows = "nixos"; - nixos-hardware.url = "github:nixos/nixos-hardware"; + nixCargoIntegration.url = "github:yusdacra/nix-cargo-integration"; + nixCargoIntegration.inputs.nixpkgs.follows = "nixos"; + nixCargoIntegration.inputs.rustOverlay.follows = "rust-overlay"; + + nixosHardware.url = "github:nixos/nixos-hardware"; + nixosPersistence.url = "github:nix-community/impermanence"; + rnixLsp = { url = "github:nix-community/rnix-lsp"; inputs.naersk.follows = "naersk"; @@ -20,116 +30,96 @@ url = "github:kamadorueda/alejandra"; inputs.nixpkgs.follows = "nixos"; }; - /* - helix = { - url = "https://github.com/helix-editor/helix.git"; - type = "git"; - submodules = true; - inputs.nixpkgs.follows = "nixos"; - }; - */ - nixosPersistence.url = "github:nix-community/impermanence"; - nixpkgsWayland = { - url = "github:colemickens/nixpkgs-wayland"; + helix = { + url = "github:helix-editor/helix"; inputs.nixpkgs.follows = "nixos"; + inputs.rust-overlay.follows = "rust-overlay"; + inputs.nixCargoIntegration.follows = "nixCargoIntegration"; }; }; outputs = { self, - digga, - nixos, + fup, home, - nixos-hardware, + nixosHardware, nixosPersistence, nixpkgsWayland, rnixLsp, alejandra, + helix, + nixos, ... } @ inputs: - digga.lib.mkFlake + fup.lib.mkFlake { inherit self inputs; - channelsConfig = {allowUnfree = true;}; - channels = { - nixos = { - imports = [(digga.lib.importOverlays ./overlays)]; - overlays = [ - nixpkgsWayland.overlay - ( - _: prev: { - #helix = helix.packages.${prev.system}.helix; - #helix-src = prev.helix.src; - #rnix-lsp = rnixLsp.packages.${prev.system}.rnix-lsp; - } - ) - ( - _: prev: { - alejandra = alejandra.defaultPackage.${prev.system}; - remarshal = - prev.remarshal.overrideAttrs - ( - old: { - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "poetry.masonry.api" "poetry.core.masonry.api" \ - --replace 'PyYAML = "^5.3"' 'PyYAML = "*"' \ - --replace 'tomlkit = "^0.7"' 'tomlkit = "*"' - ''; - } - ); - } - ) - ./pkgs/default.nix - ]; - }; - }; - lib = import ./lib {lib = digga.lib // nixos.lib;}; + + supportedSystems = ["x86_64-linux"]; + channelsConfig.allowUnfree = true; + nix.generateRegistryFromInputs = true; + nix.generateNixPathFromInputs = true; + nix.linkInputs = true; + sharedOverlays = [ - ( - _: prev: { - __dontExport = true; - lib = prev.lib.extend (_: _: {our = self.lib;}); - } - ) + (_: prev: { + lib = prev.lib.extend (_: _: builtins); + }) + (_: prev: { + lib = prev.lib.extend (_: l: { + pkgBin = id: + if l.isString id + then "${prev.${id}}/bin/${id}" + else "${prev.${id.name}}/bin/${id.bin}"; + }); + }) ]; - nixos = { - hostDefaults = { - system = "x86_64-linux"; - channelName = "nixos"; - imports = [(digga.lib.importExportableModules ./modules)]; - modules = [ - {lib.our = self.lib;} - digga.nixosModules.bootstrapIso - digga.nixosModules.nixConfig - home.nixosModules.home-manager - nixosPersistence.nixosModules.impermanence - ]; - }; - imports = [(digga.lib.importHosts ./hosts)]; - hosts = {}; - importables = rec { - profiles = - (digga.lib.rakeLeaves ./profiles) - // { - users = digga.lib.rakeLeaves ./users; - nixos-hardware = nixos-hardware.nixosModules; - }; - suites = with profiles; { - base = [cachix core users.root]; - work = [users.patriot develop]; + + channels.nixos = { + overlays = [ + ./overlays/chromium-wayland.nix + ./overlays/phantom.nix + ( + _: prev: { + helix = helix.packages.${prev.system}.helix; + rnix-lsp = rnixLsp.packages.${prev.system}.rnix-lsp; + alejandra = alejandra.defaultPackage.${prev.system}; + } + ) + ]; + }; + + hostDefaults = { + channelName = "nixos"; + modules = [ + home.nixosModules.home-manager + ./profiles + ./modules + ./locale + ./secrets + ]; + }; + + hosts.lungmen = { + modules = with nixosHardware.nixosModules; [ + nixos.nixosModules.notDetected + nixosPersistence.nixosModules.impermanence + common-pc-ssd + common-pc + common-gpu-amd + common-cpu-amd + ./profiles/network/networkmanager + ./users/root + ./users/patriot + ./hosts/lungmen + ]; + }; + + outputsBuilder = channels: + with channels.nixos; { + devShell = mkShell { + name = "prts"; + buildInputs = [git git-crypt]; }; }; - }; - home = { - imports = [(digga.lib.importExportableModules ./users/modules)]; - modules = []; - importables = rec { - profiles = digga.lib.rakeLeaves ./users/profiles; - suites = with profiles; rec {base = [direnv git starship];}; - }; - }; - devshell = ./shell; - homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; - deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations {}; }; } diff --git a/hosts/NixOS.nix b/hosts/NixOS.nix deleted file mode 100644 index 3c611ff..0000000 --- a/hosts/NixOS.nix +++ /dev/null @@ -1,8 +0,0 @@ -{suites, ...}: { - ### root password is empty by default ### - imports = suites.base; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - networking.networkmanager.enable = true; - fileSystems."/" = {device = "/dev/disk/by-label/nixos";}; -} diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix deleted file mode 100644 index 17d2f20..0000000 --- a/hosts/bootstrap.nix +++ /dev/null @@ -1,16 +0,0 @@ -{profiles, ...}: { - # build with: `bud build bootstrap bootstrapIso` - # reachable on the local link via ssh root@fe80::47%eno1 - # where 'eno1' is replaced by your own machine's network - # interface that has the local link to the target machine - imports = [ - # profiles.networking - profiles.core - profiles.users.root - # make sure to configure ssh keys - profiles.users.nixos - ]; - boot.loader.systemd-boot.enable = true; - # will be overridden by the bootstrapIso instrumentation - fileSystems."/" = {device = "/dev/disk/by-label/nixos";}; -} diff --git a/hosts/lungmen.nix b/hosts/lungmen/default.nix similarity index 94% rename from hosts/lungmen.nix rename to hosts/lungmen/default.nix index 0c23558..62902a4 100644 --- a/hosts/lungmen.nix +++ b/hosts/lungmen/default.nix @@ -3,8 +3,6 @@ lib, pkgs, modulesPath, - suites, - profiles, ... }: let btrfsPartPath = "/dev/disk/by-label/NIXOS"; @@ -40,11 +38,6 @@ sudo umount /mnt ''; in { - imports = - suites.base - ++ suites.work - ++ [../profiles/network/networkmanager (modulesPath + "/installer/scan/not-detected.nix")] - ++ (with profiles.nixos-hardware; [common-pc-ssd common-pc common-gpu-amd common-cpu-amd]); boot = { loader = { efi.canTouchEfiVariables = true; @@ -128,7 +121,6 @@ in { }; nix.settings.max-jobs = lib.mkDefault 4; security = { - mitigations.disable = true; allowSimultaneousMultithreading = false; # Deleting root subvolume makes sudo show lecture every boot sudo.extraConfig = '' @@ -142,7 +134,6 @@ in { alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - media-session.enable = true; }; hardware = { opengl = { diff --git a/lib/compat/default.nix b/lib/compat/default.nix deleted file mode 100644 index f082eae..0000000 --- a/lib/compat/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -let - rev = "e7e5d481a0e15dcd459396e55327749989e04ce0"; - flake = ( - import - ( - fetchTarball - { - url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz"; - sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x"; - } - ) - {src = ../../.;} - ); -in - flake diff --git a/lib/compat/nixos/default.nix b/lib/compat/nixos/default.nix deleted file mode 100644 index f5aeeef..0000000 --- a/lib/compat/nixos/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: let - inherit (default.inputs.nixos) lib; - host = configs.${hostname} or configs.NixOS; - configs = default.nixosConfigurations; - default = (import ../.).defaultNix; - hostname = lib.fileContents /etc/hostname; -in - host diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index cff2c83..0000000 --- a/lib/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{lib}: -lib.makeExtensible -( - self: { - pkgBinNoDep = pkgs: name: "${pkgs.${name}}/bin/${name}"; - html = import ./html.nix {format = true;}; - } -) diff --git a/lib/html.nix b/lib/html.nix deleted file mode 100644 index 93284c8..0000000 --- a/lib/html.nix +++ /dev/null @@ -1,31 +0,0 @@ -{format ? false}: let - inherit (builtins) isAttrs isList map; - fmt = - if format - then "\n " - else ""; - mapAttrsToList = f: attrs: map (name: f name attrs.${name}) (builtins.attrNames attrs); - concatStrings = builtins.concatStringsSep ""; - evalAttrs = attrs: concatStrings (mapAttrsToList (name: value: " ${name}=\"${value}\"") attrs); - genAttrs = f: names: - builtins.listToAttrs (map - (n: { - name = n; - value = f n; - }) - names); - evalChildren = children: - if isList children - then concatStrings children - else children; - tag = name: maybeAttrs: - if isAttrs maybeAttrs - then (children: "<${name}${evalAttrs maybeAttrs}>${fmt}${evalChildren children}${fmt}") - else tag name {} maybeAttrs; - tags = genAttrs tag ["html" "head" "body" "div" "p" "a"]; -in - tags - // { - inherit tag; - link = url: tags.a {href = url;}; - } diff --git a/locale/default.nix b/locale/default.nix index ba9dea8..1f4f7c1 100644 --- a/locale/default.nix +++ b/locale/default.nix @@ -1,9 +1,9 @@ {...}: { - console.keyMap = "trq"; i18n = { defaultLocale = "en_US.UTF-8"; supportedLocales = ["en_US.UTF-8/UTF-8"]; }; time.timeZone = "Turkey"; services.xserver.layout = "tr"; + console.keyMap = "trq"; } diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..f93928d --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./hm-system-defaults.nix + ]; +} diff --git a/modules/nix-path.nix b/modules/nix-path.nix deleted file mode 100644 index 8668a5d..0000000 --- a/modules/nix-path.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - channel, - inputs, - ... -}: { - nix.nixPath = ["nixpkgs=${channel.input}" "nixos-config=${../lib/compat/nixos}" "home-manager=${inputs.home}"]; -} diff --git a/modules/security/mitigations.nix b/modules/security/mitigations.nix deleted file mode 100644 index 8df9050..0000000 --- a/modules/security/mitigations.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - config, - lib, - ... -}: -with lib; let - inherit (builtins) readFile fetchurl; - cfg = config.security.mitigations; - cmdline = '' - ibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off''; -in { - options = { - security.mitigations.disable = - mkOption - { - type = types.bool; - default = false; - description = '' - Whether to disable spectre and meltdown mitigations in the kernel. Do - not use this in mission critical deployments, or on any machine you do - not have physical access to. - ''; - }; - }; - config = mkIf cfg.disable {boot.kernelParams = splitString " " cmdline;}; -} diff --git a/overlays/manix.nix b/overlays/manix.nix deleted file mode 100644 index 19578a0..0000000 --- a/overlays/manix.nix +++ /dev/null @@ -1 +0,0 @@ -final: prev: {manix = prev.manix.overrideAttrs (o: rec {inherit (prev.sources.manix) pname version src;});} diff --git a/overlays/overrides.nix b/overlays/overrides.nix deleted file mode 100644 index 5d5e510..0000000 --- a/overlays/overrides.nix +++ /dev/null @@ -1,4 +0,0 @@ -channels: final: prev: { - __dontExport = true; - # overrides clutter up actual creations -} diff --git a/overlays/various-flake-fixes.nix b/overlays/various-flake-fixes.nix deleted file mode 100644 index e56499e..0000000 --- a/overlays/various-flake-fixes.nix +++ /dev/null @@ -1,7 +0,0 @@ -final: prev: { - # Since: https://github.com/NixOS/nixpkgs/pull/126137 - nix-direnv = - if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs - then prev.nix-direnv.override {enableFlakes = true;} - else prev.nix-direnv; -} diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix deleted file mode 100644 index 2ce7ec4..0000000 --- a/pkgs/_sources/generated.nix +++ /dev/null @@ -1,20 +0,0 @@ -# This file was generated by nvfetcher, please do not modify it manually. -{ - fetchgit, - fetchurl, -}: { - manix = { - pname = "manix"; - version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; - src = - fetchgit - { - url = "https://github.com/mlvzk/manix"; - rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; - fetchSubmodules = false; - deepClone = false; - leaveDotGit = false; - sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; - }; - }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 1addf90..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -final: prev: { - # keep sources this first - sources = prev.callPackage (import ./_sources/generated.nix) {}; - # then, call packages with `final.callPackage` -} diff --git a/pkgs/sources.toml b/pkgs/sources.toml deleted file mode 100644 index f7af168..0000000 --- a/pkgs/sources.toml +++ /dev/null @@ -1,4 +0,0 @@ -# nvfetcher.toml -[manix] -src.git = "https://github.com/mlvzk/manix" -fetch.github = "mlvzk/manix" diff --git a/profiles/core/default.nix b/profiles/default.nix similarity index 95% rename from profiles/core/default.nix rename to profiles/default.nix index 007aa41..bb9d6c0 100644 --- a/profiles/core/default.nix +++ b/profiles/default.nix @@ -1,17 +1,15 @@ { - self, inputs, config, pkgs, - lib, ... }: let - inherit (lib) fileContents mkIf; - pkgBin = lib.our.pkgBinNoDep pkgs; + inherit (pkgs) lib; + inherit (lib) fileContents mkIf pkgBin; coreBin = v: "${pkgs.coreutils}/bin/${v}"; nixBin = "${config.nix.package}/bin/nix"; in { - imports = [../cachix ../../locale ../../secrets/secrets.nix]; + imports = [./cachix]; boot = { tmpOnTmpfs = true; loader.systemd-boot.configurationLimit = 10; @@ -121,8 +119,6 @@ in { mn = let manix_preview = "manix '{}' | sed 's/type: /> type: /g' | bat -l Markdown --color=always --plain"; in ''manix "" | rg '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="${manix_preview}" | xargs manix''; - # fix nixos-option - nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat"; # sudo s = ifSudo "sudo -E"; si = ifSudo "sudo -i"; diff --git a/secrets/secrets.nix b/secrets/default.nix similarity index 100% rename from secrets/secrets.nix rename to secrets/default.nix diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 575a5d8..0000000 --- a/shell.nix +++ /dev/null @@ -1 +0,0 @@ -(import ./lib/compat).shellNix diff --git a/shell/default.nix b/shell/default.nix deleted file mode 100644 index 5d58ced..0000000 --- a/shell/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - self, - inputs, - ... -}: { - modules = with inputs; [ - #bud.devshellModules.bud - ]; - exportedModules = [./devos.nix]; -} diff --git a/shell/devos.nix b/shell/devos.nix deleted file mode 100644 index 84a4707..0000000 --- a/shell/devos.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - pkgs, - extraModulesPath, - ... -}: let - hooks = import ./hooks; - pkgWithCategory = category: package: {inherit package category;}; - linter = pkgWithCategory "linter"; - docs = pkgWithCategory "docs"; - devos = pkgWithCategory "devos"; -in { - _file = toString ./.; - imports = ["${extraModulesPath}/git/hooks.nix"]; - git = {inherit hooks;}; - # tempfix: remove when merged https://github.com/numtide/devshell/pull/123 - devshell.startup.load_profiles = - pkgs.lib.mkForce - ( - pkgs.lib.noDepEntry - '' - # PATH is devshell's exorbitant privilige: - # fence against its pollution - _PATH=''${PATH} - # Load installed profiles - for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do - # If that folder doesn't exist, bash loves to return the whole glob - [[ -f "$file" ]] && source "$file" - done - # Exert exorbitant privilige and leave no trace - export PATH=''${_PATH} - unset _PATH - '' - ); - packages = with pkgs; [git-crypt]; - commands = with pkgs; - [ - (devos nixUnstable) - #(devos agenix) - /* - { - category = "devos"; - name = pkgs.nvfetcher-bin.pname; - help = pkgs.nvfetcher-bin.meta.description; - command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@"; - } - */ - #(linter nixpkgs-fmt) - #(linter editorconfig-checker) - # (docs python3Packages.grip) too many deps - # (docs mdbook) - ] - ++ lib.optional (pkgs ? deploy-rs) (devos deploy-rs.deploy-rs) - ++ lib.optional (system != "i686-linux") (devos cachix); -} diff --git a/shell/hooks/default.nix b/shell/hooks/default.nix deleted file mode 100644 index 4c9e464..0000000 --- a/shell/hooks/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - enable = false; - pre-commit.text = builtins.readFile ./pre-commit.sh; -} diff --git a/shell/hooks/pre-commit.sh b/shell/hooks/pre-commit.sh deleted file mode 100755 index 985d3b4..0000000 --- a/shell/hooks/pre-commit.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(${git}/bin/git hash-object -t tree /dev/null) -fi - -diff="git diff-index --name-only --cached $against --diff-filter d" - -nix_files=($($diff -- '*.nix')) -all_files=($($diff)) - -# Format staged nix files. -if [[ -n "${nix_files[@]}" ]]; then - nixpkgs-fmt "${nix_files[@]}" \ - && git add "${nix_files[@]}" -fi - -# check editorconfig -editorconfig-checker -- "${all_files[@]}" -if [[ $? != '0' ]]; then - printf "%b\n" \ - "\nCode is not aligned with .editorconfig" \ - "Review the output and commit your fixes" >&2 - exit 1 -fi diff --git a/users/modules/.flake-keep b/users/modules/.flake-keep deleted file mode 100644 index e69de29..0000000 diff --git a/users/nixos/default.nix b/users/nixos/default.nix deleted file mode 100644 index 1ec6064..0000000 --- a/users/nixos/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: { - users.users.nixos = { - uid = 1000; - password = "nixos"; - description = "default"; - isNormalUser = true; - extraGroups = ["wheel"]; - }; -} diff --git a/users/patriot/default.nix b/users/patriot/default.nix index bcef036..eace970 100644 --- a/users/patriot/default.nix +++ b/users/patriot/default.nix @@ -97,7 +97,6 @@ in { home-manager.users.patriot = { config, pkgs, - suites, ... }: let personal = import ../../personal.nix; @@ -234,33 +233,11 @@ in { #export QT_PLATFORM_PLUGIN=qt5ct ''; in { - imports = suites.base; - # needs to be fixed to use nix profile??? - /* - gtk = { - enable = false; - font = { - package = pkgs.dejavu_fonts; - name = "DejaVu Sans 12"; - }; - iconTheme = { - package = pkgs.papirus-icon-theme; - name = "Papirus Dark"; - }; - theme = { - package = pkgs.numix-gtk-theme; - name = "Numix Dark"; - }; - }; - - qt = { - enable = false; - style = { - package = pkgs.adwaita-qt; - name = "adwaita-dark"; - }; - }; - */ + imports = [ + ../profiles/direnv + ../profiles/git + ../profiles/starship + ]; fonts.fontconfig.enable = true; home = { homeDirectory = nixosConfig.users.users.patriot.home; @@ -652,6 +629,9 @@ in { "nix.serverPath" = pkgBin "rnix-lsp"; "editor.bracketPairColorization.enabled" = true; "editor.semanticHighlighting.enabled" = true; + "remote.SSH.defaultExtensions" = [ + "gitpod.gitpod-remote-ssh" + ]; }; }; };