refactor
This commit is contained in:
parent
de4de77a87
commit
b4cf61bc23
25 changed files with 287 additions and 100 deletions
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -111,11 +111,11 @@
|
|||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1741916615,
|
||||
"narHash": "sha256-SU6Q/IBGJ9a7u6WrVjZ+ShoIjK3To/lD3U37DgfX1Tw=",
|
||||
"lastModified": 1742089599,
|
||||
"narHash": "sha256-1yBAFE5yEGEjSWZ8BuPt9Yknq+cFwzW6Q86gs5rMkGI=",
|
||||
"owner": "fufexan",
|
||||
"repo": "nix-gaming",
|
||||
"rev": "b2a32ef80ad0cc7f3dee928771791625ff9494c1",
|
||||
"rev": "bbf6f68ec16cead3c29d5ba33d5c52956dfaefdf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -126,11 +126,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1741310760,
|
||||
"narHash": "sha256-aizILFrPgq/W53Jw8i0a1h1GZAAKtlYOrG/A5r46gVM=",
|
||||
"lastModified": 1741865919,
|
||||
"narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "de0fe301211c267807afd11b12613f5511ff7433",
|
||||
"rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -180,11 +180,11 @@
|
|||
"nuschtosSearch": "nuschtosSearch"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1741709061,
|
||||
"narHash": "sha256-G1YTksB0CnVhpU1gEmvO3ugPS5CAmUpm5UtTIUIPnEI=",
|
||||
"lastModified": 1741814789,
|
||||
"narHash": "sha256-NbHsnnNwiYUcUaS4z8XK2tYpo3G8NXEKxaKkzMgMiLk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "3a3abf11700f76738d8ad9d15054ceaf182d2974",
|
||||
"rev": "33097dcf776d1fad0ff3842096c4e3546312f251",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -21,14 +21,7 @@
|
|||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
};
|
||||
};
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
lib = nixpkgs.lib;
|
||||
in {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,52 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./modules/cava.nix
|
||||
./modules/dunst.nix
|
||||
./modules/fish.nix
|
||||
./modules/ghostty.nix
|
||||
./modules/i3.nix
|
||||
./modules/lazygit.nix
|
||||
./modules/nvim.nix
|
||||
./modules/picom.nix
|
||||
./modules/polybar.nix
|
||||
./modules/rofi.nix
|
||||
./modules/starship.nix
|
||||
./modules/systemd.nix
|
||||
./modules/zellij.nix
|
||||
];
|
||||
|
||||
home.username = "cobray";
|
||||
home.homeDirectory = "/home/cobray";
|
||||
home.enableNixpkgsReleaseCheck = false;
|
||||
programs.home-manager.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
];
|
||||
home.stateVersion = "24.11";
|
||||
programs.home-manager.enable = true;
|
||||
home.enableNixpkgsReleaseCheck = false;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
coreutils
|
||||
gnused
|
||||
gnugrep
|
||||
findutils
|
||||
htop
|
||||
btop
|
||||
nvtop
|
||||
arandr
|
||||
nitrogen
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"user-dirs.dirs".source = lib.mkIf (builtins.pathExists "${config.home.homeDirectory}/.config/user-dirs.dirs")
|
||||
(config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/user-dirs.dirs");
|
||||
"user-dirs.locale".source = lib.mkIf (builtins.pathExists "${config.home.homeDirectory}/.config/user-dirs.locale")
|
||||
(config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/user-dirs.locale");
|
||||
"mimeapps.list".source = lib.mkIf (builtins.pathExists "${config.home.homeDirectory}/.config/mimeapps.list")
|
||||
(config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/mimeapps.list");
|
||||
"systemd".source = lib.mkIf (builtins.pathExists "${config.home.homeDirectory}/.config/systemd")
|
||||
(config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/systemd");
|
||||
"systemd".recursive = true;
|
||||
"environment.d".source = lib.mkIf (builtins.pathExists "${config.home.homeDirectory}/.config/environment.d")
|
||||
(config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/environment.d");
|
||||
"environment.d".recursive = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
14
home-manager/modules/cava.nix
Normal file
14
home-manager/modules/cava.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
cava
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"cava" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/cava";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
13
home-manager/modules/dunst.nix
Normal file
13
home-manager/modules/dunst.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
dunst
|
||||
];
|
||||
xdg.configFile = {
|
||||
"dunst" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/dunst";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
33
home-manager/modules/fish.nix
Normal file
33
home-manager/modules/fish.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile = {
|
||||
"fish/config.fish".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/fish/config.fish";
|
||||
"fish/fish_plugins".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/fish/fish_plugins";
|
||||
"fish/fish_variables".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/fish/fish_variables";
|
||||
"fish/themes" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/fish/themes";
|
||||
recursive = true;
|
||||
};
|
||||
"fish/functions" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/fish/functions";
|
||||
recursive = true;
|
||||
};
|
||||
"fish/completions" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/fish/completions";
|
||||
recursive = true;
|
||||
};
|
||||
"fish/conf.d" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/fish/conf.d";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
starship
|
||||
fzf
|
||||
bat
|
||||
eza
|
||||
fd
|
||||
ripgrep
|
||||
];
|
||||
}
|
||||
10
home-manager/modules/ghostty.nix
Normal file
10
home-manager/modules/ghostty.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile = {
|
||||
"ghostty" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/ghostty";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
18
home-manager/modules/i3.nix
Normal file
18
home-manager/modules/i3.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
dmenu
|
||||
i3status
|
||||
i3lock
|
||||
i3blocks
|
||||
feh
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"i3" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/i3";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
14
home-manager/modules/lazygit.nix
Normal file
14
home-manager/modules/lazygit.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
lazygit
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"lazygit" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/lazygit";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
home-manager/modules/nvim.nix
Normal file
19
home-manager/modules/nvim.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
neovim
|
||||
ripgrep
|
||||
fd
|
||||
nodejs
|
||||
gcc
|
||||
];
|
||||
|
||||
xdg.configFile."nvim" = {
|
||||
source = builtins.fetchGit {
|
||||
url = "https://github.com/alsaiduq-lab/dotfiles.git";
|
||||
ref = "dev";
|
||||
}
|
||||
recursive = true;
|
||||
};
|
||||
}
|
||||
14
home-manager/modules/picom.nix
Normal file
14
home-manager/modules/picom.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
picom
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"picom" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/picom";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
14
home-manager/modules/polybar.nix
Normal file
14
home-manager/modules/polybar.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
polybar
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"polybar" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/polybar";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
14
home-manager/modules/rofi.nix
Normal file
14
home-manager/modules/rofi.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
rofi
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"rofi" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/rofi";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
8
home-manager/modules/starship.nix
Normal file
8
home-manager/modules/starship.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
starship
|
||||
];
|
||||
xdg.configFile."starship.toml".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/starship.toml";
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
];
|
||||
|
||||
systemd.services.autossh-redbot = {
|
||||
description = "Persistent SSH Tunnel to Cloud Server";
|
||||
description = "Persistent SSH Tunnel to server";
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
14
home-manager/modules/zellij.nix
Normal file
14
home-manager/modules/zellij.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
zellij
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"zellij" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/zellij";
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -12,7 +12,6 @@
|
|||
../modules/default.nix
|
||||
];
|
||||
|
||||
networking.hostName = "nixos";
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
|
|
|
|||
|
|
@ -1,26 +1,7 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
python-rembg = pkgs.python310.pkgs.buildPythonPackage rec {
|
||||
pname = "rembg";
|
||||
version = "2.0.50";
|
||||
src = pkgs.python310.pkgs.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0dgq291bj4w6jkcyz7lvp1vba2nczfnmxa2acl2sqib5p8cpzjvc";
|
||||
};
|
||||
propagatedBuildInputs = with pkgs.python310.pkgs; [
|
||||
numpy
|
||||
pillow
|
||||
onnxruntime
|
||||
opencv4
|
||||
requests
|
||||
];
|
||||
doCheck = false;
|
||||
meta = with lib; {
|
||||
description = "Tool to remove images background";
|
||||
homepage = "https://github.com/danielgatis/rembg";
|
||||
license = licenses.mit;
|
||||
};
|
||||
};
|
||||
customPkgs = import ../pkgs { inherit pkgs lib; };
|
||||
in
|
||||
{
|
||||
# List packages installed in system profile. To search, run:
|
||||
|
|
@ -73,51 +54,15 @@ in
|
|||
matplotlib
|
||||
scipy
|
||||
requests
|
||||
psutil
|
||||
click
|
||||
typer
|
||||
rich
|
||||
pyyaml
|
||||
jq
|
||||
pytz
|
||||
onnxruntime
|
||||
opencv4
|
||||
pillow
|
||||
python-rembg # custom rembg package
|
||||
]))
|
||||
# ML-oriented
|
||||
(python311.withPackages (ps: with ps; [
|
||||
virtualenv
|
||||
ipython
|
||||
jupyter
|
||||
jupyterlab
|
||||
numpy
|
||||
pandas
|
||||
matplotlib
|
||||
scipy
|
||||
scikit-learn
|
||||
seaborn
|
||||
plotly
|
||||
pytorch-bin
|
||||
torchvision-bin
|
||||
torchaudio-bin
|
||||
tensorboard
|
||||
transformers
|
||||
huggingface-hub
|
||||
datasets
|
||||
nltk
|
||||
spacy
|
||||
pillow
|
||||
opencv4
|
||||
xgboost
|
||||
lightgbm
|
||||
optuna
|
||||
joblib
|
||||
requests
|
||||
streamlit
|
||||
gradio
|
||||
polars
|
||||
duckdb
|
||||
customPkgs.python-rembg
|
||||
]))
|
||||
uv
|
||||
ruff
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
./steam.nix
|
||||
./timezone.nix
|
||||
./user.nix
|
||||
./systemd.nix
|
||||
./man.nix
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
environment.variables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
TERM = "xterm-256color";
|
||||
TERM = "ghostty";
|
||||
GTK_THEME = "Adwaita:dark";
|
||||
CC = "${pkgs.gcc}/bin/gcc";
|
||||
PKG_CONFIG_PATH = lib.makeSearchPath "lib/pkgconfig" [
|
||||
|
|
|
|||
|
|
@ -15,5 +15,4 @@ in
|
|||
fd
|
||||
ripgrep
|
||||
];
|
||||
users.users.cobray.shell = lib.mkForce fish-rust;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{
|
||||
networking.wireless.enable = false; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
networking.hostName = "nixos";
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
|
|
|||
|
|
@ -2,21 +2,6 @@
|
|||
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Fix Python package issues
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
python310Packages = prev.python310Packages.override {
|
||||
overrides = pyFinal: pyPrev: {
|
||||
terminado = pyPrev.terminado.overrideAttrs (old: {
|
||||
doCheck = false;
|
||||
doInstallCheck = false;
|
||||
});
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
programs.nix-index.enable = true;
|
||||
programs.command-not-found.enable = false;
|
||||
nix.settings = {
|
||||
|
|
|
|||
11
pkgs/default.nix
Normal file
11
pkgs/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib }:
|
||||
|
||||
{
|
||||
fish-rust = pkgs.callPackage ./fish-rust {};
|
||||
pythonPackages = {
|
||||
rembg = pkgs.callPackage ./python-packages/rembg.nix {
|
||||
inherit (pkgs) lib stdenv fetchFromGitHub fetchPypi python310;
|
||||
inherit (pkgs.python310.pkgs) numpy pillow opencv4 requests onnxruntime;
|
||||
};
|
||||
};
|
||||
}
|
||||
30
pkgs/python-rembg/default.nix
Normal file
30
pkgs/python-rembg/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, stdenv, fetchFromGitHub, fetchPypi, python310, numpy, pillow, opencv4, requests, onnxruntime }:
|
||||
|
||||
python310.pkgs.buildPythonPackage rec {
|
||||
pname = "rembg";
|
||||
version = "2.0.50";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0dgq291bj4w6jkcyz7lvp1vba2nczfnmxa2acl2sqib5p8cpzjvc";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python310.pkgs; [
|
||||
numpy
|
||||
pillow
|
||||
onnxruntime
|
||||
opencv4
|
||||
requests
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Tool to remove images background";
|
||||
homepage = "https://github.com/danielgatis/rembg";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
maintainers = [Cobray];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue