Code Monkey home page Code Monkey logo

nixos-dotfiles's Introduction

Welcome to my NixOS config files!

Version 1.0.0 NixOS

NixOS is a fully reproducible operating system based on the Nix package manager. A good guide on NixOS can be found here.

Neofetch Dmenu Neovim Obsidian Obsidian

πŸ› οΈ What I use

What Item
OS NixOS \w Flakes && Home-Manager
Display Manager Wayland
Compositor HyprLand
Bar Waybar
Notification Manager Dunst
Audio Pipewire
App Launcher Rofi
Network Network-Manager
Take Screenshots Grim + Slurp + Wl-clipboard
Terminal Emulator Kitty
Shell Zsh
Wallpaper Manager Hyprpaper
Email client Thunderbird
Knowledge Management Obsidian
File Manager Thunar / Ranger
Editor Neovim
Browser Vivaldi
Change Brightness Brightnessctl

Vim plugins

Name Description
nvim-tree-lua Directory Tree
vim-stratify Fancy Start Screen
nerdtree Another Directory tree
surround-nvim Shortcut to surround a work with char
syntastic Code syntax checking for a lot of languages
YouCompleteMe Code completition for most languages
vim-airline Bottom bar with some informations
emmet-vim Amazing html completition
telescope-zoxide Fuzzy finder
fine-cmdline Better looking command line
nvim-colorizer-lua Show hex colors immediately
gitsigns-nvim Hilight text that has changes since last commit
copilot-nvim Github's AI assistant

πŸ”© My Hardware

πŸ–₯️ Computers

Name System Role Notes User
Desktop NixOS Main workstation for computation and Gaming i5-6500K 3.2 GHz, Nvidia 1060 3G, 16 GB ram DDR4, AC-Game Mechanical Keyboard, HP Monitor, Creative Speakers, Gaming Mouse santo
Hp Laptop NixOS University Note taking and Programming when I'm outside - lanto
Laptop Acer NixOS Tests and Backups - santo
Computerino Ubuntu Server Backups and Server - santo
Laptop 3 Archlinux - - -
Laptop 4 Debian - Too old to be useful -

πŸ”Œ Devices

Nome Role Notes
Kingdian SSD Archlinux Boot 100 GB
USB Stick Installation Media 8 GB
Samsung A13 Main Phone
Samusng J6 Wifi Hotspot
Launchpad S App-launcher

⌨️ My keyboard configuration

I use home row with the following settings

(deflayer homerow
  esc  f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11  f12        ssrq slck pause
  grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc  ins  home pgup  nlck kp/  kp*  kp-
  tab  q    w    e    r    t    y    u    i    o    p    [    ]    ret   del  end  pgdn  kp7  kp8  kp9  kp+
  caps @met_a @alt_s @ctl_d @sft_f @num_g h  @sft_j @ctl_k @alt_l @met_;  '  \           kp4  kp5  kp6
  lsft 102d z    x    c    v    b    n    m    ,    .    /    rsft            up         kp1  kp2  kp3  kprt
  lctl lmet lalt           spc                 ralt rmet cmp  rctl       left down rght  kp0  kp.
)

(deflayer numbers
  _    _    _    _    _    _    _    _    _    _    _    _    _          _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _    _     _    _    _    _    _    _    _
  _    _    _    _    _    _    XX   /    7    8    9    -    _    _     _    _    _    _    _    _    _
  _    _    _    _    _    _    XX   *    4    5    6    +    _                         _    _    _
  _    _    _    _    _    _    XX   0    1    2    3    _    _               _         _    _    _    _
  _    _    _              _                   _    _    _    _          _    _    _    _    _
)


I'm looking forward to change keyboard layout soon

πŸͺ› Use my config files

Clone my repo, then add .secrets/ directory with the file .secrets/github-access-token

Make sure there is no new line in the file (0x0a)

Build the system with with

sudo nixos-rebuild switch --flake .<profile-here> --impure

Or with the build.sh script

./build.sh system <profile-here>

impure lets you read gihub credentials from .secrets

I don't place my config in /etc/nixos/ but I have this repo on my home inside .config/nixos

πŸ—οΈ Structure

Take a look around (might not be updated to the lastest version)

