diff --git a/flake.lock b/flake.lock index 41aaf4f4..301894a6 100644 --- a/flake.lock +++ b/flake.lock @@ -464,11 +464,11 @@ ] }, "locked": { - "lastModified": 1720796317, - "narHash": "sha256-2B4PFl75fFjQkquRCPB5PYeY0bFqF/xvsLy014c+7W4=", + "lastModified": 1720861673, + "narHash": "sha256-gh34LtCLvXCd/Xyk33mgQU3QqNyJ7ZwJj59c4Qdad78=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "a07ca86e6922bc2a68ec4c801ab7e05e12397af0", + "rev": "34b8101a10dfb4cb38832a17ef33281d59e2b2b3", "type": "github" }, "original": { @@ -480,11 +480,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1720739431, - "narHash": "sha256-lEgZwuKL1eLsiFqoSiOZgq30jQCFTEYlreL79Txbxu4=", + "lastModified": 1720816717, + "narHash": "sha256-C8bdG2wrI29afHI1705W37M7CPudz5117YafiBlW0Y4=", "owner": "neovim", "repo": "neovim", - "rev": "a5de650f0eb93a848831f1ba631485437a82d57b", + "rev": "10256bb760fcab0dc25f7eb5b0b45966cb771939", "type": "github" }, "original": { @@ -610,6 +610,7 @@ "neovim-nightly-overlay": "neovim-nightly-overlay", "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable_2", + "rust-overlay": "rust-overlay_2", "systems": "systems_3" } }, @@ -655,6 +656,26 @@ "type": "github" } }, + "rust-overlay_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720837122, + "narHash": "sha256-WMwo/kZ3o2h5Bls4dEyQ3XFZ4nw2UbbOUFpq3aVlkms=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "92f0608ab66c9770e931056b1c7a1b6249dbc43a", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 866315ec..e5afb55f 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,10 @@ url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; - rust-overlay.url = "github:oxalica/rust-overlay"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, @@ -59,7 +62,7 @@ ); in { inherit lib; - devShells = forEachSystem (pkgs: import ./nixos/core/shells/dev.nix {inherit inputs pkgs;}); + devShells = forEachSystem (pkgs: import ./nixos/core/shells/dev.nix {inherit pkgs;}); formatter = forEachSystem (pkgs: pkgs.alejandra); nixosConfigurations = { diff --git a/home/users/cnst/home.nix b/home/users/cnst/home.nix index 22eb64a5..9c9f2582 100644 --- a/home/users/cnst/home.nix +++ b/home/users/cnst/home.nix @@ -20,6 +20,7 @@ }; }; + # TODO: Set your username home = { username = "cnst"; homeDirectory = "/home/cnst"; @@ -27,6 +28,7 @@ programs.home-manager.enable = true; + # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion diff --git a/nixos/core/shells/dev.nix b/nixos/core/shells/dev.nix index 40023df5..2ffec318 100644 --- a/nixos/core/shells/dev.nix +++ b/nixos/core/shells/dev.nix @@ -1,19 +1,10 @@ -{nixpkgs ? import {}}: let - rustOverlay = builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"; - pinnedPkgs = nixpkgs.fetchFromGitHub { - owner = "NixOS"; - repo = "nixpkgs"; - rev = "1fe6ed37fd9beb92afe90671c0c2a662a03463dd"; - sha256 = "1daa0y3p17shn9gibr321vx8vija6bfsb5zd7h4pxdbbwjkfq8n2"; - }; - pkgs = import pinnedPkgs { - overlays = [(import rustOverlay)]; - }; -in - pkgs.mkShell { +{pkgs ? import {}, ...}: { + default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + _rustBuild + ]; buildInputs = with pkgs; [ - rust-bin.stable.latest.default - rust-analyzer + # rust-bin.stable.latest.default openssl pkg-config ez @@ -26,4 +17,5 @@ in alias find=fd ''; RUST_BACKTRACE = 1; - } + }; +} diff --git a/nixos/core/shells/dev.nixbak b/nixos/core/shells/dev.nixbak new file mode 100644 index 00000000..dbbecdd6 --- /dev/null +++ b/nixos/core/shells/dev.nixbak @@ -0,0 +1,34 @@ +{ + inputs, + pkgs ? import {}, + ... +}: let + _rustBuildOxalica = inputs.rust-overlay.packages.${pkgs.stdenv.hostPlatform.system}.rust.override { + extensions = [ + "rust-src" + "rust-analyzer" + "clippy" + ]; + }; + _rustBuild = _rustBuildOxalica; +in { + default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + _rustBuild + ]; + buildInputs = with pkgs; [ + rust-bin.stable.latest.default + openssl + pkg-config + ez + fd + gtk3 + gtk4 + ]; + shellHook = '' + alias ls=eza + alias find=fd + ''; + RUST_BACKTRACE = 1; + }; +}