{ config, pkgs, inputs, machineName, ... }: let inherit (config.users) users; in { imports = [ oignon/hardware.nix ]; users.mutableUsers = false; users.users.julm = { isNormalUser = true; uid = 1000; # Put the hashedPassword in /nix/store, but it will also be in /etc/passwd # which is already world readable. hashedPassword = builtins.readFile ../secrets/julm/hashedPassword; extraGroups = [ "wheel" "networkmanager" #"vboxusers" ]; # If created, zfs-mount.service would require: # zfs set overlay=yes ${machineName}/home createHome = false; }; nix = { extraOptions = '' auto-optimise-store = true ''; gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 7d"; }; nixPath = [ "nixpkgs=/etc/nixpkgs" "nixpkgs-overlays=/etc/nixpkgs-overlays/overlays.nix" ]; trustedUsers = [ users.julm.name ]; }; environment.etc."nixpkgs".source = pkgs.path; environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs"; nixpkgs.config = { allowUnfree = false; }; time.timeZone = "Europe/Paris"; i18n.defaultLocale = "fr_FR.UTF-8"; console.font = "Lat2-Terminus16"; console.keyMap = "fr"; networking = { hostName = machineName; domain = "localdomain"; networkmanager = { enable = true; #dhcp = "dhcpcd"; logLevel = "INFO"; wifi = { #backend = "iwd"; #backend = "wpa_supplicant"; powersave = false; }; }; firewall = { enable = true; }; }; sound.enable = true; hardware.pulseaudio.enable = true; environment.variables = { EDITOR = "vim"; PAGER = "less -R"; SYSTEMD_LESS = "FKMRX"; }; environment.systemPackages = with pkgs; [ acpi binutils bmon coreutils cryptsetup curl direnv dstat e2fsprogs file glib # gio gvfs gnumake gnupg gparted hicolor-icon-theme home-manager htop less libfaketime lsof man miniupnpc mosh ncdu ncurses nmon ntfs3g pasystray pavucontrol pciutils powertop procps python sudo tig tmux tree utillinux vim wget which xdg_utils xsel zfs ]; programs = { bash = { interactiveShellInit = '' bind '"\e[A":history-search-backward' bind '"\e[B":history-search-forward' # Ignore duplicate commands, ignore commands starting with a space export HISTCONTROL=erasedups:ignorespace export HISTSIZE=42000 # Append to the history instead of overwriting (good for multiple connections) shopt -s histappend fan () { if [ $# -gt 0 ] then sudo tee /proc/acpi/ibm/fan <<<"level $1" else grep '^\(level\|speed\):' /proc/acpi/ibm/fan fi acpi -t } ''; shellAliases = { cl = "clear"; l = "ls -alh"; ll = "ls -al"; ls = "ls --color=tty"; mem = "ps -e -orss=,user=,args= | sort -b -k1,1n"; s="sudo systemctl"; st="sudo systemctl status"; s-u="systemctl --user"; j="sudo journalctl -u"; nix-clean="sudo nix-collect-garbage -d"; nix-catalog="sudo nix-channel --list"; nix-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system"; nix-rollback="sudo nixos-rebuild switch --rollback"; nix-update="sudo nix-channel --update"; nix-upgrade="sudo nixos-rebuild switch"; nix-upstream="sudo nix-channel --list"; nix-config="gvim ~/.config/nixos/*.nix"; }; }; dconf.enable = true; gnupg.agent = { enable = true; enableSSHSupport = true; }; mtr.enable = true; }; services = { avahi = { enable = true; nssmdns = true; }; dbus = { packages = [ pkgs.gnome3.dconf ]; }; gvfs = { enable = true; }; journald = { extraConfig = '' Compress=true MaxRetentionSec=1month Storage=persistent SystemMaxUse=100M ''; }; physlock = { enable = true; allowAnyUser = true; # NOTE: xfconf-query -c xfce4-session -p /general/LockCommand -s "physlock" --create -t string }; printing = { enable = true; drivers = [ pkgs.gutenprint pkgs.hplip ]; }; sanoid = { enable = true; extraArgs = [ "--verbose" ]; datasets = { "${machineName}/home" = { autosnap = true; autoprune = true; hourly = 12; daily = 7; monthly = 0; yearly = 0; recursive = true; }; "${machineName}/var" = { autosnap = true; autoprune = true; hourly = 12; daily = 7; monthly = 0; yearly = 0; recursive = true; }; }; }; xserver = { enable = true; layout = "fr"; xkbOptions = "eurosign:e"; libinput.enable = true; desktopManager = { session = [ # Let the session be generated by home-manager { name = "home-manager"; start = '' ${pkgs.runtimeShell} $HOME/.hm-xsession & waitPID=$! ''; } ]; xfce = { enable = false; /* thunarPlugins = [ pkgs.xfce.thunar-archive-plugin ]; */ }; xterm.enable = false; }; displayManager = { defaultSession = "home-manager"; #defaultSession = "none+xmonad"; autoLogin = { enable = true; user = users.julm.name; }; }; }; }; #virtualisation.virtualbox.host.enable = true; # This value determines the NixOS release with which your system is to be # compatible, in order to avoid breaking some software such as database # servers. You should change this only after NixOS release notes say you should. system.stateVersion = "20.09"; # Did you read the comment? }