diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index b8d9a688..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,114 +0,0 @@ -# Changelog - -## [v0.10.0](https://github.com/divnix/devos/tree/v0.10.0) (2021-05-24) - -**Implemented enhancements:** - -- Providing an interface to nixpkgs.config [\#237](https://github.com/divnix/devos/issues/237) -- Making the user available in profiles [\#230](https://github.com/divnix/devos/issues/230) -- copy evaluation store paths to iso [\#195](https://github.com/divnix/devos/issues/195) -- Extract custom system builds from devosSystem out of lib [\#170](https://github.com/divnix/devos/issues/170) -- Allow setting of channel host-wide [\#117](https://github.com/divnix/devos/issues/117) -- alacritty: CSIu support [\#51](https://github.com/divnix/devos/issues/51) - -**Fixed bugs:** - -- Cachix timeouts + how to disable nrdxp cachix \(if needed\) [\#294](https://github.com/divnix/devos/issues/294) -- default.nix flake-compat is broken [\#285](https://github.com/divnix/devos/issues/285) -- All suites return "attribute missing" [\#282](https://github.com/divnix/devos/issues/282) -- nix is built two times [\#203](https://github.com/divnix/devos/issues/203) -- fix lib docs [\#166](https://github.com/divnix/devos/issues/166) - -**Closed issues:** - -- eliminate userFlakeNixOS [\#257](https://github.com/divnix/devos/issues/257) -- devos-as-library [\#214](https://github.com/divnix/devos/issues/214) - -**Merged pull requests:** - -- Update evalArgs to match the new planned API [\#239](https://github.com/divnix/devos/pull/239) - -## [v0.9.0](https://github.com/divnix/devos/tree/v0.9.0) (2021-04-19) - -**Implemented enhancements:** - -- pin inputs into iso live registry [\#190](https://github.com/divnix/devos/issues/190) -- Pass 'self' to lib [\#169](https://github.com/divnix/devos/issues/169) -- doc: quickstart "ISO. What next?" [\#167](https://github.com/divnix/devos/issues/167) -- Integrate Android AOSP putting mobile under control [\#149](https://github.com/divnix/devos/issues/149) -- Inoculate host identity on first use [\#132](https://github.com/divnix/devos/issues/132) -- kubenix support [\#130](https://github.com/divnix/devos/issues/130) -- Improve Home Manager support: profiles/suites, modules, extern, flake outputs [\#119](https://github.com/divnix/devos/issues/119) -- Local CA \(between hosts\) [\#104](https://github.com/divnix/devos/issues/104) -- Q5: git annex for machine state [\#68](https://github.com/divnix/devos/issues/68) -- name space ./pkgs overlays [\#60](https://github.com/divnix/devos/issues/60) -- remap global keys easily [\#57](https://github.com/divnix/devos/issues/57) -- make pass state part of this repo's structure [\#56](https://github.com/divnix/devos/issues/56) -- Incorporate ./shells [\#38](https://github.com/divnix/devos/issues/38) -- Encrypt with \(r\)age [\#37](https://github.com/divnix/devos/issues/37) - -**Fixed bugs:** - -- `pathsToImportedAttrs` does not accept directories [\#221](https://github.com/divnix/devos/issues/221) -- Cachix caches aren't added to the configuration [\#208](https://github.com/divnix/devos/issues/208) -- Issues with current changelog workflow [\#205](https://github.com/divnix/devos/issues/205) -- iso: systemd service startup [\#194](https://github.com/divnix/devos/issues/194) -- Help adding easy-hls-nix to devos [\#174](https://github.com/divnix/devos/issues/174) -- `flk update` fails because of obsolete flag [\#159](https://github.com/divnix/devos/issues/159) -- Expected that not all packages are exported? [\#151](https://github.com/divnix/devos/issues/151) -- Segmentation fault when generating iso [\#150](https://github.com/divnix/devos/issues/150) - -**Documentation:** - -- doc: split iso [\#193](https://github.com/divnix/devos/issues/193) -- lib: can depend on pkgs \(a la nixpkgs\#pkgs/pkgs-lib\) [\#147](https://github.com/divnix/devos/pull/147) - -**Closed issues:** - -- FRRouting router implementation [\#154](https://github.com/divnix/devos/issues/154) -- ARM aarch64 Support [\#72](https://github.com/divnix/devos/issues/72) - -## [v0.8.0](https://github.com/divnix/devos/tree/v0.8.0) (2021-03-02) - -**Implemented enhancements:** - -- semi automatic update for /pkgs [\#118](https://github.com/divnix/devos/issues/118) -- Home-manager external modules from flakes [\#106](https://github.com/divnix/devos/issues/106) - -**Fixed bugs:** - -- My emacsGcc overlay is not working [\#146](https://github.com/divnix/devos/issues/146) -- local flake registry freezes branches [\#142](https://github.com/divnix/devos/issues/142) -- nixos-option no longer works after collect garbage [\#138](https://github.com/divnix/devos/issues/138) -- Profiles imports are brittle, causing failure if imported twice [\#136](https://github.com/divnix/devos/issues/136) - -## [0.7.0](https://github.com/divnix/devos/tree/0.7.0) (2021-02-20) - -**Implemented enhancements:** - -- add zoxide [\#53](https://github.com/divnix/devos/issues/53) -- Multiarch support? [\#17](https://github.com/divnix/devos/issues/17) -- initial multiArch support [\#18](https://github.com/divnix/devos/pull/18) - -**Fixed bugs:** - -- Missing shebang from flk.sh [\#131](https://github.com/divnix/devos/issues/131) -- Rename Meta Issue [\#128](https://github.com/divnix/devos/issues/128) -- specialisations break the `system` argument [\#46](https://github.com/divnix/devos/issues/46) -- Revert "Add extraArgs to lib.nixosSystem call to add system args." [\#47](https://github.com/divnix/devos/pull/47) - -**Documentation:** - -- update home-manager urls [\#62](https://github.com/divnix/devos/pull/62) - -**Closed issues:** - -- add github action for cachix build ci [\#59](https://github.com/divnix/devos/issues/59) - -## [12052020](https://github.com/divnix/devos/tree/12052020) (2020-12-06) - -## [07092020](https://github.com/divnix/devos/tree/07092020) (2020-07-09) - - - -\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/COPYING b/COPYING deleted file mode 100644 index c9b44cb8..00000000 --- a/COPYING +++ /dev/null @@ -1,18 +0,0 @@ -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index e5edc638..00000000 --- a/README.md +++ /dev/null @@ -1,93 +0,0 @@ -[![NixOS](https://img.shields.io/badge/NixOS-unstable-blue.svg?style=flat&logo=NixOS&logoColor=white)](https://nixos.org) -[![MIT License](https://img.shields.io/github/license/divnix/devos)][mit] - -> #### ⚠ Advisory ⚠ -> Do you remember how you got here? Where were you going? What were you leaving behind? -> Are you sure you want to go down this rabbit hole, Alice? - -## Getting Started -This is my personal deployment hub. I configure all my personal servers from this repo. Good luck if you're looking to graft this. -You'll probably want to run some `install.sh` that will configure the base NixOS system. Some of them aren't in a good state. -From there you can either install the host you want with `sudo nixos-rebuild switch --flake .#` or enter the cockpit with `nix develop` and deploy servers remotely through `deploy` - - -## Personal dotfiles - - -

- - - -

