From 1c5651bb838dea5a298fbeb050292bce4d351121 Mon Sep 17 00:00:00 2001 From: Jimbo Date: Tue, 27 Aug 2024 14:23:50 -0400 Subject: [PATCH] :3 --- configuration.nix | 101 +++++++++++++++++----------------------------- freecorn.nix | 38 +++++++++++++++++ 2 files changed, 74 insertions(+), 65 deletions(-) create mode 100644 freecorn.nix diff --git a/configuration.nix b/configuration.nix index ed1d934..ac7298f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -11,12 +11,15 @@ in { imports = [ ./hardware-configuration.nix + ./freecorn.nix "${homeManager}/nixos" ]; # Bootloader. - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; + boot.loader.grub = { + enable = true; + device = "/dev/sda"; + }; # Hostname networking.hostName = "freecornserver"; @@ -37,26 +40,17 @@ in services.xserver.enable = true; # Printer Stuff (FUCK HP!) -# services.printing.enable = true; - services.printing.drivers = [ pkgs.hplip ]; - hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ]; - - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - publish = { + services = { + printing = { enable = true; - userServices = true; + drivers = [ pkgs.hplip ]; + webInterface = false; + }; + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; }; - }; - - services.printing = { - listenAddresses = [ "*:631" ]; - allowFrom = [ "all" ]; - browsing = true; - defaultShared = true; - openFirewall = true; }; # Enable the LXQT Desktop Environment. @@ -69,10 +63,6 @@ in xkb.variant = ""; }; - # Enable CUPS to print documents. - services.printing.enable = true; - hardware.sane.enable = true; - # Enable sound with pipewire. hardware.pulseaudio.enable = false; security.rtkit.enable = true; @@ -84,11 +74,6 @@ in }; # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.freecorn = { - description = "FreeCorn"; - isNormalUser = true; - extraGroups = [ "networkmanager" "wheel" "video" "scanner" "lp" "plugdev" ]; - }; users.users.nextcloud = { extraGroups = [ "nfsShare" ]; isSystemUser = true; @@ -106,33 +91,14 @@ in boot.kernelParams = [ "modprobe.blacklist=dvb_usb_rtl28xxu" ]; # blacklist dunb driver # OpenWebRX - # services.openwebrx.enable = true; +# services.openwebrx.enable = true; # Enable automatic login for the user. - services.displayManager.autoLogin.enable = true; - services.displayManager.autoLogin.user = "freecorn"; - services.xserver.videoDrivers = [ "radeon" ]; - - # Define home manager programs and configs - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.freecorn = { config, pkgs, ... }: { - # Install user programs - home.packages = (with pkgs; [ - rustdesk-flutter anydesk vlc - ]); - - # OBS with plugins - programs.obs-studio = { - enable = true; - plugins = with pkgs.obs-studio-plugins; [ - advanced-scene-switcher obs-multi-rtmp - ]; - }; - - # Don't change this - home.stateVersion = "24.05"; + services = { + xserver.videoDrivers = [ "radeon" ]; + displayManager.autoLogin = { + enable = true; + user = "freecorn"; }; }; @@ -173,7 +139,7 @@ in }; # Nextcloud Proxy - "cloud.${cornDomain}" = { + "cloud.${secrets.cornDomain}" = { enableACME = true; addSSL = true; locations."/" = { @@ -234,12 +200,18 @@ in # Allow unfree packages nixpkgs.config.allowUnfree = true; - # Enable Adguard - # services.adguardhome.enable = true; - # Packages installed in system profile environment.systemPackages = with pkgs; [ - wget x11vnc fastfetch ffmpeg system-config-printer libcaption git rtl-sdr steam-run openwebrx + wget + x11vnc + fastfetch + ffmpeg + system-config-printer + libcaption + git + rtl-sdr + steam-run + openwebrx ]; # Install fonts, need this for orbitron! @@ -250,18 +222,17 @@ in # Enable the OpenSSH daemon. services.openssh = { enable = true; -# settings = { -# PermitRootLogin = "no"; -# PrintLastLog = "no"; + settings = { + PermitRootLogin = "no"; + PrintLastLog = "no"; # PasswordAuthentication = false; -# }; + }; # ports = [ 69 ]; }; # Open ports in the firewall. - # Adguard ports: 3000 on tcp, 53 on udp networking.firewall.allowedTCPPorts = [ 1935 4455 80 443 1234 ]; - networking.firewall.allowedUDPPorts = [ 1935 4455 80 443 ]; + networking.firewall.allowedUDPPorts = [ 4455 ]; # Copy and link the NixOS configuration file to (/run/current-system/configuration.nix). system.copySystemConfiguration = true; diff --git a/freecorn.nix b/freecorn.nix new file mode 100644 index 0000000..906d1d5 --- /dev/null +++ b/freecorn.nix @@ -0,0 +1,38 @@ +{ + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.freecorn = { + description = "FreeCorn"; + isNormalUser = true; + extraGroups = [ + "networkmanager" + "wheel" + "video" + "scanner" + "lp" + "plugdev" + ]; + }; + + # Define home manager programs and configs + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.freecorn = { config, pkgs, ... }: { + # Install user programs + home.packages = (with pkgs; [ + rustdesk-flutter anydesk vlc + ]); + + # OBS with plugins + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + advanced-scene-switcher obs-multi-rtmp + ]; + }; + + # Don't change this + home.stateVersion = "24.05"; + }; + }; +}