initial rust-shell setup

This commit is contained in:
Christoph Hollizeck 2024-08-26 21:20:15 +02:00
parent 29fb05bd92
commit b70c9851a9
Signed by: Daholli
GPG key ID: 1763BB530F50279E
7 changed files with 94 additions and 55 deletions

61
flake.lock generated
View file

@ -1,5 +1,26 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1724221791,
"narHash": "sha256-mKX67QPnUybOopVph/LhOV1G/H4EvPxDIfSmbufrVdA=",
"owner": "nix-community",
"repo": "fenix",
"rev": "e88b38a5a3834e039d413a88f8150a75ef6453ef",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@ -437,29 +458,9 @@
"type": "github"
}
},
"pyfa": {
"inputs": {
"nixpkgs": [
"unstable"
]
},
"locked": {
"lastModified": 1716550164,
"narHash": "sha256-X7duLlJK2sCgXXZ1K2rN3WazbhMN7Ap50YIU1IU1hzs=",
"owner": "Daholli",
"repo": "Pyfa",
"rev": "cf7f4e2fe4b5fa6a21b6c10588e48334dfbc9f71",
"type": "github"
},
"original": {
"owner": "Daholli",
"ref": "nixos-support",
"repo": "Pyfa",
"type": "github"
}
},
"root": {
"inputs": {
"fenix": "fenix",
"gpg-base-conf": "gpg-base-conf",
"home-manager": "home-manager",
"kickstartnvim": "kickstartnvim",
@ -467,13 +468,29 @@
"nixos-hardware": "nixos-hardware",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_2",
"pyfa": "pyfa",
"snowfall-flake": "snowfall-flake",
"snowfall-lib": "snowfall-lib_2",
"sops-nix": "sops-nix",
"unstable": "unstable"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1724153119,
"narHash": "sha256-WxpvDJDttkINkXmUA/W5o11lwLPYhATAgu0QUAacZ2g=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "3723e5910c14f0ffbd13de474b8a8fcc74db04ce",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"snowfall-flake": {
"inputs": {
"flake-compat": "flake-compat_3",

View file

@ -12,11 +12,21 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:nixos/nixos-hardware";
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
# Run unpatched dynamically compiled binaries
nix-ld = {
url = "github:Mic92/nix-ld";
inputs.nixpkgs.follows = "unstable";
};
###
# Snowfall dependencies
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
@ -32,27 +42,22 @@
inputs.nixpkgs.follows = "nixpkgs";
};
# Hardware Configuration
nixos-hardware.url = "github:nixos/nixos-hardware";
# Run unpatched dynamically compiled binaries
nix-ld = {
url = "github:Mic92/nix-ld";
inputs.nixpkgs.follows = "unstable";
};
# GPG default configuration
gpg-base-conf = {
url = "github:drduh/config";
flake = false;
};
pyfa = {
url = "github:Daholli/Pyfa/nixos-support";
inputs.nixpkgs.follows = "unstable";
};
sops-nix.url = "github:Mic92/sops-nix";
################
## inputs for dev shells
# rust
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@ -90,8 +95,6 @@
sops-nix.nixosModules.sops
];
systems.hosts.wsl.modules = with inputs; [
nixos-wsl.nixosModules.default
];
systems.hosts.wsl.modules = with inputs; [ nixos-wsl.nixosModules.default ];
};
}

View file

@ -24,6 +24,9 @@ in
ripgrep
fzf
colorls
wslu
wsl-open
];
wyrdgard = {

View file

@ -52,11 +52,8 @@ in
config = {
environment.systemPackages = with pkgs; [ ];
programs.zsh = {
enable = true;
autosuggestions.enable = true;
histFile = "$XDG_CACHE_HOME/zsh.history";
};
programs.fish = enabled;
users.defaultUserShell = pkgs.fish;
wyrdgard.home = {
file = {
@ -80,8 +77,6 @@ in
home = "/home/${cfg.name}";
group = "users";
shell = pkgs.zsh;
# Arbitrary user ID to use for the user. Since I only
# have a single user on my machines this won't ever collide.
# However, if you add multiple users you'll need to change this

View file

@ -1,5 +1,3 @@
{ channels, ... }:
final: prev: {
inherit (channels.unstable) pobfrontend;
}
final: prev: { inherit (channels.unstable) pobfrontend; }

24
shells/rust/default.nix Normal file
View file

@ -0,0 +1,24 @@
{
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# You also have access to your flake's inputs.
inputs,
# The namespace used for your flake, defaulting to "internal" if not set.
namespace,
# All other arguments come from NixPkgs. You can use `pkgs` to pull shells or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs,
mkShell,
system,
...
}:
mkShell {
# Create your shell
nativeBuildInputs = [
inputs.fenix.packages.${system}.complete.toolchain
];
}

View file

@ -12,14 +12,13 @@ with lib.wyrdgard;
defaultUser = config.wyrdgard.user.name;
};
environment.systemPackages = with pkgs; [
git
wslu
wsl-open
];
wyrdgard = {
submodules.basics-wsl = enabled;
security = {
gpg = enabled;
sops = enabled;
};
};
system.stateVersion = "24.11";