From 87e96b52c3390bf6bcde03e725cd9b478cfc091d Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Mon, 15 Sep 2025 04:04:08 -0600 Subject: [PATCH] sys: create defaultDesktopPack for sys and move settings into it --- sys/modules/default.nix | 1 + sys/modules/defaultDesktopPack.nix | 45 ++++++++++++++++++ sys/modules/users.nix | 14 +----- sys/platforms/posixlycorrect/default.nix | 22 +-------- sys/platforms/t14/default.nix | 36 ++++---------- sys/platforms/vps/default.nix | 60 ++++++++++++------------ 6 files changed, 87 insertions(+), 91 deletions(-) create mode 100644 sys/modules/defaultDesktopPack.nix diff --git a/sys/modules/default.nix b/sys/modules/default.nix index ed2f200..80d9159 100644 --- a/sys/modules/default.nix +++ b/sys/modules/default.nix @@ -18,5 +18,6 @@ ./gtklock.nix ./borgsync.nix ./dufs.nix + ./defaultDesktopPack.nix ]; } diff --git a/sys/modules/defaultDesktopPack.nix b/sys/modules/defaultDesktopPack.nix new file mode 100644 index 0000000..0dde759 --- /dev/null +++ b/sys/modules/defaultDesktopPack.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.local.sys.defaultDesktopPack; +in { + options.local.sys.defaultDesktopPack = { + enable = mkEnableOption "common desktop programs and services"; + }; + config = mkIf cfg.enable { + local.sys = { + baseline.enable = true; + + audio.enable = true; + graphics.enable = true; + gtklock.enable = true; + steam.enable = true; + + users = { + fabian = { + enable = true; + unixId = 1002; #TODO !!!!!! + }; + }; + }; + + # trivionomicon + local = { + sway.enable = true; + trivionomiconMotd.enable = true; + }; + + networking = { + networkmanager.enable = true; + + #TODO + useDHCP = false; # The global useDHCP flag is deprecated, therefore explicitly set to false here. + interfaces.enp7s0.useDHCP = true; # Per-interface useDHCP will be mandatory in the future, so this generated config + interfaces.wlp6s0.useDHCP = true; # replicates the default behaviour. + }; + }; +} diff --git a/sys/modules/users.nix b/sys/modules/users.nix index 9925e76..dee9340 100644 --- a/sys/modules/users.nix +++ b/sys/modules/users.nix @@ -35,18 +35,6 @@ in { unixId = mkDefault 1000; admin = true; }; - vanessa = { - unixId = mkDefault 1001; - admin = false; - }; - soto = { - unixId = mkDefault 1010; - admin = false; - }; - diaz = { - unixId = mkDefault 1011; - admin = false; - }; }; users = let @@ -66,7 +54,7 @@ in { shell = pkgs.zsh; extraGroups = ["users" "networkmanager"] - ++ optionals (v.admin) ["wheel" "libvirtd" "dialout" "adbusers"]; + ++ optionals (v.admin) ["wheel" "libvirtd" "dialout" "adbusers" "video"]; openssh.authorizedKeys.keyFiles = v.sshKeyPublicFile; }) enabledUsers; diff --git a/sys/platforms/posixlycorrect/default.nix b/sys/platforms/posixlycorrect/default.nix index 541a70f..494e602 100644 --- a/sys/platforms/posixlycorrect/default.nix +++ b/sys/platforms/posixlycorrect/default.nix @@ -12,15 +12,11 @@ ]; local.sys = { - baseline.enable = true; + defaultDesktopPack.enable = true; yubikey.enable = true; - audio.enable = true; - graphics.enable = true; virtualisation.enable = true; androidSupport.enable = true; - steam.enable = true; - gtklock.enable = true; borgsync = { enable = true; paths = [ @@ -30,27 +26,11 @@ ]; repoName = "posixlycorrect"; }; - - users = { - fabian = { - enable = true; - unixId = 1002; - }; - vanessa.enable = true; - }; }; - local.sway.enable = true; - local.trivionomiconMotd.enable = true; - networking = { hostName = "posixlycorrect"; - networkmanager.enable = true; hostId = "0414a727"; - - useDHCP = false; # The global useDHCP flag is deprecated, therefore explicitly set to false here. - interfaces.enp7s0.useDHCP = true; # Per-interface useDHCP will be mandatory in the future, so this generated config - interfaces.wlp6s0.useDHCP = true; # replicates the default behaviour. }; boot = { diff --git a/sys/platforms/t14/default.nix b/sys/platforms/t14/default.nix index bc63af8..cbb2a67 100644 --- a/sys/platforms/t14/default.nix +++ b/sys/platforms/t14/default.nix @@ -12,39 +12,27 @@ ]; local.sys = { - baseline.enable = true; + defaultDesktopPack.enable = true; yubikey.enable = true; - audio.enable = true; - graphics.enable = true; - steam.enable = true; - gtklock.enable = true; bluetooth.enable = true; - - users = { - fabian = { - enable = true; - unixId = 1002; - }; - }; }; + # trivionomicon local = { - sway.enable = true; - trivionomiconMotd.enable = true; laptop.enable = true; thinkpad.enable = true; }; - networking = { - hostName = "t14"; - networkmanager.enable = true; - - useDHCP = false; # The global useDHCP flag is deprecated, therefore explicitly set to false here. - interfaces.enp7s0.useDHCP = true; # Per-interface useDHCP will be mandatory in the future, so this generated config - interfaces.wlp6s0.useDHCP = true; # replicates the default behaviour. + services = { + fwupd.enable = true; #TODO + pcscd.enable = true; #TODO }; + hardware.acpilight.enable = true; + + networking.hostName = "t14"; + boot = { loader = { systemd-boot.enable = true; @@ -55,10 +43,4 @@ }; time.timeZone = "America/Costa_Rica"; - - services = { - fwupd.enable = true; #TODO - pcscd.enable = true; #TODO - }; - hardware.acpilight.enable = true; } diff --git a/sys/platforms/vps/default.nix b/sys/platforms/vps/default.nix index 7669d84..25b29da 100644 --- a/sys/platforms/vps/default.nix +++ b/sys/platforms/vps/default.nix @@ -17,11 +17,6 @@ with lib; { ./networkMap.nix ]; - local.soju = { - enable = true; - fullyQualifiedDomain = "soju.posixlycorrect.com"; - }; - local.sys = { baseline.enable = true; @@ -42,9 +37,10 @@ with lib; { }; }; - networking = { - hostName = "vps"; - domain = "posixlycorrect.com"; + # trivionomicon + local.soju = { + enable = true; + fullyQualifiedDomain = "soju.posixlycorrect.com"; }; services.openssh = { @@ -53,29 +49,13 @@ with lib; { programs.mosh.enable = true; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - - extraSpecialArgs = { - inherit flakes; - doctrine = flakes.trivionomicon.lib.mkDoctrine { - inherit pkgs; - inherit (doctrine) prefix; - namespace = "home"; - }; - }; - - users.fabian = { - imports = [ - flakes.impermanence.nixosModules.home-manager.impermanence - "${flakes.self}/home/platforms/fabian@vps" - "${flakes.self}/home" - ]; - }; + networking = { + hostName = "vps"; + domain = "posixlycorrect.com"; + firewall.allowedUDPPorts = [51820]; #TODO }; - networking.firewall.allowedUDPPorts = [51820]; #TODO + time.timeZone = "Europe/Amsterdam"; systemd = { extraConfig = '' @@ -137,5 +117,25 @@ with lib; { }; }; - time.timeZone = "Europe/Amsterdam"; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + + extraSpecialArgs = { + inherit flakes; + doctrine = flakes.trivionomicon.lib.mkDoctrine { + inherit pkgs; + inherit (doctrine) prefix; + namespace = "home"; + }; + }; + + users.fabian = { + imports = [ + flakes.impermanence.nixosModules.home-manager.impermanence + "${flakes.self}/home/platforms/fabian@vps" + "${flakes.self}/home" + ]; + }; + }; }