chore(users): grfn -> aspen

Change-Id: I6c6847fac56f0a9a1a2209792e00a3aec5e672b9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10809
Autosubmit: aspen <root@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
This commit is contained in:
Aspen Smith 2024-02-11 22:00:40 -05:00 committed by clbot
parent 0ba476a426
commit 82ecd61f5c
478 changed files with 75 additions and 77 deletions

View file

@ -0,0 +1,91 @@
{ config, lib, pkgs, ... }:
let
depot = import ../../../../.. { };
in
with lib;
{
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
tmp.cleanOnBoot = true;
};
networking.useDHCP = false;
networking.networkmanager.enable = true;
systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
i18n = {
defaultLocale = "en_US.UTF-8";
};
time.timeZone = lib.mkDefault "America/New_York";
environment.systemPackages = with pkgs; [
wget
vim
zsh
git
w3m
libnotify
file
lm_sensors
dnsutils
htop
man-pages
man-pages-posix
];
documentation.dev.enable = true;
documentation.man.generateCaches = true;
services.openssh.enable = true;
programs.ssh.startAgent = true;
networking.firewall.enable = mkDefault false;
users.mutableUsers = true;
programs.zsh.enable = true;
environment.pathsToLink = [ "/share/zsh" ];
users.users.grfn = {
isNormalUser = true;
initialPassword = "password";
extraGroups = [
"wheel"
"networkmanager"
"audio"
];
shell = pkgs.zsh;
};
nix = {
settings.trusted-users = [ "grfn" ];
distributedBuilds = true;
gc = {
automatic = true;
dates = mkDefault "weekly";
options = "--delete-older-than 30d";
};
};
services.udev.packages = with pkgs; [
yubikey-personalization
];
services.pcscd.enable = true;
services.udev.extraRules = ''
# UDEV rules for Teensy USB devices
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
'';
}

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
{
imports = [
./xserver.nix
./fonts.nix
./sound.nix
./kernel.nix
];
programs.nm-applet.enable = true;
users.users.grfn.extraGroups = [
"audio"
"video"
];
services.geoclue2.enable = true;
}

View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
virtualisation.docker.enable = true;
users.users.grfn.extraGroups = [ "docker" ];
security.pam.loginLimits = [
{
domain = "grfn";
type = "soft";
item = "nofile";
value = "65535";
}
];
}

View file

@ -0,0 +1,10 @@
{ config, lib, pkgs, ... }:
{
i18n.inputMethod = {
enabled = "fcitx";
fcitx.engines = with pkgs.fcitx-engines; [
cloudpinyin
];
};
}

View file

@ -0,0 +1,12 @@
{ config, lib, pkgs, ... }:
{
fonts = {
packages = with pkgs; [
nerdfonts
noto-fonts-emoji
twitter-color-emoji
];
fontconfig.defaultFonts.emoji = [ "Twitter Color Emoji" ];
};
}

View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
imports = [
./reusable/battery.nix
];
laptop.onLowBattery.enable = true;
services.logind.extraConfig = ''
HandlePowerKey=hibernate
'';
services.tlp.enable = true;
}

View file

@ -0,0 +1,2 @@
This directory contains things I'm eventually planning on contributing upstream
to nixpkgs

View file

@ -0,0 +1,32 @@
{ config, lib, pkgs, ... }:
with lib;
{
options = {
laptop.onLowBattery = {
enable = mkEnableOption "Perform action on low battery";
thresholdPercentage = mkOption {
description = "Threshold battery percentage on which to perform the action";
default = 8;
type = types.int;
};
action = mkOption {
description = "Action to perform on low battery";
default = "hibernate";
type = types.enum [ "hibernate" "suspend" "suspend-then-hibernate" ];
};
};
};
config =
let cfg = config.laptop.onLowBattery;
in mkIf cfg.enable {
services.udev.extraRules = concatStrings [
''SUBSYSTEM=="power_supply", ''
''ATTR{status}=="Discharging", ''
''ATTR{capacity}=="[0-${toString cfg.thresholdPercentage}]", ''
''RUN+="${pkgs.systemd}/bin/systemctl ${cfg.action}"''
];
};
}

View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
rtl-sdr
];
services.udev.packages = with pkgs; [
rtl-sdr
];
# blacklist for rtl-sdr
boot.blacklistedKernelModules = [
"dvb_usb_rtl28xxu"
];
}

View file

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
{
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
environment.systemPackages = with pkgs; [
pulseaudio-ctl
paprefs
pasystray
pavucontrol
];
hardware.pulseaudio.package = pkgs.pulseaudioFull;
}

View file

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
{
nix = {
buildMachines = [{
hostName = "whitby.tvl.fyi";
sshUser = "grfn";
sshKey = "/root/.ssh/id_rsa";
system = "x86_64-linux";
maxJobs = 64;
supportedFeatures = [ "big-parallel" "kvm" "nixos-test" "benchmark" ];
}];
extraOptions = ''
builders-use-substitutes = true
'';
settings = {
substituters = [
"https://cache.nixos.org"
];
trusted-substituters = [
"https://cache.nixos.org"
"ssh://nix-ssh@whitby.tvl.fyi"
];
};
};
programs.ssh.knownHosts.whitby = {
extraHostNames = [ "whitby" "whitby.tvl.fyi" "49.12.129.211" ];
publicKeyFile = pkgs.writeText "whitby.pub" ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILNh/w4BSKov0jdz3gKBc98tpoLta5bb87fQXWBhAl2I
'';
};
}

View file

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
programs.wireshark = {
enable = true;
package = pkgs.wireshark;
};
users.users.grfn.extraGroups = [ "wireshark" ];
}

View file

@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
# Enable the X11 windowing system.
services.xserver = {
enable = true;
layout = "us";
libinput.enable = true;
displayManager = {
defaultSession = "none+i3";
};
windowManager.i3.enable = true;
};
}