nix machine / user configurations

migrate to fup

+315 -1728
-5
bors.toml
··· 1 - status = [ "check" ] 2 - 3 - required_approvals = 1 4 - 5 - up_to_date_approvals = true
-15
bud/default.nix
··· 1 - { 2 - pkgs, 3 - lib, 4 - budUtils, 5 - ... 6 - }: { 7 - bud.cmds = with pkgs; { 8 - get = { 9 - writer = budUtils.writeBashWithPaths [nixUnstable git coreutils]; 10 - synopsis = "get [DEST]"; 11 - help = "Copy the desired template to DEST"; 12 - script = ./get.bash; 13 - }; 14 - }; 15 - }
-1
bud/get.bash
··· 1 - nix flake new -t "github:divnix/devos/main" "${2:-devos}"
-16
default.nix
··· 1 - let 2 - inherit (default.inputs.nixos) lib; 3 - default = (import ./lib/compat).defaultNix; 4 - ciSystems = ["aarch64-linux" "i686-linux" "x86_64-linux"]; 5 - filterSystems = lib.filterAttrs (system: _: lib.elem system ciSystems); 6 - recurseIntoAttrsRecursive = lib.mapAttrs (_: v: 7 - if lib.isAttrs v 8 - then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v) 9 - else v); 10 - systemOutputs = 11 - lib.filterAttrs 12 - (name: set: lib.isAttrs set && lib.any (system: set ? ${system} && name != "legacyPackages") ciSystems) 13 - default.outputs; 14 - ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs; 15 - in 16 - (recurseIntoAttrsRecursive ciDrvs) // {shell = import ./shell.nix;}
-1
doc/.gitignore
··· 1 - book
-18
doc/CONTRIBUTING.md
··· 1 - # Pull Requests 2 - 3 - ## TL;DR; 4 - - **Target Branch**: `main` 5 - - **Merge Policy**: [`bors`][bors] is always right (→ `bors try`) 6 - - **Docs**: every changeset is expected to contain doc updates 7 - - **Commit Msg**: be a poet! Comprehensive and explanatory commit messages 8 - should cover the motivation and use case in an easily understandable manner 9 - even when read after a few months. 10 - - **Test Driven Development**: please default to test driven development where possible. 11 - 12 - ### Within the Devshell (`nix develop`) 13 - - **Hooks**: please `git commit` within the devshell 14 - - **Fail Early**: please run from within the devshell on your local machine: 15 - - `nix flake check` 16 - 17 - [bors]: https://bors.tech 18 -
-28
doc/SUMMARY.md
··· 1 - # Summary 2 - 3 - - [Introduction](../README.md) 4 - - [Quick Start](./start/index.md) 5 - - [ISO](./start/iso.md) 6 - - [Bootstrapping](./start/bootstrapping.md) 7 - - [From NixOS](./start/from-nixos.md) 8 - - [Key Concepts](./concepts/index.md) 9 - - [Hosts](./concepts/hosts.md) 10 - - [Overrides](./concepts/overrides.md) 11 - - [Profiles](./concepts/profiles.md) 12 - - [Suites](./concepts/suites.md) 13 - - [Users](./concepts/users.md) 14 - - [Outputs](./outputs/index.md) 15 - - [Modules](./outputs/modules.md) 16 - - [Overlays](./outputs/overlays.md) 17 - - [Packages](./outputs/pkgs.md) 18 - - [Concerns]() 19 - - [Secrets](./secrets.md) 20 - - [Tests](./tests.md) 21 - - [Helper Script – `bud`](./bud/index.md) 22 - - [get](./bud/get.md) 23 - - [Integrations](./integrations/index.md) 24 - - [Cachix](./integrations/cachix.md) 25 - - [Deploy RS](./integrations/deploy.md) 26 - - [NvFetcher](./integrations/nvfetcher.md) 27 - - [Hercules CI](./integrations/hercules.md) 28 - - [Contributing](./CONTRIBUTING.md)
-6
doc/book.toml
··· 1 - [book] 2 - authors = ["Timothy DeHerrera"] 3 - language = "en" 4 - multilingual = false 5 - src = "." 6 - title = "devos docs"
-10
doc/bud/get.md
··· 1 - # get 2 - The `get` subcommand is useful for getting a bare copy of devos without the 3 - git history. 4 - 5 - ## Usage 6 - ```sh 7 - bud get DEST-DIR 8 - ``` 9 - 10 - If DEST-DIR is ommitted, it defaults to _./devos_.
-24
doc/bud/index.md
··· 1 - # [`bud`][bud] command 2 - The template incudes a convenient script for managing your system called [`bud`][bud]. 3 - 4 - It is a portable and highly composable system control tool that work anywhere on your host 5 - or in the flake's devshell. 6 - 7 - Although it comes with some predefined standard helpers, 8 - it is very extensible and you are encouraged to write your own script snippets 9 - to ease your workflows. An example is the bud module for a `get` command that 10 - comes included with `devos`. 11 - 12 - While writing scripts you can convenientely access smart environment variables 13 - that can tell the current architecture, user or host name, among others, regardless 14 - wether you invoke `bud` within the devshell or as the system-wide installed `bud`. 15 - 16 - For details, please review the [bud repo][bud]. 17 - 18 - ## Usage 19 - ```sh 20 - bud help 21 - ``` 22 - 23 - 24 - [bud]: https://github.com/divnix/bud
-62
doc/concepts/hosts.md
··· 1 - # Hosts 2 - 3 - Nix flakes contain an output called `nixosConfigurations` declaring an 4 - attribute set of valid NixOS systems. To simplify the management and creation 5 - of these hosts, devos automatically imports every _.nix_ file inside this 6 - directory to the mentioned attribute set, applying the projects defaults to 7 - each. The only hard requirement is that the file contain a valid NixOS module. 8 - 9 - As an example, a file `hosts/system.nix` or `hosts/system/default.nix` will 10 - be available via the flake output `nixosConfigurations.system`. You can have 11 - as many hosts as you want and all of them will be automatically imported based 12 - on their name. 13 - 14 - For each host, the configuration automatically sets the `networking.hostName` 15 - attribute to the folder name or name of the file minus the _.nix_ extension. This 16 - is for convenience, since `nixos-rebuild` automatically searches for a configuration 17 - matching the current systems hostname if one is not specified explicitly. 18 - 19 - You can set channels, systems, and add extra modules to each host by editing the 20 - `nixos.hosts` argument in flake.nix. This is the perfect place to import 21 - host specific modules from external sources, such as the 22 - [nixos-hardware][nixos-hardware] repository. 23 - 24 - It is recommended that the host modules only contain configuration information 25 - specific to a particular piece of hardware. Anything reusable across machines 26 - is best saved for [profile modules](./profiles.md). 27 - 28 - This is a good place to import sets of profiles, called [suites](./suites.md), 29 - that you intend to use on your machine. 30 - 31 - 32 - ## Example 33 - 34 - flake.nix: 35 - ```nix 36 - { 37 - nixos = { 38 - imports = [ (devos.lib.importHosts ./hosts) ]; 39 - hosts = { 40 - librem = { 41 - channelName = "latest"; 42 - modules = [ nixos-hardware.nixosModules.purism-librem-13v3 ]; 43 - }; 44 - }; 45 - }; 46 - } 47 - ``` 48 - 49 - hosts/librem.nix: 50 - ```nix 51 - { suites, ... }: 52 - { 53 - imports = suites.laptop; 54 - 55 - boot.loader.systemd-boot.enable = true; 56 - boot.loader.efi.canTouchEfiVariables = true; 57 - 58 - fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; 59 - } 60 - ``` 61 - 62 - [nixos-hardware]: https://github.com/NixOS/nixos-hardware
-10
doc/concepts/index.md
··· 1 - # Key Concepts 2 - 3 - Key concepts are derived from [digga][digga]. Please refer to its 4 - [docs][digga-docs] for more details. 5 - 6 - This section is dedicated to helping you develop a more hands on 7 - understanding of them them. 8 - 9 - [digga-docs]: https://digga.divnix.com 10 - [digga]: https://github.com/divnix/digga
-42
doc/concepts/overrides.md
··· 1 - # Overrides 2 - Each NixOS host follows one channel. But many times it is useful to get packages 3 - or modules from different channels. 4 - 5 - ## Packages 6 - You can make use of `overlays/overrides.nix` to override specific packages in the 7 - default channel to be pulled from other channels. That file is simply an example 8 - of how any overlay can get `channels` as their first argument. 9 - 10 - You can add overlays to any channel to override packages from other channels. 11 - 12 - Pulling the manix package from the `latest` channel: 13 - ```nix 14 - channels: final: prev: { 15 - __dontExport = true; 16 - inherit (pkgs.latest) manix; 17 - } 18 - ``` 19 - 20 - It is recommended to set the `__dontExport` property for override specific 21 - overlays. `overlays/overrides.nix` is the best place to consolidate all package 22 - overrides and the property is already set for you. 23 - 24 - ## Modules 25 - 26 - You can also pull modules from other channels. All modules have access to the 27 - `modulesPath` for each channel as `<channelName>ModulesPath`. And you can use 28 - `disabledModules` to remove modules from the current channel. 29 - 30 - 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: 31 - ```nix 32 - { latestModulesPath }: 33 - { 34 - imports = [ "${latestModulesPath}/programs/zsh/zsh.nix" ]; 35 - disabledModules = [ "programs/zsh/zsh.nix" ]; 36 - } 37 - ``` 38 - 39 - > ##### _Note:_ 40 - > Sometimes a modules name will change from one branch to another. 41 - 42 - [nixpkgs-modules]: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules
-67
doc/concepts/profiles.md
··· 1 - # Profiles 2 - 3 - Profiles are a convenient shorthand for the [_definition_][definition] of 4 - [options][options] in contrast to their [_declaration_][declaration]. They're 5 - built into the NixOS module system for a reason: to elegantly provide a clear 6 - separation of concerns. 7 - 8 - ## Creation 9 - Profiles are created with the `rakeLeaves` function which recursively collects 10 - `.nix` files from within a folder. The recursion stops at folders with a `default.nix` 11 - in them. You end up with an attribute set with leaves(paths to profiles) or 12 - nodes(attrsets leading to more nodes or leaves). 13 - 14 - A profile is used for quick modularization of [interelated bits](./profiles.md#subprofiles). 15 - 16 - > ##### _Notes:_ 17 - > * For _declaring_ module options, there's the [modules](../outputs/modules.md) directory. 18 - > * This directory takes inspiration from 19 - > [upstream](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/profiles) 20 - > . 21 - 22 - ### Nested profiles 23 - Profiles can be nested in attribute sets due to the recursive nature of `rakeLeaves`. 24 - This can be useful to have a set of profiles created for a specific purpose. It is 25 - sometimes useful to have a `common` profile that has high level concerns related 26 - to all its sister profiles. 27 - 28 - ### Example 29 - 30 - profiles/develop/common.nix: 31 - ```nix 32 - { 33 - imports = [ ./zsh ]; 34 - # some generic development concerns ... 35 - } 36 - ``` 37 - 38 - profiles/develop/zsh.nix: 39 - ```nix 40 - { ... }: 41 - { 42 - programs.zsh.enable = true; 43 - # zsh specific options ... 44 - } 45 - ``` 46 - 47 - The examples above will end up with a profiles set like this: 48 - ```nix 49 - { 50 - develop = { 51 - common = ./profiles/develop/common.nix; 52 - zsh = ./profiles/develop/zsh.nix; 53 - }; 54 - } 55 - ``` 56 - 57 - ## Conclusion 58 - Profiles are the most important concept in DevOS. They allow us to keep our 59 - Nix expressions self contained and modular. This way we can maximize reuse 60 - across hosts while minimizing boilerplate. Remember, anything machine 61 - specific belongs in your [host](hosts.md) files instead. 62 - 63 - [definition]: https://nixos.org/manual/nixos/stable/index.html#sec-option-definitions 64 - [declaration]: https://nixos.org/manual/nixos/stable/index.html#sec-option-declarations 65 - [options]: https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules 66 - [spec]: https://github.com/divnix/devos/tree/main/lib/devos/mkProfileAttrs.nix 67 - [config]: https://nixos.wiki/wiki/Module#structure
-25
doc/concepts/suites.md
··· 1 - # Suites 2 - Suites provide a mechanism for users to easily combine and name collections of 3 - profiles. 4 - 5 - `suites` are defined in the `importables` argument in either the `home` or `nixos` 6 - namespace. They are a special case of an `importable` which is passed as a special 7 - argument (one that can be use in an `imports` line) to your hosts. All lists defined 8 - in `suites` are flattened and type-checked as paths. 9 - 10 - ## Definition 11 - ```nix 12 - rec { 13 - workstation = [ profiles.develop profiles.graphical users.nixos ]; 14 - mobileWS = workstation ++ [ profiles.laptop ]; 15 - } 16 - ``` 17 - 18 - ## Usage 19 - `hosts/my-laptop.nix`: 20 - ```nix 21 - { suites, ... }: 22 - { 23 - imports = suites.mobileWS; 24 - } 25 - ```
-77
doc/concepts/users.md
··· 1 - > ##### _Note:_ 2 - > This section and its semantics need a conceptiual rework. 3 - > Since recently [portable home configurations][portableuser] 4 - > that are not bound to any specific host are a thing. 5 - 6 - # Users 7 - 8 - Users are a special case of [profiles](profiles.md) that define system 9 - users and [home-manager][home-manager] configurations. For your convenience, 10 - home manager is wired in by default so all you have to worry about is declaring 11 - your users. For a fully fleshed out example, check out the developers personal 12 - [branch](https://github.com/divnix/devos/tree/nrd/users/nrd/default.nix). 13 - 14 - ## Basic Usage 15 - `users/myuser/default.nix`: 16 - ```nix 17 - { ... }: 18 - { 19 - users.users.myuser = { 20 - isNormalUser = true; 21 - }; 22 - 23 - home-manager.users.myuser = { 24 - programs.mpv.enable = true; 25 - }; 26 - } 27 - 28 - ``` 29 - 30 - ## Home Manager 31 - Home Manager support follows the same principles as regular nixos configurations, 32 - it even gets its own namespace in your `flake.nix` as `home`. 33 - 34 - All modules defined in [user modules][modules-list] will be imported to 35 - Home Manager. 36 - User profiles can be collected in a similar fashion as system ones into a `suites` 37 - argument that gets passed to your home-manager users. 38 - 39 - ### Example 40 - ```nix 41 - { 42 - home-manager.users.nixos = { suites, ... }: { 43 - imports = suites.base; 44 - }; 45 - } 46 - ``` 47 - 48 - 49 - ## External Usage 50 - You can easily use the defined home-manager configurations outside of NixOS 51 - using the `homeConfigurations` flake output. The [bud](../bud/index.md) helper 52 - script makes this even easier. 53 - 54 - This is great for keeping your environment consistent across Unix systems, 55 - including OSX. 56 - 57 - ### From within the projects devshell: 58 - ```sh 59 - # builds the nixos user defined in the NixOS host 60 - bud home NixOS nixos 61 - 62 - # build and activate 63 - bud home NixOS nixos switch 64 - ``` 65 - 66 - ### Manually from outside the project: 67 - ```sh 68 - # build 69 - nix build "github:divnix/devos#homeConfigurations.nixos@NixOS.home.activationPackage" 70 - 71 - # activate 72 - ./result/activate && unlink result 73 - ``` 74 - 75 - [home-manager]: https://nix-community.github.io/home-manager 76 - [modules-list]: https://github.com/divnix/devos/tree/main/users/modules/module-list.nix 77 - [portableuser]: https://digga.divnix.com/api-reference-home.html#homeusers
-17
doc/integrations/cachix.md
··· 1 - # Cachix 2 - The system will automatically pull a cachix.nix at the root if one exists. 3 - This is usually created automatically by a `sudo cachix use`. If you're more 4 - inclined to keep the root clean, you can drop any generated files in the 5 - `cachix` directory into the `profiles/cachix` directory without further 6 - modification. 7 - 8 - For example, to add your own cache, assuming the template lives in /etc/nixos, 9 - by simply running `sudo cachix use yourcache`. Then, optionally, move 10 - `cachix/yourcache.nix` to `profiles/cachix/yourcache.nix` 11 - 12 - These caches are only added to the system after a `nixos-rebuild switch`, so it 13 - is recommended to call `cachix use nrdxp` before the initial deployment, as it 14 - will save a lot of build time. 15 - 16 - In the future, users will be able to skip this step once the ability to define 17 - the nix.conf within the flake is fully fleshed out upstream.
-49
doc/integrations/deploy.md
··· 1 - # deploy-rs 2 - [Deploy-rs][d-rs] is a tool for managing NixOS remote machines. It was 3 - chosen for devos after the author experienced some frustrations with the 4 - stateful nature of nixops' db. It was also designed from scratch to support 5 - flake based deployments, and so is an excellent tool for the job. 6 - 7 - By default, all the [hosts](../concepts/hosts.md) are also available as deploy-rs nodes, 8 - configured with the hostname set to `networking.hostName`; overridable via 9 - the command line. 10 - 11 - ## Usage 12 - 13 - Just add your ssh key to the host: 14 - ```nix 15 - { ... }: 16 - { 17 - users.users.${sshUser}.openssh.authorizedKeys.keyFiles = [ 18 - ../secrets/path/to/key.pub 19 - ]; 20 - } 21 - ``` 22 - 23 - And the private key to your user: 24 - ```nix 25 - { ... }: 26 - { 27 - home-manager.users.${sshUser}.programs.ssh = { 28 - enable = true; 29 - 30 - matchBlocks = { 31 - ${host} = { 32 - host = hostName; 33 - identityFile = ../secrets/path/to/key; 34 - extraOptions = { AddKeysToAgent = "yes"; }; 35 - }; 36 - }; 37 - } 38 - } 39 - ``` 40 - 41 - And run the deployment: 42 - ```sh 43 - deploy '.#hostName' --hostname host.example.com 44 - ``` 45 - 46 - > ##### _Note:_ 47 - > Your user will need **passwordless** sudo access 48 - 49 - [d-rs]: https://github.com/serokell/deploy-rs
-36
doc/integrations/hercules.md
··· 1 - # Hercules CI 2 - If you start adding your own packages and configurations, you'll probably have 3 - at least a few binary artifacts. With hercules we can build every package in 4 - our configuration automatically, on every commit. Additionally, we can have it 5 - upload all our build artifacts to a binary cache like [cachix][cachix]. 6 - 7 - This will work whether your copy is a fork, or a bare template, as long as your 8 - repo is hosted on GitHub. 9 - 10 - ## Setup 11 - Just head over to [hercules-ci.com](https://hercules-ci.com) to make an account. 12 - 13 - Then follow the docs to set up an [agent][agent], if you want to deploy to a 14 - binary cache (and of course you do), be sure _not_ to skip the 15 - [binary-caches.json][cache]. 16 - 17 - ## Ready to Use 18 - The repo is already set up with the proper _default.nix_ file, building all 19 - declared packages, checks, profiles and shells. So you can see if something 20 - breaks, and never build the same package twice! 21 - 22 - If you want to get fancy, you could even have hercules 23 - [deploy your configuration](https://docs.hercules-ci.com/hercules-ci-effects/guide/deploy-a-nixos-machine/)! 24 - 25 - > ##### _Note:_ 26 - > Hercules doesn't have access to anything encrypted in the 27 - > [secrets folder](../../secrets), so none of your secrets will accidentally get 28 - > pushed to a cache by mistake. 29 - > 30 - > You could pull all your secrets via your user, and then exclude it from 31 - > [allUsers](https://github.com/nrdxp/devos/blob/nrd/suites/default.nix#L17) 32 - > to keep checks passing. 33 - 34 - [agent]: https://docs.hercules-ci.com/hercules-ci/getting-started/#github 35 - [cache]: https://docs.hercules-ci.com/hercules-ci/getting-started/deploy/nixos/#_3_configure_a_binary_cache 36 - [cachix]: https://cachix.org
-5
doc/integrations/index.md
··· 1 - # Integrations 2 - This section explores some of the optional tools included with devos to provide 3 - a solution to common concerns such as ci and remote deployment. An effort is 4 - made to choose tools that treat nix, and where possible flakes, as first class 5 - citizens.
-43
doc/integrations/nvfetcher.md
··· 1 - # nvfetcher 2 - [NvFetcher][nvf] is a workflow companion for updating nix sources. 3 - 4 - You can specify an origin source and an update configuration, and 5 - nvfetcher can for example track updates to a specific branch and 6 - automatically update your nix sources configuration on each run 7 - to the tip of that branch. 8 - 9 - All package source declaration is done in [sources.toml][sources.toml]. 10 - 11 - From within the devshell of this repo, run `nvfetcher`, a wrapped 12 - version of `nvfetcher` that knows where to find and place its files 13 - and commit the results. 14 - 15 - ## Usage 16 - 17 - Statically fetching (not tracking) a particular tag from a github repo: 18 - ```toml 19 - [manix] 20 - src.manual = "v0.6.3" 21 - fetch.github = "mlvzk/manix" 22 - ``` 23 - 24 - Tracking the latest github _release_ from a github repo: 25 - ```toml 26 - [manix] 27 - src.github = "mlvzk/manix" # responsible for tracking 28 - fetch.github = "mlvzk/manix" # responsible for fetching 29 - ``` 30 - 31 - Tracking the latest commit of a git repository and fetch from a git repo: 32 - ```toml 33 - [manix] 34 - src.git = "https://github.com/mlvzk/manix.git" # responsible for tracking 35 - fetch.git = "https://github.com/mlvzk/manix.git" # responsible for fetching 36 - ``` 37 - 38 - > ##### _Note:_ 39 - > Please refer to the [NvFetcher Readme][nvf-readme] for more options. 40 - 41 - [nvf]: https://github.com/berberman/nvfetcher 42 - [nvf-readme]: https://github.com/berberman/nvfetcher#readme 43 - [sources.toml]: https://github.com/divnix/devos/tree/main/pkgs/sources.toml
-3
doc/outputs/index.md
··· 1 - # Layout 2 - Each of the following sections is a directory whose contents are output to the 3 - outside world via the flake's outputs. Check each chapter for details.
-79
doc/outputs/modules.md
··· 1 - # Modules 2 - The modules directory is a replica of nixpkg's NixOS [modules][nixpkgs-modules] 3 - , and follows the same semantics. This allows for trivial upstreaming into 4 - nixpkgs proper once your module is sufficiently stable. 5 - 6 - All modules linked in _module-list.nix_ are automatically exported via 7 - `nixosModules.<file-basename>`, and imported into all [hosts](../concepts/hosts.md). 8 - 9 - 10 - > ##### _Note:_ 11 - > This is reserved for declaring brand new module options. If you just want to 12 - > declare a coherent configuration of already existing and related NixOS options 13 - > , use [profiles](../concepts/profiles.md) instead. 14 - 15 - ## Semantics 16 - In case you've never written a module for nixpkgs before, here is a brief 17 - outline of the process. 18 - 19 - ### Declaration 20 - modules/services/service-category/my-service.nix: 21 - ```nix 22 - { config, lib, ... }: 23 - let 24 - cfg = config.services.myService; 25 - in 26 - { 27 - options.services.myService = { 28 - enable = lib.mkEnableOption "Description of my new service."; 29 - 30 - # additional options ... 31 - }; 32 - 33 - config = lib.mkIf cfg.enable { 34 - # implementation ... 35 - }; 36 - } 37 - ``` 38 - 39 - ### Import 40 - modules/module-list.nix: 41 - ```nix 42 - [ 43 - ./services/service-category/my-service.nix 44 - ] 45 - ``` 46 - 47 - ## Usage 48 - 49 - ### Internal 50 - profiles/profile-category/my-profile.nix: 51 - ```nix 52 - { ... }: 53 - { 54 - services.MyService.enable = true; 55 - } 56 - ``` 57 - 58 - ### External 59 - flake.nix: 60 - ```nix 61 - { 62 - # inputs omitted 63 - 64 - outputs = { self, devos, nixpkgs, ... }: { 65 - nixosConfigurations.myConfig = nixpkgs.lib.nixosSystem { 66 - system = "..."; 67 - 68 - modules = [ 69 - devos.nixosModules.my-service 70 - ({ ... }: { 71 - services.MyService.enable = true; 72 - }) 73 - ]; 74 - }; 75 - }; 76 - } 77 - ``` 78 - 79 - [nixpkgs-modules]: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules
-25
doc/outputs/overlays.md
··· 1 - # Overlays 2 - Writing overlays is a common occurence when using a NixOS system. Therefore, 3 - we want to keep the process as simple and straightforward as possible. 4 - 5 - Any _.nix_ files declared in this directory will be assumed to be a valid 6 - overlay, and will be automatically imported into all [hosts](../concepts/hosts.md), and 7 - exported via `overlays.<channel>/<pkgName>` _as well as_ 8 - `packages.<system>.<pkgName>` (for valid systems), so all you have to do is 9 - write it. 10 - 11 - ## Example 12 - overlays/kakoune.nix: 13 - ```nix 14 - final: prev: { 15 - kakoune = prev.kakoune.override { 16 - configure.plugins = with final.kakounePlugins; [ 17 - (kak-fzf.override { fzf = final.skim; }) 18 - kak-auto-pairs 19 - kak-buffers 20 - kak-powerline 21 - kak-vertical-selection 22 - ]; 23 - }; 24 - } 25 - ```
-109
doc/outputs/pkgs.md
··· 1 - # Packages 2 - Similar to [modules](./modules.md), the pkgs directory mirrors the upstream 3 - [nixpkgs/pkgs][pkgs], and for the same reason; if you ever want to upstream 4 - your package, it's as simple as dropping it into the nixpkgs/pkgs directory. 5 - 6 - The only minor difference is that, instead of adding the `callPackage` call to 7 - `all-packages.nix`, you just add it the the _default.nix_ in this directory, 8 - which is defined as a simple overlay. 9 - 10 - All the packages are exported via `packages.<system>.<pkg-name>`, for all 11 - the supported systems listed in the package's `meta.platforms` attribute. 12 - 13 - And, as usual, every package in the overlay is also available to any NixOS 14 - [host](../concepts/hosts.md). 15 - 16 - Another convenient difference is that it is possible to use 17 - [nvfetcher](https://github.com/berberman/nvfetcher) to keep packages up to 18 - date. 19 - This is best understood by the simple example below. 20 - 21 - ## Example 22 - It is possible to specify sources separately to keep them up to date semi 23 - automatically. 24 - The basic rules are specified in pkgs/sources.toml: 25 - ```toml 26 - # nvfetcher.toml 27 - [libinih] 28 - src.github = "benhoyt/inih" 29 - fetch.github = "benhoyt/inih" 30 - ``` 31 - After changes to this file as well as to update the packages specified in there run 32 - nvfetcher (for more details see [nvfetcher](https://github.com/berberman/nvfetcher)). 33 - 34 - The pkgs overlay is managed in 35 - pkgs/default.nix: 36 - ```nix 37 - final: prev: { 38 - # keep sources first, this makes sources available to the pkgs 39 - sources = prev.callPackage (import ./_sources/generated.nix) { }; 40 - 41 - # then, call packages with `final.callPackage` 42 - libinih = prev.callPackage ./development/libraries/libinih { }; 43 - } 44 - ``` 45 - 46 - Lastly the example package is in 47 - pkgs/development/libraries/libinih/default.nix: 48 - ```nix 49 - { stdenv, meson, ninja, lib, sources, ... }: 50 - stdenv.mkDerivation { 51 - pname = "libinih"; 52 - 53 - # version will resolve to the latest available on gitub 54 - inherit (sources.libinih) version src; 55 - 56 - buildInputs = [ meson ninja ]; 57 - 58 - # ... 59 - } 60 - ``` 61 - 62 - 63 - ## Migration from flake based approach 64 - 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. 65 - In order to switch to the new system, rewrite pkgs/flake.nix to a pkgs/sources.toml file using the documentation of nvfetcher, 66 - add the line that calls the sources at the beginning of pkgs/default.nix, and 67 - accomodate the small changes in the packages as can be seen from the example. 68 - 69 - The example package looked like: 70 - 71 - pkgs/flake.nix: 72 - ```nix 73 - { 74 - description = "Package sources"; 75 - 76 - inputs = { 77 - libinih.url = "github:benhoyt/inih/r53"; 78 - libinih.flake = false; 79 - }; 80 - } 81 - ``` 82 - 83 - pkgs/default.nix: 84 - ```nix 85 - final: prev: { 86 - # then, call packages with `final.callPackage` 87 - libinih = prev.callPackage ./development/libraries/libinih { }; 88 - } 89 - ``` 90 - 91 - pkgs/development/libraries/libinih/default.nix: 92 - ```nix 93 - { stdenv, meson, ninja, lib, srcs, ... }: 94 - let inherit (srcs) libinih; in 95 - stdenv.mkDerivation { 96 - pname = "libinih"; 97 - 98 - # version will resolve to 53, as specified in the flake.nix file 99 - inherit (libinih) version; 100 - 101 - src = libinih; 102 - 103 - buildInputs = [ meson ninja ]; 104 - 105 - # ... 106 - } 107 - ``` 108 - 109 - [pkgs]: https://github.com/NixOS/nixpkgs/tree/master/pkgs
-110
doc/secrets.md
··· 1 - # Secrets 2 - Secrets are managed using [git-crypt][git-crypt] and [agenix][agenix] 3 - so you can keep your flake in a public repository like GitHub without 4 - exposing your password or other sensitive data. 5 - 6 - By default, everything in the secrets folder is automatically encrypted. Just 7 - be sure to run `git-crypt init` before putting anything in here. 8 - 9 - ## Agenix 10 - Currently, there is [no mechanism][secrets-issue] in nix itself to deploy secrets 11 - within the nix store because it is world-readable. 12 - 13 - Most NixOS modules have the ability to set options to files in the system, outside 14 - the nix store, that contain sensitive information. You can use [agenix][agenix] 15 - to easily setup those secret files declaratively. 16 - 17 - [agenix][agenix] encrypts secrets and stores them as .age files in your repository. 18 - Age files are encrypted with multiple ssh public keys, so any host or user with a 19 - matching ssh private key can read the data. The [age module][age module] will add those 20 - encrypted files to the nix store and decrypt them on activation to `/run/secrets`. 21 - 22 - ### Setup 23 - All hosts must have openssh enabled, this is done by default in the core profile. 24 - 25 - You need to populate your `secrets/secrets.nix` with the proper ssh public keys. 26 - Be extra careful to make sure you only add public keys, you should never share a 27 - private key!! 28 - 29 - secrets/secrets.nix: 30 - ```nix 31 - let 32 - system = "<system ssh key>"; 33 - user = "<user ssh key>"; 34 - allKeys = [ system user ]; 35 - in 36 - ``` 37 - 38 - On most systems, you can get your systems ssh public key from `/etc/ssh/ssh_host_ed25519_key.pub`. If 39 - this file doesn't exist you likely need to enable openssh and rebuild your system. 40 - 41 - Your users ssh public key is probably stored in `~/.ssh/id_ed25519.pub` or 42 - `~/.ssh/id_rsa.pub`. If you haven't generated a ssh key yet, be sure do so: 43 - ```sh 44 - ssh-keygen -t ed25519 45 - ``` 46 - 47 - > ##### _Note:_ 48 - > The underlying tool used by agenix, rage, doesn't work well with password protected 49 - > ssh keys. So if you have lots of secrets you might have to type in your password many 50 - > times. 51 - 52 - 53 - ### Secrets 54 - You will need the `agenix` command to create secrets. DevOS conveniently provides that 55 - in the devShell, so just run `nix develop` whenever you want to edit secrets. Make sure 56 - to always run `agenix` while in the `secrets/` folder, so it can pick up your `secrets.nix`. 57 - 58 - To create secrets, simply add lines to your `secrets/secrets.nix`: 59 - ``` 60 - let 61 - ... 62 - allKeys = [ system user ]; 63 - in 64 - { 65 - "secret.age".publicKeys = allKeys; 66 - } 67 - ``` 68 - That would tell agenix to create a `secret.age` file that is encrypted with the `system` 69 - and `user` ssh public key. 70 - 71 - Then go into the `secrets` folder and run: 72 - ```sh 73 - agenix -e secret.age 74 - ``` 75 - This will create the `secret.age`, if it doesn't already exist, and allow you to edit it. 76 - 77 - If you ever change the `publicKeys` entry of any secret make sure to rekey the secrets: 78 - ```sh 79 - agenix --rekey 80 - ``` 81 - 82 - ### Usage 83 - Once you have your secret file encrypted and ready to use, you can utilize the [age module][age module] 84 - to ensure that your secrets end up in `/run/secrets`. 85 - 86 - In any profile that uses a NixOS module that requires a secret you can enable a particular secret like so: 87 - 88 - ```nix 89 - { self, ... }: 90 - { 91 - age.secrets.mysecret.file = "${self}/secrets/mysecret.age"; 92 - } 93 - ``` 94 - 95 - 96 - Then you can just pass the path `/run/secrets/mysecret` to the module. 97 - 98 - You can make use of the many options provided by the age module to customize where and how 99 - secrets get decrypted. You can learn about them by looking at the 100 - [age module][age module]. 101 - 102 - 103 - > ##### _Note:_ 104 - > You can take a look at the [agenix repository][agenix] for more information 105 - > about the tool. 106 - 107 - [git-crypt]: https://github.com/AGWA/git-crypt 108 - [agenix]: https://github.com/ryantm/agenix 109 - [age module]: https://github.com/ryantm/agenix/blob/master/modules/age.nix 110 - [secrets-issue]: https://github.com/NixOS/nix/issues/8
-102
doc/start/bootstrapping.md
··· 1 - # Bootstrapping 2 - 3 - This will help you boostrap a bare host with the help of the 4 - [bespoke iso](./iso.md) live installer. 5 - 6 - _Note: nothing prevents you from remotely executing the boostrapping 7 - process. See below._ 8 - 9 - Once your target host has booted into the live iso, you need to partion 10 - and format your disk according to the [official manual][manual]. 11 - 12 - ## Mount partitions 13 - 14 - Then properly mount the formatted partitions at `/mnt`, so that you can 15 - install your system to those new partitions. 16 - 17 - Mount `nixos` partition to `/mnt` and &mdash; for UEFI &mdash; `boot` 18 - partition to `/mnt/boot`: 19 - 20 - ```console 21 - $ mount /dev/disk/by-label/nixos /mnt 22 - $ mkdir -p /mnt/boot && mount /dev/disk/by-label/boot /mnt/boot # UEFI only 23 - $ swapon /dev/disk/by-label/swap 24 - ``` 25 - 26 - Add some extra space to the store. In the iso, it's running on a tmpfs 27 - off your RAM: 28 - ```console 29 - $ mkdir -p /mnt/tmpstore/{work,store} 30 - $ mount -t overlay overlay -olowerdir=/nix/store,upperdir=/mnt/tmpstore/store,workdir=/mnt/tmpstore/work /nix/store 31 - ``` 32 - 33 - ## Install 34 - 35 - Install off of a copy of devos from the time the iso was built: 36 - 37 - ```console 38 - $ cd /iso/devos 39 - $ nixos-install --flake .#NixOS 40 - ``` 41 - 42 - ## Notes of interest 43 - 44 - ### Remote access to the live installer 45 - 46 - The iso live installer comes preconfigured with a network configuration 47 - which announces it's hostname via [MulticastDNS][mDNS] as `hostname.local`, 48 - that is `bootstrap.local` in the [iso example](./iso). 49 - 50 - In the rare case that [MulticastDNS][mDNS] is not availabe or turned off 51 - in your network, there is a static link-local IPv6 address configured to 52 - `fe80::47`(mnemonic from the letter's position in the english alphabet: 53 - `n=14 i=9 x=24; 47 = n+i+x`). 54 - 55 - Provided that you have added your public key to the authorized keys of the 56 - `root` user _(hint: [`deploy-rs`](../integrations/deploy.md) needs passwordless 57 - sudo access)_: 58 - 59 - ```nix 60 - { ... }: 61 - { 62 - users.users.root.openssh.authorizedKeys.keyFiles = [ 63 - ../secrets/path/to/key.pub 64 - ]; 65 - } 66 - ``` 67 - 68 - You can then ssh into the live installer through one of the 69 - following options: 70 - 71 - ```console 72 - ssh root@bootstrap.local 73 - 74 - ssh root@fe80::47%eno1 # where eno1 is your network interface on which you are linked to the target 75 - ``` 76 - 77 - _Note: the [static link-local IPv6 address][staticLLA] and [MulticastDNS][mDNS] is only 78 - configured on the live installer. If you wish to enable [MulticastDNS][mDNS] 79 - for your environment, you ought to configure that in a regular [profile](../concepts/profiles.md)._ 80 - 81 - ### EUI-64 LLA & Host Identity 82 - 83 - The iso's IPv6 Link Local Address (LLA) is configured with a static 64-bit Extended 84 - Unique Identifiers (EUI-64) that is derived from the host interface's Message 85 - Authentication Code (MAC) address. 86 - 87 - After a little while (a few seconds), you can remotely discover this unique and host 88 - specific address over [NDP][NDP] for example with: 89 - 90 - ```console 91 - ip -6 neigh show # also shows fe80::47 92 - ``` 93 - 94 - ***This LLA is stable for the host, unless you need to swap that particular network card.*** 95 - Under this reservation, though, you may use this EUI-64 to wire up a specific 96 - (cryptographic) host identity. 97 - 98 - 99 - [manual]: https://nixos.org/manual/nixos/stable/index.html#sec-installation-partitioning 100 - [mDNS]: https://en.wikipedia.org/wiki/Multicast_DNS 101 - [NDP]: https://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol 102 - [staticLLA]: https://tools.ietf.org/html/rfc7404
-54
doc/start/from-nixos.md
··· 1 - # From NixOS 2 - 3 - ## Generate Configuration 4 - Assuming you're happy with your existing partition layout, you can generate a 5 - basic NixOS configuration for your system using: 6 - ```sh 7 - bud up 8 - ``` 9 - 10 - This will make a new file `hosts/up-$(hostname).nix`, which you can edit to 11 - your liking. 12 - 13 - You must then add a host to `nixos.hosts` in flake.nix: 14 - ```nix 15 - { 16 - nixos.hosts = { 17 - modules = hosts/NixOS.nix; 18 - }; 19 - } 20 - ``` 21 - 22 - Make sure your `i18n.defaultLocale` and `time.timeZone` are set properly for 23 - your region. Keep in mind that `networking.hostName` will be automatically 24 - set to the name of your host; 25 - 26 - Now might be a good time to read the docs on [suites](../concepts/suites.md) and 27 - [profiles](../concepts/profiles.md) and add or create any that you need. 28 - 29 - > ##### _Note:_ 30 - > While the `up` sub-command is provided as a convenience to quickly set up and 31 - > install a "fresh" NixOS system on current hardware, committing these files is 32 - > discouraged. 33 - > 34 - > They are placed in the git staging area automatically because they would be 35 - > invisible to the flake otherwise, but it is best to move what you need from 36 - > them directly into a host module of your own making, and commit that instead. 37 - # Installation 38 - 39 - Once you're ready to deploy `hosts/my-host.nix`: 40 - ```sh 41 - bud my-host switch 42 - ``` 43 - 44 - 45 - This calls `nixos-rebuild` with sudo to build and install your configuration. 46 - 47 - > ##### _Notes:_ 48 - > - Instead of `switch`, you can pass `build`, `test`, `boot`, etc just as with 49 - > `nixos-rebuild`. 50 - > 51 - > - It is convenient to have the template living at `/etc/nixos` so you can 52 - > simply `sudo nixos-rebuild switch` from anywhere on the system, but it is 53 - > not required. 54 -
-41
doc/start/index.md
··· 1 - # Quick Start 2 - The only dependency is nix, so make sure you have it [installed][install-nix]. 3 - 4 - ## Get the Template 5 - Here is a snippet that will get you the template without the git history: 6 - ```sh 7 - nix-shell -p cachix --run "cachix use nrdxp" 8 - 9 - nix-shell https://github.com/divnix/devos/archive/main.tar.gz -A shell \ 10 - --run "bud get main" 11 - 12 - cd devos 13 - 14 - nix-shell 15 - 16 - git init 17 - git add . 18 - git commit -m init 19 - ``` 20 - 21 - This will place you in a new folder named `devos` with git initialized, and a 22 - nix-shell that provides all the dependencies, including the unstable nix 23 - version required. 24 - 25 - In addition, the [binary cache](../integrations/cachix.md) is added for faster deployment. 26 - 27 - > ##### _Notes:_ 28 - > - Flakes ignore files that have not been added to git, so be sure to stage new 29 - > files before building the system. 30 - > - You can choose to simply clone the repo with git if you want to follow 31 - > upstream changes. 32 - > - If the `nix-shell -p cachix --run "cachix use nrdxp"` line doesn't work 33 - > you can try with sudo: `sudo nix-shell -p cachix --run "cachix use nrdxp"` 34 - 35 - ## Next Steps: 36 - - [Make installable ISO](./iso.md) 37 - - [Bootstrap Host](./bootstrapping.md) 38 - - [Already on NixOS](./from-nixos.md) 39 - 40 - 41 - [install-nix]: https://nixos.org/manual/nix/stable/#sect-multi-user-installation
-22
doc/start/iso.md
··· 1 - # ISO 2 - 3 - Making and writing an installable iso for `hosts/bootstrap.nix` is as simple as: 4 - ```sh 5 - bud build bootstrap bootstrapIso 6 - sudo -E $(which bud) burn 7 - ``` 8 - 9 - This works for any host. 10 - 11 - ## ISO image nix store & cache 12 - 13 - The iso image holds the store to the live environment and _also_ acts as a binary cache 14 - to the installer. To considerably speed up things, the image already includes all flake 15 - `inputs` as well as the `devshell` closures. 16 - 17 - While you _could_ provision any machine with a single stick, a custom-made iso for 18 - the host you want to install DevOS to, maximises those local cache hits. 19 - 20 - For hosts that don't differ too much, a single usb stick might be ok, whereas when 21 - there are bigger differences, a custom-made usb stick will be considerably faster. 22 -
-33
doc/tests.md
··· 1 - # Testing 2 - 3 - Testing is always an important aspect of any software development project, and 4 - NixOS offers some incredibly powerful tools to write tests for your 5 - configuration, and, optionally, run them in 6 - [CI](./integrations/hercules.md). 7 - 8 - ## Unit Tests 9 - Unit tests can be created from regular derivations, and they can do 10 - almost anything you can imagine. By convention, it is best to test your 11 - packages during their [check phase][check]. All packages and their tests will 12 - be built during CI. 13 - 14 - ## Integration Tests 15 - All your profiles defined in suites will be tested in a NixOS VM. 16 - 17 - You can write integration tests for one or more NixOS VMs that can, 18 - optionally, be networked together, and yes, it's as awesome as it sounds! 19 - 20 - Be sure to use the `mkTest` function from digga, `digga.lib.pkgs-lib.mkTest` 21 - which wraps the official [testing-python][testing-python] function to ensure 22 - that the system is setup exactly as it is for a bare DevOS system. There are 23 - already great resources for learning how to use these tests effectively, 24 - including the official [docs][test-doc], a fantastic [blog post][test-blog], 25 - and the examples in [nixpkgs][nixos-tests]. 26 - 27 - [test-doc]: https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests 28 - [test-blog]: https://www.haskellforall.com/2020/11/how-to-use-nixos-for-lightweight.html 29 - [default]: https://github.com/divnix/devos/tree/main/tests/default.nix 30 - [run-test]: https://github.com/NixOS/nixpkgs/blob/6571462647d7316aff8b8597ecdf5922547bf365/lib/debug.nix#L154-L166 31 - [nixos-tests]: https://github.com/NixOS/nixpkgs/tree/master/nixos/tests 32 - [testing-python]: https://github.com/NixOS/nixpkgs/tree/master/nixos/lib/testing-python.nix 33 - [check]: https://nixos.org/manual/nixpkgs/stable/#ssec-check-phase
-6
doc/theme/highlight.js
··· 1 - /* 2 - Highlight.js 10.1.2 (edd73d24) 3 - License: BSD-3-Clause 4 - Copyright (c) 2006-2020, Ivan Sagalaev 5 - */ 6 - 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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}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<n[0].offset?e:n:"start"===n[0].event?e:n:e.length?e:n}function c(e){s+="<"+a(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+t(e.value)+'"'})).join("")+">"}function u(e){s+="</"+a(e)+">"}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="</span>",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+=`<span class="${e}">`}}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||"<unnamed>")+'"');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;i<e.length;i++){var s=r+=1,o=d(e[i]);for(i>0&&(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?"<br>":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(/<br[ /]*>/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:/</,relevance:0,contains:[{className:"attr",begin:"[A-Za-z0-9\\._:-]+",relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[n]},{begin:/'/,end:/'/,contains:[n]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:"<![a-z]",end:">",relevance:10,contains:[a,i,t,s,{begin:"\\[",end:"\\]",contains:[{className:"meta",begin:"<![a-z]",end:">",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:"<style(?=\\s|>)",end:">",keywords:{name:"style"},contains:[c],starts:{end:"</style>",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:"<script(?=\\s|>)",end:">",keywords:{name:"script"},contains:[c],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:"</?",end:"/?>",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)\(/}]}}}());
+209 -176
flake.lock
··· 8 8 ] 9 9 }, 10 10 "locked": { 11 - "lastModified": 1646360966, 12 - "narHash": "sha256-fJ/WHSU45bMJRDqz9yA3B2lwXtW5DKooU+Pzn13GyZI=", 11 + "lastModified": 1649191071, 12 + "narHash": "sha256-35hEJuMvRswOPKb9lbB9ZuHVe0eJN6WJc4T8Frn0hYQ=", 13 13 "owner": "kamadorueda", 14 14 "repo": "alejandra", 15 - "rev": "511c3f6a88b6964e1496fb6f441f4ae5e58bd3ea", 15 + "rev": "3d3f24127a8e2b28998a81c444f8b4b4f11da6c6", 16 16 "type": "github" 17 17 }, 18 18 "original": { ··· 21 21 "type": "github" 22 22 } 23 23 }, 24 - "blank": { 25 - "locked": { 26 - "lastModified": 1625557891, 27 - "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", 28 - "owner": "divnix", 29 - "repo": "blank", 30 - "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", 31 - "type": "github" 32 - }, 33 - "original": { 34 - "owner": "divnix", 35 - "repo": "blank", 36 - "type": "github" 37 - } 38 - }, 39 24 "cachix": { 40 25 "locked": { 41 26 "lastModified": 1642244250, ··· 52 37 "type": "github" 53 38 } 54 39 }, 55 - "deploy": { 56 - "inputs": { 57 - "flake-compat": "flake-compat", 58 - "nixpkgs": [ 59 - "digga", 60 - "latest" 61 - ], 62 - "utils": "utils" 63 - }, 40 + "crane": { 41 + "flake": false, 64 42 "locked": { 65 - "lastModified": 1632822684, 66 - "narHash": "sha256-lt7eayYmgsD5OQwpb1XYfHpxttn43bWo7G7hIJs+zJw=", 67 - "owner": "serokell", 68 - "repo": "deploy-rs", 69 - "rev": "9a02de4373e0ec272d08a417b269a28ac8b961b4", 43 + "lastModified": 1644785799, 44 + "narHash": "sha256-VpAJO1L0XeBvtCuNGK4IDKp6ENHIpTrlaZT7yfBCvwo=", 45 + "owner": "ipetkov", 46 + "repo": "crane", 47 + "rev": "fc7a94f841347c88f2cb44217b2a3faa93e2a0b2", 70 48 "type": "github" 71 49 }, 72 50 "original": { 73 - "owner": "serokell", 74 - "repo": "deploy-rs", 51 + "owner": "ipetkov", 52 + "repo": "crane", 75 53 "type": "github" 76 54 } 77 55 }, 78 56 "devshell": { 57 + "inputs": { 58 + "flake-utils": "flake-utils_2", 59 + "nixpkgs": [ 60 + "nixCargoIntegration", 61 + "nixpkgs" 62 + ] 63 + }, 79 64 "locked": { 80 - "lastModified": 1637575296, 81 - "narHash": "sha256-ZY8YR5u8aglZPe27+AJMnPTG6645WuavB+w0xmhTarw=", 65 + "lastModified": 1647857022, 66 + "narHash": "sha256-Aw70NWLOIwKhT60MHDGjgWis3DP3faCzr6ap9CSayek=", 82 67 "owner": "numtide", 83 68 "repo": "devshell", 84 - "rev": "0e56ef21ba1a717169953122c7415fa6a8cd2618", 69 + "rev": "0a5ff74dacb9ea22614f64e61aeb3ca0bf0e7311", 85 70 "type": "github" 86 71 }, 87 72 "original": { ··· 90 75 "type": "github" 91 76 } 92 77 }, 93 - "digga": { 78 + "dream2nix": { 94 79 "inputs": { 95 - "blank": "blank", 96 - "deploy": "deploy", 97 - "devshell": "devshell", 98 - "flake-utils-plus": "flake-utils-plus", 99 - "home-manager": [ 100 - "home" 80 + "alejandra": [ 81 + "nixCargoIntegration", 82 + "nixpkgs" 101 83 ], 102 - "latest": "latest", 103 - "nixlib": [ 104 - "nixos" 84 + "crane": "crane", 85 + "flake-utils-pre-commit": [ 86 + "nixCargoIntegration", 87 + "nixpkgs" 105 88 ], 106 - "nixos-generators": "nixos-generators", 89 + "gomod2nix": [ 90 + "nixCargoIntegration", 91 + "nixpkgs" 92 + ], 93 + "mach-nix": [ 94 + "nixCargoIntegration", 95 + "nixpkgs" 96 + ], 107 97 "nixpkgs": [ 108 - "nixos" 98 + "nixCargoIntegration", 99 + "nixpkgs" 100 + ], 101 + "node2nix": [ 102 + "nixCargoIntegration", 103 + "nixpkgs" 104 + ], 105 + "poetry2nix": [ 106 + "nixCargoIntegration", 107 + "nixpkgs" 108 + ], 109 + "pre-commit-hooks": [ 110 + "nixCargoIntegration", 111 + "nixpkgs" 109 112 ] 110 113 }, 111 114 "locked": { 112 - "lastModified": 1643510242, 113 - "narHash": "sha256-9C9DyJhQ5bevk0CEEjGct+U9EqUgHg8T70nxz47zjMI=", 114 - "owner": "divnix", 115 - "repo": "digga", 116 - "rev": "33bfb05b8a148d8ad6a842de74e22209bf9fe5d7", 115 + "lastModified": 1649088506, 116 + "narHash": "sha256-rIpLWnomSDYlaZfQiXs4Ui3EqmiY6d9qEkIY/vzZg6s=", 117 + "owner": "nix-community", 118 + "repo": "dream2nix", 119 + "rev": "84135ea205bcc04648fcc7776261e1dcb6e78ceb", 117 120 "type": "github" 118 121 }, 119 122 "original": { 120 - "owner": "divnix", 121 - "ref": "main", 122 - "repo": "digga", 123 + "owner": "nix-community", 124 + "repo": "dream2nix", 123 125 "type": "github" 124 126 } 125 127 }, 126 128 "flake-compat": { 127 129 "flake": false, 128 130 "locked": { 129 - "lastModified": 1627913399, 130 - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", 131 + "lastModified": 1641205782, 132 + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", 131 133 "owner": "edolstra", 132 134 "repo": "flake-compat", 133 - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", 135 + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", 134 136 "type": "github" 135 137 }, 136 138 "original": { ··· 139 141 "type": "github" 140 142 } 141 143 }, 142 - "flake-compat_2": { 143 - "flake": false, 144 + "flake-utils": { 144 145 "locked": { 145 - "lastModified": 1641205782, 146 - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", 147 - "owner": "edolstra", 148 - "repo": "flake-compat", 149 - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", 146 + "lastModified": 1644229661, 147 + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", 148 + "owner": "numtide", 149 + "repo": "flake-utils", 150 + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", 150 151 "type": "github" 151 152 }, 152 153 "original": { 153 - "owner": "edolstra", 154 - "repo": "flake-compat", 154 + "owner": "numtide", 155 + "repo": "flake-utils", 155 156 "type": "github" 156 157 } 157 158 }, 158 - "flake-utils": { 159 + "flake-utils_2": { 159 160 "locked": { 160 - "lastModified": 1638122382, 161 - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", 161 + "lastModified": 1642700792, 162 + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", 162 163 "owner": "numtide", 163 164 "repo": "flake-utils", 164 - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", 165 + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", 165 166 "type": "github" 166 167 }, 167 168 "original": { ··· 170 171 "type": "github" 171 172 } 172 173 }, 173 - "flake-utils-plus": { 174 - "inputs": { 175 - "flake-utils": "flake-utils" 176 - }, 174 + "flake-utils_3": { 177 175 "locked": { 178 - "lastModified": 1639385028, 179 - "narHash": "sha256-oqorKz3mwf7UuDJwlbCEYCB2LfcWLL0DkeCWhRIL820=", 180 - "owner": "gytis-ivaskevicius", 181 - "repo": "flake-utils-plus", 182 - "rev": "be1be083af014720c14f3b574f57b6173b4915d0", 176 + "lastModified": 1637014545, 177 + "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", 178 + "owner": "numtide", 179 + "repo": "flake-utils", 180 + "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", 183 181 "type": "github" 184 182 }, 185 183 "original": { 186 - "owner": "gytis-ivaskevicius", 187 - "repo": "flake-utils-plus", 184 + "owner": "numtide", 185 + "repo": "flake-utils", 188 186 "type": "github" 189 187 } 190 188 }, 191 189 "flakeCompat": { 192 190 "flake": false, 193 191 "locked": { 194 - "lastModified": 1641205782, 195 - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", 192 + "lastModified": 1648199409, 193 + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", 196 194 "owner": "edolstra", 197 195 "repo": "flake-compat", 198 - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", 196 + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", 199 197 "type": "github" 200 198 }, 201 199 "original": { ··· 204 202 "type": "github" 205 203 } 206 204 }, 207 - "home": { 205 + "fup": { 208 206 "inputs": { 207 + "flake-utils": "flake-utils" 208 + }, 209 + "locked": { 210 + "lastModified": 1647259887, 211 + "narHash": "sha256-yEkMbEHVO9qydluQ3uHGWX1PkfZhgDKxnd1rhZYZ72w=", 212 + "owner": "gytis-ivaskevicius", 213 + "repo": "flake-utils-plus", 214 + "rev": "06dba5f3b4fa2cc0bfc98ce9cd6f9a4d8db11d46", 215 + "type": "github" 216 + }, 217 + "original": { 218 + "owner": "gytis-ivaskevicius", 219 + "repo": "flake-utils-plus", 220 + "type": "github" 221 + } 222 + }, 223 + "helix": { 224 + "inputs": { 225 + "nixCargoIntegration": [ 226 + "nixCargoIntegration" 227 + ], 209 228 "nixpkgs": [ 210 229 "nixos" 230 + ], 231 + "rust-overlay": [ 232 + "rust-overlay" 211 233 ] 212 234 }, 213 235 "locked": { 214 - "lastModified": 1645746341, 215 - "narHash": "sha256-j4fTWByYMGSSl0P7HEJQmbU/ifJtW25n/SoF6hgXN8c=", 216 - "owner": "nix-community", 217 - "repo": "home-manager", 218 - "rev": "650cfe60f31f3d27ba869bf7db12ca8ded5f1d74", 236 + "lastModified": 1649456512, 237 + "narHash": "sha256-evrtUI3NkwEhQGJmRPnDqvoYex3SnH9NAxgCLJw2v3s=", 238 + "owner": "helix-editor", 239 + "repo": "helix", 240 + "rev": "7779dbfcb847e9aa20e01ae0f8354c3c0de38fe3", 219 241 "type": "github" 220 242 }, 221 243 "original": { 222 - "owner": "nix-community", 223 - "ref": "master", 224 - "repo": "home-manager", 244 + "owner": "helix-editor", 245 + "repo": "helix", 225 246 "type": "github" 226 247 } 227 248 }, 228 - "latest": { 249 + "home": { 250 + "inputs": { 251 + "nixpkgs": [ 252 + "nixos" 253 + ] 254 + }, 229 255 "locked": { 230 - "lastModified": 1638198142, 231 - "narHash": "sha256-plU9b8r4St6q4U7VHtG9V7oF8k9fIpfXl/KDaZLuY9k=", 232 - "owner": "nixos", 233 - "repo": "nixpkgs", 234 - "rev": "8a308775674e178495767df90c419425474582a1", 256 + "lastModified": 1648834319, 257 + "narHash": "sha256-i5Aj4Aw64D/A0X6XW5LxSS4XBnYj7gMz+kN4dpsbdk8=", 258 + "owner": "nix-community", 259 + "repo": "home-manager", 260 + "rev": "0bdbdea2e26c984b096f4f7d10e3c88536a980b0", 235 261 "type": "github" 236 262 }, 237 263 "original": { 238 - "owner": "nixos", 239 - "ref": "nixos-unstable", 240 - "repo": "nixpkgs", 264 + "owner": "nix-community", 265 + "ref": "release-21.11", 266 + "repo": "home-manager", 241 267 "type": "github" 242 268 } 243 269 }, ··· 248 274 ] 249 275 }, 250 276 "locked": { 251 - "lastModified": 1639947939, 252 - "narHash": "sha256-pGsM8haJadVP80GFq4xhnSpNitYNQpaXk4cnA796Cso=", 277 + "lastModified": 1649096192, 278 + "narHash": "sha256-7O8e+eZEYeU+ET98u/zW5epuoN/xYx9G+CIh4DjZVzY=", 253 279 "owner": "nmattia", 254 280 "repo": "naersk", 255 - "rev": "2fc8ce9d3c025d59fee349c1f80be9785049d653", 281 + "rev": "d626f73332a8f587b613b0afe7293dd0777be07d", 256 282 "type": "github" 257 283 }, 258 284 "original": { ··· 261 287 "type": "github" 262 288 } 263 289 }, 264 - "nixlib": { 290 + "nixCargoIntegration": { 291 + "inputs": { 292 + "devshell": "devshell", 293 + "dream2nix": "dream2nix", 294 + "nixpkgs": [ 295 + "nixos" 296 + ], 297 + "rustOverlay": [ 298 + "rust-overlay" 299 + ] 300 + }, 265 301 "locked": { 266 - "lastModified": 1641688481, 267 - "narHash": "sha256-6L+EU12xLDHby7y8elgFtRKVBxix+7qV8DhVgXqrKZo=", 268 - "owner": "nix-community", 269 - "repo": "nixpkgs.lib", 270 - "rev": "f697717b3d3a074ffc16c8c8227504f0db292886", 302 + "lastModified": 1649398335, 303 + "narHash": "sha256-SjE4w4kcg3NphapPwBMiIdZDLvVqEf9+IfIskQMd4OY=", 304 + "owner": "yusdacra", 305 + "repo": "nix-cargo-integration", 306 + "rev": "791bf70e720869431479bd4f2133e466b13fe088", 271 307 "type": "github" 272 308 }, 273 309 "original": { 274 - "owner": "nix-community", 275 - "repo": "nixpkgs.lib", 310 + "owner": "yusdacra", 311 + "repo": "nix-cargo-integration", 276 312 "type": "github" 277 313 } 278 314 }, 279 315 "nixos": { 280 316 "locked": { 281 - "lastModified": 1645433236, 282 - "narHash": "sha256-4va4MvJ076XyPp5h8sm5eMQvCrJ6yZAbBmyw95dGyw4=", 317 + "lastModified": 1649225869, 318 + "narHash": "sha256-u1zLtPmQzhT9mNXyM8Ey9pk7orDrIKdwooeGDEXm5xM=", 283 319 "owner": "nixos", 284 320 "repo": "nixpkgs", 285 - "rev": "7f9b6e2babf232412682c09e57ed666d8f84ac2d", 321 + "rev": "b6966d911da89e5a7301aaef8b4f0a44c77e103c", 286 322 "type": "github" 287 323 }, 288 324 "original": { ··· 292 328 "type": "github" 293 329 } 294 330 }, 295 - "nixos-generators": { 296 - "inputs": { 297 - "nixlib": "nixlib", 298 - "nixpkgs": [ 299 - "digga", 300 - "blank" 301 - ] 302 - }, 303 - "locked": { 304 - "lastModified": 1637655461, 305 - "narHash": "sha256-kXZPbclN3gKwjhp2/RYFDFpAsSBwzX1iLF4EcnHZsPQ=", 306 - "owner": "nix-community", 307 - "repo": "nixos-generators", 308 - "rev": "05a3eb158a9c7746a5d463726d7f7cccf07500e4", 309 - "type": "github" 310 - }, 311 - "original": { 312 - "owner": "nix-community", 313 - "repo": "nixos-generators", 314 - "type": "github" 315 - } 316 - }, 317 - "nixos-hardware": { 331 + "nixosHardware": { 318 332 "locked": { 319 - "lastModified": 1645346782, 320 - "narHash": "sha256-3qd0cu+2kapIP7cdHW9n8zh1wCvRGg83K7/cCj5Xv+A=", 333 + "lastModified": 1649401245, 334 + "narHash": "sha256-mce0dpugKD9qgFgzloE2yoYJRD6Bvsy2QDzODpXMsss=", 321 335 "owner": "nixos", 322 336 "repo": "nixos-hardware", 323 - "rev": "1ccfe243aa6e94bf80f2a66f6be41d086d37fc87", 337 + "rev": "ddeb6a0aa430914674d6f0bc1646cf11e799a5bb", 324 338 "type": "github" 325 339 }, 326 340 "original": { ··· 331 345 }, 332 346 "nixosPersistence": { 333 347 "locked": { 334 - "lastModified": 1644791231, 335 - "narHash": "sha256-iDihsF1fUMK4xXiUudPnDM3veH1LXbbxfP9Lzekw9iU=", 348 + "lastModified": 1646131459, 349 + "narHash": "sha256-GPmgxvUFvQ1GmsGfWHy9+rcxWrczeDhS9XnAIPHi9XQ=", 336 350 "owner": "nix-community", 337 351 "repo": "impermanence", 338 - "rev": "635bcd2d88739197a0b584aa9fadaa53c717a853", 352 + "rev": "2f39baeb7d039fda5fc8225111bb79474138e6f4", 339 353 "type": "github" 340 354 }, 341 355 "original": { ··· 344 358 "type": "github" 345 359 } 346 360 }, 361 + "nixpkgs": { 362 + "locked": { 363 + "lastModified": 1645433236, 364 + "narHash": "sha256-4va4MvJ076XyPp5h8sm5eMQvCrJ6yZAbBmyw95dGyw4=", 365 + "owner": "nixos", 366 + "repo": "nixpkgs", 367 + "rev": "7f9b6e2babf232412682c09e57ed666d8f84ac2d", 368 + "type": "github" 369 + }, 370 + "original": { 371 + "owner": "nixos", 372 + "ref": "nixos-unstable", 373 + "repo": "nixpkgs", 374 + "type": "github" 375 + } 376 + }, 347 377 "nixpkgsWayland": { 348 378 "inputs": { 349 379 "cachix": "cachix", 350 - "flake-compat": "flake-compat_2", 351 - "nixpkgs": [ 352 - "nixos" 353 - ] 380 + "flake-compat": "flake-compat", 381 + "nixpkgs": "nixpkgs" 354 382 }, 355 383 "locked": { 356 - "lastModified": 1645727284, 357 384 "narHash": "sha256-xwi46ruR5z4THe967gzW74dQhPmlS5FWSiWuo9aYquY=", 358 - "owner": "colemickens", 359 - "repo": "nixpkgs-wayland", 360 - "rev": "ddd6f194eed2779df5730e702cecda28bd8938df", 361 - "type": "github" 385 + "path": "/nix/store/23by5yfsvzynznfjk2kjwn1gpb231fl9-source", 386 + "type": "path" 362 387 }, 363 388 "original": { 364 - "owner": "colemickens", 365 - "repo": "nixpkgs-wayland", 366 - "type": "github" 389 + "id": "nixpkgsWayland", 390 + "type": "indirect" 367 391 } 368 392 }, 369 393 "rnixLsp": { ··· 374 398 "nixpkgs": [ 375 399 "nixos" 376 400 ], 377 - "utils": "utils_2" 401 + "utils": "utils" 378 402 }, 379 403 "locked": { 380 - "lastModified": 1643586450, 381 - "narHash": "sha256-BRIAc3+zavSlJPYSbov2n1W9/a4Iuh2swFPYRWjCm1g=", 404 + "lastModified": 1647240246, 405 + "narHash": "sha256-/MLdBWfFUN1C1eNVBYfaVAIcDiZKXpWEbzBC2pqVXj0=", 382 406 "owner": "nix-community", 383 407 "repo": "rnix-lsp", 384 - "rev": "41eb2f3366e3f351bf2563c2a7c46fd17e78dfe0", 408 + "rev": "4d1024ccfe1bc569811769d1ef52a2fc6c1d482d", 385 409 "type": "github" 386 410 }, 387 411 "original": { ··· 393 417 "root": { 394 418 "inputs": { 395 419 "alejandra": "alejandra", 396 - "digga": "digga", 420 + "fup": "fup", 421 + "helix": "helix", 397 422 "home": "home", 398 423 "naersk": "naersk", 424 + "nixCargoIntegration": "nixCargoIntegration", 399 425 "nixos": "nixos", 400 - "nixos-hardware": "nixos-hardware", 426 + "nixosHardware": "nixosHardware", 401 427 "nixosPersistence": "nixosPersistence", 402 428 "nixpkgsWayland": "nixpkgsWayland", 403 - "rnixLsp": "rnixLsp" 429 + "rnixLsp": "rnixLsp", 430 + "rust-overlay": "rust-overlay" 404 431 } 405 432 }, 406 - "utils": { 433 + "rust-overlay": { 434 + "inputs": { 435 + "flake-utils": "flake-utils_3", 436 + "nixpkgs": [ 437 + "nixos" 438 + ] 439 + }, 407 440 "locked": { 408 - "lastModified": 1638122382, 409 - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", 410 - "owner": "numtide", 411 - "repo": "flake-utils", 412 - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", 441 + "lastModified": 1649447403, 442 + "narHash": "sha256-JZMYKsCxpLpPKLVjDUVmKs/bVnbcaPa8crf2uKh0lKY=", 443 + "owner": "oxalica", 444 + "repo": "rust-overlay", 445 + "rev": "44801306a2aa0e9aaa47588d615ce6df4acf18c6", 413 446 "type": "github" 414 447 }, 415 448 "original": { 416 - "owner": "numtide", 417 - "repo": "flake-utils", 449 + "owner": "oxalica", 450 + "repo": "rust-overlay", 418 451 "type": "github" 419 452 } 420 453 }, 421 - "utils_2": { 454 + "utils": { 422 455 "locked": { 423 456 "lastModified": 1638122382, 424 457 "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
+89 -99
flake.nix
··· 2 2 description = "A highly structured configuration database."; 3 3 inputs = { 4 4 nixos.url = "github:nixos/nixpkgs/nixos-unstable"; 5 - digga.url = "github:divnix/digga/main"; 6 - digga.inputs.nixpkgs.follows = "nixos"; 7 - digga.inputs.nixlib.follows = "nixos"; 8 - digga.inputs.home-manager.follows = "home"; 9 - home.url = "github:nix-community/home-manager/master"; 5 + 6 + fup.url = "github:gytis-ivaskevicius/flake-utils-plus"; 7 + 8 + home.url = "github:nix-community/home-manager/release-21.11"; 10 9 home.inputs.nixpkgs.follows = "nixos"; 10 + 11 + rust-overlay = { 12 + url = "github:oxalica/rust-overlay"; 13 + inputs.nixpkgs.follows = "nixos"; 14 + }; 11 15 naersk.url = "github:nmattia/naersk"; 12 16 naersk.inputs.nixpkgs.follows = "nixos"; 13 - nixos-hardware.url = "github:nixos/nixos-hardware"; 17 + nixCargoIntegration.url = "github:yusdacra/nix-cargo-integration"; 18 + nixCargoIntegration.inputs.nixpkgs.follows = "nixos"; 19 + nixCargoIntegration.inputs.rustOverlay.follows = "rust-overlay"; 20 + 21 + nixosHardware.url = "github:nixos/nixos-hardware"; 22 + nixosPersistence.url = "github:nix-community/impermanence"; 23 + 14 24 rnixLsp = { 15 25 url = "github:nix-community/rnix-lsp"; 16 26 inputs.naersk.follows = "naersk"; ··· 20 30 url = "github:kamadorueda/alejandra"; 21 31 inputs.nixpkgs.follows = "nixos"; 22 32 }; 23 - /* 24 - helix = { 25 - url = "https://github.com/helix-editor/helix.git"; 26 - type = "git"; 27 - submodules = true; 28 - inputs.nixpkgs.follows = "nixos"; 29 - }; 30 - */ 31 - nixosPersistence.url = "github:nix-community/impermanence"; 32 - nixpkgsWayland = { 33 - url = "github:colemickens/nixpkgs-wayland"; 33 + helix = { 34 + url = "github:helix-editor/helix"; 34 35 inputs.nixpkgs.follows = "nixos"; 36 + inputs.rust-overlay.follows = "rust-overlay"; 37 + inputs.nixCargoIntegration.follows = "nixCargoIntegration"; 35 38 }; 36 39 }; 37 40 outputs = { 38 41 self, 39 - digga, 40 - nixos, 42 + fup, 41 43 home, 42 - nixos-hardware, 44 + nixosHardware, 43 45 nixosPersistence, 44 46 nixpkgsWayland, 45 47 rnixLsp, 46 48 alejandra, 49 + helix, 50 + nixos, 47 51 ... 48 52 } @ inputs: 49 - digga.lib.mkFlake 53 + fup.lib.mkFlake 50 54 { 51 55 inherit self inputs; 52 - channelsConfig = {allowUnfree = true;}; 53 - channels = { 54 - nixos = { 55 - imports = [(digga.lib.importOverlays ./overlays)]; 56 - overlays = [ 57 - nixpkgsWayland.overlay 58 - ( 59 - _: prev: { 60 - #helix = helix.packages.${prev.system}.helix; 61 - #helix-src = prev.helix.src; 62 - #rnix-lsp = rnixLsp.packages.${prev.system}.rnix-lsp; 63 - } 64 - ) 65 - ( 66 - _: prev: { 67 - alejandra = alejandra.defaultPackage.${prev.system}; 68 - remarshal = 69 - prev.remarshal.overrideAttrs 70 - ( 71 - old: { 72 - postPatch = '' 73 - substituteInPlace pyproject.toml \ 74 - --replace "poetry.masonry.api" "poetry.core.masonry.api" \ 75 - --replace 'PyYAML = "^5.3"' 'PyYAML = "*"' \ 76 - --replace 'tomlkit = "^0.7"' 'tomlkit = "*"' 77 - ''; 78 - } 79 - ); 80 - } 81 - ) 82 - ./pkgs/default.nix 83 - ]; 84 - }; 85 - }; 86 - lib = import ./lib {lib = digga.lib // nixos.lib;}; 56 + 57 + supportedSystems = ["x86_64-linux"]; 58 + channelsConfig.allowUnfree = true; 59 + nix.generateRegistryFromInputs = true; 60 + nix.generateNixPathFromInputs = true; 61 + nix.linkInputs = true; 62 + 87 63 sharedOverlays = [ 88 - ( 89 - _: prev: { 90 - __dontExport = true; 91 - lib = prev.lib.extend (_: _: {our = self.lib;}); 92 - } 93 - ) 64 + (_: prev: { 65 + lib = prev.lib.extend (_: _: builtins); 66 + }) 67 + (_: prev: { 68 + lib = prev.lib.extend (_: l: { 69 + pkgBin = id: 70 + if l.isString id 71 + then "${prev.${id}}/bin/${id}" 72 + else "${prev.${id.name}}/bin/${id.bin}"; 73 + }); 74 + }) 94 75 ]; 95 - nixos = { 96 - hostDefaults = { 97 - system = "x86_64-linux"; 98 - channelName = "nixos"; 99 - imports = [(digga.lib.importExportableModules ./modules)]; 100 - modules = [ 101 - {lib.our = self.lib;} 102 - digga.nixosModules.bootstrapIso 103 - digga.nixosModules.nixConfig 104 - home.nixosModules.home-manager 105 - nixosPersistence.nixosModules.impermanence 106 - ]; 107 - }; 108 - imports = [(digga.lib.importHosts ./hosts)]; 109 - hosts = {}; 110 - importables = rec { 111 - profiles = 112 - (digga.lib.rakeLeaves ./profiles) 113 - // { 114 - users = digga.lib.rakeLeaves ./users; 115 - nixos-hardware = nixos-hardware.nixosModules; 116 - }; 117 - suites = with profiles; { 118 - base = [cachix core users.root]; 119 - work = [users.patriot develop]; 120 - }; 121 - }; 76 + 77 + channels.nixos = { 78 + overlays = [ 79 + ./overlays/chromium-wayland.nix 80 + ./overlays/phantom.nix 81 + ( 82 + _: prev: { 83 + helix = helix.packages.${prev.system}.helix; 84 + rnix-lsp = rnixLsp.packages.${prev.system}.rnix-lsp; 85 + alejandra = alejandra.defaultPackage.${prev.system}; 86 + } 87 + ) 88 + ]; 122 89 }; 123 - home = { 124 - imports = [(digga.lib.importExportableModules ./users/modules)]; 125 - modules = []; 126 - importables = rec { 127 - profiles = digga.lib.rakeLeaves ./users/profiles; 128 - suites = with profiles; rec {base = [direnv git starship];}; 90 + 91 + hostDefaults = { 92 + channelName = "nixos"; 93 + modules = [ 94 + home.nixosModules.home-manager 95 + ./profiles 96 + ./modules 97 + ./locale 98 + ./secrets 99 + ]; 100 + }; 101 + 102 + hosts.lungmen = { 103 + modules = with nixosHardware.nixosModules; [ 104 + nixos.nixosModules.notDetected 105 + nixosPersistence.nixosModules.impermanence 106 + common-pc-ssd 107 + common-pc 108 + common-gpu-amd 109 + common-cpu-amd 110 + ./profiles/network/networkmanager 111 + ./users/root 112 + ./users/patriot 113 + ./hosts/lungmen 114 + ]; 115 + }; 116 + 117 + outputsBuilder = channels: 118 + with channels.nixos; { 119 + devShell = mkShell { 120 + name = "prts"; 121 + buildInputs = [git git-crypt]; 122 + }; 129 123 }; 130 - }; 131 - devshell = ./shell; 132 - homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; 133 - deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations {}; 134 124 }; 135 125 }
-8
hosts/NixOS.nix
··· 1 - {suites, ...}: { 2 - ### root password is empty by default ### 3 - imports = suites.base; 4 - boot.loader.systemd-boot.enable = true; 5 - boot.loader.efi.canTouchEfiVariables = true; 6 - networking.networkmanager.enable = true; 7 - fileSystems."/" = {device = "/dev/disk/by-label/nixos";}; 8 - }
-16
hosts/bootstrap.nix
··· 1 - {profiles, ...}: { 2 - # build with: `bud build bootstrap bootstrapIso` 3 - # reachable on the local link via ssh root@fe80::47%eno1 4 - # where 'eno1' is replaced by your own machine's network 5 - # interface that has the local link to the target machine 6 - imports = [ 7 - # profiles.networking 8 - profiles.core 9 - profiles.users.root 10 - # make sure to configure ssh keys 11 - profiles.users.nixos 12 - ]; 13 - boot.loader.systemd-boot.enable = true; 14 - # will be overridden by the bootstrapIso instrumentation 15 - fileSystems."/" = {device = "/dev/disk/by-label/nixos";}; 16 - }
-9
hosts/lungmen.nix hosts/lungmen/default.nix
··· 3 3 lib, 4 4 pkgs, 5 5 modulesPath, 6 - suites, 7 - profiles, 8 6 ... 9 7 }: let 10 8 btrfsPartPath = "/dev/disk/by-label/NIXOS"; ··· 40 38 sudo umount /mnt 41 39 ''; 42 40 in { 43 - imports = 44 - suites.base 45 - ++ suites.work 46 - ++ [../profiles/network/networkmanager (modulesPath + "/installer/scan/not-detected.nix")] 47 - ++ (with profiles.nixos-hardware; [common-pc-ssd common-pc common-gpu-amd common-cpu-amd]); 48 41 boot = { 49 42 loader = { 50 43 efi.canTouchEfiVariables = true; ··· 128 121 }; 129 122 nix.settings.max-jobs = lib.mkDefault 4; 130 123 security = { 131 - mitigations.disable = true; 132 124 allowSimultaneousMultithreading = false; 133 125 # Deleting root subvolume makes sudo show lecture every boot 134 126 sudo.extraConfig = '' ··· 142 134 alsa.enable = true; 143 135 alsa.support32Bit = true; 144 136 pulse.enable = true; 145 - media-session.enable = true; 146 137 }; 147 138 hardware = { 148 139 opengl = {
-15
lib/compat/default.nix
··· 1 - let 2 - rev = "e7e5d481a0e15dcd459396e55327749989e04ce0"; 3 - flake = ( 4 - import 5 - ( 6 - fetchTarball 7 - { 8 - url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz"; 9 - sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x"; 10 - } 11 - ) 12 - {src = ../../.;} 13 - ); 14 - in 15 - flake
-8
lib/compat/nixos/default.nix
··· 1 - {...}: let 2 - inherit (default.inputs.nixos) lib; 3 - host = configs.${hostname} or configs.NixOS; 4 - configs = default.nixosConfigurations; 5 - default = (import ../.).defaultNix; 6 - hostname = lib.fileContents /etc/hostname; 7 - in 8 - host
-8
lib/default.nix
··· 1 - {lib}: 2 - lib.makeExtensible 3 - ( 4 - self: { 5 - pkgBinNoDep = pkgs: name: "${pkgs.${name}}/bin/${name}"; 6 - html = import ./html.nix {format = true;}; 7 - } 8 - )
-31
lib/html.nix
··· 1 - {format ? false}: let 2 - inherit (builtins) isAttrs isList map; 3 - fmt = 4 - if format 5 - then "\n " 6 - else ""; 7 - mapAttrsToList = f: attrs: map (name: f name attrs.${name}) (builtins.attrNames attrs); 8 - concatStrings = builtins.concatStringsSep ""; 9 - evalAttrs = attrs: concatStrings (mapAttrsToList (name: value: " ${name}=\"${value}\"") attrs); 10 - genAttrs = f: names: 11 - builtins.listToAttrs (map 12 - (n: { 13 - name = n; 14 - value = f n; 15 - }) 16 - names); 17 - evalChildren = children: 18 - if isList children 19 - then concatStrings children 20 - else children; 21 - tag = name: maybeAttrs: 22 - if isAttrs maybeAttrs 23 - then (children: "<${name}${evalAttrs maybeAttrs}>${fmt}${evalChildren children}${fmt}</${name}>") 24 - else tag name {} maybeAttrs; 25 - tags = genAttrs tag ["html" "head" "body" "div" "p" "a"]; 26 - in 27 - tags 28 - // { 29 - inherit tag; 30 - link = url: tags.a {href = url;}; 31 - }
+1 -1
locale/default.nix
··· 1 1 {...}: { 2 - console.keyMap = "trq"; 3 2 i18n = { 4 3 defaultLocale = "en_US.UTF-8"; 5 4 supportedLocales = ["en_US.UTF-8/UTF-8"]; 6 5 }; 7 6 time.timeZone = "Turkey"; 8 7 services.xserver.layout = "tr"; 8 + console.keyMap = "trq"; 9 9 }
+5
modules/default.nix
··· 1 + { 2 + imports = [ 3 + ./hm-system-defaults.nix 4 + ]; 5 + }
-7
modules/nix-path.nix
··· 1 - { 2 - channel, 3 - inputs, 4 - ... 5 - }: { 6 - nix.nixPath = ["nixpkgs=${channel.input}" "nixos-config=${../lib/compat/nixos}" "home-manager=${inputs.home}"]; 7 - }
-26
modules/security/mitigations.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: 6 - with lib; let 7 - inherit (builtins) readFile fetchurl; 8 - cfg = config.security.mitigations; 9 - cmdline = '' 10 - 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''; 11 - in { 12 - options = { 13 - security.mitigations.disable = 14 - mkOption 15 - { 16 - type = types.bool; 17 - default = false; 18 - description = '' 19 - Whether to disable spectre and meltdown mitigations in the kernel. Do 20 - not use this in mission critical deployments, or on any machine you do 21 - not have physical access to. 22 - ''; 23 - }; 24 - }; 25 - config = mkIf cfg.disable {boot.kernelParams = splitString " " cmdline;}; 26 - }
-1
overlays/manix.nix
··· 1 - final: prev: {manix = prev.manix.overrideAttrs (o: rec {inherit (prev.sources.manix) pname version src;});}
-4
overlays/overrides.nix
··· 1 - channels: final: prev: { 2 - __dontExport = true; 3 - # overrides clutter up actual creations 4 - }
-7
overlays/various-flake-fixes.nix
··· 1 - final: prev: { 2 - # Since: https://github.com/NixOS/nixpkgs/pull/126137 3 - nix-direnv = 4 - if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs 5 - then prev.nix-direnv.override {enableFlakes = true;} 6 - else prev.nix-direnv; 7 - }
-20
pkgs/_sources/generated.nix
··· 1 - # This file was generated by nvfetcher, please do not modify it manually. 2 - { 3 - fetchgit, 4 - fetchurl, 5 - }: { 6 - manix = { 7 - pname = "manix"; 8 - version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; 9 - src = 10 - fetchgit 11 - { 12 - url = "https://github.com/mlvzk/manix"; 13 - rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; 14 - fetchSubmodules = false; 15 - deepClone = false; 16 - leaveDotGit = false; 17 - sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; 18 - }; 19 - }; 20 - }
-5
pkgs/default.nix
··· 1 - final: prev: { 2 - # keep sources this first 3 - sources = prev.callPackage (import ./_sources/generated.nix) {}; 4 - # then, call packages with `final.callPackage` 5 - }
-4
pkgs/sources.toml
··· 1 - # nvfetcher.toml 2 - [manix] 3 - src.git = "https://github.com/mlvzk/manix" 4 - fetch.github = "mlvzk/manix"
+3 -7
profiles/core/default.nix profiles/default.nix
··· 1 1 { 2 - self, 3 2 inputs, 4 3 config, 5 4 pkgs, 6 - lib, 7 5 ... 8 6 }: let 9 - inherit (lib) fileContents mkIf; 10 - pkgBin = lib.our.pkgBinNoDep pkgs; 7 + inherit (pkgs) lib; 8 + inherit (lib) fileContents mkIf pkgBin; 11 9 coreBin = v: "${pkgs.coreutils}/bin/${v}"; 12 10 nixBin = "${config.nix.package}/bin/nix"; 13 11 in { 14 - imports = [../cachix ../../locale ../../secrets/secrets.nix]; 12 + imports = [./cachix]; 15 13 boot = { 16 14 tmpOnTmpfs = true; 17 15 loader.systemd-boot.configurationLimit = 10; ··· 121 119 mn = let 122 120 manix_preview = "manix '{}' | sed 's/type: /> type: /g' | bat -l Markdown --color=always --plain"; 123 121 in ''manix "" | rg '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="${manix_preview}" | xargs manix''; 124 - # fix nixos-option 125 - nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat"; 126 122 # sudo 127 123 s = ifSudo "sudo -E"; 128 124 si = ifSudo "sudo -i";
secrets/secrets.nix secrets/default.nix
-1
shell.nix
··· 1 - (import ./lib/compat).shellNix
-10
shell/default.nix
··· 1 - { 2 - self, 3 - inputs, 4 - ... 5 - }: { 6 - modules = with inputs; [ 7 - #bud.devshellModules.bud 8 - ]; 9 - exportedModules = [./devos.nix]; 10 - }
-54
shell/devos.nix
··· 1 - { 2 - pkgs, 3 - extraModulesPath, 4 - ... 5 - }: let 6 - hooks = import ./hooks; 7 - pkgWithCategory = category: package: {inherit package category;}; 8 - linter = pkgWithCategory "linter"; 9 - docs = pkgWithCategory "docs"; 10 - devos = pkgWithCategory "devos"; 11 - in { 12 - _file = toString ./.; 13 - imports = ["${extraModulesPath}/git/hooks.nix"]; 14 - git = {inherit hooks;}; 15 - # tempfix: remove when merged https://github.com/numtide/devshell/pull/123 16 - devshell.startup.load_profiles = 17 - pkgs.lib.mkForce 18 - ( 19 - pkgs.lib.noDepEntry 20 - '' 21 - # PATH is devshell's exorbitant privilige: 22 - # fence against its pollution 23 - _PATH=''${PATH} 24 - # Load installed profiles 25 - for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do 26 - # If that folder doesn't exist, bash loves to return the whole glob 27 - [[ -f "$file" ]] && source "$file" 28 - done 29 - # Exert exorbitant privilige and leave no trace 30 - export PATH=''${_PATH} 31 - unset _PATH 32 - '' 33 - ); 34 - packages = with pkgs; [git-crypt]; 35 - commands = with pkgs; 36 - [ 37 - (devos nixUnstable) 38 - #(devos agenix) 39 - /* 40 - { 41 - category = "devos"; 42 - name = pkgs.nvfetcher-bin.pname; 43 - help = pkgs.nvfetcher-bin.meta.description; 44 - command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@"; 45 - } 46 - */ 47 - #(linter nixpkgs-fmt) 48 - #(linter editorconfig-checker) 49 - # (docs python3Packages.grip) too many deps 50 - # (docs mdbook) 51 - ] 52 - ++ lib.optional (pkgs ? deploy-rs) (devos deploy-rs.deploy-rs) 53 - ++ lib.optional (system != "i686-linux") (devos cachix); 54 - }
-4
shell/hooks/default.nix
··· 1 - { 2 - enable = false; 3 - pre-commit.text = builtins.readFile ./pre-commit.sh; 4 - }
-29
shell/hooks/pre-commit.sh
··· 1 - #!/usr/bin/env bash 2 - 3 - if git rev-parse --verify HEAD >/dev/null 2>&1 4 - then 5 - against=HEAD 6 - else 7 - # Initial commit: diff against an empty tree object 8 - against=$(${git}/bin/git hash-object -t tree /dev/null) 9 - fi 10 - 11 - diff="git diff-index --name-only --cached $against --diff-filter d" 12 - 13 - nix_files=($($diff -- '*.nix')) 14 - all_files=($($diff)) 15 - 16 - # Format staged nix files. 17 - if [[ -n "${nix_files[@]}" ]]; then 18 - nixpkgs-fmt "${nix_files[@]}" \ 19 - && git add "${nix_files[@]}" 20 - fi 21 - 22 - # check editorconfig 23 - editorconfig-checker -- "${all_files[@]}" 24 - if [[ $? != '0' ]]; then 25 - printf "%b\n" \ 26 - "\nCode is not aligned with .editorconfig" \ 27 - "Review the output and commit your fixes" >&2 28 - exit 1 29 - fi
users/modules/.flake-keep

This is a binary file and will not be displayed.

-9
users/nixos/default.nix
··· 1 - {...}: { 2 - users.users.nixos = { 3 - uid = 1000; 4 - password = "nixos"; 5 - description = "default"; 6 - isNormalUser = true; 7 - extraGroups = ["wheel"]; 8 - }; 9 - }
+8 -28
users/patriot/default.nix
··· 97 97 home-manager.users.patriot = { 98 98 config, 99 99 pkgs, 100 - suites, 101 100 ... 102 101 }: let 103 102 personal = import ../../personal.nix; ··· 234 233 #export QT_PLATFORM_PLUGIN=qt5ct 235 234 ''; 236 235 in { 237 - imports = suites.base; 238 - # needs to be fixed to use nix profile??? 239 - /* 240 - gtk = { 241 - enable = false; 242 - font = { 243 - package = pkgs.dejavu_fonts; 244 - name = "DejaVu Sans 12"; 245 - }; 246 - iconTheme = { 247 - package = pkgs.papirus-icon-theme; 248 - name = "Papirus Dark"; 249 - }; 250 - theme = { 251 - package = pkgs.numix-gtk-theme; 252 - name = "Numix Dark"; 253 - }; 254 - }; 255 - 256 - qt = { 257 - enable = false; 258 - style = { 259 - package = pkgs.adwaita-qt; 260 - name = "adwaita-dark"; 261 - }; 262 - }; 263 - */ 236 + imports = [ 237 + ../profiles/direnv 238 + ../profiles/git 239 + ../profiles/starship 240 + ]; 264 241 fonts.fontconfig.enable = true; 265 242 home = { 266 243 homeDirectory = nixosConfig.users.users.patriot.home; ··· 652 629 "nix.serverPath" = pkgBin "rnix-lsp"; 653 630 "editor.bracketPairColorization.enabled" = true; 654 631 "editor.semanticHighlighting.enabled" = true; 632 + "remote.SSH.defaultExtensions" = [ 633 + "gitpod.gitpod-remote-ssh" 634 + ]; 655 635 }; 656 636 }; 657 637 };