mirror of
https://github.com/danbulant/dotfiles
synced 2026-05-19 04:18:55 +00:00
dev environment setup
This commit is contained in:
parent
122f159832
commit
483c40dfc4
5 changed files with 105 additions and 46 deletions
1
.default-python-packages
Normal file
1
.default-python-packages
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
pipx
|
||||||
|
|
@ -2,12 +2,17 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
unstable-pkgs = import <nixos-unstable> {};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[
|
||||||
|
<nixos-hardware/lenovo/legion/16ach6h/hybrid>
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
<home-manager/nixos>
|
<home-manager/nixos>
|
||||||
|
./cachix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
|
|
@ -15,6 +20,15 @@
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
boot.supportedFilesystems = [ "ntfs" ];
|
||||||
|
|
||||||
|
fileSystems."/media/New BTRFS" = {
|
||||||
|
device = "/dev/disk/by-uuid/26b1fa88-e270-45c7-a6c0-d46c9d4c6c90";
|
||||||
|
fsType = "btrfs";
|
||||||
|
};
|
||||||
|
fileSystems."/media/secondary" = {
|
||||||
|
device = "/dev/disk/by-uuid/050574C34881C3B9";
|
||||||
|
fsType = "ntfs";
|
||||||
|
};
|
||||||
|
|
||||||
networking.hostName = "lenovo-nix";
|
networking.hostName = "lenovo-nix";
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
@ -57,11 +71,15 @@
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
#jack.enable = true;
|
#jack.enable = true;
|
||||||
};
|
};
|
||||||
|
services.geoclue2.enable = true;
|
||||||
|
services.localtimed.enable = true;
|
||||||
|
time.hardwareClockInLocalTime = true;
|
||||||
|
|
||||||
users.users.dan = {
|
users.users.dan = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "John";
|
description = "John";
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
extraGroups = [ "networkmanager" "wheel" "docker" "fuse" ];
|
||||||
|
shell = pkgs.fish;
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
kdePackages.kate
|
kdePackages.kate
|
||||||
# thunderbird
|
# thunderbird
|
||||||
|
|
@ -75,9 +93,11 @@
|
||||||
|
|
||||||
programs.firefox.enable = true;
|
programs.firefox.enable = true;
|
||||||
programs.hyprland.enable = true;
|
programs.hyprland.enable = true;
|
||||||
|
programs.hyprland.package = unstable-pkgs.hyprland;
|
||||||
programs.hyprlock.enable = true;
|
programs.hyprlock.enable = true;
|
||||||
services.hypridle.enable = true;
|
services.hypridle.enable = true;
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
|
programs.nix-ld.enable = true; # Fix dynamic binaries from outside of nix
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.tailscale = {
|
services.tailscale = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -86,6 +106,7 @@
|
||||||
extraUpFlags = [ "--advertise-exit-node" ];
|
extraUpFlags = [ "--advertise-exit-node" ];
|
||||||
};
|
};
|
||||||
hardware.opentabletdriver.enable = true;
|
hardware.opentabletdriver.enable = true;
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|
@ -96,51 +117,18 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nixpkgs.config.cudaSupport = true;
|
||||||
|
|
||||||
# The nvidia fun part
|
# The nvidia fun part
|
||||||
hardware.opengl.enable = true;
|
hardware.opengl.enable = true;
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
|
||||||
|
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
prime = {
|
prime = {
|
||||||
# hardware specific, beware!
|
# hardware specific, beware!
|
||||||
amdgpuBusId = "PCI:01:00:0";
|
amdgpuBusId = lib.mkForce "PCI:01:00:0";
|
||||||
nvidiaBusId = "PCI:06:00:0";
|
nvidiaBusId = lib.mkForce "PCI:06:00:0";
|
||||||
|
|
||||||
offload = {
|
|
||||||
enable = true;
|
|
||||||
enableOffloadCmd = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# Modesetting is required.
|
|
||||||
modesetting.enable = true;
|
|
||||||
|
|
||||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
|
||||||
# Enable this if you have graphical corruption issues or application crashes after waking
|
|
||||||
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
|
||||||
# of just the bare essentials.
|
|
||||||
powerManagement.enable = false;
|
|
||||||
|
|
||||||
# Fine-grained power management. Turns off GPU when not in use.
|
|
||||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
|
||||||
powerManagement.finegrained = false;
|
|
||||||
|
|
||||||
# Use the NVidia open source kernel module (not to be confused with the
|
|
||||||
# independent third-party "nouveau" open source driver).
|
|
||||||
# Support is limited to the Turing and later architectures. Full list of
|
|
||||||
# supported GPUs is at:
|
|
||||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
|
||||||
# Only available from driver 515.43.04+
|
|
||||||
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
|
||||||
open = false;
|
|
||||||
|
|
||||||
# Enable the Nvidia settings menu,
|
|
||||||
# accessible via `nvidia-settings`.
|
|
||||||
nvidiaSettings = true;
|
|
||||||
|
|
||||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
||||||
};
|
|
||||||
|
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
||||||
|
|
@ -161,4 +149,6 @@
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "24.05"; # Did you read the comment?
|
system.stateVersion = "24.05"; # Did you read the comment?
|
||||||
|
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
75
home.nix
75
home.nix
|
|
@ -1,4 +1,8 @@
|
||||||
{ pkgs, ...}: {
|
{ pkgs, ...}:
|
||||||
|
let
|
||||||
|
unstable-pkgs = import <nixos-unstable> {};
|
||||||
|
in
|
||||||
|
{
|
||||||
home = {
|
home = {
|
||||||
stateVersion = "24.05";
|
stateVersion = "24.05";
|
||||||
|
|
||||||
|
|
@ -40,7 +44,19 @@
|
||||||
slurp
|
slurp
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
nextcloud-client
|
nextcloud-client
|
||||||
python3
|
kdePackages.partitionmanager
|
||||||
|
kdePackages.filelight
|
||||||
|
kdePackages.kate
|
||||||
|
xorg.xbacklight
|
||||||
|
cachix
|
||||||
|
playerctl
|
||||||
|
libcanberra-gtk3 # sound events
|
||||||
|
qt6ct
|
||||||
|
nil # nix language server
|
||||||
|
|
||||||
|
jq
|
||||||
|
htmlq
|
||||||
|
fzf
|
||||||
|
|
||||||
strace
|
strace
|
||||||
ghidra
|
ghidra
|
||||||
|
|
@ -57,6 +73,23 @@
|
||||||
feroxbuster
|
feroxbuster
|
||||||
python312Packages.pypykatz
|
python312Packages.pypykatz
|
||||||
screen
|
screen
|
||||||
|
|
||||||
|
(python312.withPackages (ps: with ps; [
|
||||||
|
pyquery
|
||||||
|
pygobject3
|
||||||
|
]))
|
||||||
|
pipx
|
||||||
|
gobject-introspection
|
||||||
|
|
||||||
|
unstable-pkgs.prisma-engines
|
||||||
|
openssl
|
||||||
|
gcc
|
||||||
|
# required by mise plugins
|
||||||
|
automake
|
||||||
|
autoconf
|
||||||
|
ncurses
|
||||||
|
pkg-config
|
||||||
|
gnumake
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
programs = {
|
programs = {
|
||||||
|
|
@ -65,8 +98,13 @@
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
set fish_greeting # Disable greeting
|
set fish_greeting # Disable greeting
|
||||||
'';
|
'';
|
||||||
shellInit = ''
|
shellInit = with unstable-pkgs; ''
|
||||||
source ~/.config/fish/config-old.fish
|
source ~/.config/fish/config-old.fish
|
||||||
|
|
||||||
|
set -x PRISMA_SCHEMA_ENGINE_BINARY "${prisma-engines}/bin/schema-engine"
|
||||||
|
set -x PRISMA_QUERY_ENGINE_BINARY "${prisma-engines}/bin/query-engine"
|
||||||
|
set -x PRISMA_QUERY_ENGINE_LIBRARY "${prisma-engines}/lib/libquery_engine.node"
|
||||||
|
set -x PRISMA_FMT_BINARY "${prisma-engines}/bin/prisma-fmt"
|
||||||
'';
|
'';
|
||||||
plugins = with pkgs.fishPlugins; [
|
plugins = with pkgs.fishPlugins; [
|
||||||
{ name = "grc"; src = grc.src; }
|
{ name = "grc"; src = grc.src; }
|
||||||
|
|
@ -88,8 +126,37 @@
|
||||||
bat.enable = true;
|
bat.enable = true;
|
||||||
lsd.enable = true;
|
lsd.enable = true;
|
||||||
fastfetch.enable = true;
|
fastfetch.enable = true;
|
||||||
mise.enable = true;
|
mise = {
|
||||||
|
enable = true;
|
||||||
|
globalConfig = {
|
||||||
|
tools = {
|
||||||
|
usage = "latest";
|
||||||
|
node = "latest";
|
||||||
|
python = "3";
|
||||||
|
terraform = "latest";
|
||||||
|
erlang = "latest";
|
||||||
|
gleam = "latest";
|
||||||
|
"pipx:pypykats" = "latest";
|
||||||
|
"pipx:pyquery" = "latest";
|
||||||
|
"pipx:pygobject" = "latest";
|
||||||
|
"npm:pnpm" = "latest";
|
||||||
|
};
|
||||||
|
plugins = {
|
||||||
|
gleam = "https://github.com/asdf-community/asdf-gleam.git";
|
||||||
|
};
|
||||||
|
env = {
|
||||||
|
MISE_NODE_COMPILE = "false";
|
||||||
|
MISE_PYTHON_COMPILE = "false";
|
||||||
|
MISE_NODE_COREPACK = "true";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
python_compile = false;
|
||||||
|
python_precompiled_os = "unknown-linux-musl";
|
||||||
|
};
|
||||||
|
};
|
||||||
direnv.enable = true;
|
direnv.enable = true;
|
||||||
|
direnv.nix-direnv.enable = true;
|
||||||
# firefox.enable = true;
|
# firefox.enable = true;
|
||||||
};
|
};
|
||||||
services.kdeconnect.enable = true;
|
services.kdeconnect.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
|
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
|
||||||
sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware
|
sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware
|
||||||
|
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
|
||||||
sudo nix-channel --update
|
sudo nix-channel --update
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
echo "Copying configurations"
|
echo "Copying configurations"
|
||||||
cp .config/* ~/.config/ -r
|
cp .config/* ~/.config/ -r
|
||||||
sudo cp configuration.nix /etc/nixos/configuration.nix
|
cp .default-python-packages ~
|
||||||
sudo cp home.nix /etc/nixos/home.nix
|
sudo cp *.nix /etc/nixos/
|
||||||
sudo nixos-rebuild switch
|
sudo nixos-rebuild switch
|
||||||
Loading…
Reference in a new issue