dotfiles/common/base.nix

60 lines
1.5 KiB
Nix
Raw Normal View History

2024-08-02 14:09:42 +02:00
{ pkgs, ... }:
{
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
kernelPackages = pkgs.linuxPackages_zen;
initrd.systemd.enable = true;
binfmt.emulatedSystems = [ "aarch64-linux" ];
};
# Temporary files
boot.tmp.useTmpfs = true;
systemd.services.nix-daemon = {
environment.TMPDIR = "/var/tmp";
2024-08-02 14:09:42 +02:00
};
system.switch = {
enable = false;
enableNg = true;
};
services.fstrim.enable = true;
2024-09-19 16:51:53 +02:00
services.fwupd.enable = true;
2024-08-02 14:09:42 +02:00
time.timeZone = "Europe/Stockholm";
environment.systemPackages = with pkgs; [
btrfs-progs
btrfs-snap
git
glibcLocales
qemu_kvm
qemu-utils
vim
zstd
];
# Use fish, but not in /etc/passwd . See https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
programs.bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
shellInit = ''
export NIX_LD=$(nix eval --impure --raw --expr 'let pkgs = import <nixpkgs> {}; NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"; in NIX_LD')
'';
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
}