From 74c023c627cff70294c80ccc3527f31b192f5944 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Sun, 24 Oct 2021 23:12:25 +0300 Subject: [PATCH] refactor config --- modules/devices.nix | 5 +++++ profiles/applications/kitty.nix | 6 ++++-- profiles/services.nix | 2 ++ profiles/workspace/locale.nix | 4 ++-- profiles/workspace/misc.nix | 1 - profiles/workspace/ssh.nix | 1 + roles/desktop.nix | 2 +- roles/server.nix | 24 ++++++++++++++++++++++-- 8 files changed, 37 insertions(+), 8 deletions(-) diff --git a/modules/devices.nix b/modules/devices.nix index ba5a617..0ac0522 100644 --- a/modules/devices.nix +++ b/modules/devices.nix @@ -36,6 +36,11 @@ with types; { default = !isNull (builtins.match ".*VM" config.networking.hostName); }; + isCloud = mkOption { + type = bool; + default = + !isNull (builtins.match ".*Cloud" config.networking.hostName); + }; isISO = mkOption { type = bool; default = diff --git a/profiles/applications/kitty.nix b/profiles/applications/kitty.nix index 9dede79..c4afdf0 100644 --- a/profiles/applications/kitty.nix +++ b/profiles/applications/kitty.nix @@ -3,13 +3,15 @@ let thm = config.lib.base16.theme; in with config.deviceSpecific; { - defaultApplications.term = lib.mkIf (isLaptop || isDesktop) { + # defaultApplications.term = lib.mkIf (isLaptop || isDesktop) { + defaultApplications.term = { cmd = "${pkgs.kitty}/bin/kitty"; desktop = "kitty"; }; home-manager.users.alukard = { programs.kitty = { - enable = isLaptop || isDesktop; + # enable = isLaptop || isDesktop; + enable = enable; font.name = "${thm.fonts.powerline.family} ${thm.fontSizes.small.str}"; # keybindings = '' # ''; diff --git a/profiles/services.nix b/profiles/services.nix index ff1be3f..599266e 100644 --- a/profiles/services.nix +++ b/profiles/services.nix @@ -57,6 +57,8 @@ with config.deviceSpecific; { services.udev.packages = [ pkgs.stlink ]; + home-manager.users.alukard.services.udiskie.enable = true; + services.upower.enable = true; systemd.services.systemd-udev-settle.enable = false; diff --git a/profiles/workspace/locale.nix b/profiles/workspace/locale.nix index fa5a108..4436811 100644 --- a/profiles/workspace/locale.nix +++ b/profiles/workspace/locale.nix @@ -11,9 +11,9 @@ LANG = lib.mkForce "en_GB.UTF-8"; }; - time.timeZone = "Europe/Moscow"; + time.timeZone = mkIf (!config.deviceSpecific.isCloud) "Europe/Moscow"; - location = { + location = mkIf (!config.deviceSpecific.isCloud) { provider = "manual"; latitude = 48.78583; longitude = 44.77973; diff --git a/profiles/workspace/misc.nix b/profiles/workspace/misc.nix index 6edafa9..19f735b 100644 --- a/profiles/workspace/misc.nix +++ b/profiles/workspace/misc.nix @@ -8,7 +8,6 @@ }; home-manager.users.alukard = { - services.udiskie.enable = true; news.display = "silent"; systemd.user.startServices = true; home.stateVersion = "21.11"; diff --git a/profiles/workspace/ssh.nix b/profiles/workspace/ssh.nix index ed49eac..5d88d89 100644 --- a/profiles/workspace/ssh.nix +++ b/profiles/workspace/ssh.nix @@ -11,6 +11,7 @@ users.users.alukard.openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC+xd8ClJPvJuAdYC9HlNnjiubEtYfvnKjYr9ROV+UmPVvI3ZITF24OaMI+fxgR0EqGfcUzSGom8528IB53Q3aFMIAaA0vKjW+jrByyB2l/k/+ttpLbH75c9WyOpAcUDTen8BhHKPyXOHoJ1jLu7GFmtPZ+mZo8thFB/VIRrwECHd8DnF0drsSCorkRp1bZC7bAHgztaYHNBUoAVGgJ7nLwW7DotlgbUEDiPJHXOxd/c/ZlXIB/cfUUqF+L5ThbMPhMcwRMspLy+nQdmHhih9k6SkvYqJoNqHT5/XeShb0RkIzvUWT2CYTPop5kAY5mMnatVTOY1FZPhHzk3G8MhOQ3r/elM/ecZxmjL8uozMN9kRGf1IL4DgQZfVqQRILdNSQGb0tfeiyirNZe1RlDw9UvMnZJOw0EkiC9lSSRhBWXXxAmxRrbNFTPQSp+/kiIGDmp2AsGhD11CfTDEU3wcLEUPBUqp1FYSzHncJyEKGy2Dpa5xaUJ0cuyGL4W3WHDXa4sTfY+AIXbQTD88Ujdsbfzyd6lrikG4D/crCurXissrh7q9DuYKWRI24cp5bw9lG33U1EXisnZqFyZNwMAmSj2QEGsHCwSevn0FgyRa2WYXgpZ9hfgY4le+ZSMo2JTosQ6DjGyxMDyQAHJ/ismTTzL67Q2p6U+73toYm62Qqdspw== (none)" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1OdiD3T30dTTVtwDjiVEQ+Dd9P92/4rI60x1xYtr6P75UYZF7eIO6FrxH8FAeSH6N10YsdTK1NPRDj5bsbLDB7d4D4YewPw+tnl3Qnp/04k+/+gpSFhVyUwKWvSTgU34NZFiwdHLuefYkHdAmDBhUhWC+28DyWSPn2LLTHhGRBOaNG39ur/1vaIuJb00vbzA/HWQmIYIByd51gjQkgC+SxIlYb13Q/L6SqHCZ8RUzJyS9bGM9Imw5T7V7SVC2FRjOt6NUm8AVVw06yRgtjXipEYA9GE+Rp69+MNmKr2OxR//KWyQb/SCfQyIWrBn0ee266XukOFuC4bpp50TjTEXx oracle_cloud" ]; home-manager.users.alukard = { diff --git a/roles/desktop.nix b/roles/desktop.nix index 10a1e10..54a22eb 100644 --- a/roles/desktop.nix +++ b/roles/desktop.nix @@ -26,7 +26,7 @@ rofi spotify steam - urxvt + # urxvt vivaldi vscode diff --git a/roles/server.nix b/roles/server.nix index 6dae84d..24292d6 100644 --- a/roles/server.nix +++ b/roles/server.nix @@ -1,5 +1,25 @@ { inputs, ... }: { - imports = [ - ./base.nix + imports = with inputs.self.nixosModules; with inputs.self.nixosProfiles; [ + inputs.home-manager.nixosModules.home-manager + inputs.base16.hmModule + + applications + devices + locale + misc + nix + overlay + secrets + secrets-envsubst + security + themes + ssh + xdg + zsh + + kitty + + direnv + fonts ]; }