From 2861935ddd7da67e138ed0952f71b4a4a532615c Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 2 Aug 2024 23:28:04 -0400 Subject: [PATCH] fix(#1): merge 'follows' directives with mkDep --- devices/cluster/default.nix | 6 +++- flake.lock | 69 ++++--------------------------------- flake.nix | 10 ++++-- flake/inputs.nix | 26 ++++++++++++-- 4 files changed, 43 insertions(+), 68 deletions(-) diff --git a/devices/cluster/default.nix b/devices/cluster/default.nix index eaf93235..e9817683 100644 --- a/devices/cluster/default.nix +++ b/devices/cluster/default.nix @@ -1,4 +1,8 @@ -deviceName: {config, self, ...}: let +deviceName: { + config, + self, + ... +}: let inherit (config.vars) mainUser hostName; clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; diff --git a/flake.lock b/flake.lock index 03fa5477..dcc01175 100644 --- a/flake.lock +++ b/flake.lock @@ -619,27 +619,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "nix-on-droid", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709445365, - "narHash": "sha256-DVv6nd9FQBbMWbOmhq0KVqmlc3y3FMSYl49UXmMcO+0=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "4de84265d7ec7634a69ba75028696d74de9a44a7", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "hyprcursor": { "inputs": { "hyprlang": [ @@ -1254,7 +1233,9 @@ }, "nix-on-droid": { "inputs": { - "home-manager": "home-manager_2", + "home-manager": [ + "home-manager" + ], "nix-formatter-pack": "nix-formatter-pack", "nixpkgs": [ "nixpkgs" @@ -1437,22 +1418,6 @@ "type": "github" } }, - "nixpkgs-stable_3": { - "locked": { - "lastModified": 1721524707, - "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "556533a23879fc7e5f98dd2e0b31a6911a213171", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-wayland": { "inputs": { "flake-compat": "flake-compat_2", @@ -1769,7 +1734,7 @@ "protonhax-src": "protonhax-src", "secrets": "secrets", "sioyek-theme-src": "sioyek-theme-src", - "sops-nix": "sops-nix_2", + "sops-nix": "sops-nix", "subsync": "subsync", "trash-d-src": "trash-d-src", "ts-for-gir-src": "ts-for-gir-src", @@ -1819,7 +1784,9 @@ "nixpkgs": [ "nixpkgs" ], - "sops-nix": "sops-nix" + "sops-nix": [ + "sops-nix" + ] }, "locked": { "lastModified": 1722222376, @@ -1854,7 +1821,6 @@ "sops-nix": { "inputs": { "nixpkgs": [ - "secrets", "nixpkgs" ], "nixpkgs-stable": "nixpkgs-stable_2" @@ -1873,27 +1839,6 @@ "type": "github" } }, - "sops-nix_2": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_3" - }, - "locked": { - "lastModified": 1722114803, - "narHash": "sha256-s6YhI8UHwQvO4cIFLwl1wZ1eS5Cuuw7ld2VzUchdFP0=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "eb34eb588132d653e4c4925d862f1e5a227cc2ab", - "type": "github" - }, - "original": { - "owner": "Mic92", - "repo": "sops-nix", - "type": "github" - } - }, "sphinxbase-src": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 4be9f520..8558297f 100644 --- a/flake.nix +++ b/flake.nix @@ -213,7 +213,10 @@ type = "github"; }; nix-on-droid = { - inputs.nixpkgs.follows = "nixpkgs"; + inputs = { + home-manager.follows = "home-manager"; + nixpkgs.follows = "nixpkgs"; + }; owner = "nix-community"; repo = "nix-on-droid"; type = "github"; @@ -285,7 +288,10 @@ type = "github"; }; secrets = { - inputs.nixpkgs.follows = "nixpkgs"; + inputs = { + nixpkgs.follows = "nixpkgs"; + sops-nix.follows = "sops-nix"; + }; type = "git"; url = "ssh://git@git.nelim.org/matt1432/nixos-secrets"; }; diff --git a/flake/inputs.nix b/flake/inputs.nix index cf27a64a..682074e5 100644 --- a/flake/inputs.nix +++ b/flake/inputs.nix @@ -3,9 +3,29 @@ let # Misc functions mkInput = {type ? "github", ...} @ info: info // {inherit type;}; - mkDep = info: (mkInput info) // {inputs.nixpkgs.follows = "nixpkgs";}; - mkHyprDep = info: (mkInput info) // {inputs.hyprland.follows = "hyprland";}; - mkSrc = info: (mkInput info) // {flake = false;}; + mkDep = info: + mkInput (info + // { + inputs = + {nixpkgs.follows = "nixpkgs";} + // ( + if builtins.hasAttr "inputs" info + then info.inputs + else {} + ); + }); + mkHyprDep = info: + mkInput (info + // { + inputs = + {hyprland.follows = "hyprland";} + // ( + if builtins.hasAttr "inputs" info + then info.inputs + else {} + ); + }); + mkSrc = info: mkInput (info // {flake = false;}); # Inputs nixTools = {