From e1d7178979a421bbfc83961edb962871acf5c791 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 13 Jun 2021 12:15:09 -0500 Subject: [PATCH 01/37] init: common flake compat fixes for other nixpkgs fixes #315 --- overlays/various-flake-fixes.nix | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 overlays/various-flake-fixes.nix diff --git a/overlays/various-flake-fixes.nix b/overlays/various-flake-fixes.nix new file mode 100644 index 0000000..2bb1f70 --- /dev/null +++ b/overlays/various-flake-fixes.nix @@ -0,0 +1,9 @@ +final: prev: { + # Since: https://github.com/NixOS/nixpkgs/pull/126137 + nix-direnv = + if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs + then prev.nix-direnv.override { + enableFlakes = true; + } + else prev.nix-direnv; +} From 62683b24acc01aad5785569f18219eca9764df90 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 13 Jun 2021 23:30:05 -0500 Subject: [PATCH 02/37] ref: pass our lib as lib.our to the module system At least we don't find ourselves with strange module signatures and use something that looks like a dedicated namespace within he module system: `config.lib` --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 359aa31..e870ac1 100644 --- a/flake.nix +++ b/flake.nix @@ -71,7 +71,7 @@ channelName = "nixos"; modules = ./modules/module-list.nix; externalModules = [ - { _module.args.ourLib = self.lib; } + { lib.our = self.lib; } ci-agent.nixosModules.agent-profile home.nixosModules.home-manager agenix.nixosModules.age From 3cc28b3adb93f15ff8f23097c27e4b666ee6ba2b Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sat, 19 Jun 2021 13:26:07 -0500 Subject: [PATCH 03/37] bump digga to latest develop --- flake.lock | 137 ++++++++++++++-------------------- flake.nix | 17 +++-- modules/customBuilds.nix | 49 ++++++------ modules/module-list.nix | 1 - users/modules/.flake-keep | 0 users/modules/module-list.nix | 1 - 6 files changed, 88 insertions(+), 117 deletions(-) delete mode 100644 modules/module-list.nix create mode 100644 users/modules/.flake-keep delete mode 100644 users/modules/module-list.nix diff --git a/flake.lock b/flake.lock index e041177..7f67e26 100644 --- a/flake.lock +++ b/flake.lock @@ -72,15 +72,21 @@ "inputs": { "flake-compat": "flake-compat_2", "naersk": "naersk", - "nixpkgs": "nixpkgs", - "utils": "utils" + "nixpkgs": [ + "digga", + "nixpkgs" + ], + "utils": [ + "digga", + "utils" + ] }, "locked": { - "lastModified": 1616406726, - "narHash": "sha256-n9zmgxR03QNrvs9/fHewqE0j3SjL7Y+cglBCFu3U3rg=", + "lastModified": 1623011836, + "narHash": "sha256-02M4P3eqUdV+ouZb8n1KDR1CXeZQm17cKpjKZKi0c10=", "owner": "serokell", "repo": "deploy-rs", - "rev": "9e405fbc5ab5bacbd271fd78c6b6b6877c4d9f8d", + "rev": "70d71b3027b1793b780f1e2435bdbbe1b0cb9ac6", "type": "github" }, "original": { @@ -109,20 +115,21 @@ "deploy": "deploy", "devshell": "devshell", "nixlib": "nixlib", - "nixpkgs": "nixpkgs_2", - "utils": "utils_2" + "nixos-generators": "nixos-generators", + "nixpkgs": "nixpkgs", + "utils": "utils" }, "locked": { - "lastModified": 1623197477, - "narHash": "sha256-2Qk/uIHb1nXre2rRlGonAJmpuamBs7RRfgXhMmS5JkU=", + "lastModified": 1624576193, + "narHash": "sha256-EPemiDnTx0V622bMtGpcgclSExljWK3+qXZMiZVvvEc=", "owner": "divnix", "repo": "digga", - "rev": "f69703abc33f221b676966a8435c4f09ef70ff49", + "rev": "241896d3942fe3f818ce9a153955dbcadd9f00fc", "type": "github" }, "original": { "owner": "divnix", - "ref": "master", + "ref": "develop", "repo": "digga", "type": "github" } @@ -161,11 +168,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1620759905, - "narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=", + "lastModified": 1623660459, + "narHash": "sha256-OTmOsh43po7r5F9s9H6lVCBQ2b0FikWbmiwLbMAGRdw=", "owner": "numtide", "repo": "flake-utils", - "rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8", + "rev": "98c8d36b1828009b20f12544214683c7489935a1", "type": "github" }, "original": { @@ -211,15 +218,16 @@ "naersk": { "inputs": { "nixpkgs": [ - "latest" + "digga", + "nixpkgs" ] }, "locked": { - "lastModified": 1610392286, - "narHash": "sha256-3wFl5y+4YZO4SgRYK8WE7JIS3p0sxbgrGaQ6RMw+d98=", + "lastModified": 1622810282, + "narHash": "sha256-4wmvM3/xfD0hCdNDIXVzRMfL4yB1J+DjH6Zte2xbAxk=", "owner": "nmattia", "repo": "naersk", - "rev": "d7bfbad3304fd768c0f93a4c3b50976275e6d4be", + "rev": "e8061169e1495871b56be97c5c51d310fae01374", "type": "github" }, "original": { @@ -229,26 +237,6 @@ "type": "github" } }, - "naersk_2": { - "inputs": { - "nixpkgs": [ - "latest" - ] - }, - "locked": { - "lastModified": 1614785451, - "narHash": "sha256-TPw8kQvr2UNCuvndtY+EjyXp6Q5GEW2l9UafXXh1XmI=", - "owner": "nmattia", - "repo": "naersk", - "rev": "e0fe990b478a66178a58c69cf53daec0478ca6f9", - "type": "github" - }, - "original": { - "owner": "nmattia", - "repo": "naersk", - "type": "github" - } - }, "nixlib": { "locked": { "lastModified": 1620519687, @@ -266,19 +254,40 @@ }, "nixos": { "locked": { - "lastModified": 1615797423, - "narHash": "sha256-5NGDZXPQzuoxf/42NiyC9YwwhwzfMfIRrz3aT0XHzSc=", + "lastModified": 1624125633, + "narHash": "sha256-AAJPHLnK3Y/R8F7cL1cgTmC5GcfjqjhaV7D0PdyQk8A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "266dc8c3d052f549826ba246d06787a219533b8f", + "rev": "59979f87460379fb2156e462a941b97ddf62ee3a", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-unstable", + "ref": "release-21.05", "type": "indirect" } }, + "nixos-generators": { + "inputs": { + "nixpkgs": [ + "digga", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1624117213, + "narHash": "sha256-hAoBANafVdM/+8Z6PrlPEKPN6LrdkM4qg2Q/ji0XUns=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "c64d3c2153274a6ab355e57f5eedfe6f85073d24", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1615652054, @@ -296,27 +305,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1610942247, - "narHash": "sha256-PKo1ATAlC6BmfYSRmX0TVmNoFbrec+A5OKcabGEu2yU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "7d71001b796340b219d1bfa8552c81995017544a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1620962350, - "narHash": "sha256-9ASW4d4/Z8HmRvuJI8rxbEOTbXTBpQ8y+CmFYBwtXzE=", + "lastModified": 1624148921, + "narHash": "sha256-FAhKTXZV67C36hK5lPvZfsFt+QY1QSHYQXwGXqpOChs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5d4a430472cafada97888cc80672fab255231f57", + "rev": "f2122ea5815648effdd97157c7bf4e9a1a6dbb34", "type": "github" }, "original": { @@ -379,7 +372,6 @@ "digga": "digga", "home": "home", "latest": "latest", - "naersk": "naersk_2", "nixos": "nixos", "nixos-hardware": "nixos-hardware", "nur": "nur", @@ -387,30 +379,15 @@ } }, "utils": { - "locked": { - "lastModified": 1610051610, - "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "utils_2": { "inputs": { "flake-utils": "flake-utils" }, "locked": { - "lastModified": 1622583383, - "narHash": "sha256-2DFx619SNfjzYwqx1ryae8zHnTh+N7VsZkbtAbrYIIA=", + "lastModified": 1624128793, + "narHash": "sha256-yZYvpT6i6iRK0x1a8k/LCoS7JGLVk6Yi1eqfhatnDLk=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "6b2ea4b02cad77fac581c6a9ec4f822ba87dce5c", + "rev": "785e6f13b8c6131d1eee625a713e8475b2b0512b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e870ac1..5fef5ee 100644 --- a/flake.nix +++ b/flake.nix @@ -3,9 +3,12 @@ inputs = { - nixos.url = "nixpkgs/nixos-unstable"; + nixos.url = "nixpkgs/release-21.05"; latest.url = "nixpkgs"; - digga.url = "github:divnix/digga/master"; + digga = { + url = "github:divnix/digga/develop"; + inputs.nipxkgs.follows = "latest"; + }; ci-agent = { url = "github:hercules-ci/hercules-ci-agent"; @@ -15,8 +18,8 @@ darwin.inputs.nixpkgs.follows = "latest"; home.url = "github:nix-community/home-manager"; home.inputs.nixpkgs.follows = "nixos"; - naersk.url = "github:nmattia/naersk"; - naersk.inputs.nixpkgs.follows = "latest"; + # naersk.url = "github:nmattia/naersk"; + # naersk.inputs.nixpkgs.follows = "latest"; agenix.url = "github:ryantm/agenix"; agenix.inputs.nixpkgs.follows = "latest"; nixos-hardware.url = "github:nixos/nixos-hardware"; @@ -59,6 +62,7 @@ sharedOverlays = [ (final: prev: { + __dontExport = true; lib = prev.lib.extend (lfinal: lprev: { our = self.lib; }); @@ -69,13 +73,12 @@ hostDefaults = { system = "x86_64-linux"; channelName = "nixos"; - modules = ./modules/module-list.nix; + imports = [ (digga.lib.importers.modules ./modules) ]; externalModules = [ { lib.our = self.lib; } ci-agent.nixosModules.agent-profile home.nixosModules.home-manager agenix.nixosModules.age - ./modules/customBuilds.nix ]; }; @@ -95,7 +98,7 @@ }; home = { - modules = ./users/modules/module-list.nix; + imports = [ (digga.lib.importers.modules ./users/modules) ]; externalModules = [ ]; importables = rec { profiles = digga.lib.importers.rakeLeaves ./users/profiles; diff --git a/modules/customBuilds.nix b/modules/customBuilds.nix index 7181f65..cbaefe3 100644 --- a/modules/customBuilds.nix +++ b/modules/customBuilds.nix @@ -1,33 +1,26 @@ -{ lib, self, diggaLib, config, modules, channel, ... }: -let - mkBuild = buildModule: - # TODO: get specialArgs as a module argument and drop builderArgs usage - channel.input.lib.nixosSystem (diggaLib.mergeAny config.lib.builderArgs { - modules = [ buildModule ]; - }); -in +{ lib, pkgs, self, config, modules, channel, ... }: { system.build = { - iso = (mkBuild (diggaLib.modules.isoConfig { - inherit self; - fullHostConfig = config; - })).config.system.build.isoImage; + iso = (config.lib.digga.mkBuild + (config.lib.digga.modules.isoConfig { + inherit self; + fullHostConfig = config; + }) + ).config.system.build.isoImage; - homes = (mkBuild ({ config, ... }: { - home-manager.useUserPackages = lib.mkForce false; - home-manager.sharedModules = [ - { - home.sessionVariables = { - inherit (config.environment.sessionVariables) NIX_PATH; - }; - xdg.configFile."nix/registry.json".text = - config.environment.etc."nix/registry.json".text; - } - ]; - })).config.home-manager.users; - - digitalOcean = (mkBuild ({ modulesPath, ... }: { - imports = [ "${modulesPath}/virtualisation/digital-ocean-image.nix" ]; - })).config.system.build.digitalOceanImage; + homes = (config.lib.digga.mkBuild + ({ config, ... }: { + home-manager.useUserPackages = lib.mkForce false; + home-manager.sharedModules = [ + { + home.sessionVariables = { + inherit (config.environment.sessionVariables) NIX_PATH; + }; + xdg.configFile."nix/registry.json".text = + config.environment.etc."nix/registry.json".text; + } + ]; + }) + ).config.home-manager.users; }; } diff --git a/modules/module-list.nix b/modules/module-list.nix deleted file mode 100644 index 1e3ec72..0000000 --- a/modules/module-list.nix +++ /dev/null @@ -1 +0,0 @@ -[ ] diff --git a/users/modules/.flake-keep b/users/modules/.flake-keep new file mode 100644 index 0000000..e69de29 diff --git a/users/modules/module-list.nix b/users/modules/module-list.nix deleted file mode 100644 index 1e3ec72..0000000 --- a/users/modules/module-list.nix +++ /dev/null @@ -1 +0,0 @@ -[ ] From 1c80b508ca29def7c0df7f1e883fd9ca86d125f5 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 24 Jun 2021 18:15:15 -0500 Subject: [PATCH 04/37] bump: nixpkgs to avoid https://github.com/NixOS/nixpkgs/pull/127720 --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7f67e26..535d572 100644 --- a/flake.lock +++ b/flake.lock @@ -254,11 +254,11 @@ }, "nixos": { "locked": { - "lastModified": 1624125633, - "narHash": "sha256-AAJPHLnK3Y/R8F7cL1cgTmC5GcfjqjhaV7D0PdyQk8A=", + "lastModified": 1624575719, + "narHash": "sha256-MVQJ2ltjqrxdB8zHj2s05ujgX6VbCDZ/+K8j2xh59Hk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "59979f87460379fb2156e462a941b97ddf62ee3a", + "rev": "001f78ff0044adf3ca972643eaf3fc5cbc8f634c", "type": "github" }, "original": { From ee89bf3f2a166c610101f93f1b3053068f86626f Mon Sep 17 00:00:00 2001 From: GTrunSec Date: Sun, 13 Jun 2021 21:48:43 -0700 Subject: [PATCH 05/37] feature: Add pkgs fetch manager nvfetcher Co-authored-by: David Arnold --- .gitignore | 2 ++ README.md | 34 +++++++++++++----------- flake.lock | 53 +++++++++++++++++++++++++++++++------ flake.nix | 20 +++++++++----- overlays/manix.nix | 5 ++++ overlays/overrides.nix | 1 - pkgs/_sources/generated.nix | 17 ++++++++++++ pkgs/default.nix | 6 ++++- pkgs/flake.lock | 25 ----------------- pkgs/flake.nix | 52 ------------------------------------ pkgs/sources.toml | 4 +++ 11 files changed, 110 insertions(+), 109 deletions(-) create mode 100644 overlays/manix.nix create mode 100644 pkgs/_sources/generated.nix delete mode 100644 pkgs/flake.lock delete mode 100644 pkgs/flake.nix create mode 100644 pkgs/sources.toml diff --git a/.gitignore b/.gitignore index e2486b1..1721f0d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ doc/index.html vm iso doi + +pkgs/_sources/.shake* diff --git a/README.md b/README.md index f347f4a..78c30ea 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ following giants][giants]: ### :family: — like family - [`numtide/devshell`][devshell] - [`serokell/deploy-rs`][deploy] +- [`berberman/nvfetcher`][nvfetcher] - [`NixOS/nixpkgs`][nixpkgs] :heart: @@ -94,22 +95,23 @@ goals are sufficiently upstreamed into "the Nix", dissolved. # License DevOS is licensed under the [MIT License][mit]. -[mk-flake]: https://github.com/divnix/digga/tree/master/src/mkFlake -[nixpkgs]: https://github.com/NixOS/nixpkgs -[deploy]: https://github.com/serokell/deploy-rs -[toc]: https://github.com/divnix/devos/blob/core/flake.nix -[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants -[digga]: https://github.com/divnix/digga -[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus -[fu]: https://github.com/numtide/flake-utils -[devshell]: https://github.com/numtide/devshell -[nix]: https://nixos.org/manual/nix/stable -[mit]: https://mit-license.org -[nixos]: https://nixos.org/manual/nixos/stable -[home-manager]: https://nix-community.github.io/home-manager -[flakes]: https://nixos.wiki/wiki/Flakes -[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md -[core]: https://github.com/divnix/devos [community]: https://github.com/divnix/devos/tree/community +[core]: https://github.com/divnix/devos +[deploy]: https://github.com/serokell/deploy-rs +[devshell]: https://github.com/numtide/devshell +[digga]: https://github.com/divnix/digga [dotfiles]: https://github.com/hlissner/dotfiles +[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md +[flakes]: https://nixos.wiki/wiki/Flakes +[fu]: https://github.com/numtide/flake-utils +[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus +[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants +[home-manager]: https://nix-community.github.io/home-manager +[mit]: https://mit-license.org +[mk-flake]: https://github.com/divnix/digga/tree/master/src/mkFlake +[nix]: https://nixos.org/manual/nix/stable +[nixos]: https://nixos.org/manual/nixos/stable +[nixpkgs]: https://github.com/NixOS/nixpkgs +[nvfetcher]: https://github.com/berberman/nvfetcher [please]: https://github.com/nrdxp/devos/tree/nrd +[toc]: https://github.com/divnix/devos/blob/core/flake.nix diff --git a/flake.lock b/flake.lock index 535d572..5a2bf6b 100644 --- a/flake.lock +++ b/flake.lock @@ -166,6 +166,22 @@ "type": "github" } }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1606424373, + "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1623660459, @@ -181,6 +197,21 @@ "type": "github" } }, + "flake-utils_2": { + "locked": { + "lastModified": 1620759905, + "narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home": { "inputs": { "nixpkgs": [ @@ -332,20 +363,26 @@ "type": "indirect" } }, - "pkgs": { + "nvfetcher": { "inputs": { + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_2", "nixpkgs": [ - "nixos" + "latest" ] }, "locked": { - "narHash": "sha256-Zs7dc0dNNa0Z3//+Gckxj7SKrMqVovY0xZZ1z8xWnEg=", - "path": "./pkgs", - "type": "path" + "lastModified": 1624534673, + "narHash": "sha256-7HWt8Xh4aIFfGKAFQus5euhYxcWLe6kXz1DsGuV0WbU=", + "owner": "berberman", + "repo": "nvfetcher", + "rev": "a8514f53c7999d23b48d2f42de63660bc3d7850f", + "type": "github" }, "original": { - "path": "./pkgs", - "type": "path" + "owner": "berberman", + "repo": "nvfetcher", + "type": "github" } }, "pre-commit-hooks-nix": { @@ -375,7 +412,7 @@ "nixos": "nixos", "nixos-hardware": "nixos-hardware", "nur": "nur", - "pkgs": "pkgs" + "nvfetcher": "nvfetcher" } }, "utils": { diff --git a/flake.nix b/flake.nix index 5fef5ee..95859a8 100644 --- a/flake.nix +++ b/flake.nix @@ -24,13 +24,12 @@ agenix.inputs.nixpkgs.follows = "latest"; nixos-hardware.url = "github:nixos/nixos-hardware"; - pkgs.url = "path:./pkgs"; - pkgs.inputs.nixpkgs.follows = "nixos"; + nvfetcher.url = "github:berberman/nvfetcher"; + nvfetcher.inputs.nixpkgs.follows = "latest"; }; outputs = { self - , pkgs , digga , nixos , ci-agent @@ -38,6 +37,7 @@ , nixos-hardware , nur , agenix + , nvfetcher , ... } @ inputs: digga.lib.mkFlake { @@ -49,10 +49,11 @@ nixos = { imports = [ (digga.lib.importers.overlays ./overlays) ]; overlays = [ - ./pkgs/default.nix - pkgs.overlay # for `srcs` nur.overlay agenix.overlay + nvfetcher.overlay + (final: prev: { nvfetcher-bin = nvfetcher.defaultPackage.${final.system}; }) + ./pkgs/default.nix ]; }; latest = { }; @@ -109,7 +110,14 @@ }; devshell.externalModules = { pkgs, ... }: { - packages = [ pkgs.agenix ]; + commands = [ + { package = pkgs.agenix; category = "secrets"; } + { + 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/"; + } + ]; }; homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; diff --git a/overlays/manix.nix b/overlays/manix.nix new file mode 100644 index 0000000..d39baa7 --- /dev/null +++ b/overlays/manix.nix @@ -0,0 +1,5 @@ +final: prev: { + manix = prev.manix.overrideAttrs (o: rec{ + inherit (prev.sources.manix) pname version src; + }); +} diff --git a/overlays/overrides.nix b/overlays/overrides.nix index 629f44b..da1f0ee 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -7,7 +7,6 @@ channels: final: prev: { dhall discord element-desktop - manix rage nixpkgs-fmt qutebrowser diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix new file mode 100644 index 0000000..0d13ac0 --- /dev/null +++ b/pkgs/_sources/generated.nix @@ -0,0 +1,17 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl }: +{ + manix = { + pname = "manix"; + version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; + src = fetchgit { + url = "https://github.com/mlvzk/manix"; + rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = false; + sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; + }; + + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index ce16870..924a230 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1 +1,5 @@ -final: prev: { } +final: prev: { + # keep sources this first + sources = prev.callPackage (import ./_sources/generated.nix) { }; + # then, call packages with `final.callPackage` +} diff --git a/pkgs/flake.lock b/pkgs/flake.lock deleted file mode 100644 index ef3f5a9..0000000 --- a/pkgs/flake.lock +++ /dev/null @@ -1,25 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1615926763, - "narHash": "sha256-yeq8A3EPNuQVlsxlEQrIRsklfJwJK0Us6jtcG/u8wNs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b702a56d417647de4090ac56c0f18bdc7e646610", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/pkgs/flake.nix b/pkgs/flake.nix deleted file mode 100644 index 1b6cc0a..0000000 --- a/pkgs/flake.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - description = "Package Sources"; - - inputs = { }; - - outputs = { self, nixpkgs, ... }: { - overlay = final: prev: { - inherit (self) srcs; - }; - - srcs = - let - inherit (nixpkgs) lib; - - mkVersion = name: input: - let - inputs = (builtins.fromJSON - (builtins.readFile ./flake.lock)).nodes; - - ref = - if lib.hasAttrByPath [ name "original" "ref" ] inputs - then inputs.${name}.original.ref - else ""; - - version = - let version' = builtins.match - "[[:alpha:]]*[-._]?([0-9]+(\.[0-9]+)*)+" - ref; - in - if lib.isList version' - then lib.head version' - else if input ? lastModifiedDate && input ? shortRev - then "${lib.substring 0 8 input.lastModifiedDate}_${input.shortRev}" - else null; - in - version; - in - lib.mapAttrs - (pname: input: - let - version = mkVersion pname input; - in - input // { inherit pname; } - // lib.optionalAttrs (! isNull version) - { - inherit version; - } - ) - (lib.filterAttrs (n: _: n != "nixpkgs") - self.inputs); - }; -} diff --git a/pkgs/sources.toml b/pkgs/sources.toml new file mode 100644 index 0000000..f7af168 --- /dev/null +++ b/pkgs/sources.toml @@ -0,0 +1,4 @@ +# nvfetcher.toml +[manix] +src.git = "https://github.com/mlvzk/manix" +fetch.github = "mlvzk/manix" From b927d97ce2fe99977b10a792a094952a514dcfe5 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Wed, 16 Jun 2021 17:25:37 -0500 Subject: [PATCH 06/37] doc: nvfetcher --- doc/SUMMARY.md | 1 + doc/integrations/nvfetcher.md | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 doc/integrations/nvfetcher.md diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md index e2b6e9a..4378683 100644 --- a/doc/SUMMARY.md +++ b/doc/SUMMARY.md @@ -31,5 +31,6 @@ - [Integrations](./integrations/index.md) - [Cachix](./integrations/cachix.md) - [Deploy RS](./integrations/deploy.md) + - [NvFetcher](./integrations/nvfetcher.md) - [Hercules CI](./integrations/hercules.md) - [Contributing](./CONTRIBUTING.md) diff --git a/doc/integrations/nvfetcher.md b/doc/integrations/nvfetcher.md new file mode 100644 index 0000000..2bfaa02 --- /dev/null +++ b/doc/integrations/nvfetcher.md @@ -0,0 +1,43 @@ +# nvfetcher +[NvFetcher][nvf] is a workflow companion for updating nix sources. + +You can specify an origin source and an update configuration, and +nvfetcher can for example track updates to a specific branch and +automatically update your nix sources configuration on each run +to the tip of that branch. + +All package source declaration is done in [sources.toml][sources.toml]. + +From within the devshell of this repo, run `nvfetcher`, a wrapped +version of `nvfetcher` that knows where to find and place its files +and commit the results. + +## Usage + +Statically fetching (not tracking) a particular tag from a github repo: +```toml +[manix] +src.manual = "v0.6.3" +fetch.github = "mlvzk/manix" +``` + +Tracking the latest github _release_ from a github repo: +```toml +[manix] +src.github = "mlvzk/manix" # responsible for tracking +fetch.github = "mlvzk/manix" # responsible for fetching +``` + +Tracking the latest commit of a git repository and fetch from a git repo: +```toml +[manix] +src.git = "https://github.com/mlvzk/manix.git" # responsible for tracking +fetch.git = "https://github.com/mlvzk/manix.git" # responsible for fetching +``` + +> ##### _Note:_ +> Please refer to the [NvFetcher Readme][nvf-readme] for more options. + +[nvf: https://github.com/berberman/nvfetcher +[nvf-readme]: https://github.com/berberman/nvfetcher#readme +[sources.toml]: https://github.com/divnix/devos/tree/core/pkgs/sources.toml From f1117f27ec333cc801fd04c70b7ba205330b986d Mon Sep 17 00:00:00 2001 From: GTrunSec Date: Thu, 24 Jun 2021 22:58:26 -0700 Subject: [PATCH 07/37] fix hasekllPackages overlay --- flake.nix | 1 - overlays/overrides.nix | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 95859a8..fd21f71 100644 --- a/flake.nix +++ b/flake.nix @@ -52,7 +52,6 @@ nur.overlay agenix.overlay nvfetcher.overlay - (final: prev: { nvfetcher-bin = nvfetcher.defaultPackage.${final.system}; }) ./pkgs/default.nix ]; }; diff --git a/overlays/overrides.nix b/overlays/overrides.nix index da1f0ee..6280513 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -14,15 +14,15 @@ channels: final: prev: { starship; - haskellPackages = prev.haskellPackages.override { - overrides = hfinal: hprev: - let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version; - in - { - # same for haskell packages, matching ghc versions - inherit (channels.latest.haskell.packages."ghc${version}") - haskell-language-server; - }; - }; - + haskellPackages = prev.haskellPackages.override + (old: { + overrides = prev.lib.composeExtensions (old.overrides or (_: _: { })) (hfinal: hprev: + let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version; + in + { + # same for haskell packages, matching ghc versions + inherit (channels.latest.haskell.packages."ghc${version}") + haskell-language-server; + }); + }); } From 95f429a5258b9b9d2f9be243c97f83da5385b06b Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Wed, 30 Jun 2021 08:50:07 -0600 Subject: [PATCH 08/37] core: use bottom instead of gotop --- profiles/core/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/core/default.nix b/profiles/core/default.nix index 9e98ba6..d2801d8 100644 --- a/profiles/core/default.nix +++ b/profiles/core/default.nix @@ -17,7 +17,7 @@ in dosfstools fd git - gotop + bottom gptfdisk iputils jq @@ -84,7 +84,7 @@ in se = ifSudo "sudoedit"; # top - top = "gotop"; + top = "btm"; # systemd ctl = "systemctl"; From 33fb25e011b050bf577a0fd77f29348e0126abc0 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Wed, 7 Jul 2021 19:31:12 -0500 Subject: [PATCH 09/37] ref: move devshell module here to `devos` again --- .gitignore | 2 - flake.lock | 157 ++++++++++++++++++++++++++------------ flake.nix | 32 ++++---- pkgs/bud/default.nix | 10 +++ pkgs/bud/get.bash | 6 ++ shell/default.nix | 62 +++++++++++++++ shell/hooks/default.nix | 4 + shell/hooks/pre-commit.sh | 29 +++++++ 8 files changed, 240 insertions(+), 62 deletions(-) create mode 100644 pkgs/bud/default.nix create mode 100644 pkgs/bud/get.bash create mode 100644 shell/default.nix create mode 100644 shell/hooks/default.nix create mode 100755 shell/hooks/pre-commit.sh diff --git a/.gitignore b/.gitignore index 1721f0d..4a99123 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ result -up -hosts/up-* .direnv doc/index.html diff --git a/flake.lock b/flake.lock index 5a2bf6b..8344bfb 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,25 @@ "type": "github" } }, + "bud": { + "inputs": { + "devshell": "devshell", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1625703505, + "narHash": "sha256-PNtHOR5wp3R/cysCHTIFcxCHHuisljbrS6iNyP/Ivfk=", + "owner": "divnix", + "repo": "bud", + "rev": "baefc56e5819375736b51e93df9e2154a120ea3d", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "bud", + "type": "github" + } + }, "ci-agent": { "inputs": { "flake-compat": "flake-compat", @@ -35,11 +54,11 @@ "pre-commit-hooks-nix": "pre-commit-hooks-nix" }, "locked": { - "lastModified": 1619088868, - "narHash": "sha256-l9db+HpNIkY41MonGE8z4pbkjBa5BdzJTG5AxV7V7Lw=", + "lastModified": 1624885917, + "narHash": "sha256-CaAEhMKzuTyN9krTLZ1jWW3C5HzvKRZY/doVOezZZx0=", "owner": "hercules-ci", "repo": "hercules-ci-agent", - "rev": "08f953a263518a3af0ca28cd887020ff3465bdf5", + "rev": "5eba6597af97e358542c6f968f6ef680ffd2a401", "type": "github" }, "original": { @@ -55,11 +74,11 @@ ] }, "locked": { - "lastModified": 1613595894, - "narHash": "sha256-MOk/7rCAUB5Lf4GL+HimvyAAZXYEw8gWsq5nW4PPQQA=", + "lastModified": 1622060422, + "narHash": "sha256-hPVlvrAyf6zL7tTx0lpK+tMxEfZeMiIZ/A2xaJ41WOY=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "5c3146b75d5d478f0693d0ea6c83f1da8382ff56", + "rev": "007d700e644ac588ad6668e6439950a5b6e2ff64", "type": "github" }, "original": { @@ -73,20 +92,16 @@ "flake-compat": "flake-compat_2", "naersk": "naersk", "nixpkgs": [ - "digga", - "nixpkgs" + "nixos" ], - "utils": [ - "digga", - "utils" - ] + "utils": "utils" }, "locked": { - "lastModified": 1623011836, - "narHash": "sha256-02M4P3eqUdV+ouZb8n1KDR1CXeZQm17cKpjKZKi0c10=", + "lastModified": 1625248509, + "narHash": "sha256-G721I9brAMCkZKXIFsgOQ1JCZ9Rj9DM7QSm0pvpQldc=", "owner": "serokell", "repo": "deploy-rs", - "rev": "70d71b3027b1793b780f1e2435bdbbe1b0cb9ac6", + "rev": "364ef202e400e4c941e18833ca38fa848ac5a148", "type": "github" }, "original": { @@ -97,11 +112,26 @@ }, "devshell": { "locked": { - "lastModified": 1622013274, - "narHash": "sha256-mK/Lv0lCbl07dI5s7tR/7nb79HunKnJik3KyR6yeI2k=", + "lastModified": 1625086391, + "narHash": "sha256-IpNPv1v8s4L3CoxhwcgZIitGpcrnNgnj09X7TA0QV3k=", "owner": "numtide", "repo": "devshell", - "rev": "e7faf69e6bf8546517cc936c7f6d31c7eb3abcb2", + "rev": "4b5ac7cf7d9a1cc60b965bb51b59922f2210cbc7", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "devshell_2": { + "locked": { + "lastModified": 1625086391, + "narHash": "sha256-IpNPv1v8s4L3CoxhwcgZIitGpcrnNgnj09X7TA0QV3k=", + "owner": "numtide", + "repo": "devshell", + "rev": "4b5ac7cf7d9a1cc60b965bb51b59922f2210cbc7", "type": "github" }, "original": { @@ -112,19 +142,21 @@ }, "digga": { "inputs": { - "deploy": "deploy", - "devshell": "devshell", + "deploy": [ + "deploy" + ], + "devshell": "devshell_2", "nixlib": "nixlib", "nixos-generators": "nixos-generators", - "nixpkgs": "nixpkgs", - "utils": "utils" + "nixpkgs": "nixpkgs_2", + "utils": "utils_2" }, "locked": { - "lastModified": 1624576193, - "narHash": "sha256-EPemiDnTx0V622bMtGpcgclSExljWK3+qXZMiZVvvEc=", + "lastModified": 1625701039, + "narHash": "sha256-4IqBKop1XmS2z7Y5nsf8Af4wSCYJfy4kXUt/zgPwhSU=", "owner": "divnix", "repo": "digga", - "rev": "241896d3942fe3f818ce9a153955dbcadd9f00fc", + "rev": "05ee310fdfa81b1a8ecc7a8075d62ed702d72430", "type": "github" }, "original": { @@ -219,11 +251,11 @@ ] }, "locked": { - "lastModified": 1616724076, - "narHash": "sha256-SwbPXLjN2sLy4NL/GhodiJrdkIVZwGGTGiCN3JxH1cU=", + "lastModified": 1625694413, + "narHash": "sha256-goRLk1I/OMclS9i17g932wyHyjiKI+htbuFIWIkzTbw=", "owner": "nix-community", "repo": "home-manager", - "rev": "fedfd430f96695997b3eaf8d7e82ca79406afa23", + "rev": "06ee8ec8dfc4554c374052cd7b7083765748af99", "type": "github" }, "original": { @@ -234,11 +266,11 @@ }, "latest": { "locked": { - "lastModified": 1619400530, - "narHash": "sha256-7ZO7B+b9i1wFbHw62EFT+iwuBBpXeA/fcHlR63Z4J0w=", + "lastModified": 1625702968, + "narHash": "sha256-MadGtaIuPvTh9JLZULkQerZae8TFBczg8c12AijZc+s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e8dc8adab655eb27957859c62bef11484b53f639", + "rev": "46c8ac79dbc9a4bcb7db4592d4708fb009284e13", "type": "github" }, "original": { @@ -249,7 +281,7 @@ "naersk": { "inputs": { "nixpkgs": [ - "digga", + "deploy", "nixpkgs" ] }, @@ -285,11 +317,11 @@ }, "nixos": { "locked": { - "lastModified": 1624575719, - "narHash": "sha256-MVQJ2ltjqrxdB8zHj2s05ujgX6VbCDZ/+K8j2xh59Hk=", + "lastModified": 1625702791, + "narHash": "sha256-3aiSEfGaBwi1mumzfSgwiO3kxGD+IHe9HAv3S227KI8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "001f78ff0044adf3ca972643eaf3fc5cbc8f634c", + "rev": "977b522d3101ad847fd51d695b817fe2cf8efaf6", "type": "github" }, "original": { @@ -321,11 +353,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1615652054, - "narHash": "sha256-jqXKU8Ovpi7MmPRqGf2FB3QOPcZtGwO2MFc0AYiOPjg=", + "lastModified": 1625333638, + "narHash": "sha256-M6J9RN60XJyv6nUfDFCwnz5aVjhe8+GJnV8Q9VpdQQQ=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "31f61b90ddb9257b94888ee17ccf96236e180c76", + "rev": "41775780a0b6b32b3d32dcc32bb9bc6df809062d", "type": "github" }, "original": { @@ -335,6 +367,20 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1624831744, + "narHash": "sha256-gGSxxnWnXRALLKfStsG3C4X+XUzAkHlKx02xHzkGZio=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dbf5cd2d90cbf8b281c1938632b431d1e61d3249", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1624148921, "narHash": "sha256-FAhKTXZV67C36hK5lPvZfsFt+QY1QSHYQXwGXqpOChs=", @@ -351,11 +397,11 @@ }, "nur": { "locked": { - "lastModified": 1615921934, - "narHash": "sha256-nURGM869KKA1+c1SHHsXKYcPXhHIuxWBjNXjJ90OzRQ=", + "lastModified": 1625695235, + "narHash": "sha256-xJ8jHWkX7IyAImQ8MpWTbUonski38R4bWDNs8pJJzpk=", "owner": "nix-community", "repo": "NUR", - "rev": "faf862e8cf009edfa38ecc61188f7a6ace293552", + "rev": "9e2254aee0cce4b05f27447e51c001ab66aed7e0", "type": "github" }, "original": { @@ -372,11 +418,11 @@ ] }, "locked": { - "lastModified": 1624534673, - "narHash": "sha256-7HWt8Xh4aIFfGKAFQus5euhYxcWLe6kXz1DsGuV0WbU=", + "lastModified": 1624890984, + "narHash": "sha256-RMQtTm4OoEc8BHWk4/Yfu1y4uHlG4HCP+DeC0J0zGqQ=", "owner": "berberman", "repo": "nvfetcher", - "rev": "a8514f53c7999d23b48d2f42de63660bc3d7850f", + "rev": "d3efa8c58057dbcc1565dca3105d31d9f25fd5ca", "type": "github" }, "original": { @@ -388,11 +434,11 @@ "pre-commit-hooks-nix": { "flake": false, "locked": { - "lastModified": 1617783930, - "narHash": "sha256-SigoU2LWM1fMggqfM9H8XEIvjOjBVQ/wj/zrn02J28c=", + "lastModified": 1622650193, + "narHash": "sha256-qSzUpJDv04ajS9FXoCq6NjVF3qOt9IiGIiGh0P8amyw=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "2d169bb1b23f3b71a894a66ea81f45c788943248", + "rev": "0398f0649e0a741660ac5e8216760bae5cc78579", "type": "github" }, "original": { @@ -404,8 +450,10 @@ "root": { "inputs": { "agenix": "agenix", + "bud": "bud", "ci-agent": "ci-agent", "darwin": "darwin", + "deploy": "deploy", "digga": "digga", "home": "home", "latest": "latest", @@ -416,6 +464,21 @@ } }, "utils": { + "locked": { + "lastModified": 1622445595, + "narHash": "sha256-m+JRe6Wc5OZ/mKw2bB3+Tl0ZbtyxxxfnAWln8Q5qs+Y=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7d706970d94bc5559077eb1a6600afddcd25a7c8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { "inputs": { "flake-utils": "flake-utils" }, diff --git a/flake.nix b/flake.nix index fd21f71..d409047 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,11 @@ digga = { url = "github:divnix/digga/develop"; inputs.nipxkgs.follows = "latest"; + inputs.deploy.follows = "deploy"; }; + bud.url = "github:divnix/bud"; # no need to follow nixpkgs: it never materialises + deploy.url = "github:serokell/deploy-rs"; + deploy.inputs.nixpkgs.follows = "nixos"; ci-agent = { url = "github:hercules-ci/hercules-ci-agent"; @@ -31,6 +35,7 @@ outputs = { self , digga + , bud , nixos , ci-agent , home @@ -38,8 +43,12 @@ , nur , agenix , nvfetcher + , deploy , ... } @ inputs: + let + bud' = bud self; # rebind to access self.budModules + in digga.lib.mkFlake { inherit self inputs; @@ -52,6 +61,7 @@ nur.overlay agenix.overlay nvfetcher.overlay + deploy.overlay ./pkgs/default.nix ]; }; @@ -79,6 +89,7 @@ ci-agent.nixosModules.agent-profile home.nixosModules.home-manager agenix.nixosModules.age + (bud.nixosModules.bud bud') ]; }; @@ -108,25 +119,20 @@ }; }; - devshell.externalModules = { pkgs, ... }: { - commands = [ - { package = pkgs.agenix; category = "secrets"; } - { - 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/"; - } - ]; - }; + devshell.modules = [ (import ./shell bud') ]; homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; - defaultTemplate = self.templates.flk; - templates.flk.path = ./.; - templates.flk.description = "flk template"; + defaultTemplate = self.templates.bud; + templates.bud.path = ./.; + templates.bud.description = "bud template"; } + // + { + budModules = { devos = import ./pkgs/bud; }; + } ; } diff --git a/pkgs/bud/default.nix b/pkgs/bud/default.nix new file mode 100644 index 0000000..f96e173 --- /dev/null +++ b/pkgs/bud/default.nix @@ -0,0 +1,10 @@ +{ pkgs, lib, budUtils, ... }: { + bud.cmds = with pkgs; { + get = { + writer = budUtils.writeBashWithPaths [ nixUnstable git coreutils ]; + synopsis = "get (core|community) [DEST]"; + help = "Copy the desired template to DEST"; + script = ./get.bash; + }; + }; +} diff --git a/pkgs/bud/get.bash b/pkgs/bud/get.bash new file mode 100644 index 0000000..15c834a --- /dev/null +++ b/pkgs/bud/get.bash @@ -0,0 +1,6 @@ +if [[ "$1" == "core" || "$1" == "community" ]]; then + nix flake new -t "github:divnix/devos/$1" "${2:-devos}" +else + echo "bud get (core|community) [DEST]" + exit 1 +fi diff --git a/shell/default.nix b/shell/default.nix new file mode 100644 index 0000000..8b67e1d --- /dev/null +++ b/shell/default.nix @@ -0,0 +1,62 @@ +bud: +{ 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 (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/hooks/default.nix b/shell/hooks/default.nix new file mode 100644 index 0000000..10aa082 --- /dev/null +++ b/shell/hooks/default.nix @@ -0,0 +1,4 @@ +{ + enable = true; + pre-commit.text = builtins.readFile ./pre-commit.sh; +} diff --git a/shell/hooks/pre-commit.sh b/shell/hooks/pre-commit.sh new file mode 100755 index 0000000..985d3b4 --- /dev/null +++ b/shell/hooks/pre-commit.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(${git}/bin/git hash-object -t tree /dev/null) +fi + +diff="git diff-index --name-only --cached $against --diff-filter d" + +nix_files=($($diff -- '*.nix')) +all_files=($($diff)) + +# Format staged nix files. +if [[ -n "${nix_files[@]}" ]]; then + nixpkgs-fmt "${nix_files[@]}" \ + && git add "${nix_files[@]}" +fi + +# check editorconfig +editorconfig-checker -- "${all_files[@]}" +if [[ $? != '0' ]]; then + printf "%b\n" \ + "\nCode is not aligned with .editorconfig" \ + "Review the output and commit your fixes" >&2 + exit 1 +fi From bf59976063db3bdabea6d6e988658c986f7cee13 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Wed, 7 Jul 2021 17:11:59 -0500 Subject: [PATCH 10/37] work-around for https://github.com/NixOS/nix/pull/4641 --- flake.lock | 3 +++ flake.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/flake.lock b/flake.lock index 8344bfb..4e996f7 100644 --- a/flake.lock +++ b/flake.lock @@ -459,6 +459,9 @@ "latest": "latest", "nixos": "nixos", "nixos-hardware": "nixos-hardware", + "nixpkgs": [ + "nixos" + ], "nur": "nur", "nvfetcher": "nvfetcher" } diff --git a/flake.nix b/flake.nix index d409047..4de566b 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,9 @@ deploy.url = "github:serokell/deploy-rs"; deploy.inputs.nixpkgs.follows = "nixos"; + # remove after https://github.com/NixOS/nix/pull/4641 + nixpkgs.follows = "nixos"; + ci-agent = { url = "github:hercules-ci/hercules-ci-agent"; inputs = { nix-darwin.follows = "darwin"; nixos-20_09.follows = "nixos"; nixos-unstable.follows = "latest"; }; From fe73d2a0835228d18f83f65d064245c6dcd78727 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 9 Jul 2021 11:46:01 -0500 Subject: [PATCH 11/37] fix: hm pin to corresponding nixos version --- flake.lock | 7 ++++--- flake.nix | 2 +- users/profiles/direnv/default.nix | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 4e996f7..6833ddc 100644 --- a/flake.lock +++ b/flake.lock @@ -251,15 +251,16 @@ ] }, "locked": { - "lastModified": 1625694413, - "narHash": "sha256-goRLk1I/OMclS9i17g932wyHyjiKI+htbuFIWIkzTbw=", + "lastModified": 1624228557, + "narHash": "sha256-wwOqe73BsrXfRv1PhyXQFNC8iTET50KvE/HitdkRgxs=", "owner": "nix-community", "repo": "home-manager", - "rev": "06ee8ec8dfc4554c374052cd7b7083765748af99", + "rev": "35a24648d155843a4d162de98c17b1afd5db51e4", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-21.05", "repo": "home-manager", "type": "github" } diff --git a/flake.nix b/flake.nix index 4de566b..0727c3b 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,7 @@ }; darwin.url = "github:LnL7/nix-darwin"; darwin.inputs.nixpkgs.follows = "latest"; - home.url = "github:nix-community/home-manager"; + home.url = "github:nix-community/home-manager/release-21.05"; home.inputs.nixpkgs.follows = "nixos"; # naersk.url = "github:nmattia/naersk"; # naersk.inputs.nixpkgs.follows = "latest"; diff --git a/users/profiles/direnv/default.nix b/users/profiles/direnv/default.nix index 173a9c5..2b51c9d 100644 --- a/users/profiles/direnv/default.nix +++ b/users/profiles/direnv/default.nix @@ -1,6 +1,6 @@ { programs.direnv = { enable = true; - enableNixDirenvIntegration = true; + nix-direnv.enable = true; }; } From 6ebdf3adb422c79675d2b919025c7f1367a5a665 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 15 Jul 2021 17:15:18 -0500 Subject: [PATCH 12/37] imp: reduce flake inputs footprint and increase conciseness --- flake.lock | 273 +++++++++++++++++++++++------------------------------ flake.nix | 54 +++++++---- 2 files changed, 155 insertions(+), 172 deletions(-) diff --git a/flake.lock b/flake.lock index 6833ddc..a2d429b 100644 --- a/flake.lock +++ b/flake.lock @@ -20,10 +20,30 @@ "type": "github" } }, + "blank": { + "locked": { + "lastModified": 1625557891, + "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", + "owner": "divnix", + "repo": "blank", + "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "blank", + "type": "github" + } + }, "bud": { "inputs": { - "devshell": "devshell", - "nixpkgs": "nixpkgs" + "devshell": [ + "digga", + "devshell" + ], + "nixpkgs": [ + "nixos" + ] }, "locked": { "lastModified": 1625703505, @@ -41,7 +61,11 @@ }, "ci-agent": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": [ + "digga", + "deploy", + "flake-compat" + ], "nix-darwin": [ "darwin" ], @@ -89,19 +113,23 @@ }, "deploy": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat", "naersk": "naersk", "nixpkgs": [ - "nixos" + "digga", + "nixpkgs" ], - "utils": "utils" + "utils": [ + "digga", + "flake-utils" + ] }, "locked": { - "lastModified": 1625248509, - "narHash": "sha256-G721I9brAMCkZKXIFsgOQ1JCZ9Rj9DM7QSm0pvpQldc=", + "lastModified": 1625729093, + "narHash": "sha256-hpo8T7mlVEpHpZIYqhxqt5i/XY8eu4p66MrAg/MCuVY=", "owner": "serokell", "repo": "deploy-rs", - "rev": "364ef202e400e4c941e18833ca38fa848ac5a148", + "rev": "587cbcfe8d3ea05c5bb153764d3617012ef28c86", "type": "github" }, "original": { @@ -125,38 +153,27 @@ "type": "github" } }, - "devshell_2": { - "locked": { - "lastModified": 1625086391, - "narHash": "sha256-IpNPv1v8s4L3CoxhwcgZIitGpcrnNgnj09X7TA0QV3k=", - "owner": "numtide", - "repo": "devshell", - "rev": "4b5ac7cf7d9a1cc60b965bb51b59922f2210cbc7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, "digga": { "inputs": { - "deploy": [ - "deploy" + "blank": "blank", + "deploy": "deploy", + "devshell": "devshell", + "flake-utils": "flake-utils", + "nixlib": [ + "nixos" ], - "devshell": "devshell_2", - "nixlib": "nixlib", "nixos-generators": "nixos-generators", - "nixpkgs": "nixpkgs_2", - "utils": "utils_2" + "nixpkgs": [ + "nixos" + ], + "utils": "utils" }, "locked": { - "lastModified": 1625701039, - "narHash": "sha256-4IqBKop1XmS2z7Y5nsf8Af4wSCYJfy4kXUt/zgPwhSU=", + "lastModified": 1626394163, + "narHash": "sha256-DFMtox9SJBx9kHkn9GhrUkQV3oGovZ/gYRIUwtHJGVk=", "owner": "divnix", "repo": "digga", - "rev": "05ee310fdfa81b1a8ecc7a8075d62ed702d72430", + "rev": "b17d29d897492324176ff616adaf54da2db1e352", "type": "github" }, "original": { @@ -182,60 +199,13 @@ "type": "github" } }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "locked": { - "lastModified": 1623660459, - "narHash": "sha256-OTmOsh43po7r5F9s9H6lVCBQ2b0FikWbmiwLbMAGRdw=", + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", "owner": "numtide", "repo": "flake-utils", - "rev": "98c8d36b1828009b20f12544214683c7489935a1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1620759905, - "narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", "type": "github" }, "original": { @@ -282,6 +252,7 @@ "naersk": { "inputs": { "nixpkgs": [ + "digga", "deploy", "nixpkgs" ] @@ -301,28 +272,33 @@ "type": "github" } }, - "nixlib": { + "naersk_2": { + "inputs": { + "nixpkgs": [ + "latest" + ] + }, "locked": { - "lastModified": 1620519687, - "narHash": "sha256-+6Dd72b2CASuXm2W7KRxZIE7AOy/dj4mU28vaF+zxcs=", - "owner": "divnix", - "repo": "nixpkgs.lib", - "rev": "c7b6169809c5f74dd0c34f3d69e9d12ba4d448de", + "lastModified": 1623927034, + "narHash": "sha256-sGxlmfp5eXL5sAMNqHSb04Zq6gPl+JeltIZ226OYN0w=", + "owner": "nmattia", + "repo": "naersk", + "rev": "e09c320446c5c2516d430803f7b19f5833781337", "type": "github" }, "original": { - "owner": "divnix", - "repo": "nixpkgs.lib", + "owner": "nmattia", + "repo": "naersk", "type": "github" } }, "nixos": { "locked": { - "lastModified": 1625702791, - "narHash": "sha256-3aiSEfGaBwi1mumzfSgwiO3kxGD+IHe9HAv3S227KI8=", + "lastModified": 1626358428, + "narHash": "sha256-mGXU+tE18/oV2i7+7udpFi0RofrFfjmirMSQan03UGc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "977b522d3101ad847fd51d695b817fe2cf8efaf6", + "rev": "b106a26a4d75dabd51189fd9f4e9c7b96677429c", "type": "github" }, "original": { @@ -333,17 +309,21 @@ }, "nixos-generators": { "inputs": { + "nixlib": [ + "digga", + "nixlib" + ], "nixpkgs": [ "digga", - "nixpkgs" + "blank" ] }, "locked": { - "lastModified": 1624117213, - "narHash": "sha256-hAoBANafVdM/+8Z6PrlPEKPN6LrdkM4qg2Q/ji0XUns=", + "lastModified": 1624973746, + "narHash": "sha256-11JbJRduNwyf556gndGErR5/12ceyHOHBfEuha5Vws4=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "c64d3c2153274a6ab355e57f5eedfe6f85073d24", + "rev": "022ef440af8dc237ab1f59fa363cb1e25783ec3e", "type": "github" }, "original": { @@ -367,42 +347,13 @@ "type": "github" } }, - "nixpkgs": { - "locked": { - "lastModified": 1624831744, - "narHash": "sha256-gGSxxnWnXRALLKfStsG3C4X+XUzAkHlKx02xHzkGZio=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "dbf5cd2d90cbf8b281c1938632b431d1e61d3249", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1624148921, - "narHash": "sha256-FAhKTXZV67C36hK5lPvZfsFt+QY1QSHYQXwGXqpOChs=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "f2122ea5815648effdd97157c7bf4e9a1a6dbb34", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "locked": { - "lastModified": 1625695235, - "narHash": "sha256-xJ8jHWkX7IyAImQ8MpWTbUonski38R4bWDNs8pJJzpk=", + "lastModified": 1626378135, + "narHash": "sha256-koC6DBYmLCrgXA+AMHVaODf1uHYPmvcFygHfy3eg6vI=", "owner": "nix-community", "repo": "NUR", - "rev": "9e2254aee0cce4b05f27447e51c001ab66aed7e0", + "rev": "00c2ec8f0bbdf0cfb2135bde55fbae5d6b64aa6d", "type": "github" }, "original": { @@ -412,8 +363,16 @@ }, "nvfetcher": { "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_2", + "flake-compat": [ + "digga", + "deploy", + "flake-compat" + ], + "flake-utils": [ + "digga", + "utils", + "flake-utils" + ], "nixpkgs": [ "latest" ] @@ -451,47 +410,55 @@ "root": { "inputs": { "agenix": "agenix", + "blank": [ + "digga", + "blank" + ], "bud": "bud", "ci-agent": "ci-agent", "darwin": "darwin", - "deploy": "deploy", + "deploy": [ + "digga", + "deploy" + ], "digga": "digga", + "flake-utils": [ + "digga", + "flake-utils" + ], "home": "home", "latest": "latest", + "naersk": "naersk_2", + "nixlib": [ + "digga", + "nixlib" + ], "nixos": "nixos", "nixos-hardware": "nixos-hardware", "nixpkgs": [ "nixos" ], "nur": "nur", - "nvfetcher": "nvfetcher" + "nvfetcher": "nvfetcher", + "utils": [ + "digga", + "utils" + ] } }, "utils": { - "locked": { - "lastModified": 1622445595, - "narHash": "sha256-m+JRe6Wc5OZ/mKw2bB3+Tl0ZbtyxxxfnAWln8Q5qs+Y=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "7d706970d94bc5559077eb1a6600afddcd25a7c8", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "utils_2": { "inputs": { - "flake-utils": "flake-utils" + "flake-utils": [ + "digga", + "flake-utils" + ] }, "locked": { - "lastModified": 1624128793, - "narHash": "sha256-yZYvpT6i6iRK0x1a8k/LCoS7JGLVk6Yi1eqfhatnDLk=", + "lastModified": 1624737817, + "narHash": "sha256-styqXE6Xli61dnDst0vB0Kb1tPt/aCuxOhTK0uGDCng=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "785e6f13b8c6131d1eee625a713e8475b2b0512b", + "rev": "6bf0d314fc5623d5d4b5240ee0bf0a3a270d717c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0727c3b..90037bd 100644 --- a/flake.nix +++ b/flake.nix @@ -5,34 +5,50 @@ { nixos.url = "nixpkgs/release-21.05"; latest.url = "nixpkgs"; - digga = { - url = "github:divnix/digga/develop"; - inputs.nipxkgs.follows = "latest"; - inputs.deploy.follows = "deploy"; - }; - bud.url = "github:divnix/bud"; # no need to follow nixpkgs: it never materialises - deploy.url = "github:serokell/deploy-rs"; - deploy.inputs.nixpkgs.follows = "nixos"; - # remove after https://github.com/NixOS/nix/pull/4641 - nixpkgs.follows = "nixos"; + digga.url = "github:divnix/digga/develop"; + digga.inputs.nixpkgs.follows = "nixos"; + digga.inputs.nixlib.follows = "nixos"; + + bud.url = "github:divnix/bud"; + bud.inputs.nixpkgs.follows = "nixos"; + bud.inputs.devshell.follows = "digga/devshell"; - ci-agent = { - url = "github:hercules-ci/hercules-ci-agent"; - inputs = { nix-darwin.follows = "darwin"; nixos-20_09.follows = "nixos"; nixos-unstable.follows = "latest"; }; - }; - darwin.url = "github:LnL7/nix-darwin"; - darwin.inputs.nixpkgs.follows = "latest"; home.url = "github:nix-community/home-manager/release-21.05"; home.inputs.nixpkgs.follows = "nixos"; - # naersk.url = "github:nmattia/naersk"; - # naersk.inputs.nixpkgs.follows = "latest"; + + darwin.url = "github:LnL7/nix-darwin"; + darwin.inputs.nixpkgs.follows = "latest"; + + deploy.follows = "digga/deploy"; + agenix.url = "github:ryantm/agenix"; agenix.inputs.nixpkgs.follows = "latest"; - nixos-hardware.url = "github:nixos/nixos-hardware"; 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"; + + 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"; + + nixos-hardware.url = "github:nixos/nixos-hardware"; + + # start ANTI CORRUPTION LAYER + # remove after https://github.com/NixOS/nix/pull/4641 + nixpkgs.follows = "nixos"; + nixlib.follows = "digga/nixlib"; + blank.follows = "digga/blank"; + utils.follows = "digga/utils"; + flake-utils.follows = "digga/flake-utils"; + # end ANTI CORRUPTION LAYER }; outputs = From 000329f6a75529dda55b5f432827aadd96bf5029 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 15 Jul 2021 22:19:38 -0500 Subject: [PATCH 13/37] fix: bump digga with infinite recursion hotfix --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index a2d429b..092f2d3 100644 --- a/flake.lock +++ b/flake.lock @@ -169,11 +169,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1626394163, - "narHash": "sha256-DFMtox9SJBx9kHkn9GhrUkQV3oGovZ/gYRIUwtHJGVk=", + "lastModified": 1626404753, + "narHash": "sha256-Ag/e7tecRg19FS+B5kKXu3KTwiNlM/C8saofKvYPC8A=", "owner": "divnix", "repo": "digga", - "rev": "b17d29d897492324176ff616adaf54da2db1e352", + "rev": "ed0dc961c121db31ac05d19937e1482ce55ff599", "type": "github" }, "original": { From 4b9cab40cb1c5d7989c2e3719d743e764128ac2a Mon Sep 17 00:00:00 2001 From: David Arnold Date: Mon, 12 Jul 2021 17:32:13 -0500 Subject: [PATCH 14/37] imp: add portable user definition According to https://github.com/nix-community/home-manager/issues/2161 there might be a better formal distinction between host-spaced and portable arch-spaced hm users in the future. --- flake.lock | 15 +++++++++------ flake.nix | 4 ++++ users/nixos/default.nix | 6 ++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 092f2d3..cc36263 100644 --- a/flake.lock +++ b/flake.lock @@ -159,6 +159,9 @@ "deploy": "deploy", "devshell": "devshell", "flake-utils": "flake-utils", + "home-manager": [ + "home" + ], "nixlib": [ "nixos" ], @@ -169,11 +172,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1626404753, - "narHash": "sha256-Ag/e7tecRg19FS+B5kKXu3KTwiNlM/C8saofKvYPC8A=", + "lastModified": 1626451343, + "narHash": "sha256-TXHFFYJhkMknpb1l0nuCfHtOMLNabAKYY5XE2p8HFM0=", "owner": "divnix", "repo": "digga", - "rev": "ed0dc961c121db31ac05d19937e1482ce55ff599", + "rev": "37e5542b03e5da27ff7d2ed801fa118c2b87bf02", "type": "github" }, "original": { @@ -454,11 +457,11 @@ ] }, "locked": { - "lastModified": 1624737817, - "narHash": "sha256-styqXE6Xli61dnDst0vB0Kb1tPt/aCuxOhTK0uGDCng=", + "lastModified": 1626288344, + "narHash": "sha256-TioHDqWJkw37jjx4DVrH6LCzwrUfAqXbWl4rKR91fpA=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "6bf0d314fc5623d5d4b5240ee0bf0a3a270d717c", + "rev": "5c6ee69f6957afc2fe22c094717d6d78516418b5", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 90037bd..cf0193a 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,7 @@ digga.url = "github:divnix/digga/develop"; digga.inputs.nixpkgs.follows = "nixos"; digga.inputs.nixlib.follows = "nixos"; + digga.inputs.home-manager.follows = "home"; bud.url = "github:divnix/bud"; bud.inputs.nixpkgs.follows = "nixos"; @@ -136,6 +137,9 @@ base = [ direnv git ]; }; }; + users = { + nixos = { suites, ... }: { imports = suites.base; }; + }; # digga.lib.importers.rakeLeaves ./users/hm; }; devshell.modules = [ (import ./shell bud') ]; diff --git a/users/nixos/default.nix b/users/nixos/default.nix index 700467b..5c037fe 100644 --- a/users/nixos/default.nix +++ b/users/nixos/default.nix @@ -1,8 +1,6 @@ -{ ... }: +{ hmUsers, ... }: { - home-manager.users.nixos = { suites, ... }: { - imports = suites.base; - }; + home-manager.users = { inherit (hmUsers) nixos; }; users.users.nixos = { uid = 1000; From b95189d754a0afd3f8d119dda036a483131283de Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 16 Jul 2021 12:45:48 -0500 Subject: [PATCH 15/37] rm: community the commmunity branch was fallen too far behind and there where no contributions to it, anyways. We will start linking usage examples out in the wild, instead. --- README.md | 17 +++-------------- doc/CONTRIBUTING.md | 6 ------ doc/concepts/profiles.md | 3 --- doc/concepts/suites.md | 2 +- doc/flk/get.md | 6 +++--- doc/start/index.md | 2 -- pkgs/bud/default.nix | 2 +- pkgs/bud/get.bash | 7 +------ 8 files changed, 9 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 78c30ea..01b92e6 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,6 @@ Also, have a look at [_flake.nix_][toc]. If anything is not immediately discoverable from there through [`digga`][digga] library's [`mkFlake`][mk-flake], please file a bug report. -## In the Wild -The author maintains his own branch, so you can take inspiration, direction, or -make critical comments about the [code][please]. 😜 - ## Motivation NixOS provides an amazing abstraction to manage our environment, but that new power can sometimes bring feelings of overwhelm and confusion. Having a turing @@ -46,16 +42,9 @@ and its satellite projects, from which best practices can evolve. ___The future is declarative! 🎉___ -## Community Profiles -There are two branches from which to choose: [core][core] and -[community][community]. The community branch builds on core and includes -several ready-made profiles for discretionary use. - -Every package and NixOS profile declared in community is uploaded to -[cachix](./integrations/cachix.md), so everything provided is available -without building anything. This is especially useful for the packages that are -[overridden](./concepts/overrides.md) from master, as without the cache, -rebuilds are quite frequent. +## Examples in the Wild +The author maintains his own branch, so you can take inspiration, direction, or +make critical comments about the [code][please]. 😜 ## Shoulders This work does not reinvent the wheel. It stands on the [shoulders of the diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index f721069..4766cdf 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -10,12 +10,6 @@ rendered on every change, so the docs should always be up to date. We also use [BORS](https://bors.tech) to ensure that all pull requests pass the test suite once at least one review is completed. -## Community PRs -While much of your work in this template may be idiosyncratic in nature. Anything -that might be generally useful to the broader NixOS community can be synced to -the `community` branch to provide a host of useful NixOS configurations available -"out of the box". - # Style If you wish to contribute please follow these guidelines: diff --git a/doc/concepts/profiles.md b/doc/concepts/profiles.md index b4ff0a1..a5eda3e 100644 --- a/doc/concepts/profiles.md +++ b/doc/concepts/profiles.md @@ -5,9 +5,6 @@ Profiles are a convenient shorthand for the [_definition_][definition] of built into the NixOS module system for a reason: to elegantly provide a clear separation of concerns. -If you need guidance, a community [branch](https://github.com/divnix/devos/tree/community/profiles) -is maintained to help get up to speed on their usage. - ## Creation Profiles are created with the `rakeLeaves` function which recursively collects `.nix` files from within a folder. The recursion stops at folders with a `default.nix` diff --git a/doc/concepts/suites.md b/doc/concepts/suites.md index e120ad6..42a3db8 100644 --- a/doc/concepts/suites.md +++ b/doc/concepts/suites.md @@ -1,6 +1,6 @@ # Suites Suites provide a mechanism for users to easily combine and name collecitons of -profiles. For good examples, check out the suites defined in the community branch. +profiles. `suites` are defined in the `importables` argument in either the `home` or `nixos` namespace. They are a special case of an `importable` which get passed as a special diff --git a/doc/flk/get.md b/doc/flk/get.md index b1f7990..8761f00 100644 --- a/doc/flk/get.md +++ b/doc/flk/get.md @@ -1,10 +1,10 @@ # get The `get` subcommand is useful for getting a bare copy of devos without the -git history. You can pull either the core or community branches. +git history. ## Usage ```sh -flk get BRANCH DEST-DIR +flk get DEST-DIR ``` -If DEST-DIR is ommitted, it defaults to _./flk_. +If DEST-DIR is ommitted, it defaults to _./devos_. diff --git a/doc/start/index.md b/doc/start/index.md index fbfab09..f3f1127 100644 --- a/doc/start/index.md +++ b/doc/start/index.md @@ -25,8 +25,6 @@ version required. In addition, the [binary cache](../integrations/cachix.md) is added for faster deployment. > ##### _Notes:_ -> - You can change `core` to [`community`](../../index.md#community-profiles) -> in the call to `flk get` > - Flakes ignore files that have not been added to git, so be sure to stage new > files before building the system. > - You can choose to simply clone the repo with git if you want to follow diff --git a/pkgs/bud/default.nix b/pkgs/bud/default.nix index f96e173..c486636 100644 --- a/pkgs/bud/default.nix +++ b/pkgs/bud/default.nix @@ -2,7 +2,7 @@ bud.cmds = with pkgs; { get = { writer = budUtils.writeBashWithPaths [ nixUnstable git coreutils ]; - synopsis = "get (core|community) [DEST]"; + synopsis = "get [DEST]"; help = "Copy the desired template to DEST"; script = ./get.bash; }; diff --git a/pkgs/bud/get.bash b/pkgs/bud/get.bash index 15c834a..3b4d9a7 100644 --- a/pkgs/bud/get.bash +++ b/pkgs/bud/get.bash @@ -1,6 +1 @@ -if [[ "$1" == "core" || "$1" == "community" ]]; then - nix flake new -t "github:divnix/devos/$1" "${2:-devos}" -else - echo "bud get (core|community) [DEST]" - exit 1 -fi +nix flake new -t "github:divnix/devos/core" "${2:-devos}" From 26a2423312fccdbc4899506f91e2c084e7899aec Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 9 Jul 2021 10:17:05 -0500 Subject: [PATCH 16/37] ref: make hm common module explicit --- modules/customBuilds.nix | 15 --------------- modules/hm-system-defaults.nix | 11 +++++++++++ 2 files changed, 11 insertions(+), 15 deletions(-) create mode 100644 modules/hm-system-defaults.nix diff --git a/modules/customBuilds.nix b/modules/customBuilds.nix index cbaefe3..d7757c6 100644 --- a/modules/customBuilds.nix +++ b/modules/customBuilds.nix @@ -7,20 +7,5 @@ fullHostConfig = config; }) ).config.system.build.isoImage; - - homes = (config.lib.digga.mkBuild - ({ config, ... }: { - home-manager.useUserPackages = lib.mkForce false; - home-manager.sharedModules = [ - { - home.sessionVariables = { - inherit (config.environment.sessionVariables) NIX_PATH; - }; - xdg.configFile."nix/registry.json".text = - config.environment.etc."nix/registry.json".text; - } - ]; - }) - ).config.home-manager.users; }; } diff --git a/modules/hm-system-defaults.nix b/modules/hm-system-defaults.nix new file mode 100644 index 0000000..7b442a6 --- /dev/null +++ b/modules/hm-system-defaults.nix @@ -0,0 +1,11 @@ +{ config, ... }: { + home-manager.sharedModules = [ + { + home.sessionVariables = { + inherit (config.environment.sessionVariables) NIX_PATH; + }; + xdg.configFile."nix/registry.json".text = + config.environment.etc."nix/registry.json".text; + } + ]; +} From bd0ef12149c4b0c19e84670e40b036bfbcbdaf45 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 16 Jul 2021 12:21:57 -0500 Subject: [PATCH 17/37] bump: pull in latest bud fixes & additions - portble home profiles - missing coreutils --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index cc36263..74b2ded 100644 --- a/flake.lock +++ b/flake.lock @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1625703505, - "narHash": "sha256-PNtHOR5wp3R/cysCHTIFcxCHHuisljbrS6iNyP/Ivfk=", + "lastModified": 1626456025, + "narHash": "sha256-TrKfxVir+TilnqSNYokxJKx2ugEem7Khv4YmSwqj9JQ=", "owner": "divnix", "repo": "bud", - "rev": "baefc56e5819375736b51e93df9e2154a120ea3d", + "rev": "59c10c3879b11371944ab664462fe2e9366cfb44", "type": "github" }, "original": { @@ -172,11 +172,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1626451343, - "narHash": "sha256-TXHFFYJhkMknpb1l0nuCfHtOMLNabAKYY5XE2p8HFM0=", + "lastModified": 1626458006, + "narHash": "sha256-mncfFzXwOLgLW8DkloEuyzSySsCtcKnn6Xe1LImVXHQ=", "owner": "divnix", "repo": "digga", - "rev": "37e5542b03e5da27ff7d2ed801fa118c2b87bf02", + "rev": "73d6ed3ba3d1430c1db3ead770ffd991f7d3c97b", "type": "github" }, "original": { From b05f95065e52f8451625f5e08a212f6bf33f4436 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 16 Jul 2021 13:18:10 -0500 Subject: [PATCH 18/37] bump: point to tip of squashed digga develop branch --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 74b2ded..15c1633 100644 --- a/flake.lock +++ b/flake.lock @@ -172,11 +172,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1626458006, - "narHash": "sha256-mncfFzXwOLgLW8DkloEuyzSySsCtcKnn6Xe1LImVXHQ=", + "lastModified": 1626459181, + "narHash": "sha256-68H1YDk5v7FNXCV/pRkunA3PI4V8GiXrcHYnnvQOHQM=", "owner": "divnix", "repo": "digga", - "rev": "73d6ed3ba3d1430c1db3ead770ffd991f7d3c97b", + "rev": "ab4f3236cfb0264fc844d983be518eb37fc97fc0", "type": "github" }, "original": { From 8ae22c63dc9eb0956ec26ca90dd7bef495be4404 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 16 Jul 2021 15:27:17 -0500 Subject: [PATCH 19/37] fix: move legacy nix path definitions back to devos --- modules/nix-path.nix | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 modules/nix-path.nix diff --git a/modules/nix-path.nix b/modules/nix-path.nix new file mode 100644 index 0000000..273f67a --- /dev/null +++ b/modules/nix-path.nix @@ -0,0 +1,7 @@ +{ channel, inputs, ... }: { + nix.nixPath = [ + "nixpkgs=${channel.input}" + "nixos-config=${../lib/compat/nixos}" + "home-manager=${inputs.home}" + ]; +} From aa45592c1735b5016b9cea835f49657eb2b02928 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 16 Jul 2021 15:35:55 -0500 Subject: [PATCH 20/37] imp: add digga's nixConfig and patchedNix --- flake.lock | 6 +++--- flake.nix | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 15c1633..3b84f5b 100644 --- a/flake.lock +++ b/flake.lock @@ -172,11 +172,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1626459181, - "narHash": "sha256-68H1YDk5v7FNXCV/pRkunA3PI4V8GiXrcHYnnvQOHQM=", + "lastModified": 1626470112, + "narHash": "sha256-hC5I3A1HxfGi45avpYBf8zXi1hQkHYWgRgUM4sF9byI=", "owner": "divnix", "repo": "digga", - "rev": "ab4f3236cfb0264fc844d983be518eb37fc97fc0", + "rev": "f25928ed0bf05ab20af5a8231d264ae01b42ab34", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index cf0193a..366fef8 100644 --- a/flake.nix +++ b/flake.nix @@ -78,6 +78,7 @@ nixos = { imports = [ (digga.lib.importers.overlays ./overlays) ]; overlays = [ + digga.overlays.patchedNix nur.overlay agenix.overlay nvfetcher.overlay @@ -106,6 +107,7 @@ imports = [ (digga.lib.importers.modules ./modules) ]; externalModules = [ { lib.our = self.lib; } + digga.nixosModules.nixConfig ci-agent.nixosModules.agent-profile home.nixosModules.home-manager agenix.nixosModules.age From 6c25e77f6fc3e4c0fa0eb009aae48a817b6bac51 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 16 Jul 2021 16:09:26 -0500 Subject: [PATCH 21/37] add flake's nixConfig values that go well with this repo --- flake.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake.nix b/flake.nix index 366fef8..c60f6f4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,10 @@ { description = "A highly structured configuration database."; + nixConfig.extra-experimental-features = "nix-command flakes ca-references"; + nixConfig.extra-substituters = "https://nrdxp.cachix.org https://nix-community.cachix.org"; + nixConfig.extra-trusted-public-keys = "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="; + inputs = { nixos.url = "nixpkgs/release-21.05"; From a088edd77ae40203d31f55dc8478548f07b8c9a0 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 16 Jul 2021 16:01:25 -0500 Subject: [PATCH 22/37] fmt --- flake.nix | 145 ++++++++++++++++--------------- overlays/various-flake-fixes.nix | 8 +- shell/default.nix | 5 +- shell/hooks/default.nix | 2 +- 4 files changed, 82 insertions(+), 78 deletions(-) diff --git a/flake.nix b/flake.nix index c60f6f4..d9f6d0a 100644 --- a/flake.nix +++ b/flake.nix @@ -73,92 +73,93 @@ let bud' = bud self; # rebind to access self.budModules in - digga.lib.mkFlake { - inherit self inputs; + digga.lib.mkFlake + { + inherit self inputs; - channelsConfig = { allowUnfree = true; }; + channelsConfig = { allowUnfree = true; }; + + channels = { + nixos = { + imports = [ (digga.lib.importers.overlays ./overlays) ]; + overlays = [ + digga.overlays.patchedNix + nur.overlay + agenix.overlay + nvfetcher.overlay + deploy.overlay + ./pkgs/default.nix + ]; + }; + latest = { }; + }; + + lib = import ./lib { lib = digga.lib // nixos.lib; }; + + sharedOverlays = [ + (final: prev: { + __dontExport = true; + lib = prev.lib.extend (lfinal: lprev: { + our = self.lib; + }); + }) + ]; - channels = { nixos = { - imports = [ (digga.lib.importers.overlays ./overlays) ]; - overlays = [ - digga.overlays.patchedNix - nur.overlay - agenix.overlay - nvfetcher.overlay - deploy.overlay - ./pkgs/default.nix - ]; - }; - latest = { }; - }; - - lib = import ./lib { lib = digga.lib // nixos.lib; }; - - sharedOverlays = [ - (final: prev: { - __dontExport = true; - lib = prev.lib.extend (lfinal: lprev: { - our = self.lib; - }); - }) - ]; - - nixos = { - hostDefaults = { - system = "x86_64-linux"; - channelName = "nixos"; - imports = [ (digga.lib.importers.modules ./modules) ]; - externalModules = [ - { lib.our = self.lib; } - digga.nixosModules.nixConfig - ci-agent.nixosModules.agent-profile - home.nixosModules.home-manager - agenix.nixosModules.age - (bud.nixosModules.bud bud') - ]; - }; - - imports = [ (digga.lib.importers.hosts ./hosts) ]; - hosts = { - /* set host specific properties here */ - NixOS = { }; - }; - importables = rec { - profiles = digga.lib.importers.rakeLeaves ./profiles // { - users = digga.lib.importers.rakeLeaves ./users; + hostDefaults = { + system = "x86_64-linux"; + channelName = "nixos"; + imports = [ (digga.lib.importers.modules ./modules) ]; + externalModules = [ + { lib.our = self.lib; } + digga.nixosModules.nixConfig + ci-agent.nixosModules.agent-profile + home.nixosModules.home-manager + agenix.nixosModules.age + (bud.nixosModules.bud bud') + ]; }; - suites = with profiles; rec { - base = [ core users.nixos users.root ]; + + imports = [ (digga.lib.importers.hosts ./hosts) ]; + hosts = { + /* set host specific properties here */ + NixOS = { }; + }; + importables = rec { + profiles = digga.lib.importers.rakeLeaves ./profiles // { + users = digga.lib.importers.rakeLeaves ./users; + }; + suites = with profiles; rec { + base = [ core users.nixos users.root ]; + }; }; }; - }; - home = { - imports = [ (digga.lib.importers.modules ./users/modules) ]; - externalModules = [ ]; - importables = rec { - profiles = digga.lib.importers.rakeLeaves ./users/profiles; - suites = with profiles; rec { - base = [ direnv git ]; + home = { + imports = [ (digga.lib.importers.modules ./users/modules) ]; + externalModules = [ ]; + importables = rec { + profiles = digga.lib.importers.rakeLeaves ./users/profiles; + suites = with profiles; rec { + base = [ direnv git ]; + }; }; + users = { + nixos = { suites, ... }: { imports = suites.base; }; + }; # digga.lib.importers.rakeLeaves ./users/hm; }; - users = { - nixos = { suites, ... }: { imports = suites.base; }; - }; # digga.lib.importers.rakeLeaves ./users/hm; - }; - devshell.modules = [ (import ./shell bud') ]; + devshell.modules = [ (import ./shell bud') ]; - homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; + homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; - deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; + deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; - defaultTemplate = self.templates.bud; - templates.bud.path = ./.; - templates.bud.description = "bud template"; + defaultTemplate = self.templates.bud; + templates.bud.path = ./.; + templates.bud.description = "bud template"; - } + } // { budModules = { devos = import ./pkgs/bud; }; diff --git a/overlays/various-flake-fixes.nix b/overlays/various-flake-fixes.nix index 2bb1f70..7dbfc18 100644 --- a/overlays/various-flake-fixes.nix +++ b/overlays/various-flake-fixes.nix @@ -2,8 +2,10 @@ final: prev: { # Since: https://github.com/NixOS/nixpkgs/pull/126137 nix-direnv = if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs - then prev.nix-direnv.override { - enableFlakes = true; - } + then + prev.nix-direnv.override + { + enableFlakes = true; + } else prev.nix-direnv; } diff --git a/shell/default.nix b/shell/default.nix index 8b67e1d..edad83c 100644 --- a/shell/default.nix +++ b/shell/default.nix @@ -9,7 +9,8 @@ let docs = pkgWithCategory "docs"; devos = pkgWithCategory "devos"; -in { +in +{ _file = toString ./.; imports = [ "${extraModulesPath}/git/hooks.nix" ]; @@ -35,7 +36,7 @@ in { ]; commands = with pkgs; [ - (devos (bud {inherit pkgs;}) ) + (devos (bud { inherit pkgs; })) (devos nixUnstable) (devos agenix) { diff --git a/shell/hooks/default.nix b/shell/hooks/default.nix index 10aa082..10f2c9d 100644 --- a/shell/hooks/default.nix +++ b/shell/hooks/default.nix @@ -1,4 +1,4 @@ { enable = true; - pre-commit.text = builtins.readFile ./pre-commit.sh; + pre-commit.text = builtins.readFile ./pre-commit.sh; } From dcb425341d94dbf0172f9f3d3ccd9fb870956612 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 20 Jul 2021 18:33:45 -0500 Subject: [PATCH 23/37] 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 3b84f5b..b855e56 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 d9f6d0a..4ff6ba5 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 24/37] 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 b855e56..6228532 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 4ff6ba5..44c3410 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 d7757c6..0000000 --- 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 25/37] 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 6228532..31b5a93 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 44c3410..c81a7fa 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 26/37] 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 31b5a93..560b208 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 c81a7fa..640dd15 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 edad83c..aef90a5 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 0000000..83101d2 --- /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 27/37] 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 560b208..b8a0f69 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 28/37] 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 b8a0f69..661ccef 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 640dd15..774e572 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 29/37] 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 661ccef..f14be31 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 774e572..dddcb52 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 5bd943f97da8e63c4b8a6c234d71fcdb7b7e7193 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sat, 31 Jul 2021 23:03:19 -0500 Subject: [PATCH 30/37] imp: advise removal of */modules-list.nix on merge conflicts During merge conflicts, these lines should appear in the hunks and give instructions on how to handle them in the face of the implementation of `rakeLeaves` for modules in https://git.io/JB1Wk via `importModules`, that knows how to rake leaves by walking the folder tree on it's own and collecting leaves that are normal nix files or folers who contain a `default.nix` mmicking strongly a "recursive" import-ish syntax. --- modules/module-list.nix | 1 + users/modules/module-list.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/module-list.nix b/modules/module-list.nix index 1e3ec72..254e402 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -1 +1,2 @@ +# ON MERGE CONFLICT: remove this file when updating to the use of digga.lib.importModules in flake.nix: importModules knows how to rakes leaves by walking the file tree on its own. see commit: https://git.io/JB1Wk [ ] diff --git a/users/modules/module-list.nix b/users/modules/module-list.nix index 1e3ec72..254e402 100644 --- a/users/modules/module-list.nix +++ b/users/modules/module-list.nix @@ -1 +1,2 @@ +# ON MERGE CONFLICT: remove this file when updating to the use of digga.lib.importModules in flake.nix: importModules knows how to rakes leaves by walking the file tree on its own. see commit: https://git.io/JB1Wk [ ] From 2fcb3605eed05978fe4df0f5969aca552fa0e140 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 1 Aug 2021 16:38:52 -0500 Subject: [PATCH 31/37] 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 842171c..5faf9c2 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 4766cdf..8574dae 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 4378683..1d7bafe 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 8761f00..12263df 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 0000000..7b98579 --- /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 45d8dcb..0000000 --- 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 8aca6e5..618292c 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 20f371d..12bf562 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 fc522cd..0000000 --- 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 f0bae76..0000000 --- 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 04fc1c4..0000000 --- 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 3ae5250..0000000 --- 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 fa658ef..0000000 --- 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 265e03a..0000000 --- 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 869db72..0000000 --- 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 2bfaa02..4670657 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 dbc7abc..0000000 --- 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 58ce52b..548667f 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 efa515a..8f5c6ab 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 dddcb52..bdd82cd 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 32/37] 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 f14be31..350c67d 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 33/37] bump: digga --- flake.lock | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 350c67d..aa53fc9 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 34/37] 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 aa53fc9..95ef100 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 35/37] 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 e4fc197..c8a8f64 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 36/37] 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 2b51c9d..d345e2d 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 37/37] 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 95ef100..6082f57 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 0d13ac0..71be396 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 83101d2..128b45c 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)