-
Install from CD/USB
-
Check
hardware-confituration.nix
andconfiguration.nix
files for ambiguity -
Change the default hostname to something you like:
networking.hostname = "yourhostname";
-
Rebuild with
sudo nixos-rebuild switch
-
Add
vim
text editor:
# It should be somewhere in the configuration.nix
environment.systemPackages = with pkgs; [
+ vim
];
Rebuild.
- If you habe SSD:
# configuration.nix
+ services.fstrim.enable = true;
# hardware-configuration.nix
fileSystems."/" = {
device = "/dev/disk/by-uuid/YOUR-SSD-DISK-ID";
fsType = "ext4";
+ # For a long and healthy SSD life
+ options = [ "noatime" ];
};
- Hardware firmware problems
# configuration.nix
+ nixpkgs.config.allowUnfree = true;
# hardware-configuration.nix
+ hardware.enableAllFirmware = true;
Rebuild.
- Add experimental feature:
# configuration.nix
+ # Turn flakes on
+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
Rebulid.
- Initialize flakes
New file flake.nix
{
description = "nix flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11"; # or 'nixos-unstable' if you want
};
outputs = { self, nixpkgs, ... } @inputs: {
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; # Or other if you have - check hardware config
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
];
};
};
}
NOTE: From now on you need to always rebuild the system with
sudo nixos-rebuild switch --flake /etc/nixos#yoursethostname
, so that you can have multiple flakes for different system configurations, e.g. server, nix on Rpi, cloud, laptop, etc. Rebuild.
- Plymouth startup screen
# configuration.nix
+ boot.plymouth.enable = true;
+ boot.kernelParams = ["quiet"]; # Is this optional?
- Manpages
# configuration.nix
+ documentation.enable = true;
+ documentation.dev.enable = true;
+ documentation.man.enable = true;
+ documentation.man.generateCaches = true;
- More packages
Just place them inside the packages = with pkgs; [
array
- EOL Electron problem solving (when installing obsidian)
# configuration.nix
+ nixpkgs.config.permittedInsecurePackages = [
+ "electron-25.9.0" # An example version used
+ ];
-
Install with
packages = with pkgs; [
-
Then, make it available for system applications
# configuration.nix
fonts.packages = with pkgs; [
fira-code
fira-code-symbols
source-code-pro
];
Rebuild.
# configuration.nix
programs.neovim = {
enable = true;
defaultEditor = true;
};
man configuration.nix
Visit (nixos package search website)[https://search.nixos.org].
Add channel for your desired package repo (e.g. 23.11 or unstable) And then pull the newest packages with...
nix flake update
...to update flake's dependencies and packages
Enable river in configuration.nix
and install additional stuff
# For river
services.xserver.displayManager.sessionPackages = [ pkgs.river ];
# Configure keymap in X11
services.xserver = {
layout = "pl";
xkbVariant = "";
};
# Configure console keymap
console.keyMap = "pl2";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# IN THE SAME FILE
# Desktop config
programs.river.enable = true;
# For window managers
# F*** you Nvidia - Linus
environment.sessionVariables = {
# Against invisible cursors
WLR_NO_HARDWARE_CURSORS = "1";
# Hint electron apps to use wayland
NIXOS_OZONE_WL = "1";
};
# Nvidia wayland config continuation
hardware = {
opengl.enable = true;
nvidia.modesetting.enable = true;
};
# Portals
xdg.portal.enable = true;
xdg.portal.wlr.enable = true;
# Doesnt work - package conflict
#xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim
(waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
})
)
dunst # notification daemon
libnotify # notification display program
# wallpaper
(wbg.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dpng=enabled" "-Djpeg=enabled" "-Dwebp=enabled" ];
})
)
bemenu # dmenu for wayland
firefox # browser
alacritty # terminal
networkmanagerapplet # guess :)
# Fonts
fira-code
fira-code-symbols
source-code-pro
];
Disable GNOME (it has conflicting packages). It solved the issue in my case.
services.xserver.displayManager.gdm.enable = true;
- services.xserver.desktopManager.gnome.enable = true;
+ # services.xserver.desktopManager.gnome.enable = true;
Rebuild. Test. Rollback, should you need it.