add rust support to config

This commit is contained in:
Schrottkatze 2024-04-16 21:37:01 +02:00
parent 5c2deec279
commit 52a6173f0b
Signed by: schrottkatze
SSH key fingerprint: SHA256:hXb3t1vINBFCiDCmhRABHX5ocdbLiKyCdKI4HK2Rbbc
7 changed files with 126 additions and 30 deletions

View file

@ -21,6 +21,7 @@
karton.url = "git+https://gitlab.com/obsidianical/microbin.git";
arion.url = "github:hercules-ci/arion";
gumseite.url = "git+https://gitlab.com/schrottkatze/gum-schulsachen.git";
fenix.url = "github:nix-community/fenix";
};
outputs = {
@ -31,10 +32,30 @@
home-manager,
nixos-hardware,
mac-brcm-fw,
fenix,
...
} @ inputs: let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
pkgs-unstable-small = nixpkgs-unstable-small.legacyPackages."x86_64-linux";
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pkgs-stable = nixpkgs-stable.legacyPackages.${system};
pkgs-unstable-small = nixpkgs-unstable-small.legacyPackages.${system};
rs-toolchain = with fenix.packages.${system};
combine [
default.toolchain
rust-analyzer
];
rs-platform = pkgs.makeRustPlatform {
cargo = rs-toolchain;
rustc = rs-toolchain;
};
rs-programs = final: prev: {
s10e-jrnl = rs-platform.buildRustPackage {
pname = "jrnl";
version = "0.0.1";
src = ./programs/jrnl;
cargoLock.lockFile = ./programs/jrnl/Cargo.lock;
};
};
in {
devShells."x86_64-linux".default = pkgs.mkShell {
buildInputs = [
@ -46,13 +67,14 @@
xmobar
statgrab
]))
rs-toolchain
pkgs.haskell-language-server
];
};
nixosConfigurations = {
monosodium-glutamate-g = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs pkgs-unstable-small;
inherit inputs pkgs-unstable-small pkgs-stable rs-programs;
};
system = "x86_64-linux";
modules = [
@ -74,7 +96,7 @@
};
catbook-j = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs pkgs-unstable-small;
inherit inputs pkgs-unstable-small pkgs-stable rs-programs;
};
system = "x86_64-linux";
modules = [
@ -96,7 +118,7 @@
};
potatobook-g = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs pkgs-unstable-small;
inherit inputs pkgs-unstable-small rs-programs;
};
system = "x86_64-linux";
modules = [