Last active
February 11, 2025 14:47
-
-
Save loulecrivain/90b6155e77c5e6c3de25188550e97cbc to your computer and use it in GitHub Desktop.
Lou's NixOS config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
<home-manager/nixos> | |
]; | |
# Bootloader. | |
boot.loader.systemd-boot.enable = true; | |
boot.loader.efi.canTouchEfiVariables = true; | |
boot.kernelPackages = pkgs.linuxPackages_latest; | |
boot.initrd.luks.devices."luks-44bf3815-7992-4e8e-9ade-5ac31585bfd8".device = "/dev/disk/by-uuid/44bf3815-7992-4e8e-9ade-5ac31585bfd8"; | |
networking.hostName = "nixos"; # Define your hostname. | |
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. | |
# Configure network proxy if necessary | |
# networking.proxy.default = "http://user:password@proxy:port/"; | |
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; | |
# Enable networking | |
networking.networkmanager.enable = true; | |
# Set your time zone. | |
time.timeZone = "Europe/Paris"; | |
# Select internationalisation properties. | |
i18n.defaultLocale = "fr_FR.UTF-8"; | |
i18n.extraLocaleSettings = { | |
LC_ADDRESS = "fr_FR.UTF-8"; | |
LC_IDENTIFICATION = "fr_FR.UTF-8"; | |
LC_MEASUREMENT = "fr_FR.UTF-8"; | |
LC_MONETARY = "fr_FR.UTF-8"; | |
LC_NAME = "fr_FR.UTF-8"; | |
LC_NUMERIC = "fr_FR.UTF-8"; | |
LC_PAPER = "fr_FR.UTF-8"; | |
LC_TELEPHONE = "fr_FR.UTF-8"; | |
LC_TIME = "fr_FR.UTF-8"; | |
}; | |
# Configure keymap in X11 | |
services.xserver = { | |
xkb.layout = "fr"; | |
xkb.variant = "azerty"; | |
}; | |
# configure udev rules | |
services.udev.packages = [ pkgs.yubikey-personalization ]; | |
# Configure console keymap | |
console.keyMap = "fr"; | |
# Define a user account. Don't forget to set a password with ‘passwd’. | |
users.users.lou = { | |
isNormalUser = true; | |
description = "Lou Lécrivain"; | |
extraGroups = [ | |
"networkmanager" | |
"wheel" | |
"wireshark" | |
"libvirtd" | |
"docker" | |
]; | |
packages = with pkgs; [ | |
]; | |
}; | |
# home manager system wide settings | |
home-manager.useUserPackages = true; | |
# home manager user settings | |
home-manager.users.lou = { pkgs, config, ... }: { | |
# nix pkg manager settings | |
nix.settings = { | |
experimental-features = [ "nix-command" "flakes" ]; | |
}; | |
home.packages = with pkgs; [ | |
emacs git htop mg mpv tmux wget file unzip feh | |
pinentry yubikey-manager gnupg qrencode | |
libreoffice firefox nextcloud-client | |
linphone liblinphone eduvpn-client | |
direnv devenv python3 poetry | |
mtr dig inetutils | |
ghidra jetbrains.pycharm-community | |
]; | |
dconf.settings = { | |
"org/gnome/desktop/wm/keybindings" = { | |
close = [ "<Super><Shift>C" ]; | |
}; | |
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { | |
binding = "<Shift><Super>Return"; | |
command = "kgx"; | |
name = "gnome term"; | |
}; | |
}; | |
xdg.userDirs = { | |
enable = true; | |
createDirectories = true; | |
desktop = "${config.home.homeDirectory}/desktop"; | |
documents = "${config.home.homeDirectory}/docs"; | |
download = "${config.home.homeDirectory}/dw"; | |
music = "${config.home.homeDirectory}/zic"; | |
pictures = "${config.home.homeDirectory}/pics"; | |
publicShare = "${config.home.homeDirectory}/pub"; | |
templates = "${config.home.homeDirectory}/templates"; | |
videos = "${config.home.homeDirectory}/vid"; | |
}; | |
programs.git = { | |
enable = true; | |
lfs.enable = true; | |
userName = "lou lecrivain"; | |
userEmail = "[email protected]"; | |
signing.key = null; | |
signing.signByDefault = true; | |
}; | |
programs.bash = { | |
enable = true; | |
initExtra = '' | |
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) | |
gpgconf --launch gpg-agent | |
''; | |
}; | |
programs.gpg = { | |
enable = true; | |
# we also have pcscd installed, see https://ludovicrousseau.blogspot.com/2019/06/gnupg-and-pcsc-conflicts.html | |
scdaemonSettings = { disable-ccid = true; }; | |
}; | |
programs.ssh = { | |
enable = true; | |
matchBlocks."matrix-gwdg".user = "lou.lecrivain"; | |
matchBlocks."matrix-gwdg".host = "*.matrix.gwdg.de"; | |
extraConfig = '' | |
Host * | |
User llecrivain | |
''; | |
}; | |
programs.direnv = { | |
enable = true; | |
nix-direnv.enable = true; | |
config.global = { | |
load_dotenv = false; | |
hide_env_diff = true; | |
}; | |
}; | |
services.gpg-agent = { | |
enable = true; | |
enableSshSupport = true; | |
pinentryPackage = pkgs.pinentry-gtk2; | |
}; | |
# required and should stay as is | |
home.stateVersion = "23.11"; | |
}; | |
# Allow unfree packages | |
nixpkgs.config = { | |
allowUnfree = true; | |
}; | |
# List packages installed in system profile. To search, run: | |
# $ nix search wget | |
environment.systemPackages = with pkgs; [ | |
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. | |
vim | |
gnome-flashback | |
gnome-power-manager | |
adwaita-icon-theme | |
gdm | |
gnome-icon-theme | |
synapse | |
networkmanager-vpnc | |
networkmanager-openconnect | |
networkmanager-openvpn | |
networkmanagerapplet | |
vpnc | |
wireshark | |
virt-manager | |
pcsclite | |
yubikey-personalization | |
libu2f-host | |
# unstable.eduvpn-client | |
]; | |
virtualisation.docker = { | |
enable = true; | |
}; | |
virtualisation.libvirtd.enable = true; | |
# Some programs need SUID wrappers, can be configured further or are | |
# started in user sessions. | |
# programs.mtr.enable = true; | |
# programs.gnupg.agent = { | |
# enable = true; | |
# enableSSHSupport = true; | |
# }; | |
programs.wireshark.enable = true; | |
programs.wireshark.package = pkgs.wireshark-qt; | |
# List services that you want to enable: | |
# xsession stuff | |
services.xserver.enable = true; | |
services.xserver.displayManager.gdm.enable = true; | |
services.xserver.desktopManager.gnome.enable = true; | |
services.xserver.desktopManager.gnome.flashback.enableMetacity = true; | |
services.displayManager.defaultSession = "gnome-flashback-metacity"; | |
# smartcard | |
services.pcscd.enable = true; | |
# ignore lid | |
services.logind.lidSwitch = "ignore"; | |
# Enable the OpenSSH daemon. | |
# services.openssh.enable = true; | |
# Open ports in the firewall. | |
# networking.firewall.allowedTCPPorts = [ ... ]; | |
# networking.firewall.allowedUDPPorts = [ ... ]; | |
# Or disable the firewall altogether. | |
# networking.firewall.enable = false; | |
networking.firewall.checkReversePath = false; | |
# This value determines the NixOS release from which the default | |
# settings for stateful data, like file locations and database versions | |
# on your system were taken. It‘s perfectly fine and recommended to leave | |
# this value at the release version of the first install of this system. | |
# Before changing this value read the documentation for this option | |
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). | |
system.stateVersion = "23.11"; # Did you read the comment? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment