diff options
author | Jasper Ras <jaspert.ras@gmail.com> | 2025-02-06 22:03:10 +0000 |
---|---|---|
committer | Jasper Ras <jaspert.ras@gmail.com> | 2025-02-06 22:19:49 +0000 |
commit | f71051f47158f57091306e269352d7579522e426 (patch) | |
tree | 3b112ddd10797c8669e9b68d483b205d49c3035b /configuration | |
parent | 463f0d40c6ee02e5512269d2e370506a8ca8f965 (diff) |
bluurb
Diffstat (limited to 'configuration')
20 files changed, 760 insertions, 102 deletions
diff --git a/configuration/core/default.nix b/configuration/core/default.nix new file mode 100644 index 0000000..87917ab --- /dev/null +++ b/configuration/core/default.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + ./users.nix + ./services.nix + ./settings.nix + ./packages.nix + ]; +} diff --git a/configuration/packages.nix b/configuration/core/packages.nix index cf4baea..cf4baea 100644 --- a/configuration/packages.nix +++ b/configuration/core/packages.nix diff --git a/configuration/services.nix b/configuration/core/services.nix index 9997d71..9997d71 100644 --- a/configuration/services.nix +++ b/configuration/core/services.nix diff --git a/configuration/nix-settings.nix b/configuration/core/settings.nix index d765c47..e7a7b2e 100644 --- a/configuration/nix-settings.nix +++ b/configuration/core/settings.nix @@ -1,5 +1,6 @@ { ... }: { + nixpkgs.config.allowUnfree = true; nix.settings = { experimental-features = [ "nix-command" "flakes" ]; trusted-users = [ "root" "jras" ]; diff --git a/configuration/users/default.nix b/configuration/core/users.nix index a074ac9..26703a0 100644 --- a/configuration/users/default.nix +++ b/configuration/core/users.nix @@ -2,6 +2,9 @@ { programs.zsh.enable = true; + security.sudo.execWheelOnly = true; + security.sudo.wheelNeedsPassword = false; + users.mutableUsers = false; users.users.jras = { createHome = true; diff --git a/configuration/home-manager/ansible.nix b/configuration/home-manager/ansible.nix new file mode 100644 index 0000000..67aff1c --- /dev/null +++ b/configuration/home-manager/ansible.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + ansible-language-server + ansible-lint + ]; +} diff --git a/configuration/home-manager/core/default.nix b/configuration/home-manager/core/default.nix new file mode 100644 index 0000000..9c33f66 --- /dev/null +++ b/configuration/home-manager/core/default.nix @@ -0,0 +1,74 @@ +{ pkgs, inputs, ... }: +{ + + imports = [ + ./helix.nix + ./shell.nix + ]; + + home.packages = [ + pkgs.gnumake + pkgs.git-crypt + pkgs.bitwarden-cli + + pkgs.fd + pkgs.glow + pkgs.eza + + pkgs.nixfmt-rfc-style + inputs.nil.packages."${pkgs.system}".nil + ]; + + programs.ripgrep.enable = true; + programs.btop.enable = true; + + programs.zoxide = { + enable = true; + options = [ "--cmd cd" ]; + }; + programs.fzf.enable = true; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + programs.git = { + enable = true; + aliases = { + b = "branch"; + f = "fetch"; + p = "pull"; + s = "status"; + co = "checkout"; + pu = "push"; + nb = "checkout -b"; + db = "branch -D"; + lg = + "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + praise = "blame"; + bump = "!git bump"; + ae = "!git add -A && git commit --amend"; + ad = "commit --amend"; + ac = "!git add -A && git commit"; + rmbs = + "!git branch | grep -wv master | grep -wv main | xargs git branch -D"; + }; + extraConfig = { + pull.rebase = false; + init.defaultBranch = "main"; + }; + }; + + services.ssh-agent.enable = true; + programs.ssh = { + enable = true; + package = "${pkgs.openssh}"; + addKeysToAgent = "yes"; + }; + + programs.taskwarrior = { + enable = true; + package = "${pkgs.taskwarrior3}"; + }; +} diff --git a/configuration/home-manager/core/helix.nix b/configuration/home-manager/core/helix.nix new file mode 100644 index 0000000..42861ce --- /dev/null +++ b/configuration/home-manager/core/helix.nix @@ -0,0 +1,42 @@ +{ pkgs, inputs, ... }: +{ + home.sessionVariables = { EDITOR = "hx"; }; + home.file = { + helix-ferra = { + source = ../../../assets/helix-wavez.toml; + target = ".config/helix/themes/wavez.toml"; + }; + }; + + programs.helix = { + enable = true; + package = inputs.helix.packages."${pkgs.system}".helix; + defaultEditor = true; + settings = { + theme = "wavez"; + keys.normal = { + space.F = "file_picker_in_current_buffer_directory"; + }; + editor = { + end-of-line-diagnostics = "hint"; + line-number = "relative"; + bufferline = "always"; + auto-save = false; + + inline-diagnostics = { + cursor-line = "error"; + }; + + lsp = { + enable = true; + display-messages = true; + }; + + indent-guides = { + render = true; + skip-levels = 1; + }; + }; + }; + }; +} diff --git a/configuration/home-manager/core/shell.nix b/configuration/home-manager/core/shell.nix new file mode 100644 index 0000000..183b9ae --- /dev/null +++ b/configuration/home-manager/core/shell.nix @@ -0,0 +1,69 @@ +{ pkgs, lib, ... }: +{ + programs.zsh = { + enable = true; + defaultKeymap = "emacs"; + initExtra = '' + # https://github.com/jeffreytse/zsh-vi-mode + source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh + ''; + shellAliases = { + g = "git"; + }; + }; + + programs.starship = { + enable = true; + settings = { + directory.style = "blue"; + + format = lib.concatStrings [ + "$username" + "$hostname" + "$directory" + "$git_branch" + "$git_state" + "$git_status" + "$cmd_duration" + "$line_break" + "$python" + "$openstack" + "$character" + ]; + + character = { + success_symbol = "[❯](purple)"; + error_symbol = "[❯](red)"; + vimcmd_symbol = "[❮](green)"; + }; + + git_branch = { + format = "[$branch]($style)"; + style = "bright-black"; + }; + + git_status = { + format = + "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)"; + style = "cyan"; + conflicted = ""; + untracked = ""; + modified = ""; + staged = ""; + renamed = ""; + deleted = ""; + stashed = "≡"; + }; + + git_state = { + format = "'([$state( $progress_current/$progress_total)]($style))' "; + style = "bright-black"; + }; + + cmd_duration = { + format = "[$duration]($style) "; + style = "yellow"; + }; + }; + }; +} diff --git a/configuration/home-manager/frontend-dev.nix b/configuration/home-manager/frontend-dev.nix new file mode 100644 index 0000000..3a957cd --- /dev/null +++ b/configuration/home-manager/frontend-dev.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + dart-sass + tailwindcss + tailwindcss-language-server + vscode-langservers-extracted + ]; + + programs.helix.languages.language = [ + { + name = "html"; + language-servers = [ "vscode-html-language-server" "tailwindcss-language-server" ]; + } + { + name = "css"; + language-servers = [ "vscode-css-language-server" "tailwindcss-language-server" ]; + } + ]; +} diff --git a/configuration/home-manager/hostnet.nix b/configuration/home-manager/hostnet.nix new file mode 100644 index 0000000..b8f6418 --- /dev/null +++ b/configuration/home-manager/hostnet.nix @@ -0,0 +1,55 @@ +{ config, pkgs, ... }: +let + nodePkgs = pkgs.nodePackages; + homeDir = "${config.home.homeDirectory}"; + llamaDir = "${homeDir}/.llama"; + apache2Dir = "${homeDir}/.apache2"; + httpd = "${pkgs.apacheHttpd}/bin/httpd"; +in { + home.packages = [ + pkgs.pre-commit + nodePkgs.webpack + nodePkgs.webpack-cli + + (pkgs.writeShellScriptBin "use-toolbox" '' + source ${config.home.homeDirectory}/projects/toolbox/var/bootstrap.zsh + '') + ]; + + programs = { + rbenv = { + enable = true; + enableZshIntegration = true; + plugins = [{ + name = "ruby-build"; + src = pkgs.fetchFromGitHub { + owner = "rbenv"; + repo = "ruby-build"; + rev = "v20230717"; + hash = "sha256-kvdANiz9R5pQMTBRHvxC5bfBewIhXc+sgRbe7V2rVU8="; + }; + }]; + }; + }; + + systemd.user.services.llama = { + Unit.Description = "Hostnet Apache LLama"; + Service = { + ExecStartPre = "${llamaDir}/se-vhosts.sh"; + ExecStart = "${httpd} -f ${llamaDir}/apache2.conf -DFOREGROUND"; + RestartSec = "2"; + Restart = "always"; + Environment = [ + "APACHE_RUN_DIR=${apache2Dir}" + "APACHE_CONFDIR=${llamaDir}" + "APACHE_RUN_USER=${config.home.username}" + "APACHE_RUN_GROUP=${config.home.username}" + "APACHE_PID_FILE=${homeDir}/.apache2.pid" + "APACHE_RUN_FILE=${apache2Dir}/run" + "APACHE_LOCK_FILE=${apache2Dir}/lock" + "APACHE_LOG_FILE=${apache2Dir}/log" + ]; + }; + Install.WantedBy = [ "default.target" ]; + }; +} diff --git a/configuration/home-manager/hyprland.nix b/configuration/home-manager/hyprland.nix new file mode 100644 index 0000000..08af2a1 --- /dev/null +++ b/configuration/home-manager/hyprland.nix @@ -0,0 +1,257 @@ +{ pkgs, inputs, ... }: +let + wallpaper = ../../assets/wallpaper.jpg; +in +{ + home.packages = with pkgs; [ + rofi-wayland-unwrapped + rofi-rbw-wayland + grimblast + hyprpicker + wl-clipboard + ]; + + # Required for hyprpicker's cursor but also seems to fix some icons for astal + home.pointerCursor = { + gtk.enable = true; + package = pkgs.adwaita-icon-theme; + name = "Adwaita"; + size = 16; + }; + + services.wlsunset.enable = true; + services.wlsunset.sunrise = "06:00"; + services.wlsunset.sunset = "17:00"; + + wayland.windowManager.hyprland.enable = true; + wayland.windowManager.hyprland.systemd.enable = true; + wayland.windowManager.hyprland.plugins = [ + inputs.hy3.packages.x86_64-linux.hy3 + ]; + + wayland.windowManager.hyprland.settings = { + "$terminal" = "alacritty"; + "$mod" = "SUPER"; + + exec-once = [ + "astal-bar" + ]; + + debug = { + "disable_logs" = false; + }; + + general = { + "layout" = "hy3"; + "border_size" = 2; + "col.active_border" = "rgba(fe8423ee) rgba(e11701ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + }; + + monitor = [ + "Unknown-1, disable" + ",preferred,auto,auto" + ]; + + xwayland = { + force_zero_scaling = true; + }; + + animations = { + bezier = [ + "easeOutQuint,0.23,1,0.32,1" + "easeInOutCubic,0.65,0.05,0.36,1" + "linear,0,0,1,1" + "almostLinear,0.5,0.5,0.75,1.0" + "quick,0.15,0,0.1,1" + ]; + animation = [ + "global, 1, 10, default" + "border, 1, 5.39, easeOutQuint" + "windows, 1, 4.79, easeOutQuint" + "windowsIn, 1, 4.1, easeOutQuint, popin 87%" + "windowsOut, 1, 1.49, linear, popin 87%" + "fadeIn, 1, 1.73, almostLinear" + "fadeOut, 1, 1.46, almostLinear" + "fade, 1, 3.03, quick" + "layers, 1, 3.81, easeOutQuint" + "layersIn, 1, 4, easeOutQuint, fade" + "layersOut, 1, 1.5, linear, fade" + "fadeLayersIn, 1, 1.79, almostLinear" + "fadeLayersOut, 1, 1.39, almostLinear" + "workspaces, 1, 1.94, almostLinear, fade" + ]; + }; + + decoration = { + "rounding" = 5; + "inactive_opacity" = 0.8; + }; + + bind = + [ + "$mod, Return, exec, alacritty" + "$mod, Semicolon, hy3:makegroup, h" + "$mod, D, exec, ${pkgs.rofi-wayland-unwrapped}/bin/rofi -show drun" + "$mod, F, fullscreen, 1" + "$mod, H, hy3:movefocus, l" + "$mod, J, hy3:movefocus, d" + "$mod, K, hy3:movefocus, u" + "$mod, L, hy3:movefocus, r" + "$mod, P, exec, ${pkgs.grimblast}/bin/grimblast copy area" + "$mod, Q, exec, ${pkgs.hyprlock}/bin/hyprlock" + "$mod, V, hy3:makegroup, v" + "$mod, W, hy3:changegroup, toggletab" + "$mod, X, movecurrentworkspacetomonitor, +1" + + "$mod SHIFT, C, exec, ${pkgs.hyprpicker}/bin/hyprpicker -a -f hex" + "$mod SHIFT, D, exec, ${pkgs.rofi-rbw-wayland}/bin/rofi-rbw" + "$mod SHIFT, H, hy3:movewindow, l" + "$mod SHIFT, J, hy3:movewindow, d" + "$mod SHIFT, K, hy3:movewindow, u" + "$mod SHIFT, L, hy3:movewindow, r" + "$mod SHIFT, P, exec, ${pkgs.grimblast}/bin/grimblast copy screen" + "$mod SHIFT, Q, hy3:killactive" + ] + ++ ( + builtins.concatLists (builtins.genList (i: + let ws = i + 1; + in [ + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT, code:1${toString i}, hy3:movetoworkspace, ${toString ws}" + ] + ) + 9) + ); + + plugin = { + hy3 = { + tabs = { + "col.active" = "0xFFFE8423"; + "col.inactive" = "0xFF103543"; + "col.text.inactive" = "0xFFFECDB2"; + }; + }; + }; + }; + + programs.waybar.enable = true; + programs.waybar.settings = { + mainBar = { + layer = "top"; + position = "bottom"; + # output = monitor-names; + modules-left = [ + "hyprland/workspaces" + ]; + modules-right = [ + "clock" + "battery" + ]; + + "hyprland/workspaces" = { + all-outputs = true; + format-icons = { + active = ""; + default = ""; + }; + format = "{id} {icon}"; + window-rewrite-default = "*"; + }; + }; + }; + + services.hyprpaper.enable = true; + services.hyprpaper.settings = { + preload = [ "${wallpaper}" ]; + wallpaper = [ ",${wallpaper}" ]; + }; + + programs.hyprlock.enable = true; + programs.hyprlock.settings = { + background = [ + { path = "${wallpaper}"; + blur_passes = 2; + monitor = ""; + } + ]; + + general = { + no_fade_in = true; + no_fade_out = true; + hide_cursor = false; + disable_loading_bar = true; + grace = 0; + }; + + input-field = [ + { + monitor = ""; + size = "250, 60"; + outline_thickness = 2; + dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.35; # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true; + outer_color = "rgba(0, 0, 0, 0)"; + inner_color = "rgba(0, 0, 0, 0.2)"; + font_color = "$foreground"; + fade_on_empty = false; + rounding = -1; + check_color = "rgb(204, 136, 34)"; + placeholder_text = "<i><span foreground=\"##cdd6f4\">Input Password...</span></i>"; + hide_input = false; + position = "0, -200"; + halign = "center"; + valign = "center"; + } + ]; + }; + + programs.alacritty = { + enable = true; + settings = { + window = { + padding = { x = 5; y = 2; }; + }; + env = { TERM = "alacritty-direct"; }; + terminal.shell = { + program = "${pkgs.zsh}/bin/zsh"; + args = [ "-l" ]; + }; + } // builtins.fromJSON (builtins.readFile ../../assets/alacritty-wavez.json); + }; + + xdg.mimeApps = { + enable = true; + defaultApplications = { + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + "x-scheme-handler/chrome" = "firefox.desktop"; + "text/html" = "firefox.desktop"; + "application/x-extension-htm" = "firefox.desktop"; + "application/x-extension-html" = "firefox.desktop"; + "application/x-extension-shtml" = "firefox.desktop"; + "application/xhtml+xml" = "firefox.desktop"; + "application/x-extension-xhtml" = "firefox.desktop"; + "application/x-extension-xht" = "firefox.desktop"; + }; + associations.added = { + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + "x-scheme-handler/chrome" = "firefox.desktop"; + "text/html" = "firefox.desktop"; + "application/x-extension-htm" = "firefox.desktop"; + "application/x-extension-html" = "firefox.desktop"; + "application/x-extension-shtml" = "firefox.desktop"; + "application/xhtml+xml" = "firefox.desktop"; + "application/x-extension-xhtml" = "firefox.desktop"; + "application/x-extension-xht" = "firefox.desktop"; + }; + }; + + programs.rbw.enable = true; + programs.rbw.settings = { + email = "jaspert.ras@gmail.com"; + pinentry = pkgs.pinentry-gnome3; + }; +} diff --git a/configuration/home-manager/php.nix b/configuration/home-manager/php.nix new file mode 100644 index 0000000..ab56f44 --- /dev/null +++ b/configuration/home-manager/php.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + programs.helix.languages.language-server.intelephense = with pkgs.nodePackages; { + command = "${intelephense}/bin/intelephense"; + }; + + programs.git.ignores = [ + ".phpactor.json" + ".phpcomplete_extended/" + ".phpunit.result.cache" + ".phpcs.xml" + ]; +} diff --git a/configuration/home-manager/python.nix b/configuration/home-manager/python.nix new file mode 100644 index 0000000..464fc39 --- /dev/null +++ b/configuration/home-manager/python.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: +{ + home.packages = [ + pkgs.pyright + pkgs.black + pkgs.ruff + ]; + + programs.helix.languages = { + language = [ + { + name = "python"; + language-servers = [ "pyright" "ruff" ]; + formatter = { command = "black"; args = ["--line-length" "88" "--quiet" "-"]; }; + auto-format = true; + } + ]; + language-server.pyright.config.python.analysis = { typeCheckingMode = "basic"; }; + language-server.ruff = { command = "ruff"; }; + language-server.ruff.config.setting = { args = ["--ignore" "E501" ]; }; + }; + + programs.starship.settings = { + python = { + format = "[$virtualenv]($style) "; + style = "bright-black"; + }; + }; +} diff --git a/configuration/home-manager/tarrel.nix b/configuration/home-manager/tarrel.nix new file mode 100644 index 0000000..a8ddb9f --- /dev/null +++ b/configuration/home-manager/tarrel.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: +{ + imports = [ + ../home-manager/core + ../home-manager/hyprland.nix + ]; + + home.username = "jras"; + home.homeDirectory = "/home/jras"; + home.stateVersion = "23.11"; + + programs.git = { + userName = "Jasper Ras"; + userEmail = "jaspert.ras@gmail.com"; + }; + + home.file = { + gamestream-start = { + text = '' + #!${pkgs.zsh}/bin/zsh + ${pkgs.hyprland}/bin/hyprctl keyword monitor HDMI-A-1,1920x1080@59.94,auto,2 + ''; + target = "bin/gamestream-start"; + executable = true; + }; + gamestream-end = { + text = '' + #!${pkgs.zsh}/bin/zsh + ${pkgs.hyprland}/bin/hyprctl keyword monitor HDMI-A-1,preferred,auto,1 + ''; + target = "bin/gamestream-end"; + executable = true; + }; + }; + + programs.zsh.envExtra = "export PATH=$HOME/bin:$PATH"; + }; +} diff --git a/configuration/snorlax/default.nix b/configuration/snorlax/default.nix index fa60d0e..ee9755e 100644 --- a/configuration/snorlax/default.nix +++ b/configuration/snorlax/default.nix @@ -1,11 +1,10 @@ { ... }: { imports = [ - ../nix-settings.nix - ../users - ./disk-config.nix ./git.nix + + ../core ]; networking.hostName = "snorlax"; diff --git a/configuration/tarrel/default.nix b/configuration/tarrel/default.nix index f92285b..f8519a7 100644 --- a/configuration/tarrel/default.nix +++ b/configuration/tarrel/default.nix @@ -1,25 +1,23 @@ -{ pkgs, inputs, config, ... }: +{ config, ... }: { imports = [ ./hardware-configuration.nix + ./home-manager.nix - ../packages.nix - ../services.nix - ../users + ../core ../hyprland.nix - ../nix-settings.nix ]; - nixpkgs.config.allowUnfree = true; + system.stateVersion = "24.05"; + + networking.hostName = "tarrel"; + networking.networkmanager.enable = true; + + users.users.jras.extraGroups = [ "networkmanager" ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - environment.systemPackages = with pkgs; [ - zola - discord - ]; - hardware.graphics.enable = true; services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { @@ -33,35 +31,6 @@ security.rtkit.enable = true; - time.timeZone = "Europe/Amsterdam"; - - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "nl_NL.UTF-8"; - LC_IDENTIFICATION = "nl_NL.UTF-8"; - LC_MEASUREMENT = "nl_NL.UTF-8"; - LC_MONETARY = "nl_NL.UTF-8"; - LC_NAME = "nl_NL.UTF-8"; - LC_NUMERIC = "nl_NL.UTF-8"; - LC_PAPER = "nl_NL.UTF-8"; - LC_TELEPHONE = "nl_NL.UTF-8"; - LC_TIME = "nl_NL.UTF-8"; - }; - - console.keyMap = "us-acentos"; - - programs.zsh.enable = true; - - users.users.jras = { - isNormalUser = true; - description = "Jasper"; - extraGroups = [ "networkmanager" "wheel" "audio" ]; - shell = pkgs.zsh; - }; - - security.sudo.execWheelOnly = true; - security.sudo.wheelNeedsPassword = false; - environment.sessionVariables = { TERMINAL = "alacritty"; EDITOR = "helix"; @@ -69,18 +38,6 @@ environment.pathsToLink = [ "/libexec" ]; - networking.hostName = "tarrel"; - networking.networkmanager.enable = true; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.jras = import ../../home-manager/entrypoints/personal.nix; - extraSpecialArgs = { inherit inputs; monitor-names = ["DP-2" "HDMI-A-1"]; }; - }; - - system.stateVersion = "24.05"; # Did you read the comment? - services.sunshine = { enable = true; autoStart = true; diff --git a/configuration/tarrel/home-manager.nix b/configuration/tarrel/home-manager.nix new file mode 100644 index 0000000..9709129 --- /dev/null +++ b/configuration/tarrel/home-manager.nix @@ -0,0 +1,42 @@ +{ pkgs, inputs, ... }: +{ + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.jras = { + imports = [ + ../home-manager/core + ../home-manager/hyprland.nix + ]; + + home.username = "jras"; + home.homeDirectory = "/home/jras"; + home.stateVersion = "23.11"; + + programs.git = { + userName = "Jasper Ras"; + userEmail = "jaspert.ras@gmail.com"; + }; + + home.file = { + gamestream-start = { + text = '' + #!${pkgs.zsh}/bin/zsh + ${pkgs.hyprland}/bin/hyprctl keyword monitor HDMI-A-1,1920x1080@59.94,auto,2 + ''; + target = "bin/gamestream-start"; + executable = true; + }; + gamestream-end = { + text = '' + #!${pkgs.zsh}/bin/zsh + ${pkgs.hyprland}/bin/hyprctl keyword monitor HDMI-A-1,preferred,auto,1 + ''; + target = "bin/gamestream-end"; + executable = true; + }; + }; + + programs.zsh.envExtra = "export PATH=$HOME/bin:$PATH"; + }; +} diff --git a/configuration/work/default.nix b/configuration/work/default.nix index 5bc9958..f17ac74 100644 --- a/configuration/work/default.nix +++ b/configuration/work/default.nix @@ -1,15 +1,17 @@ -{ config, pkgs, inputs, ... }: +{ config, pkgs, ... }: { imports = [ ./hardware-configuration.nix + ./home-manager.nix - ../packages.nix - ../services.nix - ../users + ../core ../hyprland.nix - ../nix-settings.nix ]; + system.stateVersion = "24.05"; # Do NOT change before reading configuration.nix + + users.users.jras.extraGroups = [ "networkmanager" "docker" ]; + age.secrets.ghostnet-cert.file = ../../secrets/ghostnet-cert.age; age.secrets.ghostnet-key.file = ../../secrets/ghostnet-key.age; age.secrets.ghostnet-ca.file = ../../secrets/ghostnet-ca.age; @@ -21,19 +23,6 @@ age.secrets.systems-ca.file = ../../secrets/systems-ca.age; age.secrets.systems-tls-auth.file = ../../secrets/systems-tls-auth.age; - environment.systemPackages = with pkgs; [ - slack - git-review - hexchat - apacheHttpd - moonlight-qt - brightnessctl - hugo - google-chrome - ]; - - nixpkgs.config.allowUnfree = true; - virtualisation.docker = { enable = true; enableOnBoot = true; @@ -51,21 +40,6 @@ networking.nameservers = [ "1.1.1.1" ]; networking.firewall.allowedTCPPorts = []; - time.timeZone = "Europe/Amsterdam"; - - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "nl_NL.UTF-8"; - LC_IDENTIFICATION = "nl_NL.UTF-8"; - LC_MEASUREMENT = "nl_NL.UTF-8"; - LC_MONETARY = "nl_NL.UTF-8"; - LC_NAME = "nl_NL.UTF-8"; - LC_NUMERIC = "nl_NL.UTF-8"; - LC_PAPER = "nl_NL.UTF-8"; - LC_TELEPHONE = "nl_NL.UTF-8"; - LC_TIME = "nl_NL.UTF-8"; - }; - services.libinput.mouse.accelProfile = "flat"; services.libinput.mouse.accelSpeed = "-5"; services.upower.enable = true; @@ -151,20 +125,6 @@ variant = ""; }; - users.users.jras = { - isNormalUser = true; - description = "Jasper Ras"; - extraGroups = [ "networkmanager" "wheel" "docker" ]; - packages = with pkgs; [ git ]; - }; - - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.jras = import ../../home-manager/entrypoints/work.nix; - home-manager.extraSpecialArgs = { inherit inputs; monitor-names = ["eDP-1" "HDMI-A-1" "DP-10"]; }; - programs.gnupg.agent.enable = true; programs.gnupg.agent.pinentryPackage = pkgs.pinentry-gnome3; - - system.stateVersion = "24.05"; # Do NOT change before reading configuration.nix } diff --git a/configuration/work/home-manager.nix b/configuration/work/home-manager.nix new file mode 100644 index 0000000..bbfb0a9 --- /dev/null +++ b/configuration/work/home-manager.nix @@ -0,0 +1,83 @@ +{ pkgs, inputs, ... }: +{ + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.jras = { + imports = [ + ../home-manager/core + + ../home-manager/hyprland.nix + ../home-manager/hostnet.nix + ../home-manager/php.nix + ../home-manager/ansible.nix + ../home-manager/python.nix + ]; + + home.username = "jras"; + home.homeDirectory = "/home/jras"; + home.stateVersion = "22.11"; + home.sessionPath = [ "$HOME/.local/bin" "$HOME/.plenv/bin" ]; + + home.packages = with pkgs; [ + slack + moonlight-qt + brightnessctl + google-chrome + ]; + + programs.git = { + userName = "Jasper Ras"; + userEmail = "jras@hostnet.nl"; + extraConfig = { gitreview.username = "jrasper"; }; + ignores = [ + ".direnv" + ".envrc" + ".project" + ".settings/" + ".buildpath" + "tags" + ".hhconfig" + ".DS_Store" + ".idea/" + ".vagrant/" + "*.swp" + "clover.xml" + "yarn-error.log" + "gsuite-auth.json" + "venv/" + "shell.nix" + + ".devenv*" + "devenv*" + ".pre-commit-config.yaml" + ]; + }; + + programs.zsh.envExtra = "export PATH=$HOME/.plenv/bin:$PATH"; + programs.zsh.initExtra = '' + eval "$(plenv init -)" + eval "$(dircolors)" + ''; + programs.zsh.shellAliases = { + ssh = "TERM=xterm-256color ssh"; + }; + + programs.pyenv.enable = true; + programs.pyenv.enableZshIntegration = true; + programs.ssh = { + controlMaster = "auto"; + controlPersist = "12h"; + serverAliveInterval = 11; + matchBlocks = { + "*.g1i.one".user = "jasras"; + "*.os1.openstack.group.one".user = "jasras"; + "*.one.com".user = "jasras"; + "91.184.16.185".port = 12345; + "*.compute.prv.vps1-testpod-cph3.one.com".forwardAgent = true; + "access.*.one.com".forwardAgent = true; + "access.*.g1i.one".forwardAgent = true; + }; + }; + }; +} |