diff --git a/configuration/base/default.nix b/configuration/base/default.nix new file mode 100644 index 0000000..a86057f --- /dev/null +++ b/configuration/base/default.nix @@ -0,0 +1,13 @@ +{ ... }: + +{ + imports = [ + ./fonts.nix + ./kde.nix + ./location-time.nix + ./networking.nix + ./nix-settings.nix + ./pipewire.nix + ./programs.nix + ]; +} diff --git a/configuration/base/location-time.nix b/configuration/base/location-time.nix new file mode 100644 index 0000000..1fa22cf --- /dev/null +++ b/configuration/base/location-time.nix @@ -0,0 +1,14 @@ +{ ... }: + +{ + # Set your time zone. + # time.timeZone = "Europe/London"; + services.automatic-timezoned.enable = true; + services.chrony = { + enable = true; + }; + services.geoclue2 = { + enable = true; + geoProviderUrl = "https://api.beacondb.net/v1/geolocate"; + }; +} diff --git a/configuration/base/networking.nix b/configuration/base/networking.nix new file mode 100644 index 0000000..5afe702 --- /dev/null +++ b/configuration/base/networking.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: + +{ + # networking.hostName = "nixos"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager = { + # Easiest to use and most distros use this by default. + enable = true; + wifi.powersave = false; + }; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + services.mullvad-vpn = { + enable = true; + package = pkgs.mullvad-vpn; + }; + + # services.resolved.enable = true; +} diff --git a/configuration/base/pipewire.nix b/configuration/base/pipewire.nix new file mode 100644 index 0000000..ed0f3bf --- /dev/null +++ b/configuration/base/pipewire.nix @@ -0,0 +1,35 @@ +{ ... }: + +{ + # Enable sound. + # hardware.pulseaudio.enable = true; + # OR + services.pipewire = { + enable = true; + pulse.enable = true; + extraConfig.pipewire-pulse = { + "10-prevent-agc" = { + "pulse.rules" = [ + { + matches = [ + { "application.process.binary" = "chrome"; } + { "application.process.binary" = "Discord"; } + { "application.process.binary" = "teams"; } + { "application.process.binary" = "electron"; } + { "application.process.binary" = "skypeforlinux"; } + { "application.process.binary" = "telegram-desktop"; } + { "application.process.binary" = "vivaldi"; } + { "application.process.binary" = "chromium"; } + { "application.process.binary" = "zoom"; } + ]; + actions = { + quirks = [ + "block-source-volume" + ]; + }; + } + ]; + }; + }; + }; +} diff --git a/configuration/base/programs.nix b/configuration/base/programs.nix new file mode 100644 index 0000000..b76d6a3 --- /dev/null +++ b/configuration/base/programs.nix @@ -0,0 +1,37 @@ +{ pkgs, ... }: + +{ + security.sudo-rs.enable = true; + services.fwupd.enable = true; + services.flatpak.enable = true; + programs.bash.blesh.enable = true; + programs.fish.enable = true; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; + [ + # utils + uutils-coreutils-noprefix + vim + curl + inetutils + dig + + rar + zstd + xz + p7zip + + libva-utils + smartmontools + appimage-run + + # dicts + nuspell + hunspellDicts.en-gb-large + + # For cursor in steam? + xsettingsd + xorg.xrdb + ]; +} diff --git a/configuration/base.nix b/configuration/default.nix similarity index 50% rename from configuration/base.nix rename to configuration/default.nix index 38e8f2d..0c04f4a 100644 --- a/configuration/base.nix +++ b/configuration/default.nix @@ -5,130 +5,24 @@ { pkgs, ... }: { - imports = - [ - ./base/nix-settings.nix - ./base/fonts.nix - ./base/kde.nix - ]; + imports = [ ./base ]; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.kernelPackages = pkgs.linuxPackages_latest; + hardware.bluetooth.enable = true; + hardware.enableRedistributableFirmware = true; + hardware.enableAllFirmware = true; + + # Disks / Swap / etc # swapDevices = [{ # device = "/var/lib/swapfile"; # size = 16 * 1024; # 16 GB # }]; zramSwap.enable = true; # Creates a zram block device and uses it as a swap device - - hardware.bluetooth.enable = true; - hardware.enableRedistributableFirmware = true; - hardware.enableAllFirmware = true; - - security.sudo-rs.enable = true; - - # networking.hostName = "nixos"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager = { - # Easiest to use and most distros use this by default. - enable = true; - wifi.powersave = false; - }; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable sound. - # hardware.pulseaudio.enable = true; - # OR - services.pipewire = { - enable = true; - pulse.enable = true; - extraConfig.pipewire-pulse = { - "10-prevent-agc" = { - "pulse.rules" = [ - { - matches = [ - { "application.process.binary" = "chrome"; } - { "application.process.binary" = "Discord"; } - { "application.process.binary" = "teams"; } - { "application.process.binary" = "electron"; } - { "application.process.binary" = "skypeforlinux"; } - { "application.process.binary" = "telegram-desktop"; } - { "application.process.binary" = "vivaldi"; } - { "application.process.binary" = "chromium"; } - { "application.process.binary" = "zoom"; } - ]; - actions = { - quirks = [ - "block-source-volume" - ]; - }; - } - ]; - }; - }; - }; - services.fstrim.enable = true; - # services.resolved.enable = true; - services.mullvad-vpn = { - enable = true; - package = pkgs.mullvad-vpn; - }; - - # Set your time zone. - # time.timeZone = "Europe/London"; - services.automatic-timezoned.enable = true; - services.chrony = { - enable = true; - }; - - services.fwupd.enable = true; - services.geoclue2 = { - enable = true; - geoProviderUrl = "https://api.beacondb.net/v1/geolocate"; - }; - services.flatpak.enable = true; - - programs.bash.blesh.enable = true; - programs.fish.enable = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; - [ - # utils - uutils-coreutils-noprefix - vim - curl - inetutils - dig - - rar - zstd - xz - p7zip - - libva-utils - smartmontools - appimage-run - - # dicts - nuspell - hunspellDicts.en-gb-large - - # For cursor in steam? - xsettingsd - xorg.xrdb - ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. diff --git a/devices/deck/home.nix b/devices/deck/home.nix index e6403b8..737b848 100644 --- a/devices/deck/home.nix +++ b/devices/deck/home.nix @@ -5,7 +5,7 @@ let in { imports = [ - ../../home-manager/base.nix + ../../home-manager ../../home-manager/gaming.nix ../../home-manager/development/vscode.nix ]; diff --git a/devices/starlite/configuration.nix b/devices/starlite/configuration.nix index 1c1dc7e..e3deaa3 100644 --- a/devices/starlite/configuration.nix +++ b/devices/starlite/configuration.nix @@ -7,7 +7,7 @@ { imports = [ - ../../configuration/base.nix + ../../configuration # Include the results of the hardware scan. ./hardware-configuration.nix inputs.disko.nixosModules.default diff --git a/devices/starlite/home.nix b/devices/starlite/home.nix index b90ffe5..583561a 100644 --- a/devices/starlite/home.nix +++ b/devices/starlite/home.nix @@ -2,7 +2,7 @@ { imports = [ - ../../home-manager/base.nix + ../../home-manager ../../home-manager/development/vscode.nix ]; diff --git a/devices/tuxedo/configuration.nix b/devices/tuxedo/configuration.nix index 45168e0..e018bad 100644 --- a/devices/tuxedo/configuration.nix +++ b/devices/tuxedo/configuration.nix @@ -7,7 +7,7 @@ { imports = [ - ../../configuration/base.nix + ../../configuration # Include the results of the hardware scan. ./hardware-configuration.nix inputs.disko.nixosModules.default diff --git a/devices/tuxedo/home.nix b/devices/tuxedo/home.nix index e30e258..c3c0fc5 100644 --- a/devices/tuxedo/home.nix +++ b/devices/tuxedo/home.nix @@ -2,8 +2,8 @@ { imports = [ - ../../home-manager/base.nix - ../../home-manager/development/all.nix + ../../home-manager + ../../home-manager/development ../../home-manager/gaming.nix ../../home-manager/streamlink.nix ]; @@ -79,7 +79,7 @@ gpu-api = "auto"; gpu-context = "auto"; hwdec = "auto"; - # screenshot-directory = "/mnt/HDD2/Pictures/"; + screenshot-directory = "/mnt/HDD2/Pictures/"; glsl-shaders = "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"; }; extraInput = '' diff --git a/home-manager/base/default.nix b/home-manager/base/default.nix new file mode 100644 index 0000000..56ecafd --- /dev/null +++ b/home-manager/base/default.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + imports = [ + ./fonts.nix + ./mpv.nix + ./terminal.nix + ]; +} diff --git a/home-manager/base.nix b/home-manager/default.nix similarity index 91% rename from home-manager/base.nix rename to home-manager/default.nix index b5c7183..36b79e8 100644 --- a/home-manager/base.nix +++ b/home-manager/default.nix @@ -2,10 +2,8 @@ { imports = [ - ./base/fonts.nix - ./base/terminal.nix - ./base/mpv.nix - ./firefox/firefox.nix + ./base + ./firefox ]; home.packages = with pkgs;[ diff --git a/home-manager/development/all.nix b/home-manager/development/default.nix similarity index 100% rename from home-manager/development/all.nix rename to home-manager/development/default.nix index 7a20034..0796580 100644 --- a/home-manager/development/all.nix +++ b/home-manager/development/default.nix @@ -2,10 +2,10 @@ { imports = [ - ./vscode.nix - ./helix.nix ./dotnet.nix - ./sql.nix ./games.nix + ./helix.nix + ./sql.nix + ./vscode.nix ]; } diff --git a/home-manager/firefox/firefox.nix b/home-manager/firefox/default.nix similarity index 100% rename from home-manager/firefox/firefox.nix rename to home-manager/firefox/default.nix