mirror of
https://git.adityakumar.xyz/nix-conf.git
synced 2024-11-21 19:52:52 +00:00
formatter
This commit is contained in:
parent
0db029b748
commit
24ae1a8ace
1 changed files with 59 additions and 56 deletions
|
@ -2,48 +2,51 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
# flake-overlays:
|
# flake-overlays:
|
||||||
|
|
||||||
{ config, pkgs, lib, inputs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
config,
|
||||||
[ # Include the results of the hardware scan.
|
pkgs,
|
||||||
|
lib,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
inputs.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable Bluetooth
|
# Enable Bluetooth
|
||||||
hardware.bluetooth = {
|
hardware.bluetooth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
General = {
|
General = {
|
||||||
Experimental = "true";
|
Experimental = "true";
|
||||||
Enable = "Source,Sink,Media,Socket";
|
Enable = "Source,Sink,Media,Socket";
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Allow non-free firmware
|
# Allow non-free firmware
|
||||||
hardware.firmware = with pkgs; [ firmwareLinuxNonfree ];
|
hardware.firmware = with pkgs; [firmwareLinuxNonfree];
|
||||||
|
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [ vaapiIntel vaapiVdpau libvdpau-va-gl intel-media-driver ];
|
extraPackages = with pkgs; [vaapiIntel vaapiVdpau libvdpau-va-gl intel-media-driver];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
boot.loader.efi.efiSysMountPoint = "/boot";
|
boot.loader.efi.efiSysMountPoint = "/boot";
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
boot.supportedFilesystems = ["ntfs"];
|
||||||
|
|
||||||
# Kernel modules
|
# Kernel modules
|
||||||
boot.kernelModules = [ "kvm-intel" "snd-hda-intel" "i8042" "nf_nat_ftp" ];
|
boot.kernelModules = ["kvm-intel" "snd-hda-intel" "i8042" "nf_nat_ftp"];
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
options snd-hda-intel model=alc255-acer,dell-headset-multi
|
options snd-hda-intel model=alc255-acer,dell-headset-multi
|
||||||
options i8042 nopnp=1
|
options i8042 nopnp=1
|
||||||
'';
|
'';
|
||||||
boot.kernelParams = [ "allow-discards" ];
|
boot.kernelParams = ["allow-discards"];
|
||||||
|
|
||||||
boot.kernel.sysctl = {
|
boot.kernel.sysctl = {
|
||||||
"net.ipv4.conf.all.forwarding" = true;
|
"net.ipv4.conf.all.forwarding" = true;
|
||||||
|
@ -55,7 +58,7 @@
|
||||||
# "/crypto_keyfile.bin" = null;
|
# "/crypto_keyfile.bin" = null;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
|
fileSystems."/".options = ["noatime" "nodiratime" "discard"];
|
||||||
# Enable swap on luks
|
# Enable swap on luks
|
||||||
boot.initrd.luks.devices."luks-3b571a97-616b-4dd7-9abb-d1e0491d178a".device = "/dev/disk/by-uuid/3b571a97-616b-4dd7-9abb-d1e0491d178a";
|
boot.initrd.luks.devices."luks-3b571a97-616b-4dd7-9abb-d1e0491d178a".device = "/dev/disk/by-uuid/3b571a97-616b-4dd7-9abb-d1e0491d178a";
|
||||||
# boot.initrd.luks.devices."luks-c0ef1093-a74e-4491-8c73-0009d3377c19".keyFile = "/crypto_keyfile.bin";
|
# boot.initrd.luks.devices."luks-c0ef1093-a74e-4491-8c73-0009d3377c19".keyFile = "/crypto_keyfile.bin";
|
||||||
|
@ -75,12 +78,12 @@
|
||||||
# Enable networking
|
# Enable networking
|
||||||
networking.networkmanager = {
|
networking.networkmanager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
unmanaged = [ "virbr0" "docker0" ];
|
unmanaged = ["virbr0" "docker0"];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.nftables.enable = true;
|
networking.nftables.enable = true;
|
||||||
|
|
||||||
networking.firewall.trustedInterfaces = [ "incusbr0" ];
|
networking.firewall.trustedInterfaces = ["incusbr0"];
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Asia/Kolkata";
|
time.timeZone = "Asia/Kolkata";
|
||||||
|
@ -128,22 +131,22 @@
|
||||||
xwayland.enable = true;
|
xwayland.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Change DNS
|
# Change DNS
|
||||||
networking = {
|
networking = {
|
||||||
extraHosts = ''
|
extraHosts = ''
|
||||||
185.199.108.133 raw.githubusercontent.com
|
185.199.108.133 raw.githubusercontent.com
|
||||||
'';
|
'';
|
||||||
nameservers = [ "1.1.1.1" "9.9.9.9" ];
|
nameservers = ["1.1.1.1" "9.9.9.9"];
|
||||||
bridges = { incusbr0.interfaces = []; };
|
bridges = {incusbr0.interfaces = [];};
|
||||||
# firewall.extraCommands = ''
|
# firewall.extraCommands = ''
|
||||||
# iptables -A INPUT incusbr0 -j ACCEPT
|
# iptables -A INPUT incusbr0 -j ACCEPT
|
||||||
# iptables -A FORWARD -o incusbr0 -j ACCEPT
|
# iptables -A FORWARD -o incusbr0 -j ACCEPT
|
||||||
# iptables -A FORWARD -i incusbr0 -j ACCEPT
|
# iptables -A FORWARD -i incusbr0 -j ACCEPT
|
||||||
# iptables -A OUTPUT -o incusbr0 -j ACCEPT
|
# iptables -A OUTPUT -o incusbr0 -j ACCEPT
|
||||||
# '';
|
# '';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable dde
|
# Enable dde
|
||||||
# services.xserver.desktopManager.deepin.enable = true;
|
# services.xserver.desktopManager.deepin.enable = true;
|
||||||
# services.deepin = {
|
# services.deepin = {
|
||||||
# dde-daemon.enable = true;
|
# dde-daemon.enable = true;
|
||||||
|
@ -162,7 +165,7 @@ networking = {
|
||||||
|
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
#extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
|
@ -188,14 +191,14 @@ networking = {
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
nix.settings.trusted-users = [ "root" "user" ];
|
nix.settings.trusted-users = ["root" "user"];
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
users.users.user = {
|
users.users.user = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "user";
|
description = "user";
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
extraGroups = [ "networkmanager" "wheel" "libvirtd" "qemu" "qemu-kvm" "vo" "docker" "lxc" "incus-admin" ];
|
extraGroups = ["networkmanager" "wheel" "libvirtd" "qemu" "qemu-kvm" "vo" "docker" "lxc" "incus-admin"];
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
kate
|
kate
|
||||||
vim
|
vim
|
||||||
|
@ -209,7 +212,7 @@ networking = {
|
||||||
dnsmasq
|
dnsmasq
|
||||||
networkmanagerapplet
|
networkmanagerapplet
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.root = {
|
users.users.root = {
|
||||||
subUidRanges = [
|
subUidRanges = [
|
||||||
|
@ -225,21 +228,21 @@ networking = {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = {inherit inputs;};
|
||||||
users = {
|
users = {
|
||||||
"user" = import ./home.nix;
|
"user" = import ./home.nix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
homeBinInPath = true; # Include ~/bin/ in $PATH
|
homeBinInPath = true; # Include ~/bin/ in $PATH
|
||||||
localBinInPath = true; # Include ~/.local/bin in $PATH
|
localBinInPath = true; # Include ~/.local/bin in $PATH
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
# tell electron apps to use wayland
|
# tell electron apps to use wayland
|
||||||
NIXOS_OZONW_WL = "1";
|
NIXOS_OZONW_WL = "1";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
|
@ -254,9 +257,9 @@ networking = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
|
|
||||||
packageOverrides = pkgs: {
|
packageOverrides = pkgs: {
|
||||||
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
# List packages installed in system profile. To search, run:
|
||||||
# $ nix search wget
|
# $ nix search wget
|
||||||
|
@ -284,10 +287,11 @@ networking = {
|
||||||
|
|
||||||
kdePackages.ksystemstats
|
kdePackages.ksystemstats
|
||||||
|
|
||||||
(waybar.overrideAttrs (oldAttrs: {
|
(
|
||||||
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
|
waybar.overrideAttrs (oldAttrs: {
|
||||||
|
mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
dunst
|
dunst
|
||||||
libnotify
|
libnotify
|
||||||
|
@ -297,7 +301,7 @@ networking = {
|
||||||
grim
|
grim
|
||||||
|
|
||||||
pamixer
|
pamixer
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -327,7 +331,7 @@ networking = {
|
||||||
};
|
};
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 7860 ];
|
networking.firewall.allowedTCPPorts = [80 443 7860];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
# Or disable the firewall altogether.
|
# Or disable the firewall altogether.
|
||||||
# networking.firewall.enable = false;
|
# networking.firewall.enable = false;
|
||||||
|
@ -344,5 +348,4 @@ networking = {
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "22.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue