All my system configs and packages in one repo
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: switch from rust-overlay to fenix

rust-overlay is massively bloated and contains a lot of unneeded
information of previous rust releases. fenix is sufficient if we just
want the latest (or in my case, monthly) nightly

+76 -51
+45 -7
flake.lock
··· 90 90 "type": "github" 91 91 } 92 92 }, 93 + "fenix": { 94 + "inputs": { 95 + "nixpkgs": [ 96 + "nixpkgs" 97 + ], 98 + "rust-analyzer-src": "rust-analyzer-src" 99 + }, 100 + "locked": { 101 + "lastModified": 1722493751, 102 + "narHash": "sha256-l7/yMehbrL5d4AI8E2hKtNlT50BlUAau4EKTgPg9KcY=", 103 + "owner": "nix-community", 104 + "repo": "fenix", 105 + "rev": "60ab4a085ef6ee40f2ef7921ca4061084dd8cf26", 106 + "type": "github" 107 + }, 108 + "original": { 109 + "owner": "nix-community", 110 + "ref": "monthly", 111 + "repo": "fenix", 112 + "type": "github" 113 + } 114 + }, 93 115 "firefox-addons": { 94 116 "inputs": { 95 117 "flake-utils": [ ··· 371 393 "nixpkgs" 372 394 ], 373 395 "pre-commit-hooks-nix": "pre-commit-hooks-nix", 374 - "rust-overlay": [ 375 - "rust-overlay" 376 - ] 396 + "rust-overlay": "rust-overlay" 377 397 }, 378 398 "locked": { 379 399 "lastModified": 1722329086, ··· 549 569 "catppuccin": "catppuccin", 550 570 "ctp-discord-compiled": "ctp-discord-compiled", 551 571 "ctp-vscode-compiled": "ctp-vscode-compiled", 572 + "fenix": "fenix", 552 573 "firefox-addons": "firefox-addons", 553 574 "flake-parts": "flake-parts", 554 575 "flake-utils": "flake-utils", ··· 561 582 "nixos-hardware": "nixos-hardware", 562 583 "nixpkgs": "nixpkgs", 563 584 "plasma-manager": "plasma-manager", 564 - "rust-overlay": "rust-overlay", 565 585 "treefmt-nix": "treefmt-nix" 566 586 } 567 587 }, 588 + "rust-analyzer-src": { 589 + "flake": false, 590 + "locked": { 591 + "lastModified": 1722449213, 592 + "narHash": "sha256-1na4m2PNH99syz2g/WQ+Hr3RfY7k4H8NBnmkr5dFDXw=", 593 + "owner": "rust-lang", 594 + "repo": "rust-analyzer", 595 + "rev": "c8e41d95061543715b30880932ec3dc24c42d7ae", 596 + "type": "github" 597 + }, 598 + "original": { 599 + "owner": "rust-lang", 600 + "ref": "nightly", 601 + "repo": "rust-analyzer", 602 + "type": "github" 603 + } 604 + }, 568 605 "rust-overlay": { 569 606 "inputs": { 570 607 "nixpkgs": [ 608 + "lanzaboote", 571 609 "nixpkgs" 572 610 ] 573 611 }, 574 612 "locked": { 575 - "lastModified": 1722565199, 576 - "narHash": "sha256-2eek4vZKsYg8jip2WQWvAOGMMboQ40DIrllpsI6AlU4=", 613 + "lastModified": 1722219664, 614 + "narHash": "sha256-xMOJ+HW4yj6e69PvieohUJ3dBSdgCfvI0nnCEe6/yVc=", 577 615 "owner": "oxalica", 578 616 "repo": "rust-overlay", 579 - "rev": "a9cd2009fb2eeacfea785b45bdbbc33612bba1f1", 617 + "rev": "a6fbda5d9a14fb5f7c69b8489d24afeb349c7bb4", 580 618 "type": "github" 581 619 }, 582 620 "original": {
+5 -6
flake.nix
··· 23 23 flake = false; 24 24 }; 25 25 26 + fenix = { 27 + url = "github:nix-community/fenix/monthly"; 28 + inputs.nixpkgs.follows = "nixpkgs"; 29 + }; 30 + 26 31 firefox-addons = { 27 32 url = "sourcehut:~rycee/nur-expressions?dir=pkgs/firefox-addons"; 28 33 inputs = { ··· 57 62 inputs = { 58 63 flake-parts.follows = "flake-parts"; 59 64 nixpkgs.follows = "nixpkgs"; 60 - rust-overlay.follows = "rust-overlay"; 61 65 }; 62 66 }; 63 67 ··· 84 88 home-manager.follows = "home-manager"; 85 89 nixpkgs.follows = "nixpkgs"; 86 90 }; 87 - }; 88 - 89 - rust-overlay = { 90 - url = "github:oxalica/rust-overlay"; 91 - inputs.nixpkgs.follows = "nixpkgs"; 92 91 }; 93 92 94 93 treefmt-nix.url = "github:numtide/treefmt-nix";
+26 -38
roles/rust/default.nix
··· 2 2 lib, 3 3 pkgs, 4 4 config, 5 - inputs, 5 + inputs', 6 6 ... 7 7 }: 8 8 let ··· 18 18 options.roles.rust = { 19 19 enable = mkEnableOption "Rust"; 20 20 21 - rust-bin = mkOption { 22 - type = types.attrsOf types.anything; 23 - default = pkgs.rust-bin; 24 - example = pkgs.rust-bin // { 25 - distRoot = "some-root"; 26 - }; 27 - }; 28 - 29 21 package = mkOption { 30 22 type = types.package; 31 - default = cfg.rust-bin.selectLatestNightlyWith ( 32 - toolchain: toolchain.default.override { extensions = [ "rust-analyzer" ]; } 33 - ); 34 - example = cfg.rust-bin.stable.latest.default; 35 - description = "Version of Rust to install. Defaults to latest nightly with rust-analyzer"; 23 + default = 24 + let 25 + fenix = inputs'.fenix.packages; 26 + in 27 + fenix.combine [ 28 + fenix.default.toolchain 29 + fenix.rust-analyzer 30 + ]; 31 + description = "Version of Rust to install. Defaults to nightly with rust-analyzer"; 36 32 }; 37 33 38 34 linker = mkOption { ··· 58 54 }; 59 55 }; 60 56 61 - config = 57 + config.hm = 62 58 let 63 - toTOMLFile = pkgs.formats.toml { }; 59 + toml = pkgs.formats.toml { }; 60 + linkerSettings = lib.optionalAttrs (cfg.linker != null) { 61 + target.${pkgs.rust.toRustTarget pkgs.hostPlatform} = { 62 + linker = "${lib.getExe pkgs.clang_16}"; 63 + rustflags = [ 64 + "-C" 65 + "link-arg=-fuse-ld=${cfg.linker}" 66 + ]; 67 + }; 68 + }; 64 69 in 65 70 mkIf cfg.enable { 66 - nixpkgs.overlays = [ inputs.rust-overlay.overlays.default ]; 67 - 68 - hm = { 69 - home.packages = [ cfg.package ]; 71 + home.packages = [ cfg.package ]; 70 72 71 - xdg.configFile."rustfmt/rustfmt.toml" = mkIf (cfg.rustfmt.settings != null) { 72 - source = toTOMLFile.generate "rustfmt.toml" cfg.rustfmt.settings; 73 - }; 73 + xdg.configFile."rustfmt/rustfmt.toml".source = mkIf (cfg.rustfmt.settings != null) 74 + (toml.generate "rustfmt.toml" cfg.rustfmt.settings); 74 75 75 - home.file.".cargo/config.toml" = mkIf (cfg.settings != null) { 76 - source = toTOMLFile.generate "config.toml" ( 77 - (lib.optionalAttrs (cfg.linker != null) { 78 - target.${pkgs.rust.toRustTarget pkgs.hostPlatform} = { 79 - linker = "${lib.getExe pkgs.clang_16}"; 80 - rustflags = [ 81 - "-C" 82 - "link-arg=-fuse-ld=${cfg.linker}" 83 - ]; 84 - }; 85 - }) 86 - // cfg.settings 87 - ); 88 - }; 89 - }; 76 + home.file.".cargo/config.toml".source = mkIf (cfg.settings != null) 77 + (toml.generate "config.toml" (linkerSettings // cfg.settings)); 90 78 }; 91 79 }