diff --git a/home-manager/modules/ssh/default.nix b/home-manager/modules/ssh/default.nix index e4a7747..b0c2cbc 100644 --- a/home-manager/modules/ssh/default.nix +++ b/home-manager/modules/ssh/default.nix @@ -5,6 +5,7 @@ }: with lib; let cfg = config.eboskma.programs.ssh; + var = config.eboskma.var; personalKey = "~/.ssh/id_ed25519_sk"; horusKey = "~/.ssh/id_ed25519_sk_horus"; in @@ -27,7 +28,7 @@ in SetEnv = "TERM=xterm-256color"; }; }; - home = { + home = mkIf (!var.workSystem) { host = "home"; hostname = "10.0.0.2"; extraOptions = { @@ -36,7 +37,7 @@ in }; }; - horus = { + horus = mkIf (!var.workSystem) { host = "horus"; hostname = "10.1.0.2"; proxyJump = "home"; @@ -46,26 +47,26 @@ in }; }; - proxy = { + proxy = mkIf (!var.workSystem) { forwardAgent = true; hostname = "10.0.0.251"; }; - gitea = { + gitea = mkIf (!var.workSystem) { forwardAgent = true; hostname = "10.0.0.201"; }; - drone = { + drone = mkIf (!var.workSystem) { forwardAgent = true; hostname = "10.0.0.202"; }; "git.datarift.nl" = { - hostname = "10.0.0.201"; + hostname = (if var.workSystem then "direct.datarift.nl" else "10.0.0.201"); }; - fluiddpi = { + fluiddpi = mkIf (!var.workSystem) { hostname = "10.0.0.120"; user = "pi"; }; diff --git a/machines/mimir/configuration.nix b/machines/mimir/configuration.nix index 6545729..3264017 100644 --- a/machines/mimir/configuration.nix +++ b/machines/mimir/configuration.nix @@ -23,6 +23,7 @@ in # nixpkgs.config.allowUnfree = true; eboskma = { + var.workSystem = true; users = { erwin = { enable = true; @@ -68,7 +69,7 @@ in networking = { hostName = "mimir"; useDHCP = false; - networkmanager.enable = false; + networkmanager.enable = true; useNetworkd = true; firewall = { diff --git a/modules/options/default.nix b/modules/options/default.nix index a331f76..c315a92 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -7,19 +7,19 @@ with lib; let cfg = config.eboskma.var; in { - options.eboskma.var.mainUser = lib.mkOption { + options.eboskma.var = { + mainUser = lib.mkOption { type = lib.types.str; default = "erwin"; description = '' The main system user ''; - }; + }; - options.eboskma.system = lib.mkOption { - type = lib.types.str; - default = "x86_64-linux"; - description = '' - System type - ''; + workSystem = lib.mkOption { + description = "Is this system for work or home?"; + type = lib.types.bool; + default = false; + }; }; } diff --git a/users/erwin/home.nix b/users/erwin/home.nix index fe920c5..455346e 100644 --- a/users/erwin/home.nix +++ b/users/erwin/home.nix @@ -231,6 +231,7 @@ in ]; } inputs.hyprland.homeManagerModules.default + ../../modules/options ] ++ (map (mod: (../../home-manager/modules + "/${mod}")) (builtins.attrNames (builtins.readDir ../../home-manager/modules))); }; diff --git a/users/erwin/work.nix b/users/erwin/work.nix index a7504db..c6ff515 100644 --- a/users/erwin/work.nix +++ b/users/erwin/work.nix @@ -24,6 +24,7 @@ in nixpkgs.config.allowUnfree = true; eboskma = { + var.workSystem = true; programs = { alacritty.enable = true; bat.enable = true; @@ -181,6 +182,7 @@ in ]; } inputs.hyprland.homeManagerModules.default + ../../modules/options ] ++ (map (mod: (../../home-manager/modules + "/${mod}")) (builtins.attrNames (builtins.readDir ../../home-manager/modules))); home.stateVersion = "22.11";