From 1c3255f268c18e7604e9fd5ba609d5d977bd064b Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Mon, 25 Dec 2023 18:38:17 -0800 Subject: [PATCH] cleaned up the configuration --- flake.nix | 9 +--- hosts/Alaska/default.nix | 2 +- hosts/configuration.nix | 101 +++++++++++++++++++++----------------- hosts/desktop/default.nix | 6 --- hosts/laptop/default.nix | 9 +--- 5 files changed, 62 insertions(+), 65 deletions(-) diff --git a/flake.nix b/flake.nix index ee1539e..22916e3 100644 --- a/flake.nix +++ b/flake.nix @@ -29,8 +29,6 @@ url = github:nix-community/home-manager; inputs.nixpkgs.follows = "nixpkgs"; }; - - }; outputs = inputs@{ @@ -55,23 +53,20 @@ lib = nixpkgs.lib; in { nixosConfigurations = { - inherit lib; - # Home server Alaska = lib.nixosSystem { inherit system; specialArgs = { - inherit user headscale pkgs-stable; + inherit user headscale; }; modules = [ - inputs.nicks_nextcloud_integrations.nixosModules.default { networking.hostName = "Alaska"; } + inputs.nicks_nextcloud_integrations.nixosModules.default ./hosts/Alaska - ./hosts/Alaska/configuration.nix home-manager.nixosModules.home-manager { home-manager = { useGlobalPkgs = true; diff --git a/hosts/Alaska/default.nix b/hosts/Alaska/default.nix index 3b47d32..ec3ab5b 100644 --- a/hosts/Alaska/default.nix +++ b/hosts/Alaska/default.nix @@ -5,7 +5,7 @@ { imports = [ ./modules/backup_script.nix - + ./configuration.nix ./hardware-configuration.nix ./modules/dnsmasq.nix ./modules/forgejo.nix diff --git a/hosts/configuration.nix b/hosts/configuration.nix index 066ac5b..0c465db 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -5,23 +5,6 @@ { config, lib, pkgs, user, inputs, ... }: { - - # max cores used per derivation - nix.settings.cores = 8; - # max derivations that can be built at once - # nix.settings.max-jobs = 2; - - networking.networkmanager.enable = true; - - security.pam.services.kwallet = { - name = "kdewallet"; - enableKwallet = true; - }; - - services.udev.packages = [ - pkgs.android-udev-rules - ]; - # Some programs look for session variables to store config files at # (Looking at you home-manager yazi) environment.sessionVariables = rec { @@ -59,20 +42,20 @@ }; }; - boot.supportedFilesystems = [ "nfts" ]; - boot.loader.systemd-boot.configurationLimit = 5; - - nix.settings.auto-optimise-store = true; - nixpkgs.config.allowUnfree = true; # required for discord - nix.gc = { - automatic = true; - options = "--delete-generations 8d"; - }; - + # Android Debugging interface + programs.adb.enable = true; + services.udev.packages = [ + pkgs.android-udev-rules + ]; programs.zsh.enable = true; users.users.${user} = { isNormalUser = true; - extraGroups = [ "wheel" "video" "audio" "networkmanager" "lp" "scanner" "input" "uinput" "cdrom"]; + extraGroups = [ + "wheel" "video" + "audio" "networkmanager" + "lp" "scanner" + "input" "uinput" + "cdrom" "adbusers"]; shell = pkgs.zsh; password = "password"; }; @@ -83,37 +66,67 @@ xkcd-font ]; - time.timeZone = "America/Los_Angeles"; - - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - useXkbConfig = true; # use xkbOptions in tty. + boot = { + supportedFilesystems = [ "nfts" ]; + loader.systemd-boot.configurationLimit = 5; }; + + networking.networkmanager.enable = true; + hardware = { + bluetooth.enable = true; opentabletdriver.enable = true; steam-hardware.enable = true; }; + security = { + rtkit.enable = true; + pam.services.kwallet = { + name = "kdewallet"; + enableKwallet = true; + }; + }; + + services = { + # Enable CUPS to print documents. + printing.enable = true; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + #jack.enable = true; + }; + }; + sound = { enable = false; mediaKeys.enable = true; }; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - #jack.enable = true; + time.timeZone = "America/Los_Angeles"; + time.hardwareClockInLocalTime = true; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + useXkbConfig = true; # use xkbOptions in tty. }; - # Enable CUPS to print documents. - services.printing.enable = true; - + nixpkgs.config.allowUnfree = true; nix = { + gc = { + automatic = true; + options = "--delete-generations 20d"; + }; + settings = { + auto-optimise-store = true; + # max cores used per derivation + cores = 8; + # max derivations that can be built at once + # nix.settings.max-jobs = 2; + }; package = pkgs.nixVersions.stable; extraOptions = "experimental-features = nix-command flakes"; }; diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index e82ba65..cf7a6e3 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -7,9 +7,6 @@ ./hardware-configuration.nix ]; - programs.adb.enable = true; - users.users.${user}.extraGroups = [ "adbusers" ]; - networking = { firewall = { checkReversePath = "loose"; @@ -58,7 +55,6 @@ QT_QPA_PLATFORM = "xcb"; }; - time.hardwareClockInLocalTime = true; boot.loader = { efi = { @@ -85,6 +81,4 @@ ''; }; }; - - boot.supportedFilesystems = [ "ntfs" ]; } diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 3012887..63f886e 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -6,21 +6,16 @@ ./hardware-configuration.nix ]; - programs.adb.enable = true; - users.users.${user}.extraGroups = [ "adbusers" ]; - - hardware.bluetooth.enable = true; - networking.hosts = { "100.64.0.1" = ["files.nickiel.net" "git.nickiel.net" "nickiel.net" "jellyfin.nickiel.net" ]; }; # tailscale set --exit-node to route through an exit node - services.tailscale.enable = true; networking.firewall = { + services.tailscale.enable = true; + networking.firewall = { checkReversePath = "loose"; trustedInterfaces = [ "tailscale0" ]; allowedUDPPorts = [ config.services.tailscale.port ]; }; - time.hardwareClockInLocalTime = true; boot.loader = { efi = { canTouchEfiVariables = true; efiSysMountPoint = "/boot";