From dcb425341d94dbf0172f9f3d3ccd9fb870956612 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 20 Jul 2021 18:33:45 -0500 Subject: [PATCH 01/22] update: digga/fup refactoring --- flake.lock | 66 +++++++++++++++++++++++++++--------------------------- flake.nix | 18 +++++++-------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/flake.lock b/flake.lock index 3b84f5bd..b855e569 100644 --- a/flake.lock +++ b/flake.lock @@ -159,6 +159,7 @@ "deploy": "deploy", "devshell": "devshell", "flake-utils": "flake-utils", + "flake-utils-plus": "flake-utils-plus", "home-manager": [ "home" ], @@ -168,15 +169,14 @@ "nixos-generators": "nixos-generators", "nixpkgs": [ "nixos" - ], - "utils": "utils" + ] }, "locked": { - "lastModified": 1626470112, - "narHash": "sha256-hC5I3A1HxfGi45avpYBf8zXi1hQkHYWgRgUM4sF9byI=", + "lastModified": 1626826189, + "narHash": "sha256-Ao4zLLMvs0Q8mDMtTbi7JyUHZAPUkZpo1OArgKLTOzA=", "owner": "divnix", "repo": "digga", - "rev": "f25928ed0bf05ab20af5a8231d264ae01b42ab34", + "rev": "e97d0ec012df585529eefe0381e087d73261e76e", "type": "github" }, "original": { @@ -217,6 +217,28 @@ "type": "github" } }, + "flake-utils-plus": { + "inputs": { + "flake-utils": [ + "digga", + "flake-utils" + ] + }, + "locked": { + "lastModified": 1626825599, + "narHash": "sha256-hgjuzvLE+jlt9z6k5MDbc0Fod4k5frZGnN7zArrlpd4=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "ea46e02fb86785d3c883d658b194d69799386673", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "ref": "staging", + "repo": "flake-utils-plus", + "type": "github" + } + }, "home": { "inputs": { "nixpkgs": [ @@ -373,7 +395,7 @@ ], "flake-utils": [ "digga", - "utils", + "flake-utils-plus", "flake-utils" ], "nixpkgs": [ @@ -429,6 +451,10 @@ "digga", "flake-utils" ], + "flake-utils-plus": [ + "digga", + "flake-utils-plus" + ], "home": "home", "latest": "latest", "naersk": "naersk_2", @@ -442,33 +468,7 @@ "nixos" ], "nur": "nur", - "nvfetcher": "nvfetcher", - "utils": [ - "digga", - "utils" - ] - } - }, - "utils": { - "inputs": { - "flake-utils": [ - "digga", - "flake-utils" - ] - }, - "locked": { - "lastModified": 1626288344, - "narHash": "sha256-TioHDqWJkw37jjx4DVrH6LCzwrUfAqXbWl4rKR91fpA=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "5c6ee69f6957afc2fe22c094717d6d78516418b5", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "ref": "staging", - "repo": "flake-utils-plus", - "type": "github" + "nvfetcher": "nvfetcher" } } }, diff --git a/flake.nix b/flake.nix index d9f6d0a8..4ff6ba5f 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ nvfetcher.url = "github:berberman/nvfetcher"; nvfetcher.inputs.nixpkgs.follows = "latest"; nvfetcher.inputs.flake-compat.follows = "digga/deploy/flake-compat"; - nvfetcher.inputs.flake-utils.follows = "digga/utils/flake-utils"; + nvfetcher.inputs.flake-utils.follows = "digga/flake-utils-plus/flake-utils"; ci-agent.url = "github:hercules-ci/hercules-ci-agent"; ci-agent.inputs.nix-darwin.follows = "darwin"; @@ -51,7 +51,7 @@ nixpkgs.follows = "nixos"; nixlib.follows = "digga/nixlib"; blank.follows = "digga/blank"; - utils.follows = "digga/utils"; + flake-utils-plus.follows = "digga/flake-utils-plus"; flake-utils.follows = "digga/flake-utils"; # end ANTI CORRUPTION LAYER }; @@ -81,7 +81,7 @@ channels = { nixos = { - imports = [ (digga.lib.importers.overlays ./overlays) ]; + imports = [ (digga.lib.importOverlays ./overlays) ]; overlays = [ digga.overlays.patchedNix nur.overlay @@ -109,7 +109,7 @@ hostDefaults = { system = "x86_64-linux"; channelName = "nixos"; - imports = [ (digga.lib.importers.modules ./modules) ]; + imports = [ (digga.lib.importModules ./modules) ]; externalModules = [ { lib.our = self.lib; } digga.nixosModules.nixConfig @@ -120,14 +120,14 @@ ]; }; - imports = [ (digga.lib.importers.hosts ./hosts) ]; + imports = [ (digga.lib.importHosts ./hosts) ]; hosts = { /* set host specific properties here */ NixOS = { }; }; importables = rec { - profiles = digga.lib.importers.rakeLeaves ./profiles // { - users = digga.lib.importers.rakeLeaves ./users; + profiles = digga.lib.rakeLeaves ./profiles // { + users = digga.lib.rakeLeaves ./users; }; suites = with profiles; rec { base = [ core users.nixos users.root ]; @@ -136,10 +136,10 @@ }; home = { - imports = [ (digga.lib.importers.modules ./users/modules) ]; + imports = [ (digga.lib.importModules ./users/modules) ]; externalModules = [ ]; importables = rec { - profiles = digga.lib.importers.rakeLeaves ./users/profiles; + profiles = digga.lib.rakeLeaves ./users/profiles; suites = with profiles; rec { base = [ direnv git ]; }; From 31a8e76209e880ffbb9f8561aeb3a65a0e38ae3b Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 20 Jul 2021 20:59:50 -0500 Subject: [PATCH 02/22] ref: adapt to using plain digga module for boostrap ISO --- flake.lock | 6 +++--- flake.nix | 1 + modules/customBuilds.nix | 11 ----------- 3 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 modules/customBuilds.nix diff --git a/flake.lock b/flake.lock index b855e569..6228532d 100644 --- a/flake.lock +++ b/flake.lock @@ -172,11 +172,11 @@ ] }, "locked": { - "lastModified": 1626826189, - "narHash": "sha256-Ao4zLLMvs0Q8mDMtTbi7JyUHZAPUkZpo1OArgKLTOzA=", + "lastModified": 1626835448, + "narHash": "sha256-qMZ4T0ig9bBHsiu1nEnYzI6JjXjpJv2fnBexpJ8cw+0=", "owner": "divnix", "repo": "digga", - "rev": "e97d0ec012df585529eefe0381e087d73261e76e", + "rev": "372910fa131fdd51edc695b3eb2ce3992b905460", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4ff6ba5f..44c34102 100644 --- a/flake.nix +++ b/flake.nix @@ -112,6 +112,7 @@ imports = [ (digga.lib.importModules ./modules) ]; externalModules = [ { lib.our = self.lib; } + digga.nixosModules.bootstrapIso digga.nixosModules.nixConfig ci-agent.nixosModules.agent-profile home.nixosModules.home-manager diff --git a/modules/customBuilds.nix b/modules/customBuilds.nix deleted file mode 100644 index d7757c6b..00000000 --- a/modules/customBuilds.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ lib, pkgs, self, config, modules, channel, ... }: -{ - system.build = { - iso = (config.lib.digga.mkBuild - (config.lib.digga.modules.isoConfig { - inherit self; - fullHostConfig = config; - }) - ).config.system.build.isoImage; - }; -} From bf8620f8bac46e4ce707ca7f093ecee07c013d2e Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 20 Jul 2021 22:19:09 -0500 Subject: [PATCH 03/22] ref: point `digga` to `main` (default) branch --- flake.lock | 5 ++--- flake.nix | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 6228532d..31b5a93b 100644 --- a/flake.lock +++ b/flake.lock @@ -172,16 +172,15 @@ ] }, "locked": { - "lastModified": 1626835448, + "lastModified": 1626836850, "narHash": "sha256-qMZ4T0ig9bBHsiu1nEnYzI6JjXjpJv2fnBexpJ8cw+0=", "owner": "divnix", "repo": "digga", - "rev": "372910fa131fdd51edc695b3eb2ce3992b905460", + "rev": "af700c53c6c955a46ae834c1e6e7c6bb5cb1adeb", "type": "github" }, "original": { "owner": "divnix", - "ref": "develop", "repo": "digga", "type": "github" } diff --git a/flake.nix b/flake.nix index 44c34102..c81a7fa8 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ nixos.url = "nixpkgs/release-21.05"; latest.url = "nixpkgs"; - digga.url = "github:divnix/digga/develop"; + digga.url = "github:divnix/digga"; digga.inputs.nixpkgs.follows = "nixos"; digga.inputs.nixlib.follows = "nixos"; digga.inputs.home-manager.follows = "home"; From a3ec0d281433f9ba3a1b9723a19cc29302d96eb6 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 20 Jul 2021 23:36:41 -0500 Subject: [PATCH 04/22] imp: use bud nixos-/devhsllModules and hide rebiding both modules depend on `self`/`inputs` available as special args for both, devshell & nixos modules, so bump to an improved `digga`, as well. --- flake.lock | 12 ++++----- flake.nix | 7 ++--- shell/default.nix | 67 +++++------------------------------------------ shell/devos.nix | 61 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 71 deletions(-) create mode 100644 shell/devos.nix diff --git a/flake.lock b/flake.lock index 31b5a93b..560b2085 100644 --- a/flake.lock +++ b/flake.lock @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1626456025, - "narHash": "sha256-TrKfxVir+TilnqSNYokxJKx2ugEem7Khv4YmSwqj9JQ=", + "lastModified": 1626840404, + "narHash": "sha256-6HKRxPlVO4iKyPNAjkjku3JzGX1lgJ+93ieWAx7MY60=", "owner": "divnix", "repo": "bud", - "rev": "59c10c3879b11371944ab664462fe2e9366cfb44", + "rev": "452ec18574b6e4d8b8a6aae9e190255d4c89768c", "type": "github" }, "original": { @@ -172,11 +172,11 @@ ] }, "locked": { - "lastModified": 1626836850, - "narHash": "sha256-qMZ4T0ig9bBHsiu1nEnYzI6JjXjpJv2fnBexpJ8cw+0=", + "lastModified": 1626841951, + "narHash": "sha256-tppFdKz4fvt7gYsMotT/kWSIzKWcdDsMCkQzn6mGRCA=", "owner": "divnix", "repo": "digga", - "rev": "af700c53c6c955a46ae834c1e6e7c6bb5cb1adeb", + "rev": "f676b7899541836129c188f8a23c21f439a02960", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c81a7fa8..640dd155 100644 --- a/flake.nix +++ b/flake.nix @@ -70,9 +70,6 @@ , deploy , ... } @ inputs: - let - bud' = bud self; # rebind to access self.budModules - in digga.lib.mkFlake { inherit self inputs; @@ -117,7 +114,7 @@ ci-agent.nixosModules.agent-profile home.nixosModules.home-manager agenix.nixosModules.age - (bud.nixosModules.bud bud') + bud.nixosModules.bud ]; }; @@ -150,7 +147,7 @@ }; # digga.lib.importers.rakeLeaves ./users/hm; }; - devshell.modules = [ (import ./shell bud') ]; + devshell = ./shell; homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; diff --git a/shell/default.nix b/shell/default.nix index edad83c0..aef90a55 100644 --- a/shell/default.nix +++ b/shell/default.nix @@ -1,63 +1,10 @@ -bud: -{ pkgs, extraModulesPath, ... }: -let - - hooks = import ./hooks; - - pkgWithCategory = category: package: { inherit package category; }; - linter = pkgWithCategory "linter"; - docs = pkgWithCategory "docs"; - devos = pkgWithCategory "devos"; - -in +{ self, inputs, ... }: { - _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 + externalModules = with inputs; [ + bud.devshellModules.bud + ]; + modules = [ + ./devos.nix ]; - - commands = with pkgs; [ - (devos (bud { inherit pkgs; })) - (devos nixUnstable) - (devos agenix) - { - 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/"; - } - (linter nixpkgs-fmt) - (linter editorconfig-checker) - # (docs python3Packages.grip) too many deps - (docs mdbook) - ] - - ++ lib.optional - (pkgs ? deploy-rs) - (devos deploy-rs.deploy-rs) - - ++ lib.optional - (system != "i686-linux") - (devos cachix) - - ; } + diff --git a/shell/devos.nix b/shell/devos.nix new file mode 100644 index 00000000..83101d24 --- /dev/null +++ b/shell/devos.nix @@ -0,0 +1,61 @@ +{ pkgs, extraModulesPath, ... }: +let + + hooks = import ./hooks; + + pkgWithCategory = category: package: { inherit package category; }; + linter = pkgWithCategory "linter"; + docs = pkgWithCategory "docs"; + devos = pkgWithCategory "devos"; + +in +{ + _file = toString ./.; + + imports = [ "${extraModulesPath}/git/hooks.nix" ]; + git = { inherit hooks; }; + + # tempfix: remove when merged https://github.com/numtide/devshell/pull/123 + devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry '' + # PATH is devshell's exorbitant privilige: + # fence against its pollution + _PATH=''${PATH} + # Load installed profiles + for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do + # If that folder doesn't exist, bash loves to return the whole glob + [[ -f "$file" ]] && source "$file" + done + # Exert exorbitant privilige and leave no trace + export PATH=''${_PATH} + unset _PATH + ''); + + packages = with pkgs; [ + git-crypt + ]; + + commands = with pkgs; [ + (devos nixUnstable) + (devos agenix) + { + category = "devos"; + name = pkgs.nvfetcher-bin.pname; + help = pkgs.nvfetcher-bin.meta.description; + command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@; nixpkgs-fmt _sources/"; + } + (linter nixpkgs-fmt) + (linter editorconfig-checker) + # (docs python3Packages.grip) too many deps + (docs mdbook) + ] + + ++ lib.optional + (pkgs ? deploy-rs) + (devos deploy-rs.deploy-rs) + + ++ lib.optional + (system != "i686-linux") + (devos cachix) + + ; +} From 3e298b68dd99c72c54f2450c34068f5b1711c0f8 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 23 Jul 2021 15:32:39 -0500 Subject: [PATCH 05/22] fix: bump flake-utils-plus with a regression w.r.t exportModules reverted --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 560b2085..b8a0f693 100644 --- a/flake.lock +++ b/flake.lock @@ -172,11 +172,11 @@ ] }, "locked": { - "lastModified": 1626841951, - "narHash": "sha256-tppFdKz4fvt7gYsMotT/kWSIzKWcdDsMCkQzn6mGRCA=", + "lastModified": 1627072303, + "narHash": "sha256-XMrOWqYLLMVcTiTzzgaugUUSqlIRj3/l4JGrs1cvgMU=", "owner": "divnix", "repo": "digga", - "rev": "f676b7899541836129c188f8a23c21f439a02960", + "rev": "cba3f8f76b7fd6816625d9e2e033bfa3462d7125", "type": "github" }, "original": { @@ -224,11 +224,11 @@ ] }, "locked": { - "lastModified": 1626825599, - "narHash": "sha256-hgjuzvLE+jlt9z6k5MDbc0Fod4k5frZGnN7zArrlpd4=", + "lastModified": 1627071952, + "narHash": "sha256-FhE0KOuI9Kl4eyGJXu4bh9fBP2hbxjnD1DlKHljCcYs=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "ea46e02fb86785d3c883d658b194d69799386673", + "rev": "51a82925db31073bc4822c9b538a0a3ebf1134b2", "type": "github" }, "original": { From 8b67cae20a110f296abf91cdba94a3946b1ba647 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Fri, 23 Jul 2021 14:38:54 -0600 Subject: [PATCH 06/22] flake: remove ci-agent --- flake.lock | 53 +---------------------------------------------------- flake.nix | 8 -------- 2 files changed, 1 insertion(+), 60 deletions(-) diff --git a/flake.lock b/flake.lock index b8a0f693..661ccefc 100644 --- a/flake.lock +++ b/flake.lock @@ -59,38 +59,6 @@ "type": "github" } }, - "ci-agent": { - "inputs": { - "flake-compat": [ - "digga", - "deploy", - "flake-compat" - ], - "nix-darwin": [ - "darwin" - ], - "nixos-20_09": [ - "nixos" - ], - "nixos-unstable": [ - "latest" - ], - "pre-commit-hooks-nix": "pre-commit-hooks-nix" - }, - "locked": { - "lastModified": 1624885917, - "narHash": "sha256-CaAEhMKzuTyN9krTLZ1jWW3C5HzvKRZY/doVOezZZx0=", - "owner": "hercules-ci", - "repo": "hercules-ci-agent", - "rev": "5eba6597af97e358542c6f968f6ef680ffd2a401", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "hercules-ci-agent", - "type": "github" - } - }, "darwin": { "inputs": { "nixpkgs": [ @@ -276,9 +244,7 @@ "naersk": { "inputs": { "nixpkgs": [ - "digga", - "deploy", - "nixpkgs" + "latest" ] }, "locked": { @@ -415,22 +381,6 @@ "type": "github" } }, - "pre-commit-hooks-nix": { - "flake": false, - "locked": { - "lastModified": 1622650193, - "narHash": "sha256-qSzUpJDv04ajS9FXoCq6NjVF3qOt9IiGIiGh0P8amyw=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "0398f0649e0a741660ac5e8216760bae5cc78579", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "agenix": "agenix", @@ -439,7 +389,6 @@ "blank" ], "bud": "bud", - "ci-agent": "ci-agent", "darwin": "darwin", "deploy": [ "digga", diff --git a/flake.nix b/flake.nix index 640dd155..774e572f 100644 --- a/flake.nix +++ b/flake.nix @@ -35,12 +35,6 @@ nvfetcher.inputs.flake-compat.follows = "digga/deploy/flake-compat"; nvfetcher.inputs.flake-utils.follows = "digga/flake-utils-plus/flake-utils"; - ci-agent.url = "github:hercules-ci/hercules-ci-agent"; - ci-agent.inputs.nix-darwin.follows = "darwin"; - ci-agent.inputs.nixos-20_09.follows = "nixos"; - ci-agent.inputs.nixos-unstable.follows = "latest"; - ci-agent.inputs.flake-compat.follows = "digga/deploy/flake-compat"; - naersk.url = "github:nmattia/naersk"; naersk.inputs.nixpkgs.follows = "latest"; @@ -61,7 +55,6 @@ , digga , bud , nixos - , ci-agent , home , nixos-hardware , nur @@ -111,7 +104,6 @@ { lib.our = self.lib; } digga.nixosModules.bootstrapIso digga.nixosModules.nixConfig - ci-agent.nixosModules.agent-profile home.nixosModules.home-manager agenix.nixosModules.age bud.nixosModules.bud From bf81ed29d1d1ab22c79f0a0700e7cf76ba031004 Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Fri, 30 Jul 2021 22:22:44 +0200 Subject: [PATCH 07/22] Ensure pinning latest channel to nixpkgs nixos-unstable branch --- flake.lock | 7 ++++--- flake.nix | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 661ccefc..f14be310 100644 --- a/flake.lock +++ b/flake.lock @@ -229,15 +229,16 @@ }, "latest": { "locked": { - "lastModified": 1625702968, - "narHash": "sha256-MadGtaIuPvTh9JLZULkQerZae8TFBczg8c12AijZc+s=", + "lastModified": 1627391865, + "narHash": "sha256-tPoWBO9Nzu3wuX37WcnctzL6LoDCErJLnfLGqqmXCm4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "46c8ac79dbc9a4bcb7db4592d4708fb009284e13", + "rev": "8ecc61c91a596df7d3293603a9c2384190c1b89a", "type": "github" }, "original": { "id": "nixpkgs", + "ref": "nixos-unstable", "type": "indirect" } }, diff --git a/flake.nix b/flake.nix index 774e572f..dddcb528 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ inputs = { nixos.url = "nixpkgs/release-21.05"; - latest.url = "nixpkgs"; + latest.url = "nixpkgs/nixos-unstable"; digga.url = "github:divnix/digga"; digga.inputs.nixpkgs.follows = "nixos"; From 2fcb3605eed05978fe4df0f5969aca552fa0e140 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 1 Aug 2021 16:38:52 -0500 Subject: [PATCH 08/22] docs: soft update (fix the most obvious drift) --- .github/workflows/mdbook_docs.yml | 2 +- {pkgs/bud => bud}/default.nix | 0 {pkgs/bud => bud}/get.bash | 0 doc/CONTRIBUTING.md | 33 +- doc/SUMMARY.md | 12 +- doc/{flk => bud}/get.md | 2 +- doc/bud/index.md | 24 ++ doc/concepts/extern.md | 42 --- doc/concepts/index.md | 10 +- doc/concepts/users.md | 6 + doc/flk/doi.md | 10 - doc/flk/home.md | 8 - doc/flk/index.md | 20 -- doc/flk/install.md | 12 - doc/flk/iso.md | 1 - doc/flk/up.md | 4 - doc/flk/update.md | 22 -- doc/integrations/nvfetcher.md | 2 +- doc/mkFlakeOptions.md | 541 ------------------------------ doc/outputs/pkgs.md | 10 - doc/start/iso.md | 4 +- flake.nix | 2 +- 22 files changed, 59 insertions(+), 708 deletions(-) rename {pkgs/bud => bud}/default.nix (100%) rename {pkgs/bud => bud}/get.bash (100%) rename doc/{flk => bud}/get.md (90%) create mode 100644 doc/bud/index.md delete mode 100644 doc/concepts/extern.md delete mode 100644 doc/flk/doi.md delete mode 100644 doc/flk/home.md delete mode 100644 doc/flk/index.md delete mode 100644 doc/flk/install.md delete mode 120000 doc/flk/iso.md delete mode 100644 doc/flk/up.md delete mode 100644 doc/flk/update.md delete mode 100644 doc/mkFlakeOptions.md diff --git a/.github/workflows/mdbook_docs.yml b/.github/workflows/mdbook_docs.yml index 842171c4..5faf9c28 100644 --- a/.github/workflows/mdbook_docs.yml +++ b/.github/workflows/mdbook_docs.yml @@ -3,7 +3,7 @@ name: Deploy Docs to GitHub Pages on: push: branches: - - core + - main jobs: deploy: diff --git a/pkgs/bud/default.nix b/bud/default.nix similarity index 100% rename from pkgs/bud/default.nix rename to bud/default.nix diff --git a/pkgs/bud/get.bash b/bud/get.bash similarity index 100% rename from pkgs/bud/get.bash rename to bud/get.bash diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index 4766cdf7..8574daea 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -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: ` 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 diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md index 4378683f..1d7bafe9 100644 --- a/doc/SUMMARY.md +++ b/doc/SUMMARY.md @@ -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) diff --git a/doc/flk/get.md b/doc/bud/get.md similarity index 90% rename from doc/flk/get.md rename to doc/bud/get.md index 8761f004..12263df0 100644 --- a/doc/flk/get.md +++ b/doc/bud/get.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_. diff --git a/doc/bud/index.md b/doc/bud/index.md new file mode 100644 index 00000000..7b985792 --- /dev/null +++ b/doc/bud/index.md @@ -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 diff --git a/doc/concepts/extern.md b/doc/concepts/extern.md deleted file mode 100644 index 45d8dcb5..00000000 --- a/doc/concepts/extern.md +++ /dev/null @@ -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. diff --git a/doc/concepts/index.md b/doc/concepts/index.md index 8aca6e5c..618292cb 100644 --- a/doc/concepts/index.md +++ b/doc/concepts/index.md @@ -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 diff --git a/doc/concepts/users.md b/doc/concepts/users.md index 20f371de..12bf5622 100644 --- a/doc/concepts/users.md +++ b/doc/concepts/users.md @@ -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 diff --git a/doc/flk/doi.md b/doc/flk/doi.md deleted file mode 100644 index fc522cdd..00000000 --- a/doc/flk/doi.md +++ /dev/null @@ -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`. diff --git a/doc/flk/home.md b/doc/flk/home.md deleted file mode 100644 index f0bae767..00000000 --- a/doc/flk/home.md +++ /dev/null @@ -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. diff --git a/doc/flk/index.md b/doc/flk/index.md deleted file mode 100644 index 04fc1c48..00000000 --- a/doc/flk/index.md +++ /dev/null @@ -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 -``` diff --git a/doc/flk/install.md b/doc/flk/install.md deleted file mode 100644 index 3ae52504..00000000 --- a/doc/flk/install.md +++ /dev/null @@ -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. diff --git a/doc/flk/iso.md b/doc/flk/iso.md deleted file mode 120000 index fa658ef4..00000000 --- a/doc/flk/iso.md +++ /dev/null @@ -1 +0,0 @@ -../start/iso.md \ No newline at end of file diff --git a/doc/flk/up.md b/doc/flk/up.md deleted file mode 100644 index 265e03a0..00000000 --- a/doc/flk/up.md +++ /dev/null @@ -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). diff --git a/doc/flk/update.md b/doc/flk/update.md deleted file mode 100644 index 869db72f..00000000 --- a/doc/flk/update.md +++ /dev/null @@ -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 -``` diff --git a/doc/integrations/nvfetcher.md b/doc/integrations/nvfetcher.md index 2bfaa029..4670657e 100644 --- a/doc/integrations/nvfetcher.md +++ b/doc/integrations/nvfetcher.md @@ -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 diff --git a/doc/mkFlakeOptions.md b/doc/mkFlakeOptions.md deleted file mode 100644 index dbc7abc1..00000000 --- a/doc/mkFlakeOptions.md +++ /dev/null @@ -1,541 +0,0 @@ -## channels -nixpkgs channels to create - - -*_Type_*: -attribute set of submodules - - -*_Default_* -``` -{} -``` - - - - -## channels.\.config -nixpkgs config for this channel - - -*_Type_*: -attribute set or path convertible to it - - -*_Default_* -``` -{} -``` - - - - -## channels.\.input -nixpkgs flake input to use for this channel - - -*_Type_*: -nix flake - - -*_Default_* -``` -"self.inputs." -``` - - - - -## channels.\.overlays -overlays to apply to this channel -these will get exported under the 'overlays' flake output -as \/\ 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.\.channelName -Channel this host should follow - - -*_Type_*: -a channel defined in `channels` - - -*_Default_* -``` -null -``` - - - - -## nixos.hosts.\.modules -modules to include - - -*_Type_*: -list of valid module or path convertible to its or anything convertible to it - - -*_Default_* -``` -[] -``` - - - - -## nixos.hosts.\.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"] -``` - - - diff --git a/doc/outputs/pkgs.md b/doc/outputs/pkgs.md index 58ce52bd..548667ff 100644 --- a/doc/outputs/pkgs.md +++ b/doc/outputs/pkgs.md @@ -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 diff --git a/doc/start/iso.md b/doc/start/iso.md index efa515a0..8f5c6ab0 100644 --- a/doc/start/iso.md +++ b/doc/start/iso.md @@ -2,13 +2,13 @@ Making and writing an installable iso for `hosts/NixOS.nix` is as simple as: ```sh -flk iso NixOS +bud build NixOS bootstrapIso dd bs=4M if=result/iso/*.iso of=/dev/$your_installation_device \ status=progress oflag=sync ``` -This works for any file matching `hosts/*.nix` excluding `default.nix`. +This works for any host. ## ISO image nix store & cache diff --git a/flake.nix b/flake.nix index dddcb528..bdd82cd9 100644 --- a/flake.nix +++ b/flake.nix @@ -152,7 +152,7 @@ } // { - budModules = { devos = import ./pkgs/bud; }; + budModules = { devos = import ./bud; }; } ; } From 135f1d656d9d86f8f021aa49132515958b2b05ba Mon Sep 17 00:00:00 2001 From: David Arnold Date: Mon, 2 Aug 2021 14:05:58 -0500 Subject: [PATCH 09/22] bump: nixos w upstream fixes specifically - https://github.com/NixOS/nixpkgs/pull/132363 - https://github.com/NixOS/nixpkgs/pull/131876 --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index f14be310..350c67d7 100644 --- a/flake.lock +++ b/flake.lock @@ -285,11 +285,11 @@ }, "nixos": { "locked": { - "lastModified": 1626358428, - "narHash": "sha256-mGXU+tE18/oV2i7+7udpFi0RofrFfjmirMSQan03UGc=", + "lastModified": 1627930555, + "narHash": "sha256-JKS4wNmSnkatz+3G5g0/o+tXg3XpQ4AtBpgbw2+kIcw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b106a26a4d75dabd51189fd9f4e9c7b96677429c", + "rev": "c15e294a60abc894964f4b0ae0ca17dc18b9ca98", "type": "github" }, "original": { From 757c107b4670aba05851896c4c6c8fb7b9fe283b Mon Sep 17 00:00:00 2001 From: David Arnold Date: Mon, 2 Aug 2021 14:07:04 -0500 Subject: [PATCH 10/22] bump: digga --- flake.lock | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 350c67d7..aa53fc9a 100644 --- a/flake.lock +++ b/flake.lock @@ -140,11 +140,11 @@ ] }, "locked": { - "lastModified": 1627072303, - "narHash": "sha256-XMrOWqYLLMVcTiTzzgaugUUSqlIRj3/l4JGrs1cvgMU=", + "lastModified": 1627484795, + "narHash": "sha256-ZnErne4CWPxN3G6jwEzSeTD++iIXdRa9+5ZTp2IuOQ0=", "owner": "divnix", "repo": "digga", - "rev": "cba3f8f76b7fd6816625d9e2e033bfa3462d7125", + "rev": "b52bb1001950eae6aca993232c1a88d0638b1dcf", "type": "github" }, "original": { @@ -245,7 +245,9 @@ "naersk": { "inputs": { "nixpkgs": [ - "latest" + "digga", + "deploy", + "nixpkgs" ] }, "locked": { From 0f98fe0cb3f4867d35531e709921c9c899a83a25 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Mon, 2 Aug 2021 14:09:33 -0500 Subject: [PATCH 11/22] bump: bud with some corutils missing deps & other fixes --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index aa53fc9a..95ef1003 100644 --- a/flake.lock +++ b/flake.lock @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1626840404, - "narHash": "sha256-6HKRxPlVO4iKyPNAjkjku3JzGX1lgJ+93ieWAx7MY60=", + "lastModified": 1627855680, + "narHash": "sha256-snDOrUp8nth2Vs3GeEXr7Xji+HaHy25htZLNvid/U3I=", "owner": "divnix", "repo": "bud", - "rev": "452ec18574b6e4d8b8a6aae9e190255d4c89768c", + "rev": "612228a68d404d559405225427a5d8b3cef9d27c", "type": "github" }, "original": { From 6f5ef6126ee7fa96276e45ba349f048f937c49ab Mon Sep 17 00:00:00 2001 From: David Arnold Date: Mon, 2 Aug 2021 14:38:30 -0500 Subject: [PATCH 12/22] fix: cachix branch --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e4fc197e..c8a8f64c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,7 +2,7 @@ name: "Check & Cachix" on: push: branches: - - core + - main - trying - staging jobs: From aba10aa8a43a0011e7d86d15ac466b4aeaf9e59b Mon Sep 17 00:00:00 2001 From: GTrunSec Date: Sun, 1 Aug 2021 15:44:31 -0700 Subject: [PATCH 13/22] fix/hm: direnv flakes support --- users/profiles/direnv/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/users/profiles/direnv/default.nix b/users/profiles/direnv/default.nix index 2b51c9d2..d345e2d3 100644 --- a/users/profiles/direnv/default.nix +++ b/users/profiles/direnv/default.nix @@ -1,6 +1,9 @@ { programs.direnv = { enable = true; - nix-direnv.enable = true; + nix-direnv = { + enable = true; + enableFlakes = true; + }; }; } From 768c9b8216516eaa20ffed8a3c1bebed55acaf70 Mon Sep 17 00:00:00 2001 From: GTrunSec Date: Sun, 1 Aug 2021 15:46:41 -0700 Subject: [PATCH 14/22] bump: nvfetcher and cleanup --- flake.lock | 6 +++--- pkgs/_sources/generated.nix | 1 - shell/devos.nix | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 95ef1003..6082f57c 100644 --- a/flake.lock +++ b/flake.lock @@ -371,11 +371,11 @@ ] }, "locked": { - "lastModified": 1624890984, - "narHash": "sha256-RMQtTm4OoEc8BHWk4/Yfu1y4uHlG4HCP+DeC0J0zGqQ=", + "lastModified": 1627523399, + "narHash": "sha256-j9CgnUQpWcb8OB4LRzPW8BdxvmoROJptgptDlPA8Heo=", "owner": "berberman", "repo": "nvfetcher", - "rev": "d3efa8c58057dbcc1565dca3105d31d9f25fd5ca", + "rev": "fb8f2cc770ad3dd3e29d7ba3004692d4d53fba9b", "type": "github" }, "original": { diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index 0d13ac01..71be3965 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -12,6 +12,5 @@ leaveDotGit = false; sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; }; - }; } diff --git a/shell/devos.nix b/shell/devos.nix index 83101d24..128b45c3 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 $@; nixpkgs-fmt _sources/"; + command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@"; } (linter nixpkgs-fmt) (linter editorconfig-checker) From b5da4066898205f2270f1ac4b0dada9403bb78e1 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 5 Aug 2021 20:16:53 -0500 Subject: [PATCH 15/22] 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 00000000..d491855d --- /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 16/22] 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 6082f57c..b3efea01 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 bdd82cd9..bba4f434 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 17/22] Fix a typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f088ca04..08f73f98 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 18/22] Fix typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 08f73f98..6607bb42 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 19/22] 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 873af32e..80fbd61c 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 20/22] 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 80fbd61c..09cb34fc 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 21/22] 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 8f5c6ab0..76af1c6e 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 22/22] 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 09cb34fc..f4c5190e 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 ```