From a088edd77ae40203d31f55dc8478548f07b8c9a0 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 16 Jul 2021 16:01:25 -0500 Subject: [PATCH] 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 c60f6f40..d9f6d0a8 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 2bb1f70d..7dbfc18b 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 8b67e1dc..edad83c0 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 10aa0824..10f2c9d2 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; }