Merge remote-tracking branch 'devos/main' into teutat3s-develop
This commit is contained in:
commit
e33191591c
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
|
@ -2,7 +2,7 @@ name: "Check & Cachix"
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- core
|
||||
- main
|
||||
- trying
|
||||
- staging
|
||||
jobs:
|
||||
|
|
2
.github/workflows/mdbook_docs.yml
vendored
2
.github/workflows/mdbook_docs.yml
vendored
|
@ -3,7 +3,7 @@ name: Deploy Docs to GitHub Pages
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- core
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
|
|
@ -12,7 +12,7 @@ Make an awesome template for NixOS users, with consideration for common tools li
|
|||
[devshell][devshell], and [more](./doc/integrations).
|
||||
|
||||
### No. Why _flakes_?
|
||||
Flakes are a part of an explicit push to improve [Nix's UI](https://github.com/NixOS/nix/blob/master/doc/manual/src/contributing/cli-guideline.md), and have become an intergral part of that effort.
|
||||
Flakes are a part of an explicit push to improve [Nix's UX](https://github.com/NixOS/nix/blob/master/doc/manual/src/contributing/cli-guideline.md), and have become an integral part of that effort.
|
||||
|
||||
They also make [Nix expressions](https://nixos.org/manual/nix/unstable/expressions/expression-syntax.html) easier to distribute and reuse with convient [flake references](https://github.com/NixOS/nix/blob/master/src/nix/flake.md#flake-references) for building or using packages, modules, and whole systems.
|
||||
|
||||
|
|
|
@ -1,25 +1,18 @@
|
|||
# Pull Requests
|
||||
All development is done in the `develop` branch. Only minor bug-fixes and release
|
||||
PRs should target `master`.
|
||||
|
||||
If making a change to the template, or adding a feature, please be sure to update the
|
||||
relevant docs. Each directory contains its own README.md, which will
|
||||
automatically be pulled into the [mdbook](https://devos.divnix.com). The book is
|
||||
rendered on every change, so the docs should always be up to date.
|
||||
## 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.
|
||||
|
||||
We also use [BORS](https://bors.tech) to ensure that all pull requests pass the
|
||||
test suite once at least one review is completed.
|
||||
### 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`
|
||||
|
||||
# Style
|
||||
If you wish to contribute please follow these guidelines:
|
||||
[bors]: https://bors.tech
|
||||
|
||||
* format your code with [`nixpkgs-fmt`][nixpkgs-fmt]. The default devshell
|
||||
includes a pre-commit hook that does this for you.
|
||||
|
||||
* The commit message follows the same semantics as [nixpkgs][nixpkgs].
|
||||
* You can use a `#` symbol to specify ambiguities. For example,
|
||||
`develop#zsh: <rest of commit message>` would tell me that you're updating the
|
||||
`zsh` subprofile living under the `develop` profile.
|
||||
|
||||
[nixpkgs-fmt]: https://github.com/nix-community/nixpkgs-fmt
|
||||
[nixpkgs]: https://github.com/NixOS/nixpkgs
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
- [Bootstrapping](./start/bootstrapping.md)
|
||||
- [From NixOS](./start/from-nixos.md)
|
||||
- [Key Concepts](./concepts/index.md)
|
||||
- [Extern](./concepts/extern.md)
|
||||
- [Hosts](./concepts/hosts.md)
|
||||
- [Overrides](./concepts/overrides.md)
|
||||
- [Profiles](./concepts/profiles.md)
|
||||
|
@ -17,17 +16,10 @@
|
|||
- [Overlays](./outputs/overlays.md)
|
||||
- [Packages](./outputs/pkgs.md)
|
||||
- [Concerns]()
|
||||
- [Lib](./lib.md)
|
||||
- [Secrets](./secrets.md)
|
||||
- [Tests](./tests.md)
|
||||
- [Helper Script – `flk`](./flk/index.md)
|
||||
- [up](./flk/up.md)
|
||||
- [update](./flk/update.md)
|
||||
- [get](./flk/get.md)
|
||||
- [doi](./flk/doi.md)
|
||||
- [iso](./flk/iso.md)
|
||||
- [install](./flk/install.md)
|
||||
- [home](./flk/home.md)
|
||||
- [Helper Script – `bud`](./bud/index.md)
|
||||
- [get](./bud/get.md)
|
||||
- [Integrations](./integrations/index.md)
|
||||
- [Cachix](./integrations/cachix.md)
|
||||
- [Deploy RS](./integrations/deploy.md)
|
||||
|
|
|
@ -4,7 +4,7 @@ git history.
|
|||
|
||||
## Usage
|
||||
```sh
|
||||
flk get DEST-DIR
|
||||
bud get DEST-DIR
|
||||
```
|
||||
|
||||
If DEST-DIR is ommitted, it defaults to _./devos_.
|
24
doc/bud/index.md
Normal file
24
doc/bud/index.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
# [`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
|
|
@ -1,42 +0,0 @@
|
|||
# External Art
|
||||
When you need to use a module, overlay, or pass a value from one of your inputs
|
||||
to the rest of your NixOS configuration, you can make use of a couple arguments.
|
||||
It is encouraged to add external art directly in your `flake.nix` so the file
|
||||
represents a complete dependency overview of your flake.
|
||||
|
||||
## Overlays
|
||||
External overlays can directly be added to a channel's `overlays` list.
|
||||
|
||||
flake.nix:
|
||||
```nix
|
||||
{
|
||||
channels.nixos.overlays = [ inputs.agenix.overlay ];
|
||||
}
|
||||
```
|
||||
Upon exporting overlays, these overlays will be automatically filtered out by inspecting the `inputs` argument.
|
||||
|
||||
## Modules
|
||||
There is a dedicated `nixos.hostDefaults.externalModules` argument for external
|
||||
modules.
|
||||
|
||||
flake.nix:
|
||||
```nix
|
||||
{
|
||||
nixos.hostDefaults.externalModules = [ inputs.agenix.nixosModules.age ];
|
||||
}
|
||||
```
|
||||
|
||||
## Home Manager
|
||||
Since there isn't a `hosts` concept for home-manager, externalModules is just a
|
||||
top-level argument in the `home` namespace.
|
||||
|
||||
flake.nix:
|
||||
```nix
|
||||
{
|
||||
home.externalModules = [ doom-emacs = doom-emacs.hmModule ];
|
||||
}
|
||||
```
|
||||
|
||||
> ##### Note:
|
||||
> To avoid declaring "external" modules separately, which is obvious since they come from `inputs`, the optimal solution would be to automatically export modules that were created in
|
||||
> your flake. But this is not possible due to NixOS/nix#4740.
|
|
@ -1,4 +1,10 @@
|
|||
# Key Concepts
|
||||
|
||||
There are few idioms unique to DevOS. This section is dedicated to helping you
|
||||
understand them.
|
||||
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
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
> ##### _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
|
||||
|
@ -69,3 +74,4 @@ nix build "github:divnix/devos#homeConfigurations.nixos@NixOS.home.activationPac
|
|||
|
||||
[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
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
# DigitalOcean
|
||||
|
||||
Now you can [create a droplet](https://cloud.digitalocean.com/droplets/new) using your custom image.
|
||||
|
||||
Making a DigitalOcean compatible image for `hosts/NixOS.nix` is as simple as:
|
||||
```sh
|
||||
flk doi NixOS
|
||||
```
|
||||
|
||||
This works for any file matching `hosts/*.nix` excluding `default.nix`.
|
|
@ -1,8 +0,0 @@
|
|||
# home
|
||||
The `home` subcommand is for using your home-manager configurations outside of
|
||||
NixOS, providing an awesome mechanism for keeping your environments
|
||||
synchronized, even when using other systems.
|
||||
|
||||
## Usage
|
||||
The [users](../concepts/users.md#external-usage) page contains a good usage
|
||||
example.
|
|
@ -1,20 +0,0 @@
|
|||
# flk command
|
||||
The devshell for the project incudes a convenient script for managing your
|
||||
system called `flk`. Each of the following chapters is a reference for one of
|
||||
its subcommands.
|
||||
|
||||
## Rebuild
|
||||
Without any of the subcommands, `flk` acts as a convenient shortcut for
|
||||
`nixos-rebuild`:
|
||||
```sh
|
||||
flk NixOS build
|
||||
```
|
||||
|
||||
Will build _hosts/NixOS.nix_. You can change out `build` for `switch`, `test`,
|
||||
etc. Any additional arguments are passed through to the call to
|
||||
`nixos-rebuild`.
|
||||
|
||||
## Usage
|
||||
```sh
|
||||
flk help
|
||||
```
|
|
@ -1,12 +0,0 @@
|
|||
# install
|
||||
The `install` subcommand is a simple convenience for `nixos-install`, similar
|
||||
to the shortcut for `nixos-rebuild`, all additional arguments are passed
|
||||
through.
|
||||
|
||||
## Example
|
||||
```sh
|
||||
flk install NixOS
|
||||
```
|
||||
|
||||
This will install _hosts/NixOS.nix_ to /mnt. You can override this directory
|
||||
using standard `nixos-install` args.
|
|
@ -1 +0,0 @@
|
|||
../start/iso.md
|
|
@ -1,4 +0,0 @@
|
|||
# up
|
||||
The `up` subcommand is a simple shortcut for `nixos-generate-config` that is
|
||||
compatible with devos. There is a short explanation in the the getting started
|
||||
[guide](../start/from-nixos.md#generate-configuration).
|
|
@ -1,22 +0,0 @@
|
|||
# update
|
||||
The `update` subcommand is a simple alias for:
|
||||
```sh
|
||||
nix flake update
|
||||
```
|
||||
As it sounds, this will update your lock file.
|
||||
|
||||
## Updating Package Sources
|
||||
If you pass directory name then it will update that input if the directory
|
||||
contains a flake.nix, with an optional arguement to update only a specific
|
||||
input in the subflake.
|
||||
|
||||
For example, you can update any
|
||||
[package sources](../outputs/pkgs.md#automatic-source-updates) you may have
|
||||
declared in _pkgs/flake.nix_:
|
||||
```sh
|
||||
flk update pkgs
|
||||
```
|
||||
or just its _nixpkgs_:
|
||||
```sh
|
||||
flk update pkgs nixpkgs
|
||||
```
|
|
@ -38,6 +38,6 @@ 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]: 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
|
||||
|
|
|
@ -1,541 +0,0 @@
|
|||
## channels
|
||||
nixpkgs channels to create
|
||||
|
||||
|
||||
*_Type_*:
|
||||
attribute set of submodules
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## channels.\<name\>.config
|
||||
nixpkgs config for this channel
|
||||
|
||||
|
||||
*_Type_*:
|
||||
attribute set or path convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## channels.\<name\>.input
|
||||
nixpkgs flake input to use for this channel
|
||||
|
||||
|
||||
*_Type_*:
|
||||
nix flake
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
"self.inputs.<name>"
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## channels.\<name\>.overlays
|
||||
overlays to apply to this channel
|
||||
these will get exported under the 'overlays' flake output
|
||||
as \<channel\>/\<name\> and any overlay pulled from ${inputs}
|
||||
will be filtered out
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid Nixpkgs overlay or path convertible to its or anything convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## channelsConfig
|
||||
nixpkgs config for all channels
|
||||
|
||||
|
||||
*_Type_*:
|
||||
attribute set or path convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## devshell
|
||||
Modules to include in your devos shell. the `modules` argument
|
||||
will be exported under the `devshellModules` output
|
||||
|
||||
|
||||
*_Type_*:
|
||||
submodule
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## devshell.externalModules
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid module or path convertible to its or anything convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## devshell.modules
|
||||
modules to include in all hosts and export to devshellModules output
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of path to a modules or anything convertible to it or path convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## home
|
||||
hosts, modules, suites, and profiles for home-manager
|
||||
|
||||
|
||||
*_Type_*:
|
||||
submodule
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## home.externalModules
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid module or path convertible to its or anything convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## home.importables
|
||||
Packages of paths to be passed to modules as `specialArgs`.
|
||||
|
||||
|
||||
*_Type_*:
|
||||
attribute set
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## home.importables.suites
|
||||
collections of profiles
|
||||
|
||||
|
||||
*_Type_*:
|
||||
attribute set of list of paths or anything convertible to its
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## home.modules
|
||||
modules to include in all hosts and export to homeModules output
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of path to a modules or anything convertible to it or path convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## home.profiles
|
||||
WARNING: The 'suites' and `profiles` options have been deprecated, you can now create
|
||||
both with the importables option. `rakeLeaves` can be used to create profiles and
|
||||
by passing a module or `rec` set to `importables`, suites can access profiles.
|
||||
Example:
|
||||
```
|
||||
importables = rec {
|
||||
profiles = digga.lib.importers.rakeLeaves ./profiles;
|
||||
suites = with profiles; { };
|
||||
}
|
||||
```
|
||||
See https://github.com/divnix/digga/pull/30 for more details
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of paths
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## home.suites
|
||||
WARNING: The 'suites' and `profiles` options have been deprecated, you can now create
|
||||
both with the importables option. `rakeLeaves` can be used to create profiles and
|
||||
by passing a module or `rec` set to `importables`, suites can access profiles.
|
||||
Example:
|
||||
```
|
||||
importables = rec {
|
||||
profiles = digga.lib.importers.rakeLeaves ./profiles;
|
||||
suites = with profiles; { };
|
||||
}
|
||||
```
|
||||
See https://github.com/divnix/digga/pull/30 for more details
|
||||
|
||||
|
||||
*_Type_*:
|
||||
function that evaluates to a(n) attrs or path convertible to it
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos
|
||||
hosts, modules, suites, and profiles for nixos
|
||||
|
||||
|
||||
*_Type_*:
|
||||
submodule
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hostDefaults
|
||||
Defaults for all hosts.
|
||||
the modules passed under hostDefaults will be exported
|
||||
to the 'nixosModules' flake output.
|
||||
They will also be added to all hosts.
|
||||
|
||||
|
||||
*_Type_*:
|
||||
submodule
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hostDefaults.channelName
|
||||
Channel this host should follow
|
||||
|
||||
|
||||
*_Type_*:
|
||||
a channel defined in `channels`
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
null
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hostDefaults.externalModules
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid module or path convertible to its or anything convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hostDefaults.modules
|
||||
modules to include in all hosts and export to nixosModules output
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of path to a modules or anything convertible to it or path convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hostDefaults.system
|
||||
system for this host
|
||||
|
||||
|
||||
*_Type_*:
|
||||
system defined in `supportedSystems`
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
null
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hosts
|
||||
configurations to include in the nixosConfigurations output
|
||||
|
||||
|
||||
*_Type_*:
|
||||
attribute set of submodules
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hosts.\<name\>.channelName
|
||||
Channel this host should follow
|
||||
|
||||
|
||||
*_Type_*:
|
||||
a channel defined in `channels`
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
null
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hosts.\<name\>.modules
|
||||
modules to include
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid module or path convertible to its or anything convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hosts.\<name\>.system
|
||||
system for this host
|
||||
|
||||
|
||||
*_Type_*:
|
||||
system defined in `supportedSystems`
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
null
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.importables
|
||||
Packages of paths to be passed to modules as `specialArgs`.
|
||||
|
||||
|
||||
*_Type_*:
|
||||
attribute set
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
{}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.importables.suites
|
||||
collections of profiles
|
||||
|
||||
|
||||
*_Type_*:
|
||||
attribute set of list of paths or anything convertible to its
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.profiles
|
||||
WARNING: The 'suites' and `profiles` options have been deprecated, you can now create
|
||||
both with the importables option. `rakeLeaves` can be used to create profiles and
|
||||
by passing a module or `rec` set to `importables`, suites can access profiles.
|
||||
Example:
|
||||
```
|
||||
importables = rec {
|
||||
profiles = digga.lib.importers.rakeLeaves ./profiles;
|
||||
suites = with profiles; { };
|
||||
}
|
||||
```
|
||||
See https://github.com/divnix/digga/pull/30 for more details
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of paths
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.suites
|
||||
WARNING: The 'suites' and `profiles` options have been deprecated, you can now create
|
||||
both with the importables option. `rakeLeaves` can be used to create profiles and
|
||||
by passing a module or `rec` set to `importables`, suites can access profiles.
|
||||
Example:
|
||||
```
|
||||
importables = rec {
|
||||
profiles = digga.lib.importers.rakeLeaves ./profiles;
|
||||
suites = with profiles; { };
|
||||
}
|
||||
```
|
||||
See https://github.com/divnix/digga/pull/30 for more details
|
||||
|
||||
|
||||
*_Type_*:
|
||||
function that evaluates to a(n) attrs or path convertible to it
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## outputsBuilder
|
||||
builder for flake system-spaced outputs
|
||||
The builder gets passed an attrset of all channels
|
||||
|
||||
|
||||
*_Type_*:
|
||||
function that evaluates to a(n) attrs
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
"channels: { }"
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## self
|
||||
The flake to create the devos outputs for
|
||||
|
||||
*_Type_*:
|
||||
nix flake
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## supportedSystems
|
||||
The systems supported by this flake
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of strings
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
["aarch64-linux","i686-linux","x86_64-darwin","x86_64-linux"]
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -13,16 +13,6 @@ 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).
|
||||
|
||||
## Automatic Source Updates
|
||||
There is the added, but optional, convenience of declaring your sources in
|
||||
_pkgs/flake.nix_ as an input. You can then access them from the `srcs` package.
|
||||
This allows updates to be managed automatically by simply
|
||||
[updating](../flk/update.md#updating-package-sources) the lock file. No
|
||||
more manually entering sha256 hashes!
|
||||
|
||||
As an added bonus, version strings are also generated automatically from either
|
||||
the flake ref, or the date and git revision of the source.
|
||||
|
||||
## Example
|
||||
pkgs/development/libraries/libinih/default.nix:
|
||||
```nix
|
||||
|
|
|
@ -20,29 +20,32 @@ 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/$your_swap_partition
|
||||
$ 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 using the `flk` wrapper baked into the iso off of a copy of devos
|
||||
from the time the iso was built:
|
||||
Install off of a copy of devos from the time the iso was built:
|
||||
|
||||
```console
|
||||
$ cd /iso/devos
|
||||
$ nix develop
|
||||
$ flk install NixOS --impure # use same host as above
|
||||
$ nixos-install --flake .#NixOS
|
||||
```
|
||||
|
||||
<!-- TODO: find out why --impure is necesary / PRs welcome! -->
|
||||
|
||||
## 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 `NixOS.local` in the [iso example](./iso).
|
||||
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
|
||||
|
@ -66,7 +69,7 @@ You can then ssh into the live installer through one of the
|
|||
following options:
|
||||
|
||||
```console
|
||||
ssh root@NixOS.local
|
||||
ssh root@bootstrap.local
|
||||
|
||||
ssh root@fe80::47%eno1 # where eno1 is your network interface on which you are linked to the target
|
||||
```
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
# ISO
|
||||
|
||||
Making and writing an installable iso for `hosts/NixOS.nix` is as simple as:
|
||||
Making and writing an installable iso for `hosts/bootstrap.nix` is as simple as:
|
||||
```sh
|
||||
flk iso NixOS
|
||||
|
||||
dd bs=4M if=result/iso/*.iso of=/dev/$your_installation_device \
|
||||
status=progress oflag=sync
|
||||
bud build bootstrap bootstrapIso
|
||||
sudo -E $(which bud) burn
|
||||
```
|
||||
|
||||
This works for any file matching `hosts/*.nix` excluding `default.nix`.
|
||||
This works for any host.
|
||||
|
||||
## ISO image nix store & cache
|
||||
|
||||
|
|
124
flake.lock
124
flake.lock
|
@ -7,11 +7,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1626960455,
|
||||
"narHash": "sha256-N3+qOtsADo59UcG8PxqNMhT94wqTQ73k08gpy1dLaWU=",
|
||||
"lastModified": 1620877075,
|
||||
"narHash": "sha256-XvgTqtmQZHegu9UMDSR50gK5cHEM2gbnRH0qecmdN54=",
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"rev": "fb00f178b3a49a39cc964049075439b575d36d60",
|
||||
"rev": "e543aa7d68f222e1e771165da9e9a64b5bf7b3e3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -46,11 +46,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1627447597,
|
||||
"narHash": "sha256-e7q4jCq7MPHTa0HKxX5fJS1JwZ33BN9WohWUy6sOOgA=",
|
||||
"lastModified": 1627855680,
|
||||
"narHash": "sha256-snDOrUp8nth2Vs3GeEXr7Xji+HaHy25htZLNvid/U3I=",
|
||||
"owner": "divnix",
|
||||
"repo": "bud",
|
||||
"rev": "231fa20ed93944e5b484cb5d820c60c17f4dfc35",
|
||||
"rev": "612228a68d404d559405225427a5d8b3cef9d27c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -93,11 +93,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1625729093,
|
||||
"narHash": "sha256-hpo8T7mlVEpHpZIYqhxqt5i/XY8eu4p66MrAg/MCuVY=",
|
||||
"lastModified": 1628068208,
|
||||
"narHash": "sha256-akJBkj6os4bjO1drhketJvXNC21yPuy4ufL2pyius4M=",
|
||||
"owner": "serokell",
|
||||
"repo": "deploy-rs",
|
||||
"rev": "587cbcfe8d3ea05c5bb153764d3617012ef28c86",
|
||||
"rev": "d72174307d5b88ec24cc2e69e875228fe3d642ed",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -140,11 +140,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1627484795,
|
||||
"narHash": "sha256-ZnErne4CWPxN3G6jwEzSeTD++iIXdRa9+5ZTp2IuOQ0=",
|
||||
"lastModified": 1628211944,
|
||||
"narHash": "sha256-2q1dNUzitVd0JNRHYTubbyb8ks3fL9hPJOvQgofxELE=",
|
||||
"owner": "divnix",
|
||||
"repo": "digga",
|
||||
"rev": "b52bb1001950eae6aca993232c1a88d0638b1dcf",
|
||||
"rev": "760bb9c29063258ba547145de0ab96acd7eba4c0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -206,21 +206,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"locked": {
|
||||
"lastModified": 1623875721,
|
||||
"narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -228,11 +213,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1627158444,
|
||||
"narHash": "sha256-+C0SqhyQQplhcmWl681ODGNWUng8Wp1yvC/MdI1Q7hY=",
|
||||
"lastModified": 1624228557,
|
||||
"narHash": "sha256-wwOqe73BsrXfRv1PhyXQFNC8iTET50KvE/HitdkRgxs=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "9c0abed5228d54aad120b4bc757b6f5935aeda1c",
|
||||
"rev": "35a24648d155843a4d162de98c17b1afd5db51e4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -244,17 +229,18 @@
|
|||
},
|
||||
"latest": {
|
||||
"locked": {
|
||||
"lastModified": 1627391865,
|
||||
"narHash": "sha256-tPoWBO9Nzu3wuX37WcnctzL6LoDCErJLnfLGqqmXCm4=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1627942574,
|
||||
"narHash": "sha256-guUcGRWvY2mfiVSet2x/zeHIyflm2wgglj0ldg0mMio=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8ecc61c91a596df7d3293603a9c2384190c1b89a",
|
||||
"rev": "c464dc811babfe316ed4ab7bbc12351122e69dd7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"type": "indirect"
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"naersk": {
|
||||
|
@ -300,38 +286,20 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-dram": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1626702694,
|
||||
"narHash": "sha256-YarKJzVh4De/EsMA3IYLbLzf4Qc5yH5mDcYNuYJqpP4=",
|
||||
"owner": "dramforever",
|
||||
"repo": "nix-dram",
|
||||
"rev": "b7cd3eba2567ccc662f288ca5bc46003d78f9dbb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "dramforever",
|
||||
"repo": "nix-dram",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos": {
|
||||
"locked": {
|
||||
"lastModified": 1627552538,
|
||||
"narHash": "sha256-FkIzCCSu9UuAhfdp6aSDPrZeaVQz1f5K51XRZLuvUp0=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1628203131,
|
||||
"narHash": "sha256-jQgXeJ9NQQS0Eobb/qQOvS+RRULkqRikAeXkkFKOPDA=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f90d817036015164f606b0dd9a9fbbcdd90c9b38",
|
||||
"rev": "178da37860823d35e801c7df2f73d7866d3d598a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"owner": "nixos",
|
||||
"ref": "release-21.05",
|
||||
"type": "indirect"
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-generators": {
|
||||
|
@ -361,11 +329,11 @@
|
|||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1627365147,
|
||||
"narHash": "sha256-weGn8tUd8VP+YFCqYZ8fOV8OPJxrZLtna8YJKri0Zfk=",
|
||||
"lastModified": 1625333638,
|
||||
"narHash": "sha256-M6J9RN60XJyv6nUfDFCwnz5aVjhe8+GJnV8Q9VpdQQQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "615e23579fec9bf0753fd72a8a447d9fb847c58f",
|
||||
"rev": "41775780a0b6b32b3d32dcc32bb9bc6df809062d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -374,29 +342,14 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1626556499,
|
||||
"narHash": "sha256-c2ueMT7fi/yvCNq3nGLEC2v5GklS7eHpB1240LRSW9Y=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b59c06dc92f8d03660eb4155754d93a6c34cda83",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1626202371,
|
||||
"narHash": "sha256-thj8msabJEeAfuC/6Zb4jZnnJ7SfcLUZEY0TjXhFQNs=",
|
||||
"path": "/nix/store/z9h5jj2b9ls0q3mkvhdz5s05ly7m20k7-source",
|
||||
"rev": "c10216f94e7e99a05f515a8bdc87d5b460164f1a",
|
||||
"type": "path"
|
||||
"lastModified": 1626378135,
|
||||
"narHash": "sha256-koC6DBYmLCrgXA+AMHVaODf1uHYPmvcFygHfy3eg6vI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "00c2ec8f0bbdf0cfb2135bde55fbae5d6b64aa6d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nur",
|
||||
|
@ -458,7 +411,6 @@
|
|||
"home": "home",
|
||||
"latest": "latest",
|
||||
"naersk": "naersk_2",
|
||||
"nix-dram": "nix-dram",
|
||||
"nixlib": [
|
||||
"digga",
|
||||
"nixlib"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
inputs =
|
||||
{
|
||||
nixos.url = "nixpkgs/release-21.05";
|
||||
latest.url = "nixpkgs/nixos-unstable";
|
||||
nixos.url = "github:nixos/nixpkgs/release-21.05";
|
||||
latest.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
digga.url = "github:divnix/digga";
|
||||
digga.inputs.nixpkgs.follows = "nixos";
|
||||
|
@ -163,7 +163,7 @@
|
|||
}
|
||||
//
|
||||
{
|
||||
budModules = { devos = import ./pkgs/bud; };
|
||||
budModules = { devos = import ./bud; };
|
||||
}
|
||||
;
|
||||
}
|
||||
|
|
18
hosts/bootstrap.nix
Normal file
18
hosts/bootstrap.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ profiles, ... }:
|
||||
{
|
||||
# build with: `bud build bootstrap bootstrapIso`
|
||||
# reachable on the local link via ssh root@fe80::47%eno1
|
||||
# where 'eno1' is replaced by your own machine's network
|
||||
# interface that has the local link to the target machine
|
||||
imports = [
|
||||
# profiles.networking
|
||||
profiles.core
|
||||
profiles.users.root # make sure to configure ssh keys
|
||||
profiles.users.nixos
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
# will be overridden by the bootstrapIso instrumentation
|
||||
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
|
||||
}
|
|
@ -12,6 +12,5 @@
|
|||
leaveDotGit = false;
|
||||
sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ in
|
|||
category = "devos";
|
||||
name = pkgs.nvfetcher-bin.pname;
|
||||
help = pkgs.nvfetcher-bin.meta.description;
|
||||
command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@; nixpkgs-fmt _sources/";
|
||||
command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@";
|
||||
}
|
||||
(linter nixpkgs-fmt)
|
||||
(linter editorconfig-checker)
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
nix-direnv = {
|
||||
enable = true;
|
||||
enableFlakes = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue