refactor and modularize base.nix futher; use default.nix when possible
This commit is contained in:
13
configuration/base/default.nix
Normal file
13
configuration/base/default.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./fonts.nix
|
||||
./kde.nix
|
||||
./location-time.nix
|
||||
./networking.nix
|
||||
./nix-settings.nix
|
||||
./pipewire.nix
|
||||
./programs.nix
|
||||
];
|
||||
}
|
||||
14
configuration/base/location-time.nix
Normal file
14
configuration/base/location-time.nix
Normal file
@@ -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";
|
||||
};
|
||||
}
|
||||
26
configuration/base/networking.nix
Normal file
26
configuration/base/networking.nix
Normal file
@@ -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;
|
||||
}
|
||||
35
configuration/base/pipewire.nix
Normal file
35
configuration/base/pipewire.nix
Normal file
@@ -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"
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
37
configuration/base/programs.nix
Normal file
37
configuration/base/programs.nix
Normal file
@@ -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
|
||||
];
|
||||
}
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user