From 235f7a208efe9b27160dd04d8463ee757bb2374a Mon Sep 17 00:00:00 2001 From: pagedMov Date: Tue, 26 Nov 2024 12:54:02 -0500 Subject: [PATCH] tweaked server config --- flake.lock | 122 ++++++++++++------------ flake.nix | 1 + hosts/server/config.nix | 47 +++++++-- hosts/server/home.nix | 43 +++++---- modules/home/environment/starship.nix | 2 +- modules/home/environment/stylixhome.nix | 5 +- modules/home/servermodule.nix | 28 +----- modules/server/cdn/jellyfin.nix | 4 +- modules/server/default.nix | 4 - modules/server/glasshaus/caddy.nix | 4 +- 10 files changed, 134 insertions(+), 126 deletions(-) diff --git a/flake.lock b/flake.lock index 38d328c..b9abdbe 100755 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1731966541, - "narHash": "sha256-AhX8QQBQLRqEWHftFibTmvlmh157134vzBYXW0LOBKo=", + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "d8e769add6333892b44afc107f193074a5072717", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", "type": "github" }, "original": { @@ -86,11 +86,11 @@ "base16-vim": { "flake": false, "locked": { - "lastModified": 1716150083, - "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "lastModified": 1731949548, + "narHash": "sha256-XIDexXM66sSh5j/x70e054BnUsviibUShW7XhbDGhYo=", "owner": "tinted-theming", "repo": "base16-vim", - "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", + "rev": "61165b1632409bd55e530f3dbdd4477f011cadc6", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1732109232, - "narHash": "sha256-iYh6h8yueU8IyOfNclbiBG2+fBFcjjUfXm90ZBzk0c0=", + "lastModified": 1732540163, + "narHash": "sha256-5EYzmoTpem2IB9JWzd41sL98pz3lyyCSTiCjv08i4Uk=", "owner": "nix-community", "repo": "disko", - "rev": "a0c384e0a3b8bcaed30a6bcf3783f8a7c8b35be4", + "rev": "2ed5e30fc7e34adf455db8b02b9151d3922a54ea", "type": "github" }, "original": { @@ -187,11 +187,11 @@ "flake-compat_4": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -247,11 +247,11 @@ ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -293,11 +293,11 @@ ] }, "locked": { - "lastModified": 1731363552, - "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", + "lastModified": 1732021966, + "narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", "type": "github" }, "original": { @@ -374,11 +374,11 @@ ] }, "locked": { - "lastModified": 1732025103, - "narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=", + "lastModified": 1732482255, + "narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=", "owner": "nix-community", "repo": "home-manager", - "rev": "a46e702093a5c46e192243edbd977d5749e7f294", + "rev": "a9953635d7f34e7358d5189751110f87e3ac17da", "type": "github" }, "original": { @@ -395,11 +395,11 @@ ] }, "locked": { - "lastModified": 1731887066, - "narHash": "sha256-uw7K/RsYioJicV79Nl39yjtfhdfTDU2aRxnBgvFhkZ8=", + "lastModified": 1732303962, + "narHash": "sha256-5Umjb5AdtxV5jSJd5jxoCckh5mlg+FBQDsyAilu637g=", "owner": "nix-community", "repo": "home-manager", - "rev": "f3a2ff69586f3a54b461526e5702b1a2f81e740a", + "rev": "8cf9cb2ee78aa129e5b8220135a511a2be254c0c", "type": "github" }, "original": { @@ -416,11 +416,11 @@ ] }, "locked": { - "lastModified": 1730837930, - "narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=", + "lastModified": 1732482255, + "narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f607e07f3ac7e53541120536708e824acccfaa8", + "rev": "a9953635d7f34e7358d5189751110f87e3ac17da", "type": "github" }, "original": { @@ -490,11 +490,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1732100541, - "narHash": "sha256-vFeNbKUstvSZbe9TD4bDYozZd+A/bKD+fxCye+p/Mp8=", + "lastModified": 1732629163, + "narHash": "sha256-TW6S4O2c76WbU5LkZGACBrF0imGnrPfv0MbES0BJ8bE=", "ref": "refs/heads/main", - "rev": "940f7aa990dbc99815bab8d355999d8277534b17", - "revCount": 5484, + "rev": "1fb720b62aeb474873ba43426ddc53afde1e6cdd", + "revCount": 5498, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -731,11 +731,11 @@ ] }, "locked": { - "lastModified": 1731885500, - "narHash": "sha256-ZrztYfSOS33J+ewq5alBOSdnIyZ0/sr1iy7FyBe9zIg=", + "lastModified": 1732324260, + "narHash": "sha256-0xzQvoId/P008QkTSAdFVv465P9rL9nYkIOWXL5pdsY=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "c60b5c924c6188a0b3ca2e139ead3d0f92ae5db5", + "rev": "698a62c628c2ec423aa770d8ec0e1d0bcf4fca1a", "type": "github" }, "original": { @@ -746,11 +746,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731763621, - "narHash": "sha256-ddcX4lQL0X05AYkrkV2LMFgGdRvgap7Ho8kgon3iWZk=", + "lastModified": 1732238832, + "narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c69a9bffbecde46b4b939465422ddc59493d3e4d", + "rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", "type": "github" }, "original": { @@ -826,11 +826,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1731676054, - "narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=", + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", "type": "github" }, "original": { @@ -842,11 +842,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1731531548, - "narHash": "sha256-sz8/v17enkYmfpgeeuyzniGJU0QQBfmAjlemAUYhfy8=", + "lastModified": 1732238832, + "narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "24f0d4acd634792badd6470134c387a3b039dace", + "rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", "type": "github" }, "original": { @@ -871,11 +871,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1732035679, - "narHash": "sha256-J03v1XnxvsrrvHmzKVBZiwik8678IXfkH1/ZR954ujk=", + "lastModified": 1732629460, + "narHash": "sha256-Cr8EyxEFPbVmX6p8LsslFBjDEuVlFNPILrWlwbBNnNA=", "owner": "nix-community", "repo": "nixvim", - "rev": "929bb0cd1cffb9917ab14be9cdb3f27efd6f505f", + "rev": "8b19d154823619af7ced464185e8d13ec80a758b", "type": "github" }, "original": { @@ -886,11 +886,11 @@ }, "nur": { "locked": { - "lastModified": 1732117323, - "narHash": "sha256-QtvUTcCAfocg18O2V4VcnKn42tRooSuVC2S4s1rD8ek=", + "lastModified": 1732640183, + "narHash": "sha256-dsC/webqwhap6v54sYUfGqgdO7uGCsoHWLCG2UGHR6Y=", "owner": "nix-community", "repo": "NUR", - "rev": "aa6fc91ec7d36fbd6c44f63e16cfbc89a993a3b8", + "rev": "0524c0e39883d29c380bc115fc6e51a67f92fd0c", "type": "github" }, "original": { @@ -969,11 +969,11 @@ ] }, "locked": { - "lastModified": 1732076204, - "narHash": "sha256-FnPuD4CnVos1vlHcLceBvv4hHkv2zHive7OzC4xy6ys=", + "lastModified": 1732594596, + "narHash": "sha256-XGAdvRhat+DST+bRBsGYYyno9MKMUCPu6/KTKnRgpj4=", "owner": "gerg-l", "repo": "spicetify-nix", - "rev": "62ac6a2953a8bdfe7a0f7451f8a76ca1d73a6c9f", + "rev": "626e9d49eb7f5122a60e0500f08051267484ebee", "type": "github" }, "original": { @@ -999,11 +999,11 @@ "tinted-tmux": "tinted-tmux" }, "locked": { - "lastModified": 1732036949, - "narHash": "sha256-prZV8HDVvBqHiJLkjElJYoZ6zonV7cOABb8Z0lWonJA=", + "lastModified": 1732608183, + "narHash": "sha256-T5k5ill+PNIEW6KuS4CpUacMtZNJe2J2q5eBOF4xWuU=", "owner": "danth", "repo": "stylix", - "rev": "4912f4db00bc931c7636d827e829faf01f6bf155", + "rev": "7689e621f87bce7b6ab1925dfd70ad1f4c80f334", "type": "github" }, "original": { @@ -1109,11 +1109,11 @@ "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1696725902, - "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "lastModified": 1729501581, + "narHash": "sha256-1ohEFMC23elnl39kxWnjzH1l2DFWWx4DhFNNYDTYt54=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "rev": "f0e7f7974a6441033eb0a172a0342e96722b4f14", "type": "github" }, "original": { @@ -1130,11 +1130,11 @@ ] }, "locked": { - "lastModified": 1731944360, - "narHash": "sha256-sJxPh+V0vUkBhlA58ok/y0o96AtfqiEF0O8qsdolI6o=", + "lastModified": 1732292307, + "narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "579b9a2fd0020cd9cd81a4ef4eab2dca4d20c94c", + "rev": "705df92694af7093dfbb27109ce16d828a79155f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ccdba6c..0534d21 100755 --- a/flake.nix +++ b/flake.nix @@ -98,6 +98,7 @@ modules = [ ./hosts/server/home.nix ./modules/home/servermodule.nix + stylix.homeManagerModules.stylix nixvim.homeManagerModules.nixvim ]; }; diff --git a/hosts/server/config.nix b/hosts/server/config.nix index 153b671..ae1d981 100755 --- a/hosts/server/config.nix +++ b/hosts/server/config.nix @@ -1,15 +1,23 @@ { pkgs, username, ... }: { - imports = [ ./hardware.nix ./home.nix ]; + imports = [ ./hardware.nix ]; movOpts = { - nixSettings.enable = true; - networkModule.enable = true; - bootLoader.enable = true; - issue.enable = true; - sysPkgs.enable = true; - sysProgs.enable = true; - sysServices.enable = true; - jellyfinConfig.enable = true; - caddyConfig.enable = true; + sysEnv = { + nixSettings.enable = true; + issue.enable = true; + }; + hardwareCfg = { + networkModule.enable = true; + bootLoader.enable = true; + }; + softwareCfg = { + sysPkgs.enable = true; + sysProgs.enable = true; + sysServices.enable = true; + }; + serverCfg = { + jellyfinConfig.enable = true; + caddyConfig.enable = true; + }; }; networking.firewall = { allowedTCPPorts = [ 443 8920 ]; }; environment = { @@ -22,4 +30,23 @@ }; shells = with pkgs; [ zsh bash ]; }; + + users = { + groups.persist = { }; + users = { + root.initialPassword = "1234"; + ${username} = { + isNormalUser = true; + initialPassword = "1234"; + shell = pkgs.zsh; + extraGroups = [ "wheel" "persist" "libvirtd" ]; + }; + }; + }; + security.sudo.extraConfig = '' + ${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild + ''; + nix.settings.allowed-users = [ "${username}" ]; + + time.timeZone = "America/New_York"; } diff --git a/hosts/server/home.nix b/hosts/server/home.nix index 5fb14b7..ce4e6da 100755 --- a/hosts/server/home.nix +++ b/hosts/server/home.nix @@ -1,34 +1,37 @@ { host, pkgs, self, inputs, lib, username, config, ... }: { - home.username = "${username}"; # Replace with your actual username + home.username = "${username}"; home.homeDirectory = - "/home/${username}"; # Replace with your actual home directory + "/home/${username}"; home.stateVersion = - "24.05"; # Adjust this based on your system's NixOS version + "24.05"; programs.home-manager.enable = true; movOpts = { + homeFiles.enable = true; + # modules/home/environment - autojumpConfig.enable = true; - starshipConfig.enable = true; - zshConfig.enable = true; + envConfig = { + starshipConfig.enable = true; + userPkgs.enable = true; + zshConfig = { + shellAliases.enable = true; + envVariables.enable = true; + shellOptions.enable = true; + extraConfig.enable = true; + }; + }; # modules/home/programs - btopConfig.enable = true; - userPkgs.enable = true; - ezaConfig.enable = true; - fzfConfig.enable = true; - gitConfig.enable = true; - yaziConfig.enable = true; - batConfig.enable = true; - - # modules/home/scripts - movScripts = { - enable = true; - commandScripts.enable = true; - hyprlandControls.enable = true; - nixShortcuts.enable = true; + programConfigs = { + autojumpConfig.enable = true; + btopConfig.enable = true; + ezaConfig.enable = true; + fzfConfig.enable = true; + gitConfig.enable = true; + yaziConfig.enable = true; + batConfig.enable = true; }; }; } diff --git a/modules/home/environment/starship.nix b/modules/home/environment/starship.nix index f6228d7..c858972 100755 --- a/modules/home/environment/starship.nix +++ b/modules/home/environment/starship.nix @@ -61,7 +61,7 @@ hostname = { ssh_symbol = "🌐"; ssh_only = false; - format = "[@](bold blue)[$hostname](bold red) [via $ssh_symbol]"; + format = "[@](bold blue)[$hostname $ssh_symbol](bold red)"; }; nix_shell = { diff --git a/modules/home/environment/stylixhome.nix b/modules/home/environment/stylixhome.nix index d51f901..ba0c5d4 100755 --- a/modules/home/environment/stylixhome.nix +++ b/modules/home/environment/stylixhome.nix @@ -1,8 +1,9 @@ -{ lib, self, config, pkgs, ... }: +{ lib, self, config, host, pkgs, ... }: let scheme = "tokyo-night-dark"; wallpaper = "${self}/assets/wallpapers/dark-waves.jpg"; + server = (host == "xenon"); in { options = { movOpts.envConfig.stylixHomeConfig.enable = @@ -15,7 +16,7 @@ in { image = wallpaper; polarity = "dark"; autoEnable = true; - opacity.terminal = 0.5; + opacity.terminal = if !server then 0.5 else null; targets = { waybar.enable = false; btop.enable = false; diff --git a/modules/home/servermodule.nix b/modules/home/servermodule.nix index ba0eab4..6694faa 100644 --- a/modules/home/servermodule.nix +++ b/modules/home/servermodule.nix @@ -2,37 +2,17 @@ imports = [ ./environment/starship.nix ./environment/userpkgs.nix - ./environment/zshell.nix + ./environment/stylixhome.nix + ./environment/zsh ./programs/nixvim ./programs/autojump.nix ./programs/bat.nix + ./programs/kitty.nix ./programs/btop.nix ./programs/eza.nix ./programs/fzf.nix ./programs/git.nix ./programs/yazi.nix - ./scripts + ./files.nix ]; - - movOpts = { - # ./environment - zshConfig.enable = lib.mkDefault false; - starshipConfig.enable = lib.mkDefault false; - userPkgs.enable = lib.mkDefault false; - - # ./programs - autojumpConfig.enable = lib.mkDefault false; - btopConfig.enable = lib.mkDefault false; - ezaConfig.enable = lib.mkDefault false; - fzfConfig.enable = lib.mkDefault false; - gitConfig.enable = lib.mkDefault false; - yaziConfig.enable = lib.mkDefault false; - batConfig.enable = lib.mkDefault false; - - # ./scripts - movScripts.enable = lib.mkDefault false; - movScripts.commandScripts.enable = lib.mkDefault false; - movScripts.hyprlandControls.enable = lib.mkDefault false; - movScripts.nixShortcuts.enable = lib.mkDefault false; - }; } diff --git a/modules/server/cdn/jellyfin.nix b/modules/server/cdn/jellyfin.nix index 9f59725..4640002 100755 --- a/modules/server/cdn/jellyfin.nix +++ b/modules/server/cdn/jellyfin.nix @@ -2,10 +2,10 @@ { options = { - movOpts.jellyfinConfig.enable = + movOpts.serverCfg.jellyfinConfig.enable = lib.mkEnableOption "Enables the server's jellyfin config"; }; - config = lib.mkIf config.movOpts.jellyfinConfig.enable { + config = lib.mkIf config.movOpts.serverCfg.jellyfinConfig.enable { services.jellyfin = { enable = true; openFirewall = true; diff --git a/modules/server/default.nix b/modules/server/default.nix index 9cf285c..fa8accd 100755 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -2,8 +2,4 @@ { imports = [ ./cdn ./glasshaus ]; - movOpts = { - jellyfinConfig.enable = lib.mkDefault false; - caddyConfig.enable = lib.mkDefault false; - }; } diff --git a/modules/server/glasshaus/caddy.nix b/modules/server/glasshaus/caddy.nix index bb4fcf0..9e734e7 100755 --- a/modules/server/glasshaus/caddy.nix +++ b/modules/server/glasshaus/caddy.nix @@ -2,10 +2,10 @@ { options = { - movOpts.caddyConfig.enable = lib.mkEnableOption + movOpts.serverCfg.caddyConfig.enable = lib.mkEnableOption "Enable my caddy config for the glasshaus.info domain name"; }; - config = lib.mkIf config.movOpts.caddyConfig.enable { + config = lib.mkIf config.movOpts.serverCfg.caddyConfig.enable { services.caddy = { enable = true; configFile = pkgs.writeText "Caddyfile" ''