From b5da4066898205f2270f1ac4b0dada9403bb78e1 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 5 Aug 2021 20:16:53 -0500 Subject: [PATCH 01/25] fix: dedicated bootstrap config --- hosts/bootstrap.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 hosts/bootstrap.nix diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix new file mode 100644 index 0000000..d491855 --- /dev/null +++ b/hosts/bootstrap.nix @@ -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"; }; +} From 5657ddf3c1991831bdbd8ed2df8d590b0c92588d Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 5 Aug 2021 20:30:40 -0500 Subject: [PATCH 02/25] fix: input ref / bump digga the indirect reference started failing with ``` warning: Git tree '/home/blaggacao/ghq/github.com/divnix/devos' is dirty error: NAR hash mismatch in input 'github:NixOS/nixpkgs/release-21.05' (/nix/store/0r0xrqj5l88071cama7hlha5ajya06c8-source), expected 'sha256-MhVtkVt1MFfaDY3ObJu54NBcsaPk19vOBZ8ouhjO4qs=', got 'sha256-jQgXeJ9NQQS0Eobb/qQOvS+RRULkqRikAeXkkFKOPDA=' ``` --- flake.lock | 38 ++++++++++++++++++++------------------ flake.nix | 4 ++-- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/flake.lock b/flake.lock index 6082f57..b3efea0 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { @@ -229,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": { @@ -287,17 +288,18 @@ }, "nixos": { "locked": { - "lastModified": 1627930555, - "narHash": "sha256-JKS4wNmSnkatz+3G5g0/o+tXg3XpQ4AtBpgbw2+kIcw=", - "owner": "NixOS", + "lastModified": 1628203131, + "narHash": "sha256-jQgXeJ9NQQS0Eobb/qQOvS+RRULkqRikAeXkkFKOPDA=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "c15e294a60abc894964f4b0ae0ca17dc18b9ca98", + "rev": "178da37860823d35e801c7df2f73d7866d3d598a", "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "nixos", "ref": "release-21.05", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" } }, "nixos-generators": { diff --git a/flake.nix b/flake.nix index bdd82cd..bba4f43 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; From 5c3d6254c36723875bf695b92c63ed388605605f Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Fri, 6 Aug 2021 23:07:40 +0800 Subject: [PATCH 03/25] Fix a typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f088ca0..08f73f9 100644 --- a/README.md +++ b/README.md @@ -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 intergral 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. From 5b89e53e7a39c603bed327023c953d0b30433ec2 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 11 Aug 2021 19:05:03 +0000 Subject: [PATCH 04/25] Fix typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 08f73f9..6607bb4 100644 --- a/README.md +++ b/README.md @@ -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 UX](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. From c30870f266d19e305d4163184ff4d812be022fec Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 12 Aug 2021 20:45:47 -0500 Subject: [PATCH 05/25] imp: bootstrap docs --- doc/start/bootstrapping.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/start/bootstrapping.md b/doc/start/bootstrapping.md index 873af32..80fbd61 100644 --- a/doc/start/bootstrapping.md +++ b/doc/start/bootstrapping.md @@ -21,6 +21,9 @@ partition to `/mnt/boot`: $ 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 +# add some extra space to the store, it's running on a tmpfs on your RAM +$ mkdir -p /mnt/tmpstore/{work,store} +$ mount -t overlay overlay -olowerdir=/nix/store,upperdir=/mnt/tmpstore/store,workdir=/mnt/tmpstore/work /nix/store ``` ## Install @@ -30,12 +33,9 @@ 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 # use same host as above ``` - - ## Notes of interest ### Remote access to the live installer From 32bddf6403895f104bb72d4ba7e113a61bafef70 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 12 Aug 2021 20:48:30 -0500 Subject: [PATCH 06/25] fix: docs bootsrtap - swap disk by label (easied copy/paste) --- doc/start/bootstrapping.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/start/bootstrapping.md b/doc/start/bootstrapping.md index 80fbd61..09cb34f 100644 --- a/doc/start/bootstrapping.md +++ b/doc/start/bootstrapping.md @@ -20,7 +20,7 @@ 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, it's running on a tmpfs on your RAM $ mkdir -p /mnt/tmpstore/{work,store} $ mount -t overlay overlay -olowerdir=/nix/store,upperdir=/mnt/tmpstore/store,workdir=/mnt/tmpstore/work /nix/store From c46d923876420cdfe0fc805dc70221a214e6d20e Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 12 Aug 2021 20:51:18 -0500 Subject: [PATCH 07/25] fix: iso docs w.r.t. bud burn and bootstrap.nix --- doc/start/iso.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/start/iso.md b/doc/start/iso.md index 8f5c6ab..76af1c6 100644 --- a/doc/start/iso.md +++ b/doc/start/iso.md @@ -1,11 +1,9 @@ # 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 -bud build NixOS bootstrapIso - -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 host. From 079adc4474231d5582fee5574bc5bcc6f133e5ac Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 12 Aug 2021 20:57:22 -0500 Subject: [PATCH 08/25] fix: more docs w.r.t. bootstrap iso --- doc/start/bootstrapping.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/start/bootstrapping.md b/doc/start/bootstrapping.md index 09cb34f..f4c5190 100644 --- a/doc/start/bootstrapping.md +++ b/doc/start/bootstrapping.md @@ -21,19 +21,22 @@ partition to `/mnt/boot`: $ 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, it's running on a tmpfs on your RAM +``` + +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 -$ nixos-install --flake .#NixOS # use same host as above +$ nixos-install --flake .#NixOS ``` ## Notes of interest @@ -42,7 +45,7 @@ $ nixos-install --flake .#NixOS # use same host as above 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 ``` From 0536d0de90f7b56f914052cd86e42e2b105b79a8 Mon Sep 17 00:00:00 2001 From: benneti Date: Thu, 2 Sep 2021 11:37:21 +0200 Subject: [PATCH 09/25] update pkgs documentation --- doc/outputs/pkgs.md | 79 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/doc/outputs/pkgs.md b/doc/outputs/pkgs.md index 548667f..4de93a8 100644 --- a/doc/outputs/pkgs.md +++ b/doc/outputs/pkgs.md @@ -13,18 +13,45 @@ 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, srcs, ... }: -let inherit (srcs) libinih; in +{ stdenv, meson, ninja, lib, sources, ... }: stdenv.mkDerivation { pname = "libinih"; - # version will resolve to 53, as specified in the final example below - inherit (libinih) version; - - src = libinih; + # version will resolve to the latest available on gitub + inherit (sources.libinih) version src; buildInputs = [ meson ninja ]; @@ -32,12 +59,14 @@ stdenv.mkDerivation { } ``` -pkgs/default.nix: -```nix -final: prev: { - libinih = prev.callPackage ./development/libraries/libinih { }; -} -``` + +## 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 @@ -51,4 +80,30 @@ pkgs/flake.nix: } ``` +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 From a3b2bcf3d57be28c27119a44445cfdde38349cb9 Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 18 Sep 2021 16:50:51 +0300 Subject: [PATCH 10/25] fix typo in CONTRIBUTING.md --- doc/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index 8574dae..86f5dd7 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## TL;DR; - **Target Branch**: `main` -- **Merge Policy**: [`bors`][bors] is alwyas right (→ `bors try`) +- **Merge Policy**: [`bors`][bors] is always right (→ `bors try`) - **Docs**: every changeset is expected to contain doc updates - **Commit Msg**: be a poet! Comprehensive and explanatory commit messages should cover the motivation and use case in an easily understandable manner From 54a9a8366e796661be44f8ab6f913632c02e0c34 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sat, 18 Sep 2021 15:47:11 -0400 Subject: [PATCH 11/25] ci: workflows on `main` push should trigger on `master` push --- .github/workflows/check.yml | 1 + .github/workflows/mdbook_docs.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index c8a8f64..0638c4c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - master - trying - staging jobs: diff --git a/.github/workflows/mdbook_docs.yml b/.github/workflows/mdbook_docs.yml index 5faf9c2..706b3bd 100644 --- a/.github/workflows/mdbook_docs.yml +++ b/.github/workflows/mdbook_docs.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - master jobs: deploy: From c3461cd2c3f947c3ed30d64565d4e78c80d1fdba Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sat, 18 Sep 2021 15:47:59 -0400 Subject: [PATCH 12/25] docs: `master` is the current target branch for pull requests --- doc/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index 86f5dd7..2b5241a 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Pull Requests ## TL;DR; -- **Target Branch**: `main` +- **Target Branch**: `master` - **Merge Policy**: [`bors`][bors] is always right (→ `bors try`) - **Docs**: every changeset is expected to contain doc updates - **Commit Msg**: be a poet! Comprehensive and explanatory commit messages From f13c11ea174fd508a7a327e13ad8fffff95facd6 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Sun, 19 Sep 2021 11:17:01 -0600 Subject: [PATCH 13/25] README.md: fix broken links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6607bb4..1d81382 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ They also make [Nix expressions](https://nixos.org/manual/nix/unstable/expressio ## Getting Started Check out the [guide](https://devos.divnix.com/start) to get up and running. -Also, have a look at [_flake.nix_][toc]. If anything is not immediately +Also, have a look at [_flake.nix_](./flake.nix). If anything is not immediately discoverable via "[`digga`][digga]'s [`mkFlake`][mk-flake], please file a bug report. @@ -88,4 +88,4 @@ DevOS is licensed under the [MIT License][mit]. [nixpkgs]: https://github.com/NixOS/nixpkgs [nvfetcher]: https://github.com/berberman/nvfetcher [please]: https://github.com/nrdxp/devos/tree/nrd - +[matrix]: https://matrix.to/#/#devos:nixos.org From 955b9ce1c1691d5ecd54bd666b0b47e42559a382 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sat, 18 Sep 2021 15:19:35 -0400 Subject: [PATCH 14/25] docs(bud): replace references to `flk` --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .gitignore | 2 +- doc/concepts/users.md | 6 +++--- doc/integrations/deploy.md | 2 +- doc/start/from-nixos.md | 4 ++-- doc/start/index.md | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ca1ca28..1040ee6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -35,4 +35,4 @@ Please search on the [issue tracker](../) before creating one. ## Your Environment - + diff --git a/.gitignore b/.gitignore index 4a99123..6cce155 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ result .direnv doc/index.html -# Result of flk commands +# Result of bud commands vm iso doi diff --git a/doc/concepts/users.md b/doc/concepts/users.md index 12bf562..9be3ca8 100644 --- a/doc/concepts/users.md +++ b/doc/concepts/users.md @@ -48,7 +48,7 @@ argument that gets passed to your home-manager users. ## 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 +using the `homeConfigurations` flake output. The [bud](../bud/index.md) helper script makes this even easier. This is great for keeping your environment consistent across Unix systems, @@ -57,10 +57,10 @@ including OSX. ### From within the projects devshell: ```sh # builds the nixos user defined in the NixOS host -flk home NixOS nixos +bud home NixOS nixos # build and activate -flk home NixOS nixos switch +bud home NixOS nixos switch ``` ### Manually from outside the project: diff --git a/doc/integrations/deploy.md b/doc/integrations/deploy.md index 2903210..f66d2b5 100644 --- a/doc/integrations/deploy.md +++ b/doc/integrations/deploy.md @@ -40,7 +40,7 @@ And the private key to your user: And run the deployment: ```sh -deploy "flk#hostName" --hostname host.example.com +deploy "bud#hostName" --hostname host.example.com ``` > ##### _Note:_ diff --git a/doc/start/from-nixos.md b/doc/start/from-nixos.md index 0e1d48c..ce79063 100644 --- a/doc/start/from-nixos.md +++ b/doc/start/from-nixos.md @@ -4,7 +4,7 @@ Assuming you're happy with your existing partition layout, you can generate a basic NixOS configuration for your system using: ```sh -flk up +bud up ``` This will make a new file `hosts/up-$(hostname).nix`, which you can edit to @@ -38,7 +38,7 @@ Now might be a good time to read the docs on [suites](../concepts/suites.md) and Once you're ready to deploy `hosts/my-host.nix`: ```sh -flk my-host switch +bud my-host switch ``` diff --git a/doc/start/index.md b/doc/start/index.md index f3f1127..7dd8002 100644 --- a/doc/start/index.md +++ b/doc/start/index.md @@ -6,10 +6,10 @@ 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" +nix-shell https://github.com/divnix/devos/archive/master.tar.gz -A shell \ + --run "bud get master" -cd flk +cd bud nix-shell @@ -18,7 +18,7 @@ git add . git commit -m init ``` -This will place you in a new folder named `flk` with git initialized, and a +This will place you in a new folder named `bud` with git initialized, and a nix-shell that provides all the dependencies, including the unstable nix version required. From 19666a06a7598872a0781e1b07fd267dac3d989f Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sat, 18 Sep 2021 15:21:03 -0400 Subject: [PATCH 15/25] fix: `bud get` should init flake based off `master` --- bud/get.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bud/get.bash b/bud/get.bash index 3b4d9a7..770c002 100644 --- a/bud/get.bash +++ b/bud/get.bash @@ -1 +1 @@ -nix flake new -t "github:divnix/devos/core" "${2:-devos}" +nix flake new -t "github:divnix/devos/master" "${2:-devos}" From 57a14bb4119f19cf7b56adec41a7fe8797a5b000 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sat, 18 Sep 2021 15:26:15 -0400 Subject: [PATCH 16/25] docs: update links to point to `master` instead of `core` --- doc/concepts/profiles.md | 2 +- doc/concepts/users.md | 2 +- doc/integrations/nvfetcher.md | 2 +- doc/tests.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/concepts/profiles.md b/doc/concepts/profiles.md index a5eda3e..36e423f 100644 --- a/doc/concepts/profiles.md +++ b/doc/concepts/profiles.md @@ -63,5 +63,5 @@ 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 +[spec]: https://github.com/divnix/devos/tree/master/lib/devos/mkProfileAttrs.nix [config]: https://nixos.wiki/wiki/Module#structure diff --git a/doc/concepts/users.md b/doc/concepts/users.md index 9be3ca8..d18d51d 100644 --- a/doc/concepts/users.md +++ b/doc/concepts/users.md @@ -73,5 +73,5 @@ 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 +[modules-list]: https://github.com/divnix/devos/tree/master/users/modules/module-list.nix [portableuser]: https://digga.divnix.com/api-reference-home.html#homeusers diff --git a/doc/integrations/nvfetcher.md b/doc/integrations/nvfetcher.md index 4670657..107a169 100644 --- a/doc/integrations/nvfetcher.md +++ b/doc/integrations/nvfetcher.md @@ -40,4 +40,4 @@ fetch.git = "https://github.com/mlvzk/manix.git" # responsible for fetching [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 +[sources.toml]: https://github.com/divnix/devos/tree/master/pkgs/sources.toml diff --git a/doc/tests.md b/doc/tests.md index 1d7b65e..6a62c72 100644 --- a/doc/tests.md +++ b/doc/tests.md @@ -26,7 +26,7 @@ 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 +[default]: https://github.com/divnix/devos/tree/master/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 From 252769ce465660b1480fcc127b54dab6262f4b3f Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sat, 18 Sep 2021 15:27:49 -0400 Subject: [PATCH 17/25] ci: update release workflow to checkout code from `master` branch --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b22de0..111be31 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 with: - ref: core + ref: master - name: Update Changelog uses: heinrichreimer/github-changelog-generator-action@v2.1.1 with: @@ -49,7 +49,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 with: - ref: core + ref: master - name: Get Changelog Entry id: changelog_reader From 0770c7f9009293412c53d4f901bf23ff5d368769 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sun, 19 Sep 2021 23:30:16 -0400 Subject: [PATCH 18/25] docs: `bud get` creates a directory named `devos` by default As mentioned in #370 it would not result in a directory called `bud`, as can be seen in the custom `get.bash` command where the directory name defaults to `devos`. --- doc/start/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/start/index.md b/doc/start/index.md index 7dd8002..ed1a114 100644 --- a/doc/start/index.md +++ b/doc/start/index.md @@ -9,7 +9,7 @@ nix-shell -p cachix --run "cachix use nrdxp" nix-shell https://github.com/divnix/devos/archive/master.tar.gz -A shell \ --run "bud get master" -cd bud +cd devos nix-shell @@ -18,7 +18,7 @@ git add . git commit -m init ``` -This will place you in a new folder named `bud` with git initialized, and a +This will place you in a new folder named `devos` with git initialized, and a nix-shell that provides all the dependencies, including the unstable nix version required. From ccf160dd218aa48346ce2d9802d937757ccb1bd5 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sun, 19 Sep 2021 23:40:19 -0400 Subject: [PATCH 19/25] docs: `deploy` command example is run from repo root --- doc/integrations/deploy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/integrations/deploy.md b/doc/integrations/deploy.md index f66d2b5..81507fc 100644 --- a/doc/integrations/deploy.md +++ b/doc/integrations/deploy.md @@ -40,7 +40,7 @@ And the private key to your user: And run the deployment: ```sh -deploy "bud#hostName" --hostname host.example.com +deploy ".#hostName" --hostname host.example.com ``` > ##### _Note:_ From 95f89c0b44acf92e16ec702b38a23016616d8a2b Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sun, 19 Sep 2021 23:43:29 -0400 Subject: [PATCH 20/25] docs: use single quotes in example to avoid shell expansion --- doc/integrations/deploy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/integrations/deploy.md b/doc/integrations/deploy.md index 81507fc..642267c 100644 --- a/doc/integrations/deploy.md +++ b/doc/integrations/deploy.md @@ -40,7 +40,7 @@ And the private key to your user: And run the deployment: ```sh -deploy ".#hostName" --hostname host.example.com +deploy '.#hostName' --hostname host.example.com ``` > ##### _Note:_ From e5660cdf83d9581f971504db8024240346328de8 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sun, 19 Sep 2021 23:53:14 -0400 Subject: [PATCH 21/25] ci: remove lingering references to `main` in workflow configs `main` is no longer in use. See #369 --- .github/workflows/check.yml | 1 - .github/workflows/mdbook_docs.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0638c4c..e80861b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,7 +2,6 @@ name: "Check & Cachix" on: push: branches: - - main - master - trying - staging diff --git a/.github/workflows/mdbook_docs.yml b/.github/workflows/mdbook_docs.yml index 706b3bd..9d15cc1 100644 --- a/.github/workflows/mdbook_docs.yml +++ b/.github/workflows/mdbook_docs.yml @@ -3,7 +3,6 @@ name: Deploy Docs to GitHub Pages on: push: branches: - - main - master jobs: From e0da74c87c62b1acca275f11af80a3c9fb556f33 Mon Sep 17 00:00:00 2001 From: Parthiv Seetharaman Date: Fri, 24 Sep 2021 11:40:53 -0700 Subject: [PATCH 22/25] Update flake to use new moddules options --- flake.lock | 69 ++++++++++++++++++++++++++++++++++++----------- flake.nix | 8 +++--- shell/default.nix | 4 +-- 3 files changed, 60 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index b3efea0..5dff3b1 100644 --- a/flake.lock +++ b/flake.lock @@ -93,11 +93,11 @@ ] }, "locked": { - "lastModified": 1628068208, - "narHash": "sha256-akJBkj6os4bjO1drhketJvXNC21yPuy4ufL2pyius4M=", + "lastModified": 1628752686, + "narHash": "sha256-Lzh9MYUJDsjgif+YEyOErXtj1IH+ci8J1C30g1ms69s=", "owner": "serokell", "repo": "deploy-rs", - "rev": "d72174307d5b88ec24cc2e69e875228fe3d642ed", + "rev": "e5546f9c2503c26d175f08a81fc0a0f330be4cbe", "type": "github" }, "original": { @@ -108,11 +108,11 @@ }, "devshell": { "locked": { - "lastModified": 1625086391, - "narHash": "sha256-IpNPv1v8s4L3CoxhwcgZIitGpcrnNgnj09X7TA0QV3k=", + "lastModified": 1629275356, + "narHash": "sha256-R17M69EKXP6q8/mNHaK53ECwjFo1pdF+XaJC9Qq8zjg=", "owner": "numtide", "repo": "devshell", - "rev": "4b5ac7cf7d9a1cc60b965bb51b59922f2210cbc7", + "rev": "26f25a12265f030917358a9632cd600b51af1d97", "type": "github" }, "original": { @@ -131,6 +131,7 @@ "home-manager": [ "home" ], + "nix": "nix", "nixlib": [ "nixos" ], @@ -140,11 +141,11 @@ ] }, "locked": { - "lastModified": 1628211944, - "narHash": "sha256-2q1dNUzitVd0JNRHYTubbyb8ks3fL9hPJOvQgofxELE=", + "lastModified": 1632784893, + "narHash": "sha256-SBmGCObLqF9CrWoF7hrBpiCMPTUFzHiBvAtCJXQrPg4=", "owner": "divnix", "repo": "digga", - "rev": "760bb9c29063258ba547145de0ab96acd7eba4c0", + "rev": "6316878be3527ef2b27b8e92afb44ce1857830b3", "type": "github" }, "original": { @@ -192,16 +193,15 @@ ] }, "locked": { - "lastModified": 1627071952, - "narHash": "sha256-FhE0KOuI9Kl4eyGJXu4bh9fBP2hbxjnD1DlKHljCcYs=", - "owner": "gytis-ivaskevicius", + "lastModified": 1630859749, + "narHash": "sha256-qkoU2rIbbP2+T0dfcqXW35GCWNsi0Y1IgN9BELmt4Zo=", + "owner": "divnix", "repo": "flake-utils-plus", - "rev": "51a82925db31073bc4822c9b538a0a3ebf1134b2", + "rev": "a4e267e3fc87e60c5029c6c3855935ff1ff3018e", "type": "github" }, "original": { - "owner": "gytis-ivaskevicius", - "ref": "staging", + "owner": "divnix", "repo": "flake-utils-plus", "type": "github" } @@ -243,6 +243,23 @@ "type": "github" } }, + "lowdown-src": { + "flake": false, + "locked": { + "lastModified": 1617481909, + "narHash": "sha256-SqnfOFuLuVRRNeVJr1yeEPJue/qWoCp5N6o5Kr///p4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "148f9b2f586c41b7e36e73009db43ea68c7a1a4d", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "ref": "VERSION_0_8_4", + "repo": "lowdown", + "type": "github" + } + }, "naersk": { "inputs": { "nixpkgs": [ @@ -286,6 +303,28 @@ "type": "github" } }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": [ + "digga", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1630335771, + "narHash": "sha256-eljjEPJdLK3aDskF7qX4YM/6KCq+w9nr+IKhrKW/AIQ=", + "owner": "nixos", + "repo": "nix", + "rev": "50a35860ee9237d341948437c5f70a7f0987d393", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nix", + "type": "github" + } + }, "nixos": { "locked": { "lastModified": 1628203131, diff --git a/flake.nix b/flake.nix index bba4f43..1ebdd84 100644 --- a/flake.nix +++ b/flake.nix @@ -99,8 +99,8 @@ hostDefaults = { system = "x86_64-linux"; channelName = "nixos"; - imports = [ (digga.lib.importModules ./modules) ]; - externalModules = [ + imports = [ (digga.lib.importExportableModules ./modules) ]; + modules = [ { lib.our = self.lib; } digga.nixosModules.bootstrapIso digga.nixosModules.nixConfig @@ -126,8 +126,8 @@ }; home = { - imports = [ (digga.lib.importModules ./users/modules) ]; - externalModules = [ ]; + imports = [ (digga.lib.importExportableModules ./users/modules) ]; + modules = [ ]; importables = rec { profiles = digga.lib.rakeLeaves ./users/profiles; suites = with profiles; rec { diff --git a/shell/default.nix b/shell/default.nix index aef90a5..d22b3af 100644 --- a/shell/default.nix +++ b/shell/default.nix @@ -1,9 +1,9 @@ { self, inputs, ... }: { - externalModules = with inputs; [ + modules = with inputs; [ bud.devshellModules.bud ]; - modules = [ + exportedModules = [ ./devos.nix ]; } From 950199ef2c5c85e7d8235962dc49f9a5793f41e5 Mon Sep 17 00:00:00 2001 From: GTrunSec Date: Wed, 29 Sep 2021 11:45:46 -0700 Subject: [PATCH 23/25] update deploy-rs overlay --- flake.nix | 7 +++++-- overlays/overrides.nix | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 1ebdd84..d87fdce 100644 --- a/flake.nix +++ b/flake.nix @@ -77,11 +77,14 @@ nur.overlay agenix.overlay nvfetcher.overlay - deploy.overlay ./pkgs/default.nix ]; }; - latest = { }; + latest = { + overlays = [ + deploy.overlay + ]; + }; }; lib = import ./lib { lib = digga.lib // nixos.lib; }; diff --git a/overlays/overrides.nix b/overlays/overrides.nix index 6280513..597817b 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -11,7 +11,9 @@ channels: final: prev: { nixpkgs-fmt qutebrowser signal-desktop - starship; + starship + deploy-rs + ; haskellPackages = prev.haskellPackages.override From f10a8fdd33e5b354e6c5cfe32029900a891e65ca Mon Sep 17 00:00:00 2001 From: GTrunSec Date: Wed, 29 Sep 2021 11:49:43 -0700 Subject: [PATCH 24/25] chore: update nvfecher --- flake.lock | 6 +++--- shell/devos.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 5dff3b1..3aa2ac1 100644 --- a/flake.lock +++ b/flake.lock @@ -412,11 +412,11 @@ ] }, "locked": { - "lastModified": 1627523399, - "narHash": "sha256-j9CgnUQpWcb8OB4LRzPW8BdxvmoROJptgptDlPA8Heo=", + "lastModified": 1632700276, + "narHash": "sha256-XABvQUq2qv+YcQxW93DnU8mgtVsGJWyhcznny/Lbp0Q=", "owner": "berberman", "repo": "nvfetcher", - "rev": "fb8f2cc770ad3dd3e29d7ba3004692d4d53fba9b", + "rev": "248fe98ed1bc352ce164d08a9e76fdc5f301ba2d", "type": "github" }, "original": { diff --git a/shell/devos.nix b/shell/devos.nix index 128b45c..9090143 100644 --- a/shell/devos.nix +++ b/shell/devos.nix @@ -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 $@"; + command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@"; } (linter nixpkgs-fmt) (linter editorconfig-checker) From 1df67a3f2ac5e109fef54dc0b761aca0d64c2c5c Mon Sep 17 00:00:00 2001 From: GTrunSec Date: Thu, 30 Sep 2021 00:33:01 -0700 Subject: [PATCH 25/25] update digga lock --- flake.lock | 71 ++++++++++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/flake.lock b/flake.lock index 3aa2ac1..f8da619 100644 --- a/flake.lock +++ b/flake.lock @@ -82,10 +82,9 @@ "deploy": { "inputs": { "flake-compat": "flake-compat", - "naersk": "naersk", "nixpkgs": [ "digga", - "nixpkgs" + "latest" ], "utils": [ "digga", @@ -93,11 +92,11 @@ ] }, "locked": { - "lastModified": 1628752686, - "narHash": "sha256-Lzh9MYUJDsjgif+YEyOErXtj1IH+ci8J1C30g1ms69s=", + "lastModified": 1632822684, + "narHash": "sha256-lt7eayYmgsD5OQwpb1XYfHpxttn43bWo7G7hIJs+zJw=", "owner": "serokell", "repo": "deploy-rs", - "rev": "e5546f9c2503c26d175f08a81fc0a0f330be4cbe", + "rev": "9a02de4373e0ec272d08a417b269a28ac8b961b4", "type": "github" }, "original": { @@ -108,11 +107,11 @@ }, "devshell": { "locked": { - "lastModified": 1629275356, - "narHash": "sha256-R17M69EKXP6q8/mNHaK53ECwjFo1pdF+XaJC9Qq8zjg=", + "lastModified": 1632436039, + "narHash": "sha256-OtITeVWcKXn1SpVEnImpTGH91FycCskGBPqmlxiykv4=", "owner": "numtide", "repo": "devshell", - "rev": "26f25a12265f030917358a9632cd600b51af1d97", + "rev": "7a7a7aa0adebe5488e5abaec688fd9ae0f8ea9c6", "type": "github" }, "original": { @@ -131,6 +130,7 @@ "home-manager": [ "home" ], + "latest": "latest", "nix": "nix", "nixlib": [ "nixos" @@ -141,11 +141,11 @@ ] }, "locked": { - "lastModified": 1632784893, - "narHash": "sha256-SBmGCObLqF9CrWoF7hrBpiCMPTUFzHiBvAtCJXQrPg4=", + "lastModified": 1632959483, + "narHash": "sha256-jXogai6e+QRtiZFBOrMmYdeLXejzVT91kuDKu2RuJ10=", "owner": "divnix", "repo": "digga", - "rev": "6316878be3527ef2b27b8e92afb44ce1857830b3", + "rev": "6549cf4c87d1a77138cbecbc6bb9483c20572cd7", "type": "github" }, "original": { @@ -157,11 +157,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", "owner": "edolstra", "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", "type": "github" }, "original": { @@ -228,6 +228,22 @@ } }, "latest": { + "locked": { + "lastModified": 1632660378, + "narHash": "sha256-sjA8eQlnyDjDLyAyq3XlJmN0nqW0ftl/pb7VnMg86L0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "31ffc50c571e6683e9ecc9dbcbd4a8e9914b4497", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "latest_2": { "locked": { "lastModified": 1627942574, "narHash": "sha256-guUcGRWvY2mfiVSet2x/zeHIyflm2wgglj0ldg0mMio=", @@ -261,29 +277,6 @@ } }, "naersk": { - "inputs": { - "nixpkgs": [ - "digga", - "deploy", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1622810282, - "narHash": "sha256-4wmvM3/xfD0hCdNDIXVzRMfL4yB1J+DjH6Zte2xbAxk=", - "owner": "nmattia", - "repo": "naersk", - "rev": "e8061169e1495871b56be97c5c51d310fae01374", - "type": "github" - }, - "original": { - "owner": "nmattia", - "ref": "master", - "repo": "naersk", - "type": "github" - } - }, - "naersk_2": { "inputs": { "nixpkgs": [ "latest" @@ -448,8 +441,8 @@ "flake-utils-plus" ], "home": "home", - "latest": "latest", - "naersk": "naersk_2", + "latest": "latest_2", + "naersk": "naersk", "nixlib": [ "digga", "nixlib"