pin vscode rustanalyzer

This commit is contained in:
Cyryl Płotnicki 2023-01-31 21:38:23 +00:00
parent f386acd94d
commit 95310bbcee
3 changed files with 198 additions and 183 deletions

View file

@ -366,6 +366,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-rust-analyzer": {
"locked": {
"lastModified": 1675198550,
"narHash": "sha256-LWUqaWNDvHvfsruLk27u8uMo0lT4w7Gzl/zFOIr27HE=",
"owner": "cyplo",
"repo": "nixpkgs",
"rev": "85b5540187b50ef99a14a39a5437fd0abb9f3e4b",
"type": "github"
},
"original": {
"owner": "cyplo",
"ref": "85b5540187b50ef99a14a39a5437fd0abb9f3e4b",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1674407282, "lastModified": 1674407282,
@ -410,6 +426,7 @@
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs-master": "nixpkgs-master", "nixpkgs-master": "nixpkgs-master",
"nixpkgs-nixos-unstable": "nixpkgs-nixos-unstable", "nixpkgs-nixos-unstable": "nixpkgs-nixos-unstable",
"nixpkgs-rust-analyzer": "nixpkgs-rust-analyzer",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
"nur": "nur", "nur": "nur",
"sops": "sops" "sops": "sops"

360
flake.nix
View file

@ -1,204 +1,195 @@
{ {
description = "NixOS configuration with flakes"; description = "NixOS configuration with flakes";
outputs = { outputs = { self, flake-utils, flake-compat, home-manager
self, , nixpkgs-nixos-unstable, nixpkgs-master, nixpkgs-stable, darwin
flake-utils, , nixos-hardware, nur, sops, nil, helix, alejandra, nixpkgs-rust-analyzer
flake-compat, }@inputs:
home-manager, let
nixpkgs-nixos-unstable, mkServer = pkgs: system: hostname:
nixpkgs-master, pkgs.lib.nixosSystem {
nixpkgs-stable, inherit system;
darwin, modules = [
nixos-hardware, (./. + "/nixos/boxes/${hostname}")
nur, (import ./nixos/server-common.nix)
sops, sops.nixosModules.sops
nil, ];
helix, specialArgs = { inherit inputs system; };
alejandra, };
} @ inputs: let mkRaspi = pkgs: hostname:
mkServer = pkgs: system: hostname: pkgs.lib.nixosSystem {
pkgs.lib.nixosSystem { system = "aarch64-linux";
inherit system; modules = [ (./. + "/nixos/boxes/${hostname}") ];
modules = [ specialArgs = { inherit inputs; };
(./. + "/nixos/boxes/${hostname}") };
(import ./nixos/server-common.nix) mkKiosk = pkgs: system: hostname:
sops.nixosModules.sops pkgs.lib.nixosSystem {
]; inherit system;
specialArgs = {inherit inputs system;}; modules = [
}; (./. + "/nixos/boxes/${hostname}")
mkRaspi = pkgs: hostname: (import ./nixos/common.nix)
pkgs.lib.nixosSystem { sops.nixosModules.sops
system = "aarch64-linux";
modules = [(./. + "/nixos/boxes/${hostname}")];
specialArgs = {inherit inputs;};
};
mkKiosk = pkgs: system: hostname:
pkgs.lib.nixosSystem {
inherit system;
modules = [
(./. + "/nixos/boxes/${hostname}")
(import ./nixos/common.nix)
sops.nixosModules.sops
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.cyryl = { home-manager.users.cyryl = {
imports = [./nixos/home-manager ./nixos/home-manager/linux.nix]; imports =
_module.args.inputs = inputs; [ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.system = system; _module.args.inputs = inputs;
_module.args.system = system;
};
}
];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = { allowUnfree = true; };
};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = { allowUnfree = true; };
}; };
}
];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = {allowUnfree = true;};
};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = {allowUnfree = true;};
}; };
}; };
}; mkWorkstation = pkgs: system: hostname:
mkWorkstation = pkgs: system: hostname: pkgs.lib.nixosSystem {
pkgs.lib.nixosSystem { inherit system;
inherit system; modules = [
modules = [ (./. + "/nixos/boxes/${hostname}")
(./. + "/nixos/boxes/${hostname}") (import ./nixos/email-accounts.nix)
(import ./nixos/email-accounts.nix) (import ./nixos/common.nix)
(import ./nixos/common.nix) sops.nixosModules.sops
sops.nixosModules.sops
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.cyryl = { home-manager.users.cyryl = {
imports = [./nixos/home-manager ./nixos/home-manager/linux.nix]; imports =
_module.args.inputs = inputs; [ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.system = system; _module.args.inputs = inputs;
_module.args.system = system;
};
}
];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = { allowUnfree = true; };
};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = { allowUnfree = true; };
}; };
}
];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = {allowUnfree = true;};
};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = {allowUnfree = true;};
}; };
}; };
mkShell = packageSet: system:
let pkgs = packageSet.legacyPackages.${system};
in pkgs.mkShell {
packages = with pkgs; [
cacert
git
git-lfs
nixpkgs-fmt
openssh
openssl
pkg-config
statix
];
};
in {
devShells = {
"x86_64-darwin".default = mkShell nixpkgs-stable "x86_64-darwin";
"x86_64-linux".default = mkShell nixpkgs-stable "x86_64-linux";
}; };
mkShell = packageSet: system: let darwinConfigurations = {
pkgs = packageSet.legacyPackages.${system}; "FORM3-CYRYLPLOTN" = darwin.lib.darwinSystem rec {
in system = "x86_64-darwin";
pkgs.mkShell { modules = [
packages = with pkgs; [ (./. + "/nixos/boxes/form3")
cacert home-manager.darwinModules.home-manager
git {
git-lfs home-manager.useGlobalPkgs = true;
nixpkgs-fmt home-manager.useUserPackages = true;
openssh home-manager.users.cyryl = {
openssl imports = [ ./nixos/home-manager ];
pkg-config _module.args.inputs = inputs;
statix _module.args.system = system;
]; };
}; }
in { ];
devShells = {
"x86_64-darwin".default = mkShell nixpkgs-stable "x86_64-darwin";
"x86_64-linux".default = mkShell nixpkgs-stable "x86_64-linux";
};
darwinConfigurations = {
"FORM3-CYRYLPLOTN" = darwin.lib.darwinSystem rec {
system = "x86_64-darwin";
modules = [
(./. + "/nixos/boxes/form3")
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cyryl = {
imports = [./nixos/home-manager];
_module.args.inputs = inputs;
_module.args.system = system;
};
}
];
};
};
nixosConfigurations = {
foureighty = mkWorkstation nixpkgs-stable "x86_64-linux" "foureighty";
skinnyv = mkWorkstation nixpkgs-stable "x86_64-linux" "skinnyv";
thinky = mkWorkstation nixpkgs-stable "x86_64-linux" "thinky";
bolty = mkServer nixpkgs-stable "x86_64-linux" "bolty";
vpsfree1 = mkServer nixpkgs-stable "x86_64-linux" "vpsfree1";
yoga = mkKiosk nixpkgs-stable "x86_64-linux" "yoga";
homescreen = mkRaspi nixpkgs-stable "homescreen";
bootstrap = nixpkgs-stable.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [(./. + "/nixos/boxes/bootstrap") sops.nixosModules.sops];
specialArgs = {
inherit inputs system;
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = {allowUnfree = true;};
};
}; };
}; };
# nix build .#nixosConfigurations.raspiimage.config.system.build.sdImage
# sudo dd if=result/sd-image/nixos-sd-image-21.11.20211201.a640d83-aarch64-linux.img of=/dev/sda bs=4M conv=fsync status=progress
# make sure to update eeprom https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi_4#Board-specific_installation_notes
raspiimage = nixpkgs-stable.lib.nixosSystem {
system = "aarch64-linux";
modules = [
(import
"${inputs.nixpkgs-nixos-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix")
{
environment.systemPackages = with nixpkgs-nixos-unstable.legacyPackages."aarch64-linux"; [
neovim
htop
btop
atop
];
networking.networkmanager.enable = false; nixosConfigurations = {
hardware.enableRedistributableFirmware = true; foureighty = mkWorkstation nixpkgs-stable "x86_64-linux" "foureighty";
networking.wireless.enable = true; skinnyv = mkWorkstation nixpkgs-stable "x86_64-linux" "skinnyv";
thinky = mkWorkstation nixpkgs-stable "x86_64-linux" "thinky";
bolty = mkServer nixpkgs-stable "x86_64-linux" "bolty";
vpsfree1 = mkServer nixpkgs-stable "x86_64-linux" "vpsfree1";
yoga = mkKiosk nixpkgs-stable "x86_64-linux" "yoga";
homescreen = mkRaspi nixpkgs-stable "homescreen";
services.openssh = { bootstrap = nixpkgs-stable.lib.nixosSystem rec {
enable = true; system = "x86_64-linux";
permitRootLogin = modules = [ (./. + "/nixos/boxes/bootstrap") sops.nixosModules.sops ];
nixpkgs-stable.lib.mkForce "prohibit-password"; specialArgs = {
passwordAuthentication = false; inherit inputs system;
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = { allowUnfree = true; };
}; };
};
};
# nix build .#nixosConfigurations.raspiimage.config.system.build.sdImage
# sudo dd if=result/sd-image/nixos-sd-image-21.11.20211201.a640d83-aarch64-linux.img of=/dev/sda bs=4M conv=fsync status=progress
# make sure to update eeprom https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi_4#Board-specific_installation_notes
raspiimage = nixpkgs-stable.lib.nixosSystem {
system = "aarch64-linux";
modules = [
(import
"${inputs.nixpkgs-nixos-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix")
{
environment.systemPackages =
with nixpkgs-nixos-unstable.legacyPackages."aarch64-linux"; [
neovim
htop
btop
atop
];
services.xserver = { networking.networkmanager.enable = false;
enable = true; hardware.enableRedistributableFirmware = true;
displayManager.lightdm.enable = true; networking.wireless.enable = true;
desktopManager.gnome.enable = true;
libinput.enable = true;
};
users.extraUsers.root.openssh.authorizedKeys.keys = [ services.openssh = {
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEo4R+6J3h6Ix3xWpOMdU7Es1/YxFchHw0c+kcCOJxFb cyryl@foureighty" enable = true;
]; permitRootLogin =
sdImage.compressImage = false; nixpkgs-stable.lib.mkForce "prohibit-password";
console.earlySetup = true; passwordAuthentication = false;
} };
];
specialArgs = {inherit inputs;}; services.xserver = {
enable = true;
displayManager.lightdm.enable = true;
desktopManager.gnome.enable = true;
libinput.enable = true;
};
users.extraUsers.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEo4R+6J3h6Ix3xWpOMdU7Es1/YxFchHw0c+kcCOJxFb cyryl@foureighty"
];
sdImage.compressImage = false;
console.earlySetup = true;
}
];
specialArgs = { inherit inputs; };
};
}; };
}; };
};
inputs = { inputs = {
nixpkgs-master = { nixpkgs-master = {
type = "github"; type = "github";
@ -221,6 +212,13 @@
ref = "nixos-22.11"; ref = "nixos-22.11";
}; };
nixpkgs-rust-analyzer = {
type = "github";
owner = "cyplo";
repo = "nixpkgs";
ref = "85b5540187b50ef99a14a39a5437fd0abb9f3e4b";
};
nixos-hardware = { nixos-hardware = {
type = "github"; type = "github";
owner = "NixOS"; owner = "NixOS";

View file

@ -1,11 +1,11 @@
{ config, pkgs, ... }: { { config, pkgs, inputs, ... }: {
home.packages = with pkgs; home.packages = with pkgs;
[ [
(vscode-with-extensions.override { (vscode-with-extensions.override {
vscodeExtensions = with vscode-extensions; vscodeExtensions = with vscode-extensions;
[ [
ms-python.python ms-python.python
rust-lang.rust-analyzer inputs.nixpkgs-rust-analyzer.legacyPackages.x86_64-linux.vscode-extensions.rust-lang.rust-analyzer
(vscode-utils.buildVscodeExtension { (vscode-utils.buildVscodeExtension {
vscodeExtUniqueId = "vadimcn.vscode-lldb"; vscodeExtUniqueId = "vadimcn.vscode-lldb";
name = "vadimcn.vscode-lldb-1.6.10"; name = "vadimcn.vscode-lldb-1.6.10";