From f3002053aab8e62c095d7086ce44698608f654fb Mon Sep 17 00:00:00 2001 From: Lan Tian Date: Sat, 30 Nov 2024 22:40:14 -0800 Subject: [PATCH] general: move scripts into flake-modules folder --- flake-modules/commands.nix | 29 ------------------- .../commands}/asterisk-music-deploy.nix | 2 +- .../commands}/asterisk-music-dialplan.nix | 4 +-- {scripts => flake-modules/commands}/check.nix | 0 .../commands}/colmena.nix | 0 flake-modules/commands/default.nix | 29 +++++++++++++++++++ .../commands}/dnscontrol.nix | 0 .../commands}/nvfetcher.nix | 0 .../commands}/secrets.nix | 0 .../commands}/update.nix | 0 flake.nix | 2 +- 11 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 flake-modules/commands.nix rename {scripts => flake-modules/commands}/asterisk-music-deploy.nix (88%) rename {scripts => flake-modules/commands}/asterisk-music-dialplan.nix (73%) rename {scripts => flake-modules/commands}/check.nix (100%) rename {scripts => flake-modules/commands}/colmena.nix (100%) create mode 100644 flake-modules/commands/default.nix rename {scripts => flake-modules/commands}/dnscontrol.nix (100%) rename {scripts => flake-modules/commands}/nvfetcher.nix (100%) rename {scripts => flake-modules/commands}/secrets.nix (100%) rename {scripts => flake-modules/commands}/update.nix (100%) diff --git a/flake-modules/commands.nix b/flake-modules/commands.nix deleted file mode 100644 index 1a8723b9..00000000 --- a/flake-modules/commands.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - self, - lib, - inputs, - ... -}: -{ - perSystem = - { pkgs, ... }: - let - extraArgs = { - inherit inputs; - LT = import ../helpers { inherit lib inputs pkgs; }; - packages = self.packages."${pkgs.system}"; - }; - in - { - commands = lib.mapAttrs (_k: v: pkgs.callPackage v extraArgs) { - asterisk-music-deploy = ../scripts/asterisk-music-deploy.nix; - asterisk-music-dialplan = ../scripts/asterisk-music-dialplan.nix; - colmena = ../scripts/colmena.nix; - check = ../scripts/check.nix; - dnscontrol = ../scripts/dnscontrol.nix; - nvfetcher = ../scripts/nvfetcher.nix; - secrets = ../scripts/secrets.nix; - update = ../scripts/update.nix; - }; - }; -} diff --git a/scripts/asterisk-music-deploy.nix b/flake-modules/commands/asterisk-music-deploy.nix similarity index 88% rename from scripts/asterisk-music-deploy.nix rename to flake-modules/commands/asterisk-music-deploy.nix index bb26e42e..6ce31683 100644 --- a/scripts/asterisk-music-deploy.nix +++ b/flake-modules/commands/asterisk-music-deploy.nix @@ -5,7 +5,7 @@ ... }: let - constants = callPackage ../helpers/constants.nix { }; + constants = callPackage ../../helpers/constants.nix { }; inherit (constants) asteriskMusics; files = lib.escapeShellArgs ( builtins.map (n: "/home/lantian/Music/CloudMusic/" + n) asteriskMusics diff --git a/scripts/asterisk-music-dialplan.nix b/flake-modules/commands/asterisk-music-dialplan.nix similarity index 73% rename from scripts/asterisk-music-dialplan.nix rename to flake-modules/commands/asterisk-music-dialplan.nix index be35ecdd..e1dfc158 100644 --- a/scripts/asterisk-music-dialplan.nix +++ b/flake-modules/commands/asterisk-music-dialplan.nix @@ -4,8 +4,8 @@ ... }: let - constants = callPackage ../helpers/constants.nix { }; - enumerateList = callPackage ../helpers/fn/enumerate-list.nix { }; + constants = callPackage ../../helpers/constants.nix { }; + enumerateList = callPackage ../../helpers/fn/enumerate-list.nix { }; inherit (constants) asteriskMusics; prefixZeros = diff --git a/scripts/check.nix b/flake-modules/commands/check.nix similarity index 100% rename from scripts/check.nix rename to flake-modules/commands/check.nix diff --git a/scripts/colmena.nix b/flake-modules/commands/colmena.nix similarity index 100% rename from scripts/colmena.nix rename to flake-modules/commands/colmena.nix diff --git a/flake-modules/commands/default.nix b/flake-modules/commands/default.nix new file mode 100644 index 00000000..724b2465 --- /dev/null +++ b/flake-modules/commands/default.nix @@ -0,0 +1,29 @@ +{ + self, + lib, + inputs, + ... +}: +{ + perSystem = + { pkgs, ... }: + let + extraArgs = { + inherit inputs; + LT = import ../../helpers { inherit lib inputs pkgs; }; + packages = self.packages."${pkgs.system}"; + }; + in + { + commands = lib.mapAttrs (_k: v: pkgs.callPackage v extraArgs) { + asterisk-music-deploy = ./asterisk-music-deploy.nix; + asterisk-music-dialplan = ./asterisk-music-dialplan.nix; + colmena = ./colmena.nix; + check = ./check.nix; + dnscontrol = ./dnscontrol.nix; + nvfetcher = ./nvfetcher.nix; + secrets = ./secrets.nix; + update = ./update.nix; + }; + }; +} diff --git a/scripts/dnscontrol.nix b/flake-modules/commands/dnscontrol.nix similarity index 100% rename from scripts/dnscontrol.nix rename to flake-modules/commands/dnscontrol.nix diff --git a/scripts/nvfetcher.nix b/flake-modules/commands/nvfetcher.nix similarity index 100% rename from scripts/nvfetcher.nix rename to flake-modules/commands/nvfetcher.nix diff --git a/scripts/secrets.nix b/flake-modules/commands/secrets.nix similarity index 100% rename from scripts/secrets.nix rename to flake-modules/commands/secrets.nix diff --git a/scripts/update.nix b/flake-modules/commands/update.nix similarity index 100% rename from scripts/update.nix rename to flake-modules/commands/update.nix diff --git a/flake.nix b/flake.nix index 69cc4374..0be31aa4 100644 --- a/flake.nix +++ b/flake.nix @@ -112,7 +112,7 @@ in flake-parts.lib.mkFlake { inherit inputs; } { imports = [ - ./flake-modules/commands.nix + ./flake-modules/commands ./flake-modules/nixd.nix ./flake-modules/nixos-configurations.nix inputs.nur-xddxdd.flakeModules.auto-colmena-hive-v0_20241006