- ------- - -| | | -|----------------|----------------------------------------------------------| -| **Shell:** | bash / elvish | -| **DM:** | lightdm + lightdm-mini-greeter | -| **WM:** | bspwm + polybar | -| **Editor:** | nvim | -| **Terminal:** | kitty | -| **Launcher:** | rofi | -| **Browser:** | firefox | -| **GTK Theme:** | [Ant Dracula](https://github.com/EliverLara/Ant-Dracula) | - ------ - - -### Status: Beta -The volcanic rock still shifts below this structure. It has not solidified and cannot yet be considered `home` -You should not expect landmarks here. -Learn to adopt Chaos. - -## Shoulders -Summoning is powerful magic, and cannot be created in isolation. It stands on the [shoulders of the -following giants][giants]: - -### :onion: — like the layers of an onion -- [`divnix/digga`][digga] -- [`gytis-ivaskevicius/flake-utils-plus`][fup] -- [`numtide/flake-utils`][fu] -- [`numtide/devshell`][devshell] -- [`serokell/deploy-rs`][deploy] -- [`berberman/nvfetcher`][nvfetcher] -- [`NixOS/nixpkgs`][nixpkgs] -- Agenix -- direnv - -:heart: - -### But Why? -The future is more uncertain than ever. Make dependable what you can, in whatever way you know how. -Stop doing it by yourself, unless we learn to work with one another will we be able to grow long term solutions. - -Managing servers by hand sucks, k8s doesn't allow me to transitively deploy all my configuration to multiple personal machines, and ansible wasn't good enough. - -You probably don't want to use nixOS, I'm a masocist - -### Grafts -https://github.com/hlissner/dotfiles - -# License -DevOS is licensed under the [MIT License][mit]. - -[community]: https://github.com/divnix/devos/tree/community -[core]: https://github.com/divnix/devos -[deploy]: https://github.com/serokell/deploy-rs -[devshell]: https://github.com/numtide/devshell -[digga]: https://github.com/divnix/digga -[dotfiles]: https://github.com/hlissner/dotfiles -[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md -[flakes]: https://nixos.wiki/wiki/Flakes -[fu]: https://github.com/numtide/flake-utils -[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus -[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants -[home-manager]: https://nix-community.github.io/home-manager -[mit]: https://mit-license.org -[mk-flake]: https://github.com/divnix/digga/tree/master/src/mkFlake -[nix]: https://nixos.org/manual/nix/stable -[nixos]: https://nixos.org/manual/nixos/stable -[nixpkgs]: https://github.com/NixOS/nixpkgs -[nvfetcher]: https://github.com/berberman/nvfetcher - diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 6703d416..00000000 --- a/bors.toml +++ /dev/null @@ -1,5 +0,0 @@ -status = [ "check" ] - -required_approvals = 1 - -up_to_date_approvals = true diff --git a/default.nix b/default.nix deleted file mode 100644 index 0e6bdee2..00000000 --- a/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -let - inherit (default.inputs.nixos) lib; - - default = (import ./lib/compat).defaultNix; - - ciSystems = [ - "aarch64-linux" - "i686-linux" - "x86_64-linux" - ]; - - filterSystems = lib.filterAttrs - (system: _: lib.elem system ciSystems); - - recurseIntoAttrsRecursive = lib.mapAttrs (_: v: - if lib.isAttrs v - then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v) - else v - ); - - systemOutputs = lib.filterAttrs - (name: set: lib.isAttrs set - && lib.any - (system: set ? ${system} && name != "legacyPackages") - ciSystems - ) - default.outputs; - - ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs; -in -(recurseIntoAttrsRecursive ciDrvs) // { shell = import ./shell.nix; } diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 7585238e..00000000 --- a/doc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -book diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md deleted file mode 100644 index 8574daea..00000000 --- a/doc/CONTRIBUTING.md +++ /dev/null @@ -1,18 +0,0 @@ -# Pull Requests - -## TL;DR; -- **Target Branch**: `main` -- **Merge Policy**: [`bors`][bors] is alwyas right (→ `bors try`) -- **Docs**: every changeset is expected to contain doc updates -- **Commit Msg**: be a poet! Comprehensive and explanatory commit messages - should cover the motivation and use case in an easily understandable manner - even when read after a few months. -- **Test Driven Development**: please default to test driven development where possible. - -### Within the Devshell (`nix develop`) -- **Hooks**: please `git commit` within the devshell -- **Fail Early**: please run from within the devshell on your local machine: - - `nix flake check` - -[bors]: https://bors.tech - diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md deleted file mode 100644 index 1d7bafe9..00000000 --- a/doc/SUMMARY.md +++ /dev/null @@ -1,28 +0,0 @@ -# Summary - -- [Introduction](../README.md) -- [Quick Start](./start/index.md) - - [ISO](./start/iso.md) - - [Bootstrapping](./start/bootstrapping.md) - - [From NixOS](./start/from-nixos.md) -- [Key Concepts](./concepts/index.md) - - [Hosts](./concepts/hosts.md) - - [Overrides](./concepts/overrides.md) - - [Profiles](./concepts/profiles.md) - - [Suites](./concepts/suites.md) - - [Users](./concepts/users.md) -- [Outputs](./outputs/index.md) - - [Modules](./outputs/modules.md) - - [Overlays](./outputs/overlays.md) - - [Packages](./outputs/pkgs.md) -- [Concerns]() - - [Secrets](./secrets.md) - - [Tests](./tests.md) -- [Helper Script – `bud`](./bud/index.md) - - [get](./bud/get.md) -- [Integrations](./integrations/index.md) - - [Cachix](./integrations/cachix.md) - - [Deploy RS](./integrations/deploy.md) - - [NvFetcher](./integrations/nvfetcher.md) - - [Hercules CI](./integrations/hercules.md) -- [Contributing](./CONTRIBUTING.md) diff --git a/doc/book.toml b/doc/book.toml deleted file mode 100644 index 373d26fd..00000000 --- a/doc/book.toml +++ /dev/null @@ -1,6 +0,0 @@ -[book] -authors = ["Timothy DeHerrera"] -language = "en" -multilingual = false -src = "." -title = "devos docs" diff --git a/doc/bud/get.md b/doc/bud/get.md deleted file mode 100644 index 12263df0..00000000 --- a/doc/bud/get.md +++ /dev/null @@ -1,10 +0,0 @@ -# get -The `get` subcommand is useful for getting a bare copy of devos without the -git history. - -## Usage -```sh -bud get DEST-DIR -``` - -If DEST-DIR is ommitted, it defaults to _./devos_. diff --git a/doc/bud/index.md b/doc/bud/index.md deleted file mode 100644 index 7b985792..00000000 --- a/doc/bud/index.md +++ /dev/null @@ -1,24 +0,0 @@ -# [`bud`][bud] command -The template incudes a convenient script for managing your system called [`bud`][bud]. - -It is a portable and highly composable system control tool that work anywhere on your host -or in the flake's devshell. - -Although it comes with some predefined standard helpers, -it is very extensible and you are encouraged to write your own script snippets -to ease your workflows. An example is the bud module for a `get` command that -comes included with `devos`. - -While writing scripts you can convenientely access smart environment variables -that can tell the current architecture, user or host name, among others, regardless -wether you invoke `bud` within the devshell or as the system-wide installed `bud`. - -For details, please review the [bud repo][bud]. - -## Usage -```sh -bud help -``` - - -[bud]: https://github.com/divnix/bud diff --git a/doc/concepts/hosts.md b/doc/concepts/hosts.md deleted file mode 100644 index 1c3c3fa0..00000000 --- a/doc/concepts/hosts.md +++ /dev/null @@ -1,62 +0,0 @@ -# Hosts - -Nix flakes contain an output called `nixosConfigurations` declaring an -attribute set of valid NixOS systems. To simplify the management and creation -of these hosts, devos automatically imports every _.nix_ file inside this -directory to the mentioned attribute set, applying the projects defaults to -each. The only hard requirement is that the file contain a valid NixOS module. - -As an example, a file `hosts/system.nix` or `hosts/system/default.nix` will -be available via the flake output `nixosConfigurations.system`. You can have -as many hosts as you want and all of them will be automatically imported based -on their name. - -For each host, the configuration automatically sets the `networking.hostName` -attribute to the folder name or name of the file minus the _.nix_ extension. This -is for convenience, since `nixos-rebuild` automatically searches for a configuration -matching the current systems hostname if one is not specified explicitly. - -You can set channels, systems, and add extra modules to each host by editing the -`nixos.hosts` argument in flake.nix. This is the perfect place to import -host specific modules from external sources, such as the -[nixos-hardware][nixos-hardware] repository. - -It is recommended that the host modules only contain configuration information -specific to a particular piece of hardware. Anything reusable across machines -is best saved for [profile modules](./profiles.md). - -This is a good place to import sets of profiles, called [suites](./suites.md), -that you intend to use on your machine. - - -## Example - -flake.nix: -```nix -{ - nixos = { - imports = [ (devos.lib.importHosts ./hosts) ]; - hosts = { - librem = { - channelName = "latest"; - modules = [ nixos-hardware.nixosModules.purism-librem-13v3 ]; - }; - }; - }; -} -``` - -hosts/librem.nix: -```nix -{ suites, ... }: -{ - imports = suites.laptop; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; -} -``` - -[nixos-hardware]: https://github.com/NixOS/nixos-hardware diff --git a/doc/concepts/index.md b/doc/concepts/index.md deleted file mode 100644 index 618292cb..00000000 --- a/doc/concepts/index.md +++ /dev/null @@ -1,10 +0,0 @@ -# Key Concepts - -Key concepts are derived from [digga][digga]. Please refer to its -[docs][digga-docs] for more details. - -This section is dedicated to helping you develop a more hands on -understanding of them them. - -[digga-docs]: https://digga.divnix.com -[digga]: https://github.com/divnix/digga diff --git a/doc/concepts/overrides.md b/doc/concepts/overrides.md deleted file mode 100644 index 610fde04..00000000 --- a/doc/concepts/overrides.md +++ /dev/null @@ -1,42 +0,0 @@ -# Overrides -Each NixOS host follows one channel. But many times it is useful to get packages -or modules from different channels. - -## Packages -You can make use of `overlays/overrides.nix` to override specific packages in the -default channel to be pulled from other channels. That file is simply an example -of how any overlay can get `channels` as their first argument. - -You can add overlays to any channel to override packages from other channels. - -Pulling the manix package from the `latest` channel: -```nix -channels: final: prev: { - __dontExport = true; - inherit (pkgs.latest) manix; -} -``` - -It is recommended to set the `__dontExport` property for override specific -overlays. `overlays/overrides.nix` is the best place to consolidate all package -overrides and the property is already set for you. - -## Modules - -You can also pull modules from other channels. All modules have access to the -`modulesPath` for each channel as `ModulesPath`. And you can use -`disabledModules` to remove modules from the current channel. - -To pull zsh module from the `latest` channel this code can be placed in any module, whether its your host file, a profile, or a module in ./modules etc: -```nix -{ latestModulesPath }: -{ - imports = [ "${latestModulesPath}/programs/zsh/zsh.nix" ]; - disabledModules = [ "programs/zsh/zsh.nix" ]; -} -``` - -> ##### _Note:_ -> Sometimes a modules name will change from one branch to another. - -[nixpkgs-modules]: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules diff --git a/doc/concepts/profiles.md b/doc/concepts/profiles.md deleted file mode 100644 index a5eda3e2..00000000 --- a/doc/concepts/profiles.md +++ /dev/null @@ -1,67 +0,0 @@ -# Profiles - -Profiles are a convenient shorthand for the [_definition_][definition] of -[options][options] in contrast to their [_declaration_][declaration]. They're -built into the NixOS module system for a reason: to elegantly provide a clear -separation of concerns. - -## Creation -Profiles are created with the `rakeLeaves` function which recursively collects -`.nix` files from within a folder. The recursion stops at folders with a `default.nix` -in them. You end up with an attribute set with leaves(paths to profiles) or -nodes(attrsets leading to more nodes or leaves). - -A profile is used for quick modularization of [interelated bits](./profiles.md#subprofiles). - -> ##### _Notes:_ -> * For _declaring_ module options, there's the [modules](../outputs/modules.md) directory. -> * This directory takes inspiration from -> [upstream](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/profiles) -> . - -### Nested profiles -Profiles can be nested in attribute sets due to the recursive nature of `rakeLeaves`. -This can be useful to have a set of profiles created for a specific purpose. It is -sometimes useful to have a `common` profile that has high level concerns related -to all its sister profiles. - -### Example - -profiles/develop/common.nix: -```nix -{ - imports = [ ./zsh ]; - # some generic development concerns ... -} -``` - -profiles/develop/zsh.nix: -```nix -{ ... }: -{ - programs.zsh.enable = true; - # zsh specific options ... -} -``` - -The examples above will end up with a profiles set like this: -```nix -{ - develop = { - common = ./profiles/develop/common.nix; - zsh = ./profiles/develop/zsh.nix; - }; -} -``` - -## Conclusion -Profiles are the most important concept in DevOS. They allow us to keep our -Nix expressions self contained and modular. This way we can maximize reuse -across hosts while minimizing boilerplate. Remember, anything machine -specific belongs in your [host](hosts.md) files instead. - -[definition]: https://nixos.org/manual/nixos/stable/index.html#sec-option-definitions -[declaration]: https://nixos.org/manual/nixos/stable/index.html#sec-option-declarations -[options]: https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules -[spec]: https://github.com/divnix/devos/tree/core/lib/devos/mkProfileAttrs.nix -[config]: https://nixos.wiki/wiki/Module#structure diff --git a/doc/concepts/suites.md b/doc/concepts/suites.md deleted file mode 100644 index 42a3db82..00000000 --- a/doc/concepts/suites.md +++ /dev/null @@ -1,25 +0,0 @@ -# Suites -Suites provide a mechanism for users to easily combine and name collecitons of -profiles. - -`suites` are defined in the `importables` argument in either the `home` or `nixos` -namespace. They are a special case of an `importable` which get passed as a special -argument (one that can be use in an `imports` line) to your hosts. All lists defined -in `suites` are flattened and type-checked as paths. - -## Definition -```nix -rec { - workstation = [ profiles.develop profiles.graphical users.nixos ]; - mobileWS = workstation ++ [ profiles.laptop ]; -} -``` - -## Usage -`hosts/my-laptop.nix`: -```nix -{ suites, ... }: -{ - imports = suites.mobileWS; -} -``` diff --git a/doc/concepts/users.md b/doc/concepts/users.md deleted file mode 100644 index 12bf5622..00000000 --- a/doc/concepts/users.md +++ /dev/null @@ -1,77 +0,0 @@ -> ##### _Note:_ -> This section and its semantics need a conceptiual rework. -> Since recently [portable home configurations][portableuser] -> that are not bound to any specific host are a thing. - -# Users - -Users are a special case of [profiles](profiles.md) that define system -users and [home-manager][home-manager] configurations. For your convenience, -home manager is wired in by default so all you have to worry about is declaring -your users. For a fully fleshed out example, check out the developers personal -[branch](https://github.com/divnix/devos/tree/nrd/users/nrd/default.nix). - -## Basic Usage -`users/myuser/default.nix`: -```nix -{ ... }: -{ - users.users.myuser = { - isNormalUser = true; - }; - - home-manager.users.myuser = { - programs.mpv.enable = true; - }; -} - -``` - -## Home Manager -Home Manager support follows the same principles as regular nixos configurations, -it even gets its own namespace in your `flake.nix` as `home`. - -All modules defined in [user modules][modules-list] will be imported to -Home Manager. -User profiles can be collected in a similar fashion as system ones into a `suites` -argument that gets passed to your home-manager users. - -### Example -```nix -{ - home-manager.users.nixos = { suites, ... }: { - imports = suites.base; - }; -} -``` - - -## External Usage -You can easily use the defined home-manager configurations outside of NixOS -using the `homeConfigurations` flake output. The [flk](../flk/index.md) helper -script makes this even easier. - -This is great for keeping your environment consistent across Unix systems, -including OSX. - -### From within the projects devshell: -```sh -# builds the nixos user defined in the NixOS host -flk home NixOS nixos - -# build and activate -flk home NixOS nixos switch -``` - -### Manually from outside the project: -```sh -# build -nix build "github:divnix/devos#homeConfigurations.nixos@NixOS.home.activationPackage" - -# activate -./result/activate && unlink result -``` - -[home-manager]: https://nix-community.github.io/home-manager -[modules-list]: https://github.com/divnix/devos/tree/core/users/modules/module-list.nix -[portableuser]: https://digga.divnix.com/api-reference-home.html#homeusers diff --git a/doc/integrations/cachix.md b/doc/integrations/cachix.md deleted file mode 100644 index b0254594..00000000 --- a/doc/integrations/cachix.md +++ /dev/null @@ -1,17 +0,0 @@ -# Cachix -The system will automatically pull a cachix.nix at the root if one exists. -This is usually created automatically by a `sudo cachix use`. If you're more -inclined to keep the root clean, you can drop any generated files in the -`cachix` directory into the `profiles/cachix` directory without further -modification. - -For example, to add your own cache, assuming the template lives in /etc/nixos, -by simply running `sudo cachix use yourcache`. Then, optionally, move -`cachix/yourcache.nix` to `profiles/cachix/yourcache.nix` - -These caches are only added to the system after a `nixos-rebuild switch`, so it -is recommended to call `cachix use nrdxp` before the initial deployment, as it -will save a lot of build time. - -In the future, users will be able to skip this step once the ability to define -the nix.conf within the flake is fully fleshed out upstream. diff --git a/doc/integrations/deploy.md b/doc/integrations/deploy.md deleted file mode 100644 index 29032108..00000000 --- a/doc/integrations/deploy.md +++ /dev/null @@ -1,49 +0,0 @@ -# deploy-rs -[Deploy-rs][d-rs] is a tool for managing NixOS remote machines. It was -chosen for devos after the author experienced some frustrations with the -stateful nature of nixops' db. It was also designed from scratch to support -flake based deployments, and so is an excellent tool for the job. - -By default, all the [hosts](../concepts/hosts.md) are also available as deploy-rs nodes, -configured with the hostname set to `networking.hostName`; overridable via -the command line. - -## Usage - -Just add your ssh key to the host: -```nix -{ ... }: -{ - users.users.${sshUser}.openssh.authorizedKeys.keyFiles = [ - ../secrets/path/to/key.pub - ]; -} -``` - -And the private key to your user: -```nix -{ ... }: -{ - home-manager.users.${sshUser}.programs.ssh = { - enable = true; - - matchBlocks = { - ${host} = { - host = hostName; - identityFile = ../secrets/path/to/key; - extraOptions = { AddKeysToAgent = "yes"; }; - }; - }; - } -} -``` - -And run the deployment: -```sh -deploy "flk#hostName" --hostname host.example.com -``` - -> ##### _Note:_ -> Your user will need **passwordless** sudo access - -[d-rs]: https://github.com/serokell/deploy-rs diff --git a/doc/integrations/hercules.md b/doc/integrations/hercules.md deleted file mode 100644 index aa0185e4..00000000 --- a/doc/integrations/hercules.md +++ /dev/null @@ -1,36 +0,0 @@ -# Hercules CI -If you start adding your own packages and configurations, you'll probably have -at least a few binary artifacts. With hercules we can build every package in -our configuration automatically, on every commit. Additionally, we can have it -upload all our build artifacts to a binary cache like [cachix][cachix]. - -This will work whether your copy is a fork, or a bare template, as long as your -repo is hosted on GitHub. - -## Setup -Just head over to [hercules-ci.com](https://hercules-ci.com) to make an account. - -Then follow the docs to set up an [agent][agent], if you want to deploy to a -binary cache (and of course you do), be sure _not_ to skip the -[binary-caches.json][cache]. - -## Ready to Use -The repo is already set up with the proper _default.nix_ file, building all -declared packages, checks, profiles and shells. So you can see if something -breaks, and never build the same package twice! - -If you want to get fancy, you could even have hercules -[deploy your configuration](https://docs.hercules-ci.com/hercules-ci-effects/guide/deploy-a-nixos-machine/)! - -> ##### _Note:_ -> Hercules doesn't have access to anything encrypted in the -> [secrets folder](../../secrets), so none of your secrets will accidentally get -> pushed to a cache by mistake. -> -> You could pull all your secrets via your user, and then exclude it from -> [allUsers](https://github.com/nrdxp/devos/blob/nrd/suites/default.nix#L17) -> to keep checks passing. - -[agent]: https://docs.hercules-ci.com/hercules-ci/getting-started/#github -[cache]: https://docs.hercules-ci.com/hercules-ci/getting-started/deploy/nixos/#_3_configure_a_binary_cache -[cachix]: https://cachix.org diff --git a/doc/integrations/index.md b/doc/integrations/index.md deleted file mode 100644 index 5ea739ec..00000000 --- a/doc/integrations/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# Integrations -This section explores some of the optional tools included with devos to provide -a solution to common concerns such as ci and remote deployment. An effort is -made to choose tools that treat nix, and where possible flakes, as first class -citizens. diff --git a/doc/integrations/nvfetcher.md b/doc/integrations/nvfetcher.md deleted file mode 100644 index 4670657e..00000000 --- a/doc/integrations/nvfetcher.md +++ /dev/null @@ -1,43 +0,0 @@ -# nvfetcher -[NvFetcher][nvf] is a workflow companion for updating nix sources. - -You can specify an origin source and an update configuration, and -nvfetcher can for example track updates to a specific branch and -automatically update your nix sources configuration on each run -to the tip of that branch. - -All package source declaration is done in [sources.toml][sources.toml]. - -From within the devshell of this repo, run `nvfetcher`, a wrapped -version of `nvfetcher` that knows where to find and place its files -and commit the results. - -## Usage - -Statically fetching (not tracking) a particular tag from a github repo: -```toml -[manix] -src.manual = "v0.6.3" -fetch.github = "mlvzk/manix" -``` - -Tracking the latest github _release_ from a github repo: -```toml -[manix] -src.github = "mlvzk/manix" # responsible for tracking -fetch.github = "mlvzk/manix" # responsible for fetching -``` - -Tracking the latest commit of a git repository and fetch from a git repo: -```toml -[manix] -src.git = "https://github.com/mlvzk/manix.git" # responsible for tracking -fetch.git = "https://github.com/mlvzk/manix.git" # responsible for fetching -``` - -> ##### _Note:_ -> Please refer to the [NvFetcher Readme][nvf-readme] for more options. - -[nvf]: https://github.com/berberman/nvfetcher -[nvf-readme]: https://github.com/berberman/nvfetcher#readme -[sources.toml]: https://github.com/divnix/devos/tree/core/pkgs/sources.toml diff --git a/doc/outputs/index.md b/doc/outputs/index.md deleted file mode 100644 index 36207188..00000000 --- a/doc/outputs/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Layout -Each of the following sections is a directory whose contents are output to the -outside world via the flake's outputs. Check each chapter for details. diff --git a/doc/outputs/modules.md b/doc/outputs/modules.md deleted file mode 100644 index f698e9f6..00000000 --- a/doc/outputs/modules.md +++ /dev/null @@ -1,79 +0,0 @@ -# Modules -The modules directory is a replica of nixpkg's NixOS [modules][nixpkgs-modules] -, and follows the same semantics. This allows for trivial upstreaming into -nixpkgs proper once your module is sufficiently stable. - -All modules linked in _module-list.nix_ are automatically exported via -`nixosModules.`, and imported into all [hosts](../concepts/hosts.md). - - -> ##### _Note:_ -> This is reserved for declaring brand new module options. If you just want to -> declare a coherent configuration of already existing and related NixOS options -> , use [profiles](../concepts/profiles.md) instead. - -## Semantics -In case you've never written a module for nixpkgs before, here is a brief -outline of the process. - -### Declaration -modules/services/service-category/my-service.nix: -```nix -{ config, lib, ... }: -let - cfg = config.services.myService; -in -{ - options.services.myService = { - enable = lib.mkEnableOption "Description of my new service."; - - # additional options ... - }; - - config = lib.mkIf cfg.enable { - # implementation ... - }; -} -``` - -### Import -modules/module-list.nix: -```nix -[ - ./services/service-category/my-service.nix -] -``` - -## Usage - -### Internal -profiles/profile-category/my-profile.nix: -```nix -{ ... }: -{ - services.MyService.enable = true; -} -``` - -### External -flake.nix: -```nix -{ - # inputs omitted - - outputs = { self, devos, nixpkgs, ... }: { - nixosConfigurations.myConfig = nixpkgs.lib.nixosSystem { - system = "..."; - - modules = [ - devos.nixosModules.my-service - ({ ... }: { - services.MyService.enable = true; - }) - ]; - }; - }; -} -``` - -[nixpkgs-modules]: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules diff --git a/doc/outputs/overlays.md b/doc/outputs/overlays.md deleted file mode 100644 index f463d1a7..00000000 --- a/doc/outputs/overlays.md +++ /dev/null @@ -1,25 +0,0 @@ -# Overlays -Writing overlays is a common occurence when using a NixOS system. Therefore, -we want to keep the process as simple and straightforward as possible. - -Any _.nix_ files declared in this directory will be assumed to be a valid -overlay, and will be automatically imported into all [hosts](../concepts/hosts.md), and -exported via `overlays./` _as well as_ -`packages..` (for valid systems), so all you have to do is -write it. - -## Example -overlays/kakoune.nix: -```nix -final: prev: { - kakoune = prev.kakoune.override { - configure.plugins = with final.kakounePlugins; [ - (kak-fzf.override { fzf = final.skim; }) - kak-auto-pairs - kak-buffers - kak-powerline - kak-vertical-selection - ]; - }; -} -``` diff --git a/doc/outputs/pkgs.md b/doc/outputs/pkgs.md deleted file mode 100644 index 4de93a8d..00000000 --- a/doc/outputs/pkgs.md +++ /dev/null @@ -1,109 +0,0 @@ -# Packages -Similar to [modules](./modules.md), the pkgs directory mirrors the upstream -[nixpkgs/pkgs][pkgs], and for the same reason; if you ever want to upstream -your package, it's as simple as dropping it into the nixpkgs/pkgs directory. - -The only minor difference is that, instead of adding the `callPackage` call to -`all-packages.nix`, you just add it the the _default.nix_ in this directory, -which is defined as a simple overlay. - -All the packages are exported via `packages..`, for all -the supported systems listed in the package's `meta.platforms` attribute. - -And, as usual, every package in the overlay is also available to any NixOS -[host](../concepts/hosts.md). - -Another convenient difference is that it is possible to use -[nvfetcher](https://github.com/berberman/nvfetcher) to keep packages up to -date. -This is best understood by the simple example below. - -## Example -It is possible to specify sources separately to keep them up to date semi -automatically. -The basic rules are specified in pkgs/sources.toml: -```toml -# nvfetcher.toml -[libinih] -src.github = "benhoyt/inih" -fetch.github = "benhoyt/inih" -``` -After changes to this file as well as to update the packages specified in there run -nvfetcher (for more details see [nvfetcher](https://github.com/berberman/nvfetcher)). - -The pkgs overlay is managed in -pkgs/default.nix: -```nix -final: prev: { - # keep sources first, this makes sources available to the pkgs - sources = prev.callPackage (import ./_sources/generated.nix) { }; - - # then, call packages with `final.callPackage` - libinih = prev.callPackage ./development/libraries/libinih { }; -} -``` - -Lastly the example package is in -pkgs/development/libraries/libinih/default.nix: -```nix -{ stdenv, meson, ninja, lib, sources, ... }: -stdenv.mkDerivation { - pname = "libinih"; - - # version will resolve to the latest available on gitub - inherit (sources.libinih) version src; - - buildInputs = [ meson ninja ]; - - # ... -} -``` - - -## Migration from flake based approach -Previous to nvfetcher it was possible to manage sources via a pkgs/flake.nix, the main changes from there are that sources where in the attribute "srcs" (now "sources") and the contents of the sources where slightly different. -In order to switch to the new system, rewrite pkgs/flake.nix to a pkgs/sources.toml file using the documentation of nvfetcher, -add the line that calls the sources at the beginning of pkgs/default.nix, and -accomodate the small changes in the packages as can be seen from the example. - -The example package looked like: - -pkgs/flake.nix: -```nix -{ - description = "Package sources"; - - inputs = { - libinih.url = "github:benhoyt/inih/r53"; - libinih.flake = false; - }; -} -``` - -pkgs/default.nix: -```nix -final: prev: { - # then, call packages with `final.callPackage` - libinih = prev.callPackage ./development/libraries/libinih { }; -} -``` - -pkgs/development/libraries/libinih/default.nix: -```nix -{ stdenv, meson, ninja, lib, srcs, ... }: -let inherit (srcs) libinih; in -stdenv.mkDerivation { - pname = "libinih"; - - # version will resolve to 53, as specified in the flake.nix file - inherit (libinih) version; - - src = libinih; - - buildInputs = [ meson ninja ]; - - # ... -} -``` - -[pkgs]: https://github.com/NixOS/nixpkgs/tree/master/pkgs diff --git a/doc/secrets.md b/doc/secrets.md deleted file mode 100644 index 6afe2f6a..00000000 --- a/doc/secrets.md +++ /dev/null @@ -1,110 +0,0 @@ -# Secrets -Secrets are managed using [git-crypt][git-crypt] and [agenix][agenix] -so you can keep your flake in a public repository like GitHub without -exposing your password or other sensitive data. - -By default, everything in the secrets folder is automatically encrypted. Just -be sure to run `git-crypt init` before putting anything in here. - -## Agenix -Currently, there is [no mechanism][secrets-issue] in nix itself to deploy secrets -within the nix store because it is world-readable. - -Most NixOS modules have the ability to set options to files in the system, outside -the nix store, that contain sensitive information. You can use [agenix][agenix] -to easily setup those secret files declaratively. - -[agenix][agenix] encrypts secrets and stores them as .age files in your repository. -Age files are encrypted with multiple ssh public keys, so any host or user with a -matching ssh private key can read the data. The [age module][age module] will add those -encrypted files to the nix store and decrypt them on activation to `/run/secrets`. - -### Setup -All hosts must have openssh enabled, this is done by default in the core profile. - -You need to populate your `secrets/secrets.nix` with the proper ssh public keys. -Be extra careful to make sure you only add public keys, you should never share a -private key!! - -secrets/secrets.nix: -```nix -let - system = ""; - user = ""; - allKeys = [ system user ]; -in -``` - -On most systems, you can get your systems ssh public key from `/etc/ssh/ssh_host_ed25519_key.pub`. If -this file doesn't exist you likely need to enable openssh and rebuild your system. - -Your users ssh public key is probably stored in `~/.ssh/id_ed25519.pub` or -`~/.ssh/id_rsa.pub`. If you haven't generated a ssh key yet, be sure do so: -```sh -ssh-keygen -t ed25519 -``` - -> ##### _Note:_ -> The underlying tool used by agenix, rage, doesn't work well with password protected -> ssh keys. So if you have lots of secrets you might have to type in your password many -> times. - - -### Secrets -You will need the `agenix` command to create secrets. DevOS conveniently provides that -in the devShell, so just run `nix develop` whenever you want to edit secrets. Make sure -to always run `agenix` while in the `secrets/` folder, so it can pick up your `secrets.nix`. - -To create secrets, simply add lines to your `secrets/secrets.nix`: -``` -let - ... - allKeys = [ system user ]; -in -{ - "secret.age".publicKeys = allKeys; -} -``` -That would tell agenix to create a `secret.age` file that is encrypted with the `system` -and `user` ssh public key. - -Then go into the `secrets` folder and run: -```sh -agenix -e secret.age -``` -This will create the `secret.age`, if it doesn't already exist, and allow you to edit it. - -If you ever change the `publicKeys` entry of any secret make sure to rekey the secrets: -```sh -agenix --rekey -``` - -### Usage -Once you have your secret file encrypted and ready to use, you can utilize the [age module][age module] -to ensure that your secrets end up in `/run/secrets`. - -In any profile that uses a NixOS module that requires a secret you can enable a particular secret like so: - -```nix -{ self, ... }: -{ - age.secrets.mysecret.file = "${self}/secrets/mysecret.age"; -} -``` - - -Then you can just pass the path `/run/secrets/mysecret` to the module. - -You can make use of the many options provided by the age module to customize where and how -secrets get decrypted. You can learn about them by looking at the -[age module][age module]. - - -> ##### _Note:_ -> You can take a look at the [agenix repository][agenix] for more information -> about the tool. - -[git-crypt]: https://github.com/AGWA/git-crypt -[agenix]: https://github.com/ryantm/agenix -[age module]: https://github.com/ryantm/agenix/blob/master/modules/age.nix -[secrets-issue]: https://github.com/NixOS/nix/issues/8 diff --git a/doc/start/bootstrapping.md b/doc/start/bootstrapping.md deleted file mode 100644 index f4c5190e..00000000 --- a/doc/start/bootstrapping.md +++ /dev/null @@ -1,102 +0,0 @@ -# Bootstrapping - -This will help you boostrap a bare host with the help of the -[bespoke iso](./iso.md) live installer. - -_Note: nothing prevents you from remotely executing the boostrapping -process. See below._ - -Once your target host has booted into the live iso, you need to partion -and format your disk according to the [official manual][manual]. - -## Mount partitions - -Then properly mount the formatted partitions at `/mnt`, so that you can -install your system to those new partitions. - -Mount `nixos` partition to `/mnt` and — for UEFI — `boot` -partition to `/mnt/boot`: - -```console -$ mount /dev/disk/by-label/nixos /mnt -$ mkdir -p /mnt/boot && mount /dev/disk/by-label/boot /mnt/boot # UEFI only -$ swapon /dev/disk/by-label/swap -``` - -Add some extra space to the store. In the iso, it's running on a tmpfs -off your RAM: -```console -$ mkdir -p /mnt/tmpstore/{work,store} -$ mount -t overlay overlay -olowerdir=/nix/store,upperdir=/mnt/tmpstore/store,workdir=/mnt/tmpstore/work /nix/store -``` - -## Install - -Install off of a copy of devos from the time the iso was built: - -```console -$ cd /iso/devos -$ nixos-install --flake .#NixOS -``` - -## Notes of interest - -### Remote access to the live installer - -The iso live installer comes preconfigured with a network configuration -which announces it's hostname via [MulticastDNS][mDNS] as `hostname.local`, -that is `bootstrap.local` in the [iso example](./iso). - -In the rare case that [MulticastDNS][mDNS] is not availabe or turned off -in your network, there is a static link-local IPv6 address configured to -`fe80::47`(mnemonic from the letter's position in the english alphabet: -`n=14 i=9 x=24; 47 = n+i+x`). - -Provided that you have added your public key to the authorized keys of the -`root` user _(hint: [`deploy-rs`](../integrations/deploy.md) needs passwordless -sudo access)_: - -```nix -{ ... }: -{ - users.users.root.openssh.authorizedKeys.keyFiles = [ - ../secrets/path/to/key.pub - ]; -} -``` - -You can then ssh into the live installer through one of the -following options: - -```console -ssh root@bootstrap.local - -ssh root@fe80::47%eno1 # where eno1 is your network interface on which you are linked to the target -``` - -_Note: the [static link-local IPv6 address][staticLLA] and [MulticastDNS][mDNS] is only -configured on the live installer. If you wish to enable [MulticastDNS][mDNS] -for your environment, you ought to configure that in a regular [profile](../concepts/profiles.md)._ - -### EUI-64 LLA & Host Identity - -The iso's IPv6 Link Local Address (LLA) is configured with a static 64-bit Extended -Unique Identifiers (EUI-64) that is derived from the host interface's Message -Authentication Code (MAC) address. - -After a little while (a few seconds), you can remotely discover this unique and host -specific address over [NDP][NDP] for example with: - -```console -ip -6 neigh show # also shows fe80::47 -``` - -***This LLA is stable for the host, unless you need to swap that particular network card.*** -Under this reservation, though, you may use this EUI-64 to wire up a specific -(cryptographic) host identity. - - -[manual]: https://nixos.org/manual/nixos/stable/index.html#sec-installation-partitioning -[mDNS]: https://en.wikipedia.org/wiki/Multicast_DNS -[NDP]: https://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol -[staticLLA]: https://tools.ietf.org/html/rfc7404 diff --git a/doc/start/from-nixos.md b/doc/start/from-nixos.md deleted file mode 100644 index 0e1d48cb..00000000 --- a/doc/start/from-nixos.md +++ /dev/null @@ -1,54 +0,0 @@ -# From NixOS - -## Generate Configuration -Assuming you're happy with your existing partition layout, you can generate a -basic NixOS configuration for your system using: -```sh -flk up -``` - -This will make a new file `hosts/up-$(hostname).nix`, which you can edit to -your liking. - -You must then add a host to `nixos.hosts` in flake.nix: -```nix -{ - nixos.hosts = { - modules = hosts/NixOS.nix; - }; -} -``` - -Make sure your `i18n.defaultLocale` and `time.timeZone` are set properly for -your region. Keep in mind that `networking.hostName` will be automatically -set to the name of your host; - -Now might be a good time to read the docs on [suites](../concepts/suites.md) and -[profiles](../concepts/profiles.md) and add or create any that you need. - -> ##### _Note:_ -> While the `up` sub-command is provided as a convenience to quickly set up and -> install a "fresh" NixOS system on current hardware, committing these files is -> discouraged. -> -> They are placed in the git staging area automatically because they would be -> invisible to the flake otherwise, but it is best to move what you need from -> them directly into a host module of your own making, and commit that instead. -# Installation - -Once you're ready to deploy `hosts/my-host.nix`: -```sh -flk my-host switch -``` - - -This calls `nixos-rebuild` with sudo to build and install your configuration. - -> ##### _Notes:_ -> - Instead of `switch`, you can pass `build`, `test`, `boot`, etc just as with -> `nixos-rebuild`. -> -> - It is convenient to have the template living at `/etc/nixos` so you can -> simply `sudo nixos-rebuild switch` from anywhere on the system, but it is -> not required. - diff --git a/doc/start/index.md b/doc/start/index.md deleted file mode 100644 index f3f1127f..00000000 --- a/doc/start/index.md +++ /dev/null @@ -1,41 +0,0 @@ -# Quick Start -The only dependency is nix, so make sure you have it [installed][install-nix]. - -## Get the Template -Here is a snippet that will get you the template without the git history: -```sh -nix-shell -p cachix --run "cachix use nrdxp" - -nix-shell https://github.com/divnix/devos/archive/core.tar.gz -A shell \ - --run "flk get core" - -cd flk - -nix-shell - -git init -git add . -git commit -m init -``` - -This will place you in a new folder named `flk` with git initialized, and a -nix-shell that provides all the dependencies, including the unstable nix -version required. - -In addition, the [binary cache](../integrations/cachix.md) is added for faster deployment. - -> ##### _Notes:_ -> - Flakes ignore files that have not been added to git, so be sure to stage new -> files before building the system. -> - You can choose to simply clone the repo with git if you want to follow -> upstream changes. -> - If the `nix-shell -p cachix --run "cachix use nrdxp"` line doesn't work -> you can try with sudo: `sudo nix-shell -p cachix --run "cachix use nrdxp"` - -## Next Steps: -- [Make installable ISO](./iso.md) -- [Bootstrap Host](./bootstrapping.md) -- [Already on NixOS](./from-nixos.md) - - -[install-nix]: https://nixos.org/manual/nix/stable/#sect-multi-user-installation diff --git a/doc/start/iso.md b/doc/start/iso.md deleted file mode 100644 index 76af1c6e..00000000 --- a/doc/start/iso.md +++ /dev/null @@ -1,22 +0,0 @@ -# ISO - -Making and writing an installable iso for `hosts/bootstrap.nix` is as simple as: -```sh -bud build bootstrap bootstrapIso -sudo -E $(which bud) burn -``` - -This works for any host. - -## ISO image nix store & cache - -The iso image holds the store to the live environment and _also_ acts as a binary cache -to the installer. To considerably speed up things, the image already includes all flake -`inputs` as well as the `devshell` closures. - -While you _could_ provision any machine with a single stick, a custom-made iso for -the host you want to install DevOS to, maximises those local cache hits. - -For hosts that don't differ too much, a single usb stick might be ok, whereas when -there are bigger differences, a custom-made usb stick will be considerably faster. - diff --git a/doc/tests.md b/doc/tests.md deleted file mode 100644 index 1d7b65e2..00000000 --- a/doc/tests.md +++ /dev/null @@ -1,33 +0,0 @@ -# Testing - -Testing is always an important aspect of any software development project, and -NixOS offers some incredibly powerful tools to write tests for your -configuration, and, optionally, run them in -[CI](./integrations/hercules.md). - -## Unit Tests -Unit tests can be created from regular derivations, and they can do -almost anything you can imagine. By convention, it is best to test your -packages during their [check phase][check]. All packages and their tests will -be built during CI. - -## Integration Tests -All your profiles defined in suites will be tested in a NixOS VM. - -You can write integration tests for one or more NixOS VMs that can, -optionally, be networked together, and yes, it's as awesome as it sounds! - -Be sure to use the `mkTest` function from digga, `digga.lib.pkgs-lib.mkTest` -which wraps the official [testing-python][testing-python] function to ensure -that the system is setup exactly as it is for a bare DevOS system. There are -already great resources for learning how to use these tests effectively, -including the official [docs][test-doc], a fantastic [blog post][test-blog], -and the examples in [nixpkgs][nixos-tests]. - -[test-doc]: https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests -[test-blog]: https://www.haskellforall.com/2020/11/how-to-use-nixos-for-lightweight.html -[default]: https://github.com/divnix/devos/tree/core/tests/default.nix -[run-test]: https://github.com/NixOS/nixpkgs/blob/6571462647d7316aff8b8597ecdf5922547bf365/lib/debug.nix#L154-L166 -[nixos-tests]: https://github.com/NixOS/nixpkgs/tree/master/nixos/tests -[testing-python]: https://github.com/NixOS/nixpkgs/tree/master/nixos/lib/testing-python.nix -[check]: https://nixos.org/manual/nixpkgs/stable/#ssec-check-phase diff --git a/doc/theme/highlight.js b/doc/theme/highlight.js deleted file mode 100644 index f4fd4fae..00000000 --- a/doc/theme/highlight.js +++ /dev/null @@ -1,6 +0,0 @@ -/* - Highlight.js 10.1.2 (edd73d24) - License: BSD-3-Clause - Copyright (c) 2006-2020, Ivan Sagalaev -*/ -var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!Object.hasOwnProperty.call(n,r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ignoreMatch(){this.ignore=!0}}function t(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){var t={};for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}function a(e){return e.nodeName.toLowerCase()}var i=Object.freeze({__proto__:null,escapeHTML:t,inherit:r,nodeStream:function(e){var n=[];return function e(t,r){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:r,node:i}),r=e(i,r),a(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:i}));return r}(e,0),n},mergeStreams:function(e,n,r){var i=0,s="",o=[];function l(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){s+=""}function d(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var g=l();if(s+=t(r.substring(i,g[0].offset)),i=g[0].offset,g===e){o.reverse().forEach(u);do{d(g.splice(0,1)[0]),g=l()}while(g===e&&g.length&&g[0].offset===i);o.reverse().forEach(c)}else"start"===g[0].event?o.push(g[0].node):o.pop(),d(g.splice(0,1)[0])}return s+t(r.substr(i))}});const s="",o=e=>!!e.kind;class l{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=t(e)}openNode(e){if(!o(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){o(e)&&(this.buffer+=s)}value(){return this.buffer}span(e){this.buffer+=``}}class c{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{c._collapse(e)}))}}class u extends c{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function d(e){return e?"string"==typeof e?e:e.source:null}const g="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",h={begin:"\\\\[\\s\\S]",relevance:0},f={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[h]},p={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[h]},b={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},m=function(e,n,t={}){var a=r({className:"comment",begin:e,end:n,contains:[]},t);return a.contains.push(b),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},v=m("//","$"),x=m("/\\*","\\*/"),E=m("#","$");var _=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:g,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>d(e)).join("")}(n,/.*\b/,e.binary,/\b.*/)),r({className:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:h,APOS_STRING_MODE:f,QUOTE_STRING_MODE:p,PHRASAL_WORDS_MODE:b,COMMENT:m,C_LINE_COMMENT_MODE:v,C_BLOCK_COMMENT_MODE:x,HASH_COMMENT_MODE:E,NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{className:"number",begin:g,relevance:0},BINARY_NUMBER_MODE:{className:"number",begin:"\\b(0b[01]+)",relevance:0},CSS_NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[h,{begin:/\[/,end:/\]/,relevance:0,contains:[h]}]}]},TITLE_MODE:{className:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}}),N="of and for in not or if then".split(" ");function w(e,n){return n?+n:function(e){return N.includes(e.toLowerCase())}(e)?0:1}const R=t,y=r,{nodeStream:O,mergeStreams:k}=i,M=Symbol("nomatch");return function(t){var a=[],i=Object.create(null),s=Object.create(null),o=[],l=!0,c=/(^(<[^>]+>|\t|)+|\n)/gm,g="Could not find the language '{}', did you forget to load/include a language module?";const h={disableAutodetect:!0,name:"Plain text",contains:[]};var f={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:u};function p(e){return f.noHighlightRe.test(e)}function b(e,n,t,r){var a={code:n,language:e};S("before:highlight",a);var i=a.result?a.result:m(a.language,a.code,t,r);return i.code=a.code,S("after:highlight",i),i}function m(e,t,a,s){var o=t;function c(e,n){var t=E.case_insensitive?n[0].toLowerCase():n[0];return Object.prototype.hasOwnProperty.call(e.keywords,t)&&e.keywords[t]}function u(){null!=y.subLanguage?function(){if(""!==A){var e=null;if("string"==typeof y.subLanguage){if(!i[y.subLanguage])return void k.addText(A);e=m(y.subLanguage,A,!0,O[y.subLanguage]),O[y.subLanguage]=e.top}else e=v(A,y.subLanguage.length?y.subLanguage:null);y.relevance>0&&(I+=e.relevance),k.addSublanguage(e.emitter,e.language)}}():function(){if(!y.keywords)return void k.addText(A);let e=0;y.keywordPatternRe.lastIndex=0;let n=y.keywordPatternRe.exec(A),t="";for(;n;){t+=A.substring(e,n.index);const r=c(y,n);if(r){const[e,a]=r;k.addText(t),t="",I+=a,k.addKeyword(n[0],e)}else t+=n[0];e=y.keywordPatternRe.lastIndex,n=y.keywordPatternRe.exec(A)}t+=A.substr(e),k.addText(t)}(),A=""}function h(e){return e.className&&k.openNode(e.className),y=Object.create(e,{parent:{value:y}})}function p(e){return 0===y.matcher.regexIndex?(A+=e[0],1):(L=!0,0)}var b={};function x(t,r){var i=r&&r[0];if(A+=t,null==i)return u(),0;if("begin"===b.type&&"end"===r.type&&b.index===r.index&&""===i){if(A+=o.slice(r.index,r.index+1),!l){const n=Error("0 width match regex");throw n.languageName=e,n.badRule=b.rule,n}return 1}if(b=r,"begin"===r.type)return function(e){var t=e[0],r=e.rule;const a=new n(r),i=[r.__beforeBegin,r["on:begin"]];for(const n of i)if(n&&(n(e,a),a.ignore))return p(t);return r&&r.endSameAsBegin&&(r.endRe=RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),r.skip?A+=t:(r.excludeBegin&&(A+=t),u(),r.returnBegin||r.excludeBegin||(A=t)),h(r),r.returnBegin?0:t.length}(r);if("illegal"===r.type&&!a){const e=Error('Illegal lexeme "'+i+'" for mode "'+(y.className||"")+'"');throw e.mode=y,e}if("end"===r.type){var s=function(e){var t=e[0],r=o.substr(e.index),a=function e(t,r,a){let i=function(e,n){var t=e&&e.exec(n);return t&&0===t.index}(t.endRe,a);if(i){if(t["on:end"]){const e=new n(t);t["on:end"](r,e),e.ignore&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,r,a)}(y,e,r);if(!a)return M;var i=y;i.skip?A+=t:(i.returnEnd||i.excludeEnd||(A+=t),u(),i.excludeEnd&&(A=t));do{y.className&&k.closeNode(),y.skip||y.subLanguage||(I+=y.relevance),y=y.parent}while(y!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),h(a.starts)),i.returnEnd?0:t.length}(r);if(s!==M)return s}if("illegal"===r.type&&""===i)return 1;if(B>1e5&&B>3*r.index)throw Error("potential infinite loop, way more iterations than matches");return A+=i,i.length}var E=T(e);if(!E)throw console.error(g.replace("{}",e)),Error('Unknown language: "'+e+'"');var _=function(e){function n(n,t){return RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,n="|"){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i0&&(a+=n),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"===l[0][0]&&l[1]?a+="\\"+(+l[1]+s):(a+=l[0],"("===l[0]&&r++)}a+=")"}return a}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex((e,n)=>n>0&&void 0!==e),r=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,r)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;const t=n.exec(e);return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),t}}function i(e,n){const t=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==t&&"."!==r||n.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return function t(s,o){const l=s;if(s.compiled)return l;s.compiled=!0,s.__beforeBegin=null,s.keywords=s.keywords||s.beginKeywords;let c=null;if("object"==typeof s.keywords&&(c=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=function(e,n){var t={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(n){r(n,e[n])})),t;function r(e,r){n&&(r=r.toLowerCase()),r.split(" ").forEach((function(n){var r=n.split("|");t[r[0]]=[e,w(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemes&&c)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return l.keywordPatternRe=n(s.lexemes||c||/\w+/,!0),o&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__beforeBegin=i),s.begin||(s.begin=/\B|\b/),l.beginRe=n(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(l.endRe=n(s.end)),l.terminator_end=d(s.end)||"",s.endsWithParent&&o.terminator_end&&(l.terminator_end+=(s.end?"|":"")+o.terminator_end)),s.illegal&&(l.illegalRe=n(s.illegal)),void 0===s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(n){return r(e,{variants:null},n)}))),e.cached_variants?e.cached_variants:function e(n){return!!n&&(n.endsWithParent||e(n.starts))}(e)?r(e,{starts:e.starts?r(e.starts):null}):Object.isFrozen(e)?r(e):e}("self"===e?s:e)}))),s.contains.forEach((function(e){t(e,l)})),s.starts&&t(s.starts,o),l.matcher=function(e){const n=new a;return e.contains.forEach(e=>n.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&n.addRule(e.terminator_end,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(l),l}(e)}(E),N="",y=s||_,O={},k=new f.__emitter(f);!function(){for(var e=[],n=y;n!==E;n=n.parent)n.className&&e.unshift(n.className);e.forEach(e=>k.openNode(e))}();var A="",I=0,S=0,B=0,L=!1;try{for(y.matcher.considerAll();;){B++,L?L=!1:(y.matcher.lastIndex=S,y.matcher.considerAll());const e=y.matcher.exec(o);if(!e)break;const n=x(o.substring(S,e.index),e);S=e.index+n}return x(o.substr(S)),k.closeAllNodes(),k.finalize(),N=k.toHTML(),{relevance:I,value:N,language:e,illegal:!1,emitter:k,top:y}}catch(n){if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:n.message,context:o.slice(S-100,S+100),mode:n.mode},sofar:N,relevance:0,value:R(o),emitter:k};if(l)return{illegal:!1,relevance:0,value:R(o),emitter:k,language:e,top:y,errorRaised:n};throw n}}function v(e,n){n=n||f.languages||Object.keys(i);var t=function(e){const n={relevance:0,emitter:new f.__emitter(f),value:R(e),illegal:!1,top:h};return n.emitter.addText(e),n}(e),r=t;return n.filter(T).filter(I).forEach((function(n){var a=m(n,e,!1);a.language=n,a.relevance>r.relevance&&(r=a),a.relevance>t.relevance&&(r=t,t=a)})),r.language&&(t.second_best=r),t}function x(e){return f.tabReplace||f.useBR?e.replace(c,e=>"\n"===e?f.useBR?"
":e:f.tabReplace?e.replace(/\t/g,f.tabReplace):e):e}function E(e){let n=null;const t=function(e){var n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=f.languageDetectRe.exec(n);if(t){var r=T(t[1]);return r||(console.warn(g.replace("{}",t[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?t[1]:"no-highlight"}return n.split(/\s+/).find(e=>p(e)||T(e))}(e);if(p(t))return;S("before:highlightBlock",{block:e,language:t}),f.useBR?(n=document.createElement("div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"):n=e;const r=n.textContent,a=t?b(t,r,!0):v(r),i=O(n);if(i.length){const e=document.createElement("div");e.innerHTML=a.value,a.value=k(i,O(e),r)}a.value=x(a.value),S("after:highlightBlock",{block:e,result:a}),e.innerHTML=a.value,e.className=function(e,n,t){var r=n?s[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),e.includes(r)||a.push(r),a.join(" ").trim()}(e.className,t,a.language),e.result={language:a.language,re:a.relevance,relavance:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance,relavance:a.second_best.relevance})}const N=()=>{if(!N.called){N.called=!0;var e=document.querySelectorAll("pre code");a.forEach.call(e,E)}};function T(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]}function A(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach(e=>{s[e]=n})}function I(e){var n=T(e);return n&&!n.disableAutodetect}function S(e,n){var t=e;o.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(t,{highlight:b,highlightAuto:v,fixMarkup:x,highlightBlock:E,configure:function(e){f=y(f,e)},initHighlighting:N,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",N,!1)},registerLanguage:function(e,n){var r=null;try{r=n(t)}catch(n){if(console.error("Language definition for '{}' could not be registered.".replace("{}",e)),!l)throw n;console.error(n),r=h}r.name||(r.name=e),i[e]=r,r.rawDefinition=n.bind(null,t),r.aliases&&A(r.aliases,{languageName:e})},listLanguages:function(){return Object.keys(i)},getLanguage:T,registerAliases:A,requireLanguage:function(e){var n=T(e);if(n)return n;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:I,inherit:y,addPlugin:function(e){o.push(e)}}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString="10.1.2";for(const n in _)"object"==typeof _[n]&&e(_[n]);return Object.assign(t,_),t}({})}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);hljs.registerLanguage("xml",function(){"use strict";return function(e){var n={className:"symbol",begin:"&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;"},a={begin:"\\s",contains:[{className:"meta-keyword",begin:"#?[a-z_][a-z1-9_-]+",illegal:"\\n"}]},s=e.inherit(a,{begin:"\\(",end:"\\)"}),t=e.inherit(e.APOS_STRING_MODE,{className:"meta-string"}),i=e.inherit(e.QUOTE_STRING_MODE,{className:"meta-string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:"",relevance:10,contains:[a,i,t,s,{begin:"\\[",end:"\\]",contains:[{className:"meta",begin:"",contains:[a,s,i,t]}]}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:")",end:">",keywords:{name:"style"},contains:[c],starts:{end:"",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:")",end:">",keywords:{name:"script"},contains:[c],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:"",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},c]}]}}}());hljs.registerLanguage("markdown",function(){"use strict";return function(n){const e={begin:"<",end:">",subLanguage:"xml",relevance:0},a={begin:"\\[.+?\\][\\(\\[].*?[\\)\\]]",returnBegin:!0,contains:[{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0,relevance:0},{className:"link",begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}],relevance:10},i={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},s={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};i.contains.push(s),s.contains.push(i);var c=[e,a];return i.contains=i.contains.concat(c),s.contains=s.contains.concat(c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:c=c.concat(i,s)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:c}]}]},e,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:c,end:"$"},{className:"code",variants:[{begin:"(`{3,})(.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})(.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}}());hljs.registerLanguage("perl",function(){"use strict";return function(e){var n={$pattern:/[\w.]+/,keyword:"getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmget sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when"},t={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},s={begin:"->{",end:"}"},r={variants:[{begin:/\$\d/},{begin:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{begin:/[\$%@][^\s\w{]/,relevance:0}]},i=[e.BACKSLASH_ESCAPE,t,r],a=[r,e.HASH_COMMENT_MODE,e.COMMENT("^\\=\\w","\\=cut",{endsWithParent:!0}),s,{className:"string",contains:i,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*\\<",end:"\\>",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:"{\\w+}",contains:[],relevance:0},{begin:"-?\\w+\\s*\\=\\>",contains:[],relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",begin:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",relevance:10},{className:"regexp",begin:"(m|qr)?/",end:"/[a-z]*",contains:[e.BACKSLASH_ESCAPE],relevance:0}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return t.contains=a,s.contains=a,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:a}}}());hljs.registerLanguage("plaintext",function(){"use strict";return function(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}}());hljs.registerLanguage("ini",function(){"use strict";function e(e){return e?"string"==typeof e?e:e.source:null}function n(...n){return n.map(n=>e(n)).join("")}return function(a){var s={className:"number",relevance:0,variants:[{begin:/([\+\-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},i=a.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];var t={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)}/}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,r,t,l,s,"self"],relevance:0},g="("+[/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/].map(n=>e(n)).join("|")+")";return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:n(g,"(\\s*\\.\\s*",g,")*",n("(?=",/\s*=\s*[^#\s]/,")")),className:"attr",starts:{end:/$/,contains:[i,c,r,t,l,s]}}]}}}());hljs.registerLanguage("json",function(){"use strict";return function(n){var e={literal:"true false null"},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],t=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:t,keywords:e},l={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(a,{begin:/:/})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(a)],illegal:"\\S"};return t.push(l,s),i.forEach((function(n){t.push(n)})),{name:"JSON",contains:t,keywords:e,illegal:"\\S"}}}());hljs.registerLanguage("ruby",function(){"use strict";return function(e){var n="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",a={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},s={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},r=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^\\=begin","^\\=end",{contains:[s],relevance:10}),e.COMMENT("^__END__","\\n$")],c={className:"subst",begin:"#\\{",end:"}",keywords:a},t={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[qQwWx]?\\(",end:"\\)"},{begin:"%[qQwWx]?\\[",end:"\\]"},{begin:"%[qQwWx]?{",end:"}"},{begin:"%[qQwWx]?<",end:">"},{begin:"%[qQwWx]?/",end:"/"},{begin:"%[qQwWx]?%",end:"%"},{begin:"%[qQwWx]?-",end:"-"},{begin:"%[qQwWx]?\\|",end:"\\|"},{begin:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{begin:/<<[-~]?'?(\w+)(?:.|\n)*?\n\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},b={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:a},d=[t,i,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE}]}].concat(r)},{className:"function",beginKeywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),b].concat(r)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(\\!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[t,{begin:n}],relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{className:"params",begin:/\|/,end:/\|/,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[i,{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r{",end:"}[a-z]*"},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(r),relevance:0}].concat(r);c.contains=d,b.contains=d;var g=[{begin:/^\s*=>/,starts:{end:"$",contains:d}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{end:"$",contains:d}}];return{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:r.concat(g).concat(d)}}}());hljs.registerLanguage("yaml",function(){"use strict";return function(e){var n="true false yes no null",a="[\\w#;/?:@&=+$,.~*\\'()[\\]]+",s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:"{{",end:"}}"},{begin:"%{",end:"}"}]}]},i=e.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l={end:",",endsWithParent:!0,excludeEnd:!0,contains:[],keywords:n,relevance:0},t={begin:"{",end:"}",contains:[l],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[l],illegal:"\\n",relevance:0},b=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---s*$",relevance:10},{className:"string",begin:"[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"\\-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b"},t,g,s],c=[...b];return c.pop(),c.push(i),l.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml","YAML"],contains:b}}}());hljs.registerLanguage("haskell",function(){"use strict";return function(e){var n={variants:[e.COMMENT("--","$"),e.COMMENT("{-","-}",{contains:["self"]})]},i={className:"meta",begin:"{-#",end:"#-}"},a={className:"meta",begin:"^#",end:"$"},s={className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},l={begin:"\\(",end:"\\)",illegal:'"',contains:[i,a,{className:"type",begin:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},e.inherit(e.TITLE_MODE,{begin:"[_a-z][\\w']*"}),n]};return{name:"Haskell",aliases:["hs"],keywords:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",contains:[{beginKeywords:"module",end:"where",keywords:"module where",contains:[l,n],illegal:"\\W\\.|;"},{begin:"\\bimport\\b",end:"$",keywords:"import qualified as hiding",contains:[l,n],illegal:"\\W\\.|;"},{className:"class",begin:"^(\\s*)?(class|instance)\\b",end:"where",keywords:"class family instance where",contains:[s,l,n]},{className:"class",begin:"\\b(data|(new)?type)\\b",end:"$",keywords:"data family type newtype deriving",contains:[i,s,l,{begin:"{",end:"}",contains:l.contains},n]},{beginKeywords:"default",end:"$",contains:[s,l,n]},{beginKeywords:"infix infixl infixr",end:"$",contains:[e.C_NUMBER_MODE,n]},{begin:"\\bforeign\\b",end:"$",keywords:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",contains:[s,e.QUOTE_STRING_MODE,n]},{className:"meta",begin:"#!\\/usr\\/bin\\/env runhaskell",end:"$"},i,a,e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,s,e.inherit(e.TITLE_MODE,{begin:"^[_a-z][\\w']*"}),n,{begin:"->|<-"}]}}}());hljs.registerLanguage("nix",function(){"use strict";return function(e){var n={keyword:"rec with let in inherit assert if else then",literal:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"},i={className:"subst",begin:/\$\{/,end:/}/,keywords:n},t={className:"string",contains:[i],variants:[{begin:"''",end:"''"},{begin:'"',end:'"'}]},s=[e.NUMBER_MODE,e.HASH_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t,{begin:/[a-zA-Z0-9-_]+(\s*=)/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/\S+/}]}];return i.contains=s,{name:"Nix",aliases:["nixos"],keywords:n,contains:s}}}());hljs.registerLanguage("bash",function(){"use strict";return function(e){const s={};Object.assign(s,{className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{/,end:/\}/,contains:[{begin:/:-/,contains:[s]}]}]});const t={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,t]};t.contains.push(n);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,s]},i=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b-?[a-z\._]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[i,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,n,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},s]}}}());hljs.registerLanguage("shell",function(){"use strict";return function(s){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:"^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]",starts:{end:"$",subLanguage:"bash"}}]}}}());hljs.registerLanguage("python",function(){"use strict";return function(e){var n={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10",built_in:"Ellipsis NotImplemented",literal:"False None True"},a={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:n,illegal:/#/},s={begin:/\{\{/,relevance:0},r={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/(u|b)?r?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(u|b)?r?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(fr|rf|f)'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(fr|rf|f)"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(u|r|ur)'/,end:/'/,relevance:10},{begin:/(u|r|ur)"/,end:/"/,relevance:10},{begin:/(b|br)'/,end:/'/},{begin:/(b|br)"/,end:/"/},{begin:/(fr|rf|f)'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/(fr|rf|f)"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l={className:"number",relevance:0,variants:[{begin:e.BINARY_NUMBER_RE+"[lLjJ]?"},{begin:"\\b(0o[0-7]+)[lLjJ]?"},{begin:e.C_NUMBER_RE+"[lLjJ]?"}]},t={className:"params",variants:[{begin:/\(\s*\)/,skip:!0,className:null},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:["self",a,l,r,e.HASH_COMMENT_MODE]}]};return i.contains=[r,l,a],{name:"Python",aliases:["py","gyp","ipython"],keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[a,l,{beginKeywords:"if",relevance:0},r,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,t,{begin:/->/,endsWithParent:!0,keywords:"None"}]},{className:"meta",begin:/^[\t ]*@/,end:/$/},{begin:/\b(print|exec)\(/}]}}}()); diff --git a/flake.lock b/flake.lock index e2d0ff2d..f8b8dd09 100644 --- a/flake.lock +++ b/flake.lock @@ -3,15 +3,15 @@ "agenix": { "inputs": { "nixpkgs": [ - "nixos" + "nixpkgs" ] }, "locked": { - "lastModified": 1662241716, - "narHash": "sha256-urqPvSvvGUhkwzTDxUI8N1nsdMysbAfjmBNZaTYBZRU=", + "lastModified": 1665870395, + "narHash": "sha256-Tsbqb27LDNxOoPLh0gw2hIb6L/6Ow/6lIBvqcHzEKBI=", "owner": "ryantm", "repo": "agenix", - "rev": "c96da5835b76d3d8e8d99a0fec6fe32f8539ee2e", + "rev": "a630400067c6d03c9b3e0455347dc8559db14288", "type": "github" }, "original": { @@ -24,7 +24,7 @@ "inputs": { "flake-utils": "flake-utils", "nixpkgs": [ - "nixos" + "nixpkgs" ], "poonam": [ "poonam" @@ -45,53 +45,20 @@ "url": "ssh://gitea@git.sealight.xyz/aynish/basant" } }, - "blank": { - "locked": { - "lastModified": 1625557891, - "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", - "owner": "divnix", - "repo": "blank", - "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "blank", - "type": "github" - } - }, - "darwin": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1651916036, - "narHash": "sha256-UuD9keUGm4IuVEV6wdSYbuRm7CwfXE63hVkzKDjVsh4=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "2f2bdf658d2b79bada78dc914af99c53cad37cba", - "type": "github" - }, - "original": { - "owner": "LnL7", - "repo": "nix-darwin", - "type": "github" - } - }, "deploy": { "inputs": { "flake-compat": "flake-compat", "nixpkgs": [ - "nixos" + "nixpkgs" ], "utils": "utils" }, "locked": { - "lastModified": 1659725433, - "narHash": "sha256-1ZxuK67TL29YLw88vQ18Y2Y6iYg8Jb7I6/HVzmNB6nM=", + "lastModified": 1668797197, + "narHash": "sha256-0w6iD3GSSQbIeSFVDzAAQZB+hDq670ZTms3d9XI+BtM=", "owner": "serokell", "repo": "deploy-rs", - "rev": "41f15759dd8b638e7b4f299730d94d5aa46ab7eb", + "rev": "2a3c5f70eee04a465aa534d8bd4fcc9bb3c4a8ce", "type": "github" }, "original": { @@ -100,61 +67,6 @@ "type": "github" } }, - "devshell": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1655976588, - "narHash": "sha256-VreHyH6ITkf/1EX/8h15UqhddJnUleb0HgbC3gMkAEQ=", - "owner": "numtide", - "repo": "devshell", - "rev": "899ca4629020592a13a46783587f6e674179d1db", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "digga": { - "inputs": { - "blank": "blank", - "darwin": "darwin", - "deploy": [ - "deploy" - ], - "devshell": "devshell", - "flake-compat": "flake-compat_2", - "flake-utils-plus": "flake-utils-plus", - "home-manager": [ - "home" - ], - "latest": "latest", - "nixlib": [ - "nixos" - ], - "nixpkgs": [ - "nixos" - ], - "nixpkgs-unstable": "nixpkgs-unstable" - }, - "locked": { - "lastModified": 1659622306, - "narHash": "sha256-Kpfm2PNs+kZU0W7qcugoPATLG8I2P7FJFGTgsf1LJiU=", - "owner": "divnix", - "repo": "digga", - "rev": "d1193743a535d7fbbc7f3eda4e51295b10bd4d2c", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "digga", - "type": "github" - } - }, "dirt-samples-src": { "flake": false, "locked": { @@ -174,20 +86,20 @@ }, "eww": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_2", "nixpkgs": [ - "nixos" + "nixpkgs" ], "rust-overlay": [ "rust-overlay" ] }, "locked": { - "lastModified": 1663061357, - "narHash": "sha256-zMJslerxTcSQ+A8fI4gFcJioRGs+T55343zOtsnEJ3k=", + "lastModified": 1669643151, + "narHash": "sha256-39/l57QusriyNr426kXNqtub0ciZna+t20VKPYUAgsM=", "owner": "elkowar", "repo": "eww", - "rev": "52e9603dd8c79cbc267a4733389c1f7e7625b352", + "rev": "ec4c2d1a4f12e9c3664e9f53ad99007b4a10a16a", "type": "github" }, "original": { @@ -228,54 +140,6 @@ "type": "github" } }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_4": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_5": { - "flake": false, - "locked": { - "lastModified": 1648199409, - "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "locked": { "lastModified": 1638122382, @@ -291,56 +155,7 @@ "type": "github" } }, - "flake-utils-plus": { - "inputs": { - "flake-utils": "flake-utils_3" - }, - "locked": { - "lastModified": 1654029967, - "narHash": "sha256-my3GQ3mQIw/1f6GPV1IhUZrcYQSWh0YJAMPNBjhXJDw=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "6271cf3842ff9c8a9af9e3508c547f86bc77d199", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "ref": "refs/pull/120/head", - "repo": "flake-utils-plus", - "type": "github" - } - }, "flake-utils_2": { - "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { "locked": { "lastModified": 1652372896, "narHash": "sha256-lURGussfF3mGrFPQT3zgW7+RC0pBhbHzco0C7I+ilow=", @@ -355,7 +170,7 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_3": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -370,42 +185,12 @@ "type": "github" } }, - "flake-utils_6": { - "locked": { - "lastModified": 1649676176, - "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_7": { - "locked": { - "lastModified": 1656928814, - "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "grasp": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_2", "grasp": "grasp_2", "nixpkgs": [ - "nixos" + "nixpkgs" ] }, "locked": { @@ -439,217 +224,59 @@ "type": "github" } }, - "home": { + "hardware": { + "locked": { + "lastModified": 1670174919, + "narHash": "sha256-XdQr3BUnrvVLRFunLWrZORhwYHDG0+9jUUe0Jv1pths=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "9d87bc030a0bf3f00e953dbf095a7d8e852dab6b", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-hardware", + "type": "github" + } + }, + "home-manager": { "inputs": { "nixpkgs": [ - "nixos" + "nixpkgs" ], "utils": "utils_2" }, "locked": { - "lastModified": 1670156115, - "narHash": "sha256-L2FKLedprp3AkQ+GS+2Br7CYWeCmLCjt3zUd87p0lNQ=", + "lastModified": 1669978198, + "narHash": "sha256-U8sZFwIIDFm9w/Kx58sYrIsWpuQUKmkcQmdBkuQ+gkE=", "owner": "nix-community", "repo": "home-manager", - "rev": "e704ef9ec7a8ccf8711bb11ff68da06f1917a26d", + "rev": "71fa4cdf9cd89a3e0d452439b6a2f7f01d6292e9", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-22.11", "repo": "home-manager", "type": "github" } }, - "latest": { - "locked": { - "lastModified": 1657265485, - "narHash": "sha256-PUQ9C7mfi0/BnaAUX2R/PIkoNCb/Jtx9EpnhMBNrO/o=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "b39924fc7764c08ae3b51beef9a3518c414cdb7d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "latest_2": { - "locked": { - "lastModified": 1665081174, - "narHash": "sha256-6hsmzdhdy8Kbvl5e0xZNE83pW3fKQvNiobJkM6KQrgA=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "598f83ebeb2235435189cf84d844b8b73e858e0f", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "naersk": { - "inputs": { - "nixpkgs": [ - "nixos" - ] - }, - "locked": { - "lastModified": 1662220400, - "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", - "owner": "nmattia", - "repo": "naersk", - "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", - "type": "github" - }, - "original": { - "owner": "nmattia", - "repo": "naersk", - "type": "github" - } - }, - "neovim-flake": { - "inputs": { - "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "dir": "contrib", - "lastModified": 1663315670, - "narHash": "sha256-RGoY9o0dN6BhOcjhJxw6XYSxUIDu+tAJl4vp7d9EBSM=", - "owner": "neovim", - "repo": "neovim", - "rev": "0b7a3c173c929085f54a178c9fa852481d5f021e", - "type": "github" - }, - "original": { - "dir": "contrib", - "owner": "neovim", - "repo": "neovim", - "type": "github" - } - }, - "neovim-nightly": { - "inputs": { - "flake-compat": "flake-compat_4", - "neovim-flake": "neovim-flake", - "nixpkgs": [ - "nixos" - ] - }, - "locked": { - "lastModified": 1663316300, - "narHash": "sha256-QvFH3kiYJP+KTenixYDIp9bx3xyD36UQse3L4qfC6e4=", - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "rev": "dd84dca0ba386b7e49bae4255279d3c4cde9625c", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "type": "github" - } - }, - "nixos": { - "locked": { - "lastModified": 1670157845, - "narHash": "sha256-epO16PPDkhYicQWQkSYZxU3tJAML/rF0FESR6BMTpYw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "267a3d939c3aa4cea15d3b1ccac59f5e29c05bb3", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixos-hardware": { - "locked": { - "lastModified": 1663229557, - "narHash": "sha256-1uU4nsDLXKG0AHc/VCsNBAEPkTA/07juYhcEWRb1O1E=", - "owner": "nixos", - "repo": "nixos-hardware", - "rev": "a0df6cd6e199df4a78c833c273781ea92fa62cfb", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixos-hardware", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1663419078, - "narHash": "sha256-cxEeMnaTGMTeDAvXnZmqcF50qoyJOsQENhYxSnW9ZMs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0cfb3c002b61807ca0bab3efe514476bdf2e5478", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1657292830, - "narHash": "sha256-ldfVSTveWceDCmW6gf3B4kR6vwmz/XS80y5wsLLHFJU=", + "lastModified": 1669834992, + "narHash": "sha256-YnhZGHgb4C3Q7DSGisO/stc50jFb9F/MzHeKS4giotg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "334ec8b503c3981e37a04b817a70e8d026ea9e84", + "rev": "596a8e828c5dfa504f91918d0fa4152db3ab5502", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-unstable", + "ref": "nixos-22.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { - "locked": { - "lastModified": 1663419078, - "narHash": "sha256-cxEeMnaTGMTeDAvXnZmqcF50qoyJOsQENhYxSnW9ZMs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0cfb3c002b61807ca0bab3efe514476bdf2e5478", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1663357389, - "narHash": "sha256-oYA2nVRSi6yhCBqS5Vz465Hw+3BQOVFEhfbfy//3vTs=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "da6a05816e7fa5226c3f61e285ef8d9dfc868f3c", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1662446902, "narHash": "sha256-Dmsd3jSG2ldZUlhFaIwunqgMf14EEK7ylXpw+OPDLxE=", @@ -664,46 +291,9 @@ "type": "github" } }, - "nur": { - "locked": { - "lastModified": 1663680695, - "narHash": "sha256-sVdmg21MzIS0e+mCyIEInivIodJNYKVicZ3WJr907XI=", - "owner": "nix-community", - "repo": "NUR", - "rev": "a22f443201174496ce6edb237a2e9596591cd542", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, - "nvfetcher": { - "inputs": { - "flake-compat": "flake-compat_5", - "flake-utils": "flake-utils_6", - "nixpkgs": [ - "nixos" - ] - }, - "locked": { - "lastModified": 1654975372, - "narHash": "sha256-wkNZ16akgKViuZzE/IM+bux4uaJ04KIwUeexH8gBjgw=", - "owner": "berberman", - "repo": "nvfetcher", - "rev": "d4b237c10f14f72f8266b0f658faad822e491e55", - "type": "github" - }, - "original": { - "owner": "berberman", - "repo": "nvfetcher", - "type": "github" - } - }, "poonam": { "inputs": { - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_2", "vimwiki-cli": "vimwiki-cli" }, "locked": { @@ -726,35 +316,30 @@ "agenix": "agenix", "basant": "basant", "deploy": "deploy", - "digga": "digga", "eww": "eww", "grasp": "grasp", - "home": "home", - "latest": "latest_2", - "naersk": "naersk", - "neovim-nightly": "neovim-nightly", - "nixos": "nixos", - "nixos-hardware": "nixos-hardware", - "nur": "nur", - "nvfetcher": "nvfetcher", + "hardware": "hardware", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", "poonam": "poonam", "rust-overlay": "rust-overlay", - "tidalcycles": "tidalcycles" + "tidalcycles": "tidalcycles", + "unstable": "unstable" } }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_7", + "flake-utils": "flake-utils_3", "nixpkgs": [ - "nixos" + "nixpkgs" ] }, "locked": { - "lastModified": 1663383457, - "narHash": "sha256-WoHXGHVmOv883HyH2Rvqh3XJE0Dk2YSZfLJyedSMr4U=", + "lastModified": 1670207212, + "narHash": "sha256-uuKbbv0L+QoXiqO7METP9BihY0F7hJqGdKn7xDVfyFw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "e4c6adaa5f9293911de5ad50eaf32dbe36819de3", + "rev": "18823e511bc85ed27bfabe33cccecb389f9aa92d", "type": "github" }, "original": { @@ -801,7 +386,7 @@ "inputs": { "dirt-samples-src": "dirt-samples-src", "nixpkgs": [ - "latest" + "unstable" ], "superdirt-src": "superdirt-src", "tidal-src": "tidal-src", @@ -810,11 +395,11 @@ "vowel-src": "vowel-src" }, "locked": { - "lastModified": 1661670241, - "narHash": "sha256-+5C83z+Sd8ugvMshrXqpca4vv3tQ2D4tYEJ3QY6JVsg=", + "lastModified": 1664760044, + "narHash": "sha256-e5LGk/tDnphory1mYhADgPnVtShofY2w/3xY09jEE2A=", "owner": "mitchmindtree", "repo": "tidalcycles.nix", - "rev": "fefe3d586511e1cfaac79bb83ec0b278bb1b6bad", + "rev": "3f3a820cd43709077d15a24fa6062de7d623a6bf", "type": "github" }, "original": { @@ -823,6 +408,22 @@ "type": "github" } }, + "unstable": { + "locked": { + "lastModified": 1670064435, + "narHash": "sha256-+ELoY30UN+Pl3Yn7RWRPabykwebsVK/kYE9JsIsUMxQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "61a8a98e6d557e6dd7ed0cdb54c3a3e3bbc5e25c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1648297722, @@ -871,16 +472,16 @@ "vim-tidal-src": { "flake": false, "locked": { - "lastModified": 1661670183, - "narHash": "sha256-HU075U97COak/Xqw+4ifVkEEIgWzGvwRoR3q9LGKl8s=", - "owner": "mitchmindtree", + "lastModified": 1664252474, + "narHash": "sha256-hleiK2Q7xYndpB+tIbyyXIM2sk4NunUh9DPgMqmf/Wc=", + "owner": "tidalcycles", "repo": "vim-tidal", - "rev": "5c1e70ee3d2b4655b8ccba11422866c496610ca8", + "rev": "b07f5c12986fb837e055d7fcf0acf3b7e248148f", "type": "github" }, "original": { - "owner": "mitchmindtree", - "ref": "mitchmindtree", + "owner": "tidalcycles", + "ref": "master", "repo": "vim-tidal", "type": "github" } diff --git a/flake.nix b/flake.nix index 24d740d1..b3dda651 100644 --- a/flake.nix +++ b/flake.nix @@ -1,190 +1,198 @@ { - description = "A highly structured configuration database."; + description = "Your new nix config"; - inputs = - { - # Nix - nixos.url = "github:nixos/nixpkgs/release-22.11"; - latest.url = "github:nixos/nixpkgs/nixos-unstable"; - # Community - home.url = "github:nix-community/home-manager/release-22.11"; - home.inputs.nixpkgs.follows = "nixos"; - nixos-hardware.url = "github:nixos/nixos-hardware"; - # Lib - digga.url = "github:divnix/digga"; - digga.inputs.nixpkgs.follows = "nixos"; - digga.inputs.nixlib.follows = "nixos"; - digga.inputs.home-manager.follows = "home"; - digga.inputs.deploy.follows = "deploy"; - nvfetcher.url = "github:berberman/nvfetcher"; - nvfetcher.inputs.nixpkgs.follows = "nixos"; - naersk.url = "github:nmattia/naersk"; - naersk.inputs.nixpkgs.follows = "nixos"; - nur.url = "github:nix-community/NUR"; - # Tools - agenix.url = "github:ryantm/agenix"; - agenix.inputs.nixpkgs.follows = "nixos"; - deploy.url = "github:serokell/deploy-rs"; - deploy.inputs.nixpkgs.follows = "nixos"; - # Packages - poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main"; - basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main"; - basant.inputs.nixpkgs.follows = "nixos"; - basant.inputs.poonam.follows = "poonam"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixos"; - }; - eww = { - url = "github:elkowar/eww"; - inputs.nixpkgs.follows = "nixos"; - inputs.rust-overlay.follows = "rust-overlay"; - }; - # eww follows rust nightly - # eww.inputs.nixpkgs.follows = "latest"; - grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main"; - grasp.inputs.nixpkgs.follows = "nixos"; - tidalcycles.url = "github:mitchmindtree/tidalcycles.nix"; - tidalcycles.inputs.nixpkgs.follows = "latest"; - neovim-nightly.url = "github:nix-community/neovim-nightly-overlay"; - neovim-nightly.inputs.nixpkgs.follows = "nixos"; - # TODO hundred rabbits software - # TODO not quite useful yet, since it needs secrets - # dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main"; - # dhyan.inputs.nixpkgs.follows = "nixos"; - # TODO needs secrets - # muneem.url = "git+ssh://gitea@git.sealight.xyz/aynish/muneem?ref=main"; - # muneem.inputs.nixpkgs.follows = "nixos"; + inputs = { + # Nixpkgs + nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; + unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + + # Home manager + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + hardware.url = "github:nixos/nixos-hardware"; + + # Tools + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; + deploy.url = "github:serokell/deploy-rs"; + deploy.inputs.nixpkgs.follows = "nixpkgs"; + # Packages + poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main"; + basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main"; + basant.inputs.nixpkgs.follows = "nixpkgs"; + basant.inputs.poonam.follows = "poonam"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; }; + eww = { + url = "github:elkowar/eww"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.rust-overlay.follows = "rust-overlay"; + }; + # eww follows rust nightly + # eww.inputs.nixpkgs.follows = "unstable"; + grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main"; + grasp.inputs.nixpkgs.follows = "nixpkgs"; + tidalcycles.url = "github:mitchmindtree/tidalcycles.nix"; + tidalcycles.inputs.nixpkgs.follows = "unstable"; + # TODO hundred rabbits software + # TODO not quite useful yet, since it needs secrets + # dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main"; + # dhyan.inputs.nixpkgs.follows = "nixpkgs"; + # TODO needs secrets + # muneem.url = "git+ssh://gitea@git.sealight.xyz/aynish/muneem?ref=main"; + # muneem.inputs.nixpkgs.follows = "nixpkgs"; + }; outputs = { self - , digga - , nixos - , home - , nixos-hardware - , nur - , agenix - , nvfetcher + , nixpkgs + , unstable + , home-manager , deploy + , agenix , basant , grasp , tidalcycles - , neovim-nightly , rust-overlay , eww , ... - } @ inputs: - digga.lib.mkFlake - { - inherit self inputs; - supportedSystems = [ - "x86_64-linux" + }@inputs: + let + inherit (self) outputs; + forAllSystems = nixpkgs.lib.genAttrs [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + nixpkgsFor = forAllSystems (system: import nixpkgs { + inherit system; + allowUnfree = true; + overlays = [ + rust-overlay.overlays.default + deploy.overlay + tidalcycles.overlays.default + agenix.overlay + # unstable.overlay + # self.overlays ]; + }); + in + { + # Your custom packages + # Acessible through 'nix build', 'nix shell', etc + packages = forAllSystems (system: + let pkgs = nixpkgsFor.${system}; + in import ./pkgs { pkgs = pkgs; } + ); + # Devshell for bootstrapping + # Acessible through 'nix develop' or 'nix-shell' (legacy) + devShells = forAllSystems (system: + let pkgs = nixpkgsFor.${system}; + in import ./shell.nix { pkgs = pkgs; } + ); - channelsConfig = { allowUnfree = true; }; + # Your custom packages and modifications, exported as overlays + overlays = import ./overlays; + # Reusable nixos modules you might want to export + # These are usually stuff you would upstream into nixpkgs + nixosModules = import ./modules/nixos; + # Reusable home-manager modules you might want to export + # These are usually stuff you would upstream into home-manager + homeManagerModules = import ./modules/home-manager; - channels = { - nixos = { - imports = [ (digga.lib.importOverlays ./overlays) ]; - overlays = [ - nur.overlay - agenix.overlay - nvfetcher.overlay - deploy.overlay - ./pkgs/default.nix - tidalcycles.overlays.default - # neovim-nightly.overlay - rust-overlay.overlays.default - eww.overlays.default - ]; - }; - latest = { }; + # NixOS configuration entrypoint + nixosConfigurations = { + curve = nixpkgs.lib.nixosSystem rec { + specialArgs = { inherit self inputs outputs; }; + system = "x86_64-linux"; + pkgs = nixpkgsFor.${system}; + modules = [ + ./hosts/curve + home-manager.nixosModules.home-manager + self.nixosModules.wallabag + self.nixosModules.gonic + self.nixosModules.backup + self.nixosModules.wireguard + agenix.nixosModules.age + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + # home-manager.users.anish = import ./home/gui; + } + ]; }; - - lib = import ./lib { lib = digga.lib // nixos.lib; }; - - sharedOverlays = [ - (final: prev: { - __dontExport = true; - lib = prev.lib.extend (lfinal: lprev: { - our = self.lib; - }); - }) - ]; - - nixos = { - hostDefaults = { - system = "x86_64-linux"; - channelName = "nixos"; - imports = [ (digga.lib.importExportableModules ./modules) ]; - modules = [ - { lib.our = self.lib; } - digga.nixosModules.nixConfig - home.nixosModules.home-manager - agenix.nixosModules.age - ]; - }; - - imports = [ (digga.lib.importHosts ./hosts) ]; - hosts = { - /* set host specific properties here */ - curve = { - modules = [ - ]; # nixos-hardware.nixosModules.lenovo-thinkpad - # Yubikey - }; - cube = { - modules = [ basant.nixosModule ]; - }; - box = { - modules = [ - grasp.nixosModule - ]; - }; - # helix = { }; - # work = { }; - }; - importables = rec { - profiles = digga.lib.rakeLeaves ./profiles // { - users = digga.lib.rakeLeaves ./users; - }; - suites = with profiles; rec { - base = [ core users.root users.anish ]; - sealight = [ base server metrics gitea rss-bridge mount-mossnet freshrss ]; - lituus = [ base server metrics sealight-website matrix wireguard-server ]; - mossnet = [ base server taskd shaarli dns monitoring nfs gonic headphones radicale seafile syncthing dhyan calibre wallabag finance ]; # hpi sync.music muneem - cube = [ base site server ]; - graphical = [ base bluetooth music sync.kitaab sync.website sync.cal wifi desktop mimetypes ]; - curve = [ graphical secrets syncthing ]; - work = [ base ]; - }; - }; - }; - - home = { - imports = [ (digga.lib.importExportableModules ./users/modules) ]; - # exportedModules = [ ]; - # modules = [ ]; - importables = rec { - profiles = digga.lib.rakeLeaves ./users/profiles; - suites = with profiles; rec { - hmBase = [ direnv git nvim cli task ]; - gui = [ hmBase firefox desktop email cal ]; - work = [ hmBase firefox ]; - }; - }; - users = { - nixos = { suites, ... }: { imports = suites.hmBase; }; - # anish = { suites, ... }: { imports = suites.gui; }; - anishlakhwara = { suites, ... }: { imports = suites.work; }; - }; # digga.lib.importers.rakeLeaves ./users/hm; - }; - - devshell = ./shell; - - homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; - - deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; + # helix = pkgs.lib.nixosSystem { + # specialArgs = { inherit inputs outputs; }; + # modules = [ + # ./hosts/helix + # home-manager.nixosModules.home-manager + # { + # home-manager.useGlobalPkgs = true; + # home-manager.useUserPackages = true; + # home-manager.users.anish = import ./home/core; + # } + # ]; + # }; + # lituus = pkgs.lib.nixosSystem { + # specialArgs = { inherit inputs outputs; }; + # modules = [ + # ./hosts/lituus + # home-manager.nixosModules.home-manager + # { + # home-manager.useGlobalPkgs = true; + # home-manager.useUserPackages = true; + # home-manager.users.anish = import ./home/core; + # } + # ]; + # }; + # cube = pkgs.lib.nixosSystem { + # specialArgs = { inherit inputs outputs; }; + # modules = [ + # ./hosts/cube + # home-manager.nixosModules.home-manager + # { + # home-manager.useGlobalPkgs = true; + # home-manager.useUserPackages = true; + # home-manager.users.anish = import ./home/core; + # } + # ]; + # }; + # box = pkgs.lib.nixosSystem { + # specialArgs = { inherit inputs outputs; }; + # modules = [ + # ./hosts/box + # home-manager.nixosModules.home-manager + # { + # home-manager.useGlobalPkgs = true; + # home-manager.useUserPackages = true; + # home-manager.users.anish = import ./home/core; + # } + # ]; + # }; }; + + # Standalone home-manager configuration entrypoint + # Available through 'home-manager --flake .#your-username@your-hostname' + homeConfigurations = { + "anish@work" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = { inherit inputs outputs; }; + modules = [ + ./home/core.nix + ]; + }; + }; + deploy.nodes = { + box.profiles.system = { + user = "root"; + path = deploy.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box; + }; + }; + + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy.lib; + }; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index 403ff39d..00000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,26 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, ... }: - -{ - imports = - [ - - ]; - - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { - device = "/dev/disk/by-uuid/3b8b2c4b-835e-4822-8ac8-0effdc8270d6"; - fsType = "btrfs"; - }; - - swapDevices = [ ]; - - nix.maxJobs = lib.mkDefault 1; -} diff --git a/home/core/default.nix b/home/core/default.nix new file mode 100644 index 00000000..987f76ff --- /dev/null +++ b/home/core/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +{ + import = [ + ../profiles/nvim + ../profiles/cli + ../profiles/direnv + ../profiles/git + ../profiles/task + ]; +} diff --git a/home/gui/default.nix b/home/gui/default.nix new file mode 100644 index 00000000..8f9febb4 --- /dev/null +++ b/home/gui/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +{ + import = [ + ../core + ../profiles/firefox + ../profiles/desktop + ../profiles/email + ../profiles/cal + ]; +} diff --git a/home/home.nix b/home/home.nix new file mode 100644 index 00000000..7595b4f9 --- /dev/null +++ b/home/home.nix @@ -0,0 +1,62 @@ +# This is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) + +{ inputs, outputs, lib, config, pkgs, ... }: { + # You can import other home-manager modules here + imports = [ + # If you want to use modules your own flake exports (from modules/home-manager): + # outputs.homeManagerModules.example + + # Or modules exported from other flakes (such as nix-colors): + # inputs.nix-colors.homeManagerModules.default + + # You can also split up your configuration and import pieces of it here: + # ./nvim.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # If you want to use overlays your own flake exports (from overlays dir): + # outputs.overlays.modifications + # outputs.overlays.additions + + # Or overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + # Workaround for https://github.com/nix-community/home-manager/issues/2942 + allowUnfreePredicate = (_: true); + }; + }; + + # TODO: Set your username + home = { + username = "anish"; + homeDirectory = "/home/anish/"; + }; + + # Add stuff for your user as you see fit: + # programs.neovim.enable = true; + # home.packages = with pkgs; [ steam ]; + + # Enable home-manager and git + programs.home-manager.enable = true; + # programs.git.enable = true; + + # Nicely reload system units when changing configs + # systemd.user.startServices = "sd-switch"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "22.05"; +} diff --git a/users/profiles/ayu/kitty.conf b/home/profiles/ayu/kitty.conf similarity index 100% rename from users/profiles/ayu/kitty.conf rename to home/profiles/ayu/kitty.conf diff --git a/users/profiles/cal/default.nix b/home/profiles/cal/default.nix similarity index 100% rename from users/profiles/cal/default.nix rename to home/profiles/cal/default.nix diff --git a/users/profiles/cli/default.nix b/home/profiles/cli/default.nix similarity index 100% rename from users/profiles/cli/default.nix rename to home/profiles/cli/default.nix diff --git a/profiles/core/starship.toml b/home/profiles/cli/starship.toml similarity index 100% rename from profiles/core/starship.toml rename to home/profiles/cli/starship.toml diff --git a/users/profiles/desktop/Xresources b/home/profiles/desktop/Xresources similarity index 100% rename from users/profiles/desktop/Xresources rename to home/profiles/desktop/Xresources diff --git a/users/profiles/desktop/ayu-Xresources b/home/profiles/desktop/ayu-Xresources similarity index 100% rename from users/profiles/desktop/ayu-Xresources rename to home/profiles/desktop/ayu-Xresources diff --git a/users/profiles/desktop/ayu-dark-kitty.conf b/home/profiles/desktop/ayu-dark-kitty.conf similarity index 100% rename from users/profiles/desktop/ayu-dark-kitty.conf rename to home/profiles/desktop/ayu-dark-kitty.conf diff --git a/users/profiles/desktop/ayu-kitty.conf b/home/profiles/desktop/ayu-kitty.conf similarity index 100% rename from users/profiles/desktop/ayu-kitty.conf rename to home/profiles/desktop/ayu-kitty.conf diff --git a/users/profiles/desktop/background.jpg b/home/profiles/desktop/background.jpg similarity index 100% rename from users/profiles/desktop/background.jpg rename to home/profiles/desktop/background.jpg diff --git a/users/profiles/desktop/bin/hotplug-monitor.sh b/home/profiles/desktop/bin/hotplug-monitor.sh similarity index 100% rename from users/profiles/desktop/bin/hotplug-monitor.sh rename to home/profiles/desktop/bin/hotplug-monitor.sh diff --git a/users/profiles/desktop/bin/mpv-ify b/home/profiles/desktop/bin/mpv-ify similarity index 100% rename from users/profiles/desktop/bin/mpv-ify rename to home/profiles/desktop/bin/mpv-ify diff --git a/users/profiles/desktop/bin/passmenu b/home/profiles/desktop/bin/passmenu similarity index 100% rename from users/profiles/desktop/bin/passmenu rename to home/profiles/desktop/bin/passmenu diff --git a/users/profiles/desktop/bin/powermenu b/home/profiles/desktop/bin/powermenu similarity index 100% rename from users/profiles/desktop/bin/powermenu rename to home/profiles/desktop/bin/powermenu diff --git a/users/profiles/desktop/bin/screenshot b/home/profiles/desktop/bin/screenshot similarity index 100% rename from users/profiles/desktop/bin/screenshot rename to home/profiles/desktop/bin/screenshot diff --git a/users/profiles/desktop/bspwmrc b/home/profiles/desktop/bspwmrc similarity index 100% rename from users/profiles/desktop/bspwmrc rename to home/profiles/desktop/bspwmrc diff --git a/users/profiles/desktop/default.nix b/home/profiles/desktop/default.nix similarity index 100% rename from users/profiles/desktop/default.nix rename to home/profiles/desktop/default.nix diff --git a/users/profiles/desktop/dunstrc b/home/profiles/desktop/dunstrc similarity index 100% rename from users/profiles/desktop/dunstrc rename to home/profiles/desktop/dunstrc diff --git a/users/profiles/desktop/eww/eww.scss b/home/profiles/desktop/eww/eww.scss similarity index 100% rename from users/profiles/desktop/eww/eww.scss rename to home/profiles/desktop/eww/eww.scss diff --git a/users/profiles/desktop/eww/eww.yuck b/home/profiles/desktop/eww/eww.yuck similarity index 100% rename from users/profiles/desktop/eww/eww.yuck rename to home/profiles/desktop/eww/eww.yuck diff --git a/users/profiles/desktop/eww/widgets.yuck b/home/profiles/desktop/eww/widgets.yuck similarity index 100% rename from users/profiles/desktop/eww/widgets.yuck rename to home/profiles/desktop/eww/widgets.yuck diff --git a/users/profiles/desktop/kitty.conf b/home/profiles/desktop/kitty.conf similarity index 100% rename from users/profiles/desktop/kitty.conf rename to home/profiles/desktop/kitty.conf diff --git a/users/profiles/desktop/polybar.conf b/home/profiles/desktop/polybar.conf similarity index 100% rename from users/profiles/desktop/polybar.conf rename to home/profiles/desktop/polybar.conf diff --git a/users/profiles/desktop/polybar/config b/home/profiles/desktop/polybar/config similarity index 100% rename from users/profiles/desktop/polybar/config rename to home/profiles/desktop/polybar/config diff --git a/users/profiles/desktop/polybar/config.bak b/home/profiles/desktop/polybar/config.bak similarity index 100% rename from users/profiles/desktop/polybar/config.bak rename to home/profiles/desktop/polybar/config.bak diff --git a/users/profiles/desktop/polybar/modules/redshift b/home/profiles/desktop/polybar/modules/redshift similarity index 100% rename from users/profiles/desktop/polybar/modules/redshift rename to home/profiles/desktop/polybar/modules/redshift diff --git a/users/profiles/desktop/polybar/run.sh b/home/profiles/desktop/polybar/run.sh similarity index 100% rename from users/profiles/desktop/polybar/run.sh rename to home/profiles/desktop/polybar/run.sh diff --git a/users/profiles/desktop/rofi/appmenu.rasi b/home/profiles/desktop/rofi/appmenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/appmenu.rasi rename to home/profiles/desktop/rofi/appmenu.rasi diff --git a/users/profiles/desktop/rofi/base.cyclemenu.rasi b/home/profiles/desktop/rofi/base.cyclemenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/base.cyclemenu.rasi rename to home/profiles/desktop/rofi/base.cyclemenu.rasi diff --git a/users/profiles/desktop/rofi/bookmarkmenu.rasi b/home/profiles/desktop/rofi/bookmarkmenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/bookmarkmenu.rasi rename to home/profiles/desktop/rofi/bookmarkmenu.rasi diff --git a/users/profiles/desktop/rofi/config.rasi b/home/profiles/desktop/rofi/config.rasi similarity index 100% rename from users/profiles/desktop/rofi/config.rasi rename to home/profiles/desktop/rofi/config.rasi diff --git a/users/profiles/desktop/rofi/emojimenu.rasi b/home/profiles/desktop/rofi/emojimenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/emojimenu.rasi rename to home/profiles/desktop/rofi/emojimenu.rasi diff --git a/users/profiles/desktop/rofi/filemenu.rasi b/home/profiles/desktop/rofi/filemenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/filemenu.rasi rename to home/profiles/desktop/rofi/filemenu.rasi diff --git a/users/profiles/desktop/rofi/iconmenu.rasi b/home/profiles/desktop/rofi/iconmenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/iconmenu.rasi rename to home/profiles/desktop/rofi/iconmenu.rasi diff --git a/users/profiles/desktop/rofi/passmenu.rasi b/home/profiles/desktop/rofi/passmenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/passmenu.rasi rename to home/profiles/desktop/rofi/passmenu.rasi diff --git a/users/profiles/desktop/rofi/powermenu.rasi b/home/profiles/desktop/rofi/powermenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/powermenu.rasi rename to home/profiles/desktop/rofi/powermenu.rasi diff --git a/users/profiles/desktop/rofi/screenshotmenu.rasi b/home/profiles/desktop/rofi/screenshotmenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/screenshotmenu.rasi rename to home/profiles/desktop/rofi/screenshotmenu.rasi diff --git a/users/profiles/desktop/rofi/windowmenu.rasi b/home/profiles/desktop/rofi/windowmenu.rasi similarity index 100% rename from users/profiles/desktop/rofi/windowmenu.rasi rename to home/profiles/desktop/rofi/windowmenu.rasi diff --git a/users/profiles/desktop/run.sh b/home/profiles/desktop/run.sh similarity index 100% rename from users/profiles/desktop/run.sh rename to home/profiles/desktop/run.sh diff --git a/users/profiles/desktop/sxhkdrc b/home/profiles/desktop/sxhkdrc similarity index 100% rename from users/profiles/desktop/sxhkdrc rename to home/profiles/desktop/sxhkdrc diff --git a/users/profiles/desktop/xdg.nix b/home/profiles/desktop/xdg.nix similarity index 100% rename from users/profiles/desktop/xdg.nix rename to home/profiles/desktop/xdg.nix diff --git a/users/profiles/desktop/zathurarc b/home/profiles/desktop/zathurarc similarity index 100% rename from users/profiles/desktop/zathurarc rename to home/profiles/desktop/zathurarc diff --git a/users/profiles/direnv/default.nix b/home/profiles/direnv/default.nix similarity index 100% rename from users/profiles/direnv/default.nix rename to home/profiles/direnv/default.nix diff --git a/users/profiles/email/default.nix b/home/profiles/email/default.nix similarity index 100% rename from users/profiles/email/default.nix rename to home/profiles/email/default.nix diff --git a/users/profiles/firefox/default.nix b/home/profiles/firefox/default.nix similarity index 100% rename from users/profiles/firefox/default.nix rename to home/profiles/firefox/default.nix diff --git a/users/profiles/firefox/sidebery.css b/home/profiles/firefox/sidebery.css similarity index 100% rename from users/profiles/firefox/sidebery.css rename to home/profiles/firefox/sidebery.css diff --git a/users/profiles/firefox/treestyletab.css b/home/profiles/firefox/treestyletab.css similarity index 100% rename from users/profiles/firefox/treestyletab.css rename to home/profiles/firefox/treestyletab.css diff --git a/users/profiles/firefox/userChrome.css b/home/profiles/firefox/userChrome.css similarity index 100% rename from users/profiles/firefox/userChrome.css rename to home/profiles/firefox/userChrome.css diff --git a/users/profiles/firefox/userChrome.css.bak b/home/profiles/firefox/userChrome.css.bak similarity index 100% rename from users/profiles/firefox/userChrome.css.bak rename to home/profiles/firefox/userChrome.css.bak diff --git a/users/profiles/firefox/userstyles/stylus-2020-02-11.json b/home/profiles/firefox/userstyles/stylus-2020-02-11.json similarity index 100% rename from users/profiles/firefox/userstyles/stylus-2020-02-11.json rename to home/profiles/firefox/userstyles/stylus-2020-02-11.json diff --git a/users/profiles/git/attributes b/home/profiles/git/attributes similarity index 100% rename from users/profiles/git/attributes rename to home/profiles/git/attributes diff --git a/users/profiles/git/config b/home/profiles/git/config similarity index 100% rename from users/profiles/git/config rename to home/profiles/git/config diff --git a/users/profiles/git/default.nix b/home/profiles/git/default.nix similarity index 100% rename from users/profiles/git/default.nix rename to home/profiles/git/default.nix diff --git a/users/profiles/git/ignore b/home/profiles/git/ignore similarity index 100% rename from users/profiles/git/ignore rename to home/profiles/git/ignore diff --git a/users/profiles/nvim/default.nix b/home/profiles/nvim/default.nix similarity index 100% rename from users/profiles/nvim/default.nix rename to home/profiles/nvim/default.nix diff --git a/users/profiles/task/bin/task-note.py b/home/profiles/task/bin/task-note.py similarity index 100% rename from users/profiles/task/bin/task-note.py rename to home/profiles/task/bin/task-note.py diff --git a/users/profiles/task/default.nix b/home/profiles/task/default.nix similarity index 100% rename from users/profiles/task/default.nix rename to home/profiles/task/default.nix diff --git a/users/profiles/task/taskrc b/home/profiles/task/taskrc similarity index 100% rename from users/profiles/task/taskrc rename to home/profiles/task/taskrc diff --git a/hosts/box/default.nix b/hosts/box/default.nix index 686525cd..c6db5efa 100644 --- a/hosts/box/default.nix +++ b/hosts/box/default.nix @@ -1,12 +1,25 @@ -{ self, pkgs, profiles, suites, ... }: +{ self, pkgs, ... }: { imports = [ ./configuration.nix - ] ++ suites.mossnet; - - home-manager.users.anish = { self, suites, ... }: { - imports = [ ] ++ suites.hmBase; - }; + ../users/anish + ../profiles/core + ../profiles/server + ../profiles/taskd + ../profiles/shaarli + ../profiles/dns + ../profiles/monitoring + ../profiles/nfs + ../profiles/gonic + ../profiles/headphones + ../profiles/radicale + ../profiles/seafile + ../profiles/syncthing + ../profiles/dhyan + ../profiles/calibre + ../profiles/wallabag + ../profiles/finance + ]; # For some reason this doesn't work in the profile, but does over here?? # Something weird in the way I'm importing nixpkgs in the profile or something diff --git a/hosts/cube/default.nix b/hosts/cube/default.nix index 61ea5af7..a1659fe4 100644 --- a/hosts/cube/default.nix +++ b/hosts/cube/default.nix @@ -2,9 +2,8 @@ { imports = [ ./configuration.nix - ] ++ suites.cube; - - home-manager.users.anish = { self, suites, ... }: { - imports = [ ] ++ suites.hmBase; - }; + ../profiles/core + ../profiles/server + ../profiles/site + ]; } diff --git a/hosts/curve/curve.nix b/hosts/curve/curve.nix deleted file mode 100644 index a0ce8ac2..00000000 --- a/hosts/curve/curve.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ profiles, suites, ... }: -{ - imports = [ - profiles.core - profiles.users.anish - profiles.hardware.curve # how else to deal with hardware? - ]; - - bud.enable = true; - - # Speed up boot by removing dependency on network - systemd = { - targets.network-online.wantedBy = pkgs.lib.mkForce [ ]; # Normally ["multi-user.target"] - services.NetworkManager-wait-online.wantedBy = pkgs.lib.mkForce [ ]; # Normally ["network-online.target"] - }; -} diff --git a/hosts/curve/default.nix b/hosts/curve/default.nix index 6c8849e7..3321db03 100644 --- a/hosts/curve/default.nix +++ b/hosts/curve/default.nix @@ -1,12 +1,25 @@ -{ self, pkgs, profiles, suites, ... }: +{ self, pkgs, ... }: { imports = [ ./configuration.nix - profiles.mossnet-hosts - ] ++ suites.curve; + ../users/anish + ../profiles/core + ../profiles/bluetooth + ../profiles/music + ../profiles/sync/kitaab + ../profiles/sync/website + ../profiles/sync/cal + ../profiles/wifi + ../profiles/desktop + ../profiles/mimetypes + ../profiles/syncthing + ../profiles/mossnet-hosts + ]; - home-manager.users.anish = { suites, ... }: { - imports = suites.gui; + # Speed up boot by removing dependency on network + systemd = { + targets.network-online.wantedBy = pkgs.lib.mkForce [ ]; # Normally ["multi-user.target"] + services.NetworkManager-wait-online.wantedBy = pkgs.lib.mkForce [ ]; # Normally ["network-online.target"] }; programs.gnupg.agent.pinentryFlavor = "gnome3"; diff --git a/hosts/curve/hardware-configuration.nix b/hosts/curve/hardware-configuration.nix index e855c5b3..fca90711 100644 --- a/hosts/curve/hardware-configuration.nix +++ b/hosts/curve/hardware-configuration.nix @@ -5,7 +5,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ]; @@ -14,25 +15,27 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/74ba39ee-35cd-4b87-9ee9-651384fa55bd"; + { + device = "/dev/disk/by-uuid/74ba39ee-35cd-4b87-9ee9-651384fa55bd"; fsType = "btrfs"; options = [ "subvol=root" ]; }; fileSystems."/home" = - { device = "/dev/disk/by-uuid/74ba39ee-35cd-4b87-9ee9-651384fa55bd"; + { + device = "/dev/disk/by-uuid/74ba39ee-35cd-4b87-9ee9-651384fa55bd"; fsType = "btrfs"; options = [ "subvol=home" ]; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/87DA-98E7"; + { + device = "/dev/disk/by-uuid/87DA-98E7"; fsType = "vfat"; }; swapDevices = - [ { device = "/dev/disk/by-uuid/c36e3ba9-8eee-4fbf-837c-7e1cfda33f09"; } - ]; + [{ device = "/dev/disk/by-uuid/c36e3ba9-8eee-4fbf-837c-7e1cfda33f09"; }]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/hosts/helix/default.nix b/hosts/helix/default.nix index ce4fddac..d46c6bc4 100644 --- a/hosts/helix/default.nix +++ b/hosts/helix/default.nix @@ -2,11 +2,13 @@ { imports = [ ./configuration.nix - ] ++ suites.sealight; - - home-manager.users.anish = { self, suites, ... }: { - imports = [ ] ++ suites.hmBase; - }; + ../profiles/core + ../profiles/server + ../profiles/metrics + ../profiles/sealight-website + ../profiles/matrix + ../profiles/wireguard-server + ]; # Capsul specific users.users.cyberian = { diff --git a/hosts/lituus/default.nix b/hosts/lituus/default.nix index 87a66990..80ae3dfe 100644 --- a/hosts/lituus/default.nix +++ b/hosts/lituus/default.nix @@ -2,10 +2,14 @@ { imports = [ ./configuration.nix - ] ++ suites.lituus; - - home-manager.users.anish = { self, suites, ... }: { - imports = [ ] ++ suites.hmBase; - }; + ../users/anish + ../profiles/core + ../profiles/server + ../profiles/metrics + ../profiles/gitea + ../profiles/rss-bridge + ../profiles/mount-mossnet + ../profiles/freshrss + ]; } diff --git a/profiles/backup/default.nix b/hosts/profiles/backup/default.nix similarity index 100% rename from profiles/backup/default.nix rename to hosts/profiles/backup/default.nix diff --git a/profiles/bluetooth/default.nix b/hosts/profiles/bluetooth/default.nix similarity index 100% rename from profiles/bluetooth/default.nix rename to hosts/profiles/bluetooth/default.nix diff --git a/profiles/borg/default.nix b/hosts/profiles/borg/default.nix similarity index 100% rename from profiles/borg/default.nix rename to hosts/profiles/borg/default.nix diff --git a/profiles/cachix/default.nix b/hosts/profiles/cachix/default.nix similarity index 100% rename from profiles/cachix/default.nix rename to hosts/profiles/cachix/default.nix diff --git a/profiles/cachix/nix-community.nix b/hosts/profiles/cachix/nix-community.nix similarity index 100% rename from profiles/cachix/nix-community.nix rename to hosts/profiles/cachix/nix-community.nix diff --git a/profiles/cachix/nrdxp.nix b/hosts/profiles/cachix/nrdxp.nix similarity index 100% rename from profiles/cachix/nrdxp.nix rename to hosts/profiles/cachix/nrdxp.nix diff --git a/profiles/calibre/default.nix b/hosts/profiles/calibre/default.nix similarity index 100% rename from profiles/calibre/default.nix rename to hosts/profiles/calibre/default.nix diff --git a/profiles/core/common.nix b/hosts/profiles/core/common.nix similarity index 100% rename from profiles/core/common.nix rename to hosts/profiles/core/common.nix diff --git a/profiles/core/default.nix b/hosts/profiles/core/default.nix similarity index 92% rename from profiles/core/default.nix rename to hosts/profiles/core/default.nix index 7af791b8..1c257967 100644 --- a/profiles/core/default.nix +++ b/hosts/profiles/core/default.nix @@ -4,7 +4,6 @@ in { imports = [ ../cachix ]; - nix.settings.system-features = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; fonts = { fonts = with pkgs; [ powerline-fonts dejavu_fonts ]; @@ -20,6 +19,7 @@ in trusted-users = [ "root" "@wheel" ]; allowed-users = [ "@wheel" ]; auto-optimise-store = true; + system-features = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; }; gc.automatic = true; optimise.automatic = true; diff --git a/users/profiles/cli/starship.toml b/hosts/profiles/core/starship.toml similarity index 100% rename from users/profiles/cli/starship.toml rename to hosts/profiles/core/starship.toml diff --git a/profiles/desktop/battery-low-timer.nix b/hosts/profiles/desktop/battery-low-timer.nix similarity index 100% rename from profiles/desktop/battery-low-timer.nix rename to hosts/profiles/desktop/battery-low-timer.nix diff --git a/profiles/desktop/default.nix b/hosts/profiles/desktop/default.nix similarity index 99% rename from profiles/desktop/default.nix rename to hosts/profiles/desktop/default.nix index d55c06d3..735393f9 100644 --- a/profiles/desktop/default.nix +++ b/hosts/profiles/desktop/default.nix @@ -45,7 +45,9 @@ in nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "ripcord" - "vcv-rack" + "VCV-Rack" + "SunVox" + "renoise" ]; environment.systemPackages = with pkgs; [ diff --git a/profiles/dhyan/default.nix b/hosts/profiles/dhyan/default.nix similarity index 100% rename from profiles/dhyan/default.nix rename to hosts/profiles/dhyan/default.nix diff --git a/profiles/dns/default.nix b/hosts/profiles/dns/default.nix similarity index 100% rename from profiles/dns/default.nix rename to hosts/profiles/dns/default.nix diff --git a/profiles/finance/default.nix b/hosts/profiles/finance/default.nix similarity index 100% rename from profiles/finance/default.nix rename to hosts/profiles/finance/default.nix diff --git a/profiles/freshrss/default.nix b/hosts/profiles/freshrss/default.nix similarity index 100% rename from profiles/freshrss/default.nix rename to hosts/profiles/freshrss/default.nix diff --git a/profiles/ftp/default.nix b/hosts/profiles/ftp/default.nix similarity index 100% rename from profiles/ftp/default.nix rename to hosts/profiles/ftp/default.nix diff --git a/profiles/gitea/default.nix b/hosts/profiles/gitea/default.nix similarity index 100% rename from profiles/gitea/default.nix rename to hosts/profiles/gitea/default.nix diff --git a/profiles/gonic/default.nix b/hosts/profiles/gonic/default.nix similarity index 100% rename from profiles/gonic/default.nix rename to hosts/profiles/gonic/default.nix diff --git a/profiles/gonic/module-gonic.nix b/hosts/profiles/gonic/module-gonic.nix similarity index 100% rename from profiles/gonic/module-gonic.nix rename to hosts/profiles/gonic/module-gonic.nix diff --git a/profiles/grasp/default.nix b/hosts/profiles/grasp/default.nix similarity index 100% rename from profiles/grasp/default.nix rename to hosts/profiles/grasp/default.nix diff --git a/profiles/headphones/default.nix b/hosts/profiles/headphones/default.nix similarity index 100% rename from profiles/headphones/default.nix rename to hosts/profiles/headphones/default.nix diff --git a/profiles/matrix/compress-state-service.nix b/hosts/profiles/matrix/compress-state-service.nix similarity index 100% rename from profiles/matrix/compress-state-service.nix rename to hosts/profiles/matrix/compress-state-service.nix diff --git a/profiles/matrix/default.nix b/hosts/profiles/matrix/default.nix similarity index 100% rename from profiles/matrix/default.nix rename to hosts/profiles/matrix/default.nix diff --git a/profiles/matrix/heisenbridge.nix b/hosts/profiles/matrix/heisenbridge.nix similarity index 100% rename from profiles/matrix/heisenbridge.nix rename to hosts/profiles/matrix/heisenbridge.nix diff --git a/profiles/matrix/matrix-slack.nix b/hosts/profiles/matrix/matrix-slack.nix similarity index 100% rename from profiles/matrix/matrix-slack.nix rename to hosts/profiles/matrix/matrix-slack.nix diff --git a/profiles/matrix/mautrix-telegram.nix b/hosts/profiles/matrix/mautrix-telegram.nix similarity index 100% rename from profiles/matrix/mautrix-telegram.nix rename to hosts/profiles/matrix/mautrix-telegram.nix diff --git a/profiles/matrix/mautrix-whatsapp.nix b/hosts/profiles/matrix/mautrix-whatsapp.nix similarity index 100% rename from profiles/matrix/mautrix-whatsapp.nix rename to hosts/profiles/matrix/mautrix-whatsapp.nix diff --git a/profiles/matrix/mjolnir.nix b/hosts/profiles/matrix/mjolnir.nix similarity index 100% rename from profiles/matrix/mjolnir.nix rename to hosts/profiles/matrix/mjolnir.nix diff --git a/profiles/matrix/mod-mx-puppet-slack.nix b/hosts/profiles/matrix/mod-mx-puppet-slack.nix similarity index 100% rename from profiles/matrix/mod-mx-puppet-slack.nix rename to hosts/profiles/matrix/mod-mx-puppet-slack.nix diff --git a/profiles/metrics/default.nix b/hosts/profiles/metrics/default.nix similarity index 100% rename from profiles/metrics/default.nix rename to hosts/profiles/metrics/default.nix diff --git a/profiles/mimetypes/default.nix b/hosts/profiles/mimetypes/default.nix similarity index 100% rename from profiles/mimetypes/default.nix rename to hosts/profiles/mimetypes/default.nix diff --git a/profiles/monitoring/default.nix b/hosts/profiles/monitoring/default.nix similarity index 100% rename from profiles/monitoring/default.nix rename to hosts/profiles/monitoring/default.nix diff --git a/profiles/mossnet-hosts/default.nix b/hosts/profiles/mossnet-hosts/default.nix similarity index 100% rename from profiles/mossnet-hosts/default.nix rename to hosts/profiles/mossnet-hosts/default.nix diff --git a/profiles/mount-mossnet/default.nix b/hosts/profiles/mount-mossnet/default.nix similarity index 100% rename from profiles/mount-mossnet/default.nix rename to hosts/profiles/mount-mossnet/default.nix diff --git a/profiles/muneem/default.nix b/hosts/profiles/muneem/default.nix similarity index 100% rename from profiles/muneem/default.nix rename to hosts/profiles/muneem/default.nix diff --git a/profiles/music/default.nix b/hosts/profiles/music/default.nix similarity index 100% rename from profiles/music/default.nix rename to hosts/profiles/music/default.nix diff --git a/profiles/nextcloud/default.nix b/hosts/profiles/nextcloud/default.nix similarity index 100% rename from profiles/nextcloud/default.nix rename to hosts/profiles/nextcloud/default.nix diff --git a/profiles/nfs/default.nix b/hosts/profiles/nfs/default.nix similarity index 100% rename from profiles/nfs/default.nix rename to hosts/profiles/nfs/default.nix diff --git a/profiles/postgres_upgrade_script/default.nix b/hosts/profiles/postgres_upgrade_script/default.nix similarity index 100% rename from profiles/postgres_upgrade_script/default.nix rename to hosts/profiles/postgres_upgrade_script/default.nix diff --git a/profiles/radicale/default.nix b/hosts/profiles/radicale/default.nix similarity index 100% rename from profiles/radicale/default.nix rename to hosts/profiles/radicale/default.nix diff --git a/profiles/rss-bridge/default.nix b/hosts/profiles/rss-bridge/default.nix similarity index 100% rename from profiles/rss-bridge/default.nix rename to hosts/profiles/rss-bridge/default.nix diff --git a/profiles/seafile/default.nix b/hosts/profiles/seafile/default.nix similarity index 100% rename from profiles/seafile/default.nix rename to hosts/profiles/seafile/default.nix diff --git a/profiles/sealight-website/default.nix b/hosts/profiles/sealight-website/default.nix similarity index 100% rename from profiles/sealight-website/default.nix rename to hosts/profiles/sealight-website/default.nix diff --git a/profiles/secrets/default.nix b/hosts/profiles/secrets/default.nix similarity index 100% rename from profiles/secrets/default.nix rename to hosts/profiles/secrets/default.nix diff --git a/profiles/server/default.nix b/hosts/profiles/server/default.nix similarity index 100% rename from profiles/server/default.nix rename to hosts/profiles/server/default.nix diff --git a/profiles/shaarli/default.nix b/hosts/profiles/shaarli/default.nix similarity index 100% rename from profiles/shaarli/default.nix rename to hosts/profiles/shaarli/default.nix diff --git a/profiles/site/default.nix b/hosts/profiles/site/default.nix similarity index 100% rename from profiles/site/default.nix rename to hosts/profiles/site/default.nix diff --git a/profiles/sync/cal/default.nix b/hosts/profiles/sync/cal/default.nix similarity index 100% rename from profiles/sync/cal/default.nix rename to hosts/profiles/sync/cal/default.nix diff --git a/profiles/sync/kitaab/default.nix b/hosts/profiles/sync/kitaab/default.nix similarity index 100% rename from profiles/sync/kitaab/default.nix rename to hosts/profiles/sync/kitaab/default.nix diff --git a/profiles/sync/music/default.nix b/hosts/profiles/sync/music/default.nix similarity index 100% rename from profiles/sync/music/default.nix rename to hosts/profiles/sync/music/default.nix diff --git a/profiles/sync/music/get-music.sh b/hosts/profiles/sync/music/get-music.sh similarity index 100% rename from profiles/sync/music/get-music.sh rename to hosts/profiles/sync/music/get-music.sh diff --git a/profiles/sync/website/default.nix b/hosts/profiles/sync/website/default.nix similarity index 100% rename from profiles/sync/website/default.nix rename to hosts/profiles/sync/website/default.nix diff --git a/profiles/syncthing/default.nix b/hosts/profiles/syncthing/default.nix similarity index 100% rename from profiles/syncthing/default.nix rename to hosts/profiles/syncthing/default.nix diff --git a/profiles/taskd/default.nix b/hosts/profiles/taskd/default.nix similarity index 100% rename from profiles/taskd/default.nix rename to hosts/profiles/taskd/default.nix diff --git a/profiles/wallabag/default.nix b/hosts/profiles/wallabag/default.nix similarity index 100% rename from profiles/wallabag/default.nix rename to hosts/profiles/wallabag/default.nix diff --git a/profiles/wifi/default.nix b/hosts/profiles/wifi/default.nix similarity index 100% rename from profiles/wifi/default.nix rename to hosts/profiles/wifi/default.nix diff --git a/profiles/wireguard-server/default.nix b/hosts/profiles/wireguard-server/default.nix similarity index 100% rename from profiles/wireguard-server/default.nix rename to hosts/profiles/wireguard-server/default.nix diff --git a/profiles/wireguard/default.nix b/hosts/profiles/wireguard/default.nix similarity index 100% rename from profiles/wireguard/default.nix rename to hosts/profiles/wireguard/default.nix diff --git a/users/anish/default.nix b/hosts/users/anish/default.nix similarity index 100% rename from users/anish/default.nix rename to hosts/users/anish/default.nix diff --git a/lib/compat/default.nix b/lib/compat/default.nix deleted file mode 100644 index 9d0c2837..00000000 --- a/lib/compat/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -let - rev = "e7e5d481a0e15dcd459396e55327749989e04ce0"; - flake = (import - ( - fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz"; - sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x"; - } - ) - { - src = ../../.; - }); -in -flake diff --git a/lib/compat/nixos/default.nix b/lib/compat/nixos/default.nix deleted file mode 100644 index e4e0e68a..00000000 --- a/lib/compat/nixos/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -let - inherit (default.inputs.nixos) lib; - - host = configs.${hostname} or configs.NixOS; - configs = default.nixosConfigurations; - default = (import ../.).defaultNix; - hostname = lib.fileContents /etc/hostname; -in -host diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index 2356e1f0..00000000 --- a/lib/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -{ lib }: -lib.makeExtensible (self: { }) diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 00000000..e41f7d9d --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,7 @@ +# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. + +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/modules/backup.nix b/modules/nixos/backup.nix similarity index 100% rename from modules/backup.nix rename to modules/nixos/backup.nix diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 00000000..a7a36bd8 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,11 @@ +# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. + +{ + # List your module files here + wallabag = import ./wallabag.nix; + gonic = import ./gonic.nix; + hesienbridge = import ./heisenbridge.nix; + wireguard = import ./wireguard.nix; + backup = import ./backup.nix; +} diff --git a/modules/gonic.nix b/modules/nixos/gonic.nix similarity index 100% rename from modules/gonic.nix rename to modules/nixos/gonic.nix diff --git a/modules/heisenbridge.nix b/modules/nixos/heisenbridge.nix similarity index 100% rename from modules/heisenbridge.nix rename to modules/nixos/heisenbridge.nix diff --git a/modules/hm-system-defaults.nix b/modules/nixos/hm-system-defaults.nix similarity index 100% rename from modules/hm-system-defaults.nix rename to modules/nixos/hm-system-defaults.nix diff --git a/modules/nix-path.nix b/modules/nixos/nix-path.nix similarity index 100% rename from modules/nix-path.nix rename to modules/nixos/nix-path.nix diff --git a/modules/wallabag.nix b/modules/nixos/wallabag.nix similarity index 100% rename from modules/wallabag.nix rename to modules/nixos/wallabag.nix diff --git a/modules/wireguard.nix b/modules/nixos/wireguard.nix similarity index 100% rename from modules/wireguard.nix rename to modules/nixos/wireguard.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 00000000..f73db0e5 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,99 @@ +# This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) + +{ inputs, outputs, lib, config, pkgs, ... }: { + # You can import other NixOS modules here + imports = [ + # If you want to use modules your own flake exports (from modules/nixos): + # outputs.nixosModules.example + + # Or modules from other flakes (such as nixos-hardware): + # inputs.hardware.nixosModules.common-cpu-amd + # inputs.hardware.nixosModules.common-ssd + + # You can also split up your configuration and import pieces of it here: + # ./users.nix + + # Import your generated (nixos-generate-config) hardware configuration + ./hardware-configuration.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # If you want to use overlays your own flake exports (from overlays dir): + # outputs.overlays.modifications + # outputs.overlays.additions + + # Or overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + nix = { + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + registry = lib.mapAttrs (_: value: { flake = value; }) inputs; + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + + settings = { + # Enable flakes and new 'nix' command + experimental-features = "nix-command flakes"; + # Deduplicate and optimize nix store + auto-optimise-store = true; + }; + }; + + # FIXME: Add the rest of your current configuration + + # TODO: Set your hostname + networking.hostName = "your-hostname"; + + # TODO: This is just an example, be sure to use whatever bootloader you prefer + boot.loader.systemd-boot.enable = true; + + # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. + users.users = { + # FIXME: Replace with your username + your-username = { + # TODO: You can set an initial password for your user. + # If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install. + # Be sure to change it (using passwd) after rebooting! + initialPassword = "correcthorsebatterystaple"; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect + ]; + # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) + extraGroups = [ "wheel" ]; + }; + }; + + # This setups a SSH server. Very important if you're setting up a headless system. + # Feel free to remove if you don't need it. + services.openssh = { + enable = true; + # Forbid root login through SSH. + permitRootLogin = "no"; + # Use keys only. Remove if you want to SSH using password (not recommended) + passwordAuthentication = false; + }; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "22.11"; +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 00000000..dd009398 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,10 @@ +# This is just an example, you should generate yours with nixos-generate-config and put it in here. +{ + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; + + # Set your system kind (needed for flakes) + nixpkgs.hostPlatform = "x86_64-linux"; +} diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 00000000..041de40f --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,8 @@ +# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file +# This is useful to avoid using channels when using legacy nix commands +let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; +in +import (fetchTarball { + url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; + sha256 = lock.narHash; +}) diff --git a/old b/old new file mode 160000 index 00000000..0051488e --- /dev/null +++ b/old @@ -0,0 +1 @@ +Subproject commit 0051488eb16c4946405e38a80cbb296300881c12 diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 00000000..92390331 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,15 @@ +# This file defines overlays +{ + # This one brings our custom packages from the 'pkgs' directory + additions = final: _prev: import ../pkgs { pkgs = final; }; + + # This one contains whatever you want to overlay + # You can change versions, add patches, set compilation flags, anything really. + # https://nixos.wiki/wiki/Overlays + modifications = final: prev: { + plymouth-themes = prev.callPackage ./plymouth.nix { }; + # example = prev.example.overrideAttrs (oldAttrs: rec { + # ... + # }); + }; +} diff --git a/overlays/overrides.nix b/overlays/overrides.nix deleted file mode 100644 index 4f049964..00000000 --- a/overlays/overrides.nix +++ /dev/null @@ -1,30 +0,0 @@ -channels: final: prev: { - - __dontExport = true; # overrides clutter up actual creations - - inherit (channels.latest) - cachix - dhall - discord - element-desktop - rage - nixpkgs-fmt - qutebrowser - nheko - signal-desktop - tootle - sublime-music - starship; - - haskellPackages = prev.haskellPackages.override - (old: { - overrides = prev.lib.composeExtensions (old.overrides or (_: _: { })) (hfinal: hprev: - let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version; - in - { - # same for haskell packages, matching ghc versions - inherit (channels.latest.haskell.packages."ghc${version}") - haskell-language-server; - }); - }); -} diff --git a/overlays/various-flake-fixes.nix b/overlays/various-flake-fixes.nix deleted file mode 100644 index 7dbfc18b..00000000 --- a/overlays/various-flake-fixes.nix +++ /dev/null @@ -1,11 +0,0 @@ -final: prev: { - # Since: https://github.com/NixOS/nixpkgs/pull/126137 - nix-direnv = - if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs - then - prev.nix-direnv.override - { - enableFlakes = true; - } - else prev.nix-direnv; -} diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix deleted file mode 100644 index 71be3965..00000000 --- a/pkgs/_sources/generated.nix +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by nvfetcher, please do not modify it manually. -{ fetchgit, fetchurl }: -{ - manix = { - pname = "manix"; - version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; - src = fetchgit { - url = "https://github.com/mlvzk/manix"; - rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; - fetchSubmodules = false; - deepClone = false; - leaveDotGit = false; - sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; - }; - }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix index 39eb7c9b..245429de 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,6 +1,6 @@ -final: prev: { - # keep sources this first - sources = prev.callPackage (import ./_sources/generated.nix) { }; - # then, call packages with `final.callPackage` - plymouth-themes = prev.callPackage ./plymouth.nix { }; +# Custom packages, that can be defined similarly to ones from nixpkgs +# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example' + +{ pkgs ? (import ../nixpkgs.nix) { } }: { + plymouth-themes = pkgs.callPackage ./plymouth.nix { }; } diff --git a/pkgs/sources.toml b/pkgs/sources.toml deleted file mode 100644 index f7af168e..00000000 --- a/pkgs/sources.toml +++ /dev/null @@ -1,4 +0,0 @@ -# nvfetcher.toml -[manix] -src.git = "https://github.com/mlvzk/manix" -fetch.github = "mlvzk/manix" diff --git a/profiles/helix-zone/dns.nix b/profiles/helix-zone/dns.nix deleted file mode 100644 index a23adc88..00000000 --- a/profiles/helix-zone/dns.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ pkgs, ... }: - -let - adblockLocalZones = pkgs.stdenv.mkDerivation { - name = "unbound-zones-adblock"; - - src = (pkgs.fetchFromGitHub { - owner = "StevenBlack"; - repo = "hosts"; - rev = "3.0.0"; - sha256 = "01g6pc9s1ah2w1cbf6bvi424762hkbpbgja9585a0w99cq0n6bxv"; - } + "/hosts"); - - phases = [ "installPhase" ]; - - installPhase = '' - ${pkgs.gawk}/bin/awk '{sub(/\r$/,"")} {sub(/^127\.0\.0\.1/,"0.0.0.0")} BEGIN { OFS = "" } NF == 2 && $1 == "0.0.0.0" { print "local-zone: \"", $2, "\" static"}' $src | tr '[:upper:]' '[:lower:]' | sort -u > $out - ''; - }; - -in { - networking.firewall.allowedTCPPorts = [ 53 853 5353 ]; - networking.firewall.allowedUDPPorts = [ 53 853 5353 ]; - networking.extraHosts = '' 127.0.0.1 helix.domain ''; - # These are causing errors, goes in the server file - # local-data = "mossnet.lan. 10800 IN A 10.0.69.4"; - services.unbound = { - enable = true; - settings = { - server = { - interface = [ "0.0.0.0" ]; - tls-upstream = true; - tls-cert-bundle = "/etc/ssl/certs/ca-certificates.crt"; - include = "${adblockLocalZones}"; - access-control = "0.0.0.0/0 allow"; - verbosity = 2; - do-tcp = true; - do-ip4 = true; - prefetch = true; - prefetch-key = true; - rrset-roundrobin = true; - qname-minimisation-strict = true; - hide-identity = true; - hide-version = true; - local-zone = "mossnet.lan. static"; - }; - forward-zone = [{ - name = "."; - forward-addr = [ "45.90.28.77#c46fd3.dns1.nextdns.io" "2a07:a8c0::#c46fd3.dns1.nextdns.io" "45.90.30.77#c46fd3.dns2.nextdns.io" "2a07:a8c1::#c46fd3.dns2.nextdns.io" ]; - }]; - remote-control.control-enable = true; - }; - }; -} diff --git a/profiles/helix-zone/knot.nix b/profiles/helix-zone/knot.nix deleted file mode 100644 index d6f11947..00000000 --- a/profiles/helix-zone/knot.nix +++ /dev/null @@ -1,82 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -{ config, pkgs, ... }: -let - # https://github.com/StevenBlack/hosts/issues/451 - # https://github.com/ScriptTiger/Hosts-Conversions - # https://github.com/ScriptTiger/scripttiger.github.io - # https://scripttiger.github.io/alts/ - adblockLocalZones = pkgs.stdenv.mkDerivation { - name = "adblock-rpz"; - src = (pkgs.fetchFromGitHub { - owner = "ScriptTiger"; - repo = "scripttiger.github.io"; - # nix-prefetch-github ScriptTiger scripttiger.github.io - rev = "04402a6726f97c5f0d30436a70ac1344dccb7cf1"; - sha256 = "iSTR7j7QEr5xYtImyntDlVLbnN2ipcLcTRr4sfdx078="; - } + "/alts/rpz/blacklist.txt"); - phases = [ "installPhase" ]; - installPhase = "install -m 444 -D $src $out"; - }; - domain = "sealight.xyz"; - certdir = config.security.acme.certs.${domain}.directory; -in { - networking.firewall.allowedTCPPorts = [ 853 ]; - networking.firewall.allowedUDPPorts = [ 853 ]; - - # for acme certs, TODO: make a proper group - users.users.knot-resolver.extraGroups = [ "nginx" ]; - - # https://github.com/NixOS/nixpkgs/issues/81109 - nixpkgs.config.packageOverrides = pkgs: rec { - knot-resolver = pkgs.knot-resolver.override { extraFeatures = true; }; - }; - services.kresd = { - enable = true; - # Plain DNS only from localhost. - # You might want to add a LAN or VPN subnet, depending on deployment. - #listenPlain = [ "127.0.0.1:53" "[::1]:53" ]; - listenTLS = [ "853" ]; - #listenDoH = [ "" "[::]:443" ]; - instances = 1; - # TODO: chain.pem for stapling: https://gitlab.nic.cz/knot/knot-resolver/-/issues/517 - #policy.add( - # policy.rpz( - # policy.DENY_MSG('domain blocked by your resolver operator'), - # '${adblockLocalZones}', - # false)) - extraConfig = '' - modules.load('predict') - modules = { 'hints > iterate' } - policy.add( - policy.all( - policy.TLS_FORWARD({ - {'45.90.30.0', hostname='87b4e9.dns2.nextdns.io'}, - {'45.90.28.0', hostname='87b4e9.dns1.nextdns.io'} - }))) - policy.add(policy.suffix(policy.FORWARD({'10.0.69.4', '172.16.11.240'}), {todname('mossnet.lan')})) - - net.tls("${certdir}/fullchain.pem", "${certdir}/key.pem") - - -- refresh certs when ACME updates them - -- TODO: could probably do with systemd and a control socket? - -- TODO: may fail on first boot if ACME isn't fast, add a systemd dep - local notify = require('cqueues.notify') - local watcher = notify.opendir('${certdir}') - watcher:add('fullchain.pem') - - worker.coroutine(function () - for flags, name in watcher:changes() do - for flag in notify.flags(flags) do - print('file watcher:', name, notify[flag]) - end - if name == 'fullchain.pem' then - net.tls("${certdir}/fullchain.pem", "${certdir}/key.pem") - end - end - end) - - -- Below we create a tmpfs FS for the cache -- use almost all of it: - cache.size = cache.fssize() - 1*MB - ''; - }; -} diff --git a/profiles/helix-zone/node-composition.nix b/profiles/helix-zone/node-composition.nix deleted file mode 100644 index 53bdef1f..00000000 --- a/profiles/helix-zone/node-composition.nix +++ /dev/null @@ -1,17 +0,0 @@ -# This file has been generated by node2nix 1.9.0. Do not edit! - -{pkgs ? import { - inherit system; - }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}: - -let - nodeEnv = import ./node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; - inherit pkgs nodejs; - libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; - }; -in -import ./node-packages.nix { - inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; - inherit nodeEnv; -} diff --git a/profiles/helix-zone/node-env.nix b/profiles/helix-zone/node-env.nix deleted file mode 100644 index 5f055785..00000000 --- a/profiles/helix-zone/node-env.nix +++ /dev/null @@ -1,588 +0,0 @@ -# This file originates from node2nix - -{lib, stdenv, nodejs, python2, pkgs, libtool, runCommand, writeTextFile, writeShellScript}: - -let - # Workaround to cope with utillinux in Nixpkgs 20.09 and util-linux in Nixpkgs master - utillinux = if pkgs ? utillinux then pkgs.utillinux else pkgs.util-linux; - - python = if nodejs ? python then nodejs.python else python2; - - # Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise - tarWrapper = runCommand "tarWrapper" {} '' - mkdir -p $out/bin - - cat > $out/bin/tar <> $out/nix-support/hydra-build-products - ''; - }; - - # Common shell logic - installPackage = writeShellScript "install-package" '' - installPackage() { - local packageName=$1 src=$2 - - local strippedName - - local DIR=$PWD - cd $TMPDIR - - unpackFile $src - - # Make the base dir in which the target dependency resides first - mkdir -p "$(dirname "$DIR/$packageName")" - - if [ -f "$src" ] - then - # Figure out what directory has been unpacked - packageDir="$(find . -maxdepth 1 -type d | tail -1)" - - # Restore write permissions to make building work - find "$packageDir" -type d -exec chmod u+x {} \; - chmod -R u+w "$packageDir" - - # Move the extracted tarball into the output folder - mv "$packageDir" "$DIR/$packageName" - elif [ -d "$src" ] - then - # Get a stripped name (without hash) of the source directory. - # On old nixpkgs it's already set internally. - if [ -z "$strippedName" ] - then - strippedName="$(stripHash $src)" - fi - - # Restore write permissions to make building work - chmod -R u+w "$strippedName" - - # Move the extracted directory into the output folder - mv "$strippedName" "$DIR/$packageName" - fi - - # Change to the package directory to install dependencies - cd "$DIR/$packageName" - } - ''; - - # Bundle the dependencies of the package - # - # Only include dependencies if they don't exist. They may also be bundled in the package. - includeDependencies = {dependencies}: - lib.optionalString (dependencies != []) ( - '' - mkdir -p node_modules - cd node_modules - '' - + (lib.concatMapStrings (dependency: - '' - if [ ! -e "${dependency.name}" ]; then - ${composePackage dependency} - fi - '' - ) dependencies) - + '' - cd .. - '' - ); - - # Recursively composes the dependencies of a package - composePackage = { name, packageName, src, dependencies ? [], ... }@args: - builtins.addErrorContext "while evaluating node package '${packageName}'" '' - installPackage "${packageName}" "${src}" - ${includeDependencies { inherit dependencies; }} - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - ''; - - pinpointDependencies = {dependencies, production}: - let - pinpointDependenciesFromPackageJSON = writeTextFile { - name = "pinpointDependencies.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - function resolveDependencyVersion(location, name) { - if(location == process.env['NIX_STORE']) { - return null; - } else { - var dependencyPackageJSON = path.join(location, "node_modules", name, "package.json"); - - if(fs.existsSync(dependencyPackageJSON)) { - var dependencyPackageObj = JSON.parse(fs.readFileSync(dependencyPackageJSON)); - - if(dependencyPackageObj.name == name) { - return dependencyPackageObj.version; - } - } else { - return resolveDependencyVersion(path.resolve(location, ".."), name); - } - } - } - - function replaceDependencies(dependencies) { - if(typeof dependencies == "object" && dependencies !== null) { - for(var dependency in dependencies) { - var resolvedVersion = resolveDependencyVersion(process.cwd(), dependency); - - if(resolvedVersion === null) { - process.stderr.write("WARNING: cannot pinpoint dependency: "+dependency+", context: "+process.cwd()+"\n"); - } else { - dependencies[dependency] = resolvedVersion; - } - } - } - } - - /* Read the package.json configuration */ - var packageObj = JSON.parse(fs.readFileSync('./package.json')); - - /* Pinpoint all dependencies */ - replaceDependencies(packageObj.dependencies); - if(process.argv[2] == "development") { - replaceDependencies(packageObj.devDependencies); - } - replaceDependencies(packageObj.optionalDependencies); - - /* Write the fixed package.json file */ - fs.writeFileSync("package.json", JSON.stringify(packageObj, null, 2)); - ''; - }; - in - '' - node ${pinpointDependenciesFromPackageJSON} ${if production then "production" else "development"} - - ${lib.optionalString (dependencies != []) - '' - if [ -d node_modules ] - then - cd node_modules - ${lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies} - cd .. - fi - ''} - ''; - - # Recursively traverses all dependencies of a package and pinpoints all - # dependencies in the package.json file to the versions that are actually - # being used. - - pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args: - '' - if [ -d "${packageName}" ] - then - cd "${packageName}" - ${pinpointDependencies { inherit dependencies production; }} - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - fi - ''; - - # Extract the Node.js source code which is used to compile packages with - # native bindings - nodeSources = runCommand "node-sources" {} '' - tar --no-same-owner --no-same-permissions -xf ${nodejs.src} - mv node-* $out - ''; - - # Script that adds _integrity fields to all package.json files to prevent NPM from consulting the cache (that is empty) - addIntegrityFieldsScript = writeTextFile { - name = "addintegrityfields.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - function augmentDependencies(baseDir, dependencies) { - for(var dependencyName in dependencies) { - var dependency = dependencies[dependencyName]; - - // Open package.json and augment metadata fields - var packageJSONDir = path.join(baseDir, "node_modules", dependencyName); - var packageJSONPath = path.join(packageJSONDir, "package.json"); - - if(fs.existsSync(packageJSONPath)) { // Only augment packages that exist. Sometimes we may have production installs in which development dependencies can be ignored - console.log("Adding metadata fields to: "+packageJSONPath); - var packageObj = JSON.parse(fs.readFileSync(packageJSONPath)); - - if(dependency.integrity) { - packageObj["_integrity"] = dependency.integrity; - } else { - packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads. - } - - if(dependency.resolved) { - packageObj["_resolved"] = dependency.resolved; // Adopt the resolved property if one has been provided - } else { - packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories. - } - - if(dependency.from !== undefined) { // Adopt from property if one has been provided - packageObj["_from"] = dependency.from; - } - - fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2)); - } - - // Augment transitive dependencies - if(dependency.dependencies !== undefined) { - augmentDependencies(packageJSONDir, dependency.dependencies); - } - } - } - - if(fs.existsSync("./package-lock.json")) { - var packageLock = JSON.parse(fs.readFileSync("./package-lock.json")); - - if(![1, 2].includes(packageLock.lockfileVersion)) { - process.stderr.write("Sorry, I only understand lock file versions 1 and 2!\n"); - process.exit(1); - } - - if(packageLock.dependencies !== undefined) { - augmentDependencies(".", packageLock.dependencies); - } - } - ''; - }; - - # Reconstructs a package-lock file from the node_modules/ folder structure and package.json files with dummy sha1 hashes - reconstructPackageLock = writeTextFile { - name = "addintegrityfields.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - var packageObj = JSON.parse(fs.readFileSync("package.json")); - - var lockObj = { - name: packageObj.name, - version: packageObj.version, - lockfileVersion: 1, - requires: true, - dependencies: {} - }; - - function augmentPackageJSON(filePath, dependencies) { - var packageJSON = path.join(filePath, "package.json"); - if(fs.existsSync(packageJSON)) { - var packageObj = JSON.parse(fs.readFileSync(packageJSON)); - dependencies[packageObj.name] = { - version: packageObj.version, - integrity: "sha1-000000000000000000000000000=", - dependencies: {} - }; - processDependencies(path.join(filePath, "node_modules"), dependencies[packageObj.name].dependencies); - } - } - - function processDependencies(dir, dependencies) { - if(fs.existsSync(dir)) { - var files = fs.readdirSync(dir); - - files.forEach(function(entry) { - var filePath = path.join(dir, entry); - var stats = fs.statSync(filePath); - - if(stats.isDirectory()) { - if(entry.substr(0, 1) == "@") { - // When we encounter a namespace folder, augment all packages belonging to the scope - var pkgFiles = fs.readdirSync(filePath); - - pkgFiles.forEach(function(entry) { - if(stats.isDirectory()) { - var pkgFilePath = path.join(filePath, entry); - augmentPackageJSON(pkgFilePath, dependencies); - } - }); - } else { - augmentPackageJSON(filePath, dependencies); - } - } - }); - } - } - - processDependencies("node_modules", lockObj.dependencies); - - fs.writeFileSync("package-lock.json", JSON.stringify(lockObj, null, 2)); - ''; - }; - - prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}: - let - forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com"; - in - '' - # Pinpoint the versions of all dependencies to the ones that are actually being used - echo "pinpointing versions of dependencies..." - source $pinpointDependenciesScriptPath - - # Patch the shebangs of the bundled modules to prevent them from - # calling executables outside the Nix store as much as possible - patchShebangs . - - # Deploy the Node.js package by running npm install. Since the - # dependencies have been provided already by ourselves, it should not - # attempt to install them again, which is good, because we want to make - # it Nix's responsibility. If it needs to install any dependencies - # anyway (e.g. because the dependency parameters are - # incomplete/incorrect), it fails. - # - # The other responsibilities of NPM are kept -- version checks, build - # steps, postprocessing etc. - - export HOME=$TMPDIR - cd "${packageName}" - runHook preRebuild - - ${lib.optionalString bypassCache '' - ${lib.optionalString reconstructLock '' - if [ -f package-lock.json ] - then - echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!" - echo "This will most likely result in version mismatches! We will remove the lock file and regenerate it!" - rm package-lock.json - else - echo "No package-lock.json file found, reconstructing..." - fi - - node ${reconstructPackageLock} - ''} - - node ${addIntegrityFieldsScript} - ''} - - npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} rebuild - - if [ "''${dontNpmInstall-}" != "1" ] - then - # NPM tries to download packages even when they already exist if npm-shrinkwrap is used. - rm -f npm-shrinkwrap.json - - npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} install - fi - ''; - - # Builds and composes an NPM package including all its dependencies - buildNodePackage = - { name - , packageName - , version - , dependencies ? [] - , buildInputs ? [] - , production ? true - , npmFlags ? "" - , dontNpmInstall ? false - , bypassCache ? false - , reconstructLock ? false - , preRebuild ? "" - , dontStrip ? true - , unpackPhase ? "true" - , buildPhase ? "true" - , meta ? {} - , ... }@args: - - let - extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" "meta" ]; - in - stdenv.mkDerivation ({ - name = "${name}-${version}"; - buildInputs = [ tarWrapper python nodejs ] - ++ lib.optional (stdenv.isLinux) utillinux - ++ lib.optional (stdenv.isDarwin) libtool - ++ buildInputs; - - inherit nodejs; - - inherit dontStrip; # Stripping may fail a build for some package deployments - inherit dontNpmInstall preRebuild unpackPhase buildPhase; - - compositionScript = composePackage args; - pinpointDependenciesScript = pinpointDependenciesOfPackage args; - - passAsFile = [ "compositionScript" "pinpointDependenciesScript" ]; - - installPhase = '' - source ${installPackage} - - # Create and enter a root node_modules/ folder - mkdir -p $out/lib/node_modules - cd $out/lib/node_modules - - # Compose the package and all its dependencies - source $compositionScriptPath - - ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} - - # Create symlink to the deployed executable folder, if applicable - if [ -d "$out/lib/node_modules/.bin" ] - then - ln -s $out/lib/node_modules/.bin $out/bin - fi - - # Create symlinks to the deployed manual page folders, if applicable - if [ -d "$out/lib/node_modules/${packageName}/man" ] - then - mkdir -p $out/share - for dir in "$out/lib/node_modules/${packageName}/man/"* - do - mkdir -p $out/share/man/$(basename "$dir") - for page in "$dir"/* - do - ln -s $page $out/share/man/$(basename "$dir") - done - done - fi - - # Run post install hook, if provided - runHook postInstall - ''; - - meta = { - # default to Node.js' platforms - platforms = nodejs.meta.platforms; - } // meta; - } // extraArgs); - - # Builds a node environment (a node_modules folder and a set of binaries) - buildNodeDependencies = - { name - , packageName - , version - , src - , dependencies ? [] - , buildInputs ? [] - , production ? true - , npmFlags ? "" - , dontNpmInstall ? false - , bypassCache ? false - , reconstructLock ? false - , dontStrip ? true - , unpackPhase ? "true" - , buildPhase ? "true" - , ... }@args: - - let - extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ]; - in - stdenv.mkDerivation ({ - name = "node-dependencies-${name}-${version}"; - - buildInputs = [ tarWrapper python nodejs ] - ++ lib.optional (stdenv.isLinux) utillinux - ++ lib.optional (stdenv.isDarwin) libtool - ++ buildInputs; - - inherit dontStrip; # Stripping may fail a build for some package deployments - inherit dontNpmInstall unpackPhase buildPhase; - - includeScript = includeDependencies { inherit dependencies; }; - pinpointDependenciesScript = pinpointDependenciesOfPackage args; - - passAsFile = [ "includeScript" "pinpointDependenciesScript" ]; - - installPhase = '' - source ${installPackage} - - mkdir -p $out/${packageName} - cd $out/${packageName} - - source $includeScriptPath - - # Create fake package.json to make the npm commands work properly - cp ${src}/package.json . - chmod 644 package.json - ${lib.optionalString bypassCache '' - if [ -f ${src}/package-lock.json ] - then - cp ${src}/package-lock.json . - fi - ''} - - # Go to the parent folder to make sure that all packages are pinpointed - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - - ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} - - # Expose the executables that were installed - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - - mv ${packageName} lib - ln -s $out/lib/node_modules/.bin $out/bin - ''; - } // extraArgs); - - # Builds a development shell - buildNodeShell = - { name - , packageName - , version - , src - , dependencies ? [] - , buildInputs ? [] - , production ? true - , npmFlags ? "" - , dontNpmInstall ? false - , bypassCache ? false - , reconstructLock ? false - , dontStrip ? true - , unpackPhase ? "true" - , buildPhase ? "true" - , ... }@args: - - let - nodeDependencies = buildNodeDependencies args; - in - stdenv.mkDerivation { - name = "node-shell-${name}-${version}"; - - buildInputs = [ python nodejs ] ++ lib.optional (stdenv.isLinux) utillinux ++ buildInputs; - buildCommand = '' - mkdir -p $out/bin - cat > $out/bin/shell < $out/bin/mx-puppet-slack - #!/bin/sh - exec ${nodejs}/bin/node $out/lib/node_modules/mx-puppet-slack/build/index.js "\$@" - EOF - chmod +x $out/bin/mx-puppet-slack - ''; - - meta = with lib; { - description = "A slack puppeting bridge for matrix"; - license = licenses.asl20; - homepage = "https://github.com/Sorunome/mx-puppet-slack"; - maintainers = with maintainers; [ chickensoupwithrice ]; - platforms = platforms.unix; - }; -} - diff --git a/screenshots/desktop.png b/screenshots/desktop.png deleted file mode 100644 index 9463f3cd..00000000 Binary files a/screenshots/desktop.png and /dev/null differ diff --git a/screenshots/fakebusy.png b/screenshots/fakebusy.png deleted file mode 100644 index 9996b8c0..00000000 Binary files a/screenshots/fakebusy.png and /dev/null differ diff --git a/screenshots/firefox.png b/screenshots/firefox.png deleted file mode 100644 index 282baff9..00000000 Binary files a/screenshots/firefox.png and /dev/null differ diff --git a/screenshots/rofi.png b/screenshots/rofi.png deleted file mode 100644 index fa455482..00000000 Binary files a/screenshots/rofi.png and /dev/null differ diff --git a/shell.nix b/shell.nix index 575a5d82..8d0d78de 100644 --- a/shell.nix +++ b/shell.nix @@ -1 +1,10 @@ -(import ./lib/compat).shellNix +# Shell for bootstrapping flake-enabled nix and home-manager +# You can enter it through 'nix develop' or (legacy) 'nix-shell' + +{ pkgs ? (import ./nixpkgs.nix) { }, }: { + default = pkgs.mkShell { + # Enable experimental features without having to specify the argument + NIX_CONFIG = "experimental-features = nix-command flakes"; + nativeBuildInputs = with pkgs; [ nix home-manager git agenix deploy-rs ]; + }; +} diff --git a/shell/default.nix b/shell/default.nix deleted file mode 100644 index 24f1a332..00000000 --- a/shell/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ self, inputs, ... }: -{ - modules = [ - ./devos.nix - ]; -} - diff --git a/shell/devos.nix b/shell/devos.nix deleted file mode 100644 index 75939739..00000000 --- a/shell/devos.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ pkgs, extraModulesPath, inputs, ... }: -let - - hooks = import ./hooks; - - pkgWithCategory = category: package: { inherit package category; }; - linter = pkgWithCategory "linter"; - docs = pkgWithCategory "docs"; - devos = pkgWithCategory "devos"; - -in -{ - _file = toString ./.; - - imports = [ "${extraModulesPath}/git/hooks.nix" ]; - git = { inherit hooks; }; - - # tempfix: remove when merged https://github.com/numtide/devshell/pull/123 - devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry '' - # PATH is devshell's exorbitant privilige: - # fence against its pollution - _PATH=''${PATH} - # Load installed profiles - for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do - # If that folder doesn't exist, bash loves to return the whole glob - [[ -f "$file" ]] && source "$file" - done - # Exert exorbitant privilige and leave no trace - export PATH=''${_PATH} - unset _PATH - ''); - - packages = with pkgs; [ - git-crypt - ]; - - commands = with pkgs; [ - (devos nixUnstable) - (devos agenix) - { - category = "devos"; - name = pkgs.nvfetcher-bin.pname; - help = pkgs.nvfetcher-bin.meta.description; - command = "cd ./pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@"; - } - (linter nixpkgs-fmt) - (linter editorconfig-checker) - # (docs python3Packages.grip) too many deps - (docs mdbook) - (devos inputs.deploy.packages.${pkgs.system}.deploy-rs) - ] - - ++ lib.optional - (system != "i686-linux") - (devos cachix) - - ; -} diff --git a/shell/hooks/default.nix b/shell/hooks/default.nix deleted file mode 100644 index 10f2c9d2..00000000 --- a/shell/hooks/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - enable = true; - pre-commit.text = builtins.readFile ./pre-commit.sh; -} diff --git a/shell/hooks/pre-commit.sh b/shell/hooks/pre-commit.sh deleted file mode 100755 index 985d3b40..00000000 --- a/shell/hooks/pre-commit.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(${git}/bin/git hash-object -t tree /dev/null) -fi - -diff="git diff-index --name-only --cached $against --diff-filter d" - -nix_files=($($diff -- '*.nix')) -all_files=($($diff)) - -# Format staged nix files. -if [[ -n "${nix_files[@]}" ]]; then - nixpkgs-fmt "${nix_files[@]}" \ - && git add "${nix_files[@]}" -fi - -# check editorconfig -editorconfig-checker -- "${all_files[@]}" -if [[ $? != '0' ]]; then - printf "%b\n" \ - "\nCode is not aligned with .editorconfig" \ - "Review the output and commit your fixes" >&2 - exit 1 -fi diff --git a/users/modules/.flake-keep b/users/modules/.flake-keep deleted file mode 100644 index e69de29b..00000000 diff --git a/users/nixos/default.nix b/users/nixos/default.nix deleted file mode 100644 index 5c037fe8..00000000 --- a/users/nixos/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ hmUsers, ... }: -{ - home-manager.users = { inherit (hmUsers) nixos; }; - - users.users.nixos = { - uid = 1000; - password = "nixos"; - description = "default"; - isNormalUser = true; - extraGroups = [ "wheel" ]; - }; -} diff --git a/users/root/default.nix b/users/root/default.nix deleted file mode 100644 index f38c7391..00000000 --- a/users/root/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: -# recommend using `hashedPassword` -{ - users.users.root.password = ""; -}