2023-01-05 11:42:22 +08:00
|
|
|
{ config, pkgs, artiq, ... }:
|
2022-03-15 17:51:21 +08:00
|
|
|
|
2024-10-10 21:52:01 +08:00
|
|
|
let
|
|
|
|
sealOff = pkgs.writeShellScriptBin "seal-off"
|
|
|
|
''
|
|
|
|
set -e
|
|
|
|
nixos-rebuild boot
|
|
|
|
nix-collect-garbage -d
|
|
|
|
'';
|
|
|
|
|
|
|
|
in {
|
2022-03-15 17:51:21 +08:00
|
|
|
imports =
|
|
|
|
[
|
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
2022-06-11 22:31:48 +08:00
|
|
|
boot.loader.systemd-boot.memtest86.enable = true;
|
2023-01-04 11:53:41 +08:00
|
|
|
boot.kernelParams = ["intel_idle.max_cstate=1"];
|
2024-07-17 17:02:54 +08:00
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
2022-03-15 17:51:21 +08:00
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
|
|
|
|
|
|
|
networking.hostName = "artiq";
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
systemd.suppressedSystemUnits = [
|
|
|
|
"hibernate.target"
|
|
|
|
"suspend.target"
|
|
|
|
"suspend-then-hibernate.target"
|
|
|
|
"sleep.target"
|
|
|
|
"hybrid-sleep.target"
|
|
|
|
"systemd-hibernate.service"
|
|
|
|
"systemd-hybrid-sleep.service"
|
|
|
|
"systemd-suspend.service"
|
|
|
|
"systemd-suspend-then-hibernate.service"
|
|
|
|
];
|
|
|
|
|
|
|
|
console.font = "Lat2-Terminus16";
|
|
|
|
console.keyMap = "us";
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
|
2024-10-09 18:35:12 +08:00
|
|
|
time.timeZone = "UTC";
|
2022-03-15 17:51:21 +08:00
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
environment.systemPackages = with pkgs; [
|
2024-10-10 21:52:01 +08:00
|
|
|
sealOff
|
2022-03-15 17:51:21 +08:00
|
|
|
wget
|
|
|
|
vim
|
|
|
|
gitAndTools.gitFull
|
|
|
|
usbutils
|
|
|
|
pciutils
|
|
|
|
vlc
|
|
|
|
file
|
|
|
|
lm_sensors
|
|
|
|
acpi
|
|
|
|
imagemagick
|
|
|
|
firefox
|
|
|
|
chromium
|
2023-06-06 15:42:11 +08:00
|
|
|
(artiq.inputs.nixpkgs.legacyPackages.x86_64-linux.python3.withPackages(ps: with ps; [
|
2022-05-05 19:12:39 +08:00
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
matplotlib
|
|
|
|
jupyter
|
|
|
|
pyserial
|
|
|
|
spyder
|
|
|
|
artiq.packages.x86_64-linux.artiq
|
|
|
|
]))
|
2022-03-17 13:05:59 +08:00
|
|
|
artiq.packages.x86_64-linux.openocd-bscanspi
|
2022-03-15 17:51:21 +08:00
|
|
|
texlive.combined.scheme-full
|
|
|
|
psmisc
|
2022-06-17 16:05:36 +08:00
|
|
|
xc3sprog
|
2022-03-15 17:51:21 +08:00
|
|
|
gtkwave
|
|
|
|
unzip
|
|
|
|
zip
|
|
|
|
pavucontrol
|
|
|
|
rink
|
|
|
|
gimp
|
|
|
|
gnome3.gnome-tweaks
|
|
|
|
libreoffice-fresh
|
2023-09-05 10:33:36 +08:00
|
|
|
vscodium
|
2022-03-15 17:51:21 +08:00
|
|
|
];
|
|
|
|
programs.wireshark.enable = true;
|
|
|
|
programs.wireshark.package = pkgs.wireshark;
|
|
|
|
|
|
|
|
hardware.opengl.driSupport = true;
|
|
|
|
|
|
|
|
services.openssh.enable = true;
|
2023-06-06 15:42:11 +08:00
|
|
|
services.openssh.settings.PasswordAuthentication = false;
|
2022-03-15 17:51:21 +08:00
|
|
|
|
|
|
|
sound.enable = true;
|
|
|
|
hardware.pulseaudio.enable = true;
|
|
|
|
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
|
|
|
|
|
|
|
services.xserver.enable = true;
|
2024-10-09 18:35:48 +08:00
|
|
|
services.xserver.xkb.layout = "us";
|
2022-03-15 17:51:21 +08:00
|
|
|
|
|
|
|
services.xserver.displayManager.gdm.enable = true;
|
2024-10-09 18:35:48 +08:00
|
|
|
services.displayManager.autoLogin.enable = true;
|
|
|
|
services.displayManager.autoLogin.user = "rabi";
|
2022-03-15 17:51:21 +08:00
|
|
|
# https://github.com/NixOS/nixpkgs/issues/103746
|
|
|
|
systemd.services."getty@tty1".enable = false;
|
|
|
|
systemd.services."autovt@tty1".enable = false;
|
|
|
|
services.xserver.desktopManager.gnome.enable = true;
|
2023-03-14 15:25:12 +08:00
|
|
|
environment.gnome.excludePackages = [ pkgs.epiphany ];
|
2022-03-15 17:51:21 +08:00
|
|
|
|
|
|
|
programs.fish.enable = true;
|
|
|
|
programs.command-not-found.enable = false; # broken with flakes, https://github.com/NixOS/nixpkgs/issues/39789
|
|
|
|
users.mutableUsers = true;
|
|
|
|
users.defaultUserShell = pkgs.fish;
|
2023-01-05 11:42:14 +08:00
|
|
|
users.users.root.initialPassword = "rabi";
|
2022-03-15 17:51:21 +08:00
|
|
|
users.extraGroups.plugdev = { };
|
|
|
|
users.extraUsers.rabi = {
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = ["networkmanager" "wheel" "plugdev" "dialout" "wireshark"];
|
2022-06-11 22:31:48 +08:00
|
|
|
initialPassword = "rabi";
|
2022-03-15 17:51:21 +08:00
|
|
|
openssh.authorizedKeys.keys = [
|
2024-10-14 16:43:01 +08:00
|
|
|
# m-labs
|
2024-10-10 21:57:34 +08:00
|
|
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyPk5WyFoWSvF4ozehxcVBoZ+UHgrI7VW/OoQfFFwIQe0qvetUZBMZwR2FwkLPAMZV8zz1v4EfncudEkVghy4P+/YVLlDjqDq9zwZnh8Nd/ifu84wmcNWHT2UcqnhjniCdshL8a44memzABnxfLLv+sXhP2x32cJAamo5y6fukr2qLp2jbXzR+3sv3klE0ruUXis/BR1lLqNJEYP8jB6fLn2sLKinnZPfn6DwVOk10mGeQsdME/eGl3phpjhODH9JW5V2V5nJBbC0rBnq+78dyArKVqjPSmIcSy72DEIpTctnMEN1W34BGrnsDd5Xd/DKxKxHKTMCHtZRwLC2X0NWN"
|
2024-10-14 16:43:01 +08:00
|
|
|
# m-labs
|
2024-10-10 21:57:34 +08:00
|
|
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCMALVC8RDTHec+PC8y1s3tcpUAODgq6DEzQdHDf/cyvDMfmCaPiMxfIdmkns5lMa03hymIfSmLUF0jFFDc7biRp7uf9AAXNsrTmplHii0l0McuOOZGlSdZM4eL817P7UwJqFMxJyFXDjkubhQiX6kp25Kfuj/zLnupRCaiDvE7ho/xay6Jrv0XLz935TPDwkc7W1asLIvsZLheB+sRz9SMOb9gtrvk5WXZl5JTOFOLu+JaRwQLHL/xdcHJTOod7tqHYfpoC5JHrEwKzbhTOwxZBQBfTQjQktKENQtBxXHTe71rUEWfEZQGg60/BC4BrRmh4qJjlJu3v4VIhC7SSHn1"
|
2024-10-14 16:43:01 +08:00
|
|
|
# quartiq rj
|
2024-10-01 23:19:28 +08:00
|
|
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC27krR8G8Pb59YuYm7+X2mmNnVdk/t9myYgO8LH0zfb2MeeXX5+90nW9kMjKflJss/oLl8dkD85jbJ0fRbRkfJd20pGCqCUuYAbYKkowigFVEkbrbWSLkmf+clRjzJOuBuUA0uq0XKS17uMC3qhu+dDdBOAIKb3L83NfVE8p8Pjb4BPktQrdxefM43/x4jTMuc7tgxVmTOEge3+rmVPK2GnLkUBgBn8b6S+9ElPd63HXI5J5f61v21l5N9V0mhTu1pv6PiDRdFIlFDK9dLVZcZ2qlzpKmCnFrOoreBEgre44SpfFe5/MMItxvWiVsj/rij/rHZZiol1k7JiQCnEHeCCbjjvcBBka5HxZgcb3vBZVceTOawrmjbdbA2dq35sUptz/bEgdZ1UVCmVpWsdROAlEDBmSSbcVwxzcvhoKnkpbuP4Q0V3tVKSLW053ADFNB4frtwY5nAZfsVErFLLphjwb8nlyJoDRNapQrn5syEiW0ligX2AAskZTYIl2A5AYyWPrmX6HJOPqZGatMU3qQiRMxs+hFqhyyCmBgl0kcsgW09MBKtJWk1Fbii98MHqgRUN9R7AUiYy5p78Pnv9DC8DT8Ubl9zoP0g5d40P9NGK2LAhMxLXvtckJ4ERqbSEcNZJw+q4jBrOHnMTz+NLdAUiEtru+6T2OdhaHv+eiNlFQ=="
|
2024-10-14 16:43:01 +08:00
|
|
|
# quartiq rj
|
2024-10-01 23:19:28 +08:00
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMUaB2G1jexxfkdlly3fdWslH54/s/bOuvk9AxqpjtAY"
|
2024-10-14 16:43:01 +08:00
|
|
|
# quartiq pk
|
2024-10-02 20:24:33 +08:00
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIu6yhjCoZ62eamYrAXtFefDhplTRUIdD4tncwlkyAEH"
|
2022-03-15 17:51:21 +08:00
|
|
|
];
|
|
|
|
};
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
2022-03-17 13:05:59 +08:00
|
|
|
services.udev.packages = [ artiq.packages.x86_64-linux.openocd-bscanspi ];
|
2022-03-15 17:51:21 +08:00
|
|
|
|
2023-03-14 15:24:55 +08:00
|
|
|
nix.settings.trusted-public-keys = ["nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc="];
|
|
|
|
nix.settings.substituters = ["https://nixbld.m-labs.hk"];
|
2022-03-15 17:51:21 +08:00
|
|
|
nix.extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
'';
|
|
|
|
nix.nixPath = [ "nixpkgs=${pkgs.path}" ];
|
|
|
|
|
|
|
|
# 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.
|
2024-07-17 17:02:54 +08:00
|
|
|
system.stateVersion = "24.05"; # Did you read the comment?
|
2022-03-15 17:51:21 +08:00
|
|
|
}
|