diff --git a/.scratch/scratch.org-mode b/.scratch/scratch.org-mode new file mode 100644 index 0000000..90fd3cd --- /dev/null +++ b/.scratch/scratch.org-mode @@ -0,0 +1 @@ +# Scratchpad \ No newline at end of file diff --git a/flake.lock b/flake.lock index bb69012..d35e74a 100644 --- a/flake.lock +++ b/flake.lock @@ -54,17 +54,16 @@ "base16-fish": { "flake": false, "locked": { - "lastModified": 1754405784, - "narHash": "sha256-l9xHIy+85FN+bEo6yquq2IjD1rSg9fjfjpyGP1W8YXo=", + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", "owner": "tomyun", "repo": "base16-fish", - "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", "type": "github" }, "original": { "owner": "tomyun", "repo": "base16-fish", - "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", "type": "github" } }, @@ -104,11 +103,11 @@ "blocklist-hosts": { "flake": false, "locked": { - "lastModified": 1760670453, - "narHash": "sha256-KQx4CWPfKBJwuBONYSE7AIKa7UBXBvtNVcrOmkPrjkY=", + "lastModified": 1760016705, + "narHash": "sha256-7yHFRojwqAIBddYbmA/uBwcPQk9s3pj0kj13C8G+axA=", "owner": "StevenBlack", "repo": "hosts", - "rev": "5da10a61afc297307c489903bfc35b1eb8dac674", + "rev": "1cb61353d4a9e616cba7521e094b772a2c3c072a", "type": "github" }, "original": { @@ -126,11 +125,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1761326352, - "narHash": "sha256-DoR4mHaStX6Dg2Gilc2Dqr/XaxXmQTOQS5cZ5xKPQJY=", + "lastModified": 1760134135, + "narHash": "sha256-X1JFfOcXlgzo1MKJ0nySvv2o33rA1CGHTcpiDE37p90=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "6492dc810f2f250ef95096910a44f03eea6a594f", + "rev": "2aacf8ca92001daa02ba216f68194d3fac3f3f0e", "type": "github" }, "original": { @@ -147,11 +146,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1761325938, - "narHash": "sha256-E2dm2bIlu1zBVBAVYM2bZVdr9vkzXGj70aLTfXuXUKA=", + "lastModified": 1760117121, + "narHash": "sha256-M82QKHzBYlBk5+8afnImMjbQFIT5E5JMIBouFlpVq3I=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "99807d1b33588b9d113fc5e9cca87e4f1ae3e0a1", + "rev": "9535ea88059f185b72480d7e7b0cbcdbf06b78a6", "type": "github" }, "original": { @@ -192,20 +191,6 @@ "type": "github" } }, - "flake-compat_2": { - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "revCount": 57, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -241,24 +226,6 @@ "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz" } }, - "flake-utils": { - "inputs": { - "systems": "systems_5" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "fromYaml": { "flake": false, "locked": { @@ -322,11 +289,11 @@ ] }, "locked": { - "lastModified": 1761266473, - "narHash": "sha256-QxCyKWBmuzI+eMhYV1JmbZsiUnBNATRP1EW34OBt5Vg=", + "lastModified": 1760061988, + "narHash": "sha256-CeuMo7fjWm3XaoK+b1PGyaVIlE1GHudoxk9jrJFvfbY=", "owner": "nix-community", "repo": "home-manager", - "rev": "5c71d4a730bd3c972befff343bb074421e345937", + "rev": "c7f4214faca2f196c551b767c12a70bfa0614510", "type": "github" }, "original": { @@ -342,11 +309,11 @@ ] }, "locked": { - "lastModified": 1761316995, - "narHash": "sha256-BAAjCpjTnfaxtc9NCkbUl9MUv5JmAG5qU7/G8TTHmb4=", + "lastModified": 1760130406, + "narHash": "sha256-GKMwBaFRw/C1p1VtjDz4DyhyzjKUWyi1K50bh8lgA2E=", "owner": "nix-community", "repo": "home-manager", - "rev": "82b58f38202540bce4e5e00759d115c5a43cab85", + "rev": "d305eece827a3fe317a2d70138f53feccaf890a1", "type": "github" }, "original": { @@ -430,11 +397,11 @@ ] }, "locked": { - "lastModified": 1750621377, - "narHash": "sha256-8u6b5oAdX0rCuoR8wFenajBRmI+mzbpNig6hSCuWUzE=", + "lastModified": 1759490292, + "narHash": "sha256-T6iWzDOXp8Wv0KQOCTHpBcmAOdHJ6zc/l9xaztW6Ivc=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "b3d628d01693fb9bb0a6690cd4e7b80abda04310", + "rev": "9431db625cd9bb66ac55525479dce694101d6d7a", "type": "github" }, "original": { @@ -449,9 +416,7 @@ "hyprcursor": "hyprcursor", "hyprgraphics": "hyprgraphics", "hyprland-protocols": "hyprland-protocols", - "hyprland-qtutils": [ - "hyprland-qtutils" - ], + "hyprland-qtutils": "hyprland-qtutils", "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", @@ -505,14 +470,17 @@ "hyprland-qt-support": { "inputs": { "hyprlang": [ + "hyprland", "hyprland-qtutils", "hyprlang" ], "nixpkgs": [ + "hyprland", "hyprland-qtutils", "nixpkgs" ], "systems": [ + "hyprland", "hyprland-qtutils", "systems" ] @@ -534,29 +502,36 @@ "hyprland-qtutils": { "inputs": { "hyprland-qt-support": "hyprland-qt-support", - "hyprlang": "hyprlang_2", + "hyprlang": [ + "hyprland", + "hyprlang" + ], "hyprutils": [ + "hyprland", "hyprland-qtutils", "hyprlang", "hyprutils" ], "nixpkgs": [ + "hyprland", "nixpkgs" ], - "systems": "systems_2" + "systems": [ + "hyprland", + "systems" + ] }, "locked": { - "lastModified": 1759080228, - "narHash": "sha256-RgDoAja0T1hnF0pTc56xPfLfFOO8Utol2iITwYbUhTk=", + "lastModified": 1753819801, + "narHash": "sha256-tHe6XeNeVeKapkNM3tcjW4RuD+tB2iwwoogWJOtsqTI=", "owner": "hyprwm", "repo": "hyprland-qtutils", - "rev": "629b15c19fa4082e4ce6be09fdb89e8c3312aed7", + "rev": "b308a818b9dcaa7ab8ccab891c1b84ebde2152bc", "type": "github" }, "original": { "owner": "hyprwm", "repo": "hyprland-qtutils", - "rev": "629b15c19fa4082e4ce6be09fdb89e8c3312aed7", "type": "github" } }, @@ -590,32 +565,6 @@ } }, "hyprlang_2": { - "inputs": { - "hyprutils": "hyprutils_2", - "nixpkgs": [ - "hyprland-qtutils", - "nixpkgs" - ], - "systems": [ - "hyprland-qtutils", - "systems" - ] - }, - "locked": { - "lastModified": 1749145882, - "narHash": "sha256-qr0KXeczF8Sma3Ae7+dR2NHhvG7YeLBJv19W4oMu6ZE=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "1bfb84f54d50c7ae6558c794d3cfd5f6a7e6e676", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprlang_3": { "inputs": { "hyprutils": [ "hyprlock", @@ -631,11 +580,11 @@ ] }, "locked": { - "lastModified": 1750371198, - "narHash": "sha256-/iuJ1paQOBoSLqHflRNNGyroqfF/yvPNurxzcCT0cAE=", + "lastModified": 1758927902, + "narHash": "sha256-LZgMds7M94+vuMql2bERQ6LiFFdhgsEFezE4Vn+Ys3A=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "cee01452bca58d6cadb3224e21e370de8bc20f0b", + "rev": "4dafa28d4f79877d67a7d1a654cddccf8ebf15da", "type": "github" }, "original": { @@ -647,27 +596,26 @@ "hyprlock": { "inputs": { "hyprgraphics": "hyprgraphics_2", - "hyprlang": "hyprlang_3", - "hyprutils": "hyprutils_3", + "hyprlang": "hyprlang_2", + "hyprutils": "hyprutils_2", "hyprwayland-scanner": "hyprwayland-scanner_2", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_3" + "systems": "systems_2" }, "locked": { - "lastModified": 1759399385, - "narHash": "sha256-ucJ5C83hJy8XFO8Y+PL9hVcwdrQnj63BjXcO5A4qyNU=", - "owner": "hyprwm", - "repo": "hyprlock", - "rev": "c48279d1e0f0a4399b5a2d56c16f2ec677ba18f8", - "type": "github" + "lastModified": 1760023949, + "narHash": "sha256-fu0B4duamVdbkPio/czu1XhsPLRXUJpZLDrSk3nih4U=", + "ref": "refs/heads/main", + "rev": "36ec73f166d9434a3f27c96c575198906f77644a", + "revCount": 401, + "type": "git", + "url": "https://code.hyprland.org/hyprwm/hyprlock.git" }, "original": { - "owner": "hyprwm", - "ref": "v0.9.2", - "repo": "hyprlock", - "type": "github" + "type": "git", + "url": "https://code.hyprland.org/hyprwm/hyprlock.git" } }, "hyprutils": { @@ -696,33 +644,6 @@ } }, "hyprutils_2": { - "inputs": { - "nixpkgs": [ - "hyprland-qtutils", - "hyprlang", - "nixpkgs" - ], - "systems": [ - "hyprland-qtutils", - "hyprlang", - "systems" - ] - }, - "locked": { - "lastModified": 1749135356, - "narHash": "sha256-Q8mAKMDsFbCEuq7zoSlcTuxgbIBVhfIYpX0RjE32PS0=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "e36db00dfb3a3d3fdcc4069cb292ff60d2699ccb", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprutils_3": { "inputs": { "nixpkgs": [ "hyprlock", @@ -734,11 +655,11 @@ ] }, "locked": { - "lastModified": 1751061882, - "narHash": "sha256-g9n8Vrbx+2JYM170P9BbvGHN39Wlkr4U+V2WLHQsXL8=", + "lastModified": 1759619523, + "narHash": "sha256-r1ed7AR2ZEb2U8gy321/Xcp1ho2tzn+gG1te/Wxsj1A=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "4737241eaf8a1e51671a2a088518071f9a265cf4", + "rev": "3df7bde01efb3a3e8e678d1155f2aa3f19e177ef", "type": "github" }, "original": { @@ -784,11 +705,11 @@ ] }, "locked": { - "lastModified": 1750371869, - "narHash": "sha256-lGk4gLjgZQ/rndUkzmPYcgbHr8gKU5u71vyrjnwfpB4=", + "lastModified": 1755184602, + "narHash": "sha256-RCBQN8xuADB0LEgaKbfRqwm6CdyopE1xIEhNc67FAbw=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "aa38edd6e3e277ae6a97ea83a69261a5c3aab9fd", + "rev": "b3b0f1f40ae09d4447c20608e5a4faf8bf3c492d", "type": "github" }, "original": { @@ -806,11 +727,11 @@ ] }, "locked": { - "lastModified": 1761202163, - "narHash": "sha256-6RySf5VQElrm7RYGWxlIkNttemDp4FF0aH+LX435G2Y=", + "lastModified": 1759815224, + "narHash": "sha256-HbdOyjqHm38j6o5mV24i0bn+r5ykS+VJBnWJuZ0fE+A=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "47976126007d9658ca4ac4dd933bea8846170fd9", + "rev": "ee974f496a080c61b3164992c850f43741edcc52", "type": "github" }, "original": { @@ -819,21 +740,6 @@ "type": "github" } }, - "nix-filter": { - "locked": { - "lastModified": 1731533336, - "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, "nix-github-actions": { "inputs": { "nixpkgs": [ @@ -859,11 +765,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1761114652, - "narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=", + "lastModified": 1759831965, + "narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c", + "rev": "c9b6fb798541223bbb396d287d16f43520250518", "type": "github" }, "original": { @@ -875,11 +781,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1761173472, - "narHash": "sha256-m9W0dYXflzeGgKNravKJvTMR4Qqa2MVD11AwlGMufeE=", + "lastModified": 1759994382, + "narHash": "sha256-wSK+3UkalDZRVHGCRikZ//CyZUJWDJkBDTQX1+G77Ow=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c8aa8cc00a5cb57fada0851a038d35c08a36a2bb", + "rev": "5da4a26309e796daa7ffca72df93dbe53b8164c7", "type": "github" }, "original": { @@ -891,26 +797,26 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1761173472, - "narHash": "sha256-m9W0dYXflzeGgKNravKJvTMR4Qqa2MVD11AwlGMufeE=", + "lastModified": 1751274312, + "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c8aa8cc00a5cb57fada0851a038d35c08a36a2bb", + "rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-25.05", + "ref": "nixos-24.11", "type": "indirect" } }, "nixpkgs_2": { "locked": { - "lastModified": 1761114652, - "narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=", + "lastModified": 1760038930, + "narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c", + "rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3", "type": "github" }, "original": { @@ -986,11 +892,11 @@ ] }, "locked": { - "lastModified": 1761078382, - "narHash": "sha256-JNJesbe9MMN1Brq41BHEpuH+Z+Zg74y/nI5AFZX84Vw=", + "lastModified": 1759321049, + "narHash": "sha256-8XkU4gIrLT2DJZWQyvsP5woXGZF5eE/7AnKfwQkiwYU=", "owner": "nix-community", "repo": "plasma-manager", - "rev": "27dfa61b64d0cdb8e4ba6f3aaa4d4e067d64cb5c", + "rev": "205dcfd4a30d4a5d1b4f28defee69daa7c7252cd", "type": "github" }, "original": { @@ -1029,15 +935,13 @@ "emacs-overlay": "emacs-overlay", "home-manager": "home-manager_2", "hyprland": "hyprland", - "hyprland-qtutils": "hyprland-qtutils", "hyprlock": "hyprlock", "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable_2", "plasma-manager": "plasma-manager", "rust-overlay": "rust-overlay_2", "secrets": "secrets", - "stylix": "stylix", - "winapps": "winapps" + "stylix": "stylix" } }, "rust-overlay": { @@ -1048,11 +952,11 @@ ] }, "locked": { - "lastModified": 1761273263, - "narHash": "sha256-6d6ojnu6A6sVxIjig8OL6E1T8Ge9st3YGgVwg5MOY+Q=", + "lastModified": 1760063676, + "narHash": "sha256-s5Fjh43skH2L+avOGioLmEHoYZffDbg3abV5h0gjeew=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "28405834d4fdd458d28e123fae4db148daecec6f", + "rev": "897deed0923cc5a1d560c5176abe0d172ec9716d", "type": "github" }, "original": { @@ -1066,11 +970,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1761273263, - "narHash": "sha256-6d6ojnu6A6sVxIjig8OL6E1T8Ge9st3YGgVwg5MOY+Q=", + "lastModified": 1760063676, + "narHash": "sha256-s5Fjh43skH2L+avOGioLmEHoYZffDbg3abV5h0gjeew=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "28405834d4fdd458d28e123fae4db148daecec6f", + "rev": "897deed0923cc5a1d560c5176abe0d172ec9716d", "type": "github" }, "original": { @@ -1086,11 +990,11 @@ ] }, "locked": { - "lastModified": 1760810038, - "narHash": "sha256-ZmrKFgVn/Ues34j+TRk2W7m8X6/tXVqtV19zE9apI9s=", + "lastModified": 1760201629, + "narHash": "sha256-Lw3ddEY25LYq40q2DJyPiITNbaPB0k9+2lljLBHKA+Y=", "ref": "refs/heads/main", - "rev": "56ac08a980247206d96f0efe289e6212f009f6b3", - "revCount": 47, + "rev": "a4390896ddd6015e320e4dd8b8834797dcb1f071", + "revCount": 40, "type": "git", "url": "file:///etc/nixos.secrets" }, @@ -1110,7 +1014,7 @@ "gnome-shell": "gnome-shell", "nixpkgs": "nixpkgs_4", "nur": "nur", - "systems": "systems_4", + "systems": "systems_3", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -1118,11 +1022,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1761028816, - "narHash": "sha256-s1XiIeJHpODVWfzsPaK9e21iz1dQSCU3H4/1OxOsyps=", + "lastModified": 1759690047, + "narHash": "sha256-Vlpa0d1xOgPO9waHwxJNi6LcD2PYqB3EjwLRtSxXlHc=", "owner": "nix-community", "repo": "stylix", - "rev": "b81dc0a385443099e7d231fe6275189e32c3b760", + "rev": "09022804b2bcd217f3a41a644d26b23d30375d12", "type": "github" }, "original": { @@ -1162,36 +1066,6 @@ } }, "systems_3": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1287,29 +1161,6 @@ "type": "github" } }, - "winapps": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils", - "nix-filter": "nix-filter", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1761221437, - "narHash": "sha256-6V+PkcUvinA/Ryl+tZO0pLvEmJWzfieMKj8UyAFvduo=", - "owner": "winapps-org", - "repo": "winapps", - "rev": "daa052d42d338a50bb3e093a0c86daa3d32f08c5", - "type": "github" - }, - "original": { - "owner": "winapps-org", - "repo": "winapps", - "type": "github" - } - }, "xdph": { "inputs": { "hyprland-protocols": [ diff --git a/flake.nix b/flake.nix index 9b8cb7d..7c093a9 100644 --- a/flake.nix +++ b/flake.nix @@ -47,7 +47,7 @@ in { # generate a nixos configuration for every host in ./hosts - nixosConfigurations = builtins.listToAttrs + nixosConfigurations = builtins.listToAttrs (map (host: { name = host; value = lib.nixosSystem { @@ -84,7 +84,7 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; - nixpkgs-stable.url = "nixpkgs/nixos-25.05"; + nixpkgs-stable.url = "nixpkgs/nixos-24.11"; chaotic.url = "github:chaotic-cx/nyx"; home-manager.url = "github:nix-community/home-manager/master"; @@ -93,17 +93,11 @@ hyprland = { url = "github:hyprwm/Hyprland/v0.51.0?submodules=true"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.hyprland-qtutils.follows = "hyprland-qtutils"; - }; - - # FIXME tmp fix - hyprland-qtutils = { - url = "github:hyprwm/hyprland-qtutils/629b15c19fa4082e4ce6be09fdb89e8c3312aed7"; - inputs.nixpkgs.follows = "nixpkgs"; }; hyprlock = { - url = "github:hyprwm/hyprlock/v0.9.2"; + type = "git"; + url = "https://code.hyprland.org/hyprwm/hyprlock.git"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -113,11 +107,6 @@ inputs.home-manager.follows = "home-manager"; }; - winapps = { - url = "github:winapps-org/winapps"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - stylix.url = "github:nix-community/stylix"; emacs-overlay = { diff --git a/hosts/TEMPLATE/configuration.nix b/hosts/TEMPLATE/configuration.nix index aabdf64..6656a60 100644 --- a/hosts/TEMPLATE/configuration.nix +++ b/hosts/TEMPLATE/configuration.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, lib, pkgs, ... }: { config = { @@ -57,5 +57,5 @@ ## EXTRA CONFIG GOES HERE }; - + } diff --git a/hosts/TEMPLATE/default.nix b/hosts/TEMPLATE/default.nix index 90ce64d..b29cc69 100644 --- a/hosts/TEMPLATE/default.nix +++ b/hosts/TEMPLATE/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -8,7 +8,7 @@ config = { home-manager.users = builtins.listToAttrs - (map (user: { name = user; value = - { imports = [ ./home.nix ../../modules/user ]; };}) config.systemSettings.users); + (map (user: { name = user; value = + ({ imports = [ ./home.nix ../../modules/user ]; });}) config.systemSettings.users); }; } diff --git a/hosts/TEMPLATE/hardware-configuration.nix b/hosts/TEMPLATE/hardware-configuration.nix index 13f1474..f878f7c 100644 --- a/hosts/TEMPLATE/hardware-configuration.nix +++ b/hosts/TEMPLATE/hardware-configuration.nix @@ -1,7 +1,7 @@ ## THIS FILE MUST BE GENERATED ON A PER MACHINE BASIS ## RUN -{ ... }: +{ config, lib, pkgs, modulesPath, inputs, ... }: { diff --git a/hosts/TEMPLATE/home.nix b/hosts/TEMPLATE/home.nix index eb882b1..02c76b1 100644 --- a/hosts/TEMPLATE/home.nix +++ b/hosts/TEMPLATE/home.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, lib, pkgs, ... }: { config = { diff --git a/hosts/duskfall/configuration.nix b/hosts/duskfall/configuration.nix index c102dd5..cd97bfb 100644 --- a/hosts/duskfall/configuration.nix +++ b/hosts/duskfall/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, lib, pkgs, ... }: { config = { @@ -9,7 +9,6 @@ # hardware cachy.enable = true; - cachy.variant = "lts"; bluetooth.enable = true; powerprofiles.enable = true; tlp.enable = false; @@ -18,7 +17,7 @@ # software flatpak.enable = false; virtualization = { - docker.enable = false; + docker.enable = true; virtualMachines.enable = false; }; brave.enable = true; @@ -65,5 +64,5 @@ services.xserver.videoDrivers = [ "i915" ]; }; - + } diff --git a/hosts/duskfall/default.nix b/hosts/duskfall/default.nix index 90ce64d..b29cc69 100644 --- a/hosts/duskfall/default.nix +++ b/hosts/duskfall/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -8,7 +8,7 @@ config = { home-manager.users = builtins.listToAttrs - (map (user: { name = user; value = - { imports = [ ./home.nix ../../modules/user ]; };}) config.systemSettings.users); + (map (user: { name = user; value = + ({ imports = [ ./home.nix ../../modules/user ]; });}) config.systemSettings.users); }; } diff --git a/hosts/duskfall/home.nix b/hosts/duskfall/home.nix index 5e0b864..06af00a 100644 --- a/hosts/duskfall/home.nix +++ b/hosts/duskfall/home.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, pkgs-stable, ... }: +{ config, lib, pkgs, ... }: { config = { @@ -39,7 +39,7 @@ home.packages = with pkgs; [ cage - pkgs-stable.gcompris + gcompris tuxpaint ]; diff --git a/hosts/ori/configuration.nix b/hosts/ori/configuration.nix index 2c058ed..7d430d7 100644 --- a/hosts/ori/configuration.nix +++ b/hosts/ori/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, lib, pkgs, ... }: { config = { @@ -51,172 +51,6 @@ ]; programs.fuse.userAllowOther = true; - - networking.firewall.extraCommands = - # ip ban ai crawlers - let createDropRulesForIpAddress = address: - '' - iptables -A INPUT -s ${address} -j DROP - iptables -A OUTPUT -s ${address} -j DROP - iptables -A FORWARD -s ${address} -j DROP - iptables -A DOCKER -s ${address} -j DROP - iptables -A DOCKER-BRIDGE -s ${address} -j DROP - iptables -A DOCKER-FORWARD -s ${address} -j DROP - iptables -A DOCKER-USER -s ${address} -j DROP - iptables -A DOCKER-ISOLATION-STAGE-1 -s ${address} -j DROP - iptables -A DOCKER-ISOLATION-STAGE-2 -s ${address} -j DROP - ''; - in - '' - ${createDropRulesForIpAddress "216.73.216.143"} - ${createDropRulesForIpAddress "100.24.149.244"} - ${createDropRulesForIpAddress "100.24.167.60"} - ${createDropRulesForIpAddress "100.25.120.246"} - ${createDropRulesForIpAddress "100.27.153.9"} - ${createDropRulesForIpAddress "100.28.204.82"} - ${createDropRulesForIpAddress "100.28.44.58"} - ${createDropRulesForIpAddress "18.204.152.114"} - ${createDropRulesForIpAddress "18.205.127.11"} - ${createDropRulesForIpAddress "18.205.213.231"} - ${createDropRulesForIpAddress "18.205.91.101"} - ${createDropRulesForIpAddress "18.209.201.119"} - ${createDropRulesForIpAddress "18.210.58.238"} - ${createDropRulesForIpAddress "18.211.148.239"} - ${createDropRulesForIpAddress "18.213.102.186"} - ${createDropRulesForIpAddress "18.214.138.148"} - ${createDropRulesForIpAddress "18.215.112.101"} - ${createDropRulesForIpAddress "18.233.24.238"} - ${createDropRulesForIpAddress "184.72.95.195"} - ${createDropRulesForIpAddress "184.73.167.217"} - ${createDropRulesForIpAddress "184.73.239.35"} - ${createDropRulesForIpAddress "23.20.178.124"} - ${createDropRulesForIpAddress "23.21.119.232"} - ${createDropRulesForIpAddress "23.21.175.228"} - ${createDropRulesForIpAddress "23.21.227.240"} - ${createDropRulesForIpAddress "23.22.105.143"} - ${createDropRulesForIpAddress "23.22.59.87"} - ${createDropRulesForIpAddress "23.23.137.202"} - ${createDropRulesForIpAddress "23.23.180.225"} - ${createDropRulesForIpAddress "23.23.212.212"} - ${createDropRulesForIpAddress "23.23.213.182"} - ${createDropRulesForIpAddress "3.208.146.193"} - ${createDropRulesForIpAddress "3.210.114.189"} - ${createDropRulesForIpAddress "3.210.223.61"} - ${createDropRulesForIpAddress "3.210.29.96"} - ${createDropRulesForIpAddress "3.211.105.134"} - ${createDropRulesForIpAddress "3.211.181.86"} - ${createDropRulesForIpAddress "3.212.205.90"} - ${createDropRulesForIpAddress "3.213.85.234"} - ${createDropRulesForIpAddress "3.215.221.125"} - ${createDropRulesForIpAddress "3.216.13.10"} - ${createDropRulesForIpAddress "3.216.86.144"} - ${createDropRulesForIpAddress "3.217.171.106"} - ${createDropRulesForIpAddress "3.218.103.254"} - ${createDropRulesForIpAddress "3.219.81.66"} - ${createDropRulesForIpAddress "3.221.222.168"} - ${createDropRulesForIpAddress "3.223.134.5"} - ${createDropRulesForIpAddress "3.225.9.97"} - ${createDropRulesForIpAddress "3.227.180.70"} - ${createDropRulesForIpAddress "3.232.82.72"} - ${createDropRulesForIpAddress "3.235.215.92"} - ${createDropRulesForIpAddress "34.193.2.57"} - ${createDropRulesForIpAddress "34.194.14.255"} - ${createDropRulesForIpAddress "34.194.233.48"} - ${createDropRulesForIpAddress "34.195.248.30"} - ${createDropRulesForIpAddress "34.197.28.78"} - ${createDropRulesForIpAddress "34.203.111.15"} - ${createDropRulesForIpAddress "34.205.170.13"} - ${createDropRulesForIpAddress "34.206.249.188"} - ${createDropRulesForIpAddress "34.224.132.215"} - ${createDropRulesForIpAddress "34.225.87.80"} - ${createDropRulesForIpAddress "34.226.89.140"} - ${createDropRulesForIpAddress "34.231.156.59"} - ${createDropRulesForIpAddress "34.233.114.237"} - ${createDropRulesForIpAddress "34.234.197.175"} - ${createDropRulesForIpAddress "34.234.200.207"} - ${createDropRulesForIpAddress "35.168.238.50"} - ${createDropRulesForIpAddress "35.169.119.108"} - ${createDropRulesForIpAddress "35.169.240.53"} - ${createDropRulesForIpAddress "35.170.205.140"} - ${createDropRulesForIpAddress "35.173.38.202"} - ${createDropRulesForIpAddress "3.93.211.16"} - ${createDropRulesForIpAddress "3.94.199.128"} - ${createDropRulesForIpAddress "44.205.120.22"} - ${createDropRulesForIpAddress "44.205.74.196"} - ${createDropRulesForIpAddress "44.206.65.8"} - ${createDropRulesForIpAddress "44.207.207.36"} - ${createDropRulesForIpAddress "44.207.252.58"} - ${createDropRulesForIpAddress "44.209.35.147"} - ${createDropRulesForIpAddress "44.214.19.8"} - ${createDropRulesForIpAddress "44.215.235.20"} - ${createDropRulesForIpAddress "44.218.170.184"} - ${createDropRulesForIpAddress "44.220.2.97"} - ${createDropRulesForIpAddress "44.221.180.179"} - ${createDropRulesForIpAddress "44.221.227.90"} - ${createDropRulesForIpAddress "44.223.115.10"} - ${createDropRulesForIpAddress "44.223.116.149"} - ${createDropRulesForIpAddress "44.223.232.55"} - ${createDropRulesForIpAddress "50.19.102.70"} - ${createDropRulesForIpAddress "50.19.79.213"} - ${createDropRulesForIpAddress "52.0.218.219"} - ${createDropRulesForIpAddress "52.0.63.151"} - ${createDropRulesForIpAddress "52.200.142.199"} - ${createDropRulesForIpAddress "52.202.233.37"} - ${createDropRulesForIpAddress "52.203.152.231"} - ${createDropRulesForIpAddress "52.203.65.83"} - ${createDropRulesForIpAddress "52.204.174.139"} - ${createDropRulesForIpAddress "52.204.71.8"} - ${createDropRulesForIpAddress "52.204.89.12"} - ${createDropRulesForIpAddress "52.205.113.104"} - ${createDropRulesForIpAddress "52.21.62.139"} - ${createDropRulesForIpAddress "52.2.191.202"} - ${createDropRulesForIpAddress "52.22.87.224"} - ${createDropRulesForIpAddress "52.3.102.51"} - ${createDropRulesForIpAddress "52.3.127.170"} - ${createDropRulesForIpAddress "52.3.155.146"} - ${createDropRulesForIpAddress "52.4.213.199"} - ${createDropRulesForIpAddress "52.4.229.9"} - ${createDropRulesForIpAddress "52.4.238.8"} - ${createDropRulesForIpAddress "52.45.15.233"} - ${createDropRulesForIpAddress "52.45.92.83"} - ${createDropRulesForIpAddress "52.54.249.218"} - ${createDropRulesForIpAddress "52.54.95.127"} - ${createDropRulesForIpAddress "52.6.5.24"} - ${createDropRulesForIpAddress "52.70.123.241"} - ${createDropRulesForIpAddress "52.71.216.196"} - ${createDropRulesForIpAddress "52.71.218.25"} - ${createDropRulesForIpAddress "52.73.6.26"} - ${createDropRulesForIpAddress "54.145.82.217"} - ${createDropRulesForIpAddress "54.147.238.89"} - ${createDropRulesForIpAddress "54.147.80.137"} - ${createDropRulesForIpAddress "54.156.55.147"} - ${createDropRulesForIpAddress "54.157.84.74"} - ${createDropRulesForIpAddress "54.159.18.27"} - ${createDropRulesForIpAddress "54.159.98.248"} - ${createDropRulesForIpAddress "54.162.69.192"} - ${createDropRulesForIpAddress "54.163.136.244"} - ${createDropRulesForIpAddress "54.167.32.123"} - ${createDropRulesForIpAddress "54.197.114.76"} - ${createDropRulesForIpAddress "54.225.181.161"} - ${createDropRulesForIpAddress "54.225.199.17"} - ${createDropRulesForIpAddress "54.235.125.129"} - ${createDropRulesForIpAddress "54.243.63.52"} - ${createDropRulesForIpAddress "54.83.180.239"} - ${createDropRulesForIpAddress "54.83.56.1"} - ${createDropRulesForIpAddress "54.85.7.119"} - ${createDropRulesForIpAddress "54.88.84.219"} - ${createDropRulesForIpAddress "54.89.90.224"} - ${createDropRulesForIpAddress "98.82.39.241"} - ${createDropRulesForIpAddress "98.83.10.183"} - ${createDropRulesForIpAddress "98.83.177.42"} - ${createDropRulesForIpAddress "98.83.8.142"} - ${createDropRulesForIpAddress "98.84.131.195"} - ${createDropRulesForIpAddress "98.84.184.80"} - ${createDropRulesForIpAddress "98.84.200.43"} - ${createDropRulesForIpAddress "98.84.60.17"} - ${createDropRulesForIpAddress "98.84.70.201"} - ''; - virtualisation.docker.extraOptions="--iptables=true"; }; - + } diff --git a/hosts/ori/default.nix b/hosts/ori/default.nix index 90ce64d..b29cc69 100644 --- a/hosts/ori/default.nix +++ b/hosts/ori/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -8,7 +8,7 @@ config = { home-manager.users = builtins.listToAttrs - (map (user: { name = user; value = - { imports = [ ./home.nix ../../modules/user ]; };}) config.systemSettings.users); + (map (user: { name = user; value = + ({ imports = [ ./home.nix ../../modules/user ]; });}) config.systemSettings.users); }; } diff --git a/hosts/ori/hardware-configuration.nix b/hosts/ori/hardware-configuration.nix index cce9b41..c84667b 100644 --- a/hosts/ori/hardware-configuration.nix +++ b/hosts/ori/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, modulesPath, ... }: +{ config, lib, pkgs, modulesPath, inputs, ... }: { imports = diff --git a/hosts/ori/home.nix b/hosts/ori/home.nix index d5d547d..b4a01ac 100644 --- a/hosts/ori/home.nix +++ b/hosts/ori/home.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, lib, pkgs, ... }: { config = { @@ -9,7 +9,7 @@ enable = true; apps.enable = true; }; - xdg.enable = false; + xdg.enable = true; # programs ranger.enable = true; diff --git a/hosts/snowfire/configuration.nix b/hosts/snowfire/configuration.nix index bf7ddca..17c9e0a 100644 --- a/hosts/snowfire/configuration.nix +++ b/hosts/snowfire/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, lib, pkgs, ... }: { config = { @@ -9,7 +9,6 @@ # hardware cachy.enable = true; - cachy.variant = "lts"; bluetooth.enable = true; powerprofiles.enable = true; tlp.enable = false; @@ -21,7 +20,6 @@ virtualization = { docker.enable = true; virtualMachines.enable = true; - winapps.enable = true; }; brave.enable = true; @@ -67,5 +65,5 @@ services.displayManager.defaultSession = "hyprland"; }; - + } diff --git a/hosts/snowfire/default.nix b/hosts/snowfire/default.nix index 90ce64d..b29cc69 100644 --- a/hosts/snowfire/default.nix +++ b/hosts/snowfire/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -8,7 +8,7 @@ config = { home-manager.users = builtins.listToAttrs - (map (user: { name = user; value = - { imports = [ ./home.nix ../../modules/user ]; };}) config.systemSettings.users); + (map (user: { name = user; value = + ({ imports = [ ./home.nix ../../modules/user ]; });}) config.systemSettings.users); }; } diff --git a/hosts/snowfire/hardware-configuration.nix b/hosts/snowfire/hardware-configuration.nix index 0c25d9b..4f45a3d 100644 --- a/hosts/snowfire/hardware-configuration.nix +++ b/hosts/snowfire/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, pkgs, modulesPath, inputs, ... }: { imports = @@ -22,9 +22,33 @@ # https://wiki.nixos.org/wiki/Mesa hardware = { graphics = - { + let + fn = oa: { + nativeBuildInputs = oa.nativeBuildInputs ++ [ pkgs.glslang ]; + mesonFlags = oa.mesonFlags ++ [ "-Dvulkan-layers=device-select,overlay" ]; + # patches = oa.patches ++ [ ./mesa-vulkan-layer-nvidia.patch ]; See below + postInstall = oa.postInstall + '' + mv $out/lib/libVkLayer* $drivers/lib + + #Device Select layer + layer=VkLayer_MESA_device_select + substituteInPlace $drivers/share/vulkan/implicit_layer.d/''${layer}.json \ + --replace "lib''${layer}" "$drivers/lib/lib''${layer}" + + #Overlay layer + layer=VkLayer_MESA_overlay + substituteInPlace $drivers/share/vulkan/explicit_layer.d/''${layer}.json \ + --replace "lib''${layer}" "$drivers/lib/lib''${layer}" + ''; + }; + in + with pkgs; { enable = true; enable32Bit = true; + package = (mesa.overrideAttrs fn).drivers; + package32 = (pkgsi686Linux.mesa.overrideAttrs fn).drivers; + #extraPackages = with pkgs; [ amdvlk ]; + #extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; }; }; hardware.opengl.extraPackages = [ pkgs.rocmPackages.clr.icd ]; @@ -37,9 +61,10 @@ hardware.amdgpu.initrd.enable = true; hardware.amdgpu.opencl.enable = true; + #hardware.amdgpu.amdvlk.enable = true; #hardware.amdgpu.overdrive.enable = true; environment.sessionVariables = { - #VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json"; # fix for godot + VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json"; # fix for godot }; # makes disk io not freeze the computer @@ -47,7 +72,7 @@ ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_SERIAL_SHORT}=="BTKA121225GP512A", ATTR{queue/scheduler}="bfq" ''; - #systemd.tmpfiles.rules = + #systemd.tmpfiles.rules = # let # rocmEnv = pkgs.symlinkJoin { # name = "rocm-combined"; @@ -61,7 +86,7 @@ # "L+ /opt/rocm - - - - ${rocmEnv}" # ]; - # my stupid usb hub crashes systemctl suspend half of the time now + # my stupid usb hub crashes systemct suspend half of the time now # https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Sleep_hooks systemd.services.root-suspend = { enable = true; @@ -109,7 +134,7 @@ fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; - + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/hosts/snowfire/home.nix b/hosts/snowfire/home.nix index 33e7cbf..cc420e9 100644 --- a/hosts/snowfire/home.nix +++ b/hosts/snowfire/home.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: { config = { @@ -13,8 +13,7 @@ # programs browser = "brave"; - editor = "zed"; - emacs.enable = true; + editor = "emacs"; vscodium.enable = true; yazi.enable = true; git.enable = true; diff --git a/hosts/stardust/configuration.nix b/hosts/stardust/configuration.nix index f6ecc01..97b84ee 100644 --- a/hosts/stardust/configuration.nix +++ b/hosts/stardust/configuration.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, lib, pkgs, ... }: { config = { @@ -9,7 +9,6 @@ # hardware cachy.enable = true; - cachy.variant = "lts"; bluetooth.enable = true; tlp.enable = true; printing.enable = true; @@ -50,5 +49,5 @@ }; }; - + } diff --git a/hosts/stardust/default.nix b/hosts/stardust/default.nix index 90ce64d..b29cc69 100644 --- a/hosts/stardust/default.nix +++ b/hosts/stardust/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -8,7 +8,7 @@ config = { home-manager.users = builtins.listToAttrs - (map (user: { name = user; value = - { imports = [ ./home.nix ../../modules/user ]; };}) config.systemSettings.users); + (map (user: { name = user; value = + ({ imports = [ ./home.nix ../../modules/user ]; });}) config.systemSettings.users); }; } diff --git a/hosts/stardust/hardware-configuration.nix b/hosts/stardust/hardware-configuration.nix index 3f46122..4293d5b 100644 --- a/hosts/stardust/hardware-configuration.nix +++ b/hosts/stardust/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, modulesPath, ... }: +{ config, lib, pkgs, modulesPath, ... }: { imports = diff --git a/hosts/stardust/home.nix b/hosts/stardust/home.nix index 188b856..4c55d07 100644 --- a/hosts/stardust/home.nix +++ b/hosts/stardust/home.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, lib, pkgs, ... }: { config = { diff --git a/hosts/zenith/configuration.nix b/hosts/zenith/configuration.nix index a45cbf4..1293f29 100644 --- a/hosts/zenith/configuration.nix +++ b/hosts/zenith/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, lib, pkgs, ... }: { config = { @@ -9,7 +9,6 @@ # hardware cachy.enable = true; - cachy.variant = "lts"; bluetooth.enable = true; tlp.enable = false; # intel doesn't work with tlp printing.enable = true; @@ -63,5 +62,5 @@ services.displayManager.defaultSession = "hyprland"; }; - + } diff --git a/hosts/zenith/default.nix b/hosts/zenith/default.nix index 90ce64d..b29cc69 100644 --- a/hosts/zenith/default.nix +++ b/hosts/zenith/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -8,7 +8,7 @@ config = { home-manager.users = builtins.listToAttrs - (map (user: { name = user; value = - { imports = [ ./home.nix ../../modules/user ]; };}) config.systemSettings.users); + (map (user: { name = user; value = + ({ imports = [ ./home.nix ../../modules/user ]; });}) config.systemSettings.users); }; } diff --git a/hosts/zenith/hardware-configuration.nix b/hosts/zenith/hardware-configuration.nix index b57b709..5b2342a 100644 --- a/hosts/zenith/hardware-configuration.nix +++ b/hosts/zenith/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, modulesPath, ... }: +{ config, lib, pkgs, modulesPath, ... }: { imports = diff --git a/hosts/zenith/home.nix b/hosts/zenith/home.nix index 3c75937..fdff4a3 100644 --- a/hosts/zenith/home.nix +++ b/hosts/zenith/home.nix @@ -42,11 +42,11 @@ }; home.packages = with pkgs; [ - openldap ldapvi rclone teams-for-linux pkgs-stable.rpi-imager freerdp pkgs-stable.tigervnc unixtools.xxd nodejs electron + openldap ldapvi rclone teams-for-linux rpi-imager freerdp pkgs-stable.tigervnc unixtools.xxd ]; home.sessionVariables = lib.mkIf config.userSettings.hyprland.enable { - AQ_DRM_DEVICES = lib.mkForce "/dev/dri/card1:/dev/dri/card0"; + AQ_DRM_DEVICES = lib.mkForce "/dev/dri/card1"; }; wayland.windowManager.hyprland = lib.mkIf config.userSettings.hyprland.enable { diff --git a/modules/system/brave-policy/default.nix b/modules/system/brave-policy/default.nix index aaeff62..0bf371f 100644 --- a/modules/system/brave-policy/default.nix +++ b/modules/system/brave-policy/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ...}: +{ config, lib, pkgs, ...}: let cfg = config.systemSettings.brave; diff --git a/modules/system/gaming/default.nix b/modules/system/gaming/default.nix index f88d955..1c4336a 100644 --- a/modules/system/gaming/default.nix +++ b/modules/system/gaming/default.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, ... }: +{ lib, config, pkgs, inputs, ... }: let cfg = config.systemSettings.gaming; diff --git a/modules/system/gnome/default.nix b/modules/system/gnome/default.nix index 13aa210..7b42e48 100644 --- a/modules/system/gnome/default.nix +++ b/modules/system/gnome/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, lib, ... }: +{ inputs, pkgs, config, lib, ... }: let cfg = config.systemSettings.gnome; diff --git a/modules/system/hyprland/default.nix b/modules/system/hyprland/default.nix index 001d6a0..86b7def 100644 --- a/modules/system/hyprland/default.nix +++ b/modules/system/hyprland/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, config, lib, ... }: +{ inputs, pkgs, pkgs-stable, config, lib, ... }: let cfg = config.systemSettings.hyprland; @@ -48,7 +48,7 @@ in enableHidpi = true; theme = "sddm-astronaut-theme"; package = pkgs.kdePackages.sddm; - extraPackages = with pkgs; [ + extraPackages = with pkgs; [ (sddm-astronaut.override { themeConfig = { background = config.stylix.image; @@ -125,6 +125,13 @@ in jack.enable = true; }; + # Some fancy fonts + fonts.packages = with pkgs-stable; [ + # Fonts + nerdfonts + powerline + ]; + # Auto rotate screen programs.iio-hyprland = { enable = true; diff --git a/modules/system/kernel/default.nix b/modules/system/kernel/default.nix index a33d045..f34e1e5 100644 --- a/modules/system/kernel/default.nix +++ b/modules/system/kernel/default.nix @@ -9,7 +9,7 @@ in enable = lib.mkEnableOption "Enable cachyos kernel"; variant = lib.mkOption { default = null; - type = lib.types.nullOr (lib.types.enum ["lto" "lts" "server" "hardened"]); + type = lib.types.nullOr (lib.types.enum ["lto" "server" "hardened"]); description = '' This option determines the CachyOS kernel variant to use. ''; @@ -20,7 +20,6 @@ in config = lib.mkIf cfg.enable { boot.kernelPackages = lib.mkMerge [ (lib.mkIf (cfg.variant == null) pkgs.linuxPackages_cachyos) - (lib.mkIf (cfg.variant == "lts") pkgs.linuxPackages_cachyos-lts) (lib.mkIf (cfg.variant == "lto") pkgs.linuxPackages_cachyos-lto) (lib.mkIf (cfg.variant == "server") pkgs.linuxPackages_cachyos-server) (lib.mkIf (cfg.variant == "hardened") pkgs.linuxPackages_cachyos-hardened) diff --git a/modules/system/nix/default.nix b/modules/system/nix/default.nix index 420310e..543e1c0 100644 --- a/modules/system/nix/default.nix +++ b/modules/system/nix/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, inputs, ... }: { config = { diff --git a/modules/system/overlays/ranger.nix b/modules/system/overlays/ranger.nix index 3c338f8..57a8f84 100644 --- a/modules/system/overlays/ranger.nix +++ b/modules/system/overlays/ranger.nix @@ -1,15 +1,15 @@ -{ lib, pkgs, ... }: +{ config, lib, pkgs, ... }: { config = { nixpkgs.overlays = [ (self: super: { - ranger = super.ranger.overrideAttrs (oldAttrs: { + ranger = super.ranger.overrideAttrs (oldAttrs: rec { preConfigure = '' substituteInPlace ranger/__init__.py \ --replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${lib.getBin pkgs.bat}/bin/bat'" - + # give image previews out of the box when building with w3m substituteInPlace ranger/config/rc.conf \ --replace "set preview_images false" "set preview_images true" diff --git a/modules/system/phoenix/default.nix b/modules/system/phoenix/default.nix index 798d1d6..e825482 100644 --- a/modules/system/phoenix/default.nix +++ b/modules/system/phoenix/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, pkgs-stable, ... }: +{ config, lib, pkgs, ... }: { options = { @@ -24,7 +24,7 @@ config = { environment.systemPackages = with pkgs; [ attic-client - git git-lfs + git nix-output-monitor (pkgs.writeScriptBin "phoenix" '' if [[ $EUID -ne 0 ]]; then @@ -127,7 +127,7 @@ # FIXME this thing doesn't work at all systemd.services."phoenix-system-builder" = lib.mkIf config.systemSettings.systemBuilder.enable { path = with pkgs; [ - pkgs-stable.openssh git nix nixos-rebuild + openssh git nix nixos-rebuild ]; script = '' set -euo pipefail diff --git a/modules/system/stylix/default.nix b/modules/system/stylix/default.nix index 4c46b75..5fcab3d 100644 --- a/modules/system/stylix/default.nix +++ b/modules/system/stylix/default.nix @@ -34,16 +34,16 @@ in package = pkgs.nerd-fonts.fira-code; }; serif = { - name = "Fira Sans"; - package = pkgs.fira-sans; + name = "FiraCode Nerd Font"; + package = pkgs.nerd-fonts.fira-code; }; sansSerif = { - name = "Fira Sans"; - package = pkgs.fira-sans; + name = "FiraCode Nerd Font"; + package = pkgs.nerd-fonts.fira-code; }; emoji = { - name = "Twitter Color Emoji"; - package = pkgs.twitter-color-emoji; + name = "Noto Color Emoji"; + package = pkgs.noto-fonts-emoji-blob-bin; }; }; diff --git a/modules/system/users/default.nix b/modules/system/users/default.nix index 76edc1b..6cfdd6c 100644 --- a/modules/system/users/default.nix +++ b/modules/system/users/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, inputs, ... }: { options = { diff --git a/modules/system/virtualization/docker/default.nix b/modules/system/virtualization/docker/default.nix index 297cfe9..b153f1a 100644 --- a/modules/system/virtualization/docker/default.nix +++ b/modules/system/virtualization/docker/default.nix @@ -10,7 +10,7 @@ in { }; }; - config = lib.mkIf cfg.enable { + config = { virtualisation.docker = { enable = true; enableOnBoot = true; diff --git a/modules/system/virtualization/winapps/default.nix b/modules/system/virtualization/winapps/default.nix deleted file mode 100644 index 1c715a7..0000000 --- a/modules/system/virtualization/winapps/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: - -let - cfg = config.systemSettings.virtualization.winapps; -in { - options = { - systemSettings.virtualization.winapps = { - enable = lib.mkEnableOption "Enable winapps"; - }; - }; - - config = lib.mkIf cfg.enable { - environment.systemPackages = with inputs.winapps.packages."${pkgs.system}"; [ - winapps - winapps-launcher - ] ++ [ pkgs.freerdp ]; - }; -} diff --git a/modules/user/blender/default.nix b/modules/user/blender/default.nix index cc2e1b2..e019494 100644 --- a/modules/user/blender/default.nix +++ b/modules/user/blender/default.nix @@ -9,7 +9,7 @@ in { }; }; - config = lib.mkIf cfg.enable { + config = { home.packages = [ pkgs.blender-hip (pkgs.writeScriptBin "declarative-blender-prefs" diff --git a/modules/user/browser/default.nix b/modules/user/browser/default.nix index 3c89788..d394ba5 100644 --- a/modules/user/browser/default.nix +++ b/modules/user/browser/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let browser = config.userSettings.browser; diff --git a/modules/user/dmenu-scripts/default.nix b/modules/user/dmenu-scripts/default.nix index b7e3284..f7de2bb 100644 --- a/modules/user/dmenu-scripts/default.nix +++ b/modules/user/dmenu-scripts/default.nix @@ -1,4 +1,4 @@ -{ lib, ...}: +{ config, lib, ...}: { options = { diff --git a/modules/user/editor/default.nix b/modules/user/editor/default.nix index 7fca451..c6ac1c5 100644 --- a/modules/user/editor/default.nix +++ b/modules/user/editor/default.nix @@ -8,7 +8,7 @@ in { userSettings.editor = lib.mkOption { default = "vscodium"; description = "Default editor"; - type = lib.types.enum [ "emacs" "kate" "vscodium" "zed"]; + type = lib.types.enum [ "emacs" "kate" "vscodium" ]; # TODO add more editors #type = lib.types.enum [ "emacs" "vim" "nvim" "neovide" "nano" "micro" "vscodium" "kate" "pulsar" ]; }; @@ -19,7 +19,6 @@ in { }; config = { - userSettings.zed.enable = lib.mkIf (config.userSettings.editor == "zed") true; userSettings.emacs.enable = lib.mkIf (config.userSettings.editor == "emacs") true; userSettings.vscodium.enable = lib.mkIf (config.userSettings.editor == "vscodium") true; home.packages = with pkgs; @@ -28,9 +27,8 @@ in { (lib.mkIf (editor == "emacs") "emacsclient -c -n -a 'emacs'") (lib.mkIf (editor == "neovide") "neovide -- --listen /tmp/nvimsocket") (lib.mkIf (editor == "vscodium") "codium -n") - (lib.mkIf (editor == "zed") "zeditor") (lib.mkIf (builtins.elem editor [ "vim" "nvim" "nano" "micro" ]) ("exec " + term + " -e " + editor)) - (lib.mkIf (!(builtins.elem editor [ "emacs" "vim" "nvim" "neovide" "nano" "micro" "vscodium" "zed"])) editor) + (lib.mkIf (!(builtins.elem editor [ "emacs" "vim" "nvim" "neovide" "nano" "micro" "vscodium"])) editor) ]; home.sessionVariables = { EDITOR = @@ -38,9 +36,8 @@ in { (lib.mkIf (editor == "emacs") "emacsclient -c") (lib.mkIf (editor == "neovide") "neovide -- --listen /tmp/nvimsocket") (lib.mkIf (editor == "vscodium") "codium -n") - (lib.mkIf (editor == "zed") "zeditor --wait") (lib.mkIf (builtins.elem editor [ "vim" "nvim" "nano" "micro" ]) ("exec " + term + " -e " + editor)) - (lib.mkIf (!(builtins.elem editor [ "emacs" "vim" "nvim" "neovide" "nano" "micro" "vscodium" "zed" ])) editor) + (lib.mkIf (!(builtins.elem editor [ "emacs" "vim" "nvim" "neovide" "nano" "micro" "vscodium" ])) editor) ]; }; }; diff --git a/modules/user/emacs/default.nix b/modules/user/emacs/default.nix index edab5b9..db47798 100644 --- a/modules/user/emacs/default.nix +++ b/modules/user/emacs/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, pkgs-stable, ... }: +{ config, lib, pkgs, ... }: let cfg = config.userSettings.emacs; @@ -15,10 +15,10 @@ in { }; config = lib.mkIf cfg.enable { - home.packages = with pkgs-stable; [ + home.packages = with pkgs; [ (pkgs.emacsWithPackagesFromUsePackage { config = ./init.el; - package = pkgs-stable.emacs-pgtk; + package = pkgs.emacs-git-pgtk; alwaysEnsure = false; extraEmacsPackages = epkgs: with epkgs; [ org-modern olivetti @@ -44,18 +44,18 @@ in { rainbow-mode default-text-scale (epkgs.callPackage ( - { lib, trivialBuild }: - + { lib, fetchurl, trivialBuild }: + trivialBuild { pname = "web-mode"; version = "17.3.20"; - + src = builtins.fetchGit { url = "https://github.com/fxbois/web-mode.git"; rev = "0c83581d1e93d1d802c730a1d5e90cd1c740e1b2"; ref = "main"; }; - + meta = with lib; { description = "web template editing mode for emacs"; homepage = "https://web-mode.org/"; @@ -70,18 +70,18 @@ in { lsp-mode flycheck lsp-ui lsp-treemacs # fix ultra-scroll (epkgs.callPackage ( - { lib, trivialBuild }: - + { lib, fetchurl, trivialBuild }: + trivialBuild { pname = "ultra-scroll"; version = "0.2.0"; - + src = builtins.fetchGit { url = "https://github.com/jdtsmith/ultra-scroll.git"; rev = "64ad7be02e11317576498dabb15c92cf31e2c04c"; ref = "main"; }; - + meta = with lib; { description = "scroll Emacs like lightning"; homepage = "https://github.com/jdtsmith/ultra-scroll"; @@ -91,12 +91,12 @@ in { } ) {}) (epkgs.callPackage ( - { lib, trivialBuild }: - + { lib, fetchurl, trivialBuild }: + trivialBuild { pname = "lsp-treemacs-nerd-icons"; version = "2efa09a-unstable"; - + src = builtins.fetchGit { url = "https://github.com/Velnbur/lsp-treemacs-nerd-icons.git"; rev = "2efa09a701b8b455bfb66529454f27c30f7462dc"; @@ -108,7 +108,7 @@ in { treemacs nerd-icons ]; - + meta = with lib; { description = "Use nerd icons for lsp-mode and lsp-treemacs"; homepage = "https://github.com/Velnbur/lsp-treemacs-nerd-icons"; @@ -118,18 +118,18 @@ in { } ) {}) (epkgs.callPackage ( - { lib, trivialBuild }: - + { lib, fetchurl, trivialBuild }: + trivialBuild { pname = "scratch-plus"; version = "2efa09a-unstable"; - + src = builtins.fetchGit { url = "https://git.sr.ht/~swflint/scratch-plus"; rev = "b794901f968000f6e338808307385b683b79ec8b"; ref = "main"; }; - + meta = with lib; { description = "Better scratch buffers"; homepage = "https://git.sr.ht/~swflint/scratch-plus"; diff --git a/modules/user/emacs/init.el b/modules/user/emacs/init.el index 8ca4322..0cc4880 100644 --- a/modules/user/emacs/init.el +++ b/modules/user/emacs/init.el @@ -78,7 +78,8 @@ (set-face-background 'fringe (face-attribute 'default :background)) ;; Fira and glyphs - (set-frame-font "FiraCode Nerd Font") + (when (window-system) + (set-frame-font "FiraCode Nerd Font")) (let ((alist '((33 . ".\\(?:\\(?:==\\|!!\\)\\|[!=]\\)") (35 . ".\\(?:###\\|##\\|_(\\|[#(?[_{]\\)") (36 . ".\\(?:>\\)") diff --git a/modules/user/git/git.nix b/modules/user/git/git.nix index 780a928..890b0c8 100644 --- a/modules/user/git/git.nix +++ b/modules/user/git/git.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, pkgs-stable, osConfig, ... }: +{ config, lib, pkgs, osConfig, ... }: let cfg = config.userSettings.git; @@ -10,7 +10,7 @@ in { }; config = lib.mkIf cfg.enable { - home.packages = [ pkgs.git pkgs-stable.openssh ]; + home.packages = [ pkgs.git pkgs.openssh ]; programs.git.enable = true; programs.git.userName = config.userSettings.name; programs.git.userEmail = config.userSettings.email; diff --git a/modules/user/gnome/default.nix b/modules/user/gnome/default.nix index 1cbe405..a6f9634 100644 --- a/modules/user/gnome/default.nix +++ b/modules/user/gnome/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ inputs, pkgs, config, lib, ... }: let cfg = config.userSettings.gnome; diff --git a/modules/user/home.nix b/modules/user/home.nix index d8147ea..80b2500 100644 --- a/modules/user/home.nix +++ b/modules/user/home.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, lib, pkgs, inputs, ... }: { diff --git a/modules/user/hyprland/default.nix b/modules/user/hyprland/default.nix index 3d565ed..13fe522 100644 --- a/modules/user/hyprland/default.nix +++ b/modules/user/hyprland/default.nix @@ -61,7 +61,7 @@ in xdg-desktop-portal-termfilechooser ]; }; - + xdg.portal.config.common = { default = [ "hyprland" ]; "org.freedesktop.impl.portal.FileChooser" = "termfilechooser"; @@ -70,9 +70,9 @@ in default = [ "hyprland" ]; "org.freedesktop.impl.portal.FileChooser" = "termfilechooser"; }; - + home.sessionVariables.TERMCMD = "kitty --class=filechoose_yazi"; - + xdg.configFile."xdg-desktop-portal-termfilechooser/config" = { force = true; @@ -373,11 +373,7 @@ in "center,title:(Resource)" "tile,title:(Godot)" "suppressevent maximize,class:^(steam)$" - "float,title:^(Unlock Database - KeePassXC)$" - "size 80% 85%,title:^(Unlock Database - KeePassXC)$" - "center,title:^(Unlock Database - KeepassXC)$" ] ++ lib.optionals (!performance) [ - "opacity 0.80,class:^(dev.zed.Zed)$" "opacity 0.80,class:^(org.pulseaudio.pavucontrol)$" "opacity 1.0,class:^(org.qutebrowser.qutebrowser),fullscreen:1" "opacity 0.85,class:^(Element)$" @@ -585,36 +581,36 @@ in * Grayscale */ #version 300 es - + precision highp float; in vec2 v_texcoord; uniform sampler2D tex; out vec4 fragColor; - + // Enum for type of grayscale conversion const int LUMINOSITY = 0; const int LIGHTNESS = 1; const int AVERAGE = 2; - + /** * Type of grayscale conversion. */ const int Type = LUMINOSITY; - + // Enum for selecting luma coefficients const int PAL = 0; const int HDTV = 1; const int HDR = 2; - + /** * Formula used to calculate relative luminance. * (Only applies to type = "luminosity".) */ const int LuminosityType = HDR; - + void main() { vec4 pixColor = texture2D(tex, v_texcoord); - + float gray; if (Type == LUMINOSITY) { // https://en.wikipedia.org/wiki/Grayscale#Luma_coding_in_video_systems @@ -633,7 +629,7 @@ in gray = (pixColor.r + pixColor.g + pixColor.b) / 3.0; } vec3 grayscale = vec3(gray); - + fragColor = vec4(grayscale, pixColor.a); } ''; diff --git a/modules/user/media/default.nix b/modules/user/media/default.nix index 2961291..cd843b7 100644 --- a/modules/user/media/default.nix +++ b/modules/user/media/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, inputs, ... }: let cfg = config.userSettings.media; diff --git a/modules/user/nix/default.nix b/modules/user/nix/default.nix index ae0e7a0..a2c00e0 100644 --- a/modules/user/nix/default.nix +++ b/modules/user/nix/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, lib, pkgs, inputs, ... }: { config = { diff --git a/modules/user/office/default.nix b/modules/user/office/default.nix index a9922d0..29c471d 100644 --- a/modules/user/office/default.nix +++ b/modules/user/office/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, pkgs-stable, ... }: +{ config, lib, pkgs, ... }: let cfg = config.userSettings.office; @@ -26,7 +26,6 @@ in { ]; services.syncthing.enable = true; services.nextcloud-client = { - package = pkgs-stable.nextcloud-client; enable = true; startInBackground = true; }; diff --git a/modules/user/plasma/default.nix b/modules/user/plasma/default.nix index c4210d7..601a8ba 100644 --- a/modules/user/plasma/default.nix +++ b/modules/user/plasma/default.nix @@ -1,4 +1,4 @@ -{config, lib, inputs, ...}: +{config, lib, pkgs, inputs, ...}: let cfg = config.userSettings.plasma; in { diff --git a/modules/user/ranger/README.org b/modules/user/ranger/README.org new file mode 100644 index 0000000..4d055ed --- /dev/null +++ b/modules/user/ranger/README.org @@ -0,0 +1,25 @@ +#+title: Ranger File Manager +#+author: Emmet + +* What is Ranger? +[[https://ranger.github.io/][Ranger]] is a minimalistic TUI file manager controlled with vim keybindings (making it /extremely/ efficient). + +[[https://raw.githubusercontent.com/librephoenix/nixos-config-screenshots/main/app/ranger.png]] + +If you've never tried a terminal file manager, I suggest you try it out. Here's a quick overview of how to work with it: +- =j= and =k= - Move up and down +- =l= - Move into a directory or open file at point +- =h= - Move up a directory +- =g g= - Move to top +- =G= - Move to bottom +- =SPC= - Mark a file +- =y y= - Copy (yank) file(s) +- =d d= - Cut file(s) +- =p p= - Paste file(s) +- =d T= - Trash file(s) +- =d D= - /Delete/ a file (no undo!) +- =!= - Run a shell command in current directory +- =@= - Run a shell command on file(s) +- =Ctrl-r= - Refresh view + +Just like in vim, commands can be given by typing a colon =:= (semicolons =;= also work in ranger!) and typing the command, i.e =:rename newfilename=. diff --git a/modules/user/ranger/colorschemes/hail.py b/modules/user/ranger/colorschemes/hail.py new file mode 100644 index 0000000..9a04f53 --- /dev/null +++ b/modules/user/ranger/colorschemes/hail.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python3 + +# This file is part of ranger, the console file manager. +# License: GNU GPL version 3, see the file "AUTHORS" for details. + +from __future__ import (absolute_import, division, print_function) + +from ranger.gui.colorscheme import ColorScheme +from ranger.gui.color import ( + black, blue, cyan, green, magenta, red, white, yellow, default, + normal, bold, reverse, dim, BRIGHT, + default_colors, +) + + +class Default(ColorScheme): + progress_bar_color = blue + + def use(self, context): # pylint: disable=too-many-branches,too-many-statements + fg, bg, attr = default_colors + + if context.reset: + return default_colors + + elif context.in_browser: + if context.selected: + attr = reverse + else: + attr = normal + if context.empty or context.error: + bg = red + if context.border: + fg = default + if context.media: + if context.image: + fg = yellow + else: + fg = magenta + if context.container: + fg = red + if context.directory: + attr |= bold + fg = red + fg += BRIGHT + elif context.executable: + attr |= bold + fg = red + fg += BRIGHT + if context.socket: + attr |= bold + fg = magenta + fg += BRIGHT + if context.fifo or context.device: + fg = yellow + if context.device: + attr |= bold + fg += BRIGHT + if context.link: + fg = cyan if context.good else magenta + if context.tag_marker and not context.selected: + attr |= bold + if fg in (red, magenta): + fg = white + else: + fg = red + fg += BRIGHT + if not context.selected and (context.cut or context.copied): + attr |= bold + fg = black + fg += BRIGHT + # If the terminal doesn't support bright colors, use dim white + # instead of black. + if BRIGHT == 0: + attr |= dim + fg = white + if context.main_column: + # Doubling up with BRIGHT here causes issues because it's + # additive not idempotent. + if context.selected: + attr |= bold + if context.marked: + attr |= bold + fg = yellow + if context.badinfo: + if attr & reverse: + bg = magenta + else: + fg = magenta + + if context.inactive_pane: + fg = cyan + + elif context.in_titlebar: + if context.hostname: + fg = red if context.bad else green + elif context.directory: + fg = red + elif context.tab: + if context.good: + bg = green + elif context.link: + fg = cyan + attr |= bold + + elif context.in_statusbar: + if context.permissions: + if context.good: + fg = cyan + elif context.bad: + fg = magenta + if context.marked: + attr |= bold | reverse + fg = yellow + fg += BRIGHT + if context.frozen: + attr |= bold | reverse + fg = cyan + fg += BRIGHT + if context.message: + if context.bad: + attr |= bold + fg = red + fg += BRIGHT + if context.loaded: + bg = self.progress_bar_color + if context.vcsinfo: + fg = blue + attr &= ~bold + if context.vcscommit: + fg = yellow + attr &= ~bold + if context.vcsdate: + fg = cyan + attr &= ~bold + + if context.text: + if context.highlight: + attr |= reverse + + if context.in_taskview: + if context.title: + fg = blue + + if context.selected: + attr |= reverse + + if context.loaded: + if context.selected: + fg = self.progress_bar_color + else: + bg = self.progress_bar_color + + if context.vcsfile and not context.selected: + attr &= ~bold + if context.vcsconflict: + fg = magenta + elif context.vcsuntracked: + fg = cyan + elif context.vcschanged: + fg = red + elif context.vcsunknown: + fg = red + elif context.vcsstaged: + fg = green + elif context.vcssync: + fg = green + elif context.vcsignored: + fg = default + + elif context.vcsremote and not context.selected: + attr &= ~bold + if context.vcssync or context.vcsnone: + fg = green + elif context.vcsbehind: + fg = red + elif context.vcsahead: + fg = blue + elif context.vcsdiverged: + fg = magenta + elif context.vcsunknown: + fg = red + + return fg, bg, attr diff --git a/modules/user/ranger/commands.py b/modules/user/ranger/commands.py new file mode 100644 index 0000000..97b7909 --- /dev/null +++ b/modules/user/ranger/commands.py @@ -0,0 +1,62 @@ +# This is a sample commands.py. You can add your own commands here. +# +# Please refer to commands_full.py for all the default commands and a complete +# documentation. Do NOT add them all here, or you may end up with defunct +# commands when upgrading ranger. + +# A simple command for demonstration purposes follows. +# ----------------------------------------------------------------------------- + +from __future__ import (absolute_import, division, print_function) + +# You can import any python module as needed. +import os + +# You always need to import ranger.api.commands here to get the Command class: +from ranger.api.commands import Command + + +# Any class that is a subclass of "Command" will be integrated into ranger as a +# command. Try typing ":my_edit" in ranger! +class my_edit(Command): + # The so-called doc-string of the class will be visible in the built-in + # help that is accessible by typing "?c" inside ranger. + """:my_edit + + A sample command for demonstration purposes that opens a file in an editor. + """ + + # The execute method is called when you run this command in ranger. + def execute(self): + # self.arg(1) is the first (space-separated) argument to the function. + # This way you can write ":my_edit somefilename". + if self.arg(1): + # self.rest(1) contains self.arg(1) and everything that follows + target_filename = self.rest(1) + else: + # self.fm is a ranger.core.filemanager.FileManager object and gives + # you access to internals of ranger. + # self.fm.thisfile is a ranger.container.file.File object and is a + # reference to the currently selected file. + target_filename = self.fm.thisfile.path + + # This is a generic function to print text in ranger. + self.fm.notify("Let's edit the file " + target_filename + "!") + + # Using bad=True in fm.notify allows you to print error messages: + if not os.path.exists(target_filename): + self.fm.notify("The given file does not exist!", bad=True) + return + + # This executes a function from ranger.core.acitons, a module with a + # variety of subroutines that can help you construct commands. + # Check out the source, or run "pydoc ranger.core.actions" for a list. + self.fm.edit_file(target_filename) + + # The tab method is called when you press tab, and should return a list of + # suggestions that the user will tab through. + # tabnum is 1 for and -1 for by default + def tab(self, tabnum): + # This is a generic tab-completion function that iterates through the + # content of the current directory. + return self._tab_directory_content() diff --git a/modules/user/ranger/commands_full.py b/modules/user/ranger/commands_full.py new file mode 100644 index 0000000..4650e75 --- /dev/null +++ b/modules/user/ranger/commands_full.py @@ -0,0 +1,1993 @@ +# -*- coding: utf-8 -*- +# This file is part of ranger, the console file manager. +# This configuration file is licensed under the same terms as ranger. +# =================================================================== +# +# NOTE: If you copied this file to /etc/ranger/commands_full.py or +# ~/.config/ranger/commands_full.py, then it will NOT be loaded by ranger, +# and only serve as a reference. +# +# =================================================================== +# This file contains ranger's commands. +# It's all in python; lines beginning with # are comments. +# +# Note that additional commands are automatically generated from the methods +# of the class ranger.core.actions.Actions. +# +# You can customize commands in the files /etc/ranger/commands.py (system-wide) +# and ~/.config/ranger/commands.py (per user). +# They have the same syntax as this file. In fact, you can just copy this +# file to ~/.config/ranger/commands_full.py with +# `ranger --copy-config=commands_full' and make your modifications, don't +# forget to rename it to commands.py. You can also use +# `ranger --copy-config=commands' to copy a short sample commands.py that +# has everything you need to get started. +# But make sure you update your configs when you update ranger. +# +# =================================================================== +# Every class defined here which is a subclass of `Command' will be used as a +# command in ranger. Several methods are defined to interface with ranger: +# execute(): called when the command is executed. +# cancel(): called when closing the console. +# tab(tabnum): called when is pressed. +# quick(): called after each keypress. +# +# tab() argument tabnum is 1 for and -1 for by default +# +# The return values for tab() can be either: +# None: There is no tab completion +# A string: Change the console to this string +# A list/tuple/generator: cycle through every item in it +# +# The return value for quick() can be: +# False: Nothing happens +# True: Execute the command afterwards +# +# The return value for execute() and cancel() doesn't matter. +# +# =================================================================== +# Commands have certain attributes and methods that facilitate parsing of +# the arguments: +# +# self.line: The whole line that was written in the console. +# self.args: A list of all (space-separated) arguments to the command. +# self.quantifier: If this command was mapped to the key "X" and +# the user pressed 6X, self.quantifier will be 6. +# self.arg(n): The n-th argument, or an empty string if it doesn't exist. +# self.rest(n): The n-th argument plus everything that followed. For example, +# if the command was "search foo bar a b c", rest(2) will be "bar a b c" +# self.start(n): Anything before the n-th argument. For example, if the +# command was "search foo bar a b c", start(2) will be "search foo" +# +# =================================================================== +# And this is a little reference for common ranger functions and objects: +# +# self.fm: A reference to the "fm" object which contains most information +# about ranger. +# self.fm.notify(string): Print the given string on the screen. +# self.fm.notify(string, bad=True): Print the given string in RED. +# self.fm.reload_cwd(): Reload the current working directory. +# self.fm.thisdir: The current working directory. (A File object.) +# self.fm.thisfile: The current file. (A File object too.) +# self.fm.thistab.get_selection(): A list of all selected files. +# self.fm.execute_console(string): Execute the string as a ranger command. +# self.fm.open_console(string): Open the console with the given string +# already typed in for you. +# self.fm.move(direction): Moves the cursor in the given direction, which +# can be something like down=3, up=5, right=1, left=1, to=6, ... +# +# File objects (for example self.fm.thisfile) have these useful attributes and +# methods: +# +# tfile.path: The path to the file. +# tfile.basename: The base name only. +# tfile.load_content(): Force a loading of the directories content (which +# obviously works with directories only) +# tfile.is_directory: True/False depending on whether it's a directory. +# +# For advanced commands it is unavoidable to dive a bit into the source code +# of ranger. +# =================================================================== + +from __future__ import (absolute_import, division, print_function) + +from collections import deque +import os +import re + +from ranger.api.commands import Command + + +class alias(Command): + """:alias + + Copies the oldcommand as newcommand. + """ + + context = 'browser' + resolve_macros = False + + def execute(self): + if not self.arg(1) or not self.arg(2): + self.fm.notify('Syntax: alias ', bad=True) + return + + self.fm.commands.alias(self.arg(1), self.rest(2)) + + +class echo(Command): + """:echo + + Display the text in the statusbar. + """ + + def execute(self): + self.fm.notify(self.rest(1)) + + +class cd(Command): + """:cd [-r] + + The cd command changes the directory. + If the path is a file, selects that file. + The command 'cd -' is equivalent to typing ``. + Using the option "-r" will get you to the real path. + """ + + def execute(self): + if self.arg(1) == '-r': + self.shift() + destination = os.path.realpath(self.rest(1)) + if os.path.isfile(destination): + self.fm.select_file(destination) + return + else: + destination = self.rest(1) + + if not destination: + destination = '~' + + if destination == '-': + self.fm.enter_bookmark('`') + else: + self.fm.cd(destination) + + def _tab_args(self): + # dest must be rest because path could contain spaces + if self.arg(1) == '-r': + start = self.start(2) + dest = self.rest(2) + else: + start = self.start(1) + dest = self.rest(1) + + if dest: + head, tail = os.path.split(os.path.expanduser(dest)) + if head: + dest_exp = os.path.join(os.path.normpath(head), tail) + else: + dest_exp = tail + else: + dest_exp = '' + return (start, dest_exp, os.path.join(self.fm.thisdir.path, dest_exp), + dest.endswith(os.path.sep)) + + @staticmethod + def _tab_paths(dest, dest_abs, ends_with_sep): + if not dest: + try: + return next(os.walk(dest_abs))[1], dest_abs + except (OSError, StopIteration): + return [], '' + + if ends_with_sep: + try: + return [os.path.join(dest, path) for path in next(os.walk(dest_abs))[1]], '' + except (OSError, StopIteration): + return [], '' + + return None, None + + def _tab_match(self, path_user, path_file): + if self.fm.settings.cd_tab_case == 'insensitive': + path_user = path_user.lower() + path_file = path_file.lower() + elif self.fm.settings.cd_tab_case == 'smart' and path_user.islower(): + path_file = path_file.lower() + return path_file.startswith(path_user) + + def _tab_normal(self, dest, dest_abs): + dest_dir = os.path.dirname(dest) + dest_base = os.path.basename(dest) + + try: + dirnames = next(os.walk(os.path.dirname(dest_abs)))[1] + except (OSError, StopIteration): + return [], '' + + return [os.path.join(dest_dir, d) for d in dirnames if self._tab_match(dest_base, d)], '' + + def _tab_fuzzy_match(self, basepath, tokens): + """ Find directories matching tokens recursively """ + if not tokens: + tokens = [''] + paths = [basepath] + while True: + token = tokens.pop() + matches = [] + for path in paths: + try: + directories = next(os.walk(path))[1] + except (OSError, StopIteration): + continue + matches += [os.path.join(path, d) for d in directories + if self._tab_match(token, d)] + if not tokens or not matches: + return matches + paths = matches + + return None + + def _tab_fuzzy(self, dest, dest_abs): + tokens = [] + basepath = dest_abs + while True: + basepath_old = basepath + basepath, token = os.path.split(basepath) + if basepath == basepath_old: + break + if os.path.isdir(basepath_old) and not token.startswith('.'): + basepath = basepath_old + break + tokens.append(token) + + paths = self._tab_fuzzy_match(basepath, tokens) + if not os.path.isabs(dest): + paths_rel = self.fm.thisdir.path + paths = [os.path.relpath(os.path.join(basepath, path), paths_rel) + for path in paths] + else: + paths_rel = '' + return paths, paths_rel + + def tab(self, tabnum): + from os.path import sep + + start, dest, dest_abs, ends_with_sep = self._tab_args() + + paths, paths_rel = self._tab_paths(dest, dest_abs, ends_with_sep) + if paths is None: + if self.fm.settings.cd_tab_fuzzy: + paths, paths_rel = self._tab_fuzzy(dest, dest_abs) + else: + paths, paths_rel = self._tab_normal(dest, dest_abs) + + paths.sort() + + if self.fm.settings.cd_bookmarks: + paths[0:0] = [ + os.path.relpath(v.path, paths_rel) if paths_rel else v.path + for v in self.fm.bookmarks.dct.values() for path in paths + if v.path.startswith(os.path.join(paths_rel, path) + sep) + ] + + if not paths: + return None + if len(paths) == 1: + return start + paths[0] + sep + return [start + dirname + sep for dirname in paths] + + +class chain(Command): + """:chain ; ; ... + + Calls multiple commands at once, separated by semicolons. + """ + resolve_macros = False + + def execute(self): + if not self.rest(1).strip(): + self.fm.notify('Syntax: chain ; ; ...', bad=True) + return + for command in [s.strip() for s in self.rest(1).split(";")]: + self.fm.execute_console(command) + + +class shell(Command): + escape_macros_for_shell = True + + def execute(self): + if self.arg(1) and self.arg(1)[0] == '-': + flags = self.arg(1)[1:] + command = self.rest(2) + else: + flags = '' + command = self.rest(1) + + if command: + self.fm.execute_command(command, flags=flags) + + def tab(self, tabnum): + from ranger.ext.get_executables import get_executables + if self.arg(1) and self.arg(1)[0] == '-': + command = self.rest(2) + else: + command = self.rest(1) + start = self.line[0:len(self.line) - len(command)] + + try: + position_of_last_space = command.rindex(" ") + except ValueError: + return (start + program + ' ' for program + in get_executables() if program.startswith(command)) + if position_of_last_space == len(command) - 1: + selection = self.fm.thistab.get_selection() + if len(selection) == 1: + return self.line + selection[0].shell_escaped_basename + ' ' + return self.line + '%s ' + + before_word, start_of_word = self.line.rsplit(' ', 1) + return (before_word + ' ' + file.shell_escaped_basename + for file in self.fm.thisdir.files or [] + if file.shell_escaped_basename.startswith(start_of_word)) + + +class open_with(Command): + + def execute(self): + app, flags, mode = self._get_app_flags_mode(self.rest(1)) + self.fm.execute_file( + files=[f for f in self.fm.thistab.get_selection()], + app=app, + flags=flags, + mode=mode) + + def tab(self, tabnum): + return self._tab_through_executables() + + def _get_app_flags_mode(self, string): # pylint: disable=too-many-branches,too-many-statements + """Extracts the application, flags and mode from a string. + + examples: + "mplayer f 1" => ("mplayer", "f", 1) + "atool 4" => ("atool", "", 4) + "p" => ("", "p", 0) + "" => None + """ + + app = '' + flags = '' + mode = 0 + split = string.split() + + if len(split) == 1: + part = split[0] + if self._is_app(part): + app = part + elif self._is_flags(part): + flags = part + elif self._is_mode(part): + mode = part + + elif len(split) == 2: + part0 = split[0] + part1 = split[1] + + if self._is_app(part0): + app = part0 + if self._is_flags(part1): + flags = part1 + elif self._is_mode(part1): + mode = part1 + elif self._is_flags(part0): + flags = part0 + if self._is_mode(part1): + mode = part1 + elif self._is_mode(part0): + mode = part0 + if self._is_flags(part1): + flags = part1 + + elif len(split) >= 3: + part0 = split[0] + part1 = split[1] + part2 = split[2] + + if self._is_app(part0): + app = part0 + if self._is_flags(part1): + flags = part1 + if self._is_mode(part2): + mode = part2 + elif self._is_mode(part1): + mode = part1 + if self._is_flags(part2): + flags = part2 + elif self._is_flags(part0): + flags = part0 + if self._is_mode(part1): + mode = part1 + elif self._is_mode(part0): + mode = part0 + if self._is_flags(part1): + flags = part1 + + return app, flags, int(mode) + + def _is_app(self, arg): + return not self._is_flags(arg) and not arg.isdigit() + + @staticmethod + def _is_flags(arg): + from ranger.core.runner import ALLOWED_FLAGS + return all(x in ALLOWED_FLAGS for x in arg) + + @staticmethod + def _is_mode(arg): + return all(x in '0123456789' for x in arg) + + +class set_(Command): + """:set