From a513b807f4cac74b52b24dff500f724ca1f39335 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sat, 13 Apr 2024 18:04:37 +0200 Subject: [PATCH] Add various environment settings --- system/default.nix | 1 + system/environment/default.nix | 7 +++++++ system/environment/packages.nix | 11 +++++++++++ system/environment/paths.nix | 9 +++++++++ system/environment/variables.nix | 15 +++++++++++++++ system/programs.nix | 12 +----------- 6 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 system/environment/default.nix create mode 100644 system/environment/packages.nix create mode 100644 system/environment/paths.nix create mode 100644 system/environment/variables.nix diff --git a/system/default.nix b/system/default.nix index 388799b..5ed5a2c 100644 --- a/system/default.nix +++ b/system/default.nix @@ -4,6 +4,7 @@ _: { ./boot ./services ./nix + ./environment ./impermanence ./programs.nix ./system.nix diff --git a/system/environment/default.nix b/system/environment/default.nix new file mode 100644 index 0000000..455d8c6 --- /dev/null +++ b/system/environment/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./packages.nix + ./paths.nix + ./variables.nix + ]; +} diff --git a/system/environment/packages.nix b/system/environment/packages.nix new file mode 100644 index 0000000..77c4c76 --- /dev/null +++ b/system/environment/packages.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + curl + wget + pciutils + lshw + man-pages + rsync + bind.dnsutils + ]; +} diff --git a/system/environment/paths.nix b/system/environment/paths.nix new file mode 100644 index 0000000..1413d94 --- /dev/null +++ b/system/environment/paths.nix @@ -0,0 +1,9 @@ +{ + # enable completions for system packages + # and other stuff + environment.pathsToLink = [ + "/share/zsh" # zsh completions + "/share/bash-completion" # bash completions + "/share/nix-direnv" # direnv completions + ]; +} diff --git a/system/environment/variables.nix b/system/environment/variables.nix new file mode 100644 index 0000000..5b2a257 --- /dev/null +++ b/system/environment/variables.nix @@ -0,0 +1,15 @@ +{ + # variables that I want to set globally on all systems + + environment.variables = { + # editors + EDITOR = "nvim"; + VISUAL = "nvim"; + SUDO_EDITOR = "nvim"; + + # pager stuff + SYSTEMD_PAGERSECURE = "true"; + PAGER = "less -FR"; + MANPAGER = "nvim +Man!"; + }; +} diff --git a/system/programs.nix b/system/programs.nix index bbe285e..d9eeaf9 100644 --- a/system/programs.nix +++ b/system/programs.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ # Install an actually usable system-wide editor programs.neovim = { @@ -7,14 +7,4 @@ vimAlias = true; viAlias = true; }; - - environment.systemPackages = with pkgs; [ - curl - wget - pciutils - lshw - man-pages - rsync - bind.dnsutils - ]; }