β”œβ”€β”€ build.sh                        # Easy to use build script
β”œβ”€β”€ flake.lock                      # Lock file for flakes
β”œβ”€β”€ flake.nix                       # All flakes profiles are defined here
β”œβ”€β”€ home                            # Home Manager configurations
β”‚Β Β  β”œβ”€β”€ lanto                       # Minimal user with just the necessary stuff
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ default.nix             
β”‚Β Β  β”‚Β Β  └── dev
β”‚Β Β  β”‚Β Β      β”œβ”€β”€ default.nix
β”‚Β Β  β”‚Β Β      └── git.nix             # Git configurations and setting up credentials
β”‚Β Β  β”œβ”€β”€ santo                       # Power user with many programs
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ default.nix
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ dev
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ default.nix
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── git.nix
β”‚Β Β  β”‚Β Β  └── programs
β”‚Β Β  β”‚Β Β      └── default.nix
β”‚Β Β  └── shared                      # Pakages and configurations shared between users
β”‚Β Β      β”œβ”€β”€ default.nix
β”‚Β Β      β”œβ”€β”€ desktop
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ default.nix
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ hyprland.conf       # Hyprland
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ hyprpaper.conf      # Wallpapers
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ i3.nix
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ neofetch.nix
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ ranger.nix
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ rofi.nix
β”‚Β Β      β”‚Β Β  └── waybar.nix
β”‚Β Β      β”œβ”€β”€ dev
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ default.nix
β”‚Β Β      β”‚Β Β  └── neovim.nix          # Neovim Plugins
β”‚Β Β      └── shells
β”‚Β Β          β”œβ”€β”€ alacritty.nix
β”‚Β Β          β”œβ”€β”€ bash.nix
β”‚Β Β          β”œβ”€β”€ default.nix
β”‚Β Β          β”œβ”€β”€ fhs.nix             # FHS filesystem
β”‚Β Β          β”œβ”€β”€ kitty.nix           # I use kitty
β”‚Β Β          β”œβ”€β”€ shell.nix
β”‚Β Β          └── zsh.nix
β”œβ”€β”€ hosts                           # Configuration specific per machine
β”‚Β Β  β”œβ”€β”€ acer-laptop                 # Backup / Second Laptop
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ configuration.nix
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ default.nix
β”‚Β Β  β”‚Β Β  └── hardware-configuration.nix
β”‚Β Β  β”œβ”€β”€ desktop                     # Main workstation, nvidia drivers
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ configuration.nix
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ default.nix
β”‚Β Β  β”‚Β Β  └── hardware-configuration.nix
β”‚Β Β  └── hp-laptop                   # Unversity note taking and programming
β”‚Β Β      β”œβ”€β”€ configuration.nix
β”‚Β Β      β”œβ”€β”€ default.nix
β”‚Β Β      └── hardware-configuration.nix
β”œβ”€β”€ misc                            # Some notes I took that I might need in future
β”‚Β Β  β”œβ”€β”€ powertop.md
β”‚Β Β  └── screenshots
β”‚Β Β      β”œβ”€β”€ 01.jpg
β”‚Β Β      β”œβ”€β”€ 02.jpg
β”‚Β Β      β”œβ”€β”€ 03.jpg
β”‚Β Β      └── 04.jpg
β”œβ”€β”€ modules                         # System-wide configuration and packages
β”‚Β Β  β”œβ”€β”€ cache-server.nix
β”‚Β Β  β”œβ”€β”€ default.nix                 # All system packages
β”‚Β Β  β”œβ”€β”€ memory-optimization.nix
β”‚Β Β  β”œβ”€β”€ network-manager.nix
β”‚Β Β  β”œβ”€β”€ nvidia.nix                  # Nvidia settings
β”‚Β Β  └── users.nix
β”œβ”€β”€ README.md
└── wallpapers                      # A bunch of wallpapers 
    β”œβ”€β”€ anime1.jpeg
    β”œβ”€β”€ anime2.jpeg
    β”œβ”€β”€ anime3.jpeg
    β”œβ”€β”€ fishing.png
    β”œβ”€β”€ free-as-in-freedom.jpeg
    β”œβ”€β”€ grass.jpg
    β”œβ”€β”€ lake.png
    β”œβ”€β”€ mountain.png
    β”œβ”€β”€ nixos-dark.png
    β”œβ”€β”€ nixos-light.png
    β”œβ”€β”€ only-grey.png
    └── telescope.png

🏠 home-manager

You can manage the user environment without sudo thanks to home manager. Inside flake.nix there is a profile for santo@home that imports the modules at home/santo/. You can build your profile with home-manager with this command:

home-manager switch --flake flake.nix#santo@home --impure

Or with my build script

./build.sh home santo@home

🐚 nix-shell

For developement consistency, NixOS uses (enforces...) the use of nix-shell (or nix develop for flake configuration). You can create and enter into developement environment it with the command nix-shell. You can provide the packages with -p or use a configuration file like so: modules/shell/shell.nix

{ pkgs ? import <nixpkgs> {} }: pkgs.mkShell {
  nativeBuildInputs = with pkgs.buildPackages; [
    libgcc
    # cargo
    # rustc
  ];
}

See modules/shell/shell.nix for more information.

Example usage

nix-shell -p gcc
nix-shell /path/to/shell/configuration.nix
nix develop nixpkgs#gcc

With nix develop you mantain in scope all your user programs

Run a FHS shell

nix-shell home/shared/fhs.nix

Run Appimage

nix-shell -p appimage-run
[nix-shell]$ appimage-run <your-appimage>

⬆️ Upgrade the system

nix flake update

πŸ—‘οΈ Remove Garbage

Remove system versions and packages no longer used by new generations by 15 days

nix-channel --update
sudo nix-channel --update
sudo rm /nix/var/nix/gcroots/auto/*
nix-collect-garbage -d
sudo nix-collect-garbage -d
sudo nix-store --optimize

Create a new module

Create a file such as main-user.nix Then add It into the configuration.nix file

imports = [
	./hardware-configuration.nix
	./main-user.nix
]

In main-user.nix

{ whatever, ... }:

{
   # Config here
}

Default

If you call a file default.nix, you can access It just bu importing It's folder

Finding options and functions

nix search nixpkgs <searchterm>

πŸŽ₯ Resources

Videos

https://www.youtube.com/watch?v=CwfKlX3rA6E

https://www.youtube.com/watch?v=a67Sv4Mbxmc

https://www.youtube.com/watch?v=1ED9b7ERTzI

Sites

https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=git

https://search.nixos.org/packages?channel=23.11&show=git&from=0&size=50&sort=relevance&type=packages&query=git


TODO

  • Login Manager

nixos-dotfiles's People

Contributors

san7o avatar

Stargazers

Diethyl-ether avatar Oliver Cai avatar Gamos, Carl Justin avatar  avatar LΓ©o avatar Haize avatar sachesi avatar  avatar keyvan avatar oenea avatar Diego avatar Konrad LemaΕ„ski avatar Federico Capoccia avatar rew avatar

Watchers

 avatar

Forkers

spacecowb0y

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.