diff options
| -rw-r--r-- | flake.lock | 187 | ||||
| -rw-r--r-- | flake.nix | 40 | ||||
| -rw-r--r-- | home-manager/gaming.nix | 2 | ||||
| -rw-r--r-- | home-manager/home.nix | 17 | ||||
| -rw-r--r-- | machines/betsy/default.nix | 2 | ||||
| -rw-r--r-- | machines/biski/default.nix | 1 | ||||
| -rw-r--r-- | machines/bosco/default.nix | 34 | ||||
| -rw-r--r-- | machines/khad/default.nix | 2 | ||||
| -rw-r--r-- | machines/zenbook/default.nix | 3 | ||||
| -rw-r--r-- | modules/home-manager/btop.nix | 1 | ||||
| -rw-r--r-- | modules/home-manager/waybar.nix | 16 | ||||
| -rw-r--r-- | modules/nixos/remote-build.nix | 20 | ||||
| -rw-r--r-- | modules/nixos/system-packages.nix | 1 | ||||
| -rw-r--r-- | modules/nixos/tailscale.nix | 1 | ||||
| -rw-r--r-- | modules/users/defin.nix | 1 | ||||
| -rw-r--r-- | resources/nix-search-tv.sh | 141 |
16 files changed, 379 insertions, 90 deletions
@@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1774211390, - "narHash": "sha256-sTtAgCCaX8VNNZlQFACd3i1IQ+DB0Wf3COgiFS152ds=", + "lastModified": 1775558810, + "narHash": "sha256-fy95EdPnqQlpbP8+rk0yWKclWShCUS5VKs6P7/1MF2c=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "f62a4dbfa4e5584f14ad4c62afedf6e4b433cf70", + "rev": "7371b669b22aa2af980f913fc312a786d2f1abb2", "type": "github" }, "original": { @@ -215,6 +215,24 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -258,11 +276,11 @@ ] }, "locked": { - "lastModified": 1775077333, - "narHash": "sha256-OXcxobt7lBkh1B8AjwreU+24myhtKpqeLfAeIyNLFY8=", + "lastModified": 1775425411, + "narHash": "sha256-KY6HsebJHEe5nHOWP7ur09mb0drGxYSzE3rQxy62rJo=", "owner": "nix-community", "repo": "home-manager", - "rev": "49ca96b2714c5931e17401eff87f3edd42d2b0f2", + "rev": "0d02ec1d0a05f88ef9e74b516842900c41f0f2fe", "type": "github" }, "original": { @@ -275,7 +293,7 @@ "hugo-congo": { "flake": false, "locked": { - "narHash": "sha256-T7+OzM8Dq9vVKZUA90mSoy3ESmoR5Jvzi+yV2vXxLeA=", + "narHash": "sha256-LaLdKuI3m1gFjaAvKYq7j1ksvMvQru5kbqaqJ9dj3ps=", "type": "file", "url": "https://github.com/jpanther/congo" }, @@ -329,11 +347,11 @@ ] }, "locked": { - "lastModified": 1772461523, - "narHash": "sha256-mI6A51do+hEUzeJKk9YSWfVHdI/SEEIBi2tp5Whq5mI=", + "lastModified": 1775496928, + "narHash": "sha256-Ds759WU03mGWtu3I43J+5GF5Ni8TvF+GYQUFD+fVeMo=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "7d63c04b4a2dd5e59ef943b4b143f46e713df804", + "rev": "cf95d93d17baa18f1d9b016b3afe27f820521a6e", "type": "github" }, "original": { @@ -357,15 +375,15 @@ "nixpkgs-unstable" ], "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems", + "systems": "systems_2", "xdph": "xdph" }, "locked": { - "lastModified": 1775082056, - "narHash": "sha256-rC0fWLlXNnZe+SjrCUqnX9QSrGiwLhTjR+y14onv+J4=", + "lastModified": 1776710722, + "narHash": "sha256-r3wsMIWSPbT6EEReEyVJ7sULgddOTitn8O0w7mGCjVk=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "529f72249c2cf4cefc824a612aeddf2d5f858f54", + "rev": "73f48077965d5b895a731c34ab648f73fdb7b2ce", "type": "github" }, "original": { @@ -407,11 +425,11 @@ ] }, "locked": { - "lastModified": 1772467975, - "narHash": "sha256-kipyuDBxrZq+beYpZqWzGvFWm4QbayW9agAvi94vDXY=", + "lastModified": 1774710575, + "narHash": "sha256-p7Rcw13+gA4Z9EI3oGYe3neQ3FqyOOfZCleBTfhJ95Q=", "owner": "hyprwm", "repo": "hyprland-guiutils", - "rev": "5e1c6b9025aaf4d578f3eff7c0eb1f0c197a9507", + "rev": "0703df899520001209646246bef63358c9881e36", "type": "github" }, "original": { @@ -538,11 +556,11 @@ ] }, "locked": { - "lastModified": 1774211405, - "narHash": "sha256-6KNwP4ojUzv3YBlZU5BqCpTrWHcix1Jo01BISsTT0xk=", + "lastModified": 1774911391, + "narHash": "sha256-c4YVwO33Mmw+FIV8E0u3atJZagHvGTJ9Jai6RtiB8rE=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "cb4e152dc72095a2af422956c6b689590572231a", + "rev": "e6caa3d4d1427eedbdf556cf4ceb70f2d9c0b56d", "type": "github" }, "original": { @@ -592,11 +610,11 @@ ] }, "locked": { - "lastModified": 1773074819, - "narHash": "sha256-qRqYnXiKoJLRTcfaRukn7EifmST2IVBUMZOeZMAc5UA=", + "lastModified": 1775414057, + "narHash": "sha256-mDpHnf+MkdOxEqIM1TnckYYh9p1SXR8B3KQfNZ12M8s=", "owner": "hyprwm", "repo": "hyprwire", - "rev": "f68afd0e73687598cc2774804fedad76693046f0", + "rev": "86012ee01b0fdd8bf3101ef38816f2efbee42490", "type": "github" }, "original": { @@ -629,11 +647,11 @@ "spectrum": "spectrum" }, "locked": { - "lastModified": 1775055092, - "narHash": "sha256-N9EjeJD5qnszo08XSXeCvUylU1tJDJ1LxRb4Zb/YcKU=", + "lastModified": 1776340739, + "narHash": "sha256-s4FDictJlPtY6Shd6scG5hgrDMiHth09+svtvTA5NLA=", "owner": "astro", "repo": "microvm.nix", - "rev": "0f112113172c9fabeb27a94f39397d11df49e671", + "rev": "2f2f62fdfdca2750e3399f66bd03986ab967e5ca", "type": "github" }, "original": { @@ -645,7 +663,7 @@ "modded-minecraft-servers": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nix": "nix", "nixpkgs": "nixpkgs_2" }, @@ -663,6 +681,24 @@ "type": "github" } }, + "ndg": { + "inputs": { + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1776458745, + "narHash": "sha256-hKqVIM2g8pJDVKgR561fEuw/TtbtK/8ukmZgRrgJt88=", + "owner": "feel-co", + "repo": "ndg", + "rev": "6c3864361ebe9c3458a52e0c692d1d66cdbfadb2", + "type": "github" + }, + "original": { + "owner": "feel-co", + "repo": "ndg", + "type": "github" + } + }, "nix": { "inputs": { "lowdown-src": "lowdown-src", @@ -709,11 +745,11 @@ ] }, "locked": { - "lastModified": 1774762074, - "narHash": "sha256-89Mh4Eb/5stVJX6kGagVMijcU2FmfeD8Qv7UXc5d92o=", + "lastModified": 1776575850, + "narHash": "sha256-28Gqz0GDpGsBv8GtAn2dywEQRr+CtTDsD5J7VD6icBE=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "bc13aeaed568be76eab84df88ff39261bb52ff70", + "rev": "3b9653a107c736222b5ae0d4036dd3b885219065", "type": "github" }, "original": { @@ -726,14 +762,14 @@ "inputs": { "flake-compat": "flake-compat_3", "nixpkgs": "nixpkgs_3", - "systems": "systems_2" + "systems": "systems_3" }, "locked": { - "lastModified": 1775098524, - "narHash": "sha256-1RmA9W9qSWKHbYv5RBemkbhPLKnvbS/oHuP2Tc4aAU4=", + "lastModified": 1776742288, + "narHash": "sha256-4kvrkYdNdDF+FM0UVqvV6l2gnwPtjBku3lpTxcIaFT8=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "cc4e9a8b8c6e8315fb4cb53606bfd3481417a07c", + "rev": "9bcdf09f184803b32291c3dc08fb6da1b783f1b4", "type": "github" }, "original": { @@ -843,11 +879,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1775036866, - "narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=", + "lastModified": 1776548001, + "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6201e203d09599479a3b3450ed24fa81537ebc4e", + "rev": "b12141ef619e0a9c1c84dc8c684040326f27cdcc", "type": "github" }, "original": { @@ -891,11 +927,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1775002709, - "narHash": "sha256-d3Yx83vSrN+2z/loBh4mJpyRqr9aAJqlke4TkpFmRJA=", + "lastModified": 1776560675, + "narHash": "sha256-p68udKWWh7+V4ZPpcMDq0gTHWNZJnr4JPI+kHPPE40o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bcd464ccd2a1a7cd09aa2f8d4ffba83b761b1d0e", + "rev": "e07580dae39738e46609eaab8b154de2488133ce", "type": "github" }, "original": { @@ -905,14 +941,27 @@ "type": "github" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1775036866, + "narHash": "sha256-ByAX1LkhCwZ94+KnFAmnJSMAvui7kgCxjHgUHsWAbfI=", + "rev": "6201e203d09599479a3b3450ed24fa81537ebc4e", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre972949.6201e203d095/nixexprs.tar.xz?lastModified=1775036866&rev=6201e203d09599479a3b3450ed24fa81537ebc4e" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" + } + }, "nushell-scripts": { "flake": false, "locked": { - "lastModified": 1773315180, - "narHash": "sha256-5FKqphXxVSgqGXbqOL3aiZEGFSr5SMjMVIWzB0dA/+I=", + "lastModified": 1776554812, + "narHash": "sha256-QPKgVj5tWwgwspCQYwjPBJZLTHm2e3AuneOK+hI6qUg=", "owner": "nushell", "repo": "nu_scripts", - "rev": "196d94338d382561e7bacb29948ffcfa5ff1b2a1", + "rev": "c5387bd60ca63d26885ee73ceb8a84160bc6ca6b", "type": "github" }, "original": { @@ -931,11 +980,11 @@ ] }, "locked": { - "lastModified": 1774104215, - "narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=", + "lastModified": 1775036584, + "narHash": "sha256-zW0lyy7ZNNT/x8JhzFHBsP2IPx7ATZIPai4FJj12BgU=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "f799ae951fde0627157f40aec28dec27b22076d0", + "rev": "4e0eb042b67d863b1b34b3f64d52ceb9cd926735", "type": "github" }, "original": { @@ -953,6 +1002,7 @@ "catppuccin-starship": "catppuccin-starship", "catppuccin-waybar": "catppuccin-waybar", "disko": "disko", + "flake-utils": "flake-utils", "home-manager": "home-manager", "hugo-congo": "hugo-congo", "hyprland": "hyprland", @@ -967,6 +1017,7 @@ "nixpkgs-unstable": "nixpkgs-unstable", "nushell-scripts": "nushell-scripts", "sops-nix": "sops-nix", + "unf": "unf", "wallpapers": "wallpapers" } }, @@ -977,11 +1028,11 @@ ] }, "locked": { - "lastModified": 1774910634, - "narHash": "sha256-B+rZDPyktGEjOMt8PcHKYmgmKoF+GaNAFJhguktXAo0=", + "lastModified": 1776771786, + "narHash": "sha256-DRFGPfFV6hbrfO9a1PH1FkCi7qR5FgjSqsQGGvk1rdI=", "owner": "Mic92", "repo": "sops-nix", - "rev": "19bf3d8678fbbfbc173beaa0b5b37d37938db301", + "rev": "bef289e2248991f7afeb95965c82fbcd8ff72598", "type": "github" }, "original": { @@ -1008,6 +1059,21 @@ }, "systems": { "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", @@ -1021,7 +1087,7 @@ "type": "github" } }, - "systems_2": { + "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1036,6 +1102,27 @@ "type": "github" } }, + "unf": { + "inputs": { + "ndg": "ndg", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760178630, + "narHash": "sha256-oxRMTQtzIO1yFRhY++Ss8+ea1cTH40bD/+FAE+m5NFk=", + "ref": "refs/heads/main", + "rev": "8a6aa536039f1b207888b1369c5cabf0b131e07b", + "revCount": 5, + "type": "git", + "url": "https://git.atagen.co/atagen/unf" + }, + "original": { + "type": "git", + "url": "https://git.atagen.co/atagen/unf" + } + }, "wallpapers": { "flake": false, "locked": { @@ -27,6 +27,11 @@ # inputs.nixpkgs.follows = "nixpkgs"; # inputs.lix.follows = "lix"; # }; + + unf = { + url = "git+https://git.atagen.co/atagen/unf"; + inputs.nixpkgs.follows = "nixpkgs"; + }; #for device formatting disko = { @@ -192,18 +197,32 @@ let inherit (self) outputs; lib = nixpkgs.lib // home-manager.lib; - systems = [ "x86_64-linux" "aarch64-linux" ]; - # forAllSystems = f: lib.genAttrs systems (system: f pkgsFor.${system}); - pkgsFor = lib.genAttrs systems (system: import nixpkgs { - inherit system; - config.allowUnfree = true; - }); + # systems = [ "x86_64-linux" "aarch64-linux" ]; + # # forAllSystems = f: lib.genAttrs systems (system: f pkgsFor.${system}); + # pkgsFor = lib.genAttrs systems (system: import nixpkgs { + # inherit system; + # config.allowUnfree = true; + # }); + + # function to use unf to list options from arbitrary module for home-manager + mkOpts = system: module: + inputs.unf.lib.json { + inherit self; + pkgs = nixpkgs.legacyPackages.${system}; + + # not all modules can be evaluated easily. If your module + # does not evaluate, try checking this NüschtOS file: + # https://github.com/NuschtOS/search.nuschtos.de/blob/main/flake.nix + modules = [module]; + }; minimalHomeManagerSettings = [ # From github:MasterofNull/nixos config home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.extraSpecialArgs = { + inherit inputs; + }; } ]; nixIndex = [ @@ -261,7 +280,12 @@ modules = minimalModuleConfig ++ [ ./machines/zenbook # lix-module.nixosModules.default # hyprland.homeManagerModules.default {wayland.windowManager.hyprland.enable = true;} - home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/tiling-wm.nix; } + home-manager.nixosModules.home-manager { + home-manager.users.defin = import ./home-manager/tiling-wm.nix; + home-manager.extraSpecialArgs = { + diskoOptions = inputs.disko.nixosModules.default; + }; + } ]; }; diff --git a/home-manager/gaming.nix b/home-manager/gaming.nix index d4c4ea5..db00755 100644 --- a/home-manager/gaming.nix +++ b/home-manager/gaming.nix @@ -27,7 +27,7 @@ r2modman marble-marcher-ce prismlauncher - luanti + # luanti #upstream out of date lutris heroic wineWowPackages.waylandFull diff --git a/home-manager/home.nix b/home-manager/home.nix index 313148e..d25cdfb 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,9 +1,11 @@ -{ pkgs, hyprland-plugins, ... }: +{ pkgs, hyprland-plugins, ... } @ args : # let # home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"; # unstable = import <nixpkgs-unstable>{}; # in -{ +let + ns = pkgs.writeShellScriptBin "ns" (builtins.readFile ../resources/nix-search-tv.sh); +in { imports = [ ./default.nix ]; @@ -89,6 +91,8 @@ openjdk adoptopenjdk-icedtea-web + ns + fzf ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage @@ -126,6 +130,15 @@ # }; programs = { + nix-search-tv = { + enable = true; + settings = { + experimental.options_file = { + disko = "${args.diskoOptions}"; + }; + }; + }; + qutebrowser = { enable = true; loadAutoconfig = true; diff --git a/machines/betsy/default.nix b/machines/betsy/default.nix index 8bede1d..9a54214 100644 --- a/machines/betsy/default.nix +++ b/machines/betsy/default.nix @@ -20,7 +20,7 @@ systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; - kernelPackages = pkgs.linuxPackages_latest; # use latest kernel + # kernelPackages = pkgs.linuxPackages_latest; # use latest kernel #upstream bug # kernelParams = ["acpi=force" "acpi_osi=!" "acpi_osi=Linux"]; # binfmt.emulatedSystems = ["aarch64-linux"]; }; diff --git a/machines/biski/default.nix b/machines/biski/default.nix index d9944e6..74363a4 100644 --- a/machines/biski/default.nix +++ b/machines/biski/default.nix @@ -8,6 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../modules/nixos/remote-build.nix # /tmp/etc/nixos/hardware-configuartion.nix ./disko.nix ./portforward.nix diff --git a/machines/bosco/default.nix b/machines/bosco/default.nix index 133eca8..dba217a 100644 --- a/machines/bosco/default.nix +++ b/machines/bosco/default.nix @@ -50,10 +50,10 @@ # networking.usePredictableInterfaceNames = false; - # networking.localCommands = '' - # ip addr add 23.131.76.82/32 dev ens18 - # ip route add default via "172.16.101.1" dev ens18 src 23.131.76.82 - # ''; + networking.localCommands = '' + ip route add default via 172.16.101.1 src 23.131.76.82 + ''; + # ip addr add 23.131.76.82/32 dev ens18 # ip route del default networking.interfaces."eth0".ipv4 = { addresses = [{ @@ -64,18 +64,18 @@ address = "172.16.101.82"; prefixLength = 24; }]; - routes = [ - { - via = "172.16.101.1"; - # address = "0.0.0.0"; - # prefixLength = 0; - address = "172.16.101.82"; - prefixLength = 24; - options = { - table = "default"; - src = "23.131.76.82"; - }; - } + # routes = [ + # { + # via = "172.16.101.1"; + # # address = "0.0.0.0"; + # # prefixLength = 0; + # address = "172.16.101.0"; + # prefixLength = 24; + # # options = { + # # table = "default"; + # # src = "23.131.76.82"; + # # }; + # } # { # via = "172.16.101.1"; # options = { @@ -83,7 +83,7 @@ # metric = "202"; # }; # } - ]; + # ]; }; networking.nameservers = [ "9.9.9.9" ]; diff --git a/machines/khad/default.nix b/machines/khad/default.nix index b2ab71e..3f88856 100644 --- a/machines/khad/default.nix +++ b/machines/khad/default.nix @@ -24,7 +24,7 @@ systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; - kernelPackages = pkgs.linuxPackages_latest; # use latest kernel + # kernelPackages = pkgs.linuxPackages_latest; # use latest kernel #upstream bug }; boot.binfmt.emulatedSystems = ["aarch64-linux"]; hardware.onlykey.enable = true; diff --git a/machines/zenbook/default.nix b/machines/zenbook/default.nix index f3ebeb1..cfc44f2 100644 --- a/machines/zenbook/default.nix +++ b/machines/zenbook/default.nix @@ -7,6 +7,7 @@ { imports = [ ./hardware-configuration.nix + ../../modules/nixos/remote-build.nix ../../modules/nixos/hyprland.nix ../../modules/nixos/niri.nix @@ -25,7 +26,7 @@ systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; - kernelPackages = pkgs.linuxPackages_latest; # use latest kernel + # kernelPackages = pkgs.linuxPackages_latest; # use latest kernel #upstream packaging issue binfmt.emulatedSystems = ["aarch64-linux"]; }; services.fwupd.enable = true; diff --git a/modules/home-manager/btop.nix b/modules/home-manager/btop.nix index 894ff2e..352d3bb 100644 --- a/modules/home-manager/btop.nix +++ b/modules/home-manager/btop.nix @@ -8,6 +8,7 @@ color_theme = "catppuccin_mocha"; theme_background = false; # make btop transparent vim_keys = true; + proc_aggregate = true; # aggregate subprocess resources in tree view }; }; } diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix index c7f977e..74aa144 100644 --- a/modules/home-manager/waybar.nix +++ b/modules/home-manager/waybar.nix @@ -9,7 +9,7 @@ * { font-family: FantasqueSansMono Nerd Font; - font-size: 17px; + font-size: 14px; min-height: 0; } @@ -130,7 +130,7 @@ position = "top"; height = 48; modules-left = [ "hyprland/workspaces" ]; - modules-center = [ "clock" "backlight/slider" ]; + modules-center = [ "clock" ]; modules-right = [ "pulseaudio" "bluetooth" "network" "battery" "cpu" "temperature" "memory" "idle_inhibitor" "tray" ]; "tray" = { @@ -192,12 +192,12 @@ format-disconnected = "Disconnected ⚠"; format-alt = "{ifname}: {ipaddr}/{cidr}"; }; - "backlight/slider" = { - min = 1; - max = 100; - orientation = "horizontal"; - # device = "intel_backlight"; - }; + # "backlight/slider" = { + # min = 1; + # max = 100; + # orientation = "horizontal"; + # # device = "intel_backlight"; + # }; "clock" = { format = "{:%H:%M} "; format-alt = "{:%A, %B %d, %Y (%R)} "; diff --git a/modules/nixos/remote-build.nix b/modules/nixos/remote-build.nix new file mode 100644 index 0000000..79da57e --- /dev/null +++ b/modules/nixos/remote-build.nix @@ -0,0 +1,20 @@ +{ config, ... } : { + nix.distributedBuilds = true; + # nix.settings.builders-use-subsituters = true; + nix.buildMachines = [ + { + hostName = "doretta"; + systems = [ "x86_64-linux" "aarch64-linux"]; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "llvm" + ]; + maxJobs = 2; # could be higher but slow internet + speedFactor = 1; + sshKey = "/root/.ssh/nixremote"; + sshUser = "nixremote"; + } + ]; +} diff --git a/modules/nixos/system-packages.nix b/modules/nixos/system-packages.nix index 07696ae..be78370 100644 --- a/modules/nixos/system-packages.nix +++ b/modules/nixos/system-packages.nix @@ -11,6 +11,7 @@ nvd unzip git + ack #like git-grep but works outside git repos wl-clipboard pciutils usbutils diff --git a/modules/nixos/tailscale.nix b/modules/nixos/tailscale.nix index e3635fd..8fa49be 100644 --- a/modules/nixos/tailscale.nix +++ b/modules/nixos/tailscale.nix @@ -5,6 +5,7 @@ "--login-server https://bosco.myrmexia.xyz" "--operator defin" ]; + extraSetFlags = ["--netfilter-mode=nodivert"]; }; systemd.services.tailscaled.after = [ "systemd-networkd-wait-online.service" ]; networking.firewall = { diff --git a/modules/users/defin.nix b/modules/users/defin.nix index 9cd1548..3b26ed2 100644 --- a/modules/users/defin.nix +++ b/modules/users/defin.nix @@ -25,7 +25,6 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5CATqAUsBWLTIaqtdAS/EO3L/04NwKEmnv7D68vO+a defin@biski" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILuW75N5K0/83bOgsB/yymgIHoQgaaAJjW9MMDG9s/2p defin@picast2" # keys for remote build - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPY7aJCzJmN0XYdf8Ehp/OY71y8WudmW7sWA9Nb+pncL root@doretta" ]; }; }; diff --git a/resources/nix-search-tv.sh b/resources/nix-search-tv.sh new file mode 100644 index 0000000..a822aa3 --- /dev/null +++ b/resources/nix-search-tv.sh @@ -0,0 +1,141 @@ +#!/usr/bin/env bash + +case "$(basename "$SHELL")" in +bash | zsh | sh) + # Keep the current shell + ;; +*) + # In case the system uses a non-POSIX shell, like fish or nushell, + # we want to ensure run also our forked processes in a bash environment. + SHELL="bash" + ;; +esac + +# === Change keybinds or add more here === + +declare -a INDEXES=( + "nixpkgs ctrl-n" + "home-manager ctrl-h" + + # you can add any indexes combination here, + # like `nixpkgs,nixos` + + "all ctrl-a" +) + +SEARCH_SNIPPET_KEY="ctrl-w" +OPEN_SOURCE_KEY="ctrl-s" +OPEN_HOMEPAGE_KEY="ctrl-o" +NIX_SHELL_KEY="ctrl-i" +PRINT_PREVIEW_KEY="ctrl-p" + +OPENER="xdg-open" + +if [[ "$(uname)" == 'Darwin' ]]; then + SEARCH_SNIPPET_KEY="alt-w" + OPEN_SOURCE_KEY="alt-s" + OPEN_HOMEPAGE_KEY="alt-o" + NIX_SHELL_KEY="alt-i" + PRINT_PREVIEW_KEY="alt-p" + + OPENER="open" +fi + +# ======================================== + +# for debug / development +CMD="${NIX_SEARCH_TV:-nix-search-tv}" + +# bind_index binds the given $key to the given $index +bind_index() { + local key="$1" + local index="$2" + + local prompt="" + local indexes_flag="" + if [[ -n "$index" && "$index" != "all" ]]; then + indexes_flag="--indexes $index" + prompt=$index + fi + + local preview="$CMD preview $indexes_flag" + local print="$CMD print $indexes_flag" + + echo "$key:change-prompt($prompt> )+change-preview($preview {})+reload($print)" +} + +STATE_FILE="/tmp/nix-search-tv-fzf" + +# save_state saves the currently displayed index +# to the $STATE_FILE. This file serves as an external script state +# for communication between "print" and "preview" commands +save_state() { + local index="$1" + + local indexes_flag="" + if [[ -n "$index" && "$index" != "all" ]]; then + indexes_flag="--indexes $index" + fi + + echo "execute(echo $indexes_flag > $STATE_FILE)" +} + +HEADER="$OPEN_HOMEPAGE_KEY - open homepage +$OPEN_SOURCE_KEY - open source +$SEARCH_SNIPPET_KEY - search github for snippets +$NIX_SHELL_KEY - nix-shell +$PRINT_PREVIEW_KEY - print preview +" + +FZF_BINDS="" +for e in "${INDEXES[@]}"; do + index=$(echo "$e" | awk '{ print $1 }') + keybind=$(echo "$e" | awk '{ print $2 }') + + fzf_bind=$(bind_index "$keybind" "$index") + fzf_save_state=$(save_state "$index") + FZF_BINDS="$FZF_BINDS --bind '$fzf_bind+$fzf_save_state'" + + newline=$'\n' + HEADER="$HEADER$keybind - $index$newline" +done + +# reset the state +echo "" >/tmp/nix-search-tv-fzf + +SEARCH_SNIPPET_CMD=$'echo "{}"' +# fzf surrounds the matched package with ', trim them +SEARCH_SNIPPET_CMD="$SEARCH_SNIPPET_CMD | tr -d \"\'\" " +# if it's multi-index search, then we need to remote the prefix +SEARCH_SNIPPET_CMD="$SEARCH_SNIPPET_CMD | awk \'{ if (\$2) { print \$2 } else print \$1 }\' " +SEARCH_SNIPPET_CMD="$SEARCH_SNIPPET_CMD | xargs printf \"https://github.com/search?type=code&q=lang:nix+%s\" \$1 " + +# shellcheck disable=SC2016 +NIX_SHELL_CMD='nix-shell --run $SHELL -p $(echo "{}" | sed "s:nixpkgs/::g"' +NIX_SHELL_CMD="$NIX_SHELL_CMD | tr -d \"\'\")" + +# shellcheck disable=SC2016 +PREVIEW_WINDOW=' + if [[ ${FZF_COLS:-$COLUMNS} -lt 130 ]]; then + echo "+change-preview-window(wrap,up)" + else + echo "+change-preview-window(wrap)" + fi +' + +eval "$CMD print | fzf \ + --preview '$CMD preview \$(cat $STATE_FILE) {}' \ + --bind '$OPEN_SOURCE_KEY:execute($CMD source \$(cat $STATE_FILE) {} | xargs $OPENER)' \ + --bind '$OPEN_HOMEPAGE_KEY:execute($CMD homepage \$(cat $STATE_FILE) {} | xargs $OPENER)' \ + --bind $'$SEARCH_SNIPPET_KEY:execute($SEARCH_SNIPPET_CMD | xargs $OPENER)' \ + --bind $'$NIX_SHELL_KEY:become($NIX_SHELL_CMD)' \ + --bind $'$PRINT_PREVIEW_KEY:execute($CMD preview \$(cat $STATE_FILE) {} | less)' \ + --layout reverse \ + --scheme history \ + --bind 'resize,start:transform:$PREVIEW_WINDOW' \ + --header '$HEADER' \ + --header-first \ + --header-border \ + --header-label \"Help\" \ + $FZF_BINDS +" |
