nixos-config

NixOS configs for my systems
Log | Files | Refs

commit 4983764e1e1c57574a4380244ac21789961a5417
parent d779a2d56f48b757fcb51e7005ae38592329aded
Author: vin <vin@vineetk.net>
Date:   Thu,  9 Jan 2025 00:39:53 -0500

edit desktop config

Diffstat:
Mhosts/demiurge/default.nix | 175++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
1 file changed, 106 insertions(+), 69 deletions(-)

diff --git a/hosts/demiurge/default.nix b/hosts/demiurge/default.nix @@ -6,30 +6,37 @@ { imports = - [ # Include the results of the hardware scan. + [ ./hardware.nix home-manager.nixosModules.default ]; - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + # boot options + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + zfs.extraPools = [ "hgst" "backup" "data_warm" ]; + }; - boot.zfs.extraPools = [ "hgst" "backup" "data_warm" ]; + # disable wifi and open some ports + networking = { + hostName = "demiurge"; + hostId = "cafebabe"; - networking.hostName = "demiurge"; # Define your hostname. - networking.hostId = "cafebabe"; - # Pick only one of the below networking options. - networking.wireless.enable = false; # Enables wireless support via wpa_supplicant. - # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + wireless.enable = false; + + firewall = { + allowedTCPPorts = [ 22 80 443 ]; + allowedUDPPorts = [ 51413 ]; + }; + }; # Set your time zone. time.timeZone = "America/Toronto"; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; console = { @@ -42,32 +49,57 @@ # Define a user account. users.users.vin = { isNormalUser = true; + extraGroups = [ "kvm" "libvirtd" + "transmission" "wheel" ]; + shell = pkgs.zsh; - openssh.authorizedKeys.keys = - [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEvM0xCLziR+ZT/SYE1aZM6dklbw4fEC17TWqbADIZRH kou@demiurge" ]; + + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEvM0xCLziR+ZT/SYE1aZM6dklbw4fEC17TWqbADIZRH kou@demiurge" + ]; }; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - doas-sudo-shim - emacs - git - wget - #inputs.everblush-gtk.packages.x86_64-linux.default - ]; - environment.pathsToLink = [ "/share/zsh" ]; + # default packages for both me and root + environment = { + systemPackages = with pkgs; [ + doas-sudo-shim + emacs + git + wget + ]; - programs = { - zsh.enable = true; + pathsToLink = [ "/share/zsh" ]; + }; + # enable bluetooth and add some udev rules + hardware = { + bluetooth.enable = true; + flipperzero.enable = true; + keyboard.qmk.enable = true; + }; + + programs = { # for gtk in home-manager dconf.enable = true; + + # gpg + gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryPackage = pkgs.pinentry-rofi; + settings.default-cache-ttl = 600; + }; + + # disable nano. I don't like nano. + nano.enable = false; + + # configuration in home-manager + zsh.enable = true; }; # Some programs need SUID wrappers, can be configured further or are @@ -78,20 +110,47 @@ # enableSSHSupport = true; # }; - security.sudo.enable = false; - security.doas.enable = true; - security.doas.extraRules = [{ - users = ["vin"]; - keepEnv = true; - persist = true; - }]; + security = { + sudo.enable = false; - # List services that you want to enable: + # I prefer doas over sudo for simplicity + doas = { + enable = true; + extraRules = [{ + users = ["vin"]; + keepEnv = true; + persist = true; + }]; + }; + }; services = { - libinput.enable = true; - openssh.enable = true; + # graphical input + libinput = { + enable = true; + + mouse.accelProfile = "flat"; + + touchpad = { + accelProfile = "flat"; + tapping = true; + tappingButtonMap = "lrm"; + }; + }; + + # ssh + openssh = { + enable = true; + + settings = { + KbdInteractiveAuthentication = false; + PasswordAuthentication = false; + PermitRootLogin = "no"; + X11Forwarding = true; + }; + }; + # llm ollama = { enable = true; acceleration = "rocm"; @@ -106,24 +165,29 @@ ]; }; + # sound. for some reason, pipewire enabled itself when I tried + # using pulseaudio and home-manager, so had to disable pulseaudio. pipewire = { enable = true; pulse.enable = true; }; + # torrents transmission = { enable = true; downloadDirPermissions = "770"; openPeerPorts = true; settings = { - download-dir = "/data/torrents/complete/other"; - incomplete-dir = "/data/torrents/incomplete/"; + download-dir = "/data_warm/torrents/complete/other"; + incomplete-dir = "/data_warm/torrents/incomplete/"; incomplete-dir-enabled = true; peer-port = 51413; }; }; + # to get startx and use amdgpu driver + # WM in home-manager xserver = { enable = true; autorun = false; @@ -132,6 +196,7 @@ }; }; + # create caches and use mandoc documentation.man = { enable = true; generateCaches = true; @@ -139,33 +204,5 @@ mandoc.enable = true; }; - # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 22 80 443 ]; - networking.firewall.allowedUDPPorts = [ 51413 ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - - # This option defines the first version of NixOS you have installed on this particular machine, - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. - # - # Most users should NEVER change this value after the initial install, for any reason, - # even if you've upgraded your system to a new NixOS release. - # - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, - # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how - # to actually do that. - # - # This value being lower than the current NixOS release does NOT mean your system is - # out of date, out of support, or vulnerable. - # - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, - # and migrated your data accordingly. - # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . - system.stateVersion = "24.05"; # Did you read the comment? + system.stateVersion = "24.05"; }