diff --git a/hosts/common/configs/bluetooth/default.nix b/hosts/common/configs/bluetooth/default.nix new file mode 100644 index 0000000..58abd90 --- /dev/null +++ b/hosts/common/configs/bluetooth/default.nix @@ -0,0 +1,9 @@ +{ + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General.Experimental = true; + }; + }; +} diff --git a/hosts/common/configs/boot/default.nix b/hosts/common/configs/boot/default.nix new file mode 100644 index 0000000..eb52361 --- /dev/null +++ b/hosts/common/configs/boot/default.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: + +{ + boot = { + loader = { + systemd-boot = { + enable = true; + editor = false; + }; + + timeout = 1; + efi.canTouchEfiVariables = true; + }; + + initrd.systemd.enable = true; + kernelPackages = pkgs.linuxPackages_latest; + supportedFilesystems = [ "btrfs" "ntfs" ]; + }; +} diff --git a/hosts/common/configs/networkmanager/default.nix b/hosts/common/configs/networking/default.nix similarity index 100% rename from hosts/common/configs/networkmanager/default.nix rename to hosts/common/configs/networking/default.nix diff --git a/hosts/common/configs/nix/default.nix b/hosts/common/configs/nix/default.nix new file mode 100644 index 0000000..7539f69 --- /dev/null +++ b/hosts/common/configs/nix/default.nix @@ -0,0 +1,13 @@ +{ + nix = { + settings = { + use-xdg-base-directories = true; + experimental-features = [ "nix-command" "flakes" ]; + }; + + gc.automatic = true; + optimise.automatic = true; + }; + + nixpkgs.config.allowUnfree = true; +} diff --git a/hosts/common/configs/pipewire/default.nix b/hosts/common/configs/pipewire/default.nix index b1e508d..e455363 100644 --- a/hosts/common/configs/pipewire/default.nix +++ b/hosts/common/configs/pipewire/default.nix @@ -7,5 +7,11 @@ }; pulse.enable = true; jack.enable = true; + extraConfig.pipewire-pulse = { + pulse.cmd = [{ + cmd = "load-module"; + args = "module-switch-on-connect"; + }]; + }; }; } diff --git a/hosts/common/configs/system/default.nix b/hosts/common/configs/system/default.nix new file mode 100644 index 0000000..fb972b9 --- /dev/null +++ b/hosts/common/configs/system/default.nix @@ -0,0 +1,18 @@ +{ inputs, ... }: + +{ + system = { + autoUpgrade = { + enable = true; + flake = inputs.self.outPath; + flags = [ + "--update-input" + "nixpkgs" + "-L" + ]; + dates = "02:00"; + }; + + stateVersion = "24.05"; + }; +} diff --git a/hosts/common/configs/users/default.nix b/hosts/common/configs/users/default.nix new file mode 100644 index 0000000..8f2fbbb --- /dev/null +++ b/hosts/common/configs/users/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + +{ + users = { + mutableUsers = false; + defaultUserShell = pkgs.zsh; + }; + + security.sudo.extraConfig = '' + Defaults lecture = never + ''; +} diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 8b0e937..1270a24 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,12 +1,15 @@ -{ inputs, pkgs, ... }: - { imports = [ + ./configs/boot + ./configs/system + ./configs/nix ./configs/persist ./configs/sops + ./configs/users ./configs/getty ./configs/plymouth - ./configs/networkmanager + ./configs/networking + ./configs/bluetooth ./configs/brightnessctl ./configs/pipewire ./configs/zsh @@ -23,58 +26,5 @@ ./scripts/cleanup ]; - boot = { - loader = { - systemd-boot = { - enable = true; - editor = false; - }; - - timeout = 1; - efi.canTouchEfiVariables = true; - }; - - initrd.systemd.enable = true; - kernelPackages = pkgs.linuxPackages_latest; - supportedFilesystems = [ "btrfs" "ntfs" ]; - }; - - hardware.graphics.enable32Bit = true; i18n.defaultLocale = "en_US.UTF-8"; - - users = { - mutableUsers = false; - defaultUserShell = pkgs.zsh; - }; - - security.sudo.extraConfig = '' - Defaults lecture = never - ''; - - system = { - autoUpgrade = { - enable = true; - flake = inputs.self.outPath; - flags = [ - "--update-input" - "nixpkgs" - "-L" - ]; - dates = "02:00"; - }; - - stateVersion = "24.05"; - }; - - nix = { - settings = { - use-xdg-base-directories = true; - experimental-features = [ "nix-command" "flakes" ]; - }; - - gc.automatic = true; - optimise.automatic = true; - }; - - nixpkgs.config.allowUnfree = true; } diff --git a/hosts/eirene/base/default.nix b/hosts/eirene/base/default.nix index d29c206..7d28f79 100644 --- a/hosts/eirene/base/default.nix +++ b/hosts/eirene/base/default.nix @@ -29,12 +29,17 @@ }; }; - graphics.extraPackages = with pkgs; [ - amdvlk - driversi686Linux.amdvlk - rocmPackages.clr - rocmPackages.clr.icd - ]; + graphics = { + enable32Bit = true; + extraPackages = with pkgs; [ + amdvlk + driversi686Linux.amdvlk + rocmPackages.clr + rocmPackages.clr.icd + ]; + }; + + enableAllFirmware = true; }; services = { diff --git a/hosts/eirene/base/hardware-configuration.nix b/hosts/eirene/base/hardware-configuration.nix index f25d193..59f493c 100644 --- a/hosts/eirene/base/hardware-configuration.nix +++ b/hosts/eirene/base/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, modulesPath, ... }: +{ lib, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -8,7 +8,5 @@ kernelModules = [ "kvm-amd" ]; }; - networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/eirene/default.nix b/hosts/eirene/default.nix index fd346d3..3c50505 100644 --- a/hosts/eirene/default.nix +++ b/hosts/eirene/default.nix @@ -1,11 +1,8 @@ -{ config, ... }: - { imports = [ ../common - ../../users/nick + (import ../../users/nick { autologin = true; }) ]; time.timeZone = "Europe/Athens"; - services.getty.autologinUser = config.users.users.nick.name; } diff --git a/hosts/eirene/vm/hardware-configuration.nix b/hosts/eirene/vm/hardware-configuration.nix index 0709eb7..76e285f 100644 --- a/hosts/eirene/vm/hardware-configuration.nix +++ b/hosts/eirene/vm/hardware-configuration.nix @@ -8,6 +8,5 @@ kernelModules = [ "kvm-amd" ]; }; - networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/users/configs/blueman/default.nix b/users/configs/blueman/default.nix new file mode 100644 index 0000000..6559797 --- /dev/null +++ b/users/configs/blueman/default.nix @@ -0,0 +1,20 @@ +{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: + +{ + services.blueman.enable = true; + + home-manager.users.${user.name} = { + services.blueman-applet.enable = true; + + systemd.user.services.mpris-proxy = { + Unit = { + Description = "MPRIS proxy"; + Requires = [ "sound.target" ]; + After = [ "network.target" "sound.target" ]; + }; + + Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; + Intall.WantedBy = [ "default.target" ]; + }; + }; +} diff --git a/users/configs/networkmanager/default.nix b/users/configs/networkmanager/default.nix new file mode 100644 index 0000000..e8190b2 --- /dev/null +++ b/users/configs/networkmanager/default.nix @@ -0,0 +1,5 @@ +{ user ? throw "user argument is required" }: { ... }: + +{ + home-manager.users.${user.name}.services.network-manager-applet.enable = true; +} diff --git a/users/nick/default.nix b/users/nick/default.nix index d82357d..990363e 100644 --- a/users/nick/default.nix +++ b/users/nick/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ autologin ? false}: { config, lib, ... }: let user = config.users.users.nick; @@ -14,6 +14,8 @@ in (import ../configs/cliphist { inherit user; }) (import ../configs/ags { inherit user; }) (import ../configs/wev { inherit user; }) + (import ../configs/networkmanager { inherit user; }) + (import ../configs/blueman { inherit user; }) (import ../configs/brightnessctl { inherit user; }) (import ../configs/pavucontrol { inherit user; }) (import ../configs/pipewire { inherit user; }) @@ -28,6 +30,8 @@ in ]; home-manager.users.nick = { - theme.wallpaper = ./wallpapers/cats.jpg; + theme.wallpaper = ./wallpapers/clouds.png; }; + + services.getty.autologinUser = lib.mkIf autologin user.name; }