This commit is contained in:
Hadi 2024-03-13 19:42:50 +01:00
parent a189d592ed
commit 3498cf42bf
7 changed files with 74 additions and 67 deletions

View File

@ -2,6 +2,9 @@
This is my dotfiles repo. It's a work in progress, and I'm still learning how to use nix.
Every things that you *must* change got a "CHANGEME" comment.
You can search for it with ripgrep: `rg "CHANGEME"`
# TODOLIST
- [ ] Variable user & homeDir

View File

@ -25,10 +25,15 @@
{ _module.args = { inherit inputs; }; }
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.hadi = import ./home/home.nix;
home-manager.extraSpecialArgs = { inherit inputs; inherit spicetify-nix; };
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.hadi = import ./home/home.nix; # CHANGEME - replace "hadi"
extraSpecialArgs = {
inherit inputs;
inherit spicetify-nix;
};
};
}
];
};

View File

@ -1,8 +1,8 @@
{
programs.git = {
enable = true;
userName = "Hadi";
userEmail = "112569860+anotherhadi@users.noreply.github.com";
userName = "Hadi"; # CHANGEME
userEmail = "112569860+anotherhadi@users.noreply.github.com"; # CHANGEME
extraConfig = {
init.defaultBranch = "main";
# Automatically track remote branch

View File

@ -20,8 +20,8 @@
./wallpaper
];
home.username = "hadi";
home.homeDirectory = "/home/hadi";
home.username = "hadi"; # CHANGEME
home.homeDirectory = "/home/hadi"; # CHANGEME
home.packages = with pkgs; [
swappy

View File

@ -1,5 +1,5 @@
{ pkgs, config, ... }: {
imports = [ ./hardware-configuration.nix ];
imports = [ ./hardware-configuration.nix ./nvidia.nix ];
# Bootloader.
boot.loader.efi.canTouchEfiVariables = true;
@ -8,15 +8,14 @@
consoleMode = "auto";
};
networking.hostName = "nixy";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
##############
# CHANGEME
networking.hostName = "nixy";
time.timeZone = "Europe/Paris";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_FR.UTF-8";
LC_IDENTIFICATION = "fr_FR.UTF-8";
@ -29,22 +28,36 @@
LC_TIME = "fr_FR.UTF-8";
};
# Configure keymap in X11
services.xserver = {
xkb.layout = "fr";
xkb.variant = "";
users.users.hadi = { # CHANGEME
isNormalUser = true;
description = "Hadi account";
extraGroups = [ "networkmanager" "wheel" ];
};
# Auto Update & Clean
system.autoUpgrade = {
enable = true;
dates = "04:00";
flake = "${config.users.users.hadi.home}/.config/nixos"; # CHANGEME
flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
allowReboot = true;
};
##############
services = {
xserver = {
xkb.layout = "fr";
xkb.variant = "";
};
blueman.enable = true;
gnome.gnome-keyring.enable = true;
};
console.keyMap = "fr";
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
users.users.hadi = {
isNormalUser = true;
description = "hadi";
extraGroups = [ "networkmanager" "wheel" ];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
@ -52,28 +65,10 @@
nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" "nix-2.16.2" ];
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
services.gnome.gnome-keyring.enable = true;
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
};
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
# Set environment variables
environment.variables = {
@ -100,15 +95,6 @@
wireplumber.enable = true;
};
# Auto Update & Clean
system.autoUpgrade = {
enable = true;
dates = "04:00";
flake = "${config.users.users.hadi.home}/.config/nixos";
flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
allowReboot = true;
};
nix = {
settings = {
auto-optimise-store = true;

View File

@ -1,21 +1,16 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
{ config, lib, pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
boot = {
initrd.availableKernelModules =
[ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/6c2487ec-20ff-4ce3-9396-281c2094aba1";
@ -27,7 +22,7 @@
fsType = "vfat";
};
swapDevices = [];
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
@ -38,5 +33,6 @@
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

17
nixos/nvidia.nix Normal file
View File

@ -0,0 +1,17 @@
{ pkgs, config, ... }: {
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
};
}