From 5225575a1df779ed87dc916d691b373315a98038 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 4 Mar 2026 23:11:54 +0000 Subject: [PATCH] Update flake --- flake.lock | 71 ++++++++++++++++++++- flake.nix | 181 ++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 216 insertions(+), 36 deletions(-) diff --git a/flake.lock b/flake.lock index 22f0ee9..7373ce9 100644 --- a/flake.lock +++ b/flake.lock @@ -41,6 +41,24 @@ "type": "gitlab" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -118,6 +136,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1761765539, + "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1772198003, @@ -166,6 +199,22 @@ "type": "github" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1764557259, + "narHash": "sha256-fhD/QUtJ0HKs3oLvfnD+/SrBV5Y7YEkCYnDjOVUjLys=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0d70460758949966e91d9ecb823b821f963cefbb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "disko": "disko", @@ -173,7 +222,27 @@ "home-manager": "home-manager", "impermanence": "impermanence", "nixpkgs": "nixpkgs_3", - "nixpkgs-unstable": "nixpkgs-unstable" + "nixpkgs-unstable": "nixpkgs-unstable", + "try-cli": "try-cli" + } + }, + "try-cli": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1770817563, + "narHash": "sha256-REadu3/mf6EHbXofjkYgu/gZ/UBSFOMQ5YhtflwmDNE=", + "owner": "tobi", + "repo": "try-cli", + "rev": "f52328af336f7dfa93396069ebcd7152df399010", + "type": "github" + }, + "original": { + "owner": "tobi", + "repo": "try-cli", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 27a46a4..cfdad13 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,8 @@ url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; + try-cli.url = "github:tobi/try-cli"; + elephant.url = "github:abenz1267/elephant"; }; outputs = { @@ -23,6 +25,8 @@ impermanence, disko, home-manager, + try-cli, + elephant, ... } @ inputs: let lib = nixpkgs.lib; @@ -123,8 +127,6 @@ btop eza fzf - iwd - git neovim ripgrep tldr @@ -134,16 +136,16 @@ zip zoxide jq + git lazygit less - mlocate tree tmux tmuxinator wget zenity gum - yazi + pkgs-unstable.yazi rsync p7zip impala @@ -153,6 +155,23 @@ networking = { hostName = "stationette"; networkmanager.enable = true; + wireless = { + iwd.enable = true; + networks = { + ssid = "Outskirt Stable"; + psk = "SidonPhlegm"; + }; + }; + firewall = { + enable = true; + allowedTCPPorts = [ 53317 ]; + allowedUDPPorts = [ 53317 ]; + + # Optional: Extra commands for specific DNS rules + extraCommands = '' + ip46tables -A INPUT -p udp -s 172.16.0.0/12 -d 172.17.0.1 --dport 53 -m comment --comment "allow-docker-dns" -j ACCEPT + ''; + }; }; users.users.chris = { uid = 1000; @@ -172,6 +191,8 @@ }; hyprland = { enable = true; + package = pkgs-unstable.hyprland; + xwayland.enable = true; }; steam = { enable = true; @@ -184,6 +205,9 @@ openssh.enable = true; dbus.enable = true; envfs.enable = true; # This ensures normal shebangs work (#!/bin/bash) + expressvpn.enable = true; + locate.enable = true; + displayManager = { sddm = { enable = true; @@ -209,6 +233,7 @@ directories = [ "Downloads" "Tower" + "Code" ".steam" ".config/dotfiles" ".mozilla/firefox" @@ -227,45 +252,61 @@ ".config/shell/.env" ]; }; - activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] '' - if [[ -v DRY_RUN ]]; then - echo "Dry run: Would bootstrap dotfiles from labs.scarif.space" - exit - fi + activation = { + setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] '' + if [[ -v DRY_RUN ]]; then + echo "Dry run: Would bootstrap dotfiles from labs.scarif.space" + exit + fi - TEMP_DIR=$(mktemp -d) + TEMP_DIR=$(mktemp -d) - DOTFILES_DIR="$HOME/.config/dotfiles" - DOTFILES_GIT_DIR="$DOTFILES_DIR/.git" + DOTFILES_DIR="$HOME/.config/dotfiles" + DOTFILES_GIT_DIR="$DOTFILES_DIR/.git" - if [ ! -d "$DOTFILES_GIT_DIR" ]; then - echo "No local repository so cloning from remote" - SOURCE="https://labs.scarif.space/chris/dotfiles.git" - ${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR" - mv "$TEMP_DIR/.git" "$DOTFILES_GIT_DIR" - else - echo "Local repository found so cloning from there" - ${pkgs.git}/bin/git clone -b main "$DOTFILES_GIT_DIR" "$TEMP_DIR" - ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$TEMP_DIR" pull --rebase || true - fi + if [ ! -d "$DOTFILES_GIT_DIR" ]; then + echo "No local repository so cloning from remote" + SOURCE="https://labs.scarif.space/chris/dotfiles.git" + ${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR" + mv "$TEMP_DIR/.git" "$DOTFILES_GIT_DIR" + else + echo "Local repository found so cloning from there" + ${pkgs.git}/bin/git clone -b main "$DOTFILES_GIT_DIR" "$TEMP_DIR" + ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$TEMP_DIR" pull --rebase || true + fi - echo "Copying dot files to home" - ${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME" + echo "Copying dot files to home" + ${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME" - NVIM_DIR="$HOME/.config/nvim" - echo "Neovim config not initialised so initialising from remote" - ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git - ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule update --init || true - ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git + NVIM_DIR="$HOME/.config/nvim" + echo "Neovim config not initialised so initialising from remote" + ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git + ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule update --init || true + ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git - cd "$HOME" + cd "$HOME" - echo "Cleanup" - ${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR" - ${pkgs.coreutils}/bin/rm -rf "$HOME/.git" || true + echo "Cleanup" + ${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR" + ${pkgs.coreutils}/bin/rm -rf "$HOME/.git" || true - echo "Dotfiles bootstrapped successfully." - ''; + echo "Dotfiles bootstrapped successfully." + ''; + setupDevDirectories = lib.hm.dag.entryAfter ["writeBoundary"] '' + if [[ -v DRY_RUN ]]; then + echo "Dry run: Would create dev directories" + exit + fi + + echo "Creating development directories" + + for dir in "DevOps" "FSharp" "JavaScript" "Scala" "Rust" "PHP" "Tutorials" "Sites" "MobileApps" "Tries"; do + if [ ! -d "$HOME/Code/$dir" ]; then + mkdir -p "$HOME/Code/$dir" + fi + done + ''; + }; packages = with pkgs; [ # jetbrains.rider # android-studio @@ -273,8 +314,14 @@ # brave # go # lua + direnv + wiremix + bluetui spotify nodePackages.pnpm + try-cli.packages.${system}.default + elephant.packages.${system}.default + walker # (python3.withPackages (python-pkgs: [ python-pkgs.pip python-pkgs.requests ])) # rustup # zig @@ -302,6 +349,7 @@ antigravity gimp # kdePackages.dolphin + nautilus enpass enpass-cli expressvpn @@ -323,9 +371,72 @@ # kdePackages.print-manager mpv vlc + imv # telegram-desktop ]; }; + xdg.mimeApps = { + enable = true; + defaultApplications = { + # Directories + "inode/directory" = [ "org.gnome.Nautilus.desktop" ]; + + # Images + "image/png" = [ "imv.desktop" ]; + "image/jpeg" = [ "imv.desktop" ]; + "image/gif" = [ "imv.desktop" ]; + "image/webp" = [ "imv.desktop" ]; + "image/bmp" = [ "imv.desktop" ]; + "image/tiff" = [ "imv.desktop" ]; + + # Documents + "application/pdf" = [ "zathura.desktop" ]; + + # Web and Browser + "x-scheme-handler/http" = [ "firefox.desktop" ]; + "x-scheme-handler/https" = [ "firefox.desktop" ]; + "text/html" = [ "firefox.desktop" ]; + + # Video + "video/mp4" = [ "mpv.desktop" ]; + "video/x-msvideo" = [ "mpv.desktop" ]; + "video/x-matroska" = [ "mpv.desktop" ]; + "video/x-flv" = [ "mpv.desktop" ]; + "video/x-ms-wmv" = [ "mpv.desktop" ]; + "video/mpeg" = [ "mpv.desktop" ]; + "video/ogg" = [ "mpv.desktop" ]; + "video/webm" = [ "mpv.desktop" ]; + "video/quicktime" = [ "mpv.desktop" ]; + "video/3gpp" = [ "mpv.desktop" ]; + "video/3gpp2" = [ "mpv.desktop" ]; + "video/x-ms-asf" = [ "mpv.desktop" ]; + "video/x-ogm+ogg" = [ "mpv.desktop" ]; + "video/x-theora+ogg" = [ "mpv.desktop" ]; + "application/ogg" = [ "mpv.desktop" ]; + + # Mail + "x-scheme-handler/mailto" = [ "mailspring.desktop" ]; + + # Text and Code + "text/plain" = [ "nvim.desktop" ]; + "text/english" = [ "nvim.desktop" ]; + "text/x-makefile" = [ "nvim.desktop" ]; + "text/x-c++hdr" = [ "nvim.desktop" ]; + "text/x-c++src" = [ "nvim.desktop" ]; + "text/x-chdr" = [ "nvim.desktop" ]; + "text/x-csrc" = [ "nvim.desktop" ]; + "text/x-java" = [ "nvim.desktop" ]; + "text/x-moc" = [ "nvim.desktop" ]; + "text/x-pascal" = [ "nvim.desktop" ]; + "text/x-tcl" = [ "nvim.desktop" ]; + "text/x-tex" = [ "nvim.desktop" ]; + "application/x-shellscript" = [ "nvim.desktop" ]; + "text/x-c" = [ "nvim.desktop" ]; + "text/x-c++" = [ "nvim.desktop" ]; + "application/xml" = [ "nvim.desktop" ]; + "text/xml" = [ "nvim.desktop" ]; + }; + }; programs = let lock-false = { Value = false;