From ce1e372f0ffdc2ccab36f08792eea67c6df2f088 Mon Sep 17 00:00:00 2001 From: ooks-io Date: Mon, 29 Apr 2024 14:36:45 +1200 Subject: [PATCH] refactor(systemModules:nix): now enabled on all systems unless host is specified as a phone --- system/modules/nix/default.nix | 12 ++++-------- system/modules/nix/{nh.nix => nh/default.nix} | 5 +++-- system/modules/nix/{nix.nix => nix/default.nix} | 7 ++++--- .../modules/nix/{nixpkgs.nix => nixpkgs/default.nix} | 5 +++-- system/modules/nix/{subs.nix => subs/default.nix} | 5 +++-- 5 files changed, 17 insertions(+), 17 deletions(-) rename system/modules/nix/{nh.nix => nh/default.nix} (71%) rename system/modules/nix/{nix.nix => nix/default.nix} (78%) rename system/modules/nix/{nixpkgs.nix => nixpkgs/default.nix} (74%) rename system/modules/nix/{subs.nix => subs/default.nix} (89%) diff --git a/system/modules/nix/default.nix b/system/modules/nix/default.nix index f43c52b..2ff9461 100644 --- a/system/modules/nix/default.nix +++ b/system/modules/nix/default.nix @@ -2,13 +2,9 @@ { imports = [ - ./nh.nix - ./nix.nix - ./nixpkgs.nix - ./subs.nix + ./nh + ./nix + ./nixpkgs + ./subs ]; - - options.systemModules.nixOptions = { - enable = lib.mkEnableOption "Enable nix related configuration modules"; - }; } diff --git a/system/modules/nix/nh.nix b/system/modules/nix/nh/default.nix similarity index 71% rename from system/modules/nix/nh.nix rename to system/modules/nix/nh/default.nix index b31e99a..7e052e1 100644 --- a/system/modules/nix/nh.nix +++ b/system/modules/nix/nh/default.nix @@ -1,12 +1,13 @@ { pkgs, lib, config, ... }: let - cfg = config.systemModules.nixOptions; inherit (lib) mkIf; + host = config.systemModules.host; in { - config = mkIf cfg.enable { + config = mkIf (host.type != "phone") { + # TODO: i dont't want to hardcode this. environment.variables.FLAKE = "/home/ooks/.config/ooknix/"; programs.nh = { diff --git a/system/modules/nix/nix.nix b/system/modules/nix/nix/default.nix similarity index 78% rename from system/modules/nix/nix.nix rename to system/modules/nix/nix/default.nix index 81d993b..b55bd89 100644 --- a/system/modules/nix/nix.nix +++ b/system/modules/nix/nix/default.nix @@ -1,11 +1,12 @@ -{ config, lib, pkgs, inputs, ... }: +{ config, lib, inputs, ... }: let - cfg = config.systemModules.nixOptions; + inherit (lib) mkIf; + host = config.systemModules.host; in { - config = lib.mkIf cfg.enable { + config = mkIf (host.type != "phone") { nix = { settings = { trusted-users = [ "root" "@wheel" ]; diff --git a/system/modules/nix/nixpkgs.nix b/system/modules/nix/nixpkgs/default.nix similarity index 74% rename from system/modules/nix/nixpkgs.nix rename to system/modules/nix/nixpkgs/default.nix index ff7aa58..c97cb93 100644 --- a/system/modules/nix/nixpkgs.nix +++ b/system/modules/nix/nixpkgs/default.nix @@ -1,11 +1,12 @@ { outputs, lib, config, ... }: let - cfg = config.systemModules.nixOptions; + inherit (lib) mkIf; + host = config.systemModules.host; in { - config = lib.mkIf cfg.enable { + config = mkIf host.type != "phone" { nixpkgs = { overlays = builtins.attrValues outputs.overlays; config = { diff --git a/system/modules/nix/subs.nix b/system/modules/nix/subs/default.nix similarity index 89% rename from system/modules/nix/subs.nix rename to system/modules/nix/subs/default.nix index 8ddc92e..1fb48cb 100644 --- a/system/modules/nix/subs.nix +++ b/system/modules/nix/subs/default.nix @@ -1,11 +1,12 @@ { lib, config, ... }: let - cfg = config.systemModules.nixOptions; + inherit (lib) mkIf; + host = config.systemModules.host; in { - config = lib.mkIf cfg.enable { + config = mkIf (host.type != "phone") { nix.settings = { substituters = [ "https://cache.nixos.org?priority=10"