refactor: get rid of useless global vars
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-11-18 12:30:54 -05:00
parent 2d39d81560
commit 155a9884ee
16 changed files with 25 additions and 50 deletions

View file

@ -1,5 +1,6 @@
{
config,
osConfig,
pkgs,
lib,
nixd,
@ -7,7 +8,8 @@
...
}: let
inherit (lib) getExe hasPrefix mkIf removePrefix;
inherit (config.vars) hostName mainUser neovimIde;
inherit (config.vars) mainUser neovimIde;
inherit (osConfig.networking) hostName;
defaultFormatter = self.formatter.${pkgs.system};

View file

@ -4,7 +4,6 @@
...
}: let
inherit (lib) mkDefault mkOption types;
flakeDir = config.environment.variables.FLAKE;
cfg = config.vars;
in {
options.vars = {
@ -15,13 +14,6 @@ in {
'';
};
hostName = mkOption {
type = types.str;
description = ''
Hostname that was defined at the initial setup process
'';
};
promptMainColor = mkOption {
type = types.enum (import ./prompt-schemes.nix {});
default = "purple";
@ -48,14 +40,6 @@ in {
};
};
configDir = mkOption {
type = types.str;
default = "${flakeDir}/devices/${cfg.hostName}/config";
description = ''
The path to where most of the devices' configs are in the .nix folder
'';
};
neovimIde = mkOption {
type = types.bool;
default = true;

View file

@ -24,7 +24,6 @@ In every device's `default.nix`, you'll find these [settings](https://git.nelim.
vars = {
mainUser = "matt";
hostName = "wim";
...
};
```

View file

@ -6,7 +6,6 @@
}: {
vars = {
mainUser = "nix-on-droid";
hostName = "localhost";
neovimIde = false;
};

View file

@ -3,7 +3,7 @@
self,
...
}: let
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
in {
# ------------------------------------------------
# Imports
@ -26,7 +26,6 @@ in {
# ------------------------------------------------
vars = {
mainUser = "mariah";
hostName = "bbsteamie";
promptMainColor = "pink";
};
@ -39,7 +38,7 @@ in {
};
networking = {
inherit hostName;
hostName = "bbsteamie";
networkmanager.enable = true;
};

View file

@ -3,7 +3,7 @@
self,
...
}: let
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
in {
# ------------------------------------------------
# Imports
@ -31,7 +31,6 @@ in {
# ------------------------------------------------
vars = {
mainUser = "matt";
hostName = "binto";
promptMainColor = "purple";
};
@ -48,7 +47,7 @@ in {
};
networking = {
inherit hostName;
hostName = "binto";
networkmanager.enable = true;
firewall.enable = false;
};

View file

@ -3,7 +3,7 @@ deviceName: {
self,
...
}: let
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip;
in {
@ -27,7 +27,6 @@ in {
# ------------------------------------------------
vars = {
mainUser = "matt";
hostName = deviceName;
promptMainColor =
if deviceName == "thingone"
then "green"
@ -45,7 +44,7 @@ in {
};
networking = {
inherit hostName;
hostName = deviceName;
resolvconf.enable = true;
nameservers = [
clusterIP

View file

@ -4,8 +4,9 @@
config,
...
}: let
inherit (config.vars) hostName mainUser;
inherit (config.sops) secrets;
inherit (config.vars) mainUser;
inherit (config.networking) hostName;
caddy = caddy-plugins.packages.${pkgs.system}.default;
in {

View file

@ -1,5 +1,6 @@
{config, ...}: let
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
inherit (config.networking) hostName;
clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip;
in {

View file

@ -11,7 +11,8 @@
else b)) {}
list;
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
inherit (config.networking) hostName;
serviviIP = "100.64.0.7";
caddyIp =

View file

@ -3,7 +3,7 @@
self,
...
}: let
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
in {
# ------------------------------------------------
# Imports
@ -26,7 +26,6 @@ in {
# ------------------------------------------------
vars = {
mainUser = "matt";
hostName = "homie";
promptMainColor = "yellow";
};
@ -39,7 +38,7 @@ in {
};
networking = {
inherit hostName;
hostName = "homie";
resolvconf.enable = true;
firewall.enable = false;
};

View file

@ -3,7 +3,7 @@
self,
...
}: let
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
in {
# ------------------------------------------------
# Imports
@ -26,7 +26,6 @@ in {
# ------------------------------------------------
vars = {
mainUser = "matt";
hostName = "nos";
promptMainColor = "orange";
};
@ -40,7 +39,7 @@ in {
};
networking = {
inherit hostName;
hostName = "nos";
resolvconf.enable = true;
firewall.enable = false;
};

View file

@ -3,7 +3,7 @@
self,
...
}: let
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
in {
# ------------------------------------------------
# Imports
@ -26,7 +26,6 @@ in {
# ------------------------------------------------
vars = {
mainUser = "matt";
hostName = "servivi";
promptMainColor = "blue";
};
@ -53,7 +52,7 @@ in {
};
networking = {
inherit hostName;
hostName = "servivi";
resolvconf.enable = true;
firewall.enable = false;
};

View file

@ -4,7 +4,7 @@
pkgs,
...
}: let
inherit (config.vars) mainUser hostName;
inherit (config.vars) mainUser;
in {
# ------------------------------------------------
# Imports
@ -34,7 +34,6 @@ in {
# ------------------------------------------------
vars = {
mainUser = "matt";
hostName = "wim";
promptMainColor = "purple";
};
@ -51,7 +50,7 @@ in {
};
networking = {
inherit hostName;
hostName = "wim";
networkmanager = {
enable = true;

View file

@ -9,7 +9,7 @@
inherit (lib.attrsets) attrValues hasAttr listToAttrs mapAttrs removeAttrs;
inherit (config.sops) secrets;
inherit (config.vars) hostName;
inherit (config.networking) hostName;
cfg = config.services.borgbackup;
in {

View file

@ -120,12 +120,7 @@
live-image = mkNixOS {
extraModules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
{
vars = {
mainUser = "nixos";
hostName = "nixos";
};
}
{vars.mainUser = "nixos";}
];
};
};