Skip to content

Instantly share code, notes, and snippets.

@adamdavislee
Last active August 5, 2021 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamdavislee/79215843d63e89461169682f3f809d14 to your computer and use it in GitHub Desktop.
Save adamdavislee/79215843d63e89461169682f3f809d14 to your computer and use it in GitHub Desktop.
My personal NixOs config. Running on a 2015 Chromebook Pixel LS (Samus). Notice that the kernel needs to be downgraded for the touchpad to be recognized.
{ config, pkgs, ... }:
{
system.stateVersion = "21.05"; # don't modify this if system is updated
imports = [ ./hardware-configuration.nix ]; # some sort of auto-generated fstabby thing :-)
boot.kernelPackages = pkgs.linuxPackages_5_4; # Most recent supported kernel that still has working touch and sound.
boot.loader.systemd-boot.enable = true; # use the systemd EFI boot loader
boot.loader.efi.canTouchEfiVariables = true; # set automatically during install
networking.hostName = "ecdicius"; # define your hostname
networking.wireless.enable = true; # enables wireless support via wpa_supplicant
networking.wireless.interfaces = [ "wlp1s0" ]; # without this, wpa_supplicant gets confused about how to start after reboot
time.timeZone = "America/Los_Angeles"; # set your time zone
networking.useDHCP = false; # explicitly set to false because it's deprecated
networking.interfaces.wlp1s0.useDHCP = true; # dhcp is now set on each interface explicitly
networking.wireless.networks.adamdavislee = { psk = "MY_PASSWORD"; }; # wpa_supplicant setup for my home wifi
sound.enable = true; # enable sound
hardware.pulseaudio.enable = true; # enable pulseaudio
nixpkgs.config.allowUnfree = true; # don't restrict packages to __libre__
security.sudo.wheelNeedsPassword = false; # don't require password for sudo
services.openssh.enable = true; # enable SSH
services.openssh.permitRootLogin = "no"; # don't allow remote users to SSH in as root
# setup touchpad
services.xserver.libinput = {
enable = true;
touchpad.naturalScrolling = true;
touchpad.tapping = false;
touchpad.accelSpeed = "0.66";
};
# define environment variables
environment.variables = {
EDITOR = "kak";
};
# setup the gui
services.xserver = {
enable = true;
windowManager.i3.enable = true;
displayManager.autoLogin.enable = true;
displayManager.autoLogin.user = "adamdavislee";
};
# setup of the main user
users.users.adamdavislee = {
password = "MY_PASSWORD";
extraGroups = [ "wheel" ];
isNormalUser = true;
};
# enable source code pro
fonts.fonts = with pkgs; [
source-code-pro
];
# enable packages
environment.systemPackages = with pkgs; [
kakoune
alacritty
jdk11
clojure
leiningen
kakounePlugins.rep
parinfer-rust
git
steam-run
dropbox-cli
google-chrome
acpi
i3lock
sxhkd
maim
xclip
peek
brillo
rlwrap
nodejs
python3
evtest
p7zip
xfce.thunar
];
# customize some keyboard mappings # to find your own scancodes to map from and keycodes to map to, do the following:
systemd.services.remap-samus= { # run `sudo evtest` and select the keyboard (we'll remap search/caps-lock to left control as an example)
wantedBy = [ "multi-user.target" ]; # press search and look at the upper line "...value db" ("db" is the scancode)
path = with pkgs; [ kbd ]; # now press any key bound to control and look at the lower line "...code 29..." (29 is the keycode)
script = ''
setkeycodes db 29
setkeycodes 1d 125
setkeycodes 9d 126
'';
};
# dropbox startup daemon
systemd.user.services.dropbox = {
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.dropbox.out}/bin/dropbox";
ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID";
Restart = "on-failure";
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment