diff --git a/homes/emenel/default.nix b/homes/emenel/default.nix index c3bf680..fe86fd6 100644 --- a/homes/emenel/default.nix +++ b/homes/emenel/default.nix @@ -14,7 +14,8 @@ waybar desktop music - # shikane + langs + emacs ]; home = { @@ -26,10 +27,7 @@ ] (with pkgs; [ - guix - thonny - - + samba4Full dconf xorg.libX11 xorg.libxcb @@ -37,65 +35,19 @@ fstl dbus - gst_all_1.gstreamer + alsa-oss sops ispell (aspellWithDicts (dicts: with dicts; [ en en-computers en-science es fr ])) 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-gtk spice-protocol virt-viewer 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"; }; - sops = { age.keyFile = "/home/emenel/.config/sops/age/keys.txt"; # must have no password! @@ -147,37 +98,13 @@ }; }; - programs = { 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; password-store.enable = true; }; - services = { playerctld = { enable = true; @@ -193,33 +120,6 @@ gpg-agent = { 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 = [ @@ -240,17 +140,10 @@ # moving files! 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; - xdg.configFile."emacs".enable = false; - home.file.".local/bin" = { source = ./dotfiles/dot_local/bin; recursive = true; }; - - - } diff --git a/hosts/eddie/configuration.nix b/hosts/eddie/configuration.nix index d255086..e19cb6c 100644 --- a/hosts/eddie/configuration.nix +++ b/hosts/eddie/configuration.nix @@ -2,37 +2,48 @@ # your system. Help is available in the configuration.nix(5) man page # 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; - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ./razer-speaker-fix.nix + imports = with nix-config.nixosModules; [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ./razer-speaker-fix.nix - niri - ]; + niri + ]; nixpkgs = { config = { allowUnfree = true; }; - overlays = builtins.attrValues nix-config.overlays - ++ [ - inputs.niri.overlays.niri - inputs.emacs-overlay.overlays.default - inputs.audio.overlays.default - inputs.nix-rice.overlays.default - ]; + overlays = builtins.attrValues nix-config.overlays ++ [ + inputs.niri.overlays.niri + inputs.emacs-overlay.overlays.default + inputs.audio.overlays.default + inputs.nix-rice.overlays.default + ]; }; nix = { # registry.nixpkgs.flake = nixpkgs; # channel.enable = false; settings = { - experimental-features = [ "nix-command" "flakes" ]; - substituters = [ "https://nix-community.cachix.org" "https://cache.garnix.io" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; + substituters = [ + "https://nix-community.cachix.org" + "https://cache.garnix.io" + ]; trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" @@ -77,14 +88,23 @@ }; kernelPackages = pkgs.linuxPackages_latest; initrd.systemd.enable = true; - initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" "snd-virmidi" ]; - kernelParams = [ "nvidia_drm.fbdev=1" "nvidia_drm.modeset=1" ]; + initrd.kernelModules = [ + "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 = '' - HibernateDelaySec=2h - ''; + HibernateDelaySec=2h + ''; documentation = { dev.enable = true; @@ -169,46 +189,46 @@ services.logind = { extraConfig = '' - IdleAction=lock - IdleActionSec=5m + IdleAction=lock + IdleActionSec=5m ''; }; services.udev = { 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 = [ pkgs.via pkgs.vial (pkgs.writeTextFile { name = "on-battery"; text = '' - # Rule for when switching to battery - SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set balanced" + # Rule for when switching to battery + 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"; }) (pkgs.writeTextFile { name = "on-power"; text = '' - # Rule for when switching to ac - SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set performance" + # Rule for when switching to ac + 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"; }) (pkgs.writeTextFile { name = "hibernate-low-battery"; text = '' - # 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" + # 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" ''; destination = "/etc/udev/rules.d/99-hibernate-low-battery.rules"; }) (pkgs.writeTextFile { name = "on-battery-power-saver"; text = '' - # 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" + # 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" ''; destination = "/etc/udev/rules.d/62-power-save-battery.rules"; }) @@ -217,15 +237,21 @@ security.polkit.enable = true; security.rtkit.enable = true; - security.pam.services.swaylock = {}; - security.pam.services.hyprlock = {}; + security.pam.services.swaylock = { }; + security.pam.services.hyprlock = { }; - services.xserver.videoDrivers = [ "nvidia" "modesetting" ]; + services.xserver.videoDrivers = [ + "nvidia" + "modesetting" + ]; networking = { hostName = "eddie"; domain = "local"; - nameservers = [ "1.1.1.1" "1.0.0.1" ]; + nameservers = [ + "1.1.1.1" + "1.0.0.1" + ]; networkmanager = { enable = true; wifi.powersave = true; @@ -250,10 +276,10 @@ services.resolved = { enable = true; extraConfig = '' - LLMNR=no - ReadEtcHosts=no - DNSSEC=no - ''; + LLMNR=no + ReadEtcHosts=no + DNSSEC=no + ''; }; # Set your time zone. @@ -417,14 +443,14 @@ programs.fish.enable = true; environment.pathsToLink = [ "/share/fish" ]; 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 - ''; - }; + 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 + ''; + }; services.flatpak.enable = true; services.dbus.implementation = "broker"; @@ -443,37 +469,37 @@ services.gnome.gnome-online-accounts.enable = true; services.kmonad = { - enable = true; - keyboards = { - sinc = { - device = "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd"; - config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/sinc.kbd; - }; - razer = { - extraGroups = [ "openrazer" ]; - device = "/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd"; - config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/razer.kbd; - }; - }; - }; + enable = true; + keyboards = { + sinc = { + device = "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd"; + config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/sinc.kbd; + }; + razer = { + extraGroups = [ "openrazer" ]; + device = "/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd"; + config = builtins.readFile ../../homes/emenel/dotfiles/dot_config/kmonad/razer.kbd; + }; + }; + }; - # programs.virt-manager.enable = true; + programs.virt-manager.enable = true; - # virtualisation = { - # libvirtd = { - # enable = true; - # qemu = { - # package = pkgs.qemu_kvm; - # swtpm.enable = true; - # ovmf.enable = true; - # ovmf.packages = [ pkgs.OVMFFull.fd ]; - # }; - # }; - # spiceUSBRedirection.enable = true; - # }; + virtualisation = { + libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_kvm; + swtpm.enable = true; + ovmf.enable = true; + ovmf.packages = [ pkgs.OVMFFull.fd ]; + }; + }; + spiceUSBRedirection.enable = true; + }; - # services.qemuGuest.enable = true; - # services.spice-vdagentd.enable = true; + services.qemuGuest.enable = true; + services.spice-vdagentd.enable = true; programs.appimage = { enable = true; @@ -485,35 +511,35 @@ programs.nix-ld.enable = true; programs.nix-ld.libraries = with pkgs; [ - zlib - zstd - stdenv.cc.cc - curlFull - openssl.out - attr - libssh - libxcrypt.out - bzip2 - libxml2 - acl - libsodium - util-linux - xz - systemd - fontconfig - freetype - gnutls - util-linux - libGL.dev - psutils - egl-wayland - eglexternalplatform - glfw-wayland - glfw - libGLU.dev - libuv.out - libressl.out - libudev-zero.out + zlib + zstd + stdenv.cc.cc + curlFull + openssl.out + attr + libssh + libxcrypt.out + bzip2 + libxml2 + acl + libsodium + util-linux + xz + systemd + fontconfig + freetype + gnutls + util-linux + libGL.dev + psutils + egl-wayland + eglexternalplatform + glfw-wayland + glfw + libGLU.dev + libuv.out + libressl.out + libudev-zero.out ]; fonts = { @@ -569,7 +595,22 @@ users.users.emenel = { isNormalUser = true; 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; [ git ]; @@ -578,6 +619,4 @@ #do not change system.stateVersion = "24.05"; - - } diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index 3f79151..7ac2006 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -11,10 +11,11 @@ maim wayland-utils libheif.out - + rpi-imager + thonny freecad flatpak - + gst_all_1.gstreamer prusa-slicer via vial @@ -42,11 +43,11 @@ sane-airscan xsane - bitwarden-cli - bitwarden-desktop - tailscale - trayscale - font-manager + bitwarden-cli + bitwarden-desktop + tailscale + trayscale + font-manager squirreldisk @@ -118,7 +119,7 @@ paleta wayback - protonplus + protonplus ]; @@ -155,6 +156,6 @@ 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; } diff --git a/modules/home/emacs.nix b/modules/home/emacs.nix new file mode 100644 index 0000000..fc1ae1c --- /dev/null +++ b/modules/home/emacs.nix @@ -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; + +} diff --git a/modules/home/langs.nix b/modules/home/langs.nix new file mode 100644 index 0000000..3fddd02 --- /dev/null +++ b/modules/home/langs.nix @@ -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; + +} diff --git a/modules/home/shell-conf.nix b/modules/home/shell-conf.nix index 4296f6a..e7e3676 100644 --- a/modules/home/shell-conf.nix +++ b/modules/home/shell-conf.nix @@ -41,7 +41,6 @@ openssl exiftool libsecret - samba4Full shellcheck libffi.dev nodejs_18 @@ -93,6 +92,17 @@ ghostscript playerctl + impala + tesseract + alsa-utils + alsa-tools + dockfmt + icloudpd + + borgbackup + trash-cli + + poppler_utils ];