Add various tweaks & fixes

- Add standalone home-manager conf usable outside nixos
- Fix HID devices being suspended by powertop
- Fix emacs font config & add deps for vterm module compilation
- Fix Network setup with per-device gateway
- Replace onetab with foss alternative (Tab Stash)
- Improve README.md
This commit is contained in:
Tristan D. 2023-09-19 05:43:42 +02:00 committed by Tristan Druyen
parent ab7249df82
commit e66122aa4c
Signed by: tristan
SSH key fingerprint: SHA256:U7y6eMb7CQDaTHv9XoX6/BaQnPqyxxKc+Xnfcefi6rY
6 changed files with 401 additions and 346 deletions

View file

@ -1,5 +1,11 @@
# My nix conf
## 🏠 Home Setup
```bash
nix run home-manager/release-23.05 -- switch --flake .
```
## 🏗️ System Setup
### 👷 "Manual"
@ -32,6 +38,12 @@ nix flake update
sudo nixos-rebuild --flake .#nixos-pulse switch
```
Run this to keep your home up-to-date.
```bash
nix flake update
home-manager switch --flake .
```
## 🙏 Made possible by
- NixOS: https://nixos.org/

View file

@ -15,10 +15,12 @@
};
fonts.fonts = with pkgs; [
emacs-all-the-icons-fonts
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
@ -145,6 +147,13 @@
virtualisation.libvirtd.enable = true;
powerManagement.powertop.enable = true;
systemd.services.powertop.postStart = ''
HIDDEVICES=$(ls /sys/bus/usb/drivers/usbhid | grep -oE '^[0-9]+-[0-9\.]+' | sort -u)
for i in $HIDDEVICES; do
echo -n "Enabling " | cat - /sys/bus/usb/devices/$i/product
echo 'on' > /sys/bus/usb/devices/$i/power/control
done
'';
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions

View file

@ -34,33 +34,53 @@
emacs-overlay,
disko,
nur,
}: {
}: let
system = "x86_64-linux";
customPkgs = import nixpkgs {
system = "${system}";
overlays = [emacs-overlay.overlay];
config = {
allowUnfree = true;
};
};
pkgs = nixpkgs.legacyPackages.${system};
in {
formatter = {
x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
diskoConfigurations = {
nixos-pulse = import ./disko.nix;
};
nixosConfigurations = let
customPkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [emacs-overlay.overlay];
config = {
allowUnfree = true;
homeConfigurations = {
"tristand" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
nur.hmModules.nur
{
_module.args.customPkgs = customPkgs;
# inherit customPkgs;
# pkgs.pkgs = customPkgs;
# home-manager.useUserPackages = true;
# home-manager.useGlobalPkgs = true;
}
];
};
};
in {
nixosConfigurations = {
nixos-pulse = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
./home.nix
./users.nix
./disko.nix
disko.nixosModules.disko
home-manager.nixosModules.home-manager
tuxedo-nixos.nixosModules.default
nur.nixosModules.nur
{
_module.args.customPkgs = customPkgs;
nixpkgs.pkgs = customPkgs;
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;

View file

@ -37,19 +37,21 @@
prefixLength = 24;
}
];
ipv4.routes = [
{
address = "192.168.0.0";
prefixLength = 24;
}
{
address = "0.0.0.0";
prefixLength = 0;
via = "192.168.0.5";
}
];
};
};
# TODO delete if network specific gateway is validated to work
# defaultGateway = {
# address = "192.168.0.5";
# interface = "enp5s0f4u1u1c2";
# };
};
# TODO validate his works
systemd.network.networks.enp5s0f4u1u1c2.gateway = "192.168.0.5";
# This manually configures the automatically created network-adresses service to be more flexible
# regarding booting without the the device being available on boot
# It prevents slow timeouts & errors on boot while preserving Plug & Play ability

View file

@ -1,24 +1,9 @@
{
pkgs,
customPkgs,
config,
...
}: {
fonts.fonts = [pkgs.emacs-all-the-icons-fonts];
users.users.tristand = {
isNormalUser = true;
description = "Tristan Druyen";
extraGroups = ["networkmanager" "wheel" "libvirtd"];
shell = pkgs.fish;
home = "/home/tristand";
hashedPassword = "$6$Wj.XY8JgH5EWuog4$HnbtPJXDEqKXFrzkPVEjih3PytcpBCrkfL7TAwkXd0IFced7kGMlZNliNsAqQ3XqfyUzAYiiKTIqoPVJEk.s..";
};
home-manager.users.tristand = {pkgs, ...}: {
nix = {
settings.experimental-features = ["nix-command" "flakes"];
};
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
@ -40,7 +25,7 @@
services.emacs = {
enable = true;
defaultEditor = true;
package = pkgs.emacs-unstable-pgtk;
package = customPkgs.emacs-unstable-pgtk;
};
programs.fish = {
@ -50,6 +35,7 @@
ec = "emacsclient $argv";
ecc = "emacsclient -c $argv";
ecr = "emacsclient -r $argv";
ecrr = "emacsclient -r $argv";
};
};
@ -96,18 +82,17 @@
};
extensions = with config.nur.repos.rycee.firefox-addons; [
betterttv
bitwarden
clearurls
consent-o-matic
darkreader
localcdn
onetab
plasma-integration
privacy-badger
rust-search-extension
skip-redirect
sponsorblock
tab-stash
ublock-origin
unpaywall
];
@ -305,6 +290,9 @@
enableSshSupport = true;
};
home.username = "tristand";
home.homeDirectory = "/home/tristand";
home.packages = with pkgs; [
alejandra
atool
@ -319,7 +307,8 @@
brave
btop
direnv
emacs-unstable-pgtk
cmake
customPkgs.emacs-unstable-pgtk
firefox
jellyfin-media-player
neofetch
@ -330,6 +319,9 @@
rust-motd
(ripgrep.override {withPCRE2 = true;})
gnutls
gnumake
gcc
libtool
fd
imagemagick
pinentry-emacs
@ -351,5 +343,4 @@
};
home.stateVersion = "23.05";
};
}

21
users.nix Normal file
View file

@ -0,0 +1,21 @@
{
pkgs,
config,
customPkgs,
...
}: {
users.users.tristand = {
isNormalUser = true;
description = "Tristan Druyen";
extraGroups = ["networkmanager" "wheel" "libvirtd"];
shell = pkgs.fish;
home = "/home/tristand";
hashedPassword = "$6$Wj.XY8JgH5EWuog4$HnbtPJXDEqKXFrzkPVEjih3PytcpBCrkfL7TAwkXd0IFced7kGMlZNliNsAqQ3XqfyUzAYiiKTIqoPVJEk.s..";
};
home-manager.users.tristand = import ./home.nix {
inherit pkgs;
inherit config;
inherit customPkgs;
};
}