From eba2e31042759c953850ea2435aca0927b9309c8 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 25 Jul 2024 11:56:35 -0500 Subject: [PATCH] move pkgs out --- hosts/algiz/default.nix | 15 +-------------- hosts/algiz/pkgs.nix | 8 ++++++++ hosts/mannaz/system.nix | 6 +----- lib/generators.nix | 9 +++++++-- 4 files changed, 17 insertions(+), 21 deletions(-) create mode 100644 hosts/algiz/pkgs.nix diff --git a/hosts/algiz/default.nix b/hosts/algiz/default.nix index bd09773..259c5d7 100644 --- a/hosts/algiz/default.nix +++ b/hosts/algiz/default.nix @@ -1,12 +1,5 @@ +{ enabled, ... }: { - self, - pkgs, - enabled, - ... -}: -{ - imports = with self.nixosModules; [ restic ]; - oizys = { languages = [ "nim" @@ -20,12 +13,6 @@ nix-ld = enabled; }; - environment.systemPackages = with pkgs; [ - (writeShellScriptBin "gitea" '' - ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@" - '') - ]; - services.restic.backups.gdrive = { # directories created by gitea and soft-serve aren't world readable user = "root"; diff --git a/hosts/algiz/pkgs.nix b/hosts/algiz/pkgs.nix new file mode 100644 index 0000000..3d6d274 --- /dev/null +++ b/hosts/algiz/pkgs.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + (writeShellScriptBin "gitea" '' + ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@" + '') + ]; +} diff --git a/hosts/mannaz/system.nix b/hosts/mannaz/system.nix index fb775f4..c4990ec 100644 --- a/hosts/mannaz/system.nix +++ b/hosts/mannaz/system.nix @@ -1,8 +1,4 @@ -{ - config, - enabled, - ... -}: +{ config, enabled, ... }: { # Use the systemd-boot EFI boot loader. boot.loader = { diff --git a/lib/generators.nix b/lib/generators.nix index f63247b..12d5c56 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -8,7 +8,6 @@ let inherit (builtins) filter; inherit (lib) nixosSystem - isNixFile mkDefaultOizysModule mkOizysModule enabled @@ -16,12 +15,17 @@ let pkgsFromSystem pkgFromSystem overlayFrom + isNixFile ; inherit (lib.filesystem) listFilesRecursive; pkgFrom = pkgFromSystem "x86_64-linux"; pkgsFrom = pkgsFromSystem "x86_64-linux"; + hostPath = host: ../. + "/hosts/${host}"; + # all nix files not including pkgs.nix + hostFiles = host: filter isNixFile (listFilesRecursive (hostPath host)); + mkIso = nixosSystem { system = "x86_64-linux"; modules = [ @@ -54,7 +58,8 @@ let ../overlays inputs.lix-module.nixosModules.default inputs.hyprland.nixosModules.default - ] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostName}")); + ] ++ (hostFiles hostName); + specialArgs = { inherit inputs