Skip to content

Instantly share code, notes, and snippets.

@ingenieroariel
Created September 4, 2024 16:11
Show Gist options
  • Save ingenieroariel/5ee960be299e139f0e85aada80f5fc44 to your computer and use it in GitHub Desktop.
Save ingenieroariel/5ee960be299e139f0e85aada80f5fc44 to your computer and use it in GitHub Desktop.
{ config, lib, pkgs, ... }:
let
srcPkgs = import /src {
overlays = [ (
final: prev: {
mesa = pkgs.callPackage ./apple-silicon-support/packages/mesa-asahi-edge {};
arcane = pkgs.callPackage ./apple-silicon-support/packages/arcan {mesa = final.mesa; } ;
m1n1 = pkgs.callPackage ./apple-silicon-support/packages/m1n1 {} ;
firefox = (pkgs.wrapFirefox.override { libpulseaudio = pkgs.libpressureaudio; }) pkgs.firefox-unwrapped { };
}
)];
};
myPythonPackages = (ps: with ps; [
openpyxl
gdal
geopandas
pyarrow
pandas
networkx
duckdb
ipdb
h3
pillow
dateutil
scikit-learn
shapely
simplejson
six
geopy
matplotlib
numpy
torch
click
construct
jupyterlab
]);
in
{
imports = [ ./hardware-configuration.nix ./apple-silicon-support ];
nixpkgs.config.allowUnfree = true;
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
customRC = ''
set number
set cc=80
set list
set listchars=tab:→\ ,nbsp:␣,trail:•,eol:¶,precedes:«,extends:»
if &diff
colorscheme blue
endif
'';
packages.myVimPackage = with pkgs.vimPlugins; {
start = [ ctrlp ];
};
};
};
systemd.services.durden = {
enable = true;
description = "Arcan Durden";
after = [ "sysinit.target" ];
wants = [ "basic.target" ];
wantedBy = [ "sysinit.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${srcPkgs.arcane}/bin/arcan -d /var/arcan/arcan.sqlite durden";
};
environment = {
ARCAN_LOGPATH="/var/arcan/logs";
ARCAN_RENDER_NODE="/dev/dri/renderD128";
ARCAN_RESOURCEPATH="/var/arcan/resources";
ARCAN_STATEPATH="/var/arcan/state";
ARCAN_APPLBASEPATH="/srv/appls";
ARCAN_APPLSTOREPATH="/srv/appls";
XDG_RUNTIME_DIR="/var/arcan/runtime";
NIXOS_OZONE_WL="1";
LASH_BASE="/var/arcan/lash";
};
};
#services.create_ap = {
# enable = true;
# settings = {
# INTERNET_IFACE = "end0";
# WIFI_IFACE = "wlan0";
# SSID = "arcan-net";
# PASSPHRASE = "12345678";
# };
#};
users.users.x = {
isNormalUser = true;
home = "/x";
extraGroups = [ "wheel" "networkmanager" "input" "audio" "video"];
};
#PragmataPro_Mono_R_liga_0830.ttf
fonts.fontconfig = {
defaultFonts.monospace = ["PragmataPro_Mono_R_0830 Regular"];
defaultFonts.serif = ["PragmataPro Liga Regular"];
defaultFonts.sansSerif = ["PragmataPro Liga Regular"];
};
fonts.fontDir.enable = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
open-sans
];
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
nix.nixPath = [
"nixpkgs=/src" "nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/apple-silicon/packages/overlays"
];
nix.settings.experimental-features = [
"nix-command" "flakes" "ca-derivations"
];
nix.settings.substituters = [];
nix.settings.trusted-public-keys = [];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
boot.loader.timeout = 0;
hardware.asahi.enable = true;
hardware.asahi.setupAsahiSound = true;
services.pipewire.enable = true;
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
hardware.asahi.peripheralFirmwareDirectory = ./firmware;
hardware.graphics.enable = true;
hardware.asahi.withRust = true;
hardware.asahi.useExperimentalGPUDriver = true;
hardware.asahi.experimentalGPUInstallMode = "overlay";
services.xserver.enable = true;
services.xserver.autorun = false;
services.displayManager.enable = lib.mkForce false;
services.xserver.displayManager.lightdm.enable = lib.mkForce false;
services.xserver.config = ''
Section "OutputClass"
Identifier "appledrm"
MatchDriver "apple"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
'';
boot.kernel.sysctl = {
# Dramatically increase maximum argument length
"kernel.arg_max" = 134217728; # 128MB
# Increase maximum number of arguments
"kernel.max_arg_pages" = 32768; # 128MB worth of pages
# Increase maximum number of open files
"fs.file-max" = 2097152;
};
# Rebuild the kernel with increased limits
boot.kernelParams = [ "arg_max=134217728" ];
# Increase systemd service limits
systemd.extraConfig = ''
DefaultLimitSTACK=infinity
DefaultLimitDATA=infinity
DefaultLimitRSS=infinity
DefaultLimitNOFILE=1048576
'';
# Increase limits for user sessions
security.pam.loginLimits = [
{ domain = "*"; type = "-"; item = "nofile"; value = "1048576"; }
{ domain = "*"; type = "-"; item = "memlock"; value = "unlimited"; }
];
services.pipewire.wireplumber.extraConfig.bluetoothEnhancements = {
"monitor.bluez.properties" = {
"bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true;
"bluez5.roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ];
};
};
networking.wireless.iwd.enable = true;
networking.wireless.iwd.settings.General.EnableNetworkConfiguration = true;
networking.networkmanager.enable = false;
networking.firewall.enable = true;
time.timeZone = "America/New_York";
security.rtkit.enable = true;
system.stateVersion = "24.05";
environment.systemPackages = with srcPkgs; [
p7zip
picocom
m1n1
git
ripgrep
tmux
zenith
zsh
arcane
firefox-devedition
xarcan
vkmark
mangohud
glances
parallel
google-cloud-sdk
unzip
duckdb
buildah
krunvm
mangohud
vulkan-tools
glxinfo
vkmark
glmark2
godot_4
blender
(qgis.override { extraPythonPackages = myPythonPackages; })
(python311.withPackages(myPythonPackages))
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment