more reorg

This commit is contained in:
Matt Nish-Lapidus 2025-02-08 22:48:41 -05:00
parent f3413ce790
commit a058fa3c90
6 changed files with 251 additions and 230 deletions

View file

@ -14,7 +14,8 @@
waybar waybar
desktop desktop
music music
# shikane langs
emacs
]; ];
home = { home = {
@ -26,10 +27,7 @@
] ]
(with pkgs; [ (with pkgs; [
guix samba4Full
thonny
dconf dconf
xorg.libX11 xorg.libX11
xorg.libxcb xorg.libxcb
@ -37,65 +35,19 @@
fstl fstl
dbus dbus
gst_all_1.gstreamer
alsa-oss alsa-oss
sops sops
ispell ispell
(aspellWithDicts (dicts: with dicts; [ en en-computers en-science es fr ])) (aspellWithDicts (dicts: with dicts; [ en en-computers en-science es fr ]))
texlive.combined.scheme-full texlive.combined.scheme-full
guile
python3
ruff
(sbcl.withPackages (ps: with ps; [
cffi
arrow-macros
alexandria
serapeum
]))
ccl
racket
gdu
poppler_utils
cljfmt
libxml2
nixfmt-rfc-style
php
rustup
shfmt
html-tidy
openal
procs
rpi-imager
icloudpd
borgbackup
trash-cli
spice spice
spice-gtk spice-gtk
spice-protocol spice-protocol
virt-viewer virt-viewer
virt-manager virt-manager
jre
tesseract
alsa-utils
alsa-tools
dockfmt
impala
tree-sitter
(tree-sitter.withPlugins (_: tree-sitter.allGrammars))
]) ])
]; ];
@ -125,7 +77,6 @@
stateVersion = "24.05"; stateVersion = "24.05";
}; };
sops = { sops = {
age.keyFile = "/home/emenel/.config/sops/age/keys.txt"; # must have no password! age.keyFile = "/home/emenel/.config/sops/age/keys.txt"; # must have no password!
@ -147,37 +98,13 @@
}; };
}; };
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
emacs = {
enable = true;
package = ((pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages (
epkgs: [
epkgs.vterm
epkgs.all-the-icons
epkgs.mu4e
epkgs.sly
epkgs.sly-quicklisp
epkgs.geiser-racket
epkgs.editorconfig
epkgs.shfmt
epkgs.nixpkgs-fmt
epkgs.nixfmt
epkgs.parinfer-rust-mode
epkgs.manualPackages.tree-sitter-langs
epkgs.manualPackages.treesit-grammars.with-all-grammars
epkgs.pretty-sha-path
epkgs.pdf-tools
]
));
};
pandoc.enable = true; pandoc.enable = true;
password-store.enable = true; password-store.enable = true;
}; };
services = { services = {
playerctld = { playerctld = {
enable = true; enable = true;
@ -193,33 +120,6 @@
gpg-agent = { gpg-agent = {
enable = true; enable = true;
}; };
emacs = {
enable = true;
defaultEditor = true;
package = ((pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages (
epkgs: [
epkgs.vterm
epkgs.mu4e
epkgs.sly
epkgs.sly-quicklisp
epkgs.geiser-racket
epkgs.editorconfig
epkgs.shfmt
epkgs.nixpkgs-fmt
epkgs.nixfmt
epkgs.parinfer-rust-mode
epkgs.manualPackages.tree-sitter-langs
epkgs.manualPackages.treesit-grammars.with-all-grammars
epkgs.pretty-sha-path
epkgs.pdf-tools
]
));
socketActivation.enable = true;
client = {
enable = true;
arguments = ["-n" "-r"];
};
};
}; };
xdg.systemDirs.data = [ xdg.systemDirs.data = [
@ -240,17 +140,10 @@
# moving files! # moving files!
xdg.configFile."git".source = ./dotfiles/dot_config/git; xdg.configFile."git".source = ./dotfiles/dot_config/git;
home.file.".npmrc".source = ./dotfiles/dot_npmrc;
home.file.".sbclrc".source = ./dotfiles/dot_sbclrc;
home.file.".signature".source = ./dotfiles/dot_signature; home.file.".signature".source = ./dotfiles/dot_signature;
xdg.configFile."emacs".enable = false;
home.file.".local/bin" = { home.file.".local/bin" = {
source = ./dotfiles/dot_local/bin; source = ./dotfiles/dot_local/bin;
recursive = true; recursive = true;
}; };
} }

View file

@ -2,37 +2,48 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ nix-config, config, pkgs, inputs, ... }: {
nix-config,
config,
pkgs,
inputs,
...
}:
{ {
imports = with nix-config.nixosModules; imports = with nix-config.nixosModules; [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./razer-speaker-fix.nix ./razer-speaker-fix.nix
niri niri
]; ];
nixpkgs = { nixpkgs = {
config = { config = {
allowUnfree = true; allowUnfree = true;
}; };
overlays = builtins.attrValues nix-config.overlays overlays = builtins.attrValues nix-config.overlays ++ [
++ [ inputs.niri.overlays.niri
inputs.niri.overlays.niri inputs.emacs-overlay.overlays.default
inputs.emacs-overlay.overlays.default inputs.audio.overlays.default
inputs.audio.overlays.default inputs.nix-rice.overlays.default
inputs.nix-rice.overlays.default ];
];
}; };
nix = { nix = {
# registry.nixpkgs.flake = nixpkgs; # registry.nixpkgs.flake = nixpkgs;
# channel.enable = false; # channel.enable = false;
settings = { settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [
substituters = [ "https://nix-community.cachix.org" "https://cache.garnix.io" ]; "nix-command"
"flakes"
];
substituters = [
"https://nix-community.cachix.org"
"https://cache.garnix.io"
];
trusted-public-keys = [ trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
@ -77,14 +88,23 @@
}; };
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
initrd.systemd.enable = true; initrd.systemd.enable = true;
initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" "snd-virmidi" ]; initrd.kernelModules = [
kernelParams = [ "nvidia_drm.fbdev=1" "nvidia_drm.modeset=1" ]; "nvidia"
"nvidia_modeset"
"nvidia_uvm"
"nvidia_drm"
"snd-virmidi"
];
kernelParams = [
"nvidia_drm.fbdev=1"
"nvidia_drm.modeset=1"
];
}; };
systemd.services.tailscaled.after = ["NetworkManager-wait-online.service"]; systemd.services.tailscaled.after = [ "NetworkManager-wait-online.service" ];
systemd.sleep.extraConfig = '' systemd.sleep.extraConfig = ''
HibernateDelaySec=2h HibernateDelaySec=2h
''; '';
documentation = { documentation = {
dev.enable = true; dev.enable = true;
@ -169,46 +189,46 @@
services.logind = { services.logind = {
extraConfig = '' extraConfig = ''
IdleAction=lock IdleAction=lock
IdleActionSec=5m IdleActionSec=5m
''; '';
}; };
services.udev = { services.udev = {
extraRules = '' extraRules = ''
DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660" DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660"
''; '';
packages = [ packages = [
pkgs.via pkgs.via
pkgs.vial pkgs.vial
(pkgs.writeTextFile { (pkgs.writeTextFile {
name = "on-battery"; name = "on-battery";
text = '' text = ''
# Rule for when switching to battery # Rule for when switching to battery
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set balanced" SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set balanced"
''; '';
destination = "/etc/udev/rules.d/60-onbattery.rules"; destination = "/etc/udev/rules.d/60-onbattery.rules";
}) })
(pkgs.writeTextFile { (pkgs.writeTextFile {
name = "on-power"; name = "on-power";
text = '' text = ''
# Rule for when switching to ac # Rule for when switching to ac
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set performance" SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set performance"
''; '';
destination = "/etc/udev/rules.d/61-onpower.rules"; destination = "/etc/udev/rules.d/61-onpower.rules";
}) })
(pkgs.writeTextFile { (pkgs.writeTextFile {
name = "hibernate-low-battery"; name = "hibernate-low-battery";
text = '' text = ''
# Suspend the system when battery level drops to 5% or lower # Suspend the system when battery level drops to 5% or lower
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="${pkgs.systemd}/bin/systemctl hibernate" SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="${pkgs.systemd}/bin/systemctl hibernate"
''; '';
destination = "/etc/udev/rules.d/99-hibernate-low-battery.rules"; destination = "/etc/udev/rules.d/99-hibernate-low-battery.rules";
}) })
(pkgs.writeTextFile { (pkgs.writeTextFile {
name = "on-battery-power-saver"; name = "on-battery-power-saver";
text = '' text = ''
# Switch to power-saver when battery below 50% # Switch to power-saver when battery below 50%
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5][0-9]", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver" SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5][0-9]", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver"
''; '';
destination = "/etc/udev/rules.d/62-power-save-battery.rules"; destination = "/etc/udev/rules.d/62-power-save-battery.rules";
}) })
@ -217,15 +237,21 @@
security.polkit.enable = true; security.polkit.enable = true;
security.rtkit.enable = true; security.rtkit.enable = true;
security.pam.services.swaylock = {}; security.pam.services.swaylock = { };
security.pam.services.hyprlock = {}; security.pam.services.hyprlock = { };
services.xserver.videoDrivers = [ "nvidia" "modesetting" ]; services.xserver.videoDrivers = [
"nvidia"
"modesetting"
];
networking = { networking = {
hostName = "eddie"; hostName = "eddie";
domain = "local"; domain = "local";
nameservers = [ "1.1.1.1" "1.0.0.1" ]; nameservers = [
"1.1.1.1"
"1.0.0.1"
];
networkmanager = { networkmanager = {
enable = true; enable = true;
wifi.powersave = true; wifi.powersave = true;
@ -250,10 +276,10 @@
services.resolved = { services.resolved = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
LLMNR=no LLMNR=no
ReadEtcHosts=no ReadEtcHosts=no
DNSSEC=no DNSSEC=no
''; '';
}; };
# Set your time zone. # Set your time zone.
@ -417,14 +443,14 @@
programs.fish.enable = true; programs.fish.enable = true;
environment.pathsToLink = [ "/share/fish" ]; environment.pathsToLink = [ "/share/fish" ];
programs.bash = { programs.bash = {
interactiveShellInit = '' interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi fi
''; '';
}; };
services.flatpak.enable = true; services.flatpak.enable = true;
services.dbus.implementation = "broker"; services.dbus.implementation = "broker";
@ -443,37 +469,37 @@
services.gnome.gnome-online-accounts.enable = true; services.gnome.gnome-online-accounts.enable = true;
services.kmonad = { services.kmonad = {
enable = true; enable = true;
keyboards = { keyboards = {
sinc = { sinc = {
device = "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd"; device = "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd";
config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/sinc.kbd; config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/sinc.kbd;
}; };
razer = { razer = {
extraGroups = [ "openrazer" ]; extraGroups = [ "openrazer" ];
device = "/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd"; device = "/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd";
config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/razer.kbd; config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/razer.kbd;
}; };
}; };
}; };
# programs.virt-manager.enable = true; programs.virt-manager.enable = true;
# virtualisation = { virtualisation = {
# libvirtd = { libvirtd = {
# enable = true; enable = true;
# qemu = { qemu = {
# package = pkgs.qemu_kvm; package = pkgs.qemu_kvm;
# swtpm.enable = true; swtpm.enable = true;
# ovmf.enable = true; ovmf.enable = true;
# ovmf.packages = [ pkgs.OVMFFull.fd ]; ovmf.packages = [ pkgs.OVMFFull.fd ];
# }; };
# }; };
# spiceUSBRedirection.enable = true; spiceUSBRedirection.enable = true;
# }; };
# services.qemuGuest.enable = true; services.qemuGuest.enable = true;
# services.spice-vdagentd.enable = true; services.spice-vdagentd.enable = true;
programs.appimage = { programs.appimage = {
enable = true; enable = true;
@ -485,35 +511,35 @@
programs.nix-ld.enable = true; programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [ programs.nix-ld.libraries = with pkgs; [
zlib zlib
zstd zstd
stdenv.cc.cc stdenv.cc.cc
curlFull curlFull
openssl.out openssl.out
attr attr
libssh libssh
libxcrypt.out libxcrypt.out
bzip2 bzip2
libxml2 libxml2
acl acl
libsodium libsodium
util-linux util-linux
xz xz
systemd systemd
fontconfig fontconfig
freetype freetype
gnutls gnutls
util-linux util-linux
libGL.dev libGL.dev
psutils psutils
egl-wayland egl-wayland
eglexternalplatform eglexternalplatform
glfw-wayland glfw-wayland
glfw glfw
libGLU.dev libGLU.dev
libuv.out libuv.out
libressl.out libressl.out
libudev-zero.out libudev-zero.out
]; ];
fonts = { fonts = {
@ -569,7 +595,22 @@
users.users.emenel = { users.users.emenel = {
isNormalUser = true; isNormalUser = true;
description = "emenel"; description = "emenel";
extraGroups = [ "networkmanager" "network" "wheel" "uinput" "uucp" "dialout" "input" "audio" "video" "libvirtd" "nvidia" "cups" "openrazer" "plugdev" ]; extraGroups = [
"networkmanager"
"network"
"wheel"
"uinput"
"uucp"
"dialout"
"input"
"audio"
"video"
"libvirtd"
"nvidia"
"cups"
"openrazer"
"plugdev"
];
packages = with pkgs; [ packages = with pkgs; [
git git
]; ];
@ -578,6 +619,4 @@
#do not change #do not change
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View file

@ -11,10 +11,11 @@
maim maim
wayland-utils wayland-utils
libheif.out libheif.out
rpi-imager
thonny
freecad freecad
flatpak flatpak
gst_all_1.gstreamer
prusa-slicer prusa-slicer
via via
vial vial
@ -42,11 +43,11 @@
sane-airscan sane-airscan
xsane xsane
bitwarden-cli bitwarden-cli
bitwarden-desktop bitwarden-desktop
tailscale tailscale
trayscale trayscale
font-manager font-manager
squirreldisk squirreldisk
@ -118,7 +119,7 @@
paleta paleta
wayback wayback
protonplus protonplus
]; ];
@ -155,6 +156,6 @@
firefox.enable = true; firefox.enable = true;
}; };
xdg.configFile."halloy/config.toml".source = ./dotfiles/dot_config/halloy/config.toml; xdg.configFile."halloy/config.toml".source = ../../homes/emenel/dotfiles/dot_config/halloy/config.toml;
} }

41
modules/home/emacs.nix Normal file
View file

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
let
emacs_pkg = ((pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages (
epkgs: [
epkgs.vterm
epkgs.mu4e
epkgs.sly
epkgs.sly-quicklisp
epkgs.geiser-racket
epkgs.editorconfig
epkgs.shfmt
epkgs.nixpkgs-fmt
epkgs.nixfmt
epkgs.parinfer-rust-mode
epkgs.manualPackages.tree-sitter-langs
epkgs.manualPackages.treesit-grammars.with-all-grammars
epkgs.pretty-sha-path
epkgs.pdf-tools
epkgs.all-the-icons
]
));
in {
programs.emacs = {
enable = true;
package = emacs_pkg;
};
services.emacs = {
enable = true;
defaultEditor = true;
package = emacs_pkg;
socketActivation.enable = true;
client = {
enable = true;
arguments = ["-n" "-r"];
};
};
xdg.configFile."emacs".enable = false;
}

37
modules/home/langs.nix Normal file
View file

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
{
home.packages = with pkgs; [
guix
guile
python3
ruff
(sbcl.withPackages (ps: with ps; [
cffi
arrow-macros
alexandria
serapeum
]))
ccl
racket
gdu
cljfmt
libxml2
nixfmt-rfc-style
php
rustup
shfmt
html-tidy
openal
procs
jre
tree-sitter
(tree-sitter.withPlugins (_: tree-sitter.allGrammars))
];
home.file.".npmrc".source = ../../homes/emenel/dotfiles/dot_npmrc;
home.file.".sbclrc".source = ../../homes/emenel/dotfiles/dot_sbclrc;
}

View file

@ -41,7 +41,6 @@
openssl openssl
exiftool exiftool
libsecret libsecret
samba4Full
shellcheck shellcheck
libffi.dev libffi.dev
nodejs_18 nodejs_18
@ -93,6 +92,17 @@
ghostscript ghostscript
playerctl playerctl
impala
tesseract
alsa-utils
alsa-tools
dockfmt
icloudpd
borgbackup
trash-cli
poppler_utils
]; ];