From 652b8599f8a21d2cd39a5a78c740d6c144a6e317 Mon Sep 17 00:00:00 2001 From: muon Date: Sat, 13 Jul 2024 22:28:27 +0000 Subject: [PATCH] Cleanup --- hosts/muon/configuration.nix | 27 ++++------------------- hosts/muon/home.nix | 6 +---- modules/home/default.nix | 7 +++++- modules/home/desktop/social.nix | 3 --- modules/nixos/core/boot.nix | 6 +---- modules/nixos/core/default.nix | 1 + modules/nixos/core/home.nix | 21 ++++++++++++++++++ modules/nixos/core/network.nix | 2 ++ modules/nixos/core/user.nix | 2 +- modules/nixos/server/containers/steam.nix | 27 +---------------------- modules/nixos/unfree/steam.nix | 4 ---- 11 files changed, 38 insertions(+), 68 deletions(-) create mode 100644 modules/nixos/core/home.nix diff --git a/hosts/muon/configuration.nix b/hosts/muon/configuration.nix index 1f4e6eb..ad836f8 100644 --- a/hosts/muon/configuration.nix +++ b/hosts/muon/configuration.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, inputs, system, ... }: let cfg = config.mods; - res = "2560x1440"; + in { # Hardware imports = [ @@ -10,19 +10,7 @@ in { # System mods.user.name = "muon"; - networking.hostName = cfg.user.name; - - # Home - home-manager = { - extraSpecialArgs = { inherit system pkgs inputs; }; - users."${cfg.user.name}" = { - imports = [ - ./home.nix - inputs.self.outputs.homeManagerModules.default - ]; - }; - backupFileExtension = "bak"; - }; + mods.home.file = ./home.nix; # Modules mods.desktop.enable = true; @@ -42,7 +30,7 @@ in { mods.unfree.nvidia.enable = true; mods.unfree.minecraft.enable = true; - # Host specific + # Hardware preferences ## Mouse services.xserver.libinput.mouse.accelProfile = "flat"; @@ -53,7 +41,7 @@ in { name = "DP-2"; config = { enable = true; - mode = res; + mode = "2560x1440"; position = "0x480"; primary = true; rate = "144.00"; @@ -71,13 +59,6 @@ in { }; }; - environment.systemPackages = with pkgs; [ - arandr - ]; - - # Backup environment - services.xserver.windowManager.qtile.enable = true; - # Version of first install system.stateVersion = "23.05"; } diff --git a/hosts/muon/home.nix b/hosts/muon/home.nix index 2b7ec37..75d1367 100644 --- a/hosts/muon/home.nix +++ b/hosts/muon/home.nix @@ -1,9 +1,5 @@ { pkgs, lib, osConfig,... }: let cfg = osConfig.mods; in { - # Home - home.username = cfg.user.name; - home.homeDirectory = "/home/${cfg.user.name}"; - # Modules mods.xdg.enable = true; mods.social.enable = true; @@ -16,7 +12,7 @@ let cfg = osConfig.mods; in { mods.desktop.productivity.enable = true; mods.desktop.media.enable = true; - # Host specific + # Hardware preferences ## Monitors xsession.windowManager.i3.config.workspaceOutputAssign = [{ diff --git a/modules/home/default.nix b/modules/home/default.nix index 7c5ecd9..b3492e6 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,4 +1,7 @@ -{ pkgs, lib, config, osConfig, ... }: { +{ pkgs, lib, config, osConfig, ... }: let + cfg = osConfig.mods; + +in { imports = [ ./terminal ./desktop @@ -8,4 +11,6 @@ # Let Home Manager install and manage itself programs.home-manager.enable = true; + home.username = cfg.user.name; + home.homeDirectory = "/home/${cfg.user.name}"; } diff --git a/modules/home/desktop/social.nix b/modules/home/desktop/social.nix index 52ef725..32a340f 100644 --- a/modules/home/desktop/social.nix +++ b/modules/home/desktop/social.nix @@ -11,9 +11,6 @@ # Video freetube - - # Gaming - prismlauncher ]; }; } diff --git a/modules/nixos/core/boot.nix b/modules/nixos/core/boot.nix index 4cabff5..0093d77 100644 --- a/modules/nixos/core/boot.nix +++ b/modules/nixos/core/boot.nix @@ -1,9 +1,5 @@ { pkgs, lib, config, ... }: { - # boot.loader.systemd-boot.enable = true; - # boot.plymouth.enable = true; - # boot.initrd.systemd.enable = true; - # boot.kernelParams = [ "quiet" ]; - boot.loader = { + boot.loader = lib.mkIf config.mods.xorg.enable { timeout = 0; efi.canTouchEfiVariables = true; grub = { diff --git a/modules/nixos/core/default.nix b/modules/nixos/core/default.nix index e5f1890..802acd8 100644 --- a/modules/nixos/core/default.nix +++ b/modules/nixos/core/default.nix @@ -4,5 +4,6 @@ ./network.nix ./user.nix ./nix.nix + ./home.nix ]; } diff --git a/modules/nixos/core/home.nix b/modules/nixos/core/home.nix new file mode 100644 index 0000000..e2e1be9 --- /dev/null +++ b/modules/nixos/core/home.nix @@ -0,0 +1,21 @@ +{ pkgs, lib, config, inputs, system, ... }: let + cfg = config.mods; + +in { + options.mods.home.file = lib.mkOption { + description = "home-manager configuration file"; + }; + + config = { + home-manager = { + extraSpecialArgs = { inherit system pkgs inputs; }; + users."${cfg.user.name}" = { + imports = [ + cfg.home.file + inputs.self.outputs.homeManagerModules.default + ]; + }; + backupFileExtension = "bak"; + }; + }; +} diff --git a/modules/nixos/core/network.nix b/modules/nixos/core/network.nix index 7b85776..dbf27b6 100644 --- a/modules/nixos/core/network.nix +++ b/modules/nixos/core/network.nix @@ -12,6 +12,8 @@ }; config = { + networking.hostName = config.mods.user.name; + networking.networkmanager.enable = true; services.tailscale.enable = true; diff --git a/modules/nixos/core/user.nix b/modules/nixos/core/user.nix index 70c1b3a..800f01c 100644 --- a/modules/nixos/core/user.nix +++ b/modules/nixos/core/user.nix @@ -7,7 +7,7 @@ config = { users.users.${config.mods.user.name} = { isNormalUser = true; - extraGroups = [ "wheel" "docker" ]; + extraGroups = [ "wheel" ]; initialPassword = "changeme"; shell = if config.programs.zsh.enable then pkgs.zsh diff --git a/modules/nixos/server/containers/steam.nix b/modules/nixos/server/containers/steam.nix index 01b8c10..3073528 100644 --- a/modules/nixos/server/containers/steam.nix +++ b/modules/nixos/server/containers/steam.nix @@ -1,6 +1,4 @@ { pkgs, lib, config, ... }: let - # smoop = pkgs.callPackage ./smoop.nix {}; - steam-xinit = pkgs.writeShellScriptBin "steam-xinit" '' ${lib.getExe pkgs.steam} & exec ${lib.getExe pkgs.openbox} & @@ -69,34 +67,11 @@ in { openbox steam-xinit - # smoop novnc - tigervnc xorg.xinit - - - # python3 - # python3Packages.pip - # python3Packages.virtualenv - # python3Packages.tkinter - # python3Packages.xlib - # python3Packages.pillow - # python3Packages.python-dotenv - # python3Packages.pyautogui - # python3Packages.aiohttp - # python3Packages.discordpy - # python3Packages.opencv4 - # stdenv.cc.cc.lib - # glib - # libglvnd + ]; - # environment.sessionVariables = rec { - # LD_LIBRARY_PATH = - # "${pkgs.lib.makeLibraryPath config.environment.systemPackages}:\ - # ${pkgs.stdenv.cc.cc.lib.outPath}/lib:$LD_LIBRARY_PATH"; - # }; - services.xserver.enable = true; networking.firewall.allowedTCPPorts = [ 6080 ]; diff --git a/modules/nixos/unfree/steam.nix b/modules/nixos/unfree/steam.nix index a588205..7a1fa3f 100644 --- a/modules/nixos/unfree/steam.nix +++ b/modules/nixos/unfree/steam.nix @@ -20,9 +20,5 @@ enable = true; remotePlay.openFirewall = true; }; - - services.flatpak.enable = true; - xdg.portal.enable = true; - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; }