diff --git a/hosts/steamdeck/configuration.nix b/hosts/steamdeck/configuration.nix index 626ae8d..eed5bba 100644 --- a/hosts/steamdeck/configuration.nix +++ b/hosts/steamdeck/configuration.nix @@ -1,5 +1,4 @@ -# Modify the kernel and v4l2loopback section in your configuration.nix -{ config, pkgs, lib, ... }: +{ pkgs, lib, ... }: let jovianNixosRev = "f6423d86bec22c25a576b23262495c5536b0d069"; @@ -8,7 +7,6 @@ let sha256 = "sha256:1frd1dfqd97idwf1rj29ab0wvyfa2nx2h3bp9hkbmfa1m802avmb"; }; - # Custom v4l2loopback configuration for Steam Deck v4l2loopback-options = { options = { exclusive_caps = 1; @@ -20,33 +18,51 @@ in { imports = [ ./hardware-configuration.nix - (jovianNixos + "/modules") - ]; + (jovianNixos + "/modules") + ]; - nixpkgs = { + # Basic System Configuration + system.stateVersion = "24.05"; + networking = { + hostName = "steamnix"; + networkmanager.enable = true; + }; + time.timeZone = "America/Los_Angeles"; + i18n = { + defaultLocale = "en_US.UTF-8"; + 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 Package Manager Configuration + nixpkgs = { overlays = [ (import (jovianNixos + "/overlay.nix")) ]; config.allowUnfree = true; }; - # Nix Configuration nix.settings = { experimental-features = [ "nix-command" "flakes" ]; - substituters = [ "https://cache.nixos.org" ]; + substituters = [ "cache.nixos.org" ]; allowed-users = [ "@wheel" "jeirmeister" ]; auto-optimise-store = true; }; - # Steam Deck Configuration + # Steam Deck Specific Configuration jovian = { - # Hardware detection hardware.has.amd.gpu = true; - devices.steamdeck = { enable = true; - - # Hardware features enableControllerUdevRules = true; enableDefaultStage1Modules = true; enablePerfControlUdevRules = true; @@ -54,20 +70,62 @@ in enableSoundSupport = true; enableXorgRotation = true; enableKernelPatches = true; - - # Disable firmware updates temporarily enableFwupdBiosUpdates = false; autoUpdate = false; }; - steam.enable = false; workarounds.ignoreMissingKernelModules = true; }; + # Hardware and Display Configuration + hardware.video = { + displaylink.enable = true; + }; - # System Services + # Desktop Environment and Display Configuration + services.xserver = { + enable = true; + xkb.layout = "us"; + videoDrives = [ "displaylink" "modesetting" ]; + desktopManager.plasma6 = { + enable = true; + extraSessionCommands = '' + ${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0; + ''; + }; + displayManager = { + sddm = { + enable = true; + wayland = true; + }; + sessionCommands = '' + ${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0 + ''; + }; + }; + + # System Services Configuration + services = { + # Audio Configuration + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + # Network Services + openssh = { + enable = true; + settings = { + PasswordAuthentication = true; + AllowUsers = [ "jeirmeister" ]; + }; + }; + tailscale.enable = true; + }; + + # Systemd Services systemd.services = { - # Fan Control Service jupiter-fan-control = { path = [ pkgs.dmidecode ]; serviceConfig = lib.mkForce { @@ -81,70 +139,18 @@ in }; }; - # Immersed Video Service - # immersed-video = { - # description = "Load v4l2loopback module for Immersed"; - # wantedBy = [ "multi-user.target" ]; - # after = [ "systemd-modules-load.service" ]; - # requires = [ "systemd-modules-load.service" ]; - # serviceConfig = { - # Type = "oneshot"; - # RemainAfterExit = true; - # ExecStartPre = "${pkgs.kmod}/bin/modprobe -r v4l2loopback || true"; - # ExecStart = "${pkgs.kmod}/bin/modprobe v4l2loopback exclusive_caps=1 video_nr=0 card_label='Immersed Virtual Camera'"; - # ExecStop = "${pkgs.kmod}/bin/rmmod v4l2loopback || true"; - # }; - # }; + "systemd-modules-load" = { + wantedBy = [ "multi-user.target" ]; + restartIfChanged = true; + }; }; - # Ensure module loading at boot - systemd.services."systemd-modules-load" = { - wantedBy = [ "multi-user.target" ]; - restartIfChanged = true; - }; - - # UDev Rules services.udev.extraRules = '' - # Steam Deck Fan Control SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/pwm1" SUBSYSTEM=="hwmon*", KERNEL=="hwmon*", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chmod a+rw /sys/%p/fan1_input" ''; - # Network Configuration - networking = { - hostName = "steamnix"; - networkmanager.enable = true; - }; - - # Desktop Environment - services = { - xserver = { - enable = true; - xkb.layout = "us"; - }; - desktopManager.plasma6.enable = true; - displayManager.sddm.enable = true; - - # Audio - pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - }; - - # SSH Server - openssh = { - enable = true; - settings = { - PasswordAuthentication = true; - AllowUsers = [ "jeirmeister" ]; - }; - }; - - # Tailscale VPN - tailscale.enable = true; - }; # User Configuration users = { users.jeirmeister = { @@ -179,43 +185,41 @@ in }; environment.systemPackages = with pkgs; [ - # Debugging tools + # System Tools pciutils usbutils lm_sensors dmidecode - - linuxPackages.v4l2loopback # Virtual display for ImmersedVR - v4l-utils - - # Development tools - nixfmt-rfc-style - - # Basic utilities - tree - git - wget - curl binutils + # Virtual Display + linuxPackages.v4l2loopback + v4l-utils + + # Development Tools + nixfmt-rfc-style + git + + # Network Tools + wget + curl + + # Utilities + tree ]; - - # Locale and Time - time.timeZone = "America/Los_Angeles"; - i18n = { - defaultLocale = "en_US.UTF-8"; - 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"; - }; - }; - - system.stateVersion = "24.05"; } +# TODO: Incorporate this part later + # Immersed Video Service + # immersed-video = { + # description = "Load v4l2loopback module for Immersed"; + # wantedBy = [ "multi-user.target" ]; + # after = [ "systemd-modules-load.service" ]; + # requires = [ "systemd-modules-load.service" ]; + # serviceConfig = { + # Type = "oneshot"; + # RemainAfterExit = true; + # ExecStartPre = "${pkgs.kmod}/bin/modprobe -r v4l2loopback || true"; + # ExecStart = "${pkgs.kmod}/bin/modprobe v4l2loopback exclusive_caps=1 video_nr=0 card_label='Immersed Virtual Camera'"; + # ExecStop = "${pkgs.kmod}/bin/rmmod v4l2loopback || true"; + # }; + # }; \ No newline at end of file diff --git a/hosts/steamdeck/hardware-configuration.nix b/hosts/steamdeck/hardware-configuration.nix index dce37ac..930ec00 100644 --- a/hosts/steamdeck/hardware-configuration.nix +++ b/hosts/steamdeck/hardware-configuration.nix @@ -1,7 +1,7 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, modulesPath, ... }: { imports = diff --git a/users/jeirmeister/programs/browsers/default.nix b/users/jeirmeister/programs/browsers/default.nix index 293de3f..16ca557 100644 --- a/users/jeirmeister/programs/browsers/default.nix +++ b/users/jeirmeister/programs/browsers/default.nix @@ -3,5 +3,6 @@ { imports = [ ./floorp.nix + ./ungoogled-chromium.nix ]; } diff --git a/users/jeirmeister/programs/browsers/ungoogled-chromium.nix b/users/jeirmeister/programs/browsers/ungoogled-chromium.nix new file mode 100644 index 0000000..cb58dfc --- /dev/null +++ b/users/jeirmeister/programs/browsers/ungoogled-chromium.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + ungoogled-chromium + ]; +} diff --git a/users/jeirmeister/programs/communication/default.nix b/users/jeirmeister/programs/communication/default.nix new file mode 100644 index 0000000..630b1ce --- /dev/null +++ b/users/jeirmeister/programs/communication/default.nix @@ -0,0 +1,28 @@ +{ config, pkgs, ... }: +{ + home.packages = with pkgs; [ + # Matrix/Mautrix bridges + element-desktop-wayland + mautrix-whatsapp + mautrix-signal + mautrix-telegram + + # Signal + signal-cli + signal-export + signal-desktop + + # Telegram + telegram-desktop + telegram-bot-api + tg + tdl + + # WhatsApp + whatsapp-for-linux + whatsapp-chat-exporter + + # Video conferencing + zoom-us + ]; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/default.nix b/users/jeirmeister/programs/default.nix index 41da992..b09a513 100644 --- a/users/jeirmeister/programs/default.nix +++ b/users/jeirmeister/programs/default.nix @@ -2,10 +2,13 @@ { imports = [ + ./browsers + ./communication ./development ./gaming ./productivity ./shell ./system + ]; } diff --git a/users/jeirmeister/programs/development/env/common/default.nix b/users/jeirmeister/programs/development/env/common/default.nix new file mode 100644 index 0000000..03d09d2 --- /dev/null +++ b/users/jeirmeister/programs/development/env/common/default.nix @@ -0,0 +1,17 @@ +# Add to common/default.nix +{ config, pkgs, lib, ... }: + +{ + imports = [ ./paths.nix ./versions.nix ]; + + # Helper function for path concatenation + _module.args.pathJoin = fragments: + lib.concatStringsSep "/" fragments; + + programs.zsh.initExtra = lib.concatStrings [ + '' + # Environment Setup + ${builtins.concatStringsSep "\n" (map (path: "export PATH=\"${path}:$PATH\"") config.home.sessionPath)} + '' + ]; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/common/paths.nix b/users/jeirmeister/programs/development/env/common/paths.nix new file mode 100644 index 0000000..1e00dc5 --- /dev/null +++ b/users/jeirmeister/programs/development/env/common/paths.nix @@ -0,0 +1,57 @@ +{ config, pkgs, ... }: + +{ + home.sessionVariables = { + # XDG Base Directories + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_STATE_HOME = "$HOME/.local/state"; + XDG_RUNTIME_DIR = "/run/user/${toString config.home.uid}"; + + # Tool-specific paths + DEVELOPMENT_TOOLS_HOME = "$XDG_DATA_HOME/dev-tools"; + VIRTUALENV_HOME = "$XDG_DATA_HOME/virtualenvs"; + NODE_PACKAGES_DIR = "$XDG_DATA_HOME/node-packages"; + CARGO_HOME = "$XDG_DATA_HOME/cargo"; + GO_PATH = "$XDG_DATA_HOME/go"; + }; + + # Ensure directories exist + home.file = { + "${config.home.sessionVariables.DEVELOPMENT_TOOLS_HOME}/.keep".text = ""; + "${config.home.sessionVariables.VIRTUALENV_HOME}/.keep".text = ""; + "${config.home.sessionVariables.NODE_PACKAGES_DIR}/.keep".text = ""; + # Add standard cache directories + "${config.home.sessionVariables.XDG_CACHE_HOME}/yarn/.keep".text = ""; + "${config.home.sessionVariables.XDG_CACHE_HOME}/pnpm/.keep".text = ""; + + # Add standard data directories + "${config.home.sessionVariables.XDG_DATA_HOME}/node/.keep".text = ""; + "${config.home.sessionVariables.XDG_DATA_HOME}/python/.keep".text = ""; + "${config.home.sessionVariables.XDG_DATA_HOME}/cargo/.keep".text = ""; + }; + + # Add to env/common/paths.nix + home.sessionPath = [ + "$HOME/.local/bin" + "${config.home.sessionVariables.CARGO_HOME}/bin" + "${config.home.sessionVariables.GO_PATH}/bin" + "${config.home.sessionVariables.NODE_PACKAGES_DIR}/bin" + ]; + + assertions = [ + { + assertion = config.home.sessionVariables.XDG_CACHE_HOME != ""; + message = "XDG_CACHE_HOME must be set"; + } + { + assertion = config.home.sessionVariables.XDG_DATA_HOME != ""; + message = "XDG_DATA_HOME must be set"; + } + { + assertion = config.home.sessionVariables.XDG_CONFIG_HOME != ""; + message = "XDG_CONFIG_HOME must be set"; + } + ]; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/common/versions.nix b/users/jeirmeister/programs/development/env/common/versions.nix new file mode 100644 index 0000000..641f8ad --- /dev/null +++ b/users/jeirmeister/programs/development/env/common/versions.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + home.sessionVariables = { + PYTHON_VERSION = "3.11"; + NODE_VERSION = "20"; + GO_VERSION = "1.21"; + RUST_VERSION = "stable"; + }; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/default.nix b/users/jeirmeister/programs/development/env/default.nix index 2547e5e..4865192 100644 --- a/users/jeirmeister/programs/development/env/default.nix +++ b/users/jeirmeister/programs/development/env/default.nix @@ -3,6 +3,8 @@ { imports = [ ./direnv.nix + ./common ./languages ]; -} + +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/go/tools.nix b/users/jeirmeister/programs/development/env/languages/go/tools.nix index 6fee2bc..2825a1d 100644 --- a/users/jeirmeister/programs/development/env/languages/go/tools.nix +++ b/users/jeirmeister/programs/development/env/languages/go/tools.nix @@ -9,9 +9,7 @@ ]; home.sessionVariables = { - GOPATH = "$HOME/go"; - GOBIN = "$HOME/go/bin"; + GOPATH = "${config.home.sessionVariables.GO_PATH}"; + GOBIN = "${config.home.sessionVariables.GO_PATH}/bin"; }; - - home.file."go/bin/.keep".text = ""; -} +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/javascript/default.nix b/users/jeirmeister/programs/development/env/languages/javascript/default.nix index 111ed0d..48bb793 100644 --- a/users/jeirmeister/programs/development/env/languages/javascript/default.nix +++ b/users/jeirmeister/programs/development/env/languages/javascript/default.nix @@ -3,7 +3,6 @@ { imports = [ ./node.nix - ./pnpm.nix - ./yarn.nix + ./package-managers ]; -} +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/javascript/node.nix b/users/jeirmeister/programs/development/env/languages/javascript/node.nix index 735ded2..a78e38f 100644 --- a/users/jeirmeister/programs/development/env/languages/javascript/node.nix +++ b/users/jeirmeister/programs/development/env/languages/javascript/node.nix @@ -1,17 +1,16 @@ { config, pkgs, ... }: +let + nodeVersion = if builtins.getEnv "NODE_VERSION" != "" + then builtins.getEnv "NODE_VERSION" + else "20"; +in { - home.packages = with pkgs; [ - nodejs_20 - nodePackages.npm - nodePackages.node-gyp - nodePackages.node-pre-gyp + home.packages = [ + pkgs."nodejs_${nodeVersion}" ]; home.sessionVariables = { - NODE_PATH = "$HOME/.npm-packages/lib/node_modules"; - NPM_CONFIG_PREFIX = "$HOME/.npm-packages"; + NODE_PATH = "${config.home.sessionVariables.NODE_PACKAGES_DIR}/lib/node_modules"; }; - - home.file.".npmrc".text = "prefix=$HOME/.npm-packages"; -} +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/javascript/package-managers/default.nix b/users/jeirmeister/programs/development/env/languages/javascript/package-managers/default.nix new file mode 100644 index 0000000..5aad822 --- /dev/null +++ b/users/jeirmeister/programs/development/env/languages/javascript/package-managers/default.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./npm.nix + ./pnpm.nix + ./yarn.nix + ]; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/javascript/package-managers/npm.nix b/users/jeirmeister/programs/development/env/languages/javascript/package-managers/npm.nix new file mode 100644 index 0000000..83805ab --- /dev/null +++ b/users/jeirmeister/programs/development/env/languages/javascript/package-managers/npm.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + nodePackages.npm + nodePackages.node-gyp + nodePackages.node-pre-gyp + ]; + + home.file.".npmrc".text = '' + prefix=${config.home.sessionVariables.NODE_PACKAGES_DIR} + ''; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/javascript/package-managers/pnpm.nix b/users/jeirmeister/programs/development/env/languages/javascript/package-managers/pnpm.nix new file mode 100644 index 0000000..964342b --- /dev/null +++ b/users/jeirmeister/programs/development/env/languages/javascript/package-managers/pnpm.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ nodePackages.pnpm ]; + + home.file.".pnpmrc".text = '' + pnpm-version=8.9.0 + store-dir=${config.home.sessionVariables.XDG_DATA_HOME}/pnpm + ''; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/javascript/package-managers/yarn.nix b/users/jeirmeister/programs/development/env/languages/javascript/package-managers/yarn.nix new file mode 100644 index 0000000..e471721 --- /dev/null +++ b/users/jeirmeister/programs/development/env/languages/javascript/package-managers/yarn.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ yarn ]; + + home.file.".yarnrc".text = '' + cache-folder "${config.home.sessionVariables.XDG_CACHE_HOME}/yarn" + ''; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/javascript/pnpm.nix b/users/jeirmeister/programs/development/env/languages/javascript/pnpm.nix deleted file mode 100644 index 9b8c66e..0000000 --- a/users/jeirmeister/programs/development/env/languages/javascript/pnpm.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - nodePackages.pnpm - ]; - - home.file.".pnpmrc".text = " -pnpm-version=8.9.0 -store-dir=$HOME/.pnpm-store -"; -} diff --git a/users/jeirmeister/programs/development/env/languages/javascript/yarn.nix b/users/jeirmeister/programs/development/env/languages/javascript/yarn.nix deleted file mode 100644 index 2c60328..0000000 --- a/users/jeirmeister/programs/development/env/languages/javascript/yarn.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - yarn - ]; - - home.file.".yarnrc".text = " -cache-folder $HOME/.yarn-cache -"; -} diff --git a/users/jeirmeister/programs/development/env/languages/python/base.nix b/users/jeirmeister/programs/development/env/languages/python/base.nix new file mode 100644 index 0000000..289acee --- /dev/null +++ b/users/jeirmeister/programs/development/env/languages/python/base.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: + +let + pythonVersion = builtins.replaceStrings ["."] [""] + (if builtins.getEnv "PYTHON_VERSION" != "" + then builtins.getEnv "PYTHON_VERSION" + else "311"); +in +{ + home.packages = [ + pkgs."python${pythonVersion}" + pkgs."python${pythonVersion}Packages"."pip" + pkgs."python${pythonVersion}Packages"."setuptools" + pkgs."python${pythonVersion}Packages"."wheel" + ]; + + home.sessionVariables = { + PYTHONDONTWRITEBYTECODE = 1; + PYTHONIOENCODING = "UTF-8"; + VIRTUAL_ENV_DISABLE_PROMPT = 1; + }; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/python/default.nix b/users/jeirmeister/programs/development/env/languages/python/default.nix index 77dc907..e542165 100644 --- a/users/jeirmeister/programs/development/env/languages/python/default.nix +++ b/users/jeirmeister/programs/development/env/languages/python/default.nix @@ -1,27 +1,8 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { imports = [ - ./pipenv.nix - ./poetry.nix - ./pyenv.nix + ./base.nix + ./package-managers ]; - - # Base Python installation - home.packages = with pkgs; [ - python311 - python311Packages.pip - python311Packages.setuptools - python311Packages.wheel - ]; - - # Common Python environment variables - home.sessionVariables = { - PYTHONDONTWRITEBYTECODE = 1; - PYTHONIOENCODING = "UTF-8"; - PYTHONUSERBASE = "$HOME/.local/python"; - }; - - # Create Python user directory - home.file.".local/python/.keep".text = ""; -} +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/python/package-managers/default.nix b/users/jeirmeister/programs/development/env/languages/python/package-managers/default.nix new file mode 100644 index 0000000..fac49c2 --- /dev/null +++ b/users/jeirmeister/programs/development/env/languages/python/package-managers/default.nix @@ -0,0 +1,10 @@ +# Add to env/languages/python/package-managers/default.nix +{ config, pkgs, ... }: + +{ + imports = [ + ./pipenv.nix + ./poetry + ]; + +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/python/pipenv.nix b/users/jeirmeister/programs/development/env/languages/python/package-managers/pipenv.nix similarity index 57% rename from users/jeirmeister/programs/development/env/languages/python/pipenv.nix rename to users/jeirmeister/programs/development/env/languages/python/package-managers/pipenv.nix index 2845fd2..022559f 100644 --- a/users/jeirmeister/programs/development/env/languages/python/pipenv.nix +++ b/users/jeirmeister/programs/development/env/languages/python/package-managers/pipenv.nix @@ -1,18 +1,14 @@ { config, pkgs, ... }: { - home.packages = with pkgs; [ - pipenv - ]; + home.packages = with pkgs; [ pipenv ]; home.sessionVariables = { PIPENV_VENV_IN_PROJECT = "1"; - WORKON_HOME = "$HOME/.local/share/virtualenvs"; + WORKON_HOME = "${config.home.sessionVariables.VIRTUALENV_HOME}"; PIP_NO_CACHE_DIR = "off"; PIPENV_SKIP_LOCK = "1"; PIPENV_IGNORE_VIRTUALENVS = "1"; PIPENV_MAX_DEPTH = "5"; }; - - home.file.".local/share/virtualenvs/.keep".text = ""; -} +} \ No newline at end of file diff --git a/users/jeirmeister/programs/development/env/languages/python/package-managers/poetry/default.nix b/users/jeirmeister/programs/development/env/languages/python/package-managers/poetry/default.nix new file mode 100644 index 0000000..98b9b71 --- /dev/null +++ b/users/jeirmeister/programs/development/env/languages/python/package-managers/poetry/default.nix @@ -0,0 +1,32 @@ +{ config, pkgs, ... }: + +let + poetry2nix = import (pkgs.fetchFromGitHub { + owner = "nix-community"; + repo = "poetry2nix"; + rev = "1.0.0"; + sha256 = "15mdb0lr7027qpm9s1v1d9sdb8abmcdrpqsv4zvinif8a8liqxkq"; + }) { inherit pkgs; }; +in +{ + home.packages = with pkgs; [ + poetry + + ]; + imports = [ + ./packages + ]; + + home.sessionVariables = { + POETRY_VIRTUALENVS_IN_PROJECT = "true"; + POETRY_CACHE_DIR = "${config.home.sessionVariables.XDG_CACHE_HOME}/pypoetry"; + }; + + home.file.".config/pypoetry/config.toml".text = '' + [virtualenvs] + in-project = true + path = "${config.home.sessionVariables.VIRTUALENV_HOME}/poetry" + create = true + clear = false + ''; +} \ No newline at end of file diff --git a/users/jeirmeister/packages/default.nix b/users/jeirmeister/programs/development/env/languages/python/package-managers/poetry/packages/default.nix similarity index 53% rename from users/jeirmeister/packages/default.nix rename to users/jeirmeister/programs/development/env/languages/python/package-managers/poetry/packages/default.nix index 56fa4bb..eb2fb4b 100644 --- a/users/jeirmeister/packages/default.nix +++ b/users/jeirmeister/programs/development/env/languages/python/package-managers/poetry/packages/default.nix @@ -1,5 +1,4 @@ -# users/jeirmeister/packages/default.nix -{ pkgs }: +{ pkgs, ... }: { repo-to-text = pkgs.callPackage ./repo-to-text.nix {}; diff --git a/users/jeirmeister/packages/repo-to-text.nix b/users/jeirmeister/programs/development/env/languages/python/package-managers/poetry/packages/repo-to-text.nix similarity index 100% rename from users/jeirmeister/packages/repo-to-text.nix rename to users/jeirmeister/programs/development/env/languages/python/package-managers/poetry/packages/repo-to-text.nix diff --git a/users/jeirmeister/programs/development/env/languages/python/poetry.nix b/users/jeirmeister/programs/development/env/languages/python/poetry.nix deleted file mode 100644 index d5771ac..0000000 --- a/users/jeirmeister/programs/development/env/languages/python/poetry.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - poetry - ]; - - home.sessionVariables = { - POETRY_VIRTUALENVS_IN_PROJECT = "true"; - POETRY_CACHE_DIR = "$HOME/.cache/pypoetry"; - POETRY_IGNORE_ENVIRONMENT_VARIABLES = "1"; - }; - - home.file.".config/pypoetry/config.toml".text = '' - [virtualenvs] - in-project = true - path = "{cache-dir}/virtualenvs" - create = true - clear = false - - [repositories] - ''; -} diff --git a/users/jeirmeister/programs/development/env/languages/python/pyenv.nix b/users/jeirmeister/programs/development/env/languages/python/pyenv.nix deleted file mode 100644 index 8fbeb9c..0000000 --- a/users/jeirmeister/programs/development/env/languages/python/pyenv.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - pyenv - ]; - - home.sessionVariables = { - PYENV_ROOT = "$HOME/.pyenv"; - PYENV_SHELL = "zsh"; - PYENV_VIRTUALENV_INIT = "1"; - }; - - home.file.".pyenv/version".text = "system"; - - programs.zsh.initExtra = '' - export PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init --path)" - eval "$(pyenv virtualenv-init -)" - ''; -} diff --git a/users/jeirmeister/programs/development/env/languages/rust/cargo.nix b/users/jeirmeister/programs/development/env/languages/rust/cargo.nix index 8e3e0ca..1fc6275 100644 --- a/users/jeirmeister/programs/development/env/languages/rust/cargo.nix +++ b/users/jeirmeister/programs/development/env/languages/rust/cargo.nix @@ -2,7 +2,6 @@ { home.packages = with pkgs; [ - # cargo is provided by rustup cargo-edit cargo-watch cargo-audit @@ -10,17 +9,13 @@ ]; home.sessionVariables = { - CARGO_HOME = "$HOME/.cargo"; + CARGO_HOME = "${config.home.sessionVariables.CARGO_HOME}"; }; - programs.zsh.initExtra = '' - export PATH="$CARGO_HOME/bin:$PATH" - ''; - home.file.".cargo/config.toml".text = '' [build] target-dir = "target" - + [cargo-new] vcs = "git" ''; diff --git a/users/jeirmeister/programs/development/env/languages/rust/default.nix b/users/jeirmeister/programs/development/env/languages/rust/default.nix index 123dd7e..382a925 100644 --- a/users/jeirmeister/programs/development/env/languages/rust/default.nix +++ b/users/jeirmeister/programs/development/env/languages/rust/default.nix @@ -3,6 +3,6 @@ { imports = [ ./cargo.nix - ./rustup.nix + ./toolchain.nix ]; } diff --git a/users/jeirmeister/programs/development/env/languages/rust/rustup.nix b/users/jeirmeister/programs/development/env/languages/rust/toolchain.nix similarity index 53% rename from users/jeirmeister/programs/development/env/languages/rust/rustup.nix rename to users/jeirmeister/programs/development/env/languages/rust/toolchain.nix index 4c6f717..7d84342 100644 --- a/users/jeirmeister/programs/development/env/languages/rust/rustup.nix +++ b/users/jeirmeister/programs/development/env/languages/rust/toolchain.nix @@ -6,11 +6,11 @@ ]; home.sessionVariables = { - RUSTUP_HOME = "$HOME/.rustup"; + RUSTUP_HOME = "${config.home.sessionVariables.XDG_DATA_HOME}/rustup"; }; home.file.".rustup/settings.toml".text = '' - default_toolchain = "stable" + default_toolchain = "${config.home.sessionVariables.RUST_VERSION}" profile = "default" - ''; -} + ''; +} \ No newline at end of file diff --git a/users/jeirmeister/programs/shell/utilities/security/ssh.nix b/users/jeirmeister/programs/shell/utilities/security/ssh.nix index e9d6f91..0525943 100644 --- a/users/jeirmeister/programs/shell/utilities/security/ssh.nix +++ b/users/jeirmeister/programs/shell/utilities/security/ssh.nix @@ -3,21 +3,21 @@ { programs.ssh = { enable = true; - + extraConfig = '' AddKeysToAgent yes UseKeychain yes IdentitiesOnly yes HashKnownHosts yes ''; - + # For better security serverAliveInterval = 60; serverAliveCountMax = 2; # Manage known hosts userKnownHostsFile = "~/.ssh/known_hosts"; - + # Example host configurations matchBlocks = { "github.com" = { @@ -34,4 +34,5 @@ }; }; }; + home.file."${config.home.sessionVariables.XDG_DATA_HOME}/ssh/.keep".text = ""; } \ No newline at end of file