From bb1658aeda0dc9490b0f431991198adc5db630e6 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 27 Jun 2022 17:53:47 -0700 Subject: ref(flake): move `nixosConfigurations` at the bottom This is more readable. Change-Id: Ibdb6cf2f880f8fe3be80f9049bdf18b2d9120b91 Reviewed-on: https://cl.fcuny.net/c/world/+/587 Reviewed-by: Franck Cuny Tested-by: CI --- flake.nix | 91 +++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/flake.nix b/flake.nix index c6b5373..3a1c6e2 100644 --- a/flake.nix +++ b/flake.nix @@ -36,53 +36,58 @@ eachMySystem = eachSystem mySystems; lib = import ./nix { inherit inputs; }; in - { - nixosConfigurations = { - carmel = lib.mkSystem { hostname = "carmel"; }; - aptos = lib.mkSystem { hostname = "aptos"; }; - tahoe = lib.mkSystem { hostname = "tahoe"; }; - }; - } // eachMySystem (system: - let - pkgs = import inputs.nixpkgs { inherit system; }; - home-manager = inputs.home-manager.defaultPackage."${system}"; - ci = import ./ops/ci { inherit pkgs; }; - in - { - packages = pkgs // { - inherit home-manager; + eachMySystem + (system: + let + pkgs = import inputs.nixpkgs { inherit system; }; + home-manager = inputs.home-manager.defaultPackage."${system}"; + ci = import ./ops/ci { inherit pkgs; }; + in + rec + { + packages = pkgs // { + inherit home-manager; - tools = { - dnsupdate = import ./tools/dnsupdate { inherit pkgs; }; - govanity = import ./tools/govanity { inherit pkgs; }; - ipconverter = import ./tools/ipconverter { inherit pkgs; }; - git-blame-stats = import ./tools/git-blame-stats { inherit pkgs; }; - }; + tools = { + dnsupdate = import ./tools/dnsupdate { inherit pkgs; }; + govanity = import ./tools/govanity { inherit pkgs; }; + ipconverter = import ./tools/ipconverter { inherit pkgs; }; + git-blame-stats = import ./tools/git-blame-stats { inherit pkgs; }; + }; - users.fcuny = { - blog = import ./users/fcuny/blog { inherit pkgs; }; - notes = import ./users/fcuny/notes { inherit pkgs; }; - resume = import ./users/fcuny/resume { inherit pkgs; }; + users.fcuny = { + blog = import ./users/fcuny/blog { inherit pkgs; }; + notes = import ./users/fcuny/notes { inherit pkgs; }; + resume = import ./users/fcuny/resume { inherit pkgs; }; + }; }; - }; - # `nix run .#ci.format` formats in current directory! - apps.ci.format = ci.fmt.mkFmtScript self; + # `nix run .#ci.format` formats in current directory! + apps.ci.format = ci.fmt.mkFmtScript self; - # `nix run .#ci.shellcheck` formats in current directory! - apps.ci.shellcheck = ci.shell.mkShellCheckScript self; + # `nix run .#ci.shellcheck` formats in current directory! + apps.ci.shellcheck = ci.shell.mkShellCheckScript self; - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - nixUnstable - nixfmt - nixpkgs-fmt - rnix-lsp - home-manager - git - go - gopls - ]; - }; - }); + devShells = { + default = pkgs.mkShell { + name = "NixOS-config"; + buildInputs = with pkgs; [ + nixUnstable + nixfmt + nixpkgs-fmt + rnix-lsp + home-manager + git + go + gopls + ]; + }; + }; + }) // { + nixosConfigurations = { + carmel = lib.mkSystem { hostname = "carmel"; }; + aptos = lib.mkSystem { hostname = "aptos"; }; + tahoe = lib.mkSystem { hostname = "tahoe"; }; + }; + }; } -- cgit 1.4.1