2023-06-21 20:03:51 +05:30
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
2024-01-19 03:06:52 +05:30
|
|
|
|
{ pkgs, lib, systemSettings, userSettings, ... }:
|
2023-06-21 20:03:51 +05:30
|
|
|
|
{
|
|
|
|
|
imports =
|
|
|
|
|
[ ../../system/hardware-configuration.nix
|
2023-11-12 21:40:37 +05:30
|
|
|
|
../../system/hardware/systemd.nix # systemd config
|
2023-08-12 00:57:02 +05:30
|
|
|
|
../../system/hardware/kernel.nix # Kernel config
|
|
|
|
|
../../system/hardware/power.nix # Power management
|
2023-12-24 19:07:12 +05:30
|
|
|
|
../../system/hardware/time.nix # Network time sync
|
2023-06-21 20:03:51 +05:30
|
|
|
|
../../system/hardware/opengl.nix
|
|
|
|
|
../../system/hardware/printing.nix
|
|
|
|
|
../../system/hardware/bluetooth.nix
|
2024-01-27 02:15:23 +05:30
|
|
|
|
(./. + "../../../system/wm"+("/"+userSettings.wm)+".nix") # My window manager
|
2024-03-16 21:26:48 +05:30
|
|
|
|
../../system/app/flatpak.nix
|
2023-10-29 07:13:37 +05:30
|
|
|
|
../../system/app/virtualization.nix
|
2024-01-19 03:06:52 +05:30
|
|
|
|
( import ../../system/app/docker.nix {storageDriver = "btrfs"; inherit userSettings lib;} )
|
2023-06-21 20:03:51 +05:30
|
|
|
|
../../system/security/doas.nix
|
|
|
|
|
../../system/security/gpg.nix
|
|
|
|
|
../../system/security/blocklist.nix
|
|
|
|
|
../../system/security/firewall.nix
|
2023-07-31 20:15:45 +05:30
|
|
|
|
../../system/security/firejail.nix
|
2023-06-21 20:03:51 +05:30
|
|
|
|
../../system/security/openvpn.nix
|
2024-01-14 07:59:22 +05:30
|
|
|
|
../../system/security/automount.nix
|
2023-06-21 20:03:51 +05:30
|
|
|
|
../../system/style/stylix.nix
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Fix nix path
|
|
|
|
|
nix.nixPath = [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
|
|
|
|
|
"nixos-config=$HOME/dotfiles/system/configuration.nix"
|
|
|
|
|
"/nix/var/nix/profiles/per-user/root/channels"
|
|
|
|
|
];
|
|
|
|
|
|
2023-10-30 03:02:06 +05:30
|
|
|
|
# Ensure nix flakes are enabled
|
|
|
|
|
nix.package = pkgs.nixFlakes;
|
|
|
|
|
nix.extraOptions = ''
|
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
|
'';
|
2023-06-21 20:03:51 +05:30
|
|
|
|
|
|
|
|
|
# I'm sorry Stallman-taichou
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
|
|
# Kernel modules
|
|
|
|
|
boot.kernelModules = [ "i2c-dev" "i2c-piix4" "cpufreq_powersave" ];
|
|
|
|
|
|
|
|
|
|
# Bootloader
|
2024-02-29 07:17:06 +05:30
|
|
|
|
# Use systemd-boot if uefi, default to grub otherwise
|
|
|
|
|
boot.loader.systemd-boot.enable = if (systemSettings.bootMode == "uefi") then true else false;
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = if (systemSettings.bootMode == "uefi") then true else false;
|
2024-03-01 08:18:15 +05:30
|
|
|
|
boot.loader.efi.efiSysMountPoint = systemSettings.bootMountPath; # does nothing if running bios rather than uefi
|
|
|
|
|
boot.loader.grub.enable = if (systemSettings.bootMode == "uefi") then false else true;
|
|
|
|
|
boot.loader.grub.device = systemSettings.grubDevice; # does nothing if running uefi rather than bios
|
2023-06-21 20:03:51 +05:30
|
|
|
|
|
|
|
|
|
# Networking
|
2024-01-19 03:06:52 +05:30
|
|
|
|
networking.hostName = systemSettings.hostname; # Define your hostname.
|
2023-06-21 20:03:51 +05:30
|
|
|
|
networking.networkmanager.enable = true; # Use networkmanager
|
|
|
|
|
|
|
|
|
|
# Timezone and locale
|
2024-01-19 03:06:52 +05:30
|
|
|
|
time.timeZone = systemSettings.timezone; # time zone
|
|
|
|
|
i18n.defaultLocale = systemSettings.locale;
|
2023-06-21 20:03:51 +05:30
|
|
|
|
i18n.extraLocaleSettings = {
|
2024-01-19 03:06:52 +05:30
|
|
|
|
LC_ADDRESS = systemSettings.locale;
|
|
|
|
|
LC_IDENTIFICATION = systemSettings.locale;
|
|
|
|
|
LC_MEASUREMENT = systemSettings.locale;
|
|
|
|
|
LC_MONETARY = systemSettings.locale;
|
|
|
|
|
LC_NAME = systemSettings.locale;
|
|
|
|
|
LC_NUMERIC = systemSettings.locale;
|
|
|
|
|
LC_PAPER = systemSettings.locale;
|
|
|
|
|
LC_TELEPHONE = systemSettings.locale;
|
|
|
|
|
LC_TIME = systemSettings.locale;
|
2023-06-21 20:03:51 +05:30
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# User account
|
2024-01-19 03:06:52 +05:30
|
|
|
|
users.users.${userSettings.username} = {
|
2023-06-21 20:03:51 +05:30
|
|
|
|
isNormalUser = true;
|
2024-01-19 03:06:52 +05:30
|
|
|
|
description = userSettings.name;
|
2023-06-21 20:03:51 +05:30
|
|
|
|
extraGroups = [ "networkmanager" "wheel" ];
|
2024-01-27 02:15:23 +05:30
|
|
|
|
packages = [];
|
2023-06-21 20:03:51 +05:30
|
|
|
|
uid = 1000;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# System packages
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
vim
|
|
|
|
|
wget
|
|
|
|
|
zsh
|
|
|
|
|
git
|
2023-07-14 23:47:10 +05:30
|
|
|
|
cryptsetup
|
2023-08-12 01:27:32 +05:30
|
|
|
|
home-manager
|
2023-06-21 20:03:51 +05:30
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# I use zsh btw
|
|
|
|
|
environment.shells = with pkgs; [ zsh ];
|
|
|
|
|
users.defaultUserShell = pkgs.zsh;
|
|
|
|
|
programs.zsh.enable = true;
|
|
|
|
|
|
2023-10-22 08:35:18 +05:30
|
|
|
|
fonts.fontDir.enable = true;
|
|
|
|
|
|
2023-08-12 01:27:32 +05:30
|
|
|
|
xdg.portal = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraPortals = [
|
|
|
|
|
pkgs.xdg-desktop-portal
|
|
|
|
|
pkgs.xdg-desktop-portal-gtk
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-21 20:03:51 +05:30
|
|
|
|
# It is ok to leave this unchanged for compatibility purposes
|
|
|
|
|
system.stateVersion = "22.11";
|
|
|
|
|
|
|
|
|
|
}
|