mirror of
https://github.com/thilobillerbeck/dotfiles.git
synced 2025-05-28 18:04:18 +02:00
restructured config directory
This commit is contained in:
parent
0ea46ec3a4
commit
e615e06990
43 changed files with 583 additions and 0 deletions
home-manager/modules
142
home-manager/modules/machine.nix
Normal file
142
home-manager/modules/machine.nix
Normal file
|
@ -0,0 +1,142 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
{
|
||||
imports = [
|
||||
./../programs/alacritty.nix
|
||||
./../programs/bat.nix
|
||||
./../programs/beets.nix
|
||||
./../programs/command-not-found.nix
|
||||
./../programs/dircolors.nix
|
||||
./../programs/direnv.nix
|
||||
./../programs/fzf.nix
|
||||
./../programs/git.nix
|
||||
./../programs/htop.nix
|
||||
./../programs/neovim.nix
|
||||
./../programs/starship.nix
|
||||
./../programs/topgrade.nix
|
||||
./../programs/yt-dlp.nix
|
||||
./../programs/zsh.nix
|
||||
./../programs/go.nix
|
||||
./packages.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
machine = {
|
||||
username = mkOption {
|
||||
type = types.str;
|
||||
default = "thilo";
|
||||
description = "The username of the user";
|
||||
};
|
||||
isGeneric = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether the system is generic or not";
|
||||
};
|
||||
isGraphical = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether the system is graphical or not";
|
||||
};
|
||||
isGnome = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether the system is gnome or not";
|
||||
};
|
||||
noiseSuppression.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable noise suppression or not";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
news.display = "silent";
|
||||
targets.genericLinux.enable = config.machine.isGeneric;
|
||||
|
||||
home = {
|
||||
username = "${config.machine.username}";
|
||||
homeDirectory = "/home/${config.machine.username}";
|
||||
stateVersion = "22.11";
|
||||
file = {
|
||||
".config/nano/nanorc".text = ''
|
||||
set linenumbers
|
||||
include "/usr/share/nano/*.nanorc"
|
||||
'';
|
||||
".ssh/config".source = ./../dotfiles/ssh-config;
|
||||
".gitignore".source = ./../dotfiles/.gitignore;
|
||||
".config/pipewire/pipewire.conf.d/99-noise-suppression.conf".text = ''
|
||||
context.modules = [{
|
||||
name = libpipewire-module-filter-chain
|
||||
args = {
|
||||
node.description = "Noise Canceling source"
|
||||
media.name = "Noise Canceling source"
|
||||
filter.graph = {
|
||||
nodes = [{
|
||||
type = ladspa
|
||||
name = rnnoise
|
||||
plugin = ${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so
|
||||
label = noise_suppressor_stereo
|
||||
control = {
|
||||
"VAD Threshold (%)" 50.0
|
||||
"VAD Grace Period (ms)" 200
|
||||
"Retroactive VAD Grace (ms)" 0
|
||||
}
|
||||
}]
|
||||
}
|
||||
capture.props = {
|
||||
node.name = "capture.rnnoise_source"
|
||||
node.passive = true
|
||||
audio.rate = 48000
|
||||
}
|
||||
playback.props = {
|
||||
node.name = "rnnoise_source"
|
||||
media.class = Audio/Source
|
||||
audio.rate = 48000
|
||||
}
|
||||
}
|
||||
}]
|
||||
'';
|
||||
};
|
||||
activation = {
|
||||
setNodeGlobalDir = {
|
||||
after = [ "writeBoundary" "createXdgUserDirectories" ];
|
||||
before = [ ];
|
||||
data = ''
|
||||
mkdir -p ${config.home.homeDirectory}/.node-global
|
||||
${pkgs.nodejs}/bin/npm config set prefix ${config.home.homeDirectory}/.node-global
|
||||
'';
|
||||
};
|
||||
} // mkIf config.machine.isGeneric {
|
||||
linkDesktopApplications = {
|
||||
after = [ "writeBoundary" "createXdgUserDirectories" ];
|
||||
before = [ ];
|
||||
data = ''
|
||||
for dir in ${config.home.homeDirectory}/.nix-profile/share/applications/*; do
|
||||
chmod +x $(realpath $dir) -v
|
||||
done
|
||||
'';
|
||||
};
|
||||
};
|
||||
sessionPath = [ "${config.home.homeDirectory}/.node-global/bin" ];
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
nix = {
|
||||
package = mkDefault pkgs.nixUnstable;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = config.machine.isGnome;
|
||||
theme = {
|
||||
name = "adw-gtk3-dark";
|
||||
package = pkgs.adw-gtk3;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
113
home-manager/modules/packages.nix
Normal file
113
home-manager/modules/packages.nix
Normal file
|
@ -0,0 +1,113 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
config = {
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
quickemu = prev.quickemu.overrideAttrs (old: {
|
||||
patches = (old.patches or [ ]) ++ [
|
||||
./../patches/quickemu.patch
|
||||
];
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
up
|
||||
rbenv
|
||||
cargo-update
|
||||
htop
|
||||
rustup
|
||||
nixfmt
|
||||
nodejs
|
||||
bun
|
||||
deno
|
||||
devbox
|
||||
tldr
|
||||
flutter
|
||||
nurl
|
||||
hcloud
|
||||
tea
|
||||
dgraph
|
||||
nix-init
|
||||
nodePackages.nodemon
|
||||
pocketbase
|
||||
# surrealdb
|
||||
thefuck
|
||||
hub
|
||||
httpie
|
||||
manix
|
||||
(pkgs.writeShellScriptBin "ssh-fix-permissions"
|
||||
(builtins.readFile ./../scripts/ssh-fix-permissions.sh))
|
||||
(pkgs.writeShellScriptBin "yt-dlp-audio"
|
||||
(builtins.readFile ./../scripts/yt-dlp-audio.sh))
|
||||
(pkgs.writeShellScriptBin "nix-shell-init"
|
||||
(builtins.readFile ./../scripts/nix-shell-init.sh))
|
||||
(pkgs.writeShellScriptBin "http-server" ''
|
||||
${pkgs.caddy}/bin/caddy file-server --listen :2345
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "nix-build-default" ''
|
||||
nix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }'
|
||||
'')
|
||||
(callPackage ./../pkgs/docker-craft-cms-dev-env.nix {
|
||||
inherit lib;
|
||||
})
|
||||
(callPackage ./../pkgs/toggl-time-grouper/package.nix {
|
||||
inherit lib;
|
||||
})
|
||||
nixpkgs-fmt
|
||||
toolbox
|
||||
distrobox
|
||||
ddev
|
||||
act
|
||||
mkcert
|
||||
pulumi
|
||||
kubectl
|
||||
pulumiPackages.pulumi-language-nodejs
|
||||
ncdu
|
||||
] ++ (if config.machine.isGraphical then [
|
||||
(pkgs.nerdfonts.override {
|
||||
fonts = [ "JetBrainsMono" "FiraCode" "FiraMono" ];
|
||||
})
|
||||
# anki
|
||||
corefonts
|
||||
vistafonts
|
||||
jetbrains.webstorm
|
||||
element-desktop
|
||||
ludusavi
|
||||
dbeaver
|
||||
insomnia
|
||||
onlyoffice-bin
|
||||
spotify
|
||||
(lutris.override {
|
||||
extraLibraries = pkgs: [
|
||||
gnome3.adwaita-icon-theme
|
||||
];
|
||||
extraPkgs = pkgs: [
|
||||
wineWowPackages.full
|
||||
winetricks
|
||||
gnome3.adwaita-icon-theme
|
||||
];
|
||||
})
|
||||
bottles
|
||||
protontricks
|
||||
heroic
|
||||
google-chrome
|
||||
chromium
|
||||
vscode
|
||||
discord
|
||||
chromium
|
||||
quickemu
|
||||
quickgui
|
||||
trilium-desktop
|
||||
anki
|
||||
] else [ ]) ++ (if config.machine.isGnome then [
|
||||
gnomeExtensions.blur-my-shell
|
||||
gnomeExtensions.dash-to-panel
|
||||
gnomeExtensions.user-themes
|
||||
gnomeExtensions.vitals
|
||||
gnomeExtensions.custom-accent-colors
|
||||
] else [ ]);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue