diff --git a/flake.lock b/flake.lock index 1f34e69..352b99b 100644 --- a/flake.lock +++ b/flake.lock @@ -429,7 +429,7 @@ "crane_4": { "inputs": { "flake-compat": "flake-compat_6", - "flake-utils": "flake-utils_10", + "flake-utils": "flake-utils_11", "nixpkgs": [ "music-player", "nixpkgs" @@ -1128,11 +1128,11 @@ "systems": "systems_13" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -1161,7 +1161,25 @@ }, "flake-utils_12": { "inputs": { - "systems": "systems_16" + "systems": "systems_15" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_13": { + "inputs": { + "systems": "systems_17" }, "locked": { "lastModified": 1731533236, @@ -1177,7 +1195,7 @@ "type": "github" } }, - "flake-utils_13": { + "flake-utils_14": { "inputs": { "systems": [ "nixpkgs-xr", @@ -1198,9 +1216,9 @@ "type": "github" } }, - "flake-utils_14": { + "flake-utils_15": { "inputs": { - "systems": "systems_19" + "systems": "systems_20" }, "locked": { "lastModified": 1731533236, @@ -1216,7 +1234,7 @@ "type": "github" } }, - "flake-utils_15": { + "flake-utils_16": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -1231,7 +1249,7 @@ "type": "github" } }, - "flake-utils_16": { + "flake-utils_17": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -1246,9 +1264,9 @@ "type": "github" } }, - "flake-utils_17": { + "flake-utils_18": { "inputs": { - "systems": "systems_21" + "systems": "systems_22" }, "locked": { "lastModified": 1731533236, @@ -1264,9 +1282,9 @@ "type": "github" } }, - "flake-utils_18": { + "flake-utils_19": { "inputs": { - "systems": "systems_23" + "systems": "systems_24" }, "locked": { "lastModified": 1731533236, @@ -1282,9 +1300,9 @@ "type": "github" } }, - "flake-utils_19": { + "flake-utils_2": { "inputs": { - "systems": "systems_24" + "systems": "systems_3" }, "locked": { "lastModified": 1731533236, @@ -1300,9 +1318,9 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_20": { "inputs": { - "systems": "systems_3" + "systems": "systems_25" }, "locked": { "lastModified": 1731533236, @@ -1318,9 +1336,9 @@ "type": "github" } }, - "flake-utils_20": { + "flake-utils_21": { "inputs": { - "systems": "systems_26" + "systems": "systems_27" }, "locked": { "lastModified": 1731533236, @@ -1543,7 +1561,7 @@ }, "gomod2nix": { "inputs": { - "flake-utils": "flake-utils_18", + "flake-utils": "flake-utils_19", "nixpkgs": [ "tangled-core", "nixpkgs" @@ -2141,6 +2159,27 @@ "type": "github" } }, + "lichtfeld": { + "inputs": { + "flake-utils": "flake-utils_10", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775261177, + "narHash": "sha256-J2Ao8M8LB7TZ2T/DyiQlF20DEe8QecB57ekldc2X2DM=", + "owner": "uttarayan21", + "repo": "lichtfeld-nix", + "rev": "4602e71239d92f151e4761a095e837e237169f6a", + "type": "github" + }, + "original": { + "owner": "uttarayan21", + "repo": "lichtfeld-nix", + "type": "github" + } + }, "lucide-src": { "flake": false, "locked": { @@ -2171,7 +2210,7 @@ "advisory-db": "advisory-db_3", "crane": "crane_4", "fenix": "fenix_2", - "flake-utils": "flake-utils_11", + "flake-utils": "flake-utils_12", "nixpkgs": [ "nixpkgs" ] @@ -2411,7 +2450,7 @@ "inputs": { "flake-compat": "flake-compat_7", "nixpkgs": "nixpkgs_5", - "systems": "systems_15" + "systems": "systems_16" }, "locked": { "lastModified": 1774754558, @@ -2446,7 +2485,7 @@ "inputs": { "advisory-db": "advisory-db_4", "crane": "crane_5", - "flake-utils": "flake-utils_12", + "flake-utils": "flake-utils_13", "nix-github-actions": "nix-github-actions_3", "nixpkgs": [ "nixpkgs" @@ -2581,12 +2620,12 @@ "nixpkgs-xr": { "inputs": { "flake-compat": "flake-compat_9", - "flake-utils": "flake-utils_13", + "flake-utils": "flake-utils_14", "nixpkgs": [ "nixpkgs" ], "nvfetcher": "nvfetcher", - "systems": "systems_17", + "systems": "systems_18", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -2783,7 +2822,7 @@ "inputs": { "flake-parts": "flake-parts_4", "nixpkgs": "nixpkgs_8", - "systems": "systems_18" + "systems": "systems_19" }, "locked": { "lastModified": 1774612943, @@ -2801,7 +2840,7 @@ }, "nno": { "inputs": { - "flake-utils": "flake-utils_14", + "flake-utils": "flake-utils_15", "neorg": "neorg", "neorg-telescope": "neorg-telescope", "nixpkgs": [ @@ -2827,7 +2866,7 @@ "norg": { "inputs": { "flake-compat": "flake-compat_10", - "flake-utils": "flake-utils_15", + "flake-utils": "flake-utils_16", "nixpkgs": "nixpkgs_9" }, "locked": { @@ -2848,7 +2887,7 @@ "norg-meta": { "inputs": { "flake-compat": "flake-compat_11", - "flake-utils": "flake-utils_16", + "flake-utils": "flake-utils_17", "nixpkgs": "nixpkgs_10" }, "locked": { @@ -2944,7 +2983,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_20" + "systems": "systems_21" }, "locked": { "lastModified": 1774625180, @@ -3031,6 +3070,7 @@ "iamb": "iamb", "ironbar": "ironbar", "lanzaboote": "lanzaboote", + "lichtfeld": "lichtfeld", "music-player": "music-player", "musnix": "musnix", "nix-darwin": "nix-darwin", @@ -3330,7 +3370,7 @@ "crane": "crane_6", "crates-io-index": "crates-io-index_2", "crates-nix": "crates-nix_2", - "flake-utils": "flake-utils_17", + "flake-utils": "flake-utils_18", "nix-github-actions": "nix-github-actions_4", "nixpkgs": [ "nixpkgs" @@ -3397,7 +3437,7 @@ "nixpkgs" ], "nur": "nur_2", - "systems": "systems_22", + "systems": "systems_23", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -3540,31 +3580,31 @@ }, "systems_17": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, "systems_18": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -3703,6 +3743,21 @@ "type": "github" } }, + "systems_27": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_3": { "locked": { "lastModified": 1681028828, @@ -3925,7 +3980,7 @@ "inputs": { "advisory-db": "advisory-db_6", "crane": "crane_7", - "flake-utils": "flake-utils_19", + "flake-utils": "flake-utils_20", "nix-github-actions": "nix-github-actions_5", "nixpkgs": [ "nixpkgs" @@ -4068,7 +4123,7 @@ "vicinae": { "inputs": { "nixpkgs": "nixpkgs_12", - "systems": "systems_25" + "systems": "systems_26" }, "locked": { "lastModified": 1774616856, @@ -4151,7 +4206,7 @@ "zjstatus": { "inputs": { "crane": "crane_8", - "flake-utils": "flake-utils_20", + "flake-utils": "flake-utils_21", "nixpkgs": [ "nixpkgs" ], diff --git a/flake.nix b/flake.nix index ef83bca..170585d 100644 --- a/flake.nix +++ b/flake.nix @@ -192,6 +192,10 @@ url = "github:ezKEa/aagl-gtk-on-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + lichtfeld = { + url = "github:uttarayan21/lichtfeld-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { diff --git a/home/apps/default.nix b/home/apps/default.nix index 0d26475..ce66c04 100644 --- a/home/apps/default.nix +++ b/home/apps/default.nix @@ -15,6 +15,7 @@ lib.optionalAttrs device.hasGui { # ./ida.nix # ./jellyflix.nix # ./kicad.nix + # ./lichtfeld.nix # ./lmstudio.nix # ./neovide.nix # ./openscad.nix @@ -22,7 +23,6 @@ lib.optionalAttrs device.hasGui { # ./pcsx2.nix # ./prismlauncher.nix # ./rpcs3.nix - # ./shadps4.nix # ./thunderbird.nix # ./tsukimi.nix # ./vial.nix @@ -40,16 +40,17 @@ lib.optionalAttrs device.hasGui { ./ghostty.nix ./hyprpicker.nix ./kitty.nix + ./localsend.nix ./matrix.nix ./moonlight.nix ./mpv.nix ./nextcloud.nix ./obs-studio.nix + ./shadps4.nix ./slack.nix ./vicinae.nix ./wezterm.nix ./zathura.nix ./zen.nix - ./localsend.nix ]; } diff --git a/home/apps/lichtfeld.nix b/home/apps/lichtfeld.nix new file mode 100644 index 0000000..ed94143 --- /dev/null +++ b/home/apps/lichtfeld.nix @@ -0,0 +1,12 @@ +{ + pkgs, + inputs, + device, + lib, + ... +}: { + home.packages = lib.optionals (device.is "ryu") [ + inputs.lichtfeld.packages.${pkgs.system}.lichtfeld + ]; +} + diff --git a/home/apps/shadps4.nix b/home/apps/shadps4.nix index 02854c9..dacb7b2 100644 --- a/home/apps/shadps4.nix +++ b/home/apps/shadps4.nix @@ -6,8 +6,8 @@ shadps4_qtlauncher = pkgs.fetchFromGitHub { owner = "shadps4-emu"; repo = "shadps4-qtlauncher"; - rev = "1f4e59f6110d5f991cead5a3e9f72671fced2c70"; - sha256 = "sha256-AAxj3Eqp7iGJgRgJki/93fln5Z6ae8AydJLGZ6Dbb00="; + rev = "62704a8a0450792608d9644e38b2627c543bc971"; + sha256 = "sha256-NKt6AGSkhR7wyo7PP5Lgh9UhVbt3lWu/qygMvyD56wk="; fetchSubmodules = true; }; # diegolixShadps4 = pkgs.fetchFromGitHub { @@ -20,8 +20,8 @@ bblauncher = pkgs.fetchFromGitHub { owner = "rainmakerv3"; repo = "BB_Launcher"; - rev = "2280c90974d2d741ce927dfc88f0ecf98c8bd2df"; - sha256 = "sha256-jPcIQp2EBAEiaTLvC/OBH0BgcfYv3zo2H7akHJSlPaI="; + rev = "d0f7698de7d79a1a6078273843ad9e4c76442168"; + sha256 = "sha256-ECwN0g4DVTC6LepFCD28I7mpvETZcOwCeIZ6dIcEh6Q="; fetchSubmodules = true; }; in { @@ -67,10 +67,10 @@ in { pkgs.vulkan-utility-libraries pkgs.wayland pkgs.wayland-protocols - pkgs.xorg.libxcb - pkgs.xorg.xcbutil - pkgs.xorg.xcbutilkeysyms - pkgs.xorg.xcbutilwm + pkgs.libxcb + pkgs.xcbutil + pkgs.xcbutilkeysyms + pkgs.xcbutilwm pkgs.zlib ]; }) @@ -112,10 +112,10 @@ in { pkgs.vulkan-utility-libraries pkgs.wayland pkgs.wayland-protocols - pkgs.xorg.libxcb - pkgs.xorg.xcbutil - pkgs.xorg.xcbutilkeysyms - pkgs.xorg.xcbutilwm + pkgs.libxcb + pkgs.xcbutil + pkgs.xcbutilkeysyms + pkgs.xcbutilwm pkgs.zlib ]; }) diff --git a/home/apps/zen.nix b/home/apps/zen.nix index 6890a74..0b572c8 100644 --- a/home/apps/zen.nix +++ b/home/apps/zen.nix @@ -13,7 +13,7 @@ enable = true; profiles.default = rec { settings = { - "zen.window-sync.enabled" = false; + "zen.window-sync.enabled" = true; "zen.welcome-screen.seen" = true; }; containersForce = true; diff --git a/home/programs/git.nix b/home/programs/git.nix index b469aac..8997818 100644 --- a/home/programs/git.nix +++ b/home/programs/git.nix @@ -6,30 +6,34 @@ ... }: lib.optionalAttrs (!(device.is "tsuba")) { - programs.git = { - enable = true; - lfs.enable = true; - settings = { - user.name = "servius"; - user.email = builtins.elemAt config.accounts.email.accounts.fastmail.aliases 0; - user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJfKKrX8yeIHUUury0aPwMY6Ha+BJyUR7P0Gqid90ik/"; - color.ui = true; - core.editor = "nvim"; - core.pager = "${pkgs.delta}/bin/delta"; - interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only"; - delta.navigate = true; - merge.conflictStyle = "diff3"; - diff.colorMoved = "default"; - push.autoSetupRemote = true; - gpg.format = "ssh"; - commit.gpgsign = true; - pull = { - rebase = true; + programs = { + git = { + enable = true; + lfs.enable = true; + settings = { + user.name = "servius"; + user.email = builtins.elemAt config.accounts.email.accounts.fastmail.aliases 0; + user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJfKKrX8yeIHUUury0aPwMY6Ha+BJyUR7P0Gqid90ik/"; + color.ui = true; + core.editor = "nvim"; + core.pager = "${pkgs.delta}/bin/delta"; + interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only"; + delta.navigate = true; + merge.conflictStyle = "diff3"; + diff.colorMoved = "default"; + push.autoSetupRemote = true; + gpg.format = "ssh"; + commit.gpgsign = true; + pull = { + rebase = true; + }; + "gpg \"ssh\"".program = + if pkgs.stdenv.isDarwin + then "/Applications/1Password.app/Contents/MacOS/op-ssh-sign" + else "${pkgs._1password-gui}/share/1password/op-ssh-sign"; }; - "gpg \"ssh\"".program = - if pkgs.stdenv.isDarwin - then "/Applications/1Password.app/Contents/MacOS/op-ssh-sign" - else "${pkgs._1password-gui}/share/1password/op-ssh-sign"; + + signing.format = "openpgp"; }; }; } diff --git a/home/programs/opencode.nix b/home/programs/opencode.nix index ea2c13e..35aa233 100644 --- a/home/programs/opencode.nix +++ b/home/programs/opencode.nix @@ -21,5 +21,101 @@ lib.optionalAttrs (device.is "ryu" || device.is "kuro") { }; }; }; + skills = { + nix = '' + --- + name: nix + description: Nix / NixOS related modifications + --- + **Formatting:** + - Use `alejandra` formatter (run before committing) + + **Common Patterns:** + Writing a new module must be like this + ```nix + with lib; let + cfg = config.programs.myProgram; + in { + options.programs.myProgram = { + enable = mkEnableOption "myProgram"; + }; + config = mkIf cfg.enable { + home.packages = [ pkgs.myProgram ]; + }; + } + ``` + + **Device-Specific Logic:** + ```nix + home.packages = lib.optionals device.isLinux [ pkgs.linuxPackage ] ++ lib.optionals device.isDarwin [ pkgs.macPackage ]; + # if the device doesn't h + + **Instructions:** + When working on nixos / darwin configurations do not run `nix check` instead try to build the derivation. + When working on nix derivations try to compile on local machine only (use --builders \'\') + + **Resources:** + 1. https://wiki.nixos.org/wiki/Packaging/Quirks_and_Caveats + ``` + ''; + rust = '' + ## Rust Guidelines + + **Code Organization:** + - One module per file + - Use `foo.rs` and `foo` for module directories + - Re-export public API at module root + + **Naming Conventions:** + - Types: PascalCase (e.g., `HttpClient`) + - Functions/variables: snake_case (e.g., `parse_config`) + - Constants: SCREAMING_SNAKE_CASE (e.g., `MAX_RETRIES`) + - Lifetimes: short lowercase (e.g., `'a`, `'ctx`) + + **Error Handling:** + - Use `Result` for recoverable errors + - Use `thiserror` for custom error types + - Avoid `unwrap()` and `expect()` in production code + + **Idiomatic Patterns:** + ```rust + // Use Option/Result combinators + user.name.clone().unwrap_or_default(); + + // Use pattern matching exhaustively + match result { + Ok(value) => value, + Err(e) => return Err(e.into()), + } + + // Prefer iterators over explicit loops + items.iter().filter(|x| x.active).map(|x| x.id).collect() + std::env::args().skip(1).collect::>() + ``` + + **Safety:** + - Avoid `unsafe` unless absolutely necessary + - Document safety invariants for `unsafe` blocks + - Use `#[allow(dead_code)]` sparingly + + **Dependencies:** + - Specify versions in `Cargo.toml` + - Use `cargo edit` for dependency management + - Run `cargo outdated` regularly + - Use rust edition 2024 + - If there is a flake.nix in the repo use the default devShell + + **Testing:** + - Write unit tests in same file with `#[cfg(test)]` + - Write integration tests in `tests/` directory + - Use `cargo test` for running tests + - Use `cargo tarpaulin` for coverage + + **Clippy:** + - Run `cargo clippy -- -D warnings` + - Address all clippy warnings before committing + + ''; + }; }; } diff --git a/home/services/hyprland.nix b/home/services/hyprland.nix index a116971..7ccec35 100644 --- a/home/services/hyprland.nix +++ b/home/services/hyprland.nix @@ -40,9 +40,9 @@ render = { cm_enabled = true; direct_scanout = 1; # 0 - off; 1 - on; 2 - auto based on `game` - cm_fs_passthrough = 1; # 0 - off; 1 - always; 2 - hdr only + cm_fs_passthrough = 2; # 0 - off; 1 - always; 2 - hdr only send_content_type = true; # automatic monitor mode switch - cm_auto_hdr = 1; # 0 - off; 1 - switch to cm,hdr 2; 2 - switch to cm,hdredid + cm_auto_hdr = 2; # 0 - off; 1 - switch to cm,hdr 2; 2 - switch to cm,hdredid non_shader_cm = 2; }; # experimental = { diff --git a/home/services/xdg.nix b/home/services/xdg.nix index 8f14043..86664ab 100644 --- a/home/services/xdg.nix +++ b/home/services/xdg.nix @@ -5,12 +5,15 @@ inputs, ... }: { - xdg.portal = { - enable = device.is "ryu"; - config = { - hyprland.default = ["hyprland"]; - common.default = ["*" "hyprland"]; + xdg = { + portal = { + enable = device.is "ryu"; + config = { + hyprland.default = ["hyprland"]; + common.default = ["*" "hyprland"]; + }; }; + userDirs.setSessionVariables = true; }; } # // lib.optionalAttrs (device.is "ryu